// Quake is a trademark of Id Software, Inc., (c) 1996 Id Software, Inc. All
// rights reserved.
+#include "quakedef.h"
#include <windows.h>
+#include <mmsystem.h>
-#include "quakedef.h"
#include "cdaudio.h"
#if _MSC_VER < 1300
DWORD dwReturn;
if ((dwReturn = mciSendCommand(wDeviceID, MCI_SET, MCI_SET_DOOR_OPEN, (DWORD_PTR)NULL)))
- Con_Printf("MCI_SET_DOOR_OPEN failed (%i)\n", dwReturn);
+ Con_Printf("MCI_SET_DOOR_OPEN failed (%x)\n", (unsigned)dwReturn);
}
DWORD dwReturn;
if ((dwReturn = mciSendCommand(wDeviceID, MCI_SET, MCI_SET_DOOR_CLOSED, (DWORD_PTR)NULL)))
- Con_Printf("MCI_SET_DOOR_CLOSED failed (%i)\n", dwReturn);
+ Con_Printf("MCI_SET_DOOR_CLOSED failed (%x)\n", (unsigned)dwReturn);
}
int CDAudio_SysGetAudioDiskInfo(void)
}
-int CDAudio_SysPlay (qbyte track)
+int CDAudio_SysPlay (unsigned char track)
{
DWORD dwReturn;
MCI_PLAY_PARMS mciPlayParms;
dwReturn = mciSendCommand(wDeviceID, MCI_STATUS, MCI_STATUS_ITEM | MCI_TRACK | MCI_WAIT, (DWORD_PTR) (LPVOID) &mciStatusParms);
if (dwReturn)
{
- Con_Printf("CDAudio_SysPlay: MCI_STATUS failed (%i)\n", dwReturn);
+ Con_Printf("CDAudio_SysPlay: MCI_STATUS failed (%x)\n", (unsigned)dwReturn);
return -1;
}
if (mciStatusParms.dwReturn != MCI_CDA_TRACK_AUDIO)
dwReturn = mciSendCommand(wDeviceID, MCI_STATUS, MCI_STATUS_ITEM | MCI_TRACK | MCI_WAIT, (DWORD_PTR) (LPVOID) &mciStatusParms);
if (dwReturn)
{
- Con_Printf("CDAudio_SysPlay: MCI_STATUS failed (%i)\n", dwReturn);
+ Con_Printf("CDAudio_SysPlay: MCI_STATUS failed (%x)\n", (unsigned)dwReturn);
return -1;
}
dwReturn = mciSendCommand(wDeviceID, MCI_PLAY, MCI_NOTIFY | MCI_FROM | MCI_TO, (DWORD_PTR)(LPVOID) &mciPlayParms);
if (dwReturn)
{
- Con_Printf("CDAudio_SysPlay: MCI_PLAY failed (%i)\n", dwReturn);
+ Con_Printf("CDAudio_SysPlay: MCI_PLAY failed (%x)\n", (unsigned)dwReturn);
return -1;
}
if ((dwReturn = mciSendCommand(wDeviceID, MCI_STOP, 0, (DWORD_PTR)NULL)))
{
- Con_Printf("MCI_STOP failed (%i)\n", dwReturn);
+ Con_Printf("MCI_STOP failed (%x)\n", (unsigned)dwReturn);
return -1;
}
return 0;
mciGenericParms.dwCallback = (DWORD_PTR)mainwindow;
if ((dwReturn = mciSendCommand(wDeviceID, MCI_PAUSE, 0, (DWORD_PTR)(LPVOID) &mciGenericParms)))
{
- Con_Printf("MCI_PAUSE failed (%i)\n", dwReturn);
+ Con_Printf("MCI_PAUSE failed (%x)\n", (unsigned)dwReturn);
return -1;
}
return 0;
dwReturn = mciSendCommand(wDeviceID, MCI_PLAY, MCI_TO | MCI_NOTIFY, (DWORD_PTR)(LPVOID) &mciPlayParms);
if (dwReturn)
{
- Con_Printf("CDAudio_SysResume: MCI_PLAY failed (%i)\n", dwReturn);
+ Con_Printf("CDAudio_SysResume: MCI_PLAY failed (%x)\n", (unsigned)dwReturn);
return -1;
}
- return 0;
+ return 0;
}
LONG CDAudio_MessageHandler (HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
mciOpenParms.lpstrDeviceType = "cdaudio";
if ((dwReturn = mciSendCommand(0, MCI_OPEN, MCI_OPEN_TYPE | MCI_OPEN_SHAREABLE, (DWORD_PTR) (LPVOID) &mciOpenParms)))
{
- Con_Printf("CDAudio_SysStartup: MCI_OPEN failed (%i)\n", dwReturn);
+ Con_Printf("CDAudio_SysStartup: MCI_OPEN failed (%x)\n", (unsigned)dwReturn);
return -1;
}
wDeviceID = mciOpenParms.wDeviceID;
mciSetParms.dwTimeFormat = MCI_FORMAT_TMSF;
if ((dwReturn = mciSendCommand(wDeviceID, MCI_SET, MCI_SET_TIME_FORMAT, (DWORD_PTR)(LPVOID) &mciSetParms)))
{
- Con_Printf("CDAudio_SysStartup: MCI_SET_TIME_FORMAT failed (%i)\n", dwReturn);
+ Con_Printf("CDAudio_SysStartup: MCI_SET_TIME_FORMAT failed (%x)\n", (unsigned)dwReturn);
mciSendCommand(wDeviceID, MCI_CLOSE, 0, (DWORD_PTR)NULL);
return -1;
}