@@ -143,10 +143,12 @@ func InitGui(indexes *[]SubsonicIndex, connection *SubsonicConnection) *Ui {
143
143
// player queue
144
144
queueList := tview .NewList ().ShowSecondaryText (false )
145
145
// status text at the top
146
- startStopStatus := tview .NewTextView ().SetText ("stmp: stopped" ).
147
- SetTextAlign (tview .AlignLeft )
148
- playerStatus := tview .NewTextView ().SetText ("[100%][0:00/0:00]" ).
149
- SetTextAlign (tview .AlignRight )
146
+ startStopStatus := tview .NewTextView ().SetText ("[::b]stmp: [red]stopped" ).
147
+ SetTextAlign (tview .AlignLeft ).
148
+ SetDynamicColors (true )
149
+ playerStatus := tview .NewTextView ().SetText ("[::b][100%][0:00/0:00]" ).
150
+ SetTextAlign (tview .AlignRight ).
151
+ SetDynamicColors (true )
150
152
player , err := InitPlayer ()
151
153
var currentDirectory * SubsonicDirectory
152
154
var artistIdList []string
@@ -259,11 +261,11 @@ func InitGui(indexes *[]SubsonicIndex, connection *SubsonicConnection) *Ui {
259
261
if event .Rune () == 'p' {
260
262
status := player .Pause ()
261
263
if status == PlayerStopped {
262
- startStopStatus .SetText ("stmp: stopped" )
264
+ startStopStatus .SetText ("[::b] stmp: [red] stopped" )
263
265
} else if status == PlayerPlaying {
264
- startStopStatus .SetText ("stmp: playing " + player .Queue [0 ].Title )
266
+ startStopStatus .SetText ("[::b] stmp: [green] playing " + player .Queue [0 ].Title )
265
267
} else if status == PlayerPaused {
266
- startStopStatus .SetText ("stmp: paused" )
268
+ startStopStatus .SetText ("[::b] stmp: [yellow] paused" )
267
269
}
268
270
return nil
269
271
}
@@ -301,15 +303,15 @@ func handleMpvEvents(ui *Ui) {
301
303
if e == nil {
302
304
break
303
305
} else if e .Event_Id == mpv .EVENT_END_FILE {
304
- ui .startStopStatus .SetText ("stmp: stopped" )
306
+ ui .startStopStatus .SetText ("[::b] stmp: [red] stopped" )
305
307
// TODO it's gross that this is here, need better event handling
306
308
if len (ui .player .Queue ) > 0 {
307
309
ui .player .Queue = ui .player .Queue [1 :]
308
310
}
309
311
updateQueueList (ui .player , ui .queueList )
310
312
ui .player .PlayNextTrack ()
311
313
} else if e .Event_Id == mpv .EVENT_START_FILE {
312
- ui .startStopStatus .SetText ("stmp: playing " + ui .player .Queue [0 ].Title )
314
+ ui .startStopStatus .SetText ("[::b] stmp: [green] playing " + ui .player .Queue [0 ].Title )
313
315
updateQueueList (ui .player , ui .queueList )
314
316
}
315
317
@@ -348,7 +350,7 @@ func formatPlayerStatus(volume int64, position float64, duration float64) string
348
350
positionMin , positionSec := secondsToMinAndSec (position )
349
351
durationMin , durationSec := secondsToMinAndSec (duration )
350
352
351
- return fmt .Sprintf ("[%d%%][%02d:%02d/%02d:%02d]" , volume ,
353
+ return fmt .Sprintf ("[::b][ %d%%][%02d:%02d/%02d:%02d]" , volume ,
352
354
positionMin , positionSec , durationMin , durationSec )
353
355
}
354
356
0 commit comments