Making r (Renderer) Global RENDERER

This commit is contained in:
aditya-K2
2021-12-22 17:54:14 +05:30
parent 7bb59ef102
commit d1306f194f
3 changed files with 12 additions and 11 deletions
+5 -4
View File
@@ -18,6 +18,7 @@ var (
CONN *mpd.Client
UI *Application
NOTIFICATION_SERVER *NotificationServer
RENDERER *Renderer
Volume int64
Random bool
Repeat bool
@@ -36,15 +37,15 @@ func main() {
}
defer CONN.Close()
cache.SetCacheDir(viper.GetString("CACHE_DIR"))
r := newRenderer()
RENDERER = newRenderer()
c, _ := CONN.CurrentSong()
if len(c) != 0 {
r.Start(c["file"])
RENDERER.Start(c["file"])
} else {
r.Start("stop")
RENDERER.Start("stop")
}
UI = newApplication(r)
UI = newApplication()
fileMap, err := CONN.GetFiles()
dirTree := generateDirectoryTree(fileMap)