27 const bool deleteSourceWhenDeleted)
28 : source (
source_, deleteSourceWhenDeleted),
29 requiredNumberOfChannels (2)
31 remappedInfo.
buffer = &buffer;
48 remappedInputs.
clear();
49 remappedOutputs.
clear();
57 remappedInputs.
add (-1);
67 remappedOutputs.
add (-1);
100 source->releaseResources();
130 source->getNextAudioBlock (remappedInfo);
134 for (
int i = 0; i < requiredNumberOfChannels; ++i)
150 auto e = std::make_unique<XmlElement> (
"MAPPINGS");
155 for (
int i = 0; i < remappedInputs.
size(); ++i)
158 for (
int i = 0; i < remappedOutputs.
size(); ++i)
161 e->setAttribute (
"inputs",
ins.trimEnd());
162 e->setAttribute (
"outputs",
outs.trimEnd());
169 if (
e.hasTagName (
"MAPPINGS"))
176 ins.addTokens (
e.getStringAttribute (
"inputs"),
false);
177 outs.addTokens (
e.getStringAttribute (
"outputs"),
false);
179 for (
int i = 0; i <
ins.
size(); ++i)
180 remappedInputs.
add (
ins[i].getIntValue());
182 for (
int i = 0; i <
outs.
size(); ++i)
183 remappedOutputs.
add (
outs[i].getIntValue());
ElementType getUnchecked(int index) const
int size() const noexcept
void add(const ElementType &newElement)
void set(int indexToChange, ParameterType newValue)
void setSize(int newNumChannels, int newNumSamples, bool keepExistingContent=false, bool clearExtraSpace=false, bool avoidReallocating=false)
int getNumChannels() const noexcept
void copyFrom(int destChannel, int destStartSample, const AudioBuffer &source, int sourceChannel, int sourceStartSample, int numSamples) noexcept
void setOutputChannelMapping(int sourceChannelIndex, int destChannelIndex)
void getNextAudioBlock(const AudioSourceChannelInfo &) override
~ChannelRemappingAudioSource() override
void prepareToPlay(int samplesPerBlockExpected, double sampleRate) override
void setNumberOfChannelsToProduce(int requiredNumberOfChannels)
void restoreFromXml(const XmlElement &)
void releaseResources() override
int getRemappedInputChannel(int inputChannelIndex) const
int getRemappedOutputChannel(int outputChannelIndex) const
ChannelRemappingAudioSource(AudioSource *source, bool deleteSourceWhenDeleted)
std::unique_ptr< XmlElement > createXml() const
void setInputChannelMapping(int destChannelIndex, int sourceChannelIndex)
AudioBuffer< float > * buffer