-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmain.go
71 lines (59 loc) · 1.24 KB
/
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
package main
import (
"github.com/murlokswarm/app"
_ "github.com/murlokswarm/mac"
"log"
"mistlur/play"
"os"
"runtime"
)
var (
win app.Windower
playlist play.Playlist
)
func main() {
log.Println(os.Args)
runtime.GOMAXPROCS(1)
if len(os.Args) < 2 {
return
}
// Initialize FFT.
Init()
playlist = play.New()
playlist.Init(os.Args[1:])
go func() {
playlist.Start()
}()
app.OnLaunch = func() {
appMenu := &MenuBar{}
if menuBar, ok := app.MenuBar(); ok {
menuBar.Mount(appMenu)
}
win = newMainWindow()
win.Mount(&Player{})
}
app.OnReopen = func() {
if win != nil {
return
}
win = newMainWindow()
win.Mount(&Player{})
}
app.Run()
}
func newMainWindow() app.Windower {
return app.NewWindow(app.Window{
Title: "mistlur",
TitlebarHidden: true,
Width: 400,
Height: 70,
Vibrancy: app.VibeDark,
CloseHidden: true,
MinimizeHidden: true,
FixedSize: true,
OnClose: func() bool {
win = nil
return true
},
})
}