Commit 9f53b7a8 authored by Mark Harmstone's avatar Mark Harmstone Committed by Vitaly Lipatov

dsound: Support getting and setting EAX buffer properties.

parent 92376c01
......@@ -1127,6 +1127,8 @@ HRESULT secondarybuffer_create(DirectSoundDevice *device, const DSBUFFERDESC *ds
return DSERR_OUTOFMEMORY;
}
dsb->eax.reverb_mix = EAX_REVERBMIX_USEDISTANCE;
if (dsb->dsbd.dwFlags & DSBCAPS_CTRL3D) {
dsb->ds3db_ds3db.dwSize = sizeof(DS3DBUFFER);
dsb->ds3db_ds3db.vPosition.x = 0.0;
......
......@@ -119,6 +119,10 @@ typedef struct {
EFXEAXREVERBPROPERTIES eax_props;
} eax_info;
typedef struct {
float reverb_mix;
} eax_buffer_info;
#ifdef __cplusplus
}
#endif
......
......@@ -177,6 +177,8 @@ struct IDirectSoundBufferImpl
int num_filters;
DSFilter* filters;
eax_buffer_info eax;
struct list entry;
};
......
......@@ -179,6 +179,38 @@ HRESULT WINAPI EAX_Get(IDirectSoundBufferImpl *buf, REFGUID guidPropSet,
}
return S_OK;
} else if (IsEqualGUID(&DSPROPSETID_EAXBUFFER_ReverbProperties, guidPropSet)) {
EAXBUFFER_REVERBPROPERTIES *props;
if (!buf->device->eax.using_eax)
init_eax(buf->device);
switch (dwPropID) {
case DSPROPERTY_EAXBUFFER_ALL:
if (cbPropData < sizeof(EAXBUFFER_REVERBPROPERTIES))
return E_FAIL;
props = pPropData;
props->fMix = buf->eax.reverb_mix;
*pcbReturned = sizeof(EAXBUFFER_REVERBPROPERTIES);
break;
case DSPROPERTY_EAXBUFFER_REVERBMIX:
if (cbPropData < sizeof(float))
return E_FAIL;
*(float*)pPropData = buf->eax.reverb_mix;
*pcbReturned = sizeof(float);
break;
default:
return E_PROP_ID_UNSUPPORTED;
}
return S_OK;
}
return E_PROP_ID_UNSUPPORTED;
......@@ -276,6 +308,38 @@ HRESULT WINAPI EAX_Set(IDirectSoundBufferImpl *buf, REFGUID guidPropSet,
}
return S_OK;
} else if (IsEqualGUID(&DSPROPSETID_EAXBUFFER_ReverbProperties, guidPropSet)) {
EAXBUFFER_REVERBPROPERTIES *props;
if (!buf->device->eax.using_eax)
init_eax(buf->device);
switch (dwPropID) {
case DSPROPERTY_EAXBUFFER_ALL:
if (cbPropData != sizeof(EAXBUFFER_REVERBPROPERTIES))
return E_FAIL;
props = pPropData;
TRACE("setting reverb mix to %f\n", props->fMix);
buf->eax.reverb_mix = props->fMix;
break;
case DSPROPERTY_EAXBUFFER_REVERBMIX:
if (cbPropData != sizeof(float))
return E_FAIL;
TRACE("setting reverb mix to %f\n", *(float*)pPropData);
buf->eax.reverb_mix = *(float*)pPropData;
break;
default:
return E_PROP_ID_UNSUPPORTED;
}
return S_OK;
}
return E_PROP_ID_UNSUPPORTED;
......
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