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.
Note:
An uninitialized bus cannot set or get any of its fields.
Bus[2/2]
Creates a wrapper instance over the provided state.
Warning:
This constructor is for internal usage only.
Parameters:
-
stateThe internal state to wrap.
Clear
Uninitializes this bus.
Note:
This does not destroy the internal state it references, it just removes this reference to it.
FadeTo
Fades to gain overduration milliseconds.
Parameters:
-
gainThe gain value to fade to. -
durationThe amount of time in milliseconds to take to reach the desired gain.
GetFinalGain
Returns the final calculated gain on this bus.
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.
Returns:
The user specified gain.
GetId
Gets the unique ID of this bus.
Returns:
The bus unique ID.
GetName
Gets the name of this bus.
Returns:
The bus name.
GetState
Returns the internal state of this bus.
Warning:
This method is only for internal usage only.
Returns:
The bus internal state.
IsMuted
Returns whether this bus is muted.
Returns:
true if this bus is muted, false otherwise.
SetGain
Sets the gain of this bus.
Parameters:
-
gainThe new gain value.
SetMute
Sets the muted state of this bus.
Parameters:
-
muteThe muted state.
Valid
Checks whether this bus has been initialized.
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