本文整理汇总了Python中playlist.Playlist.prev方法的典型用法代码示例。如果您正苦于以下问题:Python Playlist.prev方法的具体用法?Python Playlist.prev怎么用?Python Playlist.prev使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类playlist.Playlist
的用法示例。
在下文中一共展示了Playlist.prev方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from playlist import Playlist [as 别名]
# 或者: from playlist.Playlist import prev [as 别名]
#.........这里部分代码省略.........
if user_in[1] == "LENGTH":
return "Length: %d" % self.playlist.len()
elif user_in[1] == "FILEADD":
if 1 <= len(user_in[2:]) <= 4:
self.playlist.add(PlaylistItem(*user_in[2:]))
return "Adding..." #NEEDS EXIT SPECIFICATION
else:
return "[ADD] Incorrect number of arguments!"
elif user_in[1] == "DIRADD":
if len(user_in[2:]) == 1:
return self.playlist.add_dir(user_in[2])
else:
return "[DIRADD] Incorrect number of arguments!"
elif user_in[1] == "SHOW":
return self.playlist.show()
elif user_in[1] == "CLEAR":
return self.playlist.clear()
elif user_in[1] == "SHUFFLE":
self.playlist.randomize()
if self.playing:
self.play()
return "Randomized playlist:\n %s" % self.playlist.show()
else:
return "Unknown PLAYLIST command."
except IndexError:
return self.playlist.show()
except:
raise
elif user_in[0] == "PLAY":
return self.play()
elif user_in[0] == "NEXT":
return self.next()
elif user_in[0] == "PREVIOUS":
return self.prev()
elif user_in[0] == "JUMP":
try: return self.jump(user_in[1])
except: return "No track number supplied."
elif user_in[0] == "STOP":
return self.stop()
elif user_in[0] == "REPEAT":
self.playlist.repeat = not(self.playlist.repeat)
return "REPEAT is now %s" % ("ON" if self.playlist.repeat else "OFF")
elif user_in[0] == "LIBRARY":
try:
return "%s" % self.playlist.setlibrary(user_in[1])
except IndexError:
return "Current library PATH is: %s" % Playlist.root
elif user_in[0] == "VOLUME":
try:
if user_in[1] == "UP":
return self.adjustVolume(1)
elif user_in[1] == "DOWN":
return self.adjustVolume(-1)
else:
return "Unknown argument"
except IndexError:
return "Current volume is %s" % str(MusicPlayer.volume) + "dB"
elif user_in[0] == "ERRORLOG":
return "\n".join(self.errorlog)
elif user_in[0] == "STATUS":
return "%s" % " ".join(self.current_out)
else:
return "Unknown command."
def play(self):
if self.playlist.len() > 0: