| 2479 | // ---------------------------------------------------------------------------------------------------------------- |
| 2480 | |
| 2481 | CFMutableDictionaryRef retrieveClassInfo() |
| 2482 | { |
| 2483 | CFMutableDictionaryRef clsInfo = CFDictionaryCreateMutable(nullptr, |
| 2484 | 0, |
| 2485 | &kCFTypeDictionaryKeyCallBacks, |
| 2486 | &kCFTypeDictionaryValueCallBacks); |
| 2487 | SInt32 value; |
| 2488 | |
| 2489 | value = 0; |
| 2490 | if (const CFNumberRef num = CFNumberCreate(nullptr, kCFNumberSInt32Type, &value)) |
| 2491 | { |
| 2492 | CFDictionarySetValue(clsInfo, CFSTR(kAUPresetVersionKey), num); |
| 2493 | CFRelease(num); |
| 2494 | } |
| 2495 | |
| 2496 | value = kType; |
| 2497 | if (const CFNumberRef num = CFNumberCreate(nullptr, kCFNumberSInt32Type, &value)) |
| 2498 | { |
| 2499 | CFDictionarySetValue(clsInfo, CFSTR(kAUPresetTypeKey), num); |
| 2500 | CFRelease(num); |
| 2501 | } |
| 2502 | |
| 2503 | value = kSubType; |
| 2504 | if (const CFNumberRef num = CFNumberCreate(nullptr, kCFNumberSInt32Type, &value)) |
| 2505 | { |
| 2506 | CFDictionarySetValue(clsInfo, CFSTR(kAUPresetSubtypeKey), num); |
| 2507 | CFRelease(num); |
| 2508 | } |
| 2509 | |
| 2510 | value = kManufacturer; |
| 2511 | if (const CFNumberRef num = CFNumberCreate(nullptr, kCFNumberSInt32Type, &value)) |
| 2512 | { |
| 2513 | CFDictionarySetValue(clsInfo, CFSTR(kAUPresetManufacturerKey), num); |
| 2514 | CFRelease(num); |
| 2515 | } |
| 2516 | |
| 2517 | #if DISTRHO_PLUGIN_WANT_PROGRAMS |
| 2518 | if (fCurrentProgram >= 0) |
| 2519 | { |
| 2520 | CFDictionarySetValue(clsInfo, CFSTR(kAUPresetNameKey), fFactoryPresetsData[fCurrentProgram].presetName); |
| 2521 | } |
| 2522 | else |
| 2523 | #endif |
| 2524 | { |
| 2525 | CFDictionarySetValue(clsInfo, CFSTR(kAUPresetNameKey), fUserPresetData.presetName); |
| 2526 | } |
| 2527 | |
| 2528 | if (const CFMutableDictionaryRef data = CFDictionaryCreateMutable(nullptr, |
| 2529 | 0, |
| 2530 | &kCFTypeDictionaryKeyCallBacks, |
| 2531 | &kCFTypeDictionaryValueCallBacks)) |
| 2532 | { |
| 2533 | #if DISTRHO_PLUGIN_WANT_PROGRAMS |
| 2534 | const SInt32 program = fCurrentProgram; |
| 2535 | if (const CFNumberRef programRef = CFNumberCreate(nullptr, kCFNumberSInt32Type, &program)) |
| 2536 | { |
| 2537 | CFDictionarySetValue(data, CFSTR("program"), programRef); |
| 2538 | CFRelease(programRef); |
no test coverage detected