Changes on GUI for new player module

This commit is contained in:
Manuel Cortez 2022-10-20 17:25:29 -05:00
parent 062bbcc842
commit 516e20c3b8
No known key found for this signature in database
GPG Key ID: 9E0735CA15EFE790

View File

@ -136,12 +136,12 @@ class Controller(object):
ev.Skip() ev.Skip()
def on_play_pause(self, *args, **kwargs): def on_play_pause(self, *args, **kwargs):
if player.player.player.is_playing() == 1: if player.player.player.playback_time != None and player.player.player.pause == False:
self.window.play.SetLabel(_(u"Play")) self.window.play.SetLabel(_("Play"))
return player.player.pause() return player.player.pause()
else: else:
self.window.play.SetLabel(_(u"Pause")) self.window.play.SetLabel(_("Pause"))
return player.player.player.play() player.player.player.pause = False
def on_next(self, *args, **kwargs): def on_next(self, *args, **kwargs):
return utils.call_threaded(player.player.next) return utils.call_threaded(player.player.next)
@ -212,9 +212,9 @@ class Controller(object):
def on_timer(self, *args, **kwargs): def on_timer(self, *args, **kwargs):
if not self.window.time_slider.HasFocus(): if not self.window.time_slider.HasFocus():
if player.player.player != None: if player.player.player.playback_time != None:
progress = (player.player.player.get_position()/player.player.player.get_length())*100 progress = (player.player.player.playback_time/(player.player.player.playback_time+player.player.player.playtime_remaining))*100
self.window.time_slider.SetValue(progress) self.window.time_slider.SetValue(int(progress))
def on_close(self, event): def on_close(self, event):
log.debug("Exiting...") log.debug("Exiting...")