當前位置: 首頁>>代碼示例>>Python>>正文


Python Playlist.isPlaying方法代碼示例

本文整理匯總了Python中Playlist.Playlist.isPlaying方法的典型用法代碼示例。如果您正苦於以下問題:Python Playlist.isPlaying方法的具體用法?Python Playlist.isPlaying怎麽用?Python Playlist.isPlaying使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Playlist.Playlist的用法示例。


在下文中一共展示了Playlist.isPlaying方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: __init__

# 需要導入模塊: from Playlist import Playlist [as 別名]
# 或者: from Playlist.Playlist import isPlaying [as 別名]
class AmarokEventHandler:

    def __init__(self, state):
        self.__running = True;
        self.__playlist = Playlist()
        self.__state = state
        dcop = Dcop.init()
        dcop.player.enableRandomMode("false")

    def start(self):
        while self.__running:
            delay = 1
            fd = sys.stdin.fileno()
            (r,w,e) = select.select( [fd], [], [], delay)
            for File in r:
                if File == fd:
                    line = os.read(fd, 1024)
                    self.__dispatch(line)

    def stop(self):
        self.__running = False

    def __dispatch(self, s):
        Debug.log("Event received: " + s)
        if s.find("engineStateChange: empty" ) >= 0:
            Debug.log("Playlist is empty!")
            if self.__state.isRunning():
                Debug.log("Queuing random song")
                self.__playlist.playRandom()
            else:
                Debug.log("Not running")
        elif s.find("trackChange" ) >= 0:
            if not self.__playlist.isPlaying():
                Debug.log("Queuing random song")
                self.__playlist.playRandom()
開發者ID:BackupTheBerlios,項目名稱:amarok-jukebox-svn,代碼行數:37,代碼來源:AmarokEventHandler.py

示例2: __dispatch

# 需要導入模塊: from Playlist import Playlist [as 別名]
# 或者: from Playlist.Playlist import isPlaying [as 別名]
 def __dispatch(self, s):
     if s.find("engineStateChange: empty" ) >= 0:
         if self.__state.isRunning():
             sys.stderr.write("Unknown notification: " + s + " -> ignoring\n")
             self.__player.playRandom()
     elif s.find("trackChange" ) >= 0:
         pl = Playlist()
         if not pl.isPlaying():
             self.__player.playRandom()                
     else:
         sys.stderr.write("Unknown notification: " + s + " -> ignoring\n")
開發者ID:BackupTheBerlios,項目名稱:amarok-jukebox-svn,代碼行數:13,代碼來源:AmarokEventHandler.py

示例3: play

# 需要導入模塊: from Playlist import Playlist [as 別名]
# 或者: from Playlist.Playlist import isPlaying [as 別名]
def play(p, request):
    request.state.start()
    p.play()
    pl = Playlist()
    if not pl.isPlaying():
        p.playRandom()
開發者ID:BackupTheBerlios,項目名稱:amarok-jukebox-svn,代碼行數:8,代碼來源:Player.py

示例4: play

# 需要導入模塊: from Playlist import Playlist [as 別名]
# 或者: from Playlist.Playlist import isPlaying [as 別名]
def play():
    p.play()
    pl = Playlist()
    if not pl.isPlaying():
        p.playRandom()
開發者ID:BackupTheBerlios,項目名稱:amarok-jukebox-svn,代碼行數:7,代碼來源:player.py


注:本文中的Playlist.Playlist.isPlaying方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。