[vlc-devel] [PATCH] macosx: update EQ frequency labels according to VLC frequency setting
Marvin Scholz
epirat07 at gmail.com
Tue Jul 21 22:20:09 CEST 2020
On 21 Jul 2020, at 22:17, David Fuhrmann wrote:
>> Am 21.07.2020 um 21:05 schrieb Ron Wright
>> <logiconcepts819 at gmail.com>:
>>
>> An option exists for selecting between VLC frequency bands and ISO
>> frequency
>> bands for the audio equalizer; however, as of this writing, the text
>> labels in
>> the macOS interface do not quite reflect the selected option. (For
>> example, if
>> the option to use ISO frequencies is selected in preferences and VLC
>> is
>> restarted, VLC frequencies still appear in the effects interface.)
>> This patch
>> introduces a change that dynamically updates the frequency labels
>> according to
>> the VLC frequency setting.
>> ---
>> modules/gui/macosx/UI/AudioEffects.xib | 10 +++++++
>> .../panels/VLCAudioEffectsWindowController.h | 10 +++++++
>> .../panels/VLCAudioEffectsWindowController.m | 29
>> +++++++++++++++++++
>> 3 files changed, 49 insertions(+)
>>
>> diff --git a/modules/gui/macosx/UI/AudioEffects.xib
>> b/modules/gui/macosx/UI/AudioEffects.xib
>> index 6258bd8a91..7dfe6d1bb9 100644
>> --- a/modules/gui/macosx/UI/AudioEffects.xib
>> +++ b/modules/gui/macosx/UI/AudioEffects.xib
>> @@ -34,15 +34,25 @@
>> <outlet property="compressorResetButton"
>> destination="621" id="B33-wI-ncD"/>
>> <outlet property="compressorView" destination="723"
>> id="Lf1-bS-Ric"/>
>> <outlet property="equalizerBand10Slider"
>> destination="216" id="XGb-IB-1IO"/>
>> + <outlet property="equalizerBand10TextField"
>> destination="111" id="4NH-3f-BCQ"/>
>> <outlet property="equalizerBand1Slider"
>> destination="198" id="7rF-1A-pv4"/>
>> + <outlet property="equalizerBand1TextField"
>> destination="95" id="akP-MF-Ndm"/>
>> <outlet property="equalizerBand2Slider"
>> destination="200" id="yRm-sh-ahX"/>
>> + <outlet property="equalizerBand2TextField"
>> destination="96" id="ara-Pz-sRL"/>
>> <outlet property="equalizerBand3Slider"
>> destination="202" id="5OD-N2-BPy"/>
>> + <outlet property="equalizerBand3TextField"
>> destination="101" id="81b-Za-oun"/>
>> <outlet property="equalizerBand4Slider"
>> destination="204" id="mW0-5k-BqH"/>
>> + <outlet property="equalizerBand4TextField"
>> destination="100" id="RTD-vn-ukR"/>
>> <outlet property="equalizerBand5Slider"
>> destination="206" id="Ql0-VZ-G95"/>
>> + <outlet property="equalizerBand5TextField"
>> destination="102" id="Wfj-ky-8Lu"/>
>> <outlet property="equalizerBand6Slider"
>> destination="208" id="5rp-16-qZS"/>
>> + <outlet property="equalizerBand6TextField"
>> destination="107" id="kFt-de-0Uo"/>
>> <outlet property="equalizerBand7Slider"
>> destination="210" id="NX9-KD-cd8"/>
>> + <outlet property="equalizerBand7TextField"
>> destination="109" id="Lsa-7i-HKt"/>
>> <outlet property="equalizerBand8Slider"
>> destination="212" id="X9a-hy-G3f"/>
>> + <outlet property="equalizerBand8TextField"
>> destination="104" id="r1J-uW-c4E"/>
>> <outlet property="equalizerBand9Slider"
>> destination="214" id="UCy-aA-wav"/>
>> + <outlet property="equalizerBand9TextField"
>> destination="110" id="sMJ-Jm-Z7c"/>
>> <outlet property="equalizerEnableCheckbox"
>> destination="192" id="eV2-Qt-hd1"/>
>> <outlet property="equalizerPreampLabel"
>> destination="93" id="F5G-xX-9qX"/>
>> <outlet property="equalizerPreampSlider"
>> destination="196" id="DFs-vD-QFY"/>
>> diff --git
>> a/modules/gui/macosx/panels/VLCAudioEffectsWindowController.h
>> b/modules/gui/macosx/panels/VLCAudioEffectsWindowController.h
>> index 951b81207b..1cefa493d6 100644
>> --- a/modules/gui/macosx/panels/VLCAudioEffectsWindowController.h
>> +++ b/modules/gui/macosx/panels/VLCAudioEffectsWindowController.h
>> @@ -40,15 +40,25 @@
>> @property (readwrite, weak) IBOutlet NSTextField
>> *equalizerPreampLabel;
>> @property (readwrite, weak) IBOutlet NSPopUpButton
>> *equalizerPresetsPopup;
>> @property (readwrite, weak) IBOutlet NSSlider *equalizerBand1Slider;
>> + at property (readwrite, weak) IBOutlet NSTextField
>> *equalizerBand1TextField;
>> @property (readwrite, weak) IBOutlet NSSlider *equalizerBand2Slider;
>> + at property (readwrite, weak) IBOutlet NSTextField
>> *equalizerBand2TextField;
>> @property (readwrite, weak) IBOutlet NSSlider *equalizerBand3Slider;
>> + at property (readwrite, weak) IBOutlet NSTextField
>> *equalizerBand3TextField;
>> @property (readwrite, weak) IBOutlet NSSlider *equalizerBand4Slider;
>> + at property (readwrite, weak) IBOutlet NSTextField
>> *equalizerBand4TextField;
>> @property (readwrite, weak) IBOutlet NSSlider *equalizerBand5Slider;
>> + at property (readwrite, weak) IBOutlet NSTextField
>> *equalizerBand5TextField;
>> @property (readwrite, weak) IBOutlet NSSlider *equalizerBand6Slider;
>> + at property (readwrite, weak) IBOutlet NSTextField
>> *equalizerBand6TextField;
>> @property (readwrite, weak) IBOutlet NSSlider *equalizerBand7Slider;
>> + at property (readwrite, weak) IBOutlet NSTextField
>> *equalizerBand7TextField;
>> @property (readwrite, weak) IBOutlet NSSlider *equalizerBand8Slider;
>> + at property (readwrite, weak) IBOutlet NSTextField
>> *equalizerBand8TextField;
>> @property (readwrite, weak) IBOutlet NSSlider *equalizerBand9Slider;
>> + at property (readwrite, weak) IBOutlet NSTextField
>> *equalizerBand9TextField;
>> @property (readwrite, weak) IBOutlet NSSlider *equalizerBand10Slider;
>> + at property (readwrite, weak) IBOutlet NSTextField
>> *equalizerBand10TextField;
>> @property (readwrite, weak) IBOutlet NSSlider *equalizerPreampSlider;
>>
>> /* Compressor */
>> diff --git
>> a/modules/gui/macosx/panels/VLCAudioEffectsWindowController.m
>> b/modules/gui/macosx/panels/VLCAudioEffectsWindowController.m
>> index 2015c1f72b..3576878486 100644
>> --- a/modules/gui/macosx/panels/VLCAudioEffectsWindowController.m
>> +++ b/modules/gui/macosx/panels/VLCAudioEffectsWindowController.m
>> @@ -686,6 +686,7 @@ - (void)equalizerUpdated
>> audio_output_t *p_aout = [_playerController mainAudioOutput];
>> if (!p_aout)
>> return;
>> + bool b_vlcfreqs = var_InheritBool(p_aout, "equalizer-vlcfreqs");
>> bool b_2p = var_CreateGetBool(p_aout, "equalizer-2pass");
>> bool bEnabled = GetEqualizerStatus(p_intf, _playerController,
>> (char *)"equalizer");
>>
>> @@ -702,6 +703,34 @@ - (void)equalizerUpdated
>> [_equalizerView enableSubviews: bEnabled];
>> [_equalizerEnableCheckbox setState: bEnabled];
>> [_equalizerTwoPassCheckbox setState: b_2p];
>> +
>> + /* Set the frequency labels */
>> + if (b_vlcfreqs)
>> + {
>> + [_equalizerBand1TextField setStringValue:_NS("60")];
>> + [_equalizerBand2TextField setStringValue:_NS("170")];
>> + [_equalizerBand3TextField setStringValue:_NS("310")];
>> + [_equalizerBand4TextField setStringValue:_NS("600")];
>> + [_equalizerBand5TextField setStringValue:_NS("1K")];
>> + [_equalizerBand6TextField setStringValue:_NS("3K")];
>> + [_equalizerBand7TextField setStringValue:_NS("6K")];
>> + [_equalizerBand8TextField setStringValue:_NS("12K")];
>> + [_equalizerBand9TextField setStringValue:_NS("14K")];
>> + [_equalizerBand10TextField setStringValue:_NS("16K")];
>> + }
>> + else
>> + {
>> + [_equalizerBand1TextField setStringValue:_NS("31")];
>> + [_equalizerBand2TextField setStringValue:_NS("63")];
>> + [_equalizerBand3TextField setStringValue:_NS("125")];
>> + [_equalizerBand4TextField setStringValue:_NS("250")];
>> + [_equalizerBand5TextField setStringValue:_NS("500")];
>> + [_equalizerBand6TextField setStringValue:_NS("1K")];
>> + [_equalizerBand7TextField setStringValue:_NS("2K")];
>> + [_equalizerBand8TextField setStringValue:_NS("4K")];
>> + [_equalizerBand9TextField setStringValue:_NS("8K")];
>> + [_equalizerBand10TextField setStringValue:_NS("16K")];
>> + }
>
> Is it really necessary to translate (almost) pure numbers? Especially
> as they do not seem to be translated before?
>
Thanks for the patch!
I agree with David though that the numbers should not be translated, so
it would be nice if you could submit a new version with them not
translated.
(Just replace the _NS() with @)
> BR. David
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel
More information about the vlc-devel
mailing list