added shuffle button to UI + base data flow

This commit is contained in:
Siiiiinth
2026-02-15 09:28:38 -08:00
committed by Drew Weymouth
parent fa56047a82
commit 405d9643b3
4 changed files with 24 additions and 4 deletions
+9
View File
@@ -263,6 +263,15 @@ func (p *playbackEngine) GetLoopMode() LoopMode {
return p.loopMode
}
func (p *playbackEngine) SetShuffle(shuffle bool) {
p.shuffle = shuffle
//TODO: Implement functionality
}
func (p *playbackEngine) GetShuffle() bool {
return p.shuffle
}
func (p *playbackEngine) PlaybackStatus() PlaybackStatus {
stat := p.pendingPlayerChangeStatus
if !p.pendingPlayerChange {
+8
View File
@@ -373,6 +373,10 @@ func (p *PlaybackManager) LoadAlbum(albumID string, insertQueueMode InsertQueueM
return nil
}
func (p *PlaybackManager) GetShuffle() bool {
return p.engine.GetShuffle()
}
// Loads the specified playlist into the play queue.
func (p *PlaybackManager) LoadPlaylist(playlistID string, insertQueueMode InsertQueueMode, shuffle bool) error {
playlist, err := p.engine.sm.Server.GetPlaylist(playlistID)
@@ -639,6 +643,10 @@ func (p *PlaybackManager) SetAutoplay(autoplay bool) {
}
}
func (p *PlaybackManager) SetShuffle(shuffle bool) {
p.engine.SetShuffle(shuffle)
}
func (p *PlaybackManager) Volume() int {
return p.engine.CurrentPlayer().GetVolume()
}
+3
View File
@@ -122,6 +122,9 @@ func NewBottomPanel(pm *backend.PlaybackManager, im *backend.ImageManager, contr
bp.AuxControls.OnChangeAutoplay = func(autoplay bool) {
pm.SetAutoplay(autoplay)
}
bp.AuxControls.OnChangeShuffle = func(shuffle bool) {
pm.SetShuffle(shuffle)
}
bp.AuxControls.OnShowPlayQueue(contr.ShowPopUpPlayQueue)
bp.AuxControls.OnShowCastMenu(contr.ShowCastMenu)
+4 -4
View File
@@ -111,11 +111,11 @@ func (a *AuxControls) SetLoopMode(mode backend.LoopMode) {
}
func (a *AuxControls) SetShuffle(isShuffle bool) {
if isShuffle {
a.shuffle.Highlighted = true
} else {
a.shuffle.Highlighted = false
if isShuffle == a.shuffle.Highlighted {
return
}
a.shuffle.Highlighted = isShuffle
a.shuffle.Refresh()
}
func (a *AuxControls) DisableCastButton() {