MCPcopy Create free account
hub / github.com/TombEngine/TombEngine / Sound_FreeSlot

Function Sound_FreeSlot

TombEngine/Sound/sound.cpp:856–872  ·  view source on GitHub ↗

Stop and free desired sound slot.

Source from the content-addressed store, hash-verified

854
855// Stop and free desired sound slot.
856void Sound_FreeSlot(int index, unsigned int fadeout)
857{
858 if (index >= SOUND_MAX_CHANNELS || index < 0)
859 return;
860
861 if (SoundSlot[index].Channel != NULL && BASS_ChannelIsActive(SoundSlot[index].Channel))
862 {
863 if (fadeout > 0)
864 BASS_ChannelSlideAttribute(SoundSlot[index].Channel, BASS_ATTRIB_VOL, -1.0f, fadeout);
865 else
866 BASS_ChannelStop(SoundSlot[index].Channel);
867 }
868
869 SoundSlot[index].Channel = NULL;
870 SoundSlot[index].State = SoundState::Idle;
871 SoundSlot[index].EffectID = SOUND_NO_CHANNEL;
872}
873
874// Update sound position in a level.
875bool Sound_UpdateEffectPosition(int index, Pose *position, bool force)

Callers 5

SoundEffectFunction · 0.85
StopSoundEffectFunction · 0.85
StopAllSoundsFunction · 0.85
Sound_GetFreeSlotFunction · 0.85
Sound_UpdateSceneFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected