]> git.sesse.net Git - vlc/commitdiff
HTTP: set volume on playlist
authorRémi Denis-Courmont <remi@remlab.net>
Thu, 9 Jul 2009 18:26:13 +0000 (21:26 +0300)
committerRémi Denis-Courmont <remi@remlab.net>
Thu, 9 Jul 2009 18:26:13 +0000 (21:26 +0300)
modules/control/http/http.c
modules/control/http/macro.c
modules/control/http/rpn.c

index 6987029e4891b108e918a19aba42631a99922b3b..4494f7e224284e21b4181898eb9f89cb3baca375 100644 (file)
@@ -418,7 +418,7 @@ static void ParseExecute( httpd_file_sys_t *p_args, char *p_buffer,
         state = "stop";
     }
 
-    aout_VolumeGet( p_args->p_intf, &i_volume );
+    aout_VolumeGet( p_sys->p_playlist, &i_volume );
     sprintf( volume, "%d", (int)i_volume );
 
     p_args->vars = mvar_New( "variables", "" );
index 6fabb634b20c1244d5e4069e77dd541c126427b5..c05e5ec8aa5ad4d775aaf94c856c45368cae965d 100644 (file)
@@ -256,7 +256,7 @@ static void MacroDo( httpd_file_sys_t *p_args,
                     int i_value;
 
                     ExtractURIValue( p_request, "value", vol, 8 );
-                    aout_VolumeGet( p_intf, &i_volume );
+                    aout_VolumeGet( p_sys->p_playlist, &i_volume );
                     decode_URI( vol );
 
                     if( vol[0] == '+' )
@@ -264,12 +264,12 @@ static void MacroDo( httpd_file_sys_t *p_args,
                         i_value = atoi( vol + 1 );
                         if( (i_volume + i_value) > AOUT_VOLUME_MAX )
                         {
-                            aout_VolumeSet( p_intf , AOUT_VOLUME_MAX );
+                            aout_VolumeSet( p_sys->p_playlist, AOUT_VOLUME_MAX );
                             msg_Dbg( p_intf, "requested volume set: max" );
                         }
                         else
                         {
-                            aout_VolumeSet( p_intf , (i_volume + i_value) );
+                            aout_VolumeSet( p_sys->p_playlist, (i_volume + i_value) );
                             msg_Dbg( p_intf, "requested volume set: +%i", (i_volume + i_value) );
                         }
                     }
@@ -278,12 +278,12 @@ static void MacroDo( httpd_file_sys_t *p_args,
                         i_value = atoi( vol + 1 );
                         if( (i_volume - i_value) < AOUT_VOLUME_MIN )
                         {
-                            aout_VolumeSet( p_intf , AOUT_VOLUME_MIN );
+                            aout_VolumeSet( p_sys->p_playlist, AOUT_VOLUME_MIN );
                             msg_Dbg( p_intf, "requested volume set: min" );
                         }
                         else
                         {
-                            aout_VolumeSet( p_intf , (i_volume - i_value) );
+                            aout_VolumeSet( p_sys->p_playlist, (i_volume - i_value) );
                             msg_Dbg( p_intf, "requested volume set: -%i", (i_volume - i_value) );
                         }
                     }
@@ -291,7 +291,7 @@ static void MacroDo( httpd_file_sys_t *p_args,
                     {
                         i_value = atoi( vol );
                         if( (i_value <= 400) && (i_value>=0) ){
-                            aout_VolumeSet( p_intf, (i_value * (AOUT_VOLUME_MAX - AOUT_VOLUME_MIN))/400+AOUT_VOLUME_MIN);
+                            aout_VolumeSet( p_sys->p_playlist, (i_value * (AOUT_VOLUME_MAX - AOUT_VOLUME_MIN))/400+AOUT_VOLUME_MIN);
                             msg_Dbg( p_intf, "requested volume set: %i%%", atoi( vol ));
                         }
                     }
@@ -300,7 +300,7 @@ static void MacroDo( httpd_file_sys_t *p_args,
                         i_value = atoi( vol );
                         if( ( i_value <= AOUT_VOLUME_MAX ) && ( i_value >= AOUT_VOLUME_MIN ) )
                         {
-                            aout_VolumeSet( p_intf , atoi( vol ) );
+                            aout_VolumeSet( p_sys->p_playlist, atoi( vol ) );
                             msg_Dbg( p_intf, "requested volume set: %i", atoi( vol ) );
                         }
                     }
index bf29c17ddb2b8d6cb19113a1514a027a906d0802..a0a7284b5579dca49794ea0520c8255ca8d805bd 100644 (file)
@@ -944,38 +944,38 @@ void EvaluateRPN( intf_thread_t *p_intf, mvar_t  *vars,
             char *psz_vol = SSPop( st );
             int i_value;
             audio_volume_t i_volume;
-            aout_VolumeGet( p_intf, &i_volume );
+            aout_VolumeGet( p_sys->p_playlist, &i_volume );
             if( psz_vol[0] == '+' )
             {
                 i_value = atoi( psz_vol );
                 if( (i_volume + i_value) > AOUT_VOLUME_MAX )
-                    aout_VolumeSet( p_intf, AOUT_VOLUME_MAX );
+                    aout_VolumeSet( p_sys->p_playlist, AOUT_VOLUME_MAX );
                 else
-                    aout_VolumeSet( p_intf, i_volume + i_value );
+                    aout_VolumeSet( p_sys->p_playlist, i_volume + i_value );
             }
             else if( psz_vol[0] == '-' )
             {
                 i_value = atoi( psz_vol );
                 if( (i_volume + i_value) < AOUT_VOLUME_MIN )
-                    aout_VolumeSet( p_intf, AOUT_VOLUME_MIN );
+                    aout_VolumeSet( p_sys->p_playlist, AOUT_VOLUME_MIN );
                 else
-                    aout_VolumeSet( p_intf, i_volume + i_value );
+                    aout_VolumeSet( p_sys->p_playlist, i_volume + i_value );
             }
             else if( strstr( psz_vol, "%") != NULL )
             {
                 i_value = atoi( psz_vol );
                 if( i_value < 0 ) i_value = 0;
                 if( i_value > 400 ) i_value = 400;
-                aout_VolumeSet( p_intf, (i_value * (AOUT_VOLUME_MAX - AOUT_VOLUME_MIN))/400+AOUT_VOLUME_MIN);
+                aout_VolumeSet( p_sys->p_playlist, (i_value * (AOUT_VOLUME_MAX - AOUT_VOLUME_MIN))/400+AOUT_VOLUME_MIN);
             }
             else
             {
                 i_value = atoi( psz_vol );
                 if( i_value > AOUT_VOLUME_MAX ) i_value = AOUT_VOLUME_MAX;
                 if( i_value < AOUT_VOLUME_MIN ) i_value = AOUT_VOLUME_MIN;
-                aout_VolumeSet( p_intf, i_value );
+                aout_VolumeSet( p_sys->p_playlist, i_value );
             }
-            aout_VolumeGet( p_intf, &i_volume );
+            aout_VolumeGet( p_sys->p_playlist, &i_volume );
             free( psz_vol );
         }
         else if( !strcmp( s, "vlc_get_meta" ) )