From eca4cc47f9eb0e47cfc7ebf6fa240aec81ee2b87 Mon Sep 17 00:00:00 2001 From: aditya-K2 Date: Sun, 14 Nov 2021 12:02:36 +0530 Subject: [PATCH] Rename notificationServer -> NOTIFICATION_SERVER making notificationServer global as other services might need access to it. --- main.go | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/main.go b/main.go index 05a0aee..c901269 100644 --- a/main.go +++ b/main.go @@ -12,6 +12,7 @@ import ( var CONN *mpd.Client var UI *Application +var NOTIFICATION_SERVER *NotificationServer var Volume int64 var Random bool var Repeat bool @@ -56,8 +57,8 @@ func main() { return UI.ExpandedView.GetInnerRect() }) - notificationServer := NewNotificationServer() - notificationServer.Start() + NOTIFICATION_SERVER = NewNotificationServer() + NOTIFICATION_SERVER.Start() var FUNC_MAP = map[string]func(){ "showChildrenContent": func() { @@ -93,7 +94,7 @@ func main() { if InsidePlaylist { UpdatePlaylist(UI.ExpandedView) } - notificationServer.Send("PlayList Cleared") + NOTIFICATION_SERVER.Send("PlayList Cleared") }, "previousSong": func() { CONN.Previous() @@ -151,14 +152,14 @@ func main() { }, "stop": func() { CONN.Stop() - notificationServer.Send("Playback Stopped") + NOTIFICATION_SERVER.Send("Playback Stopped") }, "updateDB": func() { _, err = CONN.Update("") if err != nil { panic(err) } - notificationServer.Send("Database Updated") + NOTIFICATION_SERVER.Send("Database Updated") }, "deleteSongFromPlaylist": func() { if InsidePlaylist {