Skip to content

Bus

An object representing one node in the tree of buses. Buses are used to adjust a set of channel gains in tandem.

Detailed Description

The Bus class is a lightweight reference to a BusInternalState object which is managed internally by the Engine. There is always at least one bus, the "master" bus, and any number of additional buses may be defined as well. Each bus can be thought as a node in the tree. The gain on a Bus is applied to all child buses as well.

Public Functions

Type Name
Bus ()
Creates an uninitialized bus.
Bus (BusInternalState * state)
Creates a wrapper instance over the provided state.
void Clear ()
Uninitializes this bus.
void FadeTo (AmReal32 gain, AmTime duration) const
Fades to gain overduration milliseconds.
AmReal32 GetFinalGain () const
Returns the final calculated gain on this bus.
AmReal32 GetGain () const
Returns the user specified gain on this bus.
AmBusID GetId () const
Gets the unique ID of this bus.
const AmString & GetName () const
Gets the name of this bus.
BusInternalState * GetState () const
Returns the internal state of this bus.
bool IsMuted () const
Returns whether this bus is muted.
void SetGain (AmReal32 gain) const
Sets the gain of this bus.
void SetMute (bool mute) const
Sets the muted state of this bus.
bool Valid () const
Checks whether this bus has been initialized.

Public Functions Documentation

Bus[1/2]

Creates an uninitialized bus.

Amplitude::Bus::Bus () 

Note:

An uninitialized bus cannot set or get any of its fields.

Bus[2/2]

Creates a wrapper instance over the provided state.

explicit Amplitude::Bus::Bus (
    BusInternalState * state
) 

Warning:

This constructor is for internal usage only.

Parameters:

  • state The internal state to wrap.
Clear

Uninitializes this bus.

void Amplitude::Bus::Clear () 

Note:

This does not destroy the internal state it references, it just removes this reference to it.

FadeTo

Fades to gain overduration milliseconds.

void Amplitude::Bus::FadeTo (
    AmReal32 gain,
    AmTime duration
) const

Parameters:

  • gain The gain value to fade to.
  • duration The amount of time in milliseconds to take to reach the desired gain.
GetFinalGain

Returns the final calculated gain on this bus.

AmReal32 Amplitude::Bus::GetFinalGain () const

Note:

The final gain of a bus is the product of the gain specified in the bus definition file, with the gain specified by the user, and with the final gain of the parent bus.

Returns:

The final calculated gain.

GetGain

Returns the user specified gain on this bus.

AmReal32 Amplitude::Bus::GetGain () const

Returns:

The user specified gain.

GetId

Gets the unique ID of this bus.

AmBusID Amplitude::Bus::GetId () const

Returns:

The bus unique ID.

GetName

Gets the name of this bus.

const AmString & Amplitude::Bus::GetName () const

Returns:

The bus name.

GetState

Returns the internal state of this bus.

BusInternalState * Amplitude::Bus::GetState () const

Warning:

This method is only for internal usage only.

Returns:

The bus internal state.

IsMuted

Returns whether this bus is muted.

bool Amplitude::Bus::IsMuted () const

Returns:

true if this bus is muted, false otherwise.

SetGain

Sets the gain of this bus.

void Amplitude::Bus::SetGain (
    AmReal32 gain
) const

Parameters:

  • gain The new gain value.
SetMute

Sets the muted state of this bus.

void Amplitude::Bus::SetMute (
    bool mute
) const

Parameters:

  • mute The muted state.
Valid

Checks whether this bus has been initialized.

bool Amplitude::Bus::Valid () const

Returns:

true if this bus has been initialized, false otherwise.


The documentation for this class was generated from the following file: include/SparkyStudios/Audio/Amplitude/Core/Playback/Bus.h