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


Python Playlist.moveDown方法代码示例

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


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

示例1: MainPanel

# 需要导入模块: from playlist import Playlist [as 别名]
# 或者: from playlist.Playlist import moveDown [as 别名]

#.........这里部分代码省略.........
                    self.clockthread.start()
                    
            if (self.chkAuto.Value == True and self.networkconn.loaded == "" and 
                self.lblLoaded.GetLabelText() != 'Please Wait...'):
                self.OnPlayUpdateFromList()
                
        else:
            self.lblPlaying.SetLabel("None")
            self.lblCountdown.Show(False)
            self.btnStop.Enable(False)
            
            if self.clock != -1:
                self.clock = -1
                self.clockthread = None
            
        if self.networkconn.loaded != "":
            self.lblLoaded.SetLabel(self.networkconn.loaded)
            self.btnPlay.Enable(True)
        else:
            self.lblLoaded.SetLabel("None")
            self.btnPlay.Enable(False)
            
        # Fix red/green highlights
        self.StatusHighlightSet()
        
    def OnMoveUp(self, event):
        if self.lstPlaylist.SelectedItemCount > 0:
            self.playlist.moveUp(self.lstPlaylist.GetFirstSelected())
            self.PlaylistRefresh()
            self.plmodded = True
            
    def OnMoveDown(self, event):
        if self.lstPlaylist.SelectedItemCount > 0:
            self.playlist.moveDown(self.lstPlaylist.GetFirstSelected())
            self.PlaylistRefresh()
            self.plmodded = True
            
    def OnRemove(self, event):
        if self.lstPlaylist.SelectedItemCount > 0:
            self.playlist.removeItem(self.lstPlaylist.GetFirstSelected())
            self.PlaylistRefresh()     
            self.plmodded = True   

    def OnPLSelect(self, event):
        if self.lstPlaylist.ItemCount > 0:
            if self.lstPlaylist.SelectedItemCount > 0:
                self.playlist.index = self.lstPlaylist.GetFirstSelected()
                
                # Load a new item if we're connected
                try:
                    if self.networkconn.connected == True:
                        if self.networkconn.loaded != self.playlist.getCurrentItemName():
                            self.networkconn.load(self.playlist.getCurrentItemName())
                            self.lblLoaded.SetLabel("Please Wait...")
                            self.btnPlay.Enable(False)
                        self.chkAuto.SetLabel("Auto-play selected item")
                    else:
                        self.GetParent().OnDisconnectInstruction()
                        raise AttributeError
                except AttributeError:
                    pass
            else:
                if self.chkAuto.Value == False:
                    self.playlist.index = -1
        else:
            self.playlist.index = -1
开发者ID:samdnic,项目名称:PiVTDesktop,代码行数:70,代码来源:PiVTDesktop.py

示例2: MainPanel

# 需要导入模块: from playlist import Playlist [as 别名]
# 或者: from playlist.Playlist import moveDown [as 别名]

#.........这里部分代码省略.........
            self.lblCountdown.Show(False)
            self.btnStop.Enable(False)
            
            if self.endtime != None:
                self.endtime = None
                self.clockthread = None
            
        if self.networkconn.loaded != "":
            self.lblLoaded.SetLabel(self.networkconn.loaded)
            self.btnPlay.Enable(True)
            
            if (self.networkconn.playing == ""):
                m, s = divmod(round(seconds), 60)
                self.lblCountdown.SetLabel("{0:02d}:{1:02d}".format(int(round(m)), 
                                                                    int(round(s))))
                self.lblCountdown.SetForegroundColour((0, 0, 0))
                self.lblCountdown.Show(True)
            
        else:
            self.lblLoaded.SetLabel("None")
            self.btnPlay.Enable(False)
            
        # Fix red/green highlights
        self.StatusHighlightSet()
        
    def OnMoveUp(self, event):
        if self.lstPlaylist.SelectedItemCount > 0:
            self.playlist.moveUp(self.lstPlaylist.GetFirstSelected())
            self.PlaylistRefresh()
            self.plmodded = True
            
    def OnMoveDown(self, event):
        if self.lstPlaylist.SelectedItemCount > 0:
            self.playlist.moveDown(self.lstPlaylist.GetFirstSelected())
            self.PlaylistRefresh()
            self.plmodded = True
            
    def OnRemove(self, event):
        if self.lstPlaylist.SelectedItemCount > 0:
            self.playlist.removeItem(self.lstPlaylist.GetFirstSelected())
            self.PlaylistRefresh()     
            self.plmodded = True   

    def OnPLSelect(self, event):
        if self.lstPlaylist.ItemCount > 0:
            if self.lstPlaylist.SelectedItemCount > 0:
                self.playlist.index = self.lstPlaylist.GetFirstSelected()
                
                # Load a new item if we're connected
                try:
                    if self.networkconn.connected == True:
                        if self.networkconn.loaded != self.playlist.getCurrentItemName():
                            self.networkconn.load(self.playlist.getCurrentItemName())
                            self.lblLoaded.SetLabel("Please Wait...")
                            self.btnPlay.Enable(False)
                        self.chkAuto.SetLabel("Auto-play selected item")
                    else:
                        self.GetParent().OnDisconnectInstruction()
                        raise AttributeError
                except AttributeError:
                    pass
            else:
                if self.chkAuto.Value == False:
                    self.playlist.index = -1
        else:
            self.playlist.index = -1
开发者ID:YSTV,项目名称:PiVTDesktop,代码行数:70,代码来源:PiVTDesktop.py


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