add interface to decouple MPV player from PlaybackManager

This commit is contained in:
Drew Weymouth
2023-12-18 20:22:24 -08:00
parent 1665281ad7
commit df6c53a3f5
6 changed files with 135 additions and 107 deletions
+5 -5
View File
@@ -7,7 +7,7 @@ import (
"fyne.io/fyne/v2/theme"
"fyne.io/fyne/v2/widget"
"github.com/dweymouth/supersonic/backend"
"github.com/dweymouth/supersonic/player"
myTheme "github.com/dweymouth/supersonic/ui/theme"
"github.com/dweymouth/supersonic/ui/util"
)
@@ -67,15 +67,15 @@ func (a *AuxControls) OnChangeLoopMode(f func()) {
a.loop.OnTapped = f
}
func (a *AuxControls) SetLoopMode(mode backend.LoopMode) {
func (a *AuxControls) SetLoopMode(mode player.LoopMode) {
switch mode {
case backend.LoopModeAll:
case player.LoopAll:
a.loop.Importance = widget.HighImportance
a.loop.Icon = myTheme.RepeatIcon
case backend.LoopModeOne:
case player.LoopOne:
a.loop.Importance = widget.HighImportance
a.loop.Icon = myTheme.RepeatOneIcon
case backend.LoopModeNone:
case player.LoopNone:
a.loop.Importance = widget.MediumImportance
a.loop.Icon = myTheme.RepeatIcon
}