Fix backwards compatibility with 64ch REAPER versions #267
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Setting
BusesProperties
in aAudioProcessor
ctor sets the default layout for the plugin.If this is 128 channels, REAPER v6.x will still instantiate the plugin and appear happy with it, but never call the
processBlock
method, so level monitoring, export and DSP will not run.Therefore, it is necessary to know if we are running under REAPER with a 64 channel limitation within the plugins. The extension already provided an exposed function to do this, which could be called via the
DetermineChannelCount
helper. A handle to the host is grabbed viasetIHostApplication
- however, this is only called AFTER the plugin has been constructed, when we would need to set the default layout.A bus can be resized at any time using the JUCE
setChannelLayoutOfBus
function. However, this always seems to return false if there is more than one bus in the layout (not sure if a bug in JUCE/VST3/REAPER, but it is a blocker in any case). For this reason, plugin layouts had to be changed to a single bus ofdiscreteChannels
so they can be resized after construction.Additionally, there are some peculiarities with calls from the host to
isBusesLayoutSupported
- dozens of configurations are queried with quite unusual layout types. The actual set layout isn't always queried, so the calls would always return false. To simplify this, so long as the input and output channel counts match, we return true. Ultimately we're not bothered what the buses actually are as everything we do works entirely on a per-channel basis.