}
+float CDAudio_SysGetVolume (void)
+{
+ // IMPLEMENTME
+ return -1.0f;
+}
+
+
+void CDAudio_SysSetVolume (float volume)
+{
+ // IMPLEMENTME
+}
+
+
int CDAudio_SysPlay (qbyte track)
{
struct ioc_read_toc_entry rte;
}
+float CDAudio_SysGetVolume (void)
+{
+ struct cdrom_volctrl vol;
+
+ if (cdfile == -1)
+ return -1.0f;
+
+ if (ioctl (cdfile, CDROMVOLREAD, &vol) == -1)
+ {
+ Con_DPrint("ioctl CDROMVOLREAD failed\n");
+ return -1.0f;
+ }
+
+ return (vol.channel0 + vol.channel1) / 2.0f / 255.0f;
+}
+
+
+void CDAudio_SysSetVolume (float volume)
+{
+ struct cdrom_volctrl vol;
+
+ if (cdfile == -1)
+ return;
+
+ vol.channel0 = vol.channel1 = volume * 255;
+ if (ioctl (cdfile, CDROMVOLCTRL, &vol) == -1)
+ Con_DPrint("ioctl CDROMVOLCTRL failed\n");
+}
+
+
int CDAudio_SysPlay (qbyte track)
{
struct cdrom_tocentry entry;
}
+float CDAudio_SysGetVolume (void)
+{
+ return -1.0f;
+}
+
+
+void CDAudio_SysSetVolume (float volume)
+{
+}
+
+
int CDAudio_SysPlay (qbyte track)
{
return -1;
extern void CDAudio_SysEject (void);
extern void CDAudio_SysCloseDoor (void);
extern int CDAudio_SysGetAudioDiskInfo (void);
+extern float CDAudio_SysGetVolume (void);
+extern void CDAudio_SysSetVolume (float volume);
extern int CDAudio_SysPlay (qbyte track);
extern int CDAudio_SysStop (void);
extern int CDAudio_SysPause (void);
static qbyte maxTrack;
static int faketrack = -1;
+static float saved_vol = 1.0f;
+
// exported variables
qboolean cdValid = false;
qboolean cdPlaying = false;
if (faketrack != -1)
S_SetChannelVolume (faketrack, newvol);
- else
- {
- // TODO: add support for the "real CD" mixer
- }
+ CDAudio_SysSetVolume (newvol);
}
cdvolume = newvol;
cdValid = false;
}
+ saved_vol = CDAudio_SysGetVolume ();
+ if (saved_vol < 0.0f)
+ saved_vol = 1.0f;
+
initialized = true;
Con_DPrint("CD Audio Initialized\n");
{
if (!initialized)
return;
+
+ CDAudio_SysSetVolume (saved_vol);
+
CDAudio_Stop();
CDAudio_SysShutdown();
initialized = false;
}
+float CDAudio_SysGetVolume (void)
+{
+ // IMPLEMENTME
+ return -1.0f;
+}
+
+
+void CDAudio_SysSetVolume (float volume)
+{
+ // IMPLEMENTME
+}
+
+
int CDAudio_SysPlay (qbyte track)
{
DWORD dwReturn;