From: cloudwalk Date: Wed, 15 Jul 2020 14:59:08 +0000 (+0000) Subject: Implement pausesound command, ported from wrath-darkplaces X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=6a7204ff6ce92d48d2aec637cfec3a904a4afc92;p=xonotic%2Fdarkplaces.git Implement pausesound command, ported from wrath-darkplaces git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12821 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/snd_main.c b/snd_main.c index 3b995e73..33c3a08b 100644 --- a/snd_main.c +++ b/snd_main.c @@ -364,6 +364,14 @@ static void S_SoundInfo_f(cmd_state_t *cmd) Con_Printf("%5u total_channels\n", total_channels); } +static void S_PauseSound_f(cmd_state_t *cmd) +{ + if( Cmd_Argc(cmd) != 2 ) { + Con_Print("pausesound \n"); + return; + } + S_PauseGameSounds(atoi( Cmd_Argv(cmd, 1 ) ) != 0); +} int S_GetSoundRate(void) { @@ -785,6 +793,7 @@ void S_Init(void) Cmd_AddCommand(CMD_CLIENT, "play2", S_Play2_f, "play a sound globally throughout the level (not heard by anyone else)"); Cmd_AddCommand(CMD_CLIENT, "playvol", S_PlayVol_f, "play a sound at the specified volume level at your current location (not heard by anyone else)"); Cmd_AddCommand(CMD_CLIENT, "stopsound", S_StopAllSounds_f, "silence"); + Cmd_AddCommand(CMD_CLIENT, "pausesound", S_PauseSound_f, "temporary silence"); Cmd_AddCommand(CMD_CLIENT, "soundlist", S_SoundList_f, "list loaded sounds"); Cmd_AddCommand(CMD_CLIENT, "soundinfo", S_SoundInfo_f, "print sound system information (such as channels and speed)"); Cmd_AddCommand(CMD_CLIENT, "snd_restart", S_Restart_f, "restart sound system");