1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00

MIDI network session enabled for iOS simulator

This commit is contained in:
ed 2016-08-04 12:24:21 +01:00
parent 17a07a0057
commit bc77b00700
2 changed files with 12 additions and 0 deletions

View file

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

View file

@ -220,6 +220,14 @@ namespace CoreMidiHelpers
// correctly when called from the message thread! // correctly when called from the message thread!
jassert (MessageManager::getInstance()->isThisTheMessageThread()); 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; CoreMidiHelpers::ScopedCFString name;
name.cfString = getGlobalMidiClientName().toCFString(); name.cfString = getGlobalMidiClientName().toCFString();
CHECK_ERROR (MIDIClientCreate (name.cfString, &globalSystemChangeCallback, nullptr, &globalMidiClient)); CHECK_ERROR (MIDIClientCreate (name.cfString, &globalSystemChangeCallback, nullptr, &globalMidiClient));