diff options
| author | Gary Scavone <gary@music.mcgill.ca> | 2013-12-27 20:37:03 -0800 |
|---|---|---|
| committer | Gary Scavone <gary@music.mcgill.ca> | 2013-12-27 20:37:03 -0800 |
| commit | c80bfb62fe97c8d2176bd7f6d953682bf2c89384 (patch) | |
| tree | efa275510abc6aeef6765ceaf0baf784147deab9 /RtMidi.cpp | |
| parent | 408610f7b91afb25549369e951a5d899c936fc9a (diff) | |
OS-X dynamic device fix
Diffstat (limited to 'RtMidi.cpp')
| -rw-r--r-- | RtMidi.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
@@ -556,6 +556,7 @@ void MidiInCore :: openPort( unsigned int portNumber, const std::string portName return; } + CFRunLoopRunInMode( kCFRunLoopDefaultMode, 0, false ); unsigned int nSrc = MIDIGetNumberOfSources(); if (nSrc < 1) { errorString_ = "MidiInCore::openPort: no MIDI input sources found!"; @@ -633,6 +634,7 @@ void MidiInCore :: closePort( void ) unsigned int MidiInCore :: getPortCount() { + CFRunLoopRunInMode( kCFRunLoopDefaultMode, 0, false ); return MIDIGetNumberOfSources(); } @@ -768,6 +770,7 @@ std::string MidiInCore :: getPortName( unsigned int portNumber ) char name[128]; std::string stringName; + CFRunLoopRunInMode( kCFRunLoopDefaultMode, 0, false ); if ( portNumber >= MIDIGetNumberOfSources() ) { ost << "MidiInCore::getPortName: the 'portNumber' argument (" << portNumber << ") is invalid."; errorString_ = ost.str(); @@ -825,6 +828,7 @@ void MidiOutCore :: initialize( const std::string& clientName ) unsigned int MidiOutCore :: getPortCount() { + CFRunLoopRunInMode( kCFRunLoopDefaultMode, 0, false ); return MIDIGetNumberOfDestinations(); } @@ -836,6 +840,7 @@ std::string MidiOutCore :: getPortName( unsigned int portNumber ) char name[128]; std::string stringName; + CFRunLoopRunInMode( kCFRunLoopDefaultMode, 0, false ); if ( portNumber >= MIDIGetNumberOfDestinations() ) { ost << "MidiOutCore::getPortName: the 'portNumber' argument (" << portNumber << ") is invalid."; errorString_ = ost.str(); @@ -860,6 +865,7 @@ void MidiOutCore :: openPort( unsigned int portNumber, const std::string portNam return; } + CFRunLoopRunInMode( kCFRunLoopDefaultMode, 0, false ); unsigned int nDest = MIDIGetNumberOfDestinations(); if (nDest < 1) { errorString_ = "MidiOutCore::openPort: no MIDI output destinations found!"; @@ -1206,7 +1212,7 @@ extern "C" void *alsaMidiHandler( void *ptr ) if ( !( data->ignoreFlags & 0x02 ) ) doDecode = true; break; - case SND_SEQ_EVENT_TICK: // MIDI timing tick + case SND_SEQ_EVENT_CLOCK: // MIDI timing tick if ( !( data->ignoreFlags & 0x02 ) ) doDecode = true; break; @@ -2429,7 +2435,7 @@ public: throw std::runtime_error("CKsEnumFilters: no devices found"); // Loop through members of the set and get details for each - for (int iClassMember=0;;iClassMember++) { + for ( int iClassMember=0; iClassMember++ ) { try { SP_DEVICE_INTERFACE_DATA DID; DID.cbSize = sizeof(DID); |
