Commit 78885615 authored by Christophe Massiot's avatar Christophe Massiot

New --volume option (untested, like usual :).

parent e160ea97
...@@ -271,6 +271,9 @@ ...@@ -271,6 +271,9 @@
#define VOLUME_STEP 128 #define VOLUME_STEP 128
#define VOLUME_MAX 1024 #define VOLUME_MAX 1024
/* Environment variable for volume */
#define AOUT_VOLUME_VAR "vlc_volume"
/* Environment variable for output rate, and default value */ /* Environment variable for output rate, and default value */
#define AOUT_RATE_VAR "vlc_audio_rate" #define AOUT_RATE_VAR "vlc_audio_rate"
#define AOUT_RATE_DEFAULT 44100 #define AOUT_RATE_DEFAULT 44100
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* audio_output.c : audio output thread * audio_output.c : audio output thread
***************************************************************************** *****************************************************************************
* Copyright (C) 1999, 2000, 2001 VideoLAN * 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> * Authors: Michel Kaempf <maxx@via.ecp.fr>
* *
...@@ -169,7 +169,7 @@ aout_thread_t *aout_CreateThread( int *pi_status ) ...@@ -169,7 +169,7 @@ aout_thread_t *aout_CreateThread( int *pi_status )
} }
/* Initialize the volume level */ /* 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; p_aout->i_savedvolume = 0;
/* FIXME: maybe it would be cleaner to change SpawnThread prototype /* FIXME: maybe it would be cleaner to change SpawnThread prototype
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
* and spawn threads. * and spawn threads.
***************************************************************************** *****************************************************************************
* Copyright (C) 1998, 1999, 2000 VideoLAN * 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> * Authors: Vincent Seguin <seguin@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org> * Samuel Hocevar <sam@zoy.org>
...@@ -107,6 +107,7 @@ ...@@ -107,6 +107,7 @@
#define OPT_STEREO 151 #define OPT_STEREO 151
#define OPT_MONO 152 #define OPT_MONO 152
#define OPT_SPDIF 153 #define OPT_SPDIF 153
#define OPT_VOLUME 154
#define OPT_NOVIDEO 160 #define OPT_NOVIDEO 160
#define OPT_DISPLAY 161 #define OPT_DISPLAY 161
...@@ -176,6 +177,7 @@ static const struct option longopts[] = ...@@ -176,6 +177,7 @@ static const struct option longopts[] =
{ "spdif", 0, 0, OPT_SPDIF }, { "spdif", 0, 0, OPT_SPDIF },
{ "downmix", 1, 0, OPT_DOWNMIX }, { "downmix", 1, 0, OPT_DOWNMIX },
{ "imdct", 1, 0, OPT_IMDCT }, { "imdct", 1, 0, OPT_IMDCT },
{ "volume", 1, 0, OPT_VOLUME },
/* Video options */ /* Video options */
{ "novideo", 0, 0, OPT_NOVIDEO }, { "novideo", 0, 0, OPT_NOVIDEO },
...@@ -694,6 +696,9 @@ static int GetConfiguration( int *pi_argc, char *ppsz_argv[], char *ppsz_env[] ) ...@@ -694,6 +696,9 @@ static int GetConfiguration( int *pi_argc, char *ppsz_argv[], char *ppsz_env[] )
case OPT_IMDCT: /* --imdct */ case OPT_IMDCT: /* --imdct */
main_PutPszVariable( IMDCT_METHOD_VAR, optarg ); main_PutPszVariable( IMDCT_METHOD_VAR, optarg );
break; break;
case OPT_VOLUME: /* --volume */
main_PutIntVariable( AOUT_VOLUME_VAR, atoi(optarg) );
break;
/* Video options */ /* Video options */
case OPT_NOVIDEO: /* --novideo */ case OPT_NOVIDEO: /* --novideo */
...@@ -871,6 +876,7 @@ static void Usage( int i_fashion ) ...@@ -871,6 +876,7 @@ static void Usage( int i_fashion )
"\n --spdif \tAC3 pass-through mode" "\n --spdif \tAC3 pass-through mode"
"\n --downmix <module> \tAC3 downmix method" "\n --downmix <module> \tAC3 downmix method"
"\n --imdct <module> \tAC3 IMDCT method" "\n --imdct <module> \tAC3 IMDCT method"
"\n --volume [0..1024] \tVLC output volume"
"\n" "\n"
"\n --novideo \tdisable video" "\n --novideo \tdisable video"
"\n -V, --vout <module> \tvideo output method" "\n -V, --vout <module> \tvideo output method"
...@@ -923,6 +929,7 @@ static void Usage( int i_fashion ) ...@@ -923,6 +929,7 @@ static void Usage( int i_fashion )
"\n " AOUT_SPDIF_VAR "={1|0} \tAC3 pass-through mode" "\n " AOUT_SPDIF_VAR "={1|0} \tAC3 pass-through mode"
"\n " DOWNMIX_METHOD_VAR "=<method name> \tAC3 downmix method" "\n " DOWNMIX_METHOD_VAR "=<method name> \tAC3 downmix method"
"\n " IMDCT_METHOD_VAR "=<method name> \tAC3 IMDCT 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" ); "\n " AOUT_RATE_VAR "=<rate> \toutput rate" );
/* Video parameters */ /* Video parameters */
......
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