Fixed playback status representation in slider controls

This commit is contained in:
Manuel Cortez 2021-09-23 16:55:48 -05:00
parent 14d311f29d
commit 74d9b5b1a4

View File

@ -206,13 +206,14 @@ class Controller(object):
def on_time_change(self, event, *args, **kwargs): def on_time_change(self, event, *args, **kwargs):
p = event.GetPosition() p = event.GetPosition()
if player.player.player != None: if player.player.player != None:
player.player.player.set_position(p/100.0) progress = int((player.player.player.get_length()/100)*p)
player.player.player.set_position(progress)
event.Skip() event.Skip()
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 != None:
progress = player.player.player.get_position()*100 progress = (player.player.player.get_position()/player.player.player.get_length())*100
self.window.time_slider.SetValue(progress) self.window.time_slider.SetValue(progress)
def on_close(self, event): def on_close(self, event):