def __sleep_timer_fired(self):
"""
The sleep timer gets called every second. Here we do the countdown stuff
aswell as stop the playback / suspend the machine.
"""
self.current_timer_time = self.current_timer_time - 1
adjustment = self.timer_spinner.get_adjustment()
adjustment.set_value(int(self.current_timer_time / 60) + 1)
if self.current_timer_time < 1:
self.timer_switch.set_active(False)
if player.get_gst_player_state() == Gst.State.PLAYING:
player.play_pause(None)
self.sleep_timer.stop()
评论列表
文章目录