User Settings: Obey standards

Replace "midi.plugin" with "midiPlugin", as per the value naming
conventions that Apple set out. Migrate the old value if found.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
CQTexperiment
Christopher Snowhill 2022-01-29 16:38:53 -08:00
parent 85fd3836c0
commit 7e5107d431
2 changed files with 11 additions and 5 deletions

View File

@ -485,7 +485,7 @@ void* kAppControllerContext = &kAppControllerContext;
[userDefaultsValuesDict setObject:[NSNumber numberWithInteger:-1] forKey:@"lastTrackPlaying"];
[userDefaultsValuesDict setObject:[NSNumber numberWithDouble:0] forKey:@"lastTrackPosition"];
[userDefaultsValuesDict setObject:@"dls appl" forKey:@"midi.plugin"];
[userDefaultsValuesDict setObject:@"dls appl" forKey:@"midiPlugin"];
[userDefaultsValuesDict setObject:@"default" forKey:@"midi.flavor"];
@ -507,8 +507,14 @@ void* kAppControllerContext = &kAppControllerContext;
[[NSUserDefaults standardUserDefaults] setValue:feedURLdefault forKey:@"SUFeedURL"];
}
if ([[[NSUserDefaults standardUserDefaults] stringForKey:@"midi.plugin"] isEqualToString:@"BASSMIDI"]) {
[[NSUserDefaults standardUserDefaults] setValue:@"FluidSynth" forKey:@"midi.plugin"];
if ([[[NSUserDefaults standardUserDefaults] stringForKey:@"midiPlugin"] isEqualToString:@"BASSMIDI"]) {
[[NSUserDefaults standardUserDefaults] setValue:@"FluidSynth" forKey:@"midiPlugin"];
}
NSString * oldMidiPlugin = [[NSUserDefaults standardUserDefaults] stringForKey:@"midi.plugin"];
if (oldMidiPlugin) {
[[NSUserDefaults standardUserDefaults] setValue:oldMidiPlugin forKey:@"midiPlugin"];
[[NSUserDefaults standardUserDefaults] removeObjectForKey:@"midi.plugin"];
}
}

View File

@ -183,13 +183,13 @@ static OSType getOSType(const char * in_)
[[NSUserDefaults standardUserDefaults] setValue:globalSoundFontPath forKey:@"soundFontPath"];
}
NSString * plugin = [[NSUserDefaults standardUserDefaults] stringForKey:@"midi.plugin"];
NSString * plugin = [[NSUserDefaults standardUserDefaults] stringForKey:@"midiPlugin"];
// Then detect if we should force the DLSMusicSynth, which has its own bank
if (!plugin || [plugin isEqualToString:@"FluidSynth"]) {
if (!globalSoundFontPath || [globalSoundFontPath isEqualToString:@""]) {
plugin = @"dls appl"; // Apple DLSMusicSynth if soundfont doesn't exist
[[NSUserDefaults standardUserDefaults] setValue:plugin forKey:@"midi.plugin"];
[[NSUserDefaults standardUserDefaults] setValue:plugin forKey:@"midiPlugin"];
}
}