moving notification to notification package inside ui

This commit is contained in:
aditya-K2 2021-12-23 00:16:07 +05:30
parent 33603e1450
commit b587f5acfd
2 changed files with 8 additions and 6 deletions

View File

@ -1,6 +1,7 @@
package main package main
import ( import (
"github.com/aditya-K2/gomp/ui/notify"
"strconv" "strconv"
"time" "time"
@ -21,7 +22,7 @@ import (
var ( var (
CONN *mpd.Client CONN *mpd.Client
UI *ui.Application UI *ui.Application
Notify *ui.NotificationServer Notify *notify.NotificationServer
RENDERER *render.Renderer RENDERER *render.Renderer
Volume int64 Volume int64
Random bool Random bool
@ -56,7 +57,7 @@ func main() {
} }
UI = ui.NewApplication() UI = ui.NewApplication()
ui.ConnectUI(UI) notify.ConnectUI(UI)
fileMap, err := CONN.GetFiles() fileMap, err := CONN.GetFiles()
dirTree := client.GenerateDirectoryTree(fileMap) dirTree := client.GenerateDirectoryTree(fileMap)
@ -70,7 +71,7 @@ func main() {
ArtistTree, err = client.GenerateArtistTree() ArtistTree, err = client.GenerateArtistTree()
ArtistTreeContent := utils.ConvertToArray(ArtistTree) ArtistTreeContent := utils.ConvertToArray(ArtistTree)
Notify = ui.NewNotificationServer() Notify = notify.NewNotificationServer()
Notify.Start() Notify.Start()
client.SetNotificationServer(Notify) client.SetNotificationServer(Notify)
render.SetNotificationServer(Notify) render.SetNotificationServer(Notify)

View File

@ -1,6 +1,7 @@
package ui package notify
import ( import (
"github.com/aditya-K2/gomp/ui"
"time" "time"
"github.com/aditya-K2/gomp/utils" "github.com/aditya-K2/gomp/utils"
@ -10,10 +11,10 @@ import (
) )
var ( var (
UI *Application UI *ui.Application
) )
func ConnectUI(a *Application) { func ConnectUI(a *ui.Application) {
UI = a UI = a
} }