本文整理匯總了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()
示例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")
示例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()
示例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()