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

View File

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