]> git.sesse.net Git - vlc/commitdiff
Possibility to set volume using %
authorAntoine Cellerier <dionoea@videolan.org>
Mon, 1 Nov 2004 11:06:13 +0000 (11:06 +0000)
committerAntoine Cellerier <dionoea@videolan.org>
Mon, 1 Nov 2004 11:06:13 +0000 (11:06 +0000)
modules/control/http.c
share/http/index.html

index 5524603f2a05a0181fb65b49311cc781d1b1e5b3..a98b7485fe2f07e43917b726652a092b63338bb1 100644 (file)
@@ -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 ) )
index 8a404026e78e5c02431d095dffc04721b6583fdc..3eaedbbc99a65143c26bfa7ee6ebb35e2df15268 100644 (file)
       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>