Exemple #1
0
/*
* SF_Shutdown
*/
void SF_Shutdown( bool verbose )
{
	if( !soundpool ) {
		return;
	}

	SF_StopAllSounds( true, true );

	// free all sounds
	SF_FreeSounds();
	
	// wake up the mixer
	SF_Activate( true );

	// shutdown backend
	S_IssueShutdownCmd( s_cmdPipe, verbose );

	// wait for the queue to be processed
	S_FinishSoundCmdPipe( s_cmdPipe );
	
	// wait for the backend thread to die
	trap_Thread_Join( s_backThread );
	s_backThread = NULL;

	S_DestroySoundCmdPipe( &s_cmdPipe );

#ifdef ENABLE_PLAY
	trap_Cmd_RemoveCommand( "play" );
#endif
	trap_Cmd_RemoveCommand( "music" );
	trap_Cmd_RemoveCommand( "stopsound" );
	trap_Cmd_RemoveCommand( "stopmusic" );
	trap_Cmd_RemoveCommand( "prevmusic" );
	trap_Cmd_RemoveCommand( "nextmusic" );
	trap_Cmd_RemoveCommand( "pausemusic" );
	trap_Cmd_RemoveCommand( "soundlist" );
	trap_Cmd_RemoveCommand( "soundinfo" );

	S_MemFreePool( &soundpool );

	s_registering = false;

	num_sfx = 0;
}
Exemple #2
0
/*
* S_CloseBackgroundTrackTask
*/
static void S_CloseBackgroundTrackTask( void )
{
	s_bgTrackBuffering = false;
	trap_Thread_Join( s_bgOpenThread );
	s_bgOpenThread = NULL;
}