2001-02-19 21:15:25 +00:00
|
|
|
/*
|
|
|
|
cd_sdl.c
|
|
|
|
|
|
|
|
SDL CD audio routines
|
|
|
|
|
|
|
|
Copyright (C) 1996-1997 Id Software, Inc.
|
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or
|
|
|
|
modify it under the terms of the GNU General Public License
|
|
|
|
as published by the Free Software Foundation; either version 2
|
|
|
|
of the License, or (at your option) any later version.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
|
|
|
|
|
|
See the GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with this program; if not, write to:
|
|
|
|
|
|
|
|
Free Software Foundation, Inc.
|
|
|
|
59 Temple Place - Suite 330
|
|
|
|
Boston, MA 02111-1307, USA
|
|
|
|
|
|
|
|
*/
|
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
# include "config.h"
|
|
|
|
#endif
|
2003-01-15 15:31:36 +00:00
|
|
|
|
2001-02-19 21:15:25 +00:00
|
|
|
#ifdef HAVE_STRING_H
|
|
|
|
# include <string.h>
|
|
|
|
#endif
|
|
|
|
#ifdef HAVE_STRINGS_H
|
|
|
|
# include <strings.h>
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include <SDL.h>
|
|
|
|
|
2001-04-09 21:15:09 +00:00
|
|
|
#include "QF/cdaudio.h"
|
2001-03-27 23:36:02 +00:00
|
|
|
#include "QF/cmd.h"
|
2001-06-01 22:55:33 +00:00
|
|
|
#include "QF/cvar.h"
|
2001-03-27 23:36:02 +00:00
|
|
|
#include "QF/qargs.h"
|
2001-04-09 21:15:09 +00:00
|
|
|
#include "QF/sound.h"
|
2001-09-21 04:22:46 +00:00
|
|
|
#include "QF/sys.h"
|
2001-02-19 21:15:25 +00:00
|
|
|
|
2012-02-13 12:58:34 +00:00
|
|
|
#include "QF/plugin/general.h"
|
|
|
|
#include "QF/plugin/cd.h"
|
|
|
|
|
2001-06-01 22:55:33 +00:00
|
|
|
#include "compat.h"
|
|
|
|
|
2001-08-31 00:16:31 +00:00
|
|
|
static plugin_t plugin_info;
|
|
|
|
static plugin_data_t plugin_info_data;
|
|
|
|
static plugin_funcs_t plugin_info_funcs;
|
|
|
|
static general_data_t plugin_info_general_data;
|
|
|
|
static general_funcs_t plugin_info_general_funcs;
|
|
|
|
static cd_funcs_t plugin_info_cd_funcs;
|
2001-06-01 22:55:33 +00:00
|
|
|
|
2023-06-13 09:06:11 +00:00
|
|
|
static bool cdValid = false;
|
|
|
|
static bool initialized = false;
|
|
|
|
static bool enabled = true;
|
|
|
|
static bool playLooping = false;
|
2001-02-19 21:15:25 +00:00
|
|
|
|
2001-05-20 20:52:27 +00:00
|
|
|
static SDL_CD *cd_id;
|
2001-02-19 21:15:25 +00:00
|
|
|
static float cdvolume = 1.0;
|
|
|
|
|
[cvar] Make cvars properly typed
This is an extremely extensive patch as it hits every cvar, and every
usage of the cvars. Cvars no longer store the value they control,
instead, they use a cexpr value object to reference the value and
specify the value's type (currently, a null type is used for strings).
Non-string cvars are passed through cexpr, allowing expressions in the
cvars' settings. Also, cvars have returned to an enhanced version of the
original (id quake) registration scheme.
As a minor benefit, relevant code having direct access to the
cvar-controlled variables is probably a slight optimization as it
removed a pointer dereference, and the variables can be located for data
locality.
The static cvar descriptors are made private as an additional safety
layer, though there's nothing stopping external modification via
Cvar_FindVar (which is needed for adding listeners).
While not used yet (partly due to working out the design), cvars can
have a validation function.
Registering a cvar allows a primary listener (and its data) to be
specified: it will always be called first when the cvar is modified. The
combination of proper listeners and direct access to the controlled
variable greatly simplifies the more complex cvar interactions as much
less null checking is required, and there's no need for one cvar's
callback to call another's.
nq-x11 is known to work at least well enough for the demos. More testing
will come.
2022-04-23 03:22:45 +00:00
|
|
|
static float bgmvolume;
|
|
|
|
static cvar_t bgmvolume_cvar = {
|
|
|
|
.name = "bgmvolume",
|
|
|
|
.description =
|
|
|
|
"Volume of CD music",
|
|
|
|
.default_value = "1",
|
|
|
|
.flags = CVAR_ARCHIVE,
|
|
|
|
.value = { .type = &cexpr_float, .value = &bgmvolume },
|
|
|
|
};
|
2001-05-20 20:52:27 +00:00
|
|
|
|
2004-02-07 05:35:15 +00:00
|
|
|
|
2001-08-31 00:05:58 +00:00
|
|
|
static void
|
2001-06-01 22:55:33 +00:00
|
|
|
I_CDAudio_Eject (void)
|
2001-02-19 21:15:25 +00:00
|
|
|
{
|
|
|
|
if (!cd_id || !enabled)
|
|
|
|
return;
|
|
|
|
|
|
|
|
if (SDL_CDEject (cd_id))
|
2021-03-29 10:58:00 +00:00
|
|
|
Sys_MaskPrintf (SYS_snd, "Unable to eject CD-ROM tray.\n");
|
2001-02-19 21:15:25 +00:00
|
|
|
}
|
|
|
|
|
2001-08-31 00:05:58 +00:00
|
|
|
static void
|
2001-06-01 22:55:33 +00:00
|
|
|
I_CDAudio_Pause (void)
|
|
|
|
{
|
|
|
|
if (!cd_id || !enabled)
|
|
|
|
return;
|
|
|
|
if (SDL_CDStatus (cd_id) != CD_PLAYING)
|
|
|
|
return;
|
|
|
|
|
|
|
|
if (SDL_CDPause (cd_id))
|
2021-03-29 10:58:00 +00:00
|
|
|
Sys_MaskPrintf (SYS_snd, "CDAudio_Pause: Failed to pause track.\n");
|
2001-06-01 22:55:33 +00:00
|
|
|
}
|
|
|
|
|
2001-08-31 00:05:58 +00:00
|
|
|
static void
|
2001-06-01 22:55:33 +00:00
|
|
|
I_CDAudio_Stop (void)
|
|
|
|
{
|
|
|
|
int cdstate;
|
|
|
|
|
|
|
|
if (!cd_id || !enabled)
|
|
|
|
return;
|
|
|
|
cdstate = SDL_CDStatus (cd_id);
|
|
|
|
if ((cdstate != CD_PLAYING) && (cdstate != CD_PAUSED))
|
|
|
|
return;
|
|
|
|
|
|
|
|
if (SDL_CDStop (cd_id))
|
2021-03-29 10:58:00 +00:00
|
|
|
Sys_MaskPrintf (SYS_snd, "CDAudio_Stop: Failed to stop track.\n");
|
2001-06-01 22:55:33 +00:00
|
|
|
}
|
|
|
|
|
2001-08-31 00:05:58 +00:00
|
|
|
static void
|
2023-06-13 09:06:11 +00:00
|
|
|
I_CDAudio_Play (int track, bool looping)
|
2001-02-19 21:15:25 +00:00
|
|
|
{
|
|
|
|
/* Initialize cd_stat to avoid warning */
|
|
|
|
/* XXX - Does this default value make sense? */
|
|
|
|
CDstatus cd_stat = CD_ERROR;
|
|
|
|
|
|
|
|
if (!cd_id || !enabled)
|
|
|
|
return;
|
|
|
|
|
|
|
|
if (!cdValid) {
|
2004-03-21 04:59:02 +00:00
|
|
|
cd_stat = SDL_CDStatus (cd_id);
|
|
|
|
if (!CD_INDRIVE (cd_stat) || (!cd_id->numtracks))
|
2001-02-19 21:15:25 +00:00
|
|
|
return;
|
|
|
|
cdValid = true;
|
|
|
|
}
|
|
|
|
|
|
|
|
if ((track < 1) || (track >= cd_id->numtracks)) {
|
2001-06-01 22:55:33 +00:00
|
|
|
I_CDAudio_Stop ();
|
2001-02-19 21:15:25 +00:00
|
|
|
return;
|
|
|
|
}
|
2001-06-01 22:55:33 +00:00
|
|
|
track--; // Convert track from person to SDL value
|
2001-02-19 21:15:25 +00:00
|
|
|
if (cd_stat == CD_PLAYING) {
|
|
|
|
if (cd_id->cur_track == track)
|
|
|
|
return;
|
2001-06-01 22:55:33 +00:00
|
|
|
I_CDAudio_Stop ();
|
2001-02-19 21:15:25 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if (SDL_CDPlay (cd_id, cd_id->track[track].offset,
|
|
|
|
cd_id->track[track].length)) {
|
2021-03-29 10:58:00 +00:00
|
|
|
Sys_MaskPrintf (SYS_snd, "CDAudio_Play: Unable to play track: %d\n",
|
2010-11-23 05:09:30 +00:00
|
|
|
track + 1);
|
2001-02-19 21:15:25 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
playLooping = looping;
|
|
|
|
}
|
|
|
|
|
2001-08-31 00:05:58 +00:00
|
|
|
static void
|
2001-06-01 22:55:33 +00:00
|
|
|
I_CDAudio_Resume (void)
|
2001-02-19 21:15:25 +00:00
|
|
|
{
|
|
|
|
if (!cd_id || !enabled)
|
|
|
|
return;
|
2001-06-01 22:55:33 +00:00
|
|
|
if (SDL_CDStatus (cd_id) != CD_PAUSED)
|
2001-02-19 21:15:25 +00:00
|
|
|
return;
|
|
|
|
|
2001-06-01 22:55:33 +00:00
|
|
|
if (SDL_CDResume (cd_id))
|
2021-03-29 10:58:00 +00:00
|
|
|
Sys_MaskPrintf (SYS_snd, "CDAudio_Resume: Failed to resume track.\n");
|
2001-02-19 21:15:25 +00:00
|
|
|
}
|
|
|
|
|
2001-08-31 00:05:58 +00:00
|
|
|
static void
|
2001-06-01 22:55:33 +00:00
|
|
|
I_CDAudio_Shutdown (void)
|
2001-02-19 21:15:25 +00:00
|
|
|
{
|
2001-06-01 22:55:33 +00:00
|
|
|
if (!cd_id)
|
2001-02-19 21:15:25 +00:00
|
|
|
return;
|
2001-06-01 22:55:33 +00:00
|
|
|
I_CDAudio_Stop ();
|
|
|
|
SDL_CDClose (cd_id);
|
|
|
|
cd_id = NULL;
|
2001-02-19 21:15:25 +00:00
|
|
|
}
|
|
|
|
|
2001-08-31 00:05:58 +00:00
|
|
|
static void
|
2001-06-01 22:55:33 +00:00
|
|
|
I_CDAudio_Update (void)
|
2001-02-19 21:15:25 +00:00
|
|
|
{
|
|
|
|
if (!cd_id || !enabled)
|
|
|
|
return;
|
[cvar] Make cvars properly typed
This is an extremely extensive patch as it hits every cvar, and every
usage of the cvars. Cvars no longer store the value they control,
instead, they use a cexpr value object to reference the value and
specify the value's type (currently, a null type is used for strings).
Non-string cvars are passed through cexpr, allowing expressions in the
cvars' settings. Also, cvars have returned to an enhanced version of the
original (id quake) registration scheme.
As a minor benefit, relevant code having direct access to the
cvar-controlled variables is probably a slight optimization as it
removed a pointer dereference, and the variables can be located for data
locality.
The static cvar descriptors are made private as an additional safety
layer, though there's nothing stopping external modification via
Cvar_FindVar (which is needed for adding listeners).
While not used yet (partly due to working out the design), cvars can
have a validation function.
Registering a cvar allows a primary listener (and its data) to be
specified: it will always be called first when the cvar is modified. The
combination of proper listeners and direct access to the controlled
variable greatly simplifies the more complex cvar interactions as much
less null checking is required, and there's no need for one cvar's
callback to call another's.
nq-x11 is known to work at least well enough for the demos. More testing
will come.
2022-04-23 03:22:45 +00:00
|
|
|
if (bgmvolume != cdvolume) {
|
2001-02-19 21:15:25 +00:00
|
|
|
if (cdvolume) {
|
[cvar] Make cvars properly typed
This is an extremely extensive patch as it hits every cvar, and every
usage of the cvars. Cvars no longer store the value they control,
instead, they use a cexpr value object to reference the value and
specify the value's type (currently, a null type is used for strings).
Non-string cvars are passed through cexpr, allowing expressions in the
cvars' settings. Also, cvars have returned to an enhanced version of the
original (id quake) registration scheme.
As a minor benefit, relevant code having direct access to the
cvar-controlled variables is probably a slight optimization as it
removed a pointer dereference, and the variables can be located for data
locality.
The static cvar descriptors are made private as an additional safety
layer, though there's nothing stopping external modification via
Cvar_FindVar (which is needed for adding listeners).
While not used yet (partly due to working out the design), cvars can
have a validation function.
Registering a cvar allows a primary listener (and its data) to be
specified: it will always be called first when the cvar is modified. The
combination of proper listeners and direct access to the controlled
variable greatly simplifies the more complex cvar interactions as much
less null checking is required, and there's no need for one cvar's
callback to call another's.
nq-x11 is known to work at least well enough for the demos. More testing
will come.
2022-04-23 03:22:45 +00:00
|
|
|
bgmvolume = 0.0;
|
2007-05-31 06:06:52 +00:00
|
|
|
I_CDAudio_Pause ();
|
2001-02-19 21:15:25 +00:00
|
|
|
} else {
|
[cvar] Make cvars properly typed
This is an extremely extensive patch as it hits every cvar, and every
usage of the cvars. Cvars no longer store the value they control,
instead, they use a cexpr value object to reference the value and
specify the value's type (currently, a null type is used for strings).
Non-string cvars are passed through cexpr, allowing expressions in the
cvars' settings. Also, cvars have returned to an enhanced version of the
original (id quake) registration scheme.
As a minor benefit, relevant code having direct access to the
cvar-controlled variables is probably a slight optimization as it
removed a pointer dereference, and the variables can be located for data
locality.
The static cvar descriptors are made private as an additional safety
layer, though there's nothing stopping external modification via
Cvar_FindVar (which is needed for adding listeners).
While not used yet (partly due to working out the design), cvars can
have a validation function.
Registering a cvar allows a primary listener (and its data) to be
specified: it will always be called first when the cvar is modified. The
combination of proper listeners and direct access to the controlled
variable greatly simplifies the more complex cvar interactions as much
less null checking is required, and there's no need for one cvar's
callback to call another's.
nq-x11 is known to work at least well enough for the demos. More testing
will come.
2022-04-23 03:22:45 +00:00
|
|
|
bgmvolume = 1.0;
|
2007-05-31 06:06:52 +00:00
|
|
|
I_CDAudio_Resume ();
|
2001-02-19 21:15:25 +00:00
|
|
|
}
|
[cvar] Make cvars properly typed
This is an extremely extensive patch as it hits every cvar, and every
usage of the cvars. Cvars no longer store the value they control,
instead, they use a cexpr value object to reference the value and
specify the value's type (currently, a null type is used for strings).
Non-string cvars are passed through cexpr, allowing expressions in the
cvars' settings. Also, cvars have returned to an enhanced version of the
original (id quake) registration scheme.
As a minor benefit, relevant code having direct access to the
cvar-controlled variables is probably a slight optimization as it
removed a pointer dereference, and the variables can be located for data
locality.
The static cvar descriptors are made private as an additional safety
layer, though there's nothing stopping external modification via
Cvar_FindVar (which is needed for adding listeners).
While not used yet (partly due to working out the design), cvars can
have a validation function.
Registering a cvar allows a primary listener (and its data) to be
specified: it will always be called first when the cvar is modified. The
combination of proper listeners and direct access to the controlled
variable greatly simplifies the more complex cvar interactions as much
less null checking is required, and there's no need for one cvar's
callback to call another's.
nq-x11 is known to work at least well enough for the demos. More testing
will come.
2022-04-23 03:22:45 +00:00
|
|
|
cdvolume = bgmvolume;
|
2001-02-19 21:15:25 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
if (playLooping && (SDL_CDStatus (cd_id) != CD_PLAYING)
|
|
|
|
&& (SDL_CDStatus (cd_id) != CD_PAUSED))
|
2007-05-31 06:06:52 +00:00
|
|
|
I_CDAudio_Play (cd_id->cur_track + 1, true);
|
2001-02-19 21:15:25 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
#define CD_f_DEFINED
|
2001-05-20 20:52:27 +00:00
|
|
|
|
2001-08-31 00:05:58 +00:00
|
|
|
static void
|
2001-06-01 22:55:33 +00:00
|
|
|
I_CD_f (void)
|
2001-02-19 21:15:25 +00:00
|
|
|
{
|
2001-07-15 07:04:17 +00:00
|
|
|
const char *command;
|
2001-05-20 20:52:27 +00:00
|
|
|
int cdstate;
|
2001-02-19 21:15:25 +00:00
|
|
|
|
|
|
|
if (Cmd_Argc () < 2)
|
|
|
|
return;
|
|
|
|
|
|
|
|
command = Cmd_Argv (1);
|
2001-04-10 07:26:22 +00:00
|
|
|
if (strequal (command, "on")) {
|
2001-02-19 21:15:25 +00:00
|
|
|
enabled = true;
|
|
|
|
}
|
2001-04-10 07:26:22 +00:00
|
|
|
if (strequal (command, "off")) {
|
2001-02-19 21:15:25 +00:00
|
|
|
if (!cd_id)
|
|
|
|
return;
|
|
|
|
cdstate = SDL_CDStatus (cd_id);
|
|
|
|
if ((cdstate == CD_PLAYING) || (cdstate == CD_PAUSED))
|
2001-06-01 22:55:33 +00:00
|
|
|
I_CDAudio_Stop ();
|
2001-02-19 21:15:25 +00:00
|
|
|
enabled = false;
|
|
|
|
return;
|
|
|
|
}
|
2001-04-10 07:26:22 +00:00
|
|
|
if (strequal (command, "play")) {
|
2001-06-01 22:55:33 +00:00
|
|
|
I_CDAudio_Play (atoi (Cmd_Argv (2)), false);
|
2001-02-19 21:15:25 +00:00
|
|
|
return;
|
|
|
|
}
|
2001-04-10 07:26:22 +00:00
|
|
|
if (strequal (command, "loop")) {
|
2001-06-01 22:55:33 +00:00
|
|
|
I_CDAudio_Play (atoi (Cmd_Argv (2)), true);
|
2001-02-19 21:15:25 +00:00
|
|
|
return;
|
|
|
|
}
|
2001-04-10 07:26:22 +00:00
|
|
|
if (strequal (command, "stop")) {
|
2001-06-01 22:55:33 +00:00
|
|
|
I_CDAudio_Stop ();
|
2001-02-19 21:15:25 +00:00
|
|
|
return;
|
|
|
|
}
|
2001-04-10 07:26:22 +00:00
|
|
|
if (strequal (command, "pause")) {
|
2001-06-01 22:55:33 +00:00
|
|
|
I_CDAudio_Pause ();
|
2001-02-19 21:15:25 +00:00
|
|
|
return;
|
|
|
|
}
|
2001-04-10 07:26:22 +00:00
|
|
|
if (strequal (command, "resume")) {
|
2001-06-01 22:55:33 +00:00
|
|
|
I_CDAudio_Resume ();
|
2001-02-19 21:15:25 +00:00
|
|
|
return;
|
|
|
|
}
|
2001-04-10 07:26:22 +00:00
|
|
|
if (strequal (command, "eject")) {
|
2001-06-01 22:55:33 +00:00
|
|
|
I_CDAudio_Eject ();
|
2001-02-19 21:15:25 +00:00
|
|
|
return;
|
|
|
|
}
|
2001-04-10 07:26:22 +00:00
|
|
|
if (strequal (command, "info")) {
|
2001-02-19 21:15:25 +00:00
|
|
|
if (!cd_id)
|
|
|
|
return;
|
|
|
|
cdstate = SDL_CDStatus (cd_id);
|
2001-09-21 04:22:46 +00:00
|
|
|
Sys_Printf ("%d tracks\n", cd_id->numtracks);
|
2001-02-19 21:15:25 +00:00
|
|
|
if (cdstate == CD_PLAYING)
|
2001-09-21 04:22:46 +00:00
|
|
|
Sys_Printf ("Currently %s track %d\n",
|
2001-02-19 21:15:25 +00:00
|
|
|
playLooping ? "looping" : "playing",
|
|
|
|
cd_id->cur_track + 1);
|
|
|
|
else if (cdstate == CD_PAUSED)
|
2001-09-21 04:22:46 +00:00
|
|
|
Sys_Printf ("Paused %s track %d\n",
|
2001-02-19 21:15:25 +00:00
|
|
|
playLooping ? "looping" : "playing",
|
|
|
|
cd_id->cur_track + 1);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
2001-06-01 22:55:33 +00:00
|
|
|
|
2001-08-31 00:05:58 +00:00
|
|
|
static void
|
2001-06-01 22:55:33 +00:00
|
|
|
I_CDAudio_Init (void)
|
|
|
|
{
|
|
|
|
if (SDL_Init (SDL_INIT_CDROM) < 0) {
|
2001-09-21 04:22:46 +00:00
|
|
|
Sys_Printf ("Couldn't initialize SDL CD-AUDIO: %s\n", SDL_GetError ());
|
2001-06-01 22:55:33 +00:00
|
|
|
return; // was -1
|
|
|
|
}
|
|
|
|
cd_id = SDL_CDOpen (0);
|
|
|
|
if (!cd_id) {
|
2001-09-21 04:22:46 +00:00
|
|
|
Sys_Printf ("CDAudio_Init: Unable to open default CD-ROM drive: %s\n",
|
2001-06-01 22:55:33 +00:00
|
|
|
SDL_GetError ());
|
|
|
|
return; // was -1
|
|
|
|
}
|
|
|
|
|
|
|
|
initialized = true;
|
|
|
|
enabled = true;
|
|
|
|
cdValid = true;
|
|
|
|
|
|
|
|
if (!CD_INDRIVE (SDL_CDStatus (cd_id))) {
|
2001-09-21 04:22:46 +00:00
|
|
|
Sys_Printf ("CDAudio_Init: No CD in drive.\n");
|
2001-06-01 22:55:33 +00:00
|
|
|
cdValid = false;
|
|
|
|
}
|
|
|
|
if (!cd_id->numtracks) {
|
2001-09-21 04:22:46 +00:00
|
|
|
Sys_Printf ("CDAudio_Init: CD contains no audio tracks.\n");
|
2001-06-01 22:55:33 +00:00
|
|
|
cdValid = false;
|
|
|
|
}
|
2003-01-31 23:16:28 +00:00
|
|
|
|
[cvar] Make cvars properly typed
This is an extremely extensive patch as it hits every cvar, and every
usage of the cvars. Cvars no longer store the value they control,
instead, they use a cexpr value object to reference the value and
specify the value's type (currently, a null type is used for strings).
Non-string cvars are passed through cexpr, allowing expressions in the
cvars' settings. Also, cvars have returned to an enhanced version of the
original (id quake) registration scheme.
As a minor benefit, relevant code having direct access to the
cvar-controlled variables is probably a slight optimization as it
removed a pointer dereference, and the variables can be located for data
locality.
The static cvar descriptors are made private as an additional safety
layer, though there's nothing stopping external modification via
Cvar_FindVar (which is needed for adding listeners).
While not used yet (partly due to working out the design), cvars can
have a validation function.
Registering a cvar allows a primary listener (and its data) to be
specified: it will always be called first when the cvar is modified. The
combination of proper listeners and direct access to the controlled
variable greatly simplifies the more complex cvar interactions as much
less null checking is required, and there's no need for one cvar's
callback to call another's.
nq-x11 is known to work at least well enough for the demos. More testing
will come.
2022-04-23 03:22:45 +00:00
|
|
|
Cvar_Register (&bgmvolume_cvar, 0, 0);
|
2012-05-21 23:23:22 +00:00
|
|
|
|
2001-09-21 04:22:46 +00:00
|
|
|
Sys_Printf ("CD Audio Initialized.\n");
|
2001-06-01 22:55:33 +00:00
|
|
|
}
|
|
|
|
|
2004-01-20 08:34:57 +00:00
|
|
|
static general_funcs_t plugin_info_general_funcs = {
|
|
|
|
I_CDAudio_Init,
|
|
|
|
I_CDAudio_Shutdown,
|
|
|
|
};
|
|
|
|
|
|
|
|
static cd_funcs_t plugin_info_cd_funcs = {
|
2021-06-26 06:43:17 +00:00
|
|
|
0,
|
2004-01-20 08:34:57 +00:00
|
|
|
I_CD_f,
|
|
|
|
I_CDAudio_Pause,
|
|
|
|
I_CDAudio_Play,
|
|
|
|
I_CDAudio_Resume,
|
|
|
|
I_CDAudio_Update,
|
|
|
|
};
|
|
|
|
|
|
|
|
static plugin_funcs_t plugin_info_funcs = {
|
|
|
|
&plugin_info_general_funcs,
|
|
|
|
0,
|
|
|
|
&plugin_info_cd_funcs,
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
};
|
|
|
|
|
|
|
|
static plugin_data_t plugin_info_data = {
|
|
|
|
&plugin_info_general_data,
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
};
|
|
|
|
|
|
|
|
static plugin_t plugin_info = {
|
|
|
|
qfp_cd,
|
|
|
|
0,
|
|
|
|
QFPLUGIN_VERSION,
|
|
|
|
"0.1",
|
|
|
|
"SDL CD Audio output\n",
|
2004-02-07 05:35:15 +00:00
|
|
|
"Copyright (C) 2001 contributors of the QuakeForge project\n"
|
|
|
|
"Please see the file \"AUTHORS\" for a list of contributors\n",
|
2004-01-20 08:34:57 +00:00
|
|
|
&plugin_info_funcs,
|
|
|
|
&plugin_info_data,
|
|
|
|
};
|
|
|
|
|
|
|
|
PLUGIN_INFO (cd, sdl)
|
|
|
|
{
|
2001-06-01 22:55:33 +00:00
|
|
|
return &plugin_info;
|
|
|
|
}
|