ma_mutexlock;/* Only used by ma_engine_sound_init_*() and ma_engine_sound_uninit(). Not used in the mixing thread. */
ma_mutexlock;/* Only used by ma_engine_sound_init_*() and ma_engine_sound_uninit(). Not used in the mixing thread. */
ma_uint64runningTimeInEngineFrames;/* The amount of time the sound has been running in engine frames, including start delays. */
ma_uint64runningTimeInEngineFrames;/* The amount of time the sound has been running in engine frames, including start delays. */
ma_uint64startDelayInEngineFrames;
ma_uint64startDelayInEngineFrames;
ma_uint64fadeOutTimeInEngineFrames;
ma_bool32isPlaying;/* True by default. Sound groups can be stopped with ma_engine_sound_stop() and resumed with ma_engine_sound_start(). Also affects children. */
ma_bool32isPlaying;/* True by default. Sound groups can be stopped with ma_engine_sound_stop() and resumed with ma_engine_sound_start(). Also affects children. */
ma_bool32isFadingOut;/* Set to true to indicate that a fade out before stopping is in effect. */
We're not fading out. For the benefit of looping sounds, we need to make sure the timer is set properly on the fader so that fading in and out works
We're not fading out. For the benefit of looping sounds, we need to make sure the timer is set properly on the fader so that fading in and out works
across loop transitions.
across loop transitions.
*/
*/
/* TODO: Add support for controlling fading between loop transitions. Maybe have an auto-reset flag in ma_dual_fader which resets the fade once it's got past the fade time? */
/* TODO: Look at the possibility of allowing groups to use a different format to the primary data format. Makes mixing and group management much more complicated. */
/* TODO: Look at the possibility of allowing groups to use a different format to the primary data format. Makes mixing and group management much more complicated. */
ma_engine_sound_group_set_fade_out(pEngine,pGroup,MA_FADE_TIME_NONE);/* <-- Make sure we disable fading out so the sound group is stopped immediately. */
MA_ASSERT(MA_FALSE);/* Should never happen. Trigger an assert for debugging, but don't stop uninitializing in production to ensure we free memory down below. */
MA_ASSERT(MA_FALSE);/* Should never happen. Trigger an assert for debugging, but don't stop uninitializing in production to ensure we free memory down below. */
Fade out and then stop. Stopping will happen on the mixing thread. Note that it's important that we don't reset any fading state if we're already in the process
of fading out. This will happen if the sound is being stopped while in the middle of fading out naturally. In this case we just leave the fader as is and just
set the isFadingOut property to try to ensure the sound is stopped as per normal.