本文整理汇总了Python中playlist.Playlist.position方法的典型用法代码示例。如果您正苦于以下问题:Python Playlist.position方法的具体用法?Python Playlist.position怎么用?Python Playlist.position使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类playlist.Playlist
的用法示例。
在下文中一共展示了Playlist.position方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: GetProperties
# 需要导入模块: from playlist import Playlist [as 别名]
# 或者: from playlist.Playlist import position [as 别名]
def GetProperties(c,playerid,properties):
s= vlc.status();
try:
stream= vlc.audiostream( s["information"]["category"] )
XBMC.MusicPlayerCodec= stream["Codec"]
XBMC.MusicPlayerSampleRate= stream["Sample_rate"]
XBMC.MusicPlayerBitRate= stream["Bitrate"]
except KeyError as e:
print "KeyError:", e
if s["loop"]:
c.repeat="on"
elif s["repeat"]:
c.repeat="all"
else:
c.repeat="off"
c.shuffled= s["random"]
c.duration= s["length"]
c.percentage=s["position"]
c.time= seconds2time(s["position"]*s["length"])
c.totaltime= seconds2time(s["length"])
c.volume= s["volume"]/255.0
c.position= Playlist.position(**s)
if c.position<len(Playlist.items):
c.item= Playlist.items[c.position]
if s["state"]=="stopped":
c.speed=0
elif s["state"]=="playing":
c.speed=1
# print c.Get(properties)
return c.Get(properties)
示例2: Minus
# 需要导入模块: from playlist import Playlist [as 别名]
# 或者: from playlist.Playlist import position [as 别名]
def Minus(c):
vlc.command("pl_previous")
c.position= Playlist.position( **vlc.status)
c.OnPlay( **Playlist.items[c.position] )
Playlist.dirty= True
示例3: Plus
# 需要导入模块: from playlist import Playlist [as 别名]
# 或者: from playlist.Playlist import position [as 别名]
def Plus(c):
vlc.command("pl_next")
c.position= Playlist.position( **vlc.status() )
print "plus:", c.position
c.OnPlay( **Playlist.items[c.position] )
Playlist.dirty= True