def __on_progress_clicked(self, widget, sender): """ Jump to the slided time and release the progress scale update lock. """ player.jump_to(self.progress_scale.get_value()) self.progress_scale_clicked = False return False
def __on_progress_key_pressed(self, widget, event): """ Jump to the modified time. """ old_val = self.progress_scale.get_value() if event.keyval == Gdk.KEY_Up or event.keyval == Gdk.KEY_Left: if old_val > 30.0: player.jump_to(old_val - 30) else: player.jump_to(0) elif event.keyval == Gdk.KEY_Down or event.keyval == Gdk.KEY_Right: upper = self.progress_scale.get_adjustment().get_upper() if old_val + 30.0 < upper: player.jump_to(old_val + 30) else: player.jump_to(upper) return False
def __on_progress_clicked(self, widget, sender): """ Jump to the slided time and release the progress scale update lock. """ value = self.progress_scale.get_value() * self.ui.speed.get_speed() if tools.get_glib_settings().get_boolean("titlebar-remaining-time"): track, time = db.get_track_from_book_time(self.current_book, value) if track.id == player.get_current_track().id: player.jump_to(time) else: player.load_file( db.Track.select().where(db.Track.id == track.id).get()) player.play_pause(None, True) self.__set_progress_scale_value(time / self.ui.speed.get_speed()) player.jump_to(time) else: player.jump_to(value) self.progress_scale_clicked = False return False