#include "quakedef.h"
+// used by menu to ghost CD audio slider
+qboolean cdaudioinitialized = false;
static qboolean cdValid = false;
-static qboolean playing = false;
-static qboolean wasPlaying = false;
-static qboolean initialized = false;
-static qboolean enabled = true;
+static qboolean playing = false;
+static qboolean wasPlaying = false;
+static qboolean initialized = false;
+static qboolean enabled = true;
static qboolean playLooping = false;
-static float cdvolume;
-static byte remap[100];
-static byte playTrack;
-static byte maxTrack;
+static float cdvolume;
+static qbyte remap[100];
+static qbyte playTrack;
+static qbyte maxTrack;
static int cdfile = -1;
static char cd_dev[64] = "/dev/cdrom";
}
-void CDAudio_Play(byte track, qboolean looping)
+void CDAudio_Play(qbyte track, qboolean looping)
{
struct cdrom_tocentry entry;
struct cdrom_ti ti;
if (!wasPlaying)
return;
- if ( ioctl(cdfile, CDROMRESUME) == -1 )
+ if ( ioctl(cdfile, CDROMRESUME) == -1 )
Con_DPrintf("ioctl cdromresume failed\n");
playing = true;
}
static void CD_f (void)
{
- char *command;
- int ret;
- int n;
+ const char *command;
+ int ret;
+ int n;
if (Cmd_Argc() < 2)
return;
if (Q_strcasecmp(command, "play") == 0)
{
- CDAudio_Play((byte)atoi(Cmd_Argv (2)), false);
+ CDAudio_Play((qbyte)atoi(Cmd_Argv (2)), false);
return;
}
if (Q_strcasecmp(command, "loop") == 0)
{
- CDAudio_Play((byte)atoi(Cmd_Argv (2)), true);
+ CDAudio_Play((qbyte)atoi(Cmd_Argv (2)), true);
return;
}
{
if (cdvolume)
{
- Cvar_SetValue ("bgmvolume", 0.0);
+ Cvar_SetValueQuick (&bgmvolume, 0.0);
cdvolume = bgmvolume.value;
CDAudio_Pause ();
}
else
{
- Cvar_SetValue ("bgmvolume", 1.0);
+ Cvar_SetValueQuick (&bgmvolume, 1.0);
cdvolume = bgmvolume.value;
CDAudio_Resume ();
}
if (cls.state == ca_dedicated)
return -1;
- if (COM_CheckParm("-nocdaudio"))
+ if (COM_CheckParm("-nocdaudio") || COM_CheckParm("-safe"))
return -1;
if ((i = COM_CheckParm("-cddev")) != 0 && i < com_argc - 1) {
for (i = 0; i < 100; i++)
remap[i] = i;
+ cdaudioinitialized = true;
initialized = true;
enabled = true;
close(cdfile);
cdfile = -1;
}
+
+void CDAudio_Open(void)
+{
+}
+
+void CDAudio_Close(void)
+{
+}