From 320c5b66c7f6e8f7093defcfae21919725f3637c Mon Sep 17 00:00:00 2001 From: hogliux Date: Wed, 15 Jun 2016 12:16:17 +0100 Subject: [PATCH] Add removeChannel to AudioChannelSet --- .../processors/juce_AudioChannelSet.cpp | 7 +++++++ .../processors/juce_AudioChannelSet.h | 3 +++ 2 files changed, 10 insertions(+) diff --git a/modules/juce_audio_processors/processors/juce_AudioChannelSet.cpp b/modules/juce_audio_processors/processors/juce_AudioChannelSet.cpp index 3873647d09..e12a2263ca 100644 --- a/modules/juce_audio_processors/processors/juce_AudioChannelSet.cpp +++ b/modules/juce_audio_processors/processors/juce_AudioChannelSet.cpp @@ -208,6 +208,13 @@ void AudioChannelSet::addChannel (ChannelType newChannel) channels.setBit (bit); } +void AudioChannelSet::removeChannel (ChannelType newChannel) +{ + const int bit = static_cast (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)); } diff --git a/modules/juce_audio_processors/processors/juce_AudioChannelSet.h b/modules/juce_audio_processors/processors/juce_AudioChannelSet.h index ab84241362..8af8f87791 100644 --- a/modules/juce_audio_processors/processors/juce_AudioChannelSet.h +++ b/modules/juce_audio_processors/processors/juce_AudioChannelSet.h @@ -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;