def track_playback_ended(self, tl_track, time_position): self.set_playing(False) if self.timer is not None: Clock.unschedule(self.timer) self.timer = None self.ids.slider.value = 0 self.ids.current_pos.text = Utils.format_time_to_string(0) self.ids.duration.text = Utils.format_time_to_string(0)
def track_playback_resumed(self, tl_track, time_position): self.set_playing(True) self.ids.slider.value = time_position / 1000 self.ids.current_pos.text = Utils.format_time_to_string(time_position / 1000) if self.timer is None and self.has_duration: self.timer = Clock.schedule_interval(self.update, 0.1)
def track_playback_started(self, tl_track): if tl_track is not None: self.set_playing(True) # Load the data in the next screen # self.ids.screen_manager.get_screen( # self.ids.screen_manager.next() # ).track_playback_started(tl_track) # self.ids.screen_manager.transition.direction = 'left' # # # Move to the next screen # self.ids.screen_manager.current = self.ids.screen_manager.next() if 'length' in tl_track['track']: self.has_duration = True duration = int(tl_track['track']['length'] / 1000) else: self.has_duration = False duration = 0 self.ids.slider.max = duration self.ids.slider.value = 0 self.ids.duration.text = Utils.format_time_to_string(duration) if self.timer is None and self.has_duration: self.timer = Clock.schedule_interval(self.update, 0.1) else: self.track_playback_ended(None, 0)
def track_playback_started(self, tl_track): if tl_track is not None: self.set_playing(True) # Load the data in the next screen self.ids.screen_manager.get_screen(self.ids.screen_manager.next()).track_playback_started(tl_track) self.ids.screen_manager.transition.direction = 'left' # Move to the next screen self.ids.screen_manager.current = self.ids.screen_manager.next() if 'length' in tl_track['track']: self.has_duration = True duration = int(tl_track['track']['length']/1000) else: self.has_duration = False duration = 0 self.ids.slider.max = duration self.ids.slider.value = 0 self.ids.duration.text = Utils.format_time_to_string(duration) if self.timer is None and self.has_duration: self.timer = Clock.schedule_interval(self.update, 0.1) else: self.track_playback_ended(None, 0)
def seeked(self, time_position): self.ids.slider.value = time_position / 1000 self.ids.current_pos.text = Utils.format_time_to_string(time_position / 1000)
def update(self, dt): self.ids.slider.value += 0.1 self.ids.current_pos.text = Utils.format_time_to_string( int(self.ids.slider.value))
def update(self, dt): self.ids.slider.value += 0.1 self.ids.current_pos.text = Utils.format_time_to_string(int(self.ids.slider.value))
def seeked(self, time_position): self.ids.slider.value = time_position/1000 self.ids.current_pos.text = Utils.format_time_to_string(time_position/1000)
def track_playback_resumed(self, tl_track, time_position): self.set_playing(True) self.ids.slider.value = time_position/1000 self.ids.current_pos.text = Utils.format_time_to_string(time_position/1000) if self.timer is None and self.has_duration: self.timer = Clock.schedule_interval(self.update, 0.1)