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:
parent
17a07a0057
commit
bc77b00700
2 changed files with 12 additions and 0 deletions
|
|
@ -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
|
||||||
|
|
|
||||||
|
|
@ -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));
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue