aboutsummaryrefslogtreecommitdiff
path: root/src/app.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/app.go')
-rw-r--r--src/app.go16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/app.go b/src/app.go
index 029644c..3a02dbe 100644
--- a/src/app.go
+++ b/src/app.go
@@ -19,10 +19,13 @@ type app struct {
19 footer *tview.TextView 19 footer *tview.TextView
20 cfg *Config 20 cfg *Config
21 21
22 // Artists panel 22 // Artists page
23 artistsTree *tview.TreeView 23 artistsTree *tview.TreeView
24 songsList *tview.List 24 songsList *tview.List
25 25
26 // Play queue page
27 playQueueList *tview.List
28
26 // Subsonic variables 29 // Subsonic variables
27 sub *subsonic.Client 30 sub *subsonic.Client
28 playQueue *music.Queue 31 playQueue *music.Queue
@@ -42,6 +45,7 @@ func Run(cfg *Config) {
42 a.pages.SetBorder(true) 45 a.pages.SetBorder(true)
43 a.pages.AddPage("config", a.configPage(), true, false) 46 a.pages.AddPage("config", a.configPage(), true, false)
44 a.pages.AddPage("artists", a.artistsPage(), true, false) 47 a.pages.AddPage("artists", a.artistsPage(), true, false)
48 a.pages.AddPage("playqueue", a.queuePage(), true, false)
45 49
46 mainLayout := tview.NewFlex(). 50 mainLayout := tview.NewFlex().
47 SetDirection(tview.FlexRow). 51 SetDirection(tview.FlexRow).
@@ -69,9 +73,12 @@ func Run(cfg *Config) {
69 a.switchToPage("artists") 73 a.switchToPage("artists")
70 return nil 74 return nil
71 case tcell.KeyF2: 75 case tcell.KeyF2:
72 a.switchToPage("playlists") 76 a.switchToPage("playqueue")
73 return nil 77 return nil
74 case tcell.KeyF3: 78 case tcell.KeyF3:
79 a.switchToPage("playlists")
80 return nil
81 case tcell.KeyF4:
75 a.switchToPage("config") 82 a.switchToPage("config")
76 return nil 83 return nil
77 } 84 }
@@ -97,6 +104,11 @@ func (a *app) switchToPage(name string) {
97 a.headerSections.Highlight("artists") 104 a.headerSections.Highlight("artists")
98 a.tv.SetFocus(a.artistsTree) 105 a.tv.SetFocus(a.artistsTree)
99 a.pages.SetBorder(false) 106 a.pages.SetBorder(false)
107 case "playqueue":
108 a.pages.SwitchToPage("playqueue")
109 a.headerSections.Highlight("playqueue")
110 a.tv.SetFocus(a.playQueueList)
111 a.pages.SetBorder(true)
100 case "playlists": 112 case "playlists":
101 a.pages.SwitchToPage("playlists") 113 a.pages.SwitchToPage("playlists")
102 a.headerSections.Highlight("playlists") 114 a.headerSections.Highlight("playlists")