1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00

Use MidiOutput::sendBlockOfMessages() in AudioProcessorPlayer to send timestamped MIDI messages

This commit is contained in:
ed 2020-06-12 15:37:05 +01:00
parent 87fcf2f353
commit 68e0e0e329
2 changed files with 17 additions and 1 deletions

View file

@ -337,6 +337,11 @@ public:
*/
void stopBackgroundThread();
/** Returns true if the background thread used to send blocks of data is running.
@see startBackgroundThread, stopBackgroundThread
*/
bool isBackgroundThreadRunning() const noexcept { return isThreadRunning(); }
//==============================================================================
/** Deprecated. */
static StringArray getDevices();

View file

@ -165,7 +165,18 @@ void AudioProcessorPlayer::audioDeviceIOCallback (const float** const inputChann
}
if (midiOutput != nullptr)
midiOutput->sendBlockOfMessagesNow (incomingMidi);
{
if (midiOutput->isBackgroundThreadRunning())
{
midiOutput->sendBlockOfMessages (incomingMidi,
Time::getMillisecondCounterHiRes(),
sampleRate);
}
else
{
midiOutput->sendBlockOfMessagesNow (incomingMidi);
}
}
return;
}