本文整理汇总了Python中pp_medialist.MediaList.finish方法的典型用法代码示例。如果您正苦于以下问题:Python MediaList.finish方法的具体用法?Python MediaList.finish怎么用?Python MediaList.finish使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pp_medialist.MediaList
的用法示例。
在下文中一共展示了MediaList.finish方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from pp_medialist import MediaList [as 别名]
# 或者: from pp_medialist.MediaList import finish [as 别名]
#.........这里部分代码省略.........
if next_show[1]=='tomorrow':
text = self.resource('mediashow','m09')
else:
text = self.resource('mediashow','m08')
text=text.replace('%tt',next_show[0])
self.display_message(self.canvas,'text',text,0,self.start_show)
elif self.show_params['trigger']=="start":
self.start_show()
else:
self.mon.err(self,"Unknown trigger: "+ self.show_params['trigger'])
self.end('error',"Unknown trigger type")
def start_show(self):
self.state='playing'
self.direction='forward'
# self.canvas.delete(ALL)
# start interval timer
if self.show_params['repeat']=="interval" and self.show_params['repeat-interval']<>0:
self.interval_timer_signal=False
self.interval_timer=self.canvas.after(int(self.show_params['repeat-interval'])*1000,self.end_interval_timer)
# start duration timer
if self.show_params['trigger-end']=='duration':
# print 'set alarm ', self.duration
self.duration_timer = self.canvas.after(self.duration*1000,self.tod_end_callback)
# and play the first track unless commanded otherwise
if self.command=='backward':
self.medialist.finish()
else:
self.medialist.start()
self.play_selected_track(self.medialist.selected_track())
def what_next(self):
self.direction='forward'
# end of show trigger caused by tod
if self.end_trigger_signal==True:
self.end_trigger_signal=False
if self.top==True:
self.state='waiting'
self.wait_for_trigger()
else:
# not at top so stop the show
self.end('normal','sub-show end time trigger')
# user wants to end, wait for any shows or tracks to have ended then end show
# probalby will get here with end_m set when player and shower has finished
elif self.end_mediashow_signal==True:
if self.player==None and self.shower==None:
self.end_mediashow_signal=False
self.end('normal',"show ended by user")
#returning from a subshow needing to move onward
elif self.req_next=='do-next':
self.req_next='nil'
self.medialist.next(self.show_params['sequence'])
self.play_selected_track(self.medialist.selected_track())
示例2: __init__
# 需要导入模块: from pp_medialist import MediaList [as 别名]
# 或者: from pp_medialist.MediaList import finish [as 别名]
#.........这里部分代码省略.........
if self.show['trigger']=="button":
# blank screen waiting for trigger if auto, otherwise display something
if self.show['progress']=="manual":
text= self.resource('mediashow','m01')
else:
text=""
self.display_message(self.canvas,'text',text,0,self._start_show)
elif self.show['trigger']=="PIR":
# blank screen waiting for trigger
text = self.resource('mediashow','m02')
self.display_message(self.canvas,'text',text,0,self._start_show)
elif self.show['trigger']=="start":
self._start_show()
else:
self.mon.err(self,"Unknown trigger: "+ self.show['trigger'])
self._end('error',"Unknown trigger type")
def _start_show(self):
self._state='playing'
self._direction='forward'
# start interval timer
if self.show['repeat']=="interval" and self.show['repeat-interval']<>0:
self._interval_timer_signal=False
self._interval_timer=self.canvas.after(int(self.show['repeat-interval'])*1000,self._end_interval_timer)
# and play the first track unless commanded otherwise
if self.command=='backward':
self.medialist.finish()
else:
self.medialist.start()
self._play_selected_track(self.medialist.selected_track())
def _what_next(self):
self._direction='forward'
# user wants to end, wait for any shows or tracks to have ended then end show
if self._end_mediashow_signal==True:
if self.player==None and self.shower==None:
self._end_mediashow_signal=False
self._end('normal',"show ended by user")
else:
pass
#returning from a subshow needing to move onward
elif self._req_next=='do-next':
self._req_next='nil'
self.medialist.next()
self._play_selected_track(self.medialist.selected_track())
#returning from a subshow needing to move backward
elif self._req_next=='do-previous':
self._req_next='nil'
self._direction='backward'
self.medialist.previous()
self._play_selected_track(self.medialist.selected_track())
# user wants to play child
elif self._play_child_signal == True:
self._play_child_signal=False
示例3: __init__
# 需要导入模块: from pp_medialist import MediaList [as 别名]
# 或者: from pp_medialist.MediaList import finish [as 别名]
#.........这里部分代码省略.........
if next_show[quiet] == False:
if next_show[1] == "tomorrow":
text = self.resource("mediashow", "m09")
else:
text = self.resource("mediashow", "m08")
text = text.replace("%tt", next_show[0])
self.display_message(self.canvas, "text", text, 0, self._start_show)
elif self.show_params["trigger"] == "start":
self._start_show()
else:
self.mon.err(self, "Unknown trigger: " + self.show_params["trigger"])
self._end("error", "Unknown trigger type")
def _start_show(self):
self._state = "playing"
self._direction = "forward"
# self.canvas.delete(ALL)
# start interval timer
if self.show_params["repeat"] == "interval" and self.show_params["repeat-interval"] <> 0:
self._interval_timer_signal = False
self._interval_timer = self.canvas.after(
int(self.show_params["repeat-interval"]) * 1000, self._end_interval_timer
)
# start duration timer
if self.show_params["trigger-end"] == "duration":
# print 'set alarm ', self.duration
self.duration_timer = self.canvas.after(self.duration * 1000, self.tod_end_callback)
# and play the first track unless commanded otherwise
if self.command == "backward":
self.medialist.finish()
else:
self.medialist.start()
self._play_selected_track(self.medialist.selected_track())
def _what_next(self):
self._direction = "forward"
# end of show trigger
if self._end_trigger_signal == True:
self._end_trigger_signal = False
if self.top == True:
self._state = "waiting"
self._wait_for_trigger()
else:
# not at top so stop the show
self._end("normal", "sub-show end time trigger")
# user wants to end, wait for any shows or tracks to have ended then end show
elif self._end_mediashow_signal == True:
if self.player == None and self.shower == None:
self._end_mediashow_signal = False
self._end("normal", "show ended by user")
else:
pass
# returning from a subshow needing to move onward
elif self._req_next == "do-next":
self._req_next = "nil"
self.medialist.next(self.show_params["sequence"])
self._play_selected_track(self.medialist.selected_track())
# returning from a subshow needing to move backward