From c0094bd986ceb9a4491aa429c23e32d8a9bbdf41 Mon Sep 17 00:00:00 2001 From: jules Date: Sun, 19 May 2013 15:23:18 -0600 Subject: [PATCH] AudioUnit hosting name fix. --- .../juce_AudioUnitPluginFormat.mm | 23 +++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/modules/juce_audio_processors/format_types/juce_AudioUnitPluginFormat.mm b/modules/juce_audio_processors/format_types/juce_AudioUnitPluginFormat.mm index 0cca25a2fa..98e647a387 100644 --- a/modules/juce_audio_processors/format_types/juce_AudioUnitPluginFormat.mm +++ b/modules/juce_audio_processors/format_types/juce_AudioUnitPluginFormat.mm @@ -120,15 +120,14 @@ namespace AudioUnitFormatHelpers DBG ("AU name: " + name); } - if (name.isNotEmpty()) + if (name.containsChar (':')) { manufacturer = name.upToFirstOccurrenceOf (":", false, false).trim(); name = name.fromFirstOccurrenceOf (":", false, false).trim(); } - else - { + + if (name.isEmpty()) name = ""; - } } bool getComponentDescFromIdentifier (const String& fileOrIdentifier, AudioComponentDescription& desc, @@ -153,6 +152,22 @@ namespace AudioUnitFormatHelpers if (AudioComponent comp = AudioComponentFindNext (0, &desc)) { getNameAndManufacturer (comp, name, manufacturer); + + if (manufacturer.isEmpty()) + manufacturer = tokens[2]; + + if (version.isEmpty()) + { + UInt32 versionNum; + + if (AudioComponentGetVersion (comp, &versionNum) == noErr) + { + version << (int) (versionNum >> 16) << "." + << (int) ((versionNum >> 8) & 0xff) << "." + << (int) (versionNum & 0xff); + } + } + return true; } }