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:
parent
87fcf2f353
commit
68e0e0e329
2 changed files with 17 additions and 1 deletions
|
|
@ -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();
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue