Browse Source

MIDI network session enabled for iOS simulator

tags/2021-05-28
ed 9 years ago
parent
commit
bc77b00700
2 changed files with 12 additions and 0 deletions
  1. +4
    -0
      modules/juce_audio_devices/juce_audio_devices.cpp
  2. +8
    -0
      modules/juce_audio_devices/native/juce_mac_CoreMidi.cpp

+ 4
- 0
modules/juce_audio_devices/juce_audio_devices.cpp View File

@@ -55,6 +55,10 @@
#import <AVFoundation/AVFoundation.h>
#import <CoreMIDI/MIDIServices.h>
#if TARGET_OS_SIMULATOR
#import <CoreMIDI/MIDINetworkSession.h>
#endif
//==============================================================================
#elif JUCE_WINDOWS
#if JUCE_WASAPI


+ 8
- 0
modules/juce_audio_devices/native/juce_mac_CoreMidi.cpp View File

@@ -220,6 +220,14 @@ namespace CoreMidiHelpers
// correctly when called from the message thread!
jassert (MessageManager::getInstance()->isThisTheMessageThread());
#if TARGET_OS_SIMULATOR
// Enable MIDI for iOS simulator
MIDINetworkSession* session = [MIDINetworkSession defaultSession];
session.enabled = YES;
session.connectionPolicy = MIDINetworkConnectionPolicy_Anyone;
#endif
CoreMidiHelpers::ScopedCFString name;
name.cfString = getGlobalMidiClientName().toCFString();
CHECK_ERROR (MIDIClientCreate (name.cfString, &globalSystemChangeCallback, nullptr, &globalMidiClient));


Loading…
Cancel
Save