[vlc-devel] [PATCH 16/23] macosx: save/retrieve audio filters to/from the playlist

Victorien Le Couviour--Tuffet victorien.lecouviour.tuffet at gmail.com
Thu Jun 29 14:24:23 CEST 2017


---
 .../gui/macosx/VLCAudioEffectsWindowController.m    | 21 +++++----------------
 1 file changed, 5 insertions(+), 16 deletions(-)

diff --git a/modules/gui/macosx/VLCAudioEffectsWindowController.m b/modules/gui/macosx/VLCAudioEffectsWindowController.m
index 444edbbf37..246e2bd134 100644
--- a/modules/gui/macosx/VLCAudioEffectsWindowController.m
+++ b/modules/gui/macosx/VLCAudioEffectsWindowController.m
@@ -155,17 +155,7 @@
 
 - (void)setAudioFilter: (char *)psz_name on:(BOOL)b_on
 {
-    audio_output_t *p_aout = getAout();
-    intf_thread_t *p_intf = getIntf();
-    playlist_EnableAudioFilter(pl_Get(p_intf), psz_name, b_on);
-
-    if (p_aout) {
-        char *psz_new = var_GetNonEmptyString(p_aout, "audio-filter");
-        config_PutPsz(p_intf, "audio-filter", psz_new);
-        free(psz_new);
-
-        vlc_object_release(p_aout);
-    }
+    playlist_EnableAudioFilter(pl_Get(getIntf()), psz_name, b_on);
 }
 
 - (void)resetProfileSelector
@@ -457,7 +447,7 @@ static bool GetEqualizerStatus(intf_thread_t *p_custom_intf,
     if (!p_aout)
         return false;
 
-    psz_string = config_GetPsz(p_custom_intf, "audio-filter");
+    psz_string = var_InheritString(pl_Get(p_custom_intf), "audio-filter");
 
     if (!psz_string)
         psz_string = var_GetNonEmptyString(p_aout, "audio-filter");
@@ -602,7 +592,6 @@ static bool GetEqualizerStatus(intf_thread_t *p_custom_intf,
 
     /* save changed to config */
     config_PutPsz(getIntf(), "equalizer-bands", [[self generatePresetString] UTF8String]);
-
 }
 
 - (IBAction)equalizerChangePreset:(id)sender
@@ -745,7 +734,7 @@ static bool GetEqualizerStatus(intf_thread_t *p_custom_intf,
     intf_thread_t *p_intf = getIntf();
     BOOL bEnable_compressor = NO;
     char *psz_afilters;
-    psz_afilters = config_GetPsz(p_intf, "audio-filter");
+    psz_afilters = var_InheritString(pl_Get(p_intf), "audio-filter");
     if (psz_afilters) {
         bEnable_compressor = strstr(psz_afilters, "compressor") != NULL;
         [_compressorEnableCheckbox setState: (NSInteger)strstr(psz_afilters, "compressor") ];
@@ -850,7 +839,7 @@ static bool GetEqualizerStatus(intf_thread_t *p_custom_intf,
     intf_thread_t *p_intf = getIntf();
     BOOL bEnable_spatializer = NO;
     char *psz_afilters;
-    psz_afilters = config_GetPsz(p_intf, "audio-filter");
+    psz_afilters = var_InheritString(pl_Get(p_intf), "audio-filter");
     if (psz_afilters) {
         bEnable_spatializer = strstr(psz_afilters, "spatializer") != NULL;
         free(psz_afilters);
@@ -940,7 +929,7 @@ static bool GetEqualizerStatus(intf_thread_t *p_custom_intf,
     intf_thread_t *p_intf = getIntf();
     BOOL bEnable_normvol = NO;
     char *psz_afilters;
-    psz_afilters = config_GetPsz(p_intf, "audio-filter");
+    psz_afilters = var_InheritString(pl_Get(p_intf), "audio-filter");
     if (psz_afilters) {
         [_filterHeadPhoneCheckbox setState: (NSInteger)strstr(psz_afilters, "headphone") ];
         [_filterKaraokeCheckbox setState: (NSInteger)strstr(psz_afilters, "karaoke") ];
-- 
2.13.1



More information about the vlc-devel mailing list