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


Python Show.base_close_or_unload方法代码示例

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


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

示例1: start_list

# 需要导入模块: from pp_show import Show [as 别名]
# 或者: from pp_show.Show import base_close_or_unload [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: what_next_after_showing

# 需要导入模块: from pp_show import Show [as 别名]
# 或者: from pp_show.Show import base_close_or_unload [as 别名]
    def what_next_after_showing(self):
        self.mon.trace(self, '')
        # print 'WHAT NEXT AFTER SHOWING'
        # print 'current is',self.mon.id(self.current_player), '  next track signal ',self.next_track_signal
        # need to terminate
        if self.terminate_signal is True:
            self.terminate_signal=False
            # what to do when closed or unloaded
            self.ending_reason='killed'
            Show.base_close_or_unload(self)

        elif self.req_next== 'error':
            self.req_next=''
            # set what to do after closed or unloaded
            self.ending_reason='error'
            Show.base_close_or_unload(self)

        # show timeout
        elif self.show_timeout_signal is True:
            self.show_timeout_signal=False
            # what to do when closed or unloaded
            self.ending_reason='show-timeout'
            Show.base_close_or_unload(self)

        # used by exit for stopping show from other shows. 
        elif self.exit_signal is True:
            self.exit_signal=False
            self.ending_reason='exit'
            Show.base_close_or_unload(self)

        # user wants to stop
        elif self.user_stop_signal is True:
            self.user_stop_signal=False
            self.ending_reason='user-stop'
            Show.base_close_or_unload(self)

        # user has selected another track
        elif self.next_track_signal is True:
            self.next_track_signal=False
            self.current_track_ref=self.next_track_arg
            # print 'what next - next track signal is True so load ', self.current_track_ref
            index = self.medialist.index_of_track(self.current_track_ref)
            if index >=0:
                # don't use select the track as not using selected_track in radiobuttonshow
                # and load it
                Show.write_stats(self,'play',self.show_params,self.medialist.track(index))
                self.start_load_show_loop(self.medialist.track(index))
            else:
                self.mon.err(self,"track reference not found in medialist: "+ self.current_track_ref)
                self.end('error',"track reference not found in medialist: "+ self.current_track_ref)
                    
        else:
            # track ends naturally or is quit so go back to first track
            # print 'what next - natural end  so do first track'
            self.do_first_track()
开发者ID:KenT2,项目名称:pipresents-gapless,代码行数:57,代码来源:pp_radiobuttonshow.py

示例3: what_next_after_showing

# 需要导入模块: from pp_show import Show [as 别名]
# 或者: from pp_show.Show import base_close_or_unload [as 别名]
    def what_next_after_showing(self):
        self.mon.trace(self,'')
        # cancel track timeout timer
        if self.track_timeout_timer is not None:
            self.canvas.after_cancel(self.track_timeout_timer)
            self.track_timeout_timer=None
            
        # need to terminate?
        if self.terminate_signal is True:
            self.terminate_signal=False
            # set what to do when closed or unloaded
            self.ending_reason='killed'
            Show.base_close_or_unload(self)

        elif self.req_next== 'error':
            self.req_next=''
            # set what to do after closed or unloaded
            self.ending_reason='error'
            Show.base_close_or_unload(self)

        # show timeout
        elif self.show_timeout_signal is True:
            self.show_timeout_signal=False
            # set what to do when closed or unloaded
            self.ending_reason='show-timeout'
            Show.base_close_or_unload(self)

        # used by exit for stopping show from other shows. 
        elif self.exit_signal is True:
            self.exit_signal=False
            self.ending_reason='exit'
            Show.base_close_or_unload(self)

        # user wants to stop
        elif self.user_stop_signal is True:
            self.user_stop_signal=False
            self.ending_reason='user-stop'
            Show.base_close_or_unload(self)

        elif self.next_track_signal is True:
            self.next_track_signal=False
            self.menu_showing=False
            # start timeout for the track if required           
            if self.track_timeout != 0:
                self.track_timeout_timer=self.canvas.after(self.track_timeout*1000,self.track_timeout_callback)
            self.last_menu_index=self.menu_index
            Show.write_stats(self,'play',self.show_params,self.next_track)
            self.start_load_show_loop(self.next_track)
            
        else:
            # no stopping the show required so re-display the menu
            self.do_menu_track()
开发者ID:KenT2,项目名称:pipresents-gapless,代码行数:54,代码来源:pp_menushow.py

示例4: what_next_after_showing

# 需要导入模块: from pp_show import Show [as 别名]
# 或者: from pp_show.Show import base_close_or_unload [as 别名]
    def what_next_after_showing(self):
        # print 'WHAT NEXT'
        self.mon.trace(self,self.pretty_what_next_after_showing_state())
                        
        self.track_count+=1
        # set false when child rack is to be played
        self.enable_hint=True

        # first of all deal with conditions that do not require the next track to be shown
        # some of the conditions can happen at any time, others only when a track is closed or at pause_at_end

        # need to terminate
        if self.terminate_signal is True:
            self.terminate_signal=False
            self.stop_timers()
            # set what to do after closed or unloaded
            self.ending_reason='killed'
            Show.base_close_or_unload(self)

        elif self.error_signal== True or self.req_next=='error':
            self.error_signal=False
            self.req_next=''
            self.stop_timers()
            # set what to do after closed or unloaded
            self.ending_reason='error'
            Show.base_close_or_unload(self)

        # used for exiting show from other shows, time of day, external etc.
        elif self.exit_signal is True:
            self.exit_signal=False
            self.stop_timers()
            self.ending_reason='exit'
            Show.base_close_or_unload(self)

        #  show timeout
        elif self.show_timeout_signal is True:
            self.show_timeout_signal=False
            self.stop_timers()
            self.ending_reason='user-stop'
            Show.base_close_or_unload(self)

        # user wants to stop the show
        elif self.user_stop_signal is True:
            self.user_stop_signal=False
            # print 'user stop'
            self.stop_timers()
            self.ending_reason='user-stop'
            Show.base_close_or_unload(self)


       # interval > 0. If last track has finished we are waiting for interval timer before ending the list
       # note: if medialist finishes after interval is up then this route is used to start trigger. 
        elif self.waiting_for_interval is True:
            # interval_timer_signal set by alarm clock started in start_list
            if self.interval_timer_signal is True:
                self.interval_timer_signal=False
                self.waiting_for_interval=False
                # print 'RECEIVED INTERVAL TIMER SIGNAL'
                if self.show_params['repeat']=='repeat':
                    self.wait_for_trigger()
                else:
                    self.stop_timers()
                    self.ending_reason='user-stop'
                    Show.base_close_or_unload(self)
            else:
                self.poll_for_interval_timer=self.canvas.after(1000,self.what_next_after_showing)

        else:
            self.medialist.create_new_livelist()
            escapetrack_required=self.escapetrack_required
            self.escapetrack_required=False
            # print escapetrack_required,self.medialist.new_length()
            if escapetrack_required is True and self.medialist.new_length() == 0:
                # print 'use escape track'
                index = self.medialist.index_of_track(self.show_params['escape-track-ref'])
                self.mon.log(self,'Starting Escape Track: '+ self.show_params['escape-track-ref'])
                if index >=0:
                    # don't use select the track as need to preserve mediashow sequence for returning from esacpe track
                    escape_track=self.medialist.track(index)
                    Show.write_stats(self,'play escape track',self.show_params,escape_track)
                    self.display_eggtimer()
                    # use new empty livelist so if changed works OK when return from empty track
                    self.medialist.use_new_livelist()
                    self.start_load_show_loop(escape_track)
                else:
                    self.mon.err(self,"Escape Track empty")
                    self.end('error',"Escape Track empty")

            # print 'FOR IF CHANGED',self.first_list,self.medialist.length(),self.medialist.new_length(),self.medialist.livelist_changed()
            elif self.first_list is True or self.medialist.livelist_changed() is True or (self.medialist.length() == 0 and self.medialist.new_length() == 0):                            

                if self.first_list is False:
                    # do show control
                    if self.medialist.length() == 0 and self.medialist.new_length() != 0:
                            # print 'show control empty to not empty'
                            # do show control when goes from not empty to empty only
                            self.show_control(self.show_params['show-control-not-empty'])
                            
                    elif self.medialist.length() != 0 and self.medialist.new_length() == 0:
                            # print 'show control not empty to empty'
#.........这里部分代码省略.........
开发者ID:KenT2,项目名称:pipresents-gapless,代码行数:103,代码来源:pp_gapshow.py

示例5: what_next_after_showing

# 需要导入模块: from pp_show import Show [as 别名]
# 或者: from pp_show.Show import base_close_or_unload [as 别名]
    def what_next_after_showing(self):
        self.mon.trace(self, '')
        # need to terminate
        if self.terminate_signal is True:
            self.terminate_signal=False
            # what to do when closed or unloaded
            self.ending_reason='killed'
            Show.base_close_or_unload(self)

        elif self.req_next== 'error':
            self.req_next=''
            # set what to do after closed or unloaded
            self.ending_reason='error'
            Show.base_close_or_unload(self)

        # show timeout
        elif self.show_timeout_signal is True:
            self.show_timeout_signal=False
            # what to do when closed or unloaded
            self.ending_reason='show-timeout'
            Show.base_close_or_unload(self)
            
        # used by exit for stopping show from other shows. 
        elif self.exit_signal is True:
            self.exit_signal=False
            self.ending_reason='exit'
            Show.base_close_or_unload(self)

        # user wants to stop
        elif self.user_stop_signal is True:
            self.user_stop_signal=False
            self.ending_reason='user-stop'
            Show.base_close_or_unload(self)

        # user has selected another track
        elif self.next_track_signal is True:
            self.next_track_signal=False
            self.continue_timeout=False

            # home
            if self.next_track_op in ('home'):
                # back to 1 before home
                back_ref=self.path.back_to(self.home_track_ref)
                if back_ref == '':
                    self.mon.err(self,"home - home track not in path: "+self.home_track_ref)
                    self.end('error',"home - home track not in path: "+self.home_track_ref)
                # play home
                self.next_track_ref=self.home_track_ref
                self.path.append(self.next_track_ref)
                if self.debug: print 'Executed Home ' + self.path.pretty_path()

            # return-by
            elif self.next_track_op in ('return-by'):
                if self.current_track_ref != self.home_track_ref:
                    # back n stopping at home
                    # back one more and return it
                    back_ref=self.path.back_by(self.home_track_ref,self.next_track_arg)
                    # use returned track
                    self.next_track_ref=back_ref
                    self.path.append(self.next_track_ref)
                    if self.debug: print 'Executed Return By' + self.next_track_arg + self.path.pretty_path()

            # repeat is return by 1
            elif self.next_track_op in ('repeat'):
                # print 'current', self.current_track_ref
                # print 'home', self.home_track_ref
                self.path.pop_for_sibling()
                self.next_track_ref=self.current_track_ref
                self.path.append(self.current_track_ref)
                self.continue_timeout=True
                if self.debug: print 'Executed Repeat ' + self.path.pretty_path()

            # return-to
            elif self.next_track_op in ('return-to'):
                # back to one before return-to track
                back_ref=self.path.back_to(self.next_track_arg)
                if back_ref == '':
                    self.mon.err(self,"return-to - track not in path: "+self.next_track_arg)
                    self.end('error',"return-to - track not in path: "+self.next_track_arg)
                # and append the return to track
                self.next_track_ref=self.next_track_arg
                self.path.append(self.next_track_ref)
                if self.debug: print 'Executed Return To' + self.next_track_arg + self.path.pretty_path()
                
            # call
            elif self.next_track_op in ('call'):
                # append the required track
                self.path.append(self.next_track_arg)
                self.next_track_ref=self.next_track_arg
                if self.debug: print 'Executed Call ' + self.next_track_arg + self.path.pretty_path()

            # goto
            elif self.next_track_op in ('goto'):
                self.path.empty()
                # add the goto track
                self.next_track_ref=self.next_track_arg
                self.path.append(self.next_track_arg)
                if self.debug: print 'Executed Goto ' + self.next_track_arg + self.path.pretty_path()

            # jump
#.........这里部分代码省略.........
开发者ID:KenT2,项目名称:pipresents-gapless,代码行数:103,代码来源:pp_hyperlinkshow.py


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