Browse Source

Add removeChannel to AudioChannelSet

tags/2021-05-28
hogliux 9 years ago
parent
commit
320c5b66c7
2 changed files with 10 additions and 0 deletions
  1. +7
    -0
      modules/juce_audio_processors/processors/juce_AudioChannelSet.cpp
  2. +3
    -0
      modules/juce_audio_processors/processors/juce_AudioChannelSet.h

+ 7
- 0
modules/juce_audio_processors/processors/juce_AudioChannelSet.cpp View File

@@ -208,6 +208,13 @@ void AudioChannelSet::addChannel (ChannelType newChannel)
channels.setBit (bit);
}
void AudioChannelSet::removeChannel (ChannelType newChannel)
{
const int bit = static_cast<int> (newChannel);
jassert (bit >= 0 && bit < 1024);
channels.clearBit (bit);
}
AudioChannelSet AudioChannelSet::disabled() { return AudioChannelSet(); }
AudioChannelSet AudioChannelSet::mono() { return AudioChannelSet (1u << centre); }
AudioChannelSet AudioChannelSet::stereo() { return AudioChannelSet ((1u << left) | (1u << right)); }


+ 3
- 0
modules/juce_audio_processors/processors/juce_AudioChannelSet.h View File

@@ -166,6 +166,9 @@ public:
/** Adds a channel to the set. */
void addChannel (ChannelType newChannelType);
/** Removes a channel from the set. */
void removeChannel (ChannelType newChannelType);
/** Returns the number of channels in the set. */
int size() const noexcept;


Loading…
Cancel
Save