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


Python MediaList.at_end方法代码示例

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


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

示例1: __init__

# 需要导入模块: from pp_medialist import MediaList [as 别名]
# 或者: from pp_medialist.MediaList import at_end [as 别名]

#.........这里部分代码省略.........
                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
            index = self.medialist.index_of_track('pp-child-show')
            if index >=0:
                #don't select the track as need to preserve mediashow sequence.
                child_track=self.medialist.track(index)
                self._display_eggtimer(self.resource('mediashow','m07'))
                self._play_selected_track(child_track)
            else:
                self.mon.err(self,"Child show not found in medialist: "+ self.show['pp-child-show'])
                self._end('error',"child show not found in medialist")
        
        # skip to next track on user input
        elif self._next_track_signal==True:
            self._next_track_signal=False
            if self.medialist.at_end()==True:
                if  self.show['sequence']=="ordered" and self.show['repeat']=='oneshot' and self.top==False:
                    self._end('do-next',"Return from Sub Show")
                else:
                    self.medialist.next()
                    self._play_selected_track(self.medialist.selected_track())               
            else:
                self.medialist.next()
                self._play_selected_track(self.medialist.selected_track())
                
        # skip to previous track on user input
        elif self._previous_track_signal==True:
            self._previous_track_signal=False
            self._direction='backward'
            if self.medialist.at_start()==True:
                if  self.show['sequence']=="ordered" and self.show['repeat']=='oneshot' and self.top==False:
                    self._end('do-previous',"Return from Sub Show")
                else:
                    self.medialist.previous()
                    self._play_selected_track(self.medialist.selected_track())               
            else:
                self.medialist.previous()              
                self._play_selected_track(self.medialist.selected_track())
        

        # track is finished and we are on auto        
        elif self.show['progress']=="auto":
            if self.medialist.at_end()==True:
                if self.show['sequence']=="ordered" and self.show['repeat']=='oneshot' and self.top==False:
                    self._end('do-next',"Return from Sub Show")
                    
                #### elif    
                elif self.show['sequence']=="ordered" and self.show['repeat']=='oneshot' and self.top==True:
开发者ID:DennisTT,项目名称:pipresents,代码行数:70,代码来源:pp_mediashow.py

示例2: __init__

# 需要导入模块: from pp_medialist import MediaList [as 别名]
# 或者: from pp_medialist.MediaList import at_end [as 别名]

#.........这里部分代码省略.........
        self.icon_id_index=0 # rectangle around the icon
        self.image_id_index=1 # icon image - needed for tkinter
        self.text_id_index=2 # the text - need whn no icon is displayed

        #select the startof the medialist
        self.medialist.start()

        #loop through menu entries
        while True:
            #display the entry
            #calculate top left corner of entry
            self.calculate_entry_position(column_index,row_index)


            # display the button strip
            self.display_entry_strip()

            #display the selected entry highlight
            icon_id=self.display_icon_rectangle()

            #display the image in the icon
            image_id=self.display_icon_image()

            if self.show_params['menu-text-mode']<>'none':
                text_id=self.display_icon_text()
            else:
                text_id=None

            #append id's to the list
            self.menu_entry_id.append([icon_id,image_id,text_id])

            self.canvas.update_idletasks( )            
            #and loop
            if self.medialist.at_end():
                break
            self.menu_length+=1
            self.medialist.next('ordered')

            if self.direction=='horizontal':
                column_index+=1
                if column_index>=self.menu_columns:
                    column_index=0
                    row_index+=1
            else:
                row_index+=1
                if row_index>=self.menu_rows:
                    row_index=0
                    column_index+=1
                    
        # finally select and highlight the first entry
        self.medialist.start()
        self.menu_index=0
        self.highlight_menu_entry(self.menu_index,True)


    def print_geometry(self,total_width,total_height):
        print 'menu width: ', self.menu_width
        print 'columns', self.menu_columns
        print 'icon width: ', self.icon_width
        print 'horizontal padding: ', self.menu_horizontal_padding
        print 'text width: ', self.text_width
        print 'entry width: ', self.entry_width
        print 'total width: ', total_width
        print 'x separation: ', self.x_separation
        print ''
        print 'menu height', self.menu_height
开发者ID:KenT2,项目名称:pipresents-next,代码行数:70,代码来源:pp_menushow.py

示例3: __init__

# 需要导入模块: from pp_medialist import MediaList [as 别名]
# 或者: from pp_medialist.MediaList import at_end [as 别名]

#.........这里部分代码省略.........
                self.shower= MenuShow(selected_show,
                                                        self.canvas,
                                                        self.showlist,
                                                        self.pp_home,
                                                        self.pp_profile)
                self.shower.play(self.show_id,self._end_shower,top=False,command='nil')                    
            else:
                self.mon.err(self,"Unknown Show Type: "+ selected_show['type'])
                self._end("Unknown show type")  
                
        else:
            self.mon.err(self,"Unknown Track Type: "+ track_type)
            self._end("Unknown track type")
    
    # callback from when player ends
    def _end_player(self,reason,message):
        self.mon.log(self,"Returned from player with message: "+ message)
        self.player=None
        if reason in("killed","error"):
            self._end(reason,message)
        self._display_eggtimer(self.resource('menushow','m02'))
        self._what_next(message)

    # callback from when shower ends
    def _end_shower(self,show_id,reason,message):
        self.mon.log(self,"Returned from shower with message: "+ message)
        self.shower=None
        if message in ("killed","error"):
            self._end(reason,message)
        self._display_eggtimer(self.resource('menushow','m03'))
        self._what_next(message)  
   

     # at the end of a track just re-display the menu with the original callback from the menu       
    def _what_next(self,message):
        self.mon.log(self,"Re-displaying menu")
        self.play(self.show_id,self.end_callback,top=self.top)



# *********************
# Displaying things
# *********************

    def _display_background(self):
        pil_menu_img=PIL.Image.open(self.menu_img_file)
        # adjust brightness and rotate (experimental)
        # enh=PIL.ImageEnhance.Brightness(pil_menu_img)
        # pil_menu_img=enh.enhance(0.1)
        # pil_menu_img=pil_menu_img.rotate(45)
        self.menu_background = PIL.ImageTk.PhotoImage(pil_menu_img)
        self.drawn = self.canvas.create_image(int(self.canvas['width'])/2,
                                      int(self.canvas['height'])/2,
                                      image=self.menu_background,
                                      anchor=CENTER)


    def _display_video_titles(self):
        self.menu_length=1
        self.menu_entry_id=[]
        x=int(self.show_params['menu-x'])
        y=int(self.show_params['menu-y'])
        self.medialist.start()
        while True:
            id=self.canvas.create_text(x,y,anchor=NW,
                                       text="* "+self.medialist.selected_track()['title'],
                                       fill=self.show_params['entry-colour'],
                                       font=self.show_params['entry-font'])
            self.menu_entry_id.append(id)
            y=y + int(self.show_params['menu-spacing'])
            if self.medialist.at_end():
                break
            self.menu_length+=1
            self.medialist.next('ordered')
            
        # select and highlight the first entry
        self.medialist.start()
        self.menu_index=0
        self._highlight_menu_entry(self.menu_index,True)
        # self.medialist.print_list()

    def _highlight_menu_entry(self,index,state):
        if state==True:
            self.canvas.itemconfig(self.menu_entry_id[index],fill=self.show_params['entry-select-colour'])
        else:
            self.canvas.itemconfig(self.menu_entry_id[index],fill=self.show_params['entry-colour'])
    
    
    def _display_eggtimer(self,text):
        self.egg_timer=self.canvas.create_text(int(self.canvas['width'])/2,
                                              int(self.canvas['height'])/2,
                                                  text= text,
                                                  fill='white',
                                                  font="Helvetica 20 bold")
        self.canvas.update_idletasks( )


    def _delete_eggtimer(self):
        if self.egg_timer!=None:
            self.canvas.delete(self.egg_timer)
开发者ID:papiertiger,项目名称:pipresents-next,代码行数:104,代码来源:pp_menushow.py

示例4: __init__

# 需要导入模块: from pp_medialist import MediaList [as 别名]
# 或者: from pp_medialist.MediaList import at_end [as 别名]

#.........这里部分代码省略.........
                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())
            
        #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.show_params['sequence'])
            self.play_selected_track(self.medialist.selected_track())         
               
        # user wants to play child
        elif self.play_child_signal == True:
            self.play_child_signal=False
            index = self.medialist.index_of_track(self.child_track_ref)
            if index >=0:
                #don't use select the track as need to preserve mediashow sequence.
                child_track=self.medialist.track(index)
                self.display_eggtimer(self.resource('mediashow','m07'))
                self.play_selected_track(child_track)
            else:
                self.mon.err(self,"Child show not found in medialist: "+ self.show_params['pp-child-show'])
                self.end('error',"child show not found in medialist")
        
        # skip to next track on user input
        elif self.next_track_signal==True:
            self.next_track_signal=False
            if self.medialist.at_end()==True:
                if  self.show_params['sequence']=="ordered" and self.show_params['repeat']=='oneshot' and self.top==False:
                    self.end('do-next',"Return from Sub Show")
                elif  self.show_params['sequence']=="ordered" and self.show_params['repeat']=='single-run' and self.top==False:
                    self.end('do-next',"Return from Sub Show")
                else:
                    self.medialist.next(self.show_params['sequence'])
                    self.play_selected_track(self.medialist.selected_track())               
            else:
                self.medialist.next(self.show_params['sequence'])
                self.play_selected_track(self.medialist.selected_track())
                
        # skip to previous track on user input
        elif self.previous_track_signal==True:
            self.previous_track_signal=False
            self.direction='backward'
            if self.medialist.at_start()==True:
                if  self.show_params['sequence']=="ordered" and self.show_params['repeat']=='oneshot' and self.top==False:
                    self.end('do-previous',"Return from Sub Show")
                elif  self.show_params['sequence']=="ordered" and self.show_params['repeat']=='single-run' and self.top==False:
                    self.end('do-previous',"Return from Sub Show")
                else:
                    self.medialist.previous(self.show_params['sequence'])
                    self.play_selected_track(self.medialist.selected_track())               
            else:
                self.medialist.previous(self.show_params['sequence'])              
                self.play_selected_track(self.medialist.selected_track())
        

        # track is finished and we are on auto        
        elif self.show_params['progress']=="auto":
            
            if self.medialist.at_end()==True:
开发者ID:drewkeller,项目名称:pipresents-next,代码行数:70,代码来源:pp_mediashow.py

示例5: __init__

# 需要导入模块: from pp_medialist import MediaList [as 别名]
# 或者: from pp_medialist.MediaList import at_end [as 别名]

#.........这里部分代码省略.........
                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
        elif self._req_next == "do-previous":
            self._req_next = "nil"
            self._direction = "backward"
            self.medialist.previous(self.show_params["sequence"])
            self._play_selected_track(self.medialist.selected_track())

        # user wants to play child
        elif self._play_child_signal == True:
            self._play_child_signal = False
            index = self.medialist.index_of_track("pp-child-show")
            if index >= 0:
                # don't select the track as need to preserve mediashow sequence.
                child_track = self.medialist.track(index)
                self._display_eggtimer(self.resource("mediashow", "m07"))
                self._play_selected_track(child_track)
            else:
                self.mon.err(self, "Child show not found in medialist: " + self.show_params["pp-child-show"])
                self._end("error", "child show not found in medialist")

        # skip to next track on user input
        elif self._next_track_signal == True:
            self._next_track_signal = False
            if self.medialist.at_end() == True:
                if (
                    self.show_params["sequence"] == "ordered"
                    and self.show_params["repeat"] == "oneshot"
                    and self.top == False
                ):
                    self._end("do-next", "Return from Sub Show")
                else:
                    self.medialist.next(self.show_params["sequence"])
                    self._play_selected_track(self.medialist.selected_track())
            else:
                self.medialist.next(self.show_params["sequence"])
                self._play_selected_track(self.medialist.selected_track())

        # skip to previous track on user input
        elif self._previous_track_signal == True:
            self._previous_track_signal = False
            self._direction = "backward"
            if self.medialist.at_start() == True:
                if (
                    self.show_params["sequence"] == "ordered"
                    and self.show_params["repeat"] == "oneshot"
                    and self.top == False
                ):
                    self._end("do-previous", "Return from Sub Show")
                else:
                    self.medialist.previous(self.show_params["sequence"])
                    self._play_selected_track(self.medialist.selected_track())
            else:
                self.medialist.previous(self.show_params["sequence"])
                self._play_selected_track(self.medialist.selected_track())

        # track is finished and we are on auto
开发者ID:papiertiger,项目名称:pipresents-next,代码行数:70,代码来源:pp_mediashow.py


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