-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathmain.go
36 lines (29 loc) · 773 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
package main
import (
"embed"
"flag"
"io/fs"
"sync"
"github.com/sititou70/frums-credits-cli/csf"
"github.com/sititou70/frums-credits-cli/routines"
)
var (
skipSec = flag.Int("s", 0, "time to skip play (sec)")
verboseMode = flag.Bool("v", false, "print extra information")
)
//go:embed assets/csf-root
var csfFS embed.FS
var csfRootDirPath = "assets/csf-root"
func main() {
// parse options
flag.Parse()
// parse CSF(credits score format)
csfRootFS, _ := fs.Sub(csfFS, csfRootDirPath)
var csf = csf.NewCSF(csfRootFS)
// launch routines
var waitGroup sync.WaitGroup
waitGroup.Add(2)
go routines.PlayAudio(&waitGroup, csfRootFS, csf.Score.Meta.AudioFilePath, *skipSec)
go routines.DisplayScreen(&waitGroup, &csf, *verboseMode)
waitGroup.Wait()
}