forked from Wobbl/Wobuzz
Added indicator icon that shows on the currently playing track.
This commit is contained in:
parent
29cc80feae
commit
efcae74382
5 changed files with 41 additions and 10 deletions
|
@ -19,8 +19,9 @@ class GUICommunication:
|
|||
|
||||
self.settings.update_all()
|
||||
|
||||
def on_track_start(self):
|
||||
self.track_control.on_track_start()
|
||||
def on_track_change(self, previous_track=None, track=None):
|
||||
self.track_control.on_track_change(previous_track, track)
|
||||
self.app.library.on_track_change(previous_track, track)
|
||||
|
||||
def on_playstate_update(self):
|
||||
self.track_control.on_playstate_update()
|
||||
|
|
|
@ -26,7 +26,7 @@ class TrackControl:
|
|||
|
||||
self.connect()
|
||||
|
||||
self.on_track_start()
|
||||
self.on_track_change(None, None)
|
||||
|
||||
def connect(self):
|
||||
self.track_control.previous_button.triggered.connect(self.previous_track)
|
||||
|
@ -52,9 +52,12 @@ class TrackControl:
|
|||
if self.app.player.current_playlist.has_tracks():
|
||||
self.app.player.seek(self.track_control.track_progress_slider.value())
|
||||
|
||||
def on_track_start(self):
|
||||
def on_track_change(self, previous_track, track):
|
||||
if self.app.player.playing:
|
||||
duration = self.app.player.current_playlist.current_track.duration
|
||||
duration = 0
|
||||
|
||||
if track:
|
||||
duration = track.duration
|
||||
|
||||
self.track_control.track_progress_slider.setRange(
|
||||
0,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue