[vlc-commits] macosx: audio filters: load audio-filters variable from preset correctly
David Fuhrmann
git at videolan.org
Wed Dec 13 22:52:30 CET 2017
vlc | branch: master | David Fuhrmann <dfuhrmann at videolan.org> | Wed Dec 13 21:46:31 2017 +0100| [9708d49b00e20126b84895a0bffdb57ab5d26e11] | committer: 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
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=9708d49b00e20126b84895a0bffdb57ab5d26e11
---
.../gui/macosx/VLCAudioEffectsWindowController.m | 24 ++++------------------
1 file changed, 4 insertions(+), 20 deletions(-)
diff --git a/modules/gui/macosx/VLCAudioEffectsWindowController.m b/modules/gui/macosx/VLCAudioEffectsWindowController.m
index 8a5ed1c7e8..50cbb2124b 100644
--- a/modules/gui/macosx/VLCAudioEffectsWindowController.m
+++ b/modules/gui/macosx/VLCAudioEffectsWindowController.m
@@ -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);
}
More information about the vlc-commits
mailing list