Commit 2d82fc42 authored by Robert Reif's avatar Robert Reif Committed by Alexandre Julliard

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

parent a5074584
......@@ -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 */
......
......@@ -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
) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment