]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - cd_win.c
Cleaned up alot more memory leaks. (still get 720 leaks just running demo1.dem)
[xonotic/darkplaces.git] / cd_win.c
index 6161074db8650fc316c4b1ceb42312b55a8a9ef2..a79a24d4ec7f1d92373ba6a3e99f3dd2277cb7ed 100644 (file)
--- a/cd_win.c
+++ b/cd_win.c
@@ -23,6 +23,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 #include <windows.h>
 
 #include "quakedef.h"
+#include "cdaudio.h"
+
 
 extern HWND    mainwindow;
 
@@ -33,7 +35,7 @@ void CDAudio_SysEject(void)
        DWORD   dwReturn;
 
        if ((dwReturn = mciSendCommand(wDeviceID, MCI_SET, MCI_SET_DOOR_OPEN, (DWORD)NULL)))
-               Con_DPrintf("MCI_SET_DOOR_OPEN failed (%i)\n", dwReturn);
+               Con_Printf("MCI_SET_DOOR_OPEN failed (%i)\n", dwReturn);
 }
 
 
@@ -42,7 +44,7 @@ void CDAudio_SysCloseDoor(void)
        DWORD   dwReturn;
 
        if ((dwReturn = mciSendCommand(wDeviceID, MCI_SET, MCI_SET_DOOR_CLOSED, (DWORD)NULL)))
-               Con_DPrintf("MCI_SET_DOOR_CLOSED failed (%i)\n", dwReturn);
+               Con_Printf("MCI_SET_DOOR_CLOSED failed (%i)\n", dwReturn);
 }
 
 int CDAudio_SysGetAudioDiskInfo(void)
@@ -54,12 +56,12 @@ int CDAudio_SysGetAudioDiskInfo(void)
        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");
+               Con_Print("CDAudio: drive ready test - get status failed\n");
                return -1;
        }
        if (!mciStatusParms.dwReturn)
        {
-               Con_DPrintf("CDAudio: drive not ready\n");
+               Con_Print("CDAudio: drive not ready\n");
                return -1;
        }
 
@@ -67,12 +69,12 @@ int CDAudio_SysGetAudioDiskInfo(void)
        dwReturn = mciSendCommand(wDeviceID, MCI_STATUS, MCI_STATUS_ITEM | MCI_WAIT, (DWORD) (LPVOID) &mciStatusParms);
        if (dwReturn)
        {
-               Con_DPrintf("CDAudio: get tracks - status failed\n");
+               Con_Print("CDAudio: get tracks - status failed\n");
                return -1;
        }
        if (mciStatusParms.dwReturn < 1)
        {
-               Con_DPrintf("CDAudio: no music tracks\n");
+               Con_Print("CDAudio: no music tracks\n");
                return -1;
        }
 
@@ -80,6 +82,19 @@ int CDAudio_SysGetAudioDiskInfo(void)
 }
 
 
+float CDAudio_SysGetVolume (void)
+{
+       // IMPLEMENTME
+       return -1.0f;
+}
+
+
+void CDAudio_SysSetVolume (float volume)
+{
+       // IMPLEMENTME
+}
+
+
 int CDAudio_SysPlay (qbyte track)
 {
        DWORD                           dwReturn;
@@ -92,7 +107,7 @@ int CDAudio_SysPlay (qbyte track)
        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);
+               Con_Printf("MCI_STATUS failed (%i)\n", dwReturn);
                return -1;
        }
        if (mciStatusParms.dwReturn != MCI_CDA_TRACK_AUDIO)
@@ -110,7 +125,7 @@ int CDAudio_SysPlay (qbyte track)
        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);
+               Con_Printf("MCI_STATUS failed (%i)\n", dwReturn);
                return -1;
        }
 
@@ -120,7 +135,7 @@ int CDAudio_SysPlay (qbyte track)
        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);
+               Con_Printf("CDAudio: MCI_PLAY failed (%i)\n", dwReturn);
                return -1;
        }
 
@@ -134,7 +149,7 @@ int CDAudio_SysStop (void)
 
        if ((dwReturn = mciSendCommand(wDeviceID, MCI_STOP, 0, (DWORD)NULL)))
        {
-               Con_DPrintf("MCI_STOP failed (%i)", dwReturn);
+               Con_Printf("MCI_STOP failed (%i)\n", dwReturn);
                return -1;
        }
        return 0;
@@ -148,7 +163,7 @@ int CDAudio_SysPause (void)
        mciGenericParms.dwCallback = (DWORD)mainwindow;
        if ((dwReturn = mciSendCommand(wDeviceID, MCI_PAUSE, 0, (DWORD)(LPVOID) &mciGenericParms)))
        {
-               Con_DPrintf("MCI_PAUSE failed (%i)", dwReturn);
+               Con_Printf("MCI_PAUSE failed (%i)\n", dwReturn);
                return -1;
        }
        return 0;
@@ -166,7 +181,7 @@ int CDAudio_SysResume (void)
        dwReturn = mciSendCommand(wDeviceID, MCI_PLAY, MCI_TO | MCI_NOTIFY, (DWORD)(LPVOID) &mciPlayParms);
        if (dwReturn)
        {
-               Con_DPrintf("CDAudio: MCI_PLAY failed (%i)\n", dwReturn);
+               Con_Printf("CDAudio: MCI_PLAY failed (%i)\n", dwReturn);
                return -1;
        }
        return 0;       
@@ -193,13 +208,13 @@ LONG CDAudio_MessageHandler (HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
                        break;
 
                case MCI_NOTIFY_FAILURE:
-                       Con_DPrintf("MCI_NOTIFY_FAILURE\n");
+                       Con_Print("MCI_NOTIFY_FAILURE\n");
                        CDAudio_Stop ();
                        cdValid = false;
                        break;
 
                default:
-                       Con_DPrintf("Unexpected MM_MCINOTIFY type (%i)\n", wParam);
+                       Con_Printf("Unexpected MM_MCINOTIFY type (%i)\n", wParam);
                        return 1;
        }
 
@@ -245,5 +260,5 @@ int CDAudio_SysStartup (void)
 void CDAudio_SysShutdown (void)
 {
        if (mciSendCommand(wDeviceID, MCI_CLOSE, MCI_WAIT, (DWORD)NULL))
-               Con_DPrintf("CDAudio_Shutdown: MCI_CLOSE failed\n");
+               Con_Print("CDAudio_Shutdown: MCI_CLOSE failed\n");
 }