Exemplo n.º 1
0
bool AudioProcessor::Bus::isNumberOfChannelsSupported (int channels) const
{
    if (channels == 0) return isLayoutSupported(AudioChannelSet::disabled());

    const AudioChannelSet set = supportedLayoutWithChannels (channels);
    return (! set.isDisabled()) && isLayoutSupported (set);
}
Exemplo n.º 2
0
    //==============================================================================
    bool setPreferredBusArrangement (bool isInputBus, int busIndex,
                                     const AudioChannelSet& preferred) override
    {
        const int numChannels = preferred.size();
        const bool isMainBus = (busIndex == 0);

        // do not allow disabling the main output bus
        if (isMainBus && preferred.isDisabled()) return false;

        // only support mono or stereo (or disabling) buses
        if (numChannels > 2) return false;


        // pass the call on to the base class
        return AudioProcessor::setPreferredBusArrangement (isInputBus, busIndex, preferred);
    }
Exemplo n.º 3
0
bool AudioProcessor::Bus::setNumberOfChannels (int channels)
{
    bool isInputBus;
    int busIdx;
    busDirAndIndex (isInputBus, busIdx);

    if (owner.setChannelLayoutOfBus (isInputBus, busIdx, AudioChannelSet::canonicalChannelSet (channels)))
        return true;

    if (channels == 0)
        return false;

    AudioChannelSet namedSet = AudioChannelSet::namedChannelSet (channels);
    if (! namedSet.isDisabled() && owner.setChannelLayoutOfBus (isInputBus, busIdx, namedSet))
        return true;

    return owner.setChannelLayoutOfBus (isInputBus, busIdx, AudioChannelSet::discreteChannels (channels));
}
Exemplo n.º 4
0
bool AudioProcessor::Bus::setCurrentLayoutWithoutEnabling (const AudioChannelSet& set)
{
    if (! set.isDisabled())
    {
        if (isEnabled())
            return setCurrentLayout (set);

        if (isLayoutSupported (set))
        {
            lastLayout = set;
            return true;
        }

        return false;
    }

    return isLayoutSupported (set);
}