[PATCH 5/6] dsdmo: Stub IDirectSoundFXParamEq.

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


Signed-off-by: Zebediah Figura <z.figura12 at gmail.com>
---
 dlls/dsdmo/main.c           | 56 +++++++++++++++++++++++++++++++++++++
 dlls/dsdmo/tests/dsdmo.c    | 17 +++++------
 dlls/dsound/tests/dsound8.c | 10 +++----
 3 files changed, 69 insertions(+), 14 deletions(-)

diff --git a/dlls/dsdmo/main.c b/dlls/dsdmo/main.c
index 482b8202db2..ff103be159e 100644
--- a/dlls/dsdmo/main.c
+++ b/dlls/dsdmo/main.c
@@ -437,6 +437,57 @@ static void effect_init(struct effect *effect, IUnknown *outer, const struct eff
 struct eq
 {
     struct effect effect;
+    IDirectSoundFXParamEq IDirectSoundFXParamEq_iface;
+};
+
+static struct eq *impl_from_IDirectSoundFXParamEq(IDirectSoundFXParamEq *iface)
+{
+    return CONTAINING_RECORD(iface, struct eq, IDirectSoundFXParamEq_iface);
+}
+
+static HRESULT WINAPI eq_params_QueryInterface(IDirectSoundFXParamEq *iface, REFIID iid, void **out)
+{
+    struct eq *effect = impl_from_IDirectSoundFXParamEq(iface);
+    return IUnknown_QueryInterface(effect->effect.outer_unk, iid, out);
+}
+
+static ULONG WINAPI eq_params_AddRef(IDirectSoundFXParamEq *iface)
+{
+    struct eq *effect = impl_from_IDirectSoundFXParamEq(iface);
+    return IUnknown_AddRef(effect->effect.outer_unk);
+}
+
+static ULONG WINAPI eq_params_Release(IDirectSoundFXParamEq *iface)
+{
+    struct eq *effect = impl_from_IDirectSoundFXParamEq(iface);
+    return IUnknown_Release(effect->effect.outer_unk);
+}
+
+static HRESULT WINAPI eq_params_SetAllParameters(IDirectSoundFXParamEq *iface, const DSFXParamEq *params)
+{
+    struct eq *effect = impl_from_IDirectSoundFXParamEq(iface);
+
+    FIXME("effect %p, params %p, stub!\n", effect, params);
+
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI eq_params_GetAllParameters(IDirectSoundFXParamEq *iface, DSFXParamEq *params)
+{
+    struct eq *effect = impl_from_IDirectSoundFXParamEq(iface);
+
+    FIXME("effect %p, params %p, stub!\n", effect, params);
+
+    return E_NOTIMPL;
+}
+
+static const IDirectSoundFXParamEqVtbl eq_params_vtbl =
+{
+    eq_params_QueryInterface,
+    eq_params_AddRef,
+    eq_params_Release,
+    eq_params_SetAllParameters,
+    eq_params_GetAllParameters,
 };
 
 static struct eq *impl_eq_from_effect(struct effect *iface)
@@ -446,6 +497,10 @@ static struct eq *impl_eq_from_effect(struct effect *iface)
 
 static void *eq_query_interface(struct effect *iface, REFIID iid)
 {
+    struct eq *effect = impl_eq_from_effect(iface);
+
+    if (IsEqualGUID(iid, &IID_IDirectSoundFXParamEq))
+        return &effect->IDirectSoundFXParamEq_iface;
     return NULL;
 }
 
@@ -470,6 +525,7 @@ static HRESULT eq_create(IUnknown *outer, IUnknown **out)
         return E_OUTOFMEMORY;
 
     effect_init(&object->effect, outer, &eq_ops);
+    object->IDirectSoundFXParamEq_iface.lpVtbl = &eq_params_vtbl;
 
     TRACE("Created equalizer effect %p.\n", object);
     *out = &object->effect.IUnknown_inner;
diff --git a/dlls/dsdmo/tests/dsdmo.c b/dlls/dsdmo/tests/dsdmo.c
index 349e300f02e..c59361e5fcf 100644
--- a/dlls/dsdmo/tests/dsdmo.c
+++ b/dlls/dsdmo/tests/dsdmo.c
@@ -450,15 +450,16 @@ static void test_eq_parameters(void)
 
     hr = CoCreateInstance(&GUID_DSFX_STANDARD_PARAMEQ, NULL, CLSCTX_INPROC_SERVER,
             &IID_IDirectSoundFXParamEq, (void **)&eq);
-    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 = IDirectSoundFXParamEq_GetAllParameters(eq, &params);
-    ok(hr == S_OK, "Got hr %#x.\n", hr);
-    ok(params.fCenter == 8000.0f, "Got center frequency %.8e Hz.\n", params.fCenter);
-    ok(params.fBandwidth == 12.0f, "Got band width %.8e semitones.\n", params.fBandwidth);
-    ok(params.fGain == 0.0f, "Got gain %.8e.\n", params.fGain);
+    todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr);
+    if (hr == S_OK)
+    {
+        ok(params.fCenter == 8000.0f, "Got center frequency %.8e Hz.\n", params.fCenter);
+        ok(params.fBandwidth == 12.0f, "Got band width %.8e semitones.\n", params.fBandwidth);
+        ok(params.fGain == 0.0f, "Got gain %.8e.\n", params.fGain);
+    }
 
     ref = IDirectSoundFXParamEq_Release(eq);
     ok(!ref, "Got outstanding refcount %d.\n", ref);
@@ -526,7 +527,7 @@ START_TEST(dsdmo)
         {&GUID_DSFX_STANDARD_FLANGER,       &IID_IDirectSoundFXFlanger, TRUE},
         {&GUID_DSFX_STANDARD_GARGLE,        &IID_IDirectSoundFXGargle, TRUE},
         {&GUID_DSFX_STANDARD_I3DL2REVERB,   &IID_IDirectSoundFXI3DL2Reverb},
-        {&GUID_DSFX_STANDARD_PARAMEQ,       &IID_IDirectSoundFXParamEq, TRUE},
+        {&GUID_DSFX_STANDARD_PARAMEQ,       &IID_IDirectSoundFXParamEq},
         {&GUID_DSFX_WAVES_REVERB,           &IID_IDirectSoundFXWavesReverb},
     };
     unsigned int i;
diff --git a/dlls/dsound/tests/dsound8.c b/dlls/dsound/tests/dsound8.c
index 05dfabbd253..fcac31ba637 100644
--- a/dlls/dsound/tests/dsound8.c
+++ b/dlls/dsound/tests/dsound8.c
@@ -1724,15 +1724,13 @@ static void test_effects(void)
     todo_wine ok(hr == DSERR_OBJECTNOTFOUND, "Got hr %#x.\n", hr);
 
     hr = IDirectSoundBuffer8_GetObjectInPath(buffer8, &GUID_All_Objects, 0, &IID_IDirectSoundFXParamEq, (void **)&unk);
-    todo_wine ok(hr == DS_OK, "Got hr %#x.\n", hr);
-    if (hr == DS_OK)
-        IUnknown_Release(unk);
+    ok(hr == DS_OK, "Got hr %#x.\n", hr);
+    IUnknown_Release(unk);
 
     hr = IDirectSoundBuffer8_GetObjectInPath(buffer8, &GUID_All_Objects, 0,
             &IID_IDirectSoundFXParamEq, (void **)&unk);
-    todo_wine ok(hr == DS_OK, "Got hr %#x.\n", hr);
-    if (hr == DS_OK)
-        IUnknown_Release(unk);
+    ok(hr == DS_OK, "Got hr %#x.\n", hr);
+    IUnknown_Release(unk);
 
     hr = IDirectSoundBuffer8_GetObjectInPath(buffer8, &GUID_All_Objects, 0,
             &IID_IDirectSoundFXI3DL2Reverb, (void **)&unk);
-- 
2.27.0




More information about the wine-devel mailing list