expose repeat mode through MPRIS

This commit is contained in:
Drew Weymouth
2023-07-13 13:12:57 -07:00
parent 41053a22a8
commit a12b6dd276
4 changed files with 61 additions and 10 deletions
+6 -4
View File
@@ -7,6 +7,7 @@ import (
"fyne.io/fyne/v2/theme"
"fyne.io/fyne/v2/widget"
"github.com/dweymouth/supersonic/backend"
myTheme "github.com/dweymouth/supersonic/ui/theme"
"github.com/dweymouth/supersonic/ui/util"
)
@@ -67,14 +68,15 @@ func (a *AuxControls) OnChangeLoopMode(f func()) {
a.loop.OnTapped = f
}
func (a *AuxControls) SetLoopMode(mode string) {
if mode == "all" {
func (a *AuxControls) SetLoopMode(mode backend.LoopMode) {
switch mode {
case backend.LoopModeAll:
a.loop.Importance = widget.HighImportance
a.loop.Icon = myTheme.RepeatIcon
} else if mode == "one" {
case backend.LoopModeOne:
a.loop.Importance = widget.HighImportance
a.loop.Icon = myTheme.RepeatOneIcon
} else {
case backend.LoopModeNone:
a.loop.Importance = widget.MediumImportance
a.loop.Icon = myTheme.RepeatIcon
}