MCPcopy Create free account
hub / github.com/TheForceEngine/TheForceEngine / openVirtualPort

Method openVirtualPort

TheForceEngine/TFE_Audio/RtMidi.cpp:1116–1136  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1114}
1115
1116void MidiInCore :: openVirtualPort( const std::string &portName )
1117{
1118 CoreMidiData *data = static_cast<CoreMidiData *> (apiData_);
1119
1120 // Create a virtual MIDI input destination.
1121 MIDIEndpointRef endpoint;
1122 CFStringRef portNameRef = CFStringCreateWithCString( NULL, portName.c_str(), kCFStringEncodingASCII );
1123 OSStatus result = MIDIDestinationCreate( data->client,
1124 portNameRef,
1125 midiInputCallback, (void *)&inputData_, &endpoint );
1126 CFRelease( portNameRef );
1127
1128 if ( result != noErr ) {
1129 errorString_ = "MidiInCore::openVirtualPort: error creating virtual OS-X MIDI destination.";
1130 error( RtMidiError::DRIVER_ERROR, errorString_ );
1131 return;
1132 }
1133
1134 // Save our api-specific connection information.
1135 data->endpoint = endpoint;
1136}
1137
1138void MidiInCore :: closePort( void )
1139{

Callers

nothing calls this directly

Calls 3

errorFunction · 0.85
c_strMethod · 0.80
sizeMethod · 0.45

Tested by

no test coverage detected