2023-11-29 16:35:48 -08:00
|
|
|
From 5401bf0e1d666f14efae1a81383502d3c6231e57 Mon Sep 17 00:00:00 2001
|
2015-03-27 14:24:40 -07:00
|
|
|
From: Mark Harmstone <mark@harmstone.com>
|
|
|
|
Date: Fri, 27 Mar 2015 20:58:37 +0000
|
2018-09-16 21:08:36 -07:00
|
|
|
Subject: [PATCH] dsound: Add EAX init and free stubs.
|
2015-03-27 14:24:40 -07:00
|
|
|
|
|
|
|
---
|
2022-06-15 17:08:01 -07:00
|
|
|
dlls/dsound/buffer.c | 4 ++++
|
2015-03-27 14:24:40 -07:00
|
|
|
dlls/dsound/dsound_private.h | 2 ++
|
2015-03-28 13:17:21 -07:00
|
|
|
dlls/dsound/eax.c | 28 +++++++++++++++++++++++++++-
|
2022-06-15 17:08:01 -07:00
|
|
|
3 files changed, 33 insertions(+), 1 deletion(-)
|
2015-03-27 14:24:40 -07:00
|
|
|
|
|
|
|
diff --git a/dlls/dsound/buffer.c b/dlls/dsound/buffer.c
|
2023-05-23 19:06:20 -07:00
|
|
|
index ede6d9f1ba1..309d632397a 100644
|
2015-03-27 14:24:40 -07:00
|
|
|
--- a/dlls/dsound/buffer.c
|
|
|
|
+++ b/dlls/dsound/buffer.c
|
2023-05-23 19:06:20 -07:00
|
|
|
@@ -1145,6 +1145,8 @@ HRESULT secondarybuffer_create(DirectSoundDevice *device, const DSBUFFERDESC *ds
|
|
|
|
}
|
2018-09-16 21:08:36 -07:00
|
|
|
|
2020-07-07 16:10:13 -07:00
|
|
|
InitializeSRWLock(&dsb->lock);
|
2018-09-16 21:08:36 -07:00
|
|
|
+ if (dsb->device->eax.using_eax)
|
|
|
|
+ init_eax_buffer(dsb);
|
2015-03-27 14:24:40 -07:00
|
|
|
|
2018-09-16 21:08:36 -07:00
|
|
|
/* register buffer */
|
|
|
|
err = DirectSoundDevice_AddBuffer(device, dsb);
|
2023-05-23 19:06:20 -07:00
|
|
|
@@ -1186,6 +1188,8 @@ void secondarybuffer_destroy(IDirectSoundBufferImpl *This)
|
2023-02-28 15:05:20 -08:00
|
|
|
free(This->filters);
|
2015-03-27 14:24:40 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
+ free_eax_buffer(This);
|
2022-06-15 16:05:11 -07:00
|
|
|
+
|
2015-03-27 14:24:40 -07:00
|
|
|
TRACE("(%p) released\n", This);
|
2022-06-15 16:05:11 -07:00
|
|
|
|
2023-02-28 15:05:20 -08:00
|
|
|
free(This);
|
2015-03-27 14:24:40 -07:00
|
|
|
diff --git a/dlls/dsound/dsound_private.h b/dlls/dsound/dsound_private.h
|
2023-11-29 16:35:48 -08:00
|
|
|
index a89f635739c..e58a45cfb7d 100644
|
2015-03-27 14:24:40 -07:00
|
|
|
--- a/dlls/dsound/dsound_private.h
|
|
|
|
+++ b/dlls/dsound/dsound_private.h
|
2023-07-07 17:46:04 -07:00
|
|
|
@@ -241,6 +241,8 @@ HRESULT WINAPI EAX_Get(IDirectSoundBufferImpl *buf, REFGUID guidPropSet,
|
2015-03-27 14:24:40 -07:00
|
|
|
HRESULT WINAPI EAX_Set(IDirectSoundBufferImpl *buf, REFGUID guidPropSet,
|
|
|
|
ULONG dwPropID, void *pInstanceData, ULONG cbInstanceData, void *pPropData,
|
2023-11-29 16:35:48 -08:00
|
|
|
ULONG cbPropData);
|
|
|
|
+void free_eax_buffer(IDirectSoundBufferImpl *dsb);
|
|
|
|
+void init_eax_buffer(IDirectSoundBufferImpl *dsb);
|
2015-03-27 14:24:40 -07:00
|
|
|
|
|
|
|
/* mixer.c */
|
2023-07-07 17:46:04 -07:00
|
|
|
void DSOUND_CheckEvent(const IDirectSoundBufferImpl *dsb, DWORD playpos, int len);
|
2015-03-27 14:24:40 -07:00
|
|
|
diff --git a/dlls/dsound/eax.c b/dlls/dsound/eax.c
|
2022-06-15 16:05:11 -07:00
|
|
|
index 03b6e0a9813..91438efc335 100644
|
2015-03-27 14:24:40 -07:00
|
|
|
--- a/dlls/dsound/eax.c
|
|
|
|
+++ b/dlls/dsound/eax.c
|
2015-03-28 13:17:21 -07:00
|
|
|
@@ -92,20 +92,46 @@ static const EFXEAXREVERBPROPERTIES efx_presets[] = {
|
2015-03-27 14:24:40 -07:00
|
|
|
{ 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)
|
2015-03-28 13:17:21 -07:00
|
|
|
+static void ReverbUpdate(IDirectSoundBufferImpl *dsb)
|
2015-03-27 14:24:40 -07:00
|
|
|
{
|
|
|
|
/* stub */
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+static BOOL ReverbDeviceUpdate(DirectSoundDevice *dev)
|
|
|
|
+{
|
|
|
|
+ int i;
|
|
|
|
+
|
|
|
|
+ for (i = 0; i < dev->nrofbuffers; i++) {
|
|
|
|
+ ReverbUpdate(dev->buffers[i]);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
2015-03-28 13:17:21 -07:00
|
|
|
+void init_eax_buffer(IDirectSoundBufferImpl *dsb)
|
2015-03-27 14:24:40 -07:00
|
|
|
+{
|
|
|
|
+ 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]);
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+
|
2015-03-28 13:17:21 -07:00
|
|
|
+void free_eax_buffer(IDirectSoundBufferImpl *dsb)
|
2015-03-27 14:24:40 -07:00
|
|
|
+{
|
|
|
|
+ /* stub */
|
|
|
|
}
|
|
|
|
|
|
|
|
HRESULT WINAPI EAX_Get(IDirectSoundBufferImpl *buf, REFGUID guidPropSet,
|
2015-03-28 13:17:21 -07:00
|
|
|
--
|
2023-11-29 16:35:48 -08:00
|
|
|
2.42.0
|
2015-03-27 14:24:40 -07:00
|
|
|
|