[PATCH 2/6] dsdmo: Stub IDirectSoundFXI3DL2Reverb.

Zebediah Figura z.figura12 at gmail.com
Mon Jul 27 20:26:01 CDT 2020


Signed-off-by: Zebediah Figura <z.figura12 at gmail.com>
---
 dlls/dsdmo/main.c        | 96 ++++++++++++++++++++++++++++++++++++++++
 dlls/dsdmo/tests/dsdmo.c | 35 ++++++++-------
 2 files changed, 114 insertions(+), 17 deletions(-)

diff --git a/dlls/dsdmo/main.c b/dlls/dsdmo/main.c
index f42d29f58ba..8efef855b29 100644
--- a/dlls/dsdmo/main.c
+++ b/dlls/dsdmo/main.c
@@ -437,6 +437,97 @@ static void effect_init(struct effect *effect, IUnknown *outer, const struct eff
 struct reverb
 {
     struct effect effect;
+    IDirectSoundFXI3DL2Reverb IDirectSoundFXI3DL2Reverb_iface;
+};
+
+static struct reverb *impl_from_IDirectSoundFXI3DL2Reverb(IDirectSoundFXI3DL2Reverb *iface)
+{
+    return CONTAINING_RECORD(iface, struct reverb, IDirectSoundFXI3DL2Reverb_iface);
+}
+
+static HRESULT WINAPI reverb_params_QueryInterface(IDirectSoundFXI3DL2Reverb *iface, REFIID iid, void **out)
+{
+    struct reverb *effect = impl_from_IDirectSoundFXI3DL2Reverb(iface);
+    return IUnknown_QueryInterface(effect->effect.outer_unk, iid, out);
+}
+
+static ULONG WINAPI reverb_params_AddRef(IDirectSoundFXI3DL2Reverb *iface)
+{
+    struct reverb *effect = impl_from_IDirectSoundFXI3DL2Reverb(iface);
+    return IUnknown_AddRef(effect->effect.outer_unk);
+}
+
+static ULONG WINAPI reverb_params_Release(IDirectSoundFXI3DL2Reverb *iface)
+{
+    struct reverb *effect = impl_from_IDirectSoundFXI3DL2Reverb(iface);
+    return IUnknown_Release(effect->effect.outer_unk);
+}
+
+static HRESULT WINAPI reverb_params_SetAllParameters(IDirectSoundFXI3DL2Reverb *iface, const DSFXI3DL2Reverb *params)
+{
+    struct reverb *effect = impl_from_IDirectSoundFXI3DL2Reverb(iface);
+
+    FIXME("effect %p, params %p, stub!\n", effect, params);
+
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI reverb_params_GetAllParameters(IDirectSoundFXI3DL2Reverb *iface, DSFXI3DL2Reverb *params)
+{
+    struct reverb *effect = impl_from_IDirectSoundFXI3DL2Reverb(iface);
+
+    FIXME("effect %p, params %p, stub!\n", effect, params);
+
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI reverb_params_SetPreset(IDirectSoundFXI3DL2Reverb *iface, DWORD preset)
+{
+    struct reverb *effect = impl_from_IDirectSoundFXI3DL2Reverb(iface);
+
+    FIXME("effect %p, preset %u, stub!\n", effect, preset);
+
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI reverb_params_GetPreset(IDirectSoundFXI3DL2Reverb *iface, DWORD *preset)
+{
+    struct reverb *effect = impl_from_IDirectSoundFXI3DL2Reverb(iface);
+
+    FIXME("effect %p, preset %p, stub!\n", effect, preset);
+
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI reverb_params_SetQuality(IDirectSoundFXI3DL2Reverb *iface, LONG quality)
+{
+    struct reverb *effect = impl_from_IDirectSoundFXI3DL2Reverb(iface);
+
+    FIXME("effect %p, quality %u, stub!\n", effect, quality);
+
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI reverb_params_GetQuality(IDirectSoundFXI3DL2Reverb *iface, LONG *quality)
+{
+    struct reverb *effect = impl_from_IDirectSoundFXI3DL2Reverb(iface);
+
+    FIXME("effect %p, quality %p, stub!\n", effect, quality);
+
+    return E_NOTIMPL;
+}
+
+static const IDirectSoundFXI3DL2ReverbVtbl reverb_params_vtbl =
+{
+    reverb_params_QueryInterface,
+    reverb_params_AddRef,
+    reverb_params_Release,
+    reverb_params_SetAllParameters,
+    reverb_params_GetAllParameters,
+    reverb_params_SetPreset,
+    reverb_params_GetPreset,
+    reverb_params_SetQuality,
+    reverb_params_GetQuality,
 };
 
 static struct reverb *impl_reverb_from_effect(struct effect *iface)
@@ -446,6 +537,10 @@ static struct reverb *impl_reverb_from_effect(struct effect *iface)
 
 static void *reverb_query_interface(struct effect *iface, REFIID iid)
 {
+    struct reverb *effect = impl_reverb_from_effect(iface);
+
+    if (IsEqualGUID(iid, &IID_IDirectSoundFXI3DL2Reverb))
+        return &effect->IDirectSoundFXI3DL2Reverb_iface;
     return NULL;
 }
 
@@ -470,6 +565,7 @@ static HRESULT reverb_create(IUnknown *outer, IUnknown **out)
         return E_OUTOFMEMORY;
 
     effect_init(&object->effect, outer, &reverb_ops);
+    object->IDirectSoundFXI3DL2Reverb_iface.lpVtbl = &reverb_params_vtbl;
 
     TRACE("Created I3DL2 reverb effect %p.\n", object);
     *out = &object->effect.IUnknown_inner;
diff --git a/dlls/dsdmo/tests/dsdmo.c b/dlls/dsdmo/tests/dsdmo.c
index 9026728f6c6..f949d02e882 100644
--- a/dlls/dsdmo/tests/dsdmo.c
+++ b/dlls/dsdmo/tests/dsdmo.c
@@ -473,24 +473,25 @@ static void test_reverb_parameters(void)
 
     hr = CoCreateInstance(&GUID_DSFX_STANDARD_I3DL2REVERB, NULL, CLSCTX_INPROC_SERVER,
             &IID_IDirectSoundFXI3DL2Reverb, (void **)&reverb);
-    todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr);
-    if (hr != S_OK)
-        return;
+    ok(hr == S_OK, "Got hr %#x.\n", hr);
 
     hr = IDirectSoundFXI3DL2Reverb_GetAllParameters(reverb, &params);
-    ok(hr == S_OK, "Got hr %#x.\n", hr);
-    ok(params.lRoom == -1000, "Got room attenuation %d mB.\n", params.lRoom);
-    ok(params.lRoomHF == -100, "Got room high-frequency attenuation %d mB.\n", params.lRoomHF);
-    ok(params.flRoomRolloffFactor == 0.0f, "Got room rolloff factor %.8e.\n", params.flRoomRolloffFactor);
-    ok(params.flDecayTime == 1.49f, "Got decay time %.8e s.\n", params.flDecayTime);
-    ok(params.flDecayHFRatio == 0.83f, "Got decay time ratio %.8e.\n", params.flDecayHFRatio);
-    ok(params.lReflections == -2602, "Got early reflection attenuation %d mB.\n", params.lReflections);
-    ok(params.flReflectionsDelay == 0.007f, "Got first reflection delay %.8e s.\n", params.flReflectionsDelay);
-    ok(params.lReverb == 200, "Got reverb attenuation %d mB.\n", params.lReverb);
-    ok(params.flReverbDelay == 0.011f, "Got reverb delay %.8e s.\n", params.flReverbDelay);
-    ok(params.flDiffusion == 100.0f, "Got diffusion %.8e%%.\n", params.flDiffusion);
-    ok(params.flDensity == 100.0f, "Got density %.8e%%.\n", params.flDensity);
-    ok(params.flHFReference == 5000.0f, "Got reference high frequency %.8e Hz.\n", params.flHFReference);
+    todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr);
+    if (hr == S_OK)
+    {
+        ok(params.lRoom == -1000, "Got room attenuation %d mB.\n", params.lRoom);
+        ok(params.lRoomHF == -100, "Got room high-frequency attenuation %d mB.\n", params.lRoomHF);
+        ok(params.flRoomRolloffFactor == 0.0f, "Got room rolloff factor %.8e.\n", params.flRoomRolloffFactor);
+        ok(params.flDecayTime == 1.49f, "Got decay time %.8e s.\n", params.flDecayTime);
+        ok(params.flDecayHFRatio == 0.83f, "Got decay time ratio %.8e.\n", params.flDecayHFRatio);
+        ok(params.lReflections == -2602, "Got early reflection attenuation %d mB.\n", params.lReflections);
+        ok(params.flReflectionsDelay == 0.007f, "Got first reflection delay %.8e s.\n", params.flReflectionsDelay);
+        ok(params.lReverb == 200, "Got reverb attenuation %d mB.\n", params.lReverb);
+        ok(params.flReverbDelay == 0.011f, "Got reverb delay %.8e s.\n", params.flReverbDelay);
+        ok(params.flDiffusion == 100.0f, "Got diffusion %.8e%%.\n", params.flDiffusion);
+        ok(params.flDensity == 100.0f, "Got density %.8e%%.\n", params.flDensity);
+        ok(params.flHFReference == 5000.0f, "Got reference high frequency %.8e Hz.\n", params.flHFReference);
+    }
 
     ref = IDirectSoundFXI3DL2Reverb_Release(reverb);
     ok(!ref, "Got outstanding refcount %d.\n", ref);
@@ -512,7 +513,7 @@ START_TEST(dsdmo)
         {&GUID_DSFX_STANDARD_ECHO,          &IID_IDirectSoundFXEcho, TRUE},
         {&GUID_DSFX_STANDARD_FLANGER,       &IID_IDirectSoundFXFlanger, TRUE},
         {&GUID_DSFX_STANDARD_GARGLE,        &IID_IDirectSoundFXGargle, TRUE},
-        {&GUID_DSFX_STANDARD_I3DL2REVERB,   &IID_IDirectSoundFXI3DL2Reverb, TRUE},
+        {&GUID_DSFX_STANDARD_I3DL2REVERB,   &IID_IDirectSoundFXI3DL2Reverb},
         {&GUID_DSFX_STANDARD_PARAMEQ,       &IID_IDirectSoundFXParamEq, TRUE},
         {&GUID_DSFX_WAVES_REVERB,           &IID_IDirectSoundFXWavesReverb},
     };
-- 
2.27.0




More information about the wine-devel mailing list