Commit b6e03065 authored by Antoine Cellerier's avatar Antoine Cellerier

Possibility to set volume using %

parent f0269f7a
......@@ -1758,6 +1758,14 @@ static void MacroDo( httpd_file_sys_t *p_args,
msg_Dbg( p_intf, "requested volume set: -%i", (i_volume - i_value) );
}
} else
if( strstr(vol, "%") != NULL )
{
i_value = atoi( vol );
if( (i_value <= 100) && (i_value>=0) ){
aout_VolumeSet( p_intf, (i_value * (AOUT_VOLUME_MAX - AOUT_VOLUME_MIN))/100+AOUT_VOLUME_MIN);
msg_Dbg( p_intf, "requested volume set: %i%%", atoi( vol ));
}
} else
{
i_value = atoi( vol );
if( ( i_value <= AOUT_VOLUME_MAX ) && ( i_value >= AOUT_VOLUME_MIN ) )
......
......@@ -175,7 +175,7 @@
if ( seconds < 10 ) seconds = "0" + seconds;
document.getElementById('length').innerHTML = hours+":"+minutes+":"+seconds;
got_volume = <vlc id="value" param1="volume" />;
document.getElementById( 'volume').innerHTML = Math.floor(got_volume * 100/1024) + " %";
document.getElementById( 'volume').innerHTML = Math.ceil(got_volume * 100/1024) + " %";
</script>
</body>
</html>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment