-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.go
52 lines (37 loc) · 797 Bytes
/
main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
package main
import (
"flag"
"fmt"
"github.com/pablouser1/GoListenMoe/helpers"
"github.com/pablouser1/GoListenMoe/socket"
"github.com/pablouser1/GoListenMoe/ui"
)
func main() {
fallback := flag.Bool("f", false, "Use fallback MP3")
player := flag.String("p", "native", "Player to use")
flag.Parse()
genreStr := "jpop"
if len(flag.Args()) > 0 {
genreStr = flag.Args()[0]
}
genre, err := helpers.GetGenreById(genreStr)
if err != nil {
fmt.Println(err)
return
}
action := make(chan uint8)
playing, err := socket.Start(genre.Socket)
if err != nil {
fmt.Println(err)
return
}
err = helpers.InitPlayer(*player, genre, *fallback, action)
if err != nil {
fmt.Println(err)
return
}
ui.Cli(playing, action)
// Cleanup
socket.Stop()
fmt.Println("Bye!")
}