[vlc-commits] macosx: set max volume as configuable

David Fuhrmann git at videolan.org
Tue Jul 23 23:06:51 CEST 2013


vlc/vlc-2.1 | branch: master | David Fuhrmann <david.fuhrmann at googlemail.com> | Tue Jul 23 20:57:58 2013 +0200| [cbada27972702c14dd490536f79219168ec02f1c] | committer: David Fuhrmann

macosx: set max volume as configuable

no new strings.

close #8628
(cherry picked from commit ddf080f5f71bcd9f5631e66abc16ff6715ad9563)

Signed-off-by: David Fuhrmann <david.fuhrmann at googlemail.com>

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

 modules/gui/macosx/CoreInteraction.h |    2 ++
 modules/gui/macosx/CoreInteraction.m |    6 +++++-
 modules/gui/macosx/macosx.m          |    4 ++++
 3 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/modules/gui/macosx/CoreInteraction.h b/modules/gui/macosx/CoreInteraction.h
index ff67327..f6a8dc4 100644
--- a/modules/gui/macosx/CoreInteraction.h
+++ b/modules/gui/macosx/CoreInteraction.h
@@ -28,6 +28,8 @@
 @interface VLCCoreInteraction : NSObject {
     int i_currentPlaybackRate;
     mtime_t timeA, timeB;
+
+    float f_maxVolume;
 }
 + (VLCCoreInteraction *)sharedInstance;
 @property (readwrite) int volume;
diff --git a/modules/gui/macosx/CoreInteraction.m b/modules/gui/macosx/CoreInteraction.m
index e1e2aae..7ec78a5 100644
--- a/modules/gui/macosx/CoreInteraction.m
+++ b/modules/gui/macosx/CoreInteraction.m
@@ -558,7 +558,11 @@ static VLCCoreInteraction *_o_sharedInstance = nil;
 
 - (float)maxVolume
 {
-    return 1.2 * AOUT_VOLUME_DEFAULT;
+    if (f_maxVolume == 0.) {
+        f_maxVolume = (float)var_InheritInteger(VLCIntf, "macosx-max-volume") / 100. * AOUT_VOLUME_DEFAULT;
+    }
+
+    return f_maxVolume;
 }
 
 #pragma mark -
diff --git a/modules/gui/macosx/macosx.m b/modules/gui/macosx/macosx.m
index 4837bdd..bc40bc1 100644
--- a/modules/gui/macosx/macosx.m
+++ b/modules/gui/macosx/macosx.m
@@ -128,6 +128,9 @@ static const char *const itunes_list_text[] = {
     N_("Do nothing"), N_("Pause iTunes"), N_("Pause and resume iTunes")
 };
 
+#define VOLUME_MAX_TEXT N_("Maximum Volume displayed")
+
+
 vlc_module_begin()
     set_description(N_("Mac OS X interface"))
     set_capability("interface", 200)
@@ -144,6 +147,7 @@ vlc_module_begin()
         add_bool("macosx-show-playmode-buttons", false, PLAYMODEBUTTONS_TEXT, PLAYMODEBUTTONS_LONGTEXT, false)
         add_bool("macosx-show-effects-button", false, EFFECTSBUTTON_TEXT, EFFECTSBUTTON_LONGTEXT, false)
         add_bool("macosx-show-sidebar", true, SIDEBAR_TEXT, SIDEBAR_LONGTEXT, false)
+        add_integer_with_range("macosx-max-volume", 125, 60, 200, VOLUME_MAX_TEXT, VOLUME_MAX_TEXT, true)
 
     set_section(N_("Behavior"), 0)
         add_bool("macosx-autoplay", true, AUTOPLAY_OSX_TEST, AUTOPLAY_OSX_LONGTEXT, false)



More information about the vlc-commits mailing list