mirror of
https://gitlab.winehq.org/wine/wine-staging.git
synced 2024-11-21 16:46:54 -08:00
102 lines
3.3 KiB
Diff
102 lines
3.3 KiB
Diff
From 415ededb3cceae15cb05a1860cef1d4e5e055b27 Mon Sep 17 00:00:00 2001
|
|
From: Mark Harmstone <mark@harmstone.com>
|
|
Date: Fri, 27 Mar 2015 20:58:37 +0000
|
|
Subject: [PATCH] dsound: Add EAX init and free stubs.
|
|
|
|
---
|
|
dlls/dsound/buffer.c | 4 ++++
|
|
dlls/dsound/dsound_private.h | 2 ++
|
|
dlls/dsound/eax.c | 28 +++++++++++++++++++++++++++-
|
|
3 files changed, 33 insertions(+), 1 deletion(-)
|
|
|
|
diff --git a/dlls/dsound/buffer.c b/dlls/dsound/buffer.c
|
|
index 6bbf468d136..e27fdfdecc4 100644
|
|
--- a/dlls/dsound/buffer.c
|
|
+++ b/dlls/dsound/buffer.c
|
|
@@ -1110,6 +1110,8 @@ HRESULT secondarybuffer_create(DirectSoundDevice *device, const DSBUFFERDESC *ds
|
|
DSOUND_RecalcVolPan(&(dsb->volpan));
|
|
|
|
InitializeSRWLock(&dsb->lock);
|
|
+ if (dsb->device->eax.using_eax)
|
|
+ init_eax_buffer(dsb);
|
|
|
|
/* register buffer */
|
|
err = DirectSoundDevice_AddBuffer(device, dsb);
|
|
@@ -1150,6 +1152,8 @@ void secondarybuffer_destroy(IDirectSoundBufferImpl *This)
|
|
HeapFree(GetProcessHeap(), 0, This->filters);
|
|
}
|
|
|
|
+ free_eax_buffer(This);
|
|
+
|
|
HeapFree(GetProcessHeap(), 0, This);
|
|
|
|
TRACE("(%p) released\n", This);
|
|
diff --git a/dlls/dsound/dsound_private.h b/dlls/dsound/dsound_private.h
|
|
index 3b4c4f290a4..8dbb9edb594 100644
|
|
--- a/dlls/dsound/dsound_private.h
|
|
+++ b/dlls/dsound/dsound_private.h
|
|
@@ -234,6 +234,8 @@ HRESULT WINAPI EAX_Get(IDirectSoundBufferImpl *buf, REFGUID guidPropSet,
|
|
HRESULT WINAPI EAX_Set(IDirectSoundBufferImpl *buf, REFGUID guidPropSet,
|
|
ULONG dwPropID, void *pInstanceData, ULONG cbInstanceData, void *pPropData,
|
|
ULONG cbPropData) DECLSPEC_HIDDEN;
|
|
+void free_eax_buffer(IDirectSoundBufferImpl *dsb) DECLSPEC_HIDDEN;
|
|
+void init_eax_buffer(IDirectSoundBufferImpl *dsb) DECLSPEC_HIDDEN;
|
|
|
|
/* mixer.c */
|
|
void DSOUND_CheckEvent(const IDirectSoundBufferImpl *dsb, DWORD playpos, int len) DECLSPEC_HIDDEN;
|
|
diff --git a/dlls/dsound/eax.c b/dlls/dsound/eax.c
|
|
index 3931681d295..c0afb0f1acf 100644
|
|
--- a/dlls/dsound/eax.c
|
|
+++ b/dlls/dsound/eax.c
|
|
@@ -92,20 +92,46 @@ static const EFXEAXREVERBPROPERTIES efx_presets[] = {
|
|
{ 0.0625f, 0.5000f, 0.3162f, 0.8404f, 1.0000f, 7.5600f, 0.9100f, 1.0000f, 0.4864f, 0.0200f, { 0.0000f, 0.0000f, 0.0000f }, 2.4378f, 0.0300f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 4.0000f, 1.0000f, 0.9943f, 5000.0000f, 250.0000f, 0.0000f, 0x0 } /* psychotic */
|
|
};
|
|
|
|
-static BOOL ReverbDeviceUpdate(DirectSoundDevice *dev)
|
|
+static void ReverbUpdate(IDirectSoundBufferImpl *dsb)
|
|
{
|
|
/* stub */
|
|
+}
|
|
+
|
|
+static BOOL ReverbDeviceUpdate(DirectSoundDevice *dev)
|
|
+{
|
|
+ int i;
|
|
+
|
|
+ for (i = 0; i < dev->nrofbuffers; i++) {
|
|
+ ReverbUpdate(dev->buffers[i]);
|
|
+ }
|
|
+
|
|
return TRUE;
|
|
}
|
|
|
|
+void init_eax_buffer(IDirectSoundBufferImpl *dsb)
|
|
+{
|
|
+ ReverbUpdate(dsb);
|
|
+}
|
|
+
|
|
static void init_eax(DirectSoundDevice *dev)
|
|
{
|
|
+ int i;
|
|
+
|
|
dev->eax.using_eax = TRUE;
|
|
dev->eax.environment = presets[0].environment;
|
|
dev->eax.volume = presets[0].fVolume;
|
|
dev->eax.damping = presets[0].fDamping;
|
|
memcpy(&dev->eax.eax_props, &efx_presets[0], sizeof(dev->eax.eax_props));
|
|
dev->eax.eax_props.flDecayTime = presets[0].fDecayTime_sec;
|
|
+
|
|
+ for (i = 0; i < dev->nrofbuffers; i++) {
|
|
+ init_eax_buffer(dev->buffers[i]);
|
|
+ }
|
|
+}
|
|
+
|
|
+void free_eax_buffer(IDirectSoundBufferImpl *dsb)
|
|
+{
|
|
+ /* stub */
|
|
}
|
|
|
|
HRESULT WINAPI EAX_Get(IDirectSoundBufferImpl *buf, REFGUID guidPropSet,
|
|
--
|
|
2.27.0
|
|
|