当前位置: 首页>>代码示例>>Python>>正文


Python Show.base_track_ready_callback方法代码示例

本文整理汇总了Python中pp_show.Show.base_track_ready_callback方法的典型用法代码示例。如果您正苦于以下问题:Python Show.base_track_ready_callback方法的具体用法?Python Show.base_track_ready_callback怎么用?Python Show.base_track_ready_callback使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在pp_show.Show的用法示例。


在下文中一共展示了Show.base_track_ready_callback方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: start_list

# 需要导入模块: from pp_show import Show [as 别名]
# 或者: from pp_show.Show import base_track_ready_callback [as 别名]
    def start_list(self):
        # starts the list or any repeat having waited for trigger first.
        self.state='playing'

        # initialise track counter for the list
        self.track_count=0
       
        # start interval timer
        self.interval_timer_signal = False
        if self.interval != 0:
            self.interval_timer=self.canvas.after(self.interval*1000,self.end_interval_timer)

        #get rid of previous track in order to display the empty message
        if self.medialist.display_length() == 0:
            if self.show_params['empty-text']:
                Show.base_shuffle(self)
                Show.base_track_ready_callback(self,False)
                Show.display_admin_message(self,self.show_params['empty-text'])
                self.wait_for_not_empty()
            else:
                self.stop_timers()
                self.ending_reason='exit'
                Show.base_close_or_unload(self)                
        else:
            self.not_empty()
开发者ID:drewkeller,项目名称:pipresents-gapless,代码行数:27,代码来源:pp_gapshow.py

示例2: track_ready_callback

# 需要导入模块: from pp_show import Show [as 别名]
# 或者: from pp_show.Show import base_track_ready_callback [as 别名]
    def track_ready_callback(self,enable_show_background):
        self.delete_eggtimer()

        # get control bindings for this show
        # needs to be done for each track as track can override the show controls
        if self.show_params['disable-controls'] == 'yes':
            self.controls_list=[]
        else:
            reason,message,self.controls_list= self.controlsmanager.get_controls(self.show_params['controls'])
            if reason=='error':
                self.mon.err(self,message)
                self.end('error',"error in controls: " + message)
                return

            # print 'controls',reason,self.show_params['controls'],self.controls_list
            #merge controls from the track
            controls_text=self.current_player.get_links()
            reason,message,track_controls=self.controlsmanager.parse_controls(controls_text)
            if reason == 'error':
                self.mon.err(self,message + " in track: "+ self.current_player.track_params['track-ref'])
                self.error_signal=True
                self.what_next_after_showing()
            self.controlsmanager.merge_controls(self.controls_list,track_controls)

        # enable the click-area that are in the list of controls
        self.sr.enable_click_areas(self.controls_list)
        Show.base_track_ready_callback(self,enable_show_background)
开发者ID:KenT2,项目名称:pipresents-gapless,代码行数:29,代码来源:pp_gapshow.py

示例3: wait_for_trigger

# 需要导入模块: from pp_show import Show [as 别名]
# 或者: from pp_show.Show import base_track_ready_callback [as 别名]
    def wait_for_trigger(self):
        
        # wait for trigger sets the state to waiting so that trigger events can do a start_list.
        self.state='waiting'

        self.mon.log(self,self.show_params['show-ref']+ ' '+ str(self.show_id)+ ": Waiting for trigger: "+ self.show_params['trigger-start-type'])

  
        if self.show_params['trigger-start-type'] == "input":
            
            #close the previous track to display admin message
            Show.base_shuffle(self)
            Show.base_track_ready_callback(self,False)
            Show.display_admin_message(self,self.show_params['trigger-wait-text'])

        elif self.show_params['trigger-start-type'] == "input-persist":
            if self.first_list ==True:
                #first time through track list so play the track without waiting to get to end.
                self.start_list()
            else:
                #wait for trigger while displaying previous track
                pass

        elif self.show_params['trigger-start-type'] == "start":
            # don't close the previous track to give seamless repeat of the show
            self.start_list()
            
        else:
            self.mon.err(self,"Unknown trigger: "+ self.show_params['trigger-start-type'])
            self.end('error',"Unknown trigger: "+ self.show_params['trigger-start-type'])
开发者ID:KenT2,项目名称:pipresents-gapless,代码行数:32,代码来源:pp_gapshow.py

示例4: track_ready_callback

# 需要导入模块: from pp_show import Show [as 别名]
# 或者: from pp_show.Show import base_track_ready_callback [as 别名]
    def track_ready_callback(self, enable_show_background):
        self.delete_eggtimer()

        if self.show_params["disable-controls"] != "yes":
            # merge controls from the track
            controls_text = self.current_player.get_links()
            reason, message, track_controls = self.controlsmanager.parse_controls(controls_text)
            if reason == "error":
                self.mon.err(self, message + " in track: " + self.current_player.track_params["track-ref"])
                self.req_next = "error"
                self.what_next_after_showing()
            self.controlsmanager.merge_controls(self.controls_list, track_controls)

        self.sr.enable_click_areas(self.controls_list)

        Show.base_track_ready_callback(self, enable_show_background)
开发者ID:JosHel,项目名称:pipresents-gapless,代码行数:18,代码来源:pp_menushow.py

示例5: track_ready_callback

# 需要导入模块: from pp_show import Show [as 别名]
# 或者: from pp_show.Show import base_track_ready_callback [as 别名]
    def track_ready_callback(self,enable_show_background):
        self.delete_eggtimer()
        # print 'TRACK READY CALLBACK'
        # print 'previous is',self.mon.id(self.previous_player), self.next_track_signal

        #merge links from the track
        if self.show_params['disable-controls'] == 'yes':
            track_links=[]
        else:
            reason,message,track_links=self.path.parse_links(self.current_player.get_links(),self.allowed_links)
            if reason == 'error':
                self.mon.err(self,message + " in track: "+ self.current_player.track_params['track-ref'])
                self.req_next='error'
                self.what_next_after_showing()
        self.path.merge_links(self.links,track_links)
        # enable the click-area that are in the list of links
        self.sr.enable_click_areas(self.links)
        
        Show.base_track_ready_callback(self,enable_show_background)
开发者ID:KenT2,项目名称:pipresents-gapless,代码行数:21,代码来源:pp_radiobuttonshow.py

示例6: track_ready_callback

# 需要导入模块: from pp_show import Show [as 别名]
# 或者: from pp_show.Show import base_track_ready_callback [as 别名]
 def track_ready_callback(self,enable_show_background):
     # called from a Player when ready to play, merge the links from the track with those from the show
     # and then enable the click areas
     self.delete_eggtimer()
     
     if self.show_params['disable-controls'] == 'yes':
         track_links=[]
     else:
         links_text=self.current_player.get_links()
         reason,message,track_links=self.path.parse_links(links_text,self.allowed_links)
         if reason == 'error':
             self.mon.err(self,message + " in track: "+ self.current_player.track_params['track-ref'])
             self.req_next='error'  
             self.what_next_after_showing()
             
     self.path.merge_links(self.links,track_links)
     
     # enable the click-area that are in the list of links
     self.sr.enable_click_areas(self.links)
     
     Show.base_track_ready_callback(self,enable_show_background)
开发者ID:KenT2,项目名称:pipresents-gapless,代码行数:23,代码来源:pp_hyperlinkshow.py

示例7: start_list

# 需要导入模块: from pp_show import Show [as 别名]
# 或者: from pp_show.Show import base_track_ready_callback [as 别名]
    def start_list(self):
        # starts the list or any repeat having waited for trigger first.
        self.state='playing'

        # initialise track counter for the list
        self.track_count=0

        # start interval timer
        self.interval_timer_signal = False
        if self.interval != 0:
            self.interval_timer=self.canvas.after(self.interval*1000,self.end_interval_timer)

        #get rid of previous track in order to display the empty message
        if self.medialist.display_length() == 0:

            #Get current mac address
            str     = open('/sys/class/net/eth0/address').read()
            #Remove : from the mac address for ease of reading
            address = re.sub(':', '', str[0:17])
            #Get system ip address
            ipAddr = check_output(["hostname", "-I"]).rstrip()
            #Check for ip
            if ipAddr:
                iptext = "Monitor IP Address: " + ipAddr + "\n"
            else:
                iptext = ""
            #Check for internet connection
            if self.internet_on():
                addtext = "Monitor is connected to the internet"
            else:
                addtext = "Monitor not connected to a network with a internet connection\nPlease connect the monitor to a network with an internet connection\nUse a network cabel or wifi dongle to do so"

            Show.base_shuffle(self)
            Show.base_track_ready_callback(self,False)
            #Show.display_admin_message(self,self.show_params['empty-text'])
            Show.display_admin_message(self,'Monitor has nothing to play\nMonitor Code: ' + address + '\nAdd this monitor to your account to get started\n' + iptext + addtext)
            self.wait_for_not_empty()
        else:
            self.not_empty()
开发者ID:PiSignage,项目名称:PIChannel,代码行数:41,代码来源:pp_gapshow.py

示例8: what_next_after_showing

# 需要导入模块: from pp_show import Show [as 别名]
# 或者: from pp_show.Show import base_track_ready_callback [as 别名]

#.........这里部分代码省略.........
                            else:
                                # shuffling  - just do next track
                                self.kickback_for_next_track=False
                                self.medialist.next(self.show_params['sequence'])
                                self.start_load_show_loop(self.medialist.selected_track())      
                        else:
                            # not at end just do next track
                            self.medialist.next(self.show_params['sequence'])
                            self.start_load_show_loop(self.medialist.selected_track())


                # skip to previous track on user input or after subshow
                elif self.previous_track_signal is True or self.subshow_kickback_signal is True:
                    # print 'skip backward test, subshow kickback is' ,self.subshow_kickback_signal
                    self.subshow_kickback_signal=False
                    self.previous_track_signal=False
                    self.kickback_for_next_track=True
                    # medialist_at_start can give false positive for shuffle
                    if self.medialist.at_start() is True:
                        # print 'AT START'
                        if  self.show_params['sequence'] == "ordered" and self.show_params['repeat'] == 'repeat':
                            self.kickback_for_next_track=True
                            self.wait_for_trigger()
                        elif  self.show_params['sequence'] == "ordered" and self.show_params['repeat'] == 'single-run':
                            if self.level != 0:
                                self.kickback_for_next_track=True
                                self.subshow_kickback_signal=True
                                # print 'end subshow skip forward test, self. direction is ' ,self.kickback_for_next_track
                                self.end('normal',"Return from Sub Show")
                            else:
                                # end of single run and at top - exit the show
                                self.stop_timers()
                                self.ending_reason='user-stop'
                                Show.base_close_or_unload(self)
                        else:
                            # shuffling  - just do previous track
                            self.kickback_for_next_track=True
                            self.medialist.previous(self.show_params['sequence'])
                            self.start_load_show_loop(self.medialist.selected_track())               
                    else:
                        # not at end just do next track
                        self.medialist.previous(self.show_params['sequence'])              
                        self.start_load_show_loop(self.medialist.selected_track())


                    

                # AT END OF MEDIALIST
                elif self.medialist.at_end() is True:
                    # print 'MEDIALIST AT END'

                    # interval>0 and list finished so wait for the interval timer
                    if self.show_params['sequence'] == "ordered"  and self.interval > 0 and self.interval_timer_signal==False:
                        self.waiting_for_interval=True
                        # print 'WAITING FOR INTERVAL'
                        Show.base_shuffle(self)
                        Show.base_track_ready_callback(self,False)
                        self.poll_for_interval_timer=self.canvas.after(200,self.what_next_after_showing) 

                    # interval=0   
                    #elif self.show_params['sequence'] == "ordered" and self.show_params['repeat'] == 'repeat' and self.show_params['trigger-end-type']== 'interval' and int(self.show_params['trigger-end-param']) == 0:
                        #self.medialist.next(self.show_params['sequence'])
                        # self.start_load_show_loop(self.medialist.selected_track())

                    # shuffling so there is no end condition, get out of end test
                    elif self.show_params['sequence'] == "shuffle":
                        self.medialist.next(self.show_params['sequence'])
                        self.start_load_show_loop(self.medialist.selected_track())
                        
                    # nothing special to do at end of list, just repeat or exit
                    elif self.show_params['sequence'] == "ordered":
                        if self.show_params['repeat'] == 'repeat':
                            # print 'repeating at end of list'
                            self.wait_for_trigger()
                        else:
                            # single run
                            # if not at top return to parent
                            if self.level !=0:
                                self.end('normal',"End of Single Run")
                            else:
                                # at top so close the show
                                # print 'closing show'
                                self.stop_timers()
                                self.ending_reason='user-stop'
                                Show.base_close_or_unload(self)
                            
                    else:
                        self.mon.err(self,"Unhandled playing event at end of list: "+self.show_params['sequence'] +' with ' + self.show_params['repeat']+" of "+ self.show_params['trigger-end-param'])
                        self.end('error',"Unhandled playing event at end of list: "+self.show_params['sequence'] +' with ' + self.show_params['repeat']+" of "+ self.show_params['trigger-end-param'])
                    
                elif self.medialist.at_end() is False:
                    # nothing special just do the next track
                    # print 'nothing special'
                    self.medialist.next(self.show_params['sequence'])
                    self.start_load_show_loop(self.medialist.selected_track())
                          
                else:
                    # unhandled state
                    self.mon.err(self,"Unhandled playing event: "+self.show_params['sequence'] +' with ' + self.show_params['repeat']+" of "+ self.show_params['trigger-end-param'])
                    self.end('error',"Unhandled playing event: "+self.show_params['sequence'] +' with ' + self.show_params['repeat']+" of "+ self.show_params['trigger-end-param'])
开发者ID:KenT2,项目名称:pipresents-gapless,代码行数:104,代码来源:pp_gapshow.py


注:本文中的pp_show.Show.base_track_ready_callback方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。