本文整理汇总了Python中library.Library.addFolder方法的典型用法代码示例。如果您正苦于以下问题:Python Library.addFolder方法的具体用法?Python Library.addFolder怎么用?Python Library.addFolder使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类library.Library
的用法示例。
在下文中一共展示了Library.addFolder方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: main
# 需要导入模块: from library import Library [as 别名]
# 或者: from library.Library import addFolder [as 别名]
def main():
track_playing = None
track_next = None
# Load config file
config = settings.loadConfig('config.json')
# Spawn GUI
gui = GUI()
# Initialize library
lib = Library(config['library']['dbfile'])
for folder in config['library']['folders']:
lib.addFolder(folder)
player = Player()
track_playing = lib.getRandomFile()
track_next = lib.getRandomFile()
player.cue(u"file:///"+track_playing)
player.play()
print track_playing
player.cue(u"file:///"+track_next)
print track_next
#gui.queueTrack(track_playing)
while True:
pos = player.get_position()
dur = player.get_duration()
gui.set_status("%s %02d:%02d / %02d:%02d " % (track_playing, pos/60, (pos%60), dur/60, (dur%60)))
gui.update()
if player.queue is None:
track_playing = track_next
track_next = lib.getRandomFile()
player.cue(u"file:///"+track_next)
print player.queue