{waveOut,midiOut}{Get,Set}Volume signature change

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




In the latest sdk headers these functions take a handle as the first parameter instead of an int. This makes much more sense and lets us get rid of many casts.
The only exception is the 16bit functions. I hope I did the conversion correctly.

Changelog:

Francois Gouget <fgouget@codeweavers.com>

* dlls/winmm/mmsystem.c,
dlls/winmm/winmm.c,
dlls/winmm/wavemap/wavemap.c,
include/mmsystem.h

In the latest sdk the {waveOut,midiOut}{Get,Set}Volume functions take a handle as the first parameter

--
Francois Gouget
fgouget@codeweavers.com

Index: dlls/winmm/mmsystem.c
===================================================================
RCS file: /home/wine/wine/dlls/winmm/mmsystem.c,v
retrieving revision 1.87
diff -u -r1.87 mmsystem.c
--- dlls/winmm/mmsystem.c	6 Nov 2002 19:57:49 -0000	1.87
+++ dlls/winmm/mmsystem.c	13 Dec 2002 19:18:54 -0000
@@ -808,7 +808,7 @@
  */
 UINT16 WINAPI midiOutGetVolume16(UINT16 uDeviceID, DWORD* lpdwVolume)
 {
-    return midiOutGetVolume(uDeviceID, lpdwVolume);
+    return midiOutGetVolume(HMIDIOUT_32(uDeviceID), lpdwVolume);
 }
 
 /**************************************************************************
@@ -816,7 +816,7 @@
  */
 UINT16 WINAPI midiOutSetVolume16(UINT16 uDeviceID, DWORD dwVolume)
 {
-    return midiOutSetVolume(uDeviceID, dwVolume);
+    return midiOutSetVolume(HMIDIOUT_32(uDeviceID), dwVolume);
 }
 
 /**************************************************************************
@@ -1413,7 +1413,7 @@
  */
 UINT16 WINAPI waveOutGetVolume16(UINT16 devid, LPDWORD lpdw)
 {
-    return waveOutGetVolume(devid, lpdw);
+    return waveOutGetVolume(HWAVEOUT_32(devid), lpdw);
 }
 
 /**************************************************************************
@@ -1421,7 +1421,7 @@
  */
 UINT16 WINAPI waveOutSetVolume16(UINT16 devid, DWORD dw)
 {
-    return waveOutSetVolume(devid, dw);
+    return waveOutSetVolume(HWAVEOUT_32(devid), dw);
 }
 
 /**************************************************************************
Index: dlls/winmm/winmm.c
===================================================================
RCS file: /home/wine/wine/dlls/winmm/winmm.c,v
retrieving revision 1.10
diff -u -r1.10 winmm.c
--- dlls/winmm/winmm.c	30 Nov 2002 01:51:56 -0000	1.10
+++ dlls/winmm/winmm.c	13 Dec 2002 19:18:55 -0000
@@ -1182,13 +1182,13 @@
 /**************************************************************************
  * 				midiOutGetVolume	[WINMM.@]
  */
-UINT WINAPI midiOutGetVolume(UINT uDeviceID, DWORD* lpdwVolume)
+UINT WINAPI midiOutGetVolume(HMIDIOUT hMidiOut, DWORD* lpdwVolume)
 {
     LPWINE_MLD		wmld;
 
-    TRACE("(%04X, %p);\n", uDeviceID, lpdwVolume);
+    TRACE("(%p, %p);\n", hMidiOut, lpdwVolume);
 
-    if ((wmld = MMDRV_Get((HANDLE)uDeviceID, MMDRV_MIDIOUT, TRUE)) == NULL)
+    if ((wmld = MMDRV_Get(hMidiOut, MMDRV_MIDIOUT, TRUE)) == NULL)
 	return MMSYSERR_INVALHANDLE;
 
     return MMDRV_Message(wmld, MODM_GETVOLUME, (DWORD)lpdwVolume, 0L, TRUE);
@@ -1197,13 +1197,13 @@
 /**************************************************************************
  * 				midiOutSetVolume	[WINMM.@]
  */
-UINT WINAPI midiOutSetVolume(UINT uDeviceID, DWORD dwVolume)
+UINT WINAPI midiOutSetVolume(HMIDIOUT hMidiOut, DWORD dwVolume)
 {
     LPWINE_MLD		wmld;
 
-    TRACE("(%04X, %ld);\n", uDeviceID, dwVolume);
+    TRACE("(%p, %ld);\n", hMidiOut, dwVolume);
 
-    if ((wmld = MMDRV_Get((HANDLE)uDeviceID, MMDRV_MIDIOUT, TRUE)) == NULL)
+    if ((wmld = MMDRV_Get(hMidiOut, MMDRV_MIDIOUT, TRUE)) == NULL)
 	return MMSYSERR_INVALHANDLE;
 
     return MMDRV_Message(wmld, MODM_SETVOLUME, dwVolume, 0L, TRUE);
@@ -2519,13 +2520,13 @@
 /**************************************************************************
  * 				waveOutGetVolume	[WINMM.@]
  */
-UINT WINAPI waveOutGetVolume(UINT devid, LPDWORD lpdw)
+UINT WINAPI waveOutGetVolume(HWAVEOUT hWaveOut, LPDWORD lpdw)
 {
     LPWINE_MLD		wmld;
 
-    TRACE("(%04X, %08lx);\n", devid, (DWORD)lpdw);
+    TRACE("(%p, %08lx);\n", hWaveOut, (DWORD)lpdw);
 
-     if ((wmld = MMDRV_Get((HANDLE)devid, MMDRV_WAVEOUT, TRUE)) == NULL)
+     if ((wmld = MMDRV_Get(hWaveOut, MMDRV_WAVEOUT, TRUE)) == NULL)
         return MMSYSERR_INVALHANDLE;
 
     return MMDRV_Message(wmld, WODM_GETVOLUME, (DWORD)lpdw, 0L, TRUE);
@@ -2534,13 +2535,13 @@
 /**************************************************************************
  * 				waveOutSetVolume	[WINMM.@]
  */
-UINT WINAPI waveOutSetVolume(UINT devid, DWORD dw)
+UINT WINAPI waveOutSetVolume(HWAVEOUT hWaveOut, DWORD dw)
 {
     LPWINE_MLD		wmld;
 
-    TRACE("(%04X, %08lx);\n", devid, dw);
+    TRACE("(%p, %08lx);\n", hWaveOut, dw);
 
-     if ((wmld = MMDRV_Get((HANDLE)devid, MMDRV_WAVEOUT, TRUE)) == NULL)
+     if ((wmld = MMDRV_Get(hWaveOut, MMDRV_WAVEOUT, TRUE)) == NULL)
         return MMSYSERR_INVALHANDLE;
 
     return MMDRV_Message(wmld, WODM_SETVOLUME, dw, 0L, TRUE);
Index: dlls/winmm/wavemap/wavemap.c
===================================================================
RCS file: /home/wine/wine/dlls/winmm/wavemap/wavemap.c,v
retrieving revision 1.26
diff -u -r1.26 wavemap.c
--- dlls/winmm/wavemap/wavemap.c	13 Dec 2002 02:18:20 -0000	1.26
+++ dlls/winmm/wavemap/wavemap.c	13 Dec 2002 19:18:56 -0000
@@ -392,14 +419,14 @@
 static	DWORD	wodGetVolume(UINT wDevID, WAVEMAPDATA* wom, LPDWORD lpVol)
 {
     if (WAVEMAP_IsData(wom))
-	return waveOutGetVolume((UINT)wom->u.out.hInnerWave, lpVol);
+	return waveOutGetVolume(wom->u.out.hInnerWave, lpVol);
     return MMSYSERR_NOERROR;
 }
 
 static	DWORD	wodSetVolume(UINT wDevID, WAVEMAPDATA* wom, DWORD vol)
 {
     if (WAVEMAP_IsData(wom))
-	return waveOutSetVolume((UINT)wom->u.out.hInnerWave, vol);
+	return waveOutSetVolume(wom->u.out.hInnerWave, vol);
     return MMSYSERR_NOERROR;
 }
 
Index: include/mmsystem.h
===================================================================
RCS file: /home/wine/wine/include/mmsystem.h,v
retrieving revision 1.59
diff -u -r1.59 mmsystem.h
--- include/mmsystem.h	30 Nov 2002 01:50:06 -0000	1.59
+++ include/mmsystem.h	13 Dec 2002 19:19:03 -0000
@@ -435,8 +435,8 @@
 UINT 		WINAPI 	waveOutGetDevCapsA(UINT,LPWAVEOUTCAPSA,UINT);
 UINT 		WINAPI	waveOutGetDevCapsW(UINT,LPWAVEOUTCAPSW,UINT);
 #define 		waveOutGetDevCaps WINELIB_NAME_AW(waveOutGetDevCaps)
-UINT 		WINAPI	waveOutGetVolume(UINT,DWORD*);
-UINT 		WINAPI 	waveOutSetVolume(UINT,DWORD);
+UINT 		WINAPI	waveOutGetVolume(HWAVEOUT,DWORD*);
+UINT 		WINAPI 	waveOutSetVolume(HWAVEOUT,DWORD);
 UINT 		WINAPI 	waveOutGetErrorTextA(UINT,LPSTR,UINT);
 UINT 		WINAPI 	waveOutGetErrorTextW(UINT,LPWSTR,UINT);
 #define 	    	waveOutGetErrorText WINELIB_NAME_AW(waveOutGetErrorText)
@@ -637,8 +637,8 @@
 UINT		WINAPI	midiOutGetDevCapsA(UINT,LPMIDIOUTCAPSA,UINT);
 UINT		WINAPI	midiOutGetDevCapsW(UINT,LPMIDIOUTCAPSW,UINT);
 #define 		midiOutGetDevCaps WINELIB_NAME_AW(midiOutGetDevCaps)
-UINT		WINAPI	midiOutGetVolume(UINT,DWORD*);
-UINT		WINAPI	midiOutSetVolume(UINT,DWORD);
+UINT		WINAPI	midiOutGetVolume(HMIDIOUT,DWORD*);
+UINT		WINAPI	midiOutSetVolume(HMIDIOUT,DWORD);
 UINT		WINAPI	midiOutGetErrorTextA(UINT,LPSTR,UINT);
 UINT		WINAPI	midiOutGetErrorTextW(UINT,LPWSTR,UINT);
 #define 		midiOutGetErrorText WINELIB_NAME_AW(midiOutGetErrorText)

[Index of Archives]     [Gimp for Windows]     [Red Hat]     [Samba]     [Yosemite Camping]     [Graphics Cards]     [Wine Home]

  Powered by Linux