MCPcopy Create free account
hub / github.com/DescentDevelopers/Descent3 / StopSound

Method StopSound

sndlib/sdlsound.cpp:529–554  ·  view source on GitHub ↗

Stops 2d and 3d sounds

Source from the content-addressed store, hash-verified

527
528// Stops 2d and 3d sounds
529void lnxsound::StopSound(int sound_uid, uint8_t f_immediately) {
530 int current_slot;
531 sound_buffer_info *sb;
532
533 if (sound_device == 0)
534 return;
535
536 if ((current_slot = ValidateUniqueId(sound_uid)) == -1)
537 return;
538
539 sb = &sound_cache[current_slot];
540
541 if (sb->m_status == SSF_UNUSED)
542 return;
543
544 // update sound count.
545 m_cur_sounds_played--;
546
547 if (f_immediately == SKT_STOP_AFTER_LOOP) {
548 sb->m_status &= ~SSF_PLAY_LOOPING;
549 sb->m_status |= SSF_PLAY_NORMAL;
550 return;
551 }
552
553 sound_cache[current_slot].m_status = SSF_UNUSED;
554}
555
556// Pause all sounds/resume all sounds
557void lnxsound::PauseSounds() {

Callers 2

StopMethod · 0.45
StreamMixerMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected