Equalizer: Prevent circular application of presets
This prevents the apply presets function from resaving the preset number and retriggering itself repeatedly, which would cause a crash. Fixes #223 Signed-off-by: Christopher Snowhill <kode54@gmail.com>CQTexperiment
parent
e695e36599
commit
abffadef4e
|
@ -715,6 +715,10 @@ void equalizerApplyPreset(AudioUnit au, NSDictionary * preset) {
|
||||||
{
|
{
|
||||||
NSInteger index = [sender indexOfSelectedItem];
|
NSInteger index = [sender indexOfSelectedItem];
|
||||||
|
|
||||||
|
// Prevent circular application
|
||||||
|
if (index == [[[NSUserDefaultsController sharedUserDefaultsController] defaults] integerForKey:@"GraphicEQpreset"])
|
||||||
|
return;
|
||||||
|
|
||||||
if (index < [equalizer_presets_processed count])
|
if (index < [equalizer_presets_processed count])
|
||||||
{
|
{
|
||||||
NSDictionary * preset = [equalizer_presets_processed objectAtIndex:index];
|
NSDictionary * preset = [equalizer_presets_processed objectAtIndex:index];
|
||||||
|
|
Loading…
Reference in New Issue