added shuffle button to UI + base data flow
This commit is contained in:
@@ -266,6 +266,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 {
|
||||
|
||||
@@ -354,6 +354,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)
|
||||
@@ -620,6 +624,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()
|
||||
}
|
||||
|
||||
@@ -121,6 +121,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)
|
||||
|
||||
|
||||
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user