mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-23 12:52:46 +00:00
make sound blocking cvar controlled (in_snd_block, default off, archived) and
pause the cd as well.
This commit is contained in:
parent
016563e77f
commit
245d81420d
1 changed files with 11 additions and 2 deletions
|
@ -55,6 +55,7 @@
|
||||||
# include <X11/extensions/xf86dga.h>
|
# include <X11/extensions/xf86dga.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include "QF/cdaudio.h"
|
||||||
#include "QF/console.h"
|
#include "QF/console.h"
|
||||||
#include "QF/cmd.h"
|
#include "QF/cmd.h"
|
||||||
#include "QF/cvar.h"
|
#include "QF/cvar.h"
|
||||||
|
@ -71,6 +72,7 @@
|
||||||
#include "context_x11.h"
|
#include "context_x11.h"
|
||||||
#include "dga_check.h"
|
#include "dga_check.h"
|
||||||
|
|
||||||
|
cvar_t *in_snd_block;
|
||||||
cvar_t *in_dga;
|
cvar_t *in_dga;
|
||||||
cvar_t *in_dga_mouseaccel;
|
cvar_t *in_dga_mouseaccel;
|
||||||
|
|
||||||
|
@ -343,14 +345,19 @@ static void
|
||||||
event_focusout (XEvent * event)
|
event_focusout (XEvent * event)
|
||||||
{
|
{
|
||||||
XAutoRepeatOn (x_disp);
|
XAutoRepeatOn (x_disp);
|
||||||
S_BlockSound ();
|
if (in_snd_block->int_val) {
|
||||||
|
S_BlockSound ();
|
||||||
|
CDAudio_Pause ();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
event_focusin (XEvent * event)
|
event_focusin (XEvent * event)
|
||||||
{
|
{
|
||||||
XAutoRepeatOff (x_disp);
|
if (key_dest == key_game)
|
||||||
|
XAutoRepeatOff (x_disp);
|
||||||
S_UnblockSound ();
|
S_UnblockSound ();
|
||||||
|
CDAudio_Resume ();
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -500,6 +507,8 @@ IN_LL_Init (void)
|
||||||
void
|
void
|
||||||
IN_LL_Init_Cvars (void)
|
IN_LL_Init_Cvars (void)
|
||||||
{
|
{
|
||||||
|
in_snd_block= Cvar_Get ("in_snd_block", "0", CVAR_ARCHIVE, NULL,
|
||||||
|
"block sound output on window focus loss");
|
||||||
in_dga = Cvar_Get ("in_dga", "1", CVAR_ARCHIVE, NULL,
|
in_dga = Cvar_Get ("in_dga", "1", CVAR_ARCHIVE, NULL,
|
||||||
"DGA Input support");
|
"DGA Input support");
|
||||||
in_dga_mouseaccel = Cvar_Get ("in_dga_mouseaccel", "1", CVAR_ARCHIVE, NULL,
|
in_dga_mouseaccel = Cvar_Get ("in_dga_mouseaccel", "1", CVAR_ARCHIVE, NULL,
|
||||||
|
|
Loading…
Reference in a new issue