static qboolean playLooping = false;
static float cdvolume;
static qbyte remap[100];
-static qbyte cdrom;
static qbyte playTrack;
static qbyte maxTrack;
{
DWORD dwReturn;
- if (dwReturn = mciSendCommand(wDeviceID, MCI_SET, MCI_SET_DOOR_OPEN, (DWORD)NULL))
+ if ((dwReturn = mciSendCommand(wDeviceID, MCI_SET, MCI_SET_DOOR_OPEN, (DWORD)NULL)))
Con_DPrintf("MCI_SET_DOOR_OPEN failed (%i)\n", dwReturn);
}
{
DWORD dwReturn;
- if (dwReturn = mciSendCommand(wDeviceID, MCI_SET, MCI_SET_DOOR_CLOSED, (DWORD)NULL))
+ if ((dwReturn = mciSendCommand(wDeviceID, MCI_SET, MCI_SET_DOOR_CLOSED, (DWORD)NULL)))
Con_DPrintf("MCI_SET_DOOR_CLOSED failed (%i)\n", dwReturn);
}
cdValid = false;
mciStatusParms.dwItem = MCI_STATUS_READY;
- dwReturn = mciSendCommand(wDeviceID, MCI_STATUS, MCI_STATUS_ITEM | MCI_WAIT, (DWORD) (LPVOID) &mciStatusParms);
+ dwReturn = mciSendCommand(wDeviceID, MCI_STATUS, MCI_STATUS_ITEM | MCI_WAIT, (DWORD) (LPVOID) &mciStatusParms);
if (dwReturn)
{
Con_DPrintf("CDAudio: drive ready test - get status failed\n");
}
mciStatusParms.dwItem = MCI_STATUS_NUMBER_OF_TRACKS;
- dwReturn = mciSendCommand(wDeviceID, MCI_STATUS, MCI_STATUS_ITEM | MCI_WAIT, (DWORD) (LPVOID) &mciStatusParms);
+ dwReturn = mciSendCommand(wDeviceID, MCI_STATUS, MCI_STATUS_ITEM | MCI_WAIT, (DWORD) (LPVOID) &mciStatusParms);
if (dwReturn)
{
Con_DPrintf("CDAudio: get tracks - status failed\n");
void CDAudio_Play(qbyte track, qboolean looping)
{
DWORD dwReturn;
- MCI_PLAY_PARMS mciPlayParms;
+ MCI_PLAY_PARMS mciPlayParms;
MCI_STATUS_PARMS mciStatusParms;
if (!enabled)
// don't try to play a non-audio track
mciStatusParms.dwItem = MCI_CDA_STATUS_TYPE_TRACK;
mciStatusParms.dwTrack = track;
- dwReturn = mciSendCommand(wDeviceID, MCI_STATUS, MCI_STATUS_ITEM | MCI_TRACK | MCI_WAIT, (DWORD) (LPVOID) &mciStatusParms);
+ dwReturn = mciSendCommand(wDeviceID, MCI_STATUS, MCI_STATUS_ITEM | MCI_TRACK | MCI_WAIT, (DWORD) (LPVOID) &mciStatusParms);
if (dwReturn)
{
Con_DPrintf("MCI_STATUS failed (%i)\n", dwReturn);
// get the length of the track to be played
mciStatusParms.dwItem = MCI_STATUS_LENGTH;
mciStatusParms.dwTrack = track;
- dwReturn = mciSendCommand(wDeviceID, MCI_STATUS, MCI_STATUS_ITEM | MCI_TRACK | MCI_WAIT, (DWORD) (LPVOID) &mciStatusParms);
+ dwReturn = mciSendCommand(wDeviceID, MCI_STATUS, MCI_STATUS_ITEM | MCI_TRACK | MCI_WAIT, (DWORD) (LPVOID) &mciStatusParms);
if (dwReturn)
{
Con_DPrintf("MCI_STATUS failed (%i)\n", dwReturn);
CDAudio_Stop();
}
- mciPlayParms.dwFrom = MCI_MAKE_TMSF(track, 0, 0, 0);
+ mciPlayParms.dwFrom = MCI_MAKE_TMSF(track, 0, 0, 0);
mciPlayParms.dwTo = (mciStatusParms.dwReturn << 8) | track;
- mciPlayParms.dwCallback = (DWORD)mainwindow;
- dwReturn = mciSendCommand(wDeviceID, MCI_PLAY, MCI_NOTIFY | MCI_FROM | MCI_TO, (DWORD)(LPVOID) &mciPlayParms);
+ mciPlayParms.dwCallback = (DWORD)mainwindow;
+ dwReturn = mciSendCommand(wDeviceID, MCI_PLAY, MCI_NOTIFY | MCI_FROM | MCI_TO, (DWORD)(LPVOID) &mciPlayParms);
if (dwReturn)
{
Con_DPrintf("CDAudio: MCI_PLAY failed (%i)\n", dwReturn);
if (!playing)
return;
- if (dwReturn = mciSendCommand(wDeviceID, MCI_STOP, 0, (DWORD)NULL))
+ if ((dwReturn = mciSendCommand(wDeviceID, MCI_STOP, 0, (DWORD)NULL)))
Con_DPrintf("MCI_STOP failed (%i)", dwReturn);
wasPlaying = false;
return;
mciGenericParms.dwCallback = (DWORD)mainwindow;
- if (dwReturn = mciSendCommand(wDeviceID, MCI_PAUSE, 0, (DWORD)(LPVOID) &mciGenericParms))
+ if ((dwReturn = mciSendCommand(wDeviceID, MCI_PAUSE, 0, (DWORD)(LPVOID) &mciGenericParms)))
Con_DPrintf("MCI_PAUSE failed (%i)", dwReturn);
wasPlaying = playing;
void CDAudio_Resume(void)
{
DWORD dwReturn;
- MCI_PLAY_PARMS mciPlayParms;
+ MCI_PLAY_PARMS mciPlayParms;
if (!enabled)
return;
if (!wasPlaying)
return;
- mciPlayParms.dwFrom = MCI_MAKE_TMSF(playTrack, 0, 0, 0);
- mciPlayParms.dwTo = MCI_MAKE_TMSF(playTrack + 1, 0, 0, 0);
- mciPlayParms.dwCallback = (DWORD)mainwindow;
- dwReturn = mciSendCommand(wDeviceID, MCI_PLAY, MCI_TO | MCI_NOTIFY, (DWORD)(LPVOID) &mciPlayParms);
+ mciPlayParms.dwFrom = MCI_MAKE_TMSF(playTrack, 0, 0, 0);
+ mciPlayParms.dwTo = MCI_MAKE_TMSF(playTrack + 1, 0, 0, 0);
+ mciPlayParms.dwCallback = (DWORD)mainwindow;
+ dwReturn = mciSendCommand(wDeviceID, MCI_PLAY, MCI_TO | MCI_NOTIFY, (DWORD)(LPVOID) &mciPlayParms);
if (dwReturn)
{
Con_DPrintf("CDAudio: MCI_PLAY failed (%i)\n", dwReturn);
{
DWORD dwReturn;
MCI_OPEN_PARMS mciOpenParms;
- MCI_SET_PARMS mciSetParms;
+ MCI_SET_PARMS mciSetParms;
int n;
if (cls.state == ca_dedicated)
return -1;
mciOpenParms.lpstrDeviceType = "cdaudio";
- if (dwReturn = mciSendCommand(0, MCI_OPEN, MCI_OPEN_TYPE | MCI_OPEN_SHAREABLE, (DWORD) (LPVOID) &mciOpenParms))
+ if ((dwReturn = mciSendCommand(0, MCI_OPEN, MCI_OPEN_TYPE | MCI_OPEN_SHAREABLE, (DWORD) (LPVOID) &mciOpenParms)))
{
Con_Printf("CDAudio_Init: MCI_OPEN failed (%i)\n", dwReturn);
return -1;
}
wDeviceID = mciOpenParms.wDeviceID;
- // Set the time format to track/minute/second/frame (TMSF).
- mciSetParms.dwTimeFormat = MCI_FORMAT_TMSF;
- if (dwReturn = mciSendCommand(wDeviceID, MCI_SET, MCI_SET_TIME_FORMAT, (DWORD)(LPVOID) &mciSetParms))
- {
+ // Set the time format to track/minute/second/frame (TMSF).
+ mciSetParms.dwTimeFormat = MCI_FORMAT_TMSF;
+ if ((dwReturn = mciSendCommand(wDeviceID, MCI_SET, MCI_SET_TIME_FORMAT, (DWORD)(LPVOID) &mciSetParms)))
+ {
Con_Printf("MCI_SET_TIME_FORMAT failed (%i)\n", dwReturn);
- mciSendCommand(wDeviceID, MCI_CLOSE, 0, (DWORD)NULL);
+ mciSendCommand(wDeviceID, MCI_CLOSE, 0, (DWORD)NULL);
return -1;
- }
+ }
for (n = 0; n < 100; n++)
remap[n] = n;