Exemplo n.º 1
0
    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)
Exemplo n.º 2
0
 def Minus(c):
     vlc.command("pl_previous")
     c.position= Playlist.position( **vlc.status)
     c.OnPlay( **Playlist.items[c.position] )
     Playlist.dirty= True
Exemplo n.º 3
0
 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