added shuffle button to UI + base data flow
This commit is contained in:
@@ -263,6 +263,15 @@ func (p *playbackEngine) GetLoopMode() LoopMode {
|
|||||||
return p.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 {
|
func (p *playbackEngine) PlaybackStatus() PlaybackStatus {
|
||||||
stat := p.pendingPlayerChangeStatus
|
stat := p.pendingPlayerChangeStatus
|
||||||
if !p.pendingPlayerChange {
|
if !p.pendingPlayerChange {
|
||||||
|
|||||||
@@ -373,6 +373,10 @@ func (p *PlaybackManager) LoadAlbum(albumID string, insertQueueMode InsertQueueM
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (p *PlaybackManager) GetShuffle() bool {
|
||||||
|
return p.engine.GetShuffle()
|
||||||
|
}
|
||||||
|
|
||||||
// Loads the specified playlist into the play queue.
|
// Loads the specified playlist into the play queue.
|
||||||
func (p *PlaybackManager) LoadPlaylist(playlistID string, insertQueueMode InsertQueueMode, shuffle bool) error {
|
func (p *PlaybackManager) LoadPlaylist(playlistID string, insertQueueMode InsertQueueMode, shuffle bool) error {
|
||||||
playlist, err := p.engine.sm.Server.GetPlaylist(playlistID)
|
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 {
|
func (p *PlaybackManager) Volume() int {
|
||||||
return p.engine.CurrentPlayer().GetVolume()
|
return p.engine.CurrentPlayer().GetVolume()
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -122,6 +122,9 @@ func NewBottomPanel(pm *backend.PlaybackManager, im *backend.ImageManager, contr
|
|||||||
bp.AuxControls.OnChangeAutoplay = func(autoplay bool) {
|
bp.AuxControls.OnChangeAutoplay = func(autoplay bool) {
|
||||||
pm.SetAutoplay(autoplay)
|
pm.SetAutoplay(autoplay)
|
||||||
}
|
}
|
||||||
|
bp.AuxControls.OnChangeShuffle = func(shuffle bool) {
|
||||||
|
pm.SetShuffle(shuffle)
|
||||||
|
}
|
||||||
bp.AuxControls.OnShowPlayQueue(contr.ShowPopUpPlayQueue)
|
bp.AuxControls.OnShowPlayQueue(contr.ShowPopUpPlayQueue)
|
||||||
bp.AuxControls.OnShowCastMenu(contr.ShowCastMenu)
|
bp.AuxControls.OnShowCastMenu(contr.ShowCastMenu)
|
||||||
|
|
||||||
|
|||||||
@@ -111,11 +111,11 @@ func (a *AuxControls) SetLoopMode(mode backend.LoopMode) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (a *AuxControls) SetShuffle(isShuffle bool) {
|
func (a *AuxControls) SetShuffle(isShuffle bool) {
|
||||||
if isShuffle {
|
if isShuffle == a.shuffle.Highlighted {
|
||||||
a.shuffle.Highlighted = true
|
return
|
||||||
} else {
|
|
||||||
a.shuffle.Highlighted = false
|
|
||||||
}
|
}
|
||||||
|
a.shuffle.Highlighted = isShuffle
|
||||||
|
a.shuffle.Refresh()
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a *AuxControls) DisableCastButton() {
|
func (a *AuxControls) DisableCastButton() {
|
||||||
|
|||||||
Reference in New Issue
Block a user