moving notification to notification package inside ui
This commit is contained in:
		
							parent
							
								
									33603e1450
								
							
						
					
					
						commit
						b587f5acfd
					
				
							
								
								
									
										7
									
								
								main.go
									
									
									
									
									
								
							
							
						
						
									
										7
									
								
								main.go
									
									
									
									
									
								
							@ -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)
 | 
			
		||||
 | 
			
		||||
@ -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
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user