[vlc-devel] commit: HTTP: set volume on playlist ( Rémi Denis-Courmont )

git version control git at videolan.org
Thu Jul 9 20:41:57 CEST 2009


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Thu Jul  9 21:26:13 2009 +0300| [00f8067d1e820efd397735ea5fda59ef0745cde3] | committer: Rémi Denis-Courmont 

HTTP: set volume on playlist

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=00f8067d1e820efd397735ea5fda59ef0745cde3
---

 modules/control/http/http.c  |    2 +-
 modules/control/http/macro.c |   14 +++++++-------
 modules/control/http/rpn.c   |   16 ++++++++--------
 3 files changed, 16 insertions(+), 16 deletions(-)

diff --git a/modules/control/http/http.c b/modules/control/http/http.c
index 6987029..4494f7e 100644
--- a/modules/control/http/http.c
+++ b/modules/control/http/http.c
@@ -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", "" );
diff --git a/modules/control/http/macro.c b/modules/control/http/macro.c
index 6fabb63..c05e5ec 100644
--- a/modules/control/http/macro.c
+++ b/modules/control/http/macro.c
@@ -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 ) );
                         }
                     }
diff --git a/modules/control/http/rpn.c b/modules/control/http/rpn.c
index bf29c17..a0a7284 100644
--- a/modules/control/http/rpn.c
+++ b/modules/control/http/rpn.c
@@ -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" ) )




More information about the vlc-devel mailing list