hook up seek for synced lyrics
This commit is contained in:
@@ -46,7 +46,7 @@ type CanShowNowPlaying interface {
|
||||
}
|
||||
|
||||
type CanShowPlayTime interface {
|
||||
OnPlayTimeUpdate(curTime, totalTime float64)
|
||||
OnPlayTimeUpdate(curTime, totalTime float64, seeked bool)
|
||||
}
|
||||
|
||||
type CanShowPlayQueue interface {
|
||||
@@ -222,12 +222,12 @@ func (b *BrowsingPane) onSongChange(song, lastScrobbledIfAny *mediaprovider.Trac
|
||||
}
|
||||
}
|
||||
|
||||
func (b *BrowsingPane) onPlayTimeUpdate(cur, total float64) {
|
||||
func (b *BrowsingPane) onPlayTimeUpdate(cur, total float64, seeked bool) {
|
||||
if b.curPage == nil {
|
||||
return
|
||||
}
|
||||
if p, ok := b.curPage.(CanShowPlayTime); ok {
|
||||
p.OnPlayTimeUpdate(cur, total)
|
||||
p.OnPlayTimeUpdate(cur, total, seeked)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -241,9 +241,13 @@ func (s *nowPlayingPageState) Restore() Page {
|
||||
|
||||
var _ CanShowPlayTime = (*NowPlayingPage)(nil)
|
||||
|
||||
func (a *NowPlayingPage) OnPlayTimeUpdate(curTime, _ float64) {
|
||||
func (a *NowPlayingPage) OnPlayTimeUpdate(curTime, _ float64, seeked bool) {
|
||||
a.formatStatusLine()
|
||||
a.lyricsViewer.UpdatePlayPos(curTime)
|
||||
if seeked {
|
||||
a.lyricsViewer.OnSeeked(curTime)
|
||||
} else {
|
||||
a.lyricsViewer.UpdatePlayPos(curTime)
|
||||
}
|
||||
}
|
||||
|
||||
var _ CanSelectAll = (*NowPlayingPage)(nil)
|
||||
|
||||
Reference in New Issue
Block a user