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

This commit is contained in:
Robert Reif 2006-01-14 17:06:22 +01:00 committed by Alexandre Julliard
parent a5074584a8
commit 2d82fc42f0
2 changed files with 17 additions and 10 deletions

View File

@ -498,6 +498,7 @@ HRESULT DSOUND_PrimaryDestroy(DirectSoundDevice *device);
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 */

View File

@ -318,19 +318,12 @@ HRESULT DSOUND_PrimaryGetPosition(DirectSoundDevice *device, LPDWORD playpos, LP
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
) {