mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-29 02:40:05 +00:00
Added support for selecting fewer input/output channels than the max supported by the plug-in in the standalone plug-in audio settings
This commit is contained in:
parent
7484ac3dd3
commit
133b068dcb
1 changed files with 10 additions and 25 deletions
|
|
@ -255,36 +255,23 @@ public:
|
|||
{
|
||||
DialogWindow::LaunchOptions o;
|
||||
|
||||
int minNumInputs = std::numeric_limits<int>::max(), maxNumInputs = 0,
|
||||
minNumOutputs = std::numeric_limits<int>::max(), maxNumOutputs = 0;
|
||||
|
||||
auto updateMinAndMax = [] (int newValue, int& minValue, int& maxValue)
|
||||
{
|
||||
minValue = jmin (minValue, newValue);
|
||||
maxValue = jmax (maxValue, newValue);
|
||||
};
|
||||
int maxNumInputs = 0, maxNumOutputs = 0;
|
||||
|
||||
if (channelConfiguration.size() > 0)
|
||||
{
|
||||
auto defaultConfig = channelConfiguration.getReference (0);
|
||||
updateMinAndMax ((int) defaultConfig.numIns, minNumInputs, maxNumInputs);
|
||||
updateMinAndMax ((int) defaultConfig.numOuts, minNumOutputs, maxNumOutputs);
|
||||
auto& defaultConfig = channelConfiguration.getReference (0);
|
||||
|
||||
maxNumInputs = jmax (0, (int) defaultConfig.numIns);
|
||||
maxNumOutputs = jmax (0, (int) defaultConfig.numOuts);
|
||||
}
|
||||
|
||||
if (auto* bus = processor->getBus (true, 0))
|
||||
updateMinAndMax (bus->getDefaultLayout().size(), minNumInputs, maxNumInputs);
|
||||
maxNumInputs = jmax (0, bus->getDefaultLayout().size());
|
||||
|
||||
if (auto* bus = processor->getBus (false, 0))
|
||||
updateMinAndMax (bus->getDefaultLayout().size(), minNumOutputs, maxNumOutputs);
|
||||
maxNumOutputs = jmax (0, bus->getDefaultLayout().size());
|
||||
|
||||
minNumInputs = jmin (minNumInputs, maxNumInputs);
|
||||
minNumOutputs = jmin (minNumOutputs, maxNumOutputs);
|
||||
|
||||
o.content.setOwned (new SettingsComponent (*this, deviceManager,
|
||||
minNumInputs,
|
||||
maxNumInputs,
|
||||
minNumOutputs,
|
||||
maxNumOutputs));
|
||||
o.content.setOwned (new SettingsComponent (*this, deviceManager, maxNumInputs, maxNumOutputs));
|
||||
o.content->setSize (500, 550);
|
||||
|
||||
o.dialogTitle = TRANS("Audio/MIDI Settings");
|
||||
|
|
@ -425,14 +412,12 @@ private:
|
|||
public:
|
||||
SettingsComponent (StandalonePluginHolder& pluginHolder,
|
||||
AudioDeviceManager& deviceManagerToUse,
|
||||
int minAudioInputChannels,
|
||||
int maxAudioInputChannels,
|
||||
int minAudioOutputChannels,
|
||||
int maxAudioOutputChannels)
|
||||
: owner (pluginHolder),
|
||||
deviceSelector (deviceManagerToUse,
|
||||
minAudioInputChannels, maxAudioInputChannels,
|
||||
minAudioOutputChannels, maxAudioOutputChannels,
|
||||
0, maxAudioInputChannels,
|
||||
0, maxAudioOutputChannels,
|
||||
true,
|
||||
(pluginHolder.processor.get() != nullptr && pluginHolder.processor->producesMidi()),
|
||||
true, false),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue