Commit 8a87b3a3 authored by David Fuhrmann's avatar David Fuhrmann

macosx: audio filters: load audio-filters variable from preset correctly

Load audio filters correctly. Previously, only new filters were
added, but removed filters not disabled.
playlist_EnableAudioFilter ensures correct filter order in addition
to modifying the audio-filters variable. As the profile string is
created and changed with playlist_EnableAudioFilter, the saved
string conforms to the rules, so here it can be directly loaded.

Also removes redundant UI updates, which are done in a different
method already.

refs #19260

(cherry picked from commit 9708d49b)
Signed-off-by: default avatarDavid Fuhrmann <dfuhrmann@videolan.org>
parent 74937772
......@@ -154,17 +154,10 @@
var_SetString(p_playlist, "equalizer-preset", psz_eq_preset);
/* filter handling */
NSString *tempString = B64DecNSStr([items objectAtIndex:1]);
NSArray *tempArray;
NSUInteger count;
/* enable the new filters */
if ([tempString length] > 0) {
tempArray = [tempString componentsSeparatedByString:@":"];
count = [tempArray count];
for (NSUInteger x = 0; x < count; x++)
playlist_EnableAudioFilter(p_playlist, [[tempArray objectAtIndex:x] UTF8String], true);
}
NSString *audioFilters = B64DecNSStr([items objectAtIndex:1]);
if (p_aout)
var_SetString(p_aout, "audio-filter", audioFilters.UTF8String);
var_SetString(p_playlist, "audio-filter", audioFilters.UTF8String);
NSInteger presetIndex = [self getPresetIndexForProfile:profileIndex];
......@@ -208,15 +201,6 @@
var_SetString(p_aout, "equalizer-preset", [[[defaults objectForKey:@"EQNames"] objectAtIndex:presetIndex] UTF8String]);
}
/* update UI */
BOOL b_equalizerEnabled = [tempString rangeOfString:@"equalizer"].location != NSNotFound;
[_equalizerView enableSubviews:b_equalizerEnabled];
[_equalizerEnableCheckbox setState:(b_equalizerEnabled ? NSOnState : NSOffState)];
[_equalizerTwoPassCheckbox setState:[[items objectAtIndex:15] intValue]];
[defaults synchronize];
if (p_aout)
vlc_object_release(p_aout);
}
......
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