Fixed some progress bar bugs again.
This commit is contained in:
parent
d453afc6d0
commit
19563930c5
2 changed files with 14 additions and 4 deletions
|
@ -18,5 +18,5 @@ class GUI:
|
|||
self.window.main_container.track_control.previous_button.triggered.connect(self.app.player.previous_track)
|
||||
self.window.main_container.track_control.toggle_play_button.triggered.connect(self.app.player.toggle_playing)
|
||||
self.window.main_container.track_control.stop_button.triggered.connect(self.app.player.stop)
|
||||
self.window.main_container.track_control.next_button.triggered.connect(self.app.player.skip_current)
|
||||
self.window.main_container.track_control.next_button.triggered.connect(self.app.player.next_track)
|
||||
|
||||
|
|
|
@ -57,6 +57,8 @@ class Player:
|
|||
self.music_channel.play(self.playing_track.sound)
|
||||
self.track_progress.start()
|
||||
self.app.gui_communication.on_track_start()
|
||||
self.playing = True
|
||||
self.paused = False
|
||||
|
||||
else:
|
||||
self.current_playlist_index -= 1
|
||||
|
@ -78,9 +80,10 @@ class Player:
|
|||
self.music_channel.unpause()
|
||||
self.track_progress.unpause()
|
||||
self.paused = False
|
||||
self.playing = True
|
||||
|
||||
def skip_current(self):
|
||||
if self.has_tracks:
|
||||
def next_track(self):
|
||||
if self.has_tracks and self.current_playlist_index < len(self.current_playlist) - 1:
|
||||
self.music_channel.stop()
|
||||
self.track_progress.stop()
|
||||
self.track_finished()
|
||||
|
@ -100,6 +103,9 @@ class Player:
|
|||
self.track_progress.start()
|
||||
self.app.gui_communication.on_track_start()
|
||||
|
||||
self.playing = True
|
||||
self.paused = False
|
||||
|
||||
def toggle_playing(self):
|
||||
if self.playing and self.paused:
|
||||
self.unpause()
|
||||
|
@ -114,9 +120,11 @@ class Player:
|
|||
if self.has_tracks:
|
||||
self.music_channel.stop()
|
||||
self.track_progress.stop()
|
||||
self.playing = False
|
||||
self.playing_segment_duration = self.playing_track.duration
|
||||
|
||||
self.playing = False
|
||||
self.paused = False
|
||||
|
||||
def seek(self, position: int):
|
||||
if self.has_tracks:
|
||||
self.searched = True
|
||||
|
@ -126,3 +134,5 @@ class Player:
|
|||
self.music_channel.play(self.playing_segment)
|
||||
self.track_progress.start()
|
||||
|
||||
self.playing = True
|
||||
|
||||
|
|
Loading…
Reference in a new issue