]> git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - snd_main.c
progs: Implement new extension DP_QC_FS_SEARCH_PACKFILE
[xonotic/darkplaces.git] / snd_main.c
index 1509d97b3369439fbd454b6fd4aef380d7219562..33c3a08bd1e958c665294288fb1883002c68cc59 100644 (file)
@@ -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 <pause>\n");
+               return;
+       }
+       S_PauseGameSounds(atoi( Cmd_Argv(cmd, 1 ) ) != 0);
+}
 
 int S_GetSoundRate(void)
 {
@@ -375,6 +383,11 @@ int S_GetSoundChannels(void)
        return snd_renderbuffer ? snd_renderbuffer->format.channels : 0;
 }
 
+int S_GetSoundWidth(void)
+{
+       return snd_renderbuffer ? snd_renderbuffer->format.width : 0;
+}
+
 
 #define SWAP_LISTENERS(l1, l2, tmpl) { tmpl = (l1); (l1) = (l2); (l2) = tmpl; }
 
@@ -572,7 +585,7 @@ void S_Startup (void)
        {
                chosen_fmt.width = SND_MIN_WIDTH;
        }
-    else if (chosen_fmt.width == 3)
+       else if (chosen_fmt.width == 3)
        {
                chosen_fmt.width = 4;
        }
@@ -780,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");