2010-12-25, 20:55
merry christmas,
slaveunit, it's finding your current volume is 10.
can you try replacing
with
watch the indenting
and giftie nice catch on the mute displaying, you should add 1 to the volume so range picks it up.
slaveunit, it's finding your current volume is 10.
can you try replacing
PHP Code:
try: # first try jsonrpc
result = xbmc.executeJSONRPC('{"jsonrpc": "2.0", "method": "XBMC.GetVolume", "id": 1}')
match = re.search( '"result" : ([0-9]{1,2})', result )
self.current_volume = int(match.group(1))
print "current volume: %d" % self.current_volume
except: # Fall back onto httpapi
self.current_volume = int( xbmc.executehttpapi( "GetVolume" ).replace( "<li>", "" ) )
print "current volume: %d" % self.current_volume
with
PHP Code:
self.current_volume = ( 1 - abs( float( xbmc.getInfoLabel( "Player.Volume" ). split( " " )[ 0 ] ) ) / 60 ) * 100
print "current volume: %d" % self.current_volume
watch the indenting
and giftie nice catch on the mute displaying, you should add 1 to the volume so range picks it up.
PHP Code:
volumes = range( 1, self.current_volume + 1 )