Improved icon changing of play/pause button.

This commit is contained in:
The Wobbler 2024-12-29 15:18:38 +01:00
parent 44854af42f
commit 29cc80feae
3 changed files with 24 additions and 4 deletions

View file

@ -33,6 +33,8 @@ class Player:
self.playing = True
self.paused = False
self.app.gui_communication.on_playstate_update()
def track_finished(self):
if not self.current_playlist.on_last_track():
self.current_sound, self.current_sound_duration = self.current_playlist.next_track()
@ -51,6 +53,7 @@ class Player:
self.play()
self.track_progress.start()
self.app.gui_communication.on_track_start()
self.app.gui_communication.on_playstate_update()
def play_track_in_playlist(self, track_index):
self.stop()
@ -66,6 +69,8 @@ class Player:
self.track_progress.pause()
self.paused = True
self.app.gui_communication.on_playstate_update()
def unpause(self):
self.music_channel.unpause()
self.track_progress.unpause()
@ -73,6 +78,8 @@ class Player:
self.playing = True
self.paused = False
self.app.gui_communication.on_playstate_update()
def next_track(self):
if not self.current_playlist.on_last_track():
self.music_channel.stop()
@ -100,6 +107,8 @@ class Player:
self.playing = False
self.paused = False
self.app.gui_communication.on_playstate_update()
def seek(self, position: int):
self.music_channel.stop()
self.track_progress.stop()