LMMS
Loading...
Searching...
No Matches
juce::AudioProcessor::Bus Class Reference

#include <juce_AudioProcessor.h>

Classes

struct  BusDirectionAndIndex

Public Member Functions

bool isInput () const noexcept
int getBusIndex () const noexcept
bool isMain () const noexcept
const StringgetName () const noexcept
const AudioChannelSetgetDefaultLayout () const noexcept
const AudioChannelSetgetCurrentLayout () const noexcept
const AudioChannelSetgetLastEnabledLayout () const noexcept
bool setCurrentLayout (const AudioChannelSet &layout)
bool setCurrentLayoutWithoutEnabling (const AudioChannelSet &layout)
int getNumberOfChannels () const noexcept
bool setNumberOfChannels (int channels)
bool isLayoutSupported (const AudioChannelSet &set, BusesLayout *currentLayout=nullptr) const
bool isNumberOfChannelsSupported (int channels) const
AudioChannelSet supportedLayoutWithChannels (int channels) const
int getMaxSupportedChannels (int limit=AudioChannelSet::maxChannelsOfNamedLayout) const
BusesLayout getBusesLayoutForLayoutChangeOfBus (const AudioChannelSet &set) const
bool isEnabled () const noexcept
bool enable (bool shouldEnable=true)
bool isEnabledByDefault () const noexcept
int getChannelIndexInProcessBlockBuffer (int channelIndex) const noexcept
template<typename FloatType>
AudioBuffer< FloatType > getBusBuffer (AudioBuffer< FloatType > &processBlockBuffer) const

Private Member Functions

 Bus (AudioProcessor &, const String &, const AudioChannelSet &, bool)
BusDirectionAndIndex getDirectionAndIndex () const noexcept
void updateChannelCount () noexcept

Private Attributes

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

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()

juce::AudioProcessor::Bus::Bus ( AudioProcessor & processor,
const String & busName,
const AudioChannelSet & defaultLayout,
bool isDfltEnabled )
private

Member Function Documentation

◆ enable()

bool juce::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 > juce::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 AudioBuffer which contains all the plugin channels.

◆ getBusesLayoutForLayoutChangeOfBus()

AudioProcessor::BusesLayout juce::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 juce::AudioProcessor::Bus::getBusIndex ( ) const
noexcept

Returns the index of this bus.

◆ getChannelIndexInProcessBlockBuffer()

int juce::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 AudioBuffer maps onto a specific bus's channel.

◆ getCurrentLayout()

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

The bus's current layout. This will be AudioChannelSet::disabled() if the current layout is disabled.

See also
AudioChannelSet

◆ getDefaultLayout()

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

Get the default layout of this bus.

See also
AudioChannelSet

◆ getDirectionAndIndex()

AudioProcessor::Bus::BusDirectionAndIndex juce::AudioProcessor::Bus::getDirectionAndIndex ( ) const
privatenoexcept

◆ getLastEnabledLayout()

const AudioChannelSet & juce::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 juce::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 & juce::AudioProcessor::Bus::getName ( ) const
inlinenoexcept

The bus's name.

◆ getNumberOfChannels()

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

Return the number of channels of the current bus.

◆ isEnabled()

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

Returns true if the current bus is enabled.

◆ isEnabledByDefault()

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

Returns if this bus is enabled by default.

◆ isInput()

bool juce::AudioProcessor::Bus::isInput ( ) const
noexcept

Returns true if this bus is an input bus.

◆ isLayoutSupported()

bool juce::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 receiver had been successfully changed. This is useful as changing the layout of the receiver may change the bus layout of other buses.
See also
AudioChannelSet

◆ isMain()

bool juce::AudioProcessor::Bus::isMain ( ) const
inlinenoexcept

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

◆ isNumberOfChannelsSupported()

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

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

◆ setCurrentLayout()

bool juce::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 juce::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 juce::AudioProcessor::Bus::setNumberOfChannels ( int channels)

Set the number of channels of this bus. This will return false if the AudioProcessor does not support this layout.

◆ supportedLayoutWithChannels()

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

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

◆ updateChannelCount()

void juce::AudioProcessor::Bus::updateChannelCount ( )
privatenoexcept

◆ AudioProcessor

friend class AudioProcessor
friend

Member Data Documentation

◆ cachedChannelCount

int juce::AudioProcessor::Bus::cachedChannelCount
private

◆ dfltLayout

AudioChannelSet juce::AudioProcessor::Bus::dfltLayout
private

◆ enabledByDefault

bool juce::AudioProcessor::Bus::enabledByDefault
private

◆ lastLayout

AudioChannelSet juce::AudioProcessor::Bus::lastLayout
private

◆ layout

AudioChannelSet juce::AudioProcessor::Bus::layout
private

◆ name

String juce::AudioProcessor::Bus::name
private

◆ owner

AudioProcessor& juce::AudioProcessor::Bus::owner
private

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