Browse Source

MultiOutSynthPlugin: Avoid assertions in VST3PluginTestHost

pull/22/head
reuk 3 years ago
parent
commit
560e75da27
No known key found for this signature in database GPG Key ID: 9ADCD339CFC98A11
1 changed files with 13 additions and 5 deletions
  1. +13
    -5
      examples/Plugins/MultiOutSynthPluginDemo.h

+ 13
- 5
examples/Plugins/MultiOutSynthPluginDemo.h View File

@@ -123,6 +123,10 @@ public:
auto midiChannelBuffer = filterMidiMessagesForChannel (midiBuffer, busNr + 1);
auto audioBusBuffer = getBusBuffer (buffer, false, busNr);
// Voices add to the contents of the buffer. Make sure the buffer is clear before
// rendering, just in case the host left old data in the buffer.
audioBusBuffer.clear();
synth [busNr]->renderNextBlock (audioBusBuffer, midiChannelBuffer, 0, audioBusBuffer.getNumSamples());
}
}
@@ -146,11 +150,15 @@ public:
bool isBusesLayoutSupported (const BusesLayout& layout) const override
{
for (const auto& bus : layout.outputBuses)
if (bus != AudioChannelSet::stereo())
return false;
return layout.inputBuses.isEmpty() && 1 <= layout.outputBuses.size();
const auto& outputs = layout.outputBuses;
return layout.inputBuses.isEmpty()
&& 1 <= outputs.size()
&& outputs.getFirst() != AudioChannelSet::disabled()
&& std::all_of (outputs.begin(), outputs.end(), [] (const auto& bus)
{
return bus == AudioChannelSet::stereo() || bus == AudioChannelSet::disabled();
});
}
//==============================================================================


Loading…
Cancel
Save