[DSOUND] primary patch

Robert Reif reif at earthlink.net
Fri Jan 13 17:44:42 CST 2006


Add DSOUND_PrimarySetFormat and use it to set primary format.
-------------- next part --------------
Index: dlls/dsound/dsound_private.h
===================================================================
RCS file: /home/wine/wine/dlls/dsound/dsound_private.h,v
retrieving revision 1.37
diff -p -u -r1.37 dsound_private.h
--- dlls/dsound/dsound_private.h	6 Jan 2006 12:20:34 -0000	1.37
+++ dlls/dsound/dsound_private.h	13 Jan 2006 23:40:53 -0000
@@ -498,6 +498,7 @@ HRESULT DSOUND_PrimaryDestroy(DirectSoun
 HRESULT DSOUND_PrimaryPlay(DirectSoundDevice *device);
 HRESULT DSOUND_PrimaryStop(DirectSoundDevice *device);
 HRESULT DSOUND_PrimaryGetPosition(DirectSoundDevice *device, LPDWORD playpos, LPDWORD writepos);
+HRESULT DSOUND_PrimarySetFormat(DirectSoundDevice *device, LPCWAVEFORMATEX wfex);
 
 /* buffer.c */
 
Index: dlls/dsound/primary.c
===================================================================
RCS file: /home/wine/wine/dlls/dsound/primary.c,v
retrieving revision 1.53
diff -p -u -r1.53 primary.c
--- dlls/dsound/primary.c	6 Jan 2006 12:20:34 -0000	1.53
+++ dlls/dsound/primary.c	13 Jan 2006 23:40:53 -0000
@@ -318,19 +318,12 @@ HRESULT DSOUND_PrimaryGetPosition(Direct
 	return DS_OK;
 }
 
-/*******************************************************************************
- *		PrimaryBuffer
- */
-/* This sets this format for the <em>Primary Buffer Only</em> */
-/* See file:///cdrom/sdk52/docs/worddoc/dsound.doc page 120 */
-static HRESULT WINAPI PrimaryBufferImpl_SetFormat(
-	LPDIRECTSOUNDBUFFER8 iface,LPCWAVEFORMATEX wfex
-) {
-	DirectSoundDevice *device = ((PrimaryBufferImpl *)iface)->device;
+HRESULT DSOUND_PrimarySetFormat(DirectSoundDevice *device, LPCWAVEFORMATEX wfex)
+{
 	HRESULT err = DS_OK;
 	int i, alloc_size, cp_size;
 	DWORD nSamplesPerSec;
-	TRACE("(%p,%p)\n", iface, wfex);
+	TRACE("(%p,%p)\n", device, wfex);
 
 	if (device->priolevel == DSSCL_NORMAL) {
 		WARN("failed priority check!\n");
@@ -430,6 +423,19 @@ done:
 	return err;
 }
 
+/*******************************************************************************
+ *		PrimaryBuffer
+ */
+/* This sets this format for the <em>Primary Buffer Only</em> */
+/* See file:///cdrom/sdk52/docs/worddoc/dsound.doc page 120 */
+static HRESULT WINAPI PrimaryBufferImpl_SetFormat(
+    LPDIRECTSOUNDBUFFER8 iface,
+    LPCWAVEFORMATEX wfex)
+{
+    TRACE("(%p,%p)\n", iface, wfex);
+    return DSOUND_PrimarySetFormat(((PrimaryBufferImpl *)iface)->device, wfex);
+}
+
 static HRESULT WINAPI PrimaryBufferImpl_SetVolume(
 	LPDIRECTSOUNDBUFFER8 iface,LONG vol
 ) {


More information about the wine-patches mailing list