JUCE  v5.1.1-3-g1a0b28c73
JUCE API
AudioProcessor::Bus Class Reference

Describes the layout and properties of an audio bus. More...

#include <juce_AudioProcessor.h>

Collaboration diagram for AudioProcessor::Bus:

Public Member Functions

bool enable (bool shouldEnable=true)
 Enable or disable this bus. More...
 
template<typename FloatType >
AudioBuffer< FloatType > getBusBuffer (AudioBuffer< FloatType > &processBlockBuffer) const
 Returns an AudioBuffer containing a set of channel pointers for a specific bus. More...
 
BusesLayout getBusesLayoutForLayoutChangeOfBus (const AudioChannelSet &set) const
 Returns the resulting layouts of all buses after changing the layout of this bus. More...
 
int getBusIndex () const
 Returns the index of this bus. More...
 
int getChannelIndexInProcessBlockBuffer (int channelIndex) const noexcept
 Returns the position of a bus's channels within the processBlock buffer. More...
 
const AudioChannelSetgetCurrentLayout () const noexcept
 The bus's current layout. More...
 
const AudioChannelSetgetDefaultLayout () const noexcept
 Get the default layout of this bus. More...
 
const AudioChannelSetgetLastEnabledLayout () const noexcept
 Return the bus's last active channel layout. More...
 
int getMaxSupportedChannels (int limit=AudioChannelSet::maxChannelsOfNamedLayout) const
 Returns the maximum number of channels that this bus can support. More...
 
const StringgetName () const noexcept
 The bus's name. More...
 
int getNumberOfChannels () const noexcept
 Return the number of channels of the current bus. More...
 
bool isEnabled () const noexcept
 Returns true if the current bus is enabled. More...
 
bool isEnabledByDefault () const noexcept
 Returns if this bus is enabled by default. More...
 
bool isInput () const
 Returns true if this bus is an input bus. More...
 
bool isLayoutSupported (const AudioChannelSet &set, BusesLayout *currentLayout=nullptr) const
 Checks if a particular layout is supported. More...
 
bool isMain () const
 Returns true if the current bus is the main input or output bus. More...
 
bool isNumberOfChannelsSupported (int channels) const
 Checks if this bus can support a given number of channels. More...
 
bool setCurrentLayout (const AudioChannelSet &layout)
 Sets the bus's current layout. More...
 
bool setCurrentLayoutWithoutEnabling (const AudioChannelSet &layout)
 Sets the bus's current layout without changing the enabled state. More...
 
bool setNumberOfChannels (int channels)
 Set the number of channles of this bus. More...
 
AudioChannelSet supportedLayoutWithChannels (int channels) const
 Returns a ChannelSet that the bus supports with a given number of channels. More...
 

Private Member Functions

 Bus (AudioProcessor &, const String &, const AudioChannelSet &, bool)
 
void busDirAndIndex (bool &, int &) const noexcept
 
void updateChannelCount () noexcept
 

Private Attributes

int cachedChannelCount
 
AudioChannelSet dfltLayout
 
bool enabledByDefault
 
AudioChannelSet lastLayout
 
AudioChannelSet layout
 
String name
 
AudioProcessorowner
 

Friends

class AudioProcessor
 

Detailed Description

Describes the layout and properties of an audio bus.

Effectively a bus description is a named set of channel types.

See also
AudioChannelSet, AudioProcessor::addBus

Constructor & Destructor Documentation

◆ Bus()

AudioProcessor::Bus::Bus ( AudioProcessor ,
const String ,
const AudioChannelSet ,
bool   
)
private

Member Function Documentation

◆ busDirAndIndex()

void AudioProcessor::Bus::busDirAndIndex ( bool &  ,
int  
) const
privatenoexcept

◆ enable()

bool AudioProcessor::Bus::enable ( bool  shouldEnable = true)

Enable or disable this bus.

This will return false if the AudioProcessor does not support disabling this bus.

◆ getBusBuffer()

template<typename FloatType >
AudioBuffer<FloatType> AudioProcessor::Bus::getBusBuffer ( AudioBuffer< FloatType > &  processBlockBuffer) const
inline

Returns an AudioBuffer containing a set of channel pointers for a specific bus.

This can be called in processBlock to get a buffer containing a sub-group of the master AudioSampleBuffer which contains all the plugin channels.

◆ getBusesLayoutForLayoutChangeOfBus()

BusesLayout AudioProcessor::Bus::getBusesLayoutForLayoutChangeOfBus ( const AudioChannelSet set) const

Returns the resulting layouts of all buses after changing the layout of this bus.

Changing an individual layout of a bus may also change the layout of all the other buses. This method returns what the layouts of all the buses of the audio processor would be, if you were to change the layout of this bus to the given layout. If there is no way to support the given layout then this method will return the next best layout.

◆ getBusIndex()

int AudioProcessor::Bus::getBusIndex ( ) const

Returns the index of this bus.

◆ getChannelIndexInProcessBlockBuffer()

int AudioProcessor::Bus::getChannelIndexInProcessBlockBuffer ( int  channelIndex) const
noexcept

Returns the position of a bus's channels within the processBlock buffer.

This can be called in processBlock to figure out which channel of the master AudioSampleBuffer maps onto a specific bus's channel.

◆ getCurrentLayout()

const AudioChannelSet& AudioProcessor::Bus::getCurrentLayout ( ) const
inlinenoexcept

The bus's current layout.

This will be AudioChannelSet::disabled() if the current layout is dfisabled.

See also
AudioChannelSet

◆ getDefaultLayout()

const AudioChannelSet& AudioProcessor::Bus::getDefaultLayout ( ) const
inlinenoexcept

Get the default layout of this bus.

See also
AudioChannelSet

◆ getLastEnabledLayout()

const AudioChannelSet& AudioProcessor::Bus::getLastEnabledLayout ( ) const
inlinenoexcept

Return the bus's last active channel layout.

If the bus is currently enabled then the result will be identical to getCurrentLayout otherwise it will return the last enabled layout.

See also
AudioChannelSet

◆ getMaxSupportedChannels()

int AudioProcessor::Bus::getMaxSupportedChannels ( int  limit = AudioChannelSet::maxChannelsOfNamedLayout) const

Returns the maximum number of channels that this bus can support.

Parameters
limitThe maximum value to return.

◆ getName()

const String& AudioProcessor::Bus::getName ( ) const
inlinenoexcept

The bus's name.

◆ getNumberOfChannels()

int AudioProcessor::Bus::getNumberOfChannels ( ) const
inlinenoexcept

Return the number of channels of the current bus.

References AudioChannelSet::maxChannelsOfNamedLayout.

◆ isEnabled()

bool AudioProcessor::Bus::isEnabled ( ) const
inlinenoexcept

Returns true if the current bus is enabled.

References AudioChannelSet::isDisabled().

◆ isEnabledByDefault()

bool AudioProcessor::Bus::isEnabledByDefault ( ) const
inlinenoexcept

Returns if this bus is enabled by default.

◆ isInput()

bool AudioProcessor::Bus::isInput ( ) const

Returns true if this bus is an input bus.

◆ isLayoutSupported()

bool AudioProcessor::Bus::isLayoutSupported ( const AudioChannelSet set,
BusesLayout currentLayout = nullptr 
) const

Checks if a particular layout is supported.

Parameters
setThe AudioChannelSet which is to be probed.
currentLayoutIf non-null, pretend that the current layout of the AudioProcessor is currentLayout. On exit, currentLayout will be modified to to represent the buses layouts of the AudioProcessor as if the layout of the reciever had been succesfully changed. This is useful as changing the layout of the reciever may change the bus layout of other buses.
See also
AudioChannelSet

Referenced by AudioUnitHelpers::isNumberOfChannelsSupported().

◆ isMain()

bool AudioProcessor::Bus::isMain ( ) const
inline

Returns true if the current bus is the main input or output bus.

◆ isNumberOfChannelsSupported()

bool AudioProcessor::Bus::isNumberOfChannelsSupported ( int  channels) const

Checks if this bus can support a given number of channels.

◆ setCurrentLayout()

bool AudioProcessor::Bus::setCurrentLayout ( const AudioChannelSet layout)

Sets the bus's current layout.

If the AudioProcessor does not support this layout then this will return false.

See also
AudioChannelSet

◆ setCurrentLayoutWithoutEnabling()

bool AudioProcessor::Bus::setCurrentLayoutWithoutEnabling ( const AudioChannelSet layout)

Sets the bus's current layout without changing the enabled state.

If the AudioProcessor does not support this layout then this will return false.

See also
AudioChannelSet

◆ setNumberOfChannels()

bool AudioProcessor::Bus::setNumberOfChannels ( int  channels)

Set the number of channles of this bus.

This will return false if the AudioProcessor does not support this layout.

◆ supportedLayoutWithChannels()

AudioChannelSet AudioProcessor::Bus::supportedLayoutWithChannels ( int  channels) const

Returns a ChannelSet that the bus supports with a given number of channels.

◆ updateChannelCount()

void AudioProcessor::Bus::updateChannelCount ( )
privatenoexcept

Friends And Related Function Documentation

◆ AudioProcessor

friend class AudioProcessor
friend

Member Data Documentation

◆ cachedChannelCount

int AudioProcessor::Bus::cachedChannelCount
private

◆ dfltLayout

AudioChannelSet AudioProcessor::Bus::dfltLayout
private

◆ enabledByDefault

bool AudioProcessor::Bus::enabledByDefault
private

◆ lastLayout

AudioChannelSet AudioProcessor::Bus::lastLayout
private

◆ layout

AudioChannelSet AudioProcessor::Bus::layout
private

◆ name

String AudioProcessor::Bus::name
private

◆ owner

AudioProcessor& AudioProcessor::Bus::owner
private

The documentation for this class was generated from the following file: