Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

n-channel #14

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -251,8 +251,8 @@ class JuceVSTWrapper : public AudioEffectX,
chunkMemoryTime (0),
speakerIn (kSpeakerArrEmpty),
speakerOut (kSpeakerArrEmpty),
numInChans (JucePlugin_MaxNumInputChannels),
numOutChans (JucePlugin_MaxNumOutputChannels),
numInChans (af->getMaxInputs()),
numOutChans (af->getMaxOutputs()),
isProcessing (false),
isBypassed (false),
hasShutdown (false),
Expand Down Expand Up @@ -433,7 +433,7 @@ class JuceVSTWrapper : public AudioEffectX,

bool getInputProperties (VstInt32 index, VstPinProperties* properties) override
{
if (filter == nullptr || index >= JucePlugin_MaxNumInputChannels)
if (filter == nullptr || index >= filter->getMaxInputs())
return false;

setPinProperties (*properties, filter->getInputChannelName ((int) index),
Expand All @@ -443,7 +443,7 @@ class JuceVSTWrapper : public AudioEffectX,

bool getOutputProperties (VstInt32 index, VstPinProperties* properties) override
{
if (filter == nullptr || index >= JucePlugin_MaxNumOutputChannels)
if (filter == nullptr || index >= filter->getMaxOutputs())
return false;

setPinProperties (*properties, filter->getOutputChannelName ((int) index),
Expand Down Expand Up @@ -917,7 +917,7 @@ class JuceVSTWrapper : public AudioEffectX,
return 0;
}
};

/*
bool setSpeakerArrangement (VstSpeakerArrangement* pluginInput,
VstSpeakerArrangement* pluginOutput) override
{
Expand Down Expand Up @@ -955,7 +955,7 @@ class JuceVSTWrapper : public AudioEffectX,
filter->setSpeakerArrangement (String::empty, String::empty);
return false;
}

*/
static const char* getSpeakerArrangementString (VstSpeakerArrangementType type) noexcept
{
switch (type)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ AudioProcessor::AudioProcessor()
suspended (false),
nonRealtime (false)
{
maxInputs = JucePlugin_MaxNumInputChannels;
maxOutputs = JucePlugin_MaxNumOutputChannels;
}

AudioProcessor::~AudioProcessor()
Expand Down Expand Up @@ -397,6 +399,32 @@ XmlElement* AudioProcessor::getXmlFromBinary (const void* data, const int sizeIn
return nullptr;
}


void AudioProcessor::initializeMaxChannels(int numIn, int numOut)
{
// todo assert false if this is called after getters?
maxInputs = numIn;
maxOutputs = numOut;
}

int AudioProcessor::getMaxInputs()
{
return maxInputs;
}

int AudioProcessor::getMaxOutputs()
{
return maxOutputs;
}

std::vector<std::pair<int,int>> AudioProcessor::getPreferredChannelConfigs()
{
// only half-implemented and not really settable (todo?)
std::vector<std::pair<int,int>> ret;
ret.push_back(std::pair<int,int>(maxInputs, maxOutputs));
return ret;
}

//==============================================================================
void AudioProcessorListener::audioProcessorParameterChangeGestureBegin (AudioProcessor*, int) {}
void AudioProcessorListener::audioProcessorParameterChangeGestureEnd (AudioProcessor*, int) {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -712,6 +712,35 @@ class JUCE_API AudioProcessor
*/
static XmlElement* getXmlFromBinary (const void* data, int sizeInBytes);

/** Protoplug extension: initialize max number of channels.

This overrides a number of preprocessor constants, and allows for the number of channels to
be defined at runtime instead of compile time. This is meant to be called in the
constructor of the class inheriting AudioProcessor.
*/
void initializeMaxChannels(int numIn, int numOut);

/** Protoplug extension: get maximum number of input channels.

This replaces the JucePlugin_MaxNumInputChannels constant, allowing it to be defined at
runtime.
*/
int getMaxInputs();

/** Protoplug extension: get maximum number of output channels.

This replaces the JucePlugin_MaxNumOutputChannels constant, allowing it to be defined at
runtime.
*/
int getMaxOutputs();

/** Protoplug extension: get preferred channel configurations.

This replaces the JucePlugin_PreferredChannelConfigurations constant, allowing
it to be defined at runtime.
*/
std::vector<std::pair<int,int>> getPreferredChannelConfigs();

/** @internal */
static void JUCE_CALLTYPE setTypeOfNextNewPlugin (WrapperType);

Expand All @@ -734,6 +763,9 @@ class JUCE_API AudioProcessor
OwnedArray<AudioProcessorParameter> managedParameters;
AudioProcessorParameter* getParamChecked (int) const noexcept;

// protoplug extension
int maxInputs, maxOutputs;

#if JUCE_DEBUG && ! JUCE_DISABLE_AUDIOPROCESSOR_BEGIN_END_GESTURE_CHECKING
BigInteger changingParams;
#endif
Expand Down
6 changes: 3 additions & 3 deletions ProtoplugFiles/doc/classes/juce.AffineTransform.html
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,12 @@ <h2>Classes</h2>
</ul>
<h2>Modules</h2>
<ul class="$(kind=='Topics' and '' or 'nowrap'">
<li><a href="../modules/plugin.html">plugin</a></li>
<li><a href="../modules/script.html">script</a></li>
<li><a href="../modules/plugin.html">plugin</a></li>
<li><a href="../modules/multiIO.html">multiIO</a></li>
<li><a href="../modules/midi.html">midi</a></li>
<li><a href="../modules/gui.html">gui</a></li>
<li><a href="../modules/polyGen.html">polyGen</a></li>
<li><a href="../modules/stereoFx.html">stereoFx</a></li>
<li><a href="../modules/gui.html">gui</a></li>
</ul>
<h2>Examples</h2>
<ul class="$(kind=='Topics' and '' or 'nowrap'">
Expand Down
6 changes: 3 additions & 3 deletions ProtoplugFiles/doc/classes/juce.AudioFormatReader.html
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,12 @@ <h2>Classes</h2>
</ul>
<h2>Modules</h2>
<ul class="$(kind=='Topics' and '' or 'nowrap'">
<li><a href="../modules/plugin.html">plugin</a></li>
<li><a href="../modules/script.html">script</a></li>
<li><a href="../modules/plugin.html">plugin</a></li>
<li><a href="../modules/multiIO.html">multiIO</a></li>
<li><a href="../modules/midi.html">midi</a></li>
<li><a href="../modules/gui.html">gui</a></li>
<li><a href="../modules/polyGen.html">polyGen</a></li>
<li><a href="../modules/stereoFx.html">stereoFx</a></li>
<li><a href="../modules/gui.html">gui</a></li>
</ul>
<h2>Examples</h2>
<ul class="$(kind=='Topics' and '' or 'nowrap'">
Expand Down
6 changes: 3 additions & 3 deletions ProtoplugFiles/doc/classes/juce.Colour.html
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,12 @@ <h2>Classes</h2>
</ul>
<h2>Modules</h2>
<ul class="$(kind=='Topics' and '' or 'nowrap'">
<li><a href="../modules/plugin.html">plugin</a></li>
<li><a href="../modules/script.html">script</a></li>
<li><a href="../modules/plugin.html">plugin</a></li>
<li><a href="../modules/multiIO.html">multiIO</a></li>
<li><a href="../modules/midi.html">midi</a></li>
<li><a href="../modules/gui.html">gui</a></li>
<li><a href="../modules/polyGen.html">polyGen</a></li>
<li><a href="../modules/stereoFx.html">stereoFx</a></li>
<li><a href="../modules/gui.html">gui</a></li>
</ul>
<h2>Examples</h2>
<ul class="$(kind=='Topics' and '' or 'nowrap'">
Expand Down
6 changes: 3 additions & 3 deletions ProtoplugFiles/doc/classes/juce.ColourGradient.html
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,12 @@ <h2>Classes</h2>
</ul>
<h2>Modules</h2>
<ul class="$(kind=='Topics' and '' or 'nowrap'">
<li><a href="../modules/plugin.html">plugin</a></li>
<li><a href="../modules/script.html">script</a></li>
<li><a href="../modules/plugin.html">plugin</a></li>
<li><a href="../modules/multiIO.html">multiIO</a></li>
<li><a href="../modules/midi.html">midi</a></li>
<li><a href="../modules/gui.html">gui</a></li>
<li><a href="../modules/polyGen.html">polyGen</a></li>
<li><a href="../modules/stereoFx.html">stereoFx</a></li>
<li><a href="../modules/gui.html">gui</a></li>
</ul>
<h2>Examples</h2>
<ul class="$(kind=='Topics' and '' or 'nowrap'">
Expand Down
6 changes: 3 additions & 3 deletions ProtoplugFiles/doc/classes/juce.Component.html
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,12 @@ <h2>Classes</h2>
</ul>
<h2>Modules</h2>
<ul class="$(kind=='Topics' and '' or 'nowrap'">
<li><a href="../modules/plugin.html">plugin</a></li>
<li><a href="../modules/script.html">script</a></li>
<li><a href="../modules/plugin.html">plugin</a></li>
<li><a href="../modules/multiIO.html">multiIO</a></li>
<li><a href="../modules/midi.html">midi</a></li>
<li><a href="../modules/gui.html">gui</a></li>
<li><a href="../modules/polyGen.html">polyGen</a></li>
<li><a href="../modules/stereoFx.html">stereoFx</a></li>
<li><a href="../modules/gui.html">gui</a></li>
</ul>
<h2>Examples</h2>
<ul class="$(kind=='Topics' and '' or 'nowrap'">
Expand Down
6 changes: 3 additions & 3 deletions ProtoplugFiles/doc/classes/juce.FillType.html
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,12 @@ <h2>Classes</h2>
</ul>
<h2>Modules</h2>
<ul class="$(kind=='Topics' and '' or 'nowrap'">
<li><a href="../modules/plugin.html">plugin</a></li>
<li><a href="../modules/script.html">script</a></li>
<li><a href="../modules/plugin.html">plugin</a></li>
<li><a href="../modules/multiIO.html">multiIO</a></li>
<li><a href="../modules/midi.html">midi</a></li>
<li><a href="../modules/gui.html">gui</a></li>
<li><a href="../modules/polyGen.html">polyGen</a></li>
<li><a href="../modules/stereoFx.html">stereoFx</a></li>
<li><a href="../modules/gui.html">gui</a></li>
</ul>
<h2>Examples</h2>
<ul class="$(kind=='Topics' and '' or 'nowrap'">
Expand Down
6 changes: 3 additions & 3 deletions ProtoplugFiles/doc/classes/juce.Font.html
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,12 @@ <h2>Classes</h2>
</ul>
<h2>Modules</h2>
<ul class="$(kind=='Topics' and '' or 'nowrap'">
<li><a href="../modules/plugin.html">plugin</a></li>
<li><a href="../modules/script.html">script</a></li>
<li><a href="../modules/plugin.html">plugin</a></li>
<li><a href="../modules/multiIO.html">multiIO</a></li>
<li><a href="../modules/midi.html">midi</a></li>
<li><a href="../modules/gui.html">gui</a></li>
<li><a href="../modules/polyGen.html">polyGen</a></li>
<li><a href="../modules/stereoFx.html">stereoFx</a></li>
<li><a href="../modules/gui.html">gui</a></li>
</ul>
<h2>Examples</h2>
<ul class="$(kind=='Topics' and '' or 'nowrap'">
Expand Down
6 changes: 3 additions & 3 deletions ProtoplugFiles/doc/classes/juce.Graphics.html
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,12 @@ <h2>Classes</h2>
</ul>
<h2>Modules</h2>
<ul class="$(kind=='Topics' and '' or 'nowrap'">
<li><a href="../modules/plugin.html">plugin</a></li>
<li><a href="../modules/script.html">script</a></li>
<li><a href="../modules/plugin.html">plugin</a></li>
<li><a href="../modules/multiIO.html">multiIO</a></li>
<li><a href="../modules/midi.html">midi</a></li>
<li><a href="../modules/gui.html">gui</a></li>
<li><a href="../modules/polyGen.html">polyGen</a></li>
<li><a href="../modules/stereoFx.html">stereoFx</a></li>
<li><a href="../modules/gui.html">gui</a></li>
</ul>
<h2>Examples</h2>
<ul class="$(kind=='Topics' and '' or 'nowrap'">
Expand Down
6 changes: 3 additions & 3 deletions ProtoplugFiles/doc/classes/juce.Image.html
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,12 @@ <h2>Classes</h2>
</ul>
<h2>Modules</h2>
<ul class="$(kind=='Topics' and '' or 'nowrap'">
<li><a href="../modules/plugin.html">plugin</a></li>
<li><a href="../modules/script.html">script</a></li>
<li><a href="../modules/plugin.html">plugin</a></li>
<li><a href="../modules/multiIO.html">multiIO</a></li>
<li><a href="../modules/midi.html">midi</a></li>
<li><a href="../modules/gui.html">gui</a></li>
<li><a href="../modules/polyGen.html">polyGen</a></li>
<li><a href="../modules/stereoFx.html">stereoFx</a></li>
<li><a href="../modules/gui.html">gui</a></li>
</ul>
<h2>Examples</h2>
<ul class="$(kind=='Topics' and '' or 'nowrap'">
Expand Down
6 changes: 3 additions & 3 deletions ProtoplugFiles/doc/classes/juce.Justification.html
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,12 @@ <h2>Classes</h2>
</ul>
<h2>Modules</h2>
<ul class="$(kind=='Topics' and '' or 'nowrap'">
<li><a href="../modules/plugin.html">plugin</a></li>
<li><a href="../modules/script.html">script</a></li>
<li><a href="../modules/plugin.html">plugin</a></li>
<li><a href="../modules/multiIO.html">multiIO</a></li>
<li><a href="../modules/midi.html">midi</a></li>
<li><a href="../modules/gui.html">gui</a></li>
<li><a href="../modules/polyGen.html">polyGen</a></li>
<li><a href="../modules/stereoFx.html">stereoFx</a></li>
<li><a href="../modules/gui.html">gui</a></li>
</ul>
<h2>Examples</h2>
<ul class="$(kind=='Topics' and '' or 'nowrap'">
Expand Down
6 changes: 3 additions & 3 deletions ProtoplugFiles/doc/classes/juce.LagrangeInterpolator.html
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,12 @@ <h2>Classes</h2>
</ul>
<h2>Modules</h2>
<ul class="$(kind=='Topics' and '' or 'nowrap'">
<li><a href="../modules/plugin.html">plugin</a></li>
<li><a href="../modules/script.html">script</a></li>
<li><a href="../modules/plugin.html">plugin</a></li>
<li><a href="../modules/multiIO.html">multiIO</a></li>
<li><a href="../modules/midi.html">midi</a></li>
<li><a href="../modules/gui.html">gui</a></li>
<li><a href="../modules/polyGen.html">polyGen</a></li>
<li><a href="../modules/stereoFx.html">stereoFx</a></li>
<li><a href="../modules/gui.html">gui</a></li>
</ul>
<h2>Examples</h2>
<ul class="$(kind=='Topics' and '' or 'nowrap'">
Expand Down
6 changes: 3 additions & 3 deletions ProtoplugFiles/doc/classes/juce.Line.html
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,12 @@ <h2>Classes</h2>
</ul>
<h2>Modules</h2>
<ul class="$(kind=='Topics' and '' or 'nowrap'">
<li><a href="../modules/plugin.html">plugin</a></li>
<li><a href="../modules/script.html">script</a></li>
<li><a href="../modules/plugin.html">plugin</a></li>
<li><a href="../modules/multiIO.html">multiIO</a></li>
<li><a href="../modules/midi.html">midi</a></li>
<li><a href="../modules/gui.html">gui</a></li>
<li><a href="../modules/polyGen.html">polyGen</a></li>
<li><a href="../modules/stereoFx.html">stereoFx</a></li>
<li><a href="../modules/gui.html">gui</a></li>
</ul>
<h2>Examples</h2>
<ul class="$(kind=='Topics' and '' or 'nowrap'">
Expand Down
6 changes: 3 additions & 3 deletions ProtoplugFiles/doc/classes/juce.Path.html
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,12 @@ <h2>Classes</h2>
</ul>
<h2>Modules</h2>
<ul class="$(kind=='Topics' and '' or 'nowrap'">
<li><a href="../modules/plugin.html">plugin</a></li>
<li><a href="../modules/script.html">script</a></li>
<li><a href="../modules/plugin.html">plugin</a></li>
<li><a href="../modules/multiIO.html">multiIO</a></li>
<li><a href="../modules/midi.html">midi</a></li>
<li><a href="../modules/gui.html">gui</a></li>
<li><a href="../modules/polyGen.html">polyGen</a></li>
<li><a href="../modules/stereoFx.html">stereoFx</a></li>
<li><a href="../modules/gui.html">gui</a></li>
</ul>
<h2>Examples</h2>
<ul class="$(kind=='Topics' and '' or 'nowrap'">
Expand Down
6 changes: 3 additions & 3 deletions ProtoplugFiles/doc/classes/juce.Point.html
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,12 @@ <h2>Classes</h2>
</ul>
<h2>Modules</h2>
<ul class="$(kind=='Topics' and '' or 'nowrap'">
<li><a href="../modules/plugin.html">plugin</a></li>
<li><a href="../modules/script.html">script</a></li>
<li><a href="../modules/plugin.html">plugin</a></li>
<li><a href="../modules/multiIO.html">multiIO</a></li>
<li><a href="../modules/midi.html">midi</a></li>
<li><a href="../modules/gui.html">gui</a></li>
<li><a href="../modules/polyGen.html">polyGen</a></li>
<li><a href="../modules/stereoFx.html">stereoFx</a></li>
<li><a href="../modules/gui.html">gui</a></li>
</ul>
<h2>Examples</h2>
<ul class="$(kind=='Topics' and '' or 'nowrap'">
Expand Down
6 changes: 3 additions & 3 deletions ProtoplugFiles/doc/classes/juce.RectanglePlacement.html
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,12 @@ <h2>Classes</h2>
</ul>
<h2>Modules</h2>
<ul class="$(kind=='Topics' and '' or 'nowrap'">
<li><a href="../modules/plugin.html">plugin</a></li>
<li><a href="../modules/script.html">script</a></li>
<li><a href="../modules/plugin.html">plugin</a></li>
<li><a href="../modules/multiIO.html">multiIO</a></li>
<li><a href="../modules/midi.html">midi</a></li>
<li><a href="../modules/gui.html">gui</a></li>
<li><a href="../modules/polyGen.html">polyGen</a></li>
<li><a href="../modules/stereoFx.html">stereoFx</a></li>
<li><a href="../modules/gui.html">gui</a></li>
</ul>
<h2>Examples</h2>
<ul class="$(kind=='Topics' and '' or 'nowrap'">
Expand Down
6 changes: 3 additions & 3 deletions ProtoplugFiles/doc/classes/juce.Rectangle_float.html
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,12 @@ <h2>Classes</h2>
</ul>
<h2>Modules</h2>
<ul class="$(kind=='Topics' and '' or 'nowrap'">
<li><a href="../modules/plugin.html">plugin</a></li>
<li><a href="../modules/script.html">script</a></li>
<li><a href="../modules/plugin.html">plugin</a></li>
<li><a href="../modules/multiIO.html">multiIO</a></li>
<li><a href="../modules/midi.html">midi</a></li>
<li><a href="../modules/gui.html">gui</a></li>
<li><a href="../modules/polyGen.html">polyGen</a></li>
<li><a href="../modules/stereoFx.html">stereoFx</a></li>
<li><a href="../modules/gui.html">gui</a></li>
</ul>
<h2>Examples</h2>
<ul class="$(kind=='Topics' and '' or 'nowrap'">
Expand Down
Loading