예제 #1
0
파일: yamc.py 프로젝트: indiscible/yamc
    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
0
파일: yamc.py 프로젝트: indiscible/yamc
 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