group2 0.1.0
CSE 125 Group 2
Loading...
Searching...
No Matches
audio::AudioRuntime Class Reference

#include <AudioRuntime.hpp>

Collaboration diagram for audio::AudioRuntime:
[legend]

Public Member Functions

bool loadManifest (std::string_view path, std::vector< std::string > *errors=nullptr)
void loadDefaultManifest ()
const AudioManifestmanifest () const noexcept
const AudioRuntimeStatsstats () const noexcept
void resetStats () noexcept
void setObjectTransform (AudioObjectId object, const glm::vec3 &position, const glm::vec3 &velocity=glm::vec3{0.0f})
void removeObject (AudioObjectId object)
void setRtpc (AudioObjectId object, RtpcId rtpc, float value)
void setSwitch (AudioObjectId object, SwitchGroupId group, SwitchValueId value)
void setState (StateGroupId group, StateValueId value)
void setBusVolume (AudioBusId bus, float volume)
float rtpcValue (AudioObjectId object, RtpcId rtpc, float fallback=0.0f) const
SwitchValueId switchValue (AudioObjectId object, SwitchGroupId group) const
float busGain (AudioBusId bus) const
std::uint16_t busMaxVoices (AudioBusId bus) const
float busPriorityOffset (AudioBusId bus) const
std::vector< AudioCommandpostEvent (AudioEventId event, AudioObjectId object=kGlobalObject, float gain=1.0f)
std::vector< AudioCommandpostEvent (std::string_view eventName, AudioObjectId object=kGlobalObject, float gain=1.0f)

Private Member Functions

void resolveNode (const AudioNodeDef &node, AudioObjectId object, float gain, std::vector< AudioCommand > &out, int depth)
void resolveStopNode (const AudioNodeDef &node, std::vector< AudioCommand > &out, int depth) const
void appendClipCommand (const AudioClipDef &clip, AudioObjectId object, float gain, float priorityOffset, bool force2D, bool force3D, std::optional< bool > loopOverride, std::vector< AudioCommand > &out) const
const AudioObjectStatefindObject (AudioObjectId object) const

Private Attributes

AudioManifest manifest_
std::unordered_map< StableId, AudioObjectStateobjects_
std::unordered_map< StableId, StableIdstates_
std::unordered_map< StableId, float > busVolumeOverrides_
std::unordered_map< StableId, std::size_t > randomLastChoice_
std::unordered_map< StableId, std::size_t > sequenceCursors_
AudioRuntimeStats stats_ {}
std::mt19937 rng_ {0xA0D10125u}

Member Function Documentation

◆ appendClipCommand()

void audio::AudioRuntime::appendClipCommand ( const AudioClipDef & clip,
AudioObjectId object,
float gain,
float priorityOffset,
bool force2D,
bool force3D,
std::optional< bool > loopOverride,
std::vector< AudioCommand > & out ) const
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ busGain()

float audio::AudioRuntime::busGain ( AudioBusId bus) const
nodiscard

◆ busMaxVoices()

std::uint16_t audio::AudioRuntime::busMaxVoices ( AudioBusId bus) const
nodiscard
Here is the caller graph for this function:

◆ busPriorityOffset()

float audio::AudioRuntime::busPriorityOffset ( AudioBusId bus) const
nodiscard
Here is the caller graph for this function:

◆ findObject()

const AudioObjectState * audio::AudioRuntime::findObject ( AudioObjectId object) const
nodiscardprivate
Here is the caller graph for this function:

◆ loadDefaultManifest()

void audio::AudioRuntime::loadDefaultManifest ( )

◆ loadManifest()

bool audio::AudioRuntime::loadManifest ( std::string_view path,
std::vector< std::string > * errors = nullptr )
Here is the call graph for this function:

◆ manifest()

const AudioManifest & audio::AudioRuntime::manifest ( ) const
inlinenodiscardnoexcept

◆ postEvent() [1/2]

std::vector< AudioCommand > audio::AudioRuntime::postEvent ( AudioEventId event,
AudioObjectId object = kGlobalObject,
float gain = 1.0f )
nodiscard
Here is the call graph for this function:
Here is the caller graph for this function:

◆ postEvent() [2/2]

std::vector< AudioCommand > audio::AudioRuntime::postEvent ( std::string_view eventName,
AudioObjectId object = kGlobalObject,
float gain = 1.0f )
nodiscard
Here is the call graph for this function:

◆ removeObject()

void audio::AudioRuntime::removeObject ( AudioObjectId object)

◆ resetStats()

void audio::AudioRuntime::resetStats ( )
inlinenoexcept

◆ resolveNode()

void audio::AudioRuntime::resolveNode ( const AudioNodeDef & node,
AudioObjectId object,
float gain,
std::vector< AudioCommand > & out,
int depth )
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ resolveStopNode()

void audio::AudioRuntime::resolveStopNode ( const AudioNodeDef & node,
std::vector< AudioCommand > & out,
int depth ) const
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ rtpcValue()

float audio::AudioRuntime::rtpcValue ( AudioObjectId object,
RtpcId rtpc,
float fallback = 0.0f ) const
nodiscard
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setBusVolume()

void audio::AudioRuntime::setBusVolume ( AudioBusId bus,
float volume )
Here is the caller graph for this function:

◆ setObjectTransform()

void audio::AudioRuntime::setObjectTransform ( AudioObjectId object,
const glm::vec3 & position,
const glm::vec3 & velocity = glm::vec3{0.0f} )

◆ setRtpc()

void audio::AudioRuntime::setRtpc ( AudioObjectId object,
RtpcId rtpc,
float value )
Here is the caller graph for this function:

◆ setState()

void audio::AudioRuntime::setState ( StateGroupId group,
StateValueId value )
Here is the caller graph for this function:

◆ setSwitch()

void audio::AudioRuntime::setSwitch ( AudioObjectId object,
SwitchGroupId group,
SwitchValueId value )
Here is the caller graph for this function:

◆ stats()

const AudioRuntimeStats & audio::AudioRuntime::stats ( ) const
inlinenodiscardnoexcept

◆ switchValue()

SwitchValueId audio::AudioRuntime::switchValue ( AudioObjectId object,
SwitchGroupId group ) const
nodiscard
Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ busVolumeOverrides_

std::unordered_map<StableId, float> audio::AudioRuntime::busVolumeOverrides_
private

◆ manifest_

AudioManifest audio::AudioRuntime::manifest_
private

◆ objects_

std::unordered_map<StableId, AudioObjectState> audio::AudioRuntime::objects_
private

◆ randomLastChoice_

std::unordered_map<StableId, std::size_t> audio::AudioRuntime::randomLastChoice_
private

◆ rng_

std::mt19937 audio::AudioRuntime::rng_ {0xA0D10125u}
private

◆ sequenceCursors_

std::unordered_map<StableId, std::size_t> audio::AudioRuntime::sequenceCursors_
private

◆ states_

std::unordered_map<StableId, StableId> audio::AudioRuntime::states_
private

◆ stats_

AudioRuntimeStats audio::AudioRuntime::stats_ {}
mutableprivate

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