[vlc-commits] aout: --volume-save to retain volume, enabled by default
Rémi Denis-Courmont
git at videolan.org
Tue Apr 17 19:26:21 CEST 2012
vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Tue Apr 17 20:11:38 2012 +0300| [b0fdf364b5882591ce5477bc3246b4b6a55c884b] | committer: Rémi Denis-Courmont
aout: --volume-save to retain volume, enabled by default
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=b0fdf364b5882591ce5477bc3246b4b6a55c884b
---
src/audio_output/intf.c | 2 ++
src/libvlc-module.c | 6 ++++++
2 files changed, 8 insertions(+), 0 deletions(-)
diff --git a/src/audio_output/intf.c b/src/audio_output/intf.c
index e8fff11..3a89d2b 100644
--- a/src/audio_output/intf.c
+++ b/src/audio_output/intf.c
@@ -87,6 +87,8 @@ static int commitVolume (vlc_object_t *obj, audio_output_t *aout,
/* update caller (input manager) volume */
var_SetInteger (obj, "volume", volume);
var_SetBool (obj, "mute", mute);
+ if (var_InheritBool (obj, "volume-save"))
+ config_PutInt (obj, "volume", volume);
if (aout != NULL)
{
diff --git a/src/libvlc-module.c b/src/libvlc-module.c
index 483695c..5c90584 100644
--- a/src/libvlc-module.c
+++ b/src/libvlc-module.c
@@ -277,6 +277,11 @@ static const char *const ppsz_snap_formats[] =
"in a range from 0 to 1024." )
#define AOUT_VOLUME_STEP 32
+#define VOLUME_SAVE_TEXT N_( "Remember the audio volume" )
+#define VOLUME_SAVE_LONGTEXT N_( \
+ "The volume can be recorded and automatically restored next time " \
+ "VLC is used." )
+
#define AOUT_RATE_TEXT N_("Audio output frequency (Hz)")
#define AOUT_RATE_LONGTEXT N_( \
"You can force the audio output frequency here. Common values are " \
@@ -1591,6 +1596,7 @@ vlc_module_begin ()
add_integer_with_range( "volume-step", AOUT_VOLUME_STEP, 0,
AOUT_VOLUME_MAX, VOLUME_STEP_TEXT,
VOLUME_STEP_LONGTEXT, true )
+ add_bool( "volume-save", true, VOLUME_SAVE_TEXT, VOLUME_SAVE_TEXT, true )
add_obsolete_integer( "aout-rate" ) /* since 2.0.0 */
#if HAVE_FPU && !defined( __APPLE__ )
add_bool( "hq-resampling", 1, AOUT_RESAMP_TEXT,
More information about the vlc-commits
mailing list