From de251d36edfe688510ab0c9b8cb32e5e77d2d1e0 Mon Sep 17 00:00:00 2001 From: ed Date: Thu, 14 Mar 2019 12:42:09 +0000 Subject: [PATCH] macOS: Fallback for creating unique ID for MIDI ports if the bundleRef isn't created --- modules/juce_audio_devices/native/juce_mac_CoreMidi.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/modules/juce_audio_devices/native/juce_mac_CoreMidi.cpp b/modules/juce_audio_devices/native/juce_mac_CoreMidi.cpp index 5ae9155f72..b22b475c04 100644 --- a/modules/juce_audio_devices/native/juce_mac_CoreMidi.cpp +++ b/modules/juce_audio_devices/native/juce_mac_CoreMidi.cpp @@ -197,9 +197,10 @@ namespace CoreMidiHelpers } #endif - if (uniqueID.isNotEmpty()) - uniqueID += "." + deviceName + (isInput ? ".input" : ".output"); + if (uniqueID.isEmpty()) + uniqueID = String (Random::getSystemRandom().nextInt (1024)); + uniqueID += "." + deviceName + (isInput ? ".input" : ".output"); return uniqueID.hashCode(); }