mirror of
https://github.com/Ardour/ardour.git
synced 2026-01-16 02:16:09 +01:00
fix borked discovery of factory presets
git-svn-id: svn://localhost/ardour2/branches/2.0-ongoing@6395 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
parent
95566ba565
commit
7269bab49c
1 changed files with 8 additions and 10 deletions
|
|
@ -388,19 +388,15 @@ void
|
|||
AUPlugin::discover_factory_presets ()
|
||||
{
|
||||
CFArrayRef presets;
|
||||
UInt32 dataSize = 0;
|
||||
OSStatus err = unit->GetPropertyInfo (kAudioUnitProperty_FactoryPresets,
|
||||
kAudioUnitScope_Global, 0,
|
||||
&dataSize, NULL);
|
||||
if (err || !dataSize) {
|
||||
/* no presets? */
|
||||
UInt32 dataSize = sizeof (presets);
|
||||
OSStatus err;
|
||||
|
||||
if ((err = unit->GetProperty (kAudioUnitProperty_FactoryPresets, kAudioUnitScope_Global, 0, (void*) &presets, &dataSize)) != 0) {
|
||||
cerr << "cannot get factory preset info: " << err << endl;
|
||||
return;
|
||||
}
|
||||
|
||||
dataSize = sizeof (presets);
|
||||
|
||||
if ((err = unit->GetProperty (kAudioUnitProperty_FactoryPresets, kAudioUnitScope_Global, 0, (void*) &presets, &dataSize)) != 0) {
|
||||
cerr << "cannot get factory preset info: " << err << endl;
|
||||
if (!presets) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -412,6 +408,8 @@ AUPlugin::discover_factory_presets ()
|
|||
string name = CFStringRefToStdString (preset->presetName);
|
||||
factory_preset_map[name] = preset->presetNumber;
|
||||
}
|
||||
|
||||
CFRelease (presets);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue