]> git.sesse.net Git - vlc/commitdiff
New --volume option (untested, like usual :).
authorChristophe Massiot <massiot@videolan.org>
Mon, 5 Nov 2001 15:22:44 +0000 (15:22 +0000)
committerChristophe Massiot <massiot@videolan.org>
Mon, 5 Nov 2001 15:22:44 +0000 (15:22 +0000)
include/config.h.in
src/audio_output/audio_output.c
src/interface/main.c

index e4622979d1b347fd23928ccab191fc6ee88a21de..75b158cc702b2f03dadb181fd5521a16aa500f3f 100644 (file)
 #define VOLUME_STEP                     128
 #define VOLUME_MAX                      1024
 
+/* Environment variable for volume */
+#define AOUT_VOLUME_VAR                 "vlc_volume"
+
 /* Environment variable for output rate, and default value */
 #define AOUT_RATE_VAR                   "vlc_audio_rate"
 #define AOUT_RATE_DEFAULT               44100
index 9e272c5ba1193f40daf74d1ec64f5b63b3483c64..3fda15fc6f4b3e93e6802b47e1f3f1821a06bb60 100644 (file)
@@ -2,7 +2,7 @@
  * audio_output.c : audio output thread
  *****************************************************************************
  * Copyright (C) 1999, 2000, 2001 VideoLAN
- * $Id: audio_output.c,v 1.64 2001/06/12 18:16:49 stef Exp $
+ * $Id: audio_output.c,v 1.65 2001/11/05 15:22:44 massiot Exp $
  *
  * Authors: Michel Kaempf <maxx@via.ecp.fr>
  *
@@ -169,7 +169,7 @@ aout_thread_t *aout_CreateThread( int *pi_status )
     }
 
     /* Initialize the volume level */
-    p_aout->i_volume = VOLUME_DEFAULT;
+    p_aout->i_volume = main_GetIntVariable( AOUT_VOLUME_VAR, VOLUME_DEFAULT );
     p_aout->i_savedvolume = 0;
     
     /* FIXME: maybe it would be cleaner to change SpawnThread prototype
index 24977db9c44732d6b90d127dd88c4ac6d792b93a..a78cd27c0f3c42197b287a4e549ba5b01116856d 100644 (file)
@@ -4,7 +4,7 @@
  * and spawn threads.
  *****************************************************************************
  * Copyright (C) 1998, 1999, 2000 VideoLAN
- * $Id: main.c,v 1.120 2001/10/22 12:02:17 sam Exp $
+ * $Id: main.c,v 1.121 2001/11/05 15:22:44 massiot Exp $
  *
  * Authors: Vincent Seguin <seguin@via.ecp.fr>
  *          Samuel Hocevar <sam@zoy.org>
 #define OPT_STEREO              151
 #define OPT_MONO                152
 #define OPT_SPDIF               153
+#define OPT_VOLUME              154
 
 #define OPT_NOVIDEO             160
 #define OPT_DISPLAY             161
@@ -176,6 +177,7 @@ static const struct option longopts[] =
     {   "spdif",            0,          0,      OPT_SPDIF },
     {   "downmix",          1,          0,      OPT_DOWNMIX },
     {   "imdct",            1,          0,      OPT_IMDCT },
+    {   "volume",           1,          0,      OPT_VOLUME },
 
     /* Video options */
     {   "novideo",          0,          0,      OPT_NOVIDEO },
@@ -694,6 +696,9 @@ static int GetConfiguration( int *pi_argc, char *ppsz_argv[], char *ppsz_env[] )
         case OPT_IMDCT:                                           /* --imdct */
             main_PutPszVariable( IMDCT_METHOD_VAR, optarg );
             break;
+        case OPT_VOLUME:                                         /* --volume */
+            main_PutIntVariable( AOUT_VOLUME_VAR, atoi(optarg) );
+            break;
 
         /* Video options */
         case OPT_NOVIDEO:                                       /* --novideo */
@@ -871,6 +876,7 @@ static void Usage( int i_fashion )
           "\n      --spdif                    \tAC3 pass-through mode"
           "\n      --downmix <module>         \tAC3 downmix method"
           "\n      --imdct <module>           \tAC3 IMDCT method"
+          "\n      --volume [0..1024]         \tVLC output volume"
           "\n"
           "\n      --novideo                  \tdisable video"
           "\n  -V, --vout <module>            \tvideo output method"
@@ -923,6 +929,7 @@ static void Usage( int i_fashion )
         "\n  " AOUT_SPDIF_VAR "={1|0}                 \tAC3 pass-through mode"
         "\n  " DOWNMIX_METHOD_VAR "=<method name>     \tAC3 downmix method"
         "\n  " IMDCT_METHOD_VAR "=<method name>       \tAC3 IMDCT method"
+        "\n  " AOUT_VOLUME_VAR "=[0..1024]            \tVLC output volume"
         "\n  " AOUT_RATE_VAR "=<rate>                 \toutput rate" );
 
     /* Video parameters */