|
@@ -74,6 +74,8 @@ struct RtMidiInputDevice : midi::InputDevice { |
|
|
if (!userData) |
|
|
if (!userData) |
|
|
return; |
|
|
return; |
|
|
|
|
|
|
|
|
|
|
|
system::setThreadName("RtMidi input"); |
|
|
|
|
|
|
|
|
RtMidiInputDevice* midiInputDevice = (RtMidiInputDevice*) userData; |
|
|
RtMidiInputDevice* midiInputDevice = (RtMidiInputDevice*) userData; |
|
|
if (!midiInputDevice) |
|
|
if (!midiInputDevice) |
|
|
return; |
|
|
return; |
|
@@ -170,6 +172,8 @@ struct RtMidiOutputDevice : midi::OutputDevice { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
void runThread() { |
|
|
void runThread() { |
|
|
|
|
|
system::setThreadName("RtMidi output"); |
|
|
|
|
|
|
|
|
std::unique_lock<decltype(mutex)> lock(mutex); |
|
|
std::unique_lock<decltype(mutex)> lock(mutex); |
|
|
while (!stopped) { |
|
|
while (!stopped) { |
|
|
if (messageQueue.empty()) { |
|
|
if (messageQueue.empty()) { |
|
@@ -210,7 +214,8 @@ struct RtMidiOutputDevice : midi::OutputDevice { |
|
|
stopped = true; |
|
|
stopped = true; |
|
|
cv.notify_one(); |
|
|
cv.notify_one(); |
|
|
} |
|
|
} |
|
|
thread.join(); |
|
|
|
|
|
|
|
|
if (thread.joinable()) |
|
|
|
|
|
thread.join(); |
|
|
} |
|
|
} |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|