Robert Reif : dsound: Add DSOUND_PrimarySetFormat and use it to set primary format.

Alexandre Julliard julliard at wine.codeweavers.com
Sat Jan 14 10:56:31 CST 2006


Module: wine
Branch: refs/heads/master
Commit: 2d82fc42f075c369d8f41c7da2f1ec7480840f3a
URL:    http://source.winehq.org/git/?p=wine.git;a=commit;h=2d82fc42f075c369d8f41c7da2f1ec7480840f3a

Author: Robert Reif <reif at earthlink.net>
Date:   Sat Jan 14 17:06:22 2006 +0100

dsound: Add DSOUND_PrimarySetFormat and use it to set primary format.

---

 dlls/dsound/dsound_private.h |    1 +
 dlls/dsound/primary.c        |   26 ++++++++++++++++----------
 2 files changed, 17 insertions(+), 10 deletions(-)

diff --git a/dlls/dsound/dsound_private.h b/dlls/dsound/dsound_private.h
index 63225db..cdce82c 100644
--- a/dlls/dsound/dsound_private.h
+++ b/dlls/dsound/dsound_private.h
@@ -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 */
 
diff --git a/dlls/dsound/primary.c b/dlls/dsound/primary.c
index c69eddc..e3cd3a2 100644
--- a/dlls/dsound/primary.c
+++ b/dlls/dsound/primary.c
@@ -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-cvs mailing list