Runtime player for one procedural ambient sound channel.
Owned by DtProceduralSoundscapeManager. One DtProceduralSoundPlayer is created per DtProceduralSoundscapeChannel whose soundFile begins with "ProceduralSound:".
Responsibilities:
- Lazily start the underlying DtProceduralSound once the audio device is ready.
- Convert the signed-distance gate (already computed by slot_postTick) into a relative-dB value using the same formula as the looping-channel path.
- Delegate chunk production to DtProceduralSound::tick() each frame.
- Parameters
-
| de | Display engine context. |
| channel | Channel configuration (name, densityScale, etc.). |
| sound | Heap-allocated procedural sound; this player takes ownership. |
| virtual makVrv::DtProceduralSoundPlayer::~DtProceduralSoundPlayer |
( |
| ) |
|
|
virtual |
Destructor. Stops the sound before releasing it.
| virtual void makVrv::DtProceduralSoundPlayer::tick |
( |
double |
dt, |
|
|
float |
relativeDb |
|
) |
| |
|
virtual |
Drive one frame of audio mixing and volume update.
- Parameters
-
| virtual void makVrv::DtProceduralSoundPlayer::stop |
( |
| ) |
|
|
virtual |
Stop the sound and silence the stream.
- Note
- Safe to call every frame; forwards to the underlying sound only when it is currently playing.
| virtual const std::string& makVrv::DtProceduralSoundPlayer::channelName |
( |
| ) |
const |
|
virtual |
Channel name used for lookup in removeAmbientChannel().
Full channel configuration (needed by slot_postTick for gate queries).
| virtual bool makVrv::DtProceduralSoundPlayer::hasEverStarted |
( |
| ) |
const |
|
virtual |
True once play() has succeeded at least once (audio device was ready). Lets ImGui distinguish "Pending" (never started) from "Out of range" (stopped).
| virtual bool makVrv::DtProceduralSoundPlayer::isActive |
( |
| ) |
const |
|
virtual |
True while the underlying sound is currently playing.
| virtual float makVrv::DtProceduralSoundPlayer::lastRelativeDb |
( |
| ) |
const |
|
virtual |
Last relative-dB value passed to tick() - useful for ImGui diagnostics.
| virtual double makVrv::DtProceduralSoundPlayer::lastSignedDistanceMeters |
( |
| ) |
const |
|
virtual |
| virtual void makVrv::DtProceduralSoundPlayer::setLastSignedDistanceMeters |
( |
double |
d | ) |
|
|
virtual |
Store the most-recent gate query result for ImGui diagnostics.
Read-only access to the underlying procedural sound for diagnostics.
Set the behavior for this player, taking ownership. Also propagates the non-owning pointer to all layers in the underlying sound. Call after the sound has been configured (setupSound has run).
Non-owning access to the current behavior, or nullptr if none.
| virtual void makVrv::DtProceduralSoundPlayer::setLastProximityFactor |
( |
float |
factor | ) |
|
|
virtual |
| virtual void makVrv::DtProceduralSoundPlayer::setChannelDecibels |
( |
float |
dbfs | ) |
|
|
virtual |
Set the channel-level dBFS attenuation resolved from the Sound-schema sound_decibels parameter.
Additive with the per-tick fade dB computed by DtProceduralSoundscapeManager::slot_postTick(); the composite is clamped to unity inside tick() before it reaches the voice. Defaults to 0.0f (no channel-level attenuation).
- Parameters
-
| dbfs | Channel-level dBFS offset (0.0f = no attenuation, negative = attenuate). |
| virtual float makVrv::DtProceduralSoundPlayer::channelDecibels |
( |
| ) |
const |
|
virtual |
Current channel-level dBFS offset (see setChannelDecibels).
| DtDe& makVrv::DtProceduralSoundPlayer::myDe |
|
protected |
| float makVrv::DtProceduralSoundPlayer::myLastRelativeDb = 0.0f |
|
protected |
| double makVrv::DtProceduralSoundPlayer::myLastSignedDistanceMeters = 1.0e9 |
|
protected |
| bool makVrv::DtProceduralSoundPlayer::myHasEverStarted = false |
|
protected |
| float makVrv::DtProceduralSoundPlayer::myChannelDecibelsDbfs = 0.0f |
|
protected |
Channel-level dBFS attenuation from the Sound-schema sound_decibels parameter. Applied additively in tick() and clamped to unity together with the caller-supplied relative dB.
| float makVrv::DtProceduralSoundPlayer::myLastProximityFactor = 0.0f |
|
protected |
The documentation for this class was generated from the following file: