| 1114 | } |
| 1115 | |
| 1116 | void 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 | |
| 1138 | void MidiInCore :: closePort( void ) |
| 1139 | { |