Add stubs for distortion and gargle effects in dsdmo.
From: Vijay Kiran Kamuju infyquest@gmail.com
--- dlls/dsdmo/dsdmo.idl | 8 ++++ dlls/dsdmo/main.c | 95 ++++++++++++++++++++++++++++++++++++++++ dlls/dsdmo/tests/dsdmo.c | 8 ++-- 3 files changed, 108 insertions(+), 3 deletions(-)
diff --git a/dlls/dsdmo/dsdmo.idl b/dlls/dsdmo/dsdmo.idl index 30c54d0f889..df76ac15e96 100644 --- a/dlls/dsdmo/dsdmo.idl +++ b/dlls/dsdmo/dsdmo.idl @@ -73,3 +73,11 @@ coclass DirectSoundChorusDMO {} vi_progid("Microsoft.DirectSoundFlangerDMO") ] coclass DirectSoundFlangerDMO {} + +[ + uuid(ef114c90-cd1d-484e-96e5-09cfaf912a21), + threading(both), + progid("Microsoft.DirectSoundDistortionDMO.1"), + vi_progid("Microsoft.DirectSoundDistortionDMO") +] +coclass DirectSoundDistortionDMO {} diff --git a/dlls/dsdmo/main.c b/dlls/dsdmo/main.c index 769f040c790..59ee1c9f770 100644 --- a/dlls/dsdmo/main.c +++ b/dlls/dsdmo/main.c @@ -1339,6 +1339,100 @@ static HRESULT flanger_create(IUnknown *outer, IUnknown **out) return S_OK; }
+struct dmo_distortionfx +{ + struct effect effect; + IDirectSoundFXDistortion IDirectSoundFXDistortion_iface; +}; + +static inline struct dmo_distortionfx *impl_from_IDirectSoundFXDistortion(IDirectSoundFXDistortion *iface) +{ + return CONTAINING_RECORD(iface, struct dmo_distortionfx, IDirectSoundFXDistortion_iface); +} + +static HRESULT WINAPI distortionfx_QueryInterface(IDirectSoundFXDistortion *iface, REFIID iid, void **out) +{ + struct dmo_distortionfx *effect = impl_from_IDirectSoundFXDistortion(iface); + return IUnknown_QueryInterface(effect->effect.outer_unk, iid, out); +} + +static ULONG WINAPI distortionfx_AddRef(IDirectSoundFXDistortion *iface) +{ + struct dmo_distortionfx *effect = impl_from_IDirectSoundFXDistortion(iface); + return IUnknown_AddRef(effect->effect.outer_unk); +} + +static ULONG WINAPI distortionfx_Release(IDirectSoundFXDistortion *iface) +{ + struct dmo_distortionfx *effect = impl_from_IDirectSoundFXDistortion(iface); + return IUnknown_Release(effect->effect.outer_unk); +} + +static HRESULT WINAPI distortionfx_SetAllParameters(IDirectSoundFXDistortion *iface, const DSFXDistortion *distortion) +{ + struct dmo_distortionfx *This = impl_from_IDirectSoundFXDistortion(iface); + FIXME("(%p) %p\n", This, distortion); + return E_NOTIMPL; +} + +static HRESULT WINAPI distortionfx_GetAllParameters(IDirectSoundFXDistortion *iface, DSFXDistortion *distortion) +{ + struct dmo_distortionfx *This = impl_from_IDirectSoundFXDistortion(iface); + FIXME("(%p) %p\n", This, distortion); + return E_NOTIMPL; +} + +static const struct IDirectSoundFXDistortionVtbl distortion_vtbl = +{ + distortionfx_QueryInterface, + distortionfx_AddRef, + distortionfx_Release, + distortionfx_SetAllParameters, + distortionfx_GetAllParameters +}; + +static struct dmo_distortionfx *impl_distortion_from_effect(struct effect *iface) +{ + return CONTAINING_RECORD(iface, struct dmo_distortionfx, effect); +} + +static void *distortion_query_interface(struct effect *iface, REFIID iid) +{ + struct dmo_distortionfx *effect = impl_distortion_from_effect(iface); + + if (IsEqualGUID(iid, &IID_IDirectSoundFXDistortion)) + return &effect->IDirectSoundFXDistortion_iface; + return NULL; +} + +static void distortion_destroy(struct effect *iface) +{ + struct dmo_distortionfx *effect = impl_distortion_from_effect(iface); + + free(effect); +} + +static const struct effect_ops distortion_ops = +{ + .destroy = distortion_destroy, + .query_interface = distortion_query_interface, +}; + +static HRESULT distortion_create(IUnknown *outer, IUnknown **out) +{ + struct dmo_distortionfx *object; + + if (!(object = calloc(1, sizeof(*object)))) + return E_OUTOFMEMORY; + + effect_init(&object->effect, outer, &distortion_ops); + object->IDirectSoundFXDistortion_iface.lpVtbl = &distortion_vtbl; + + TRACE("Created distortion effect %p.\n", object); + *out = &object->effect.IUnknown_inner; + return S_OK; +} + struct class_factory { IClassFactory IClassFactory_iface; @@ -1427,6 +1521,7 @@ class_factories[] = {&GUID_DSFX_STANDARD_COMPRESSOR, {{&class_factory_vtbl}, compressor_create}}, {&GUID_DSFX_STANDARD_CHORUS, {{&class_factory_vtbl}, chorus_create}}, {&GUID_DSFX_STANDARD_FLANGER, {{&class_factory_vtbl}, flanger_create}}, + {&GUID_DSFX_STANDARD_DISTORTION, {{&class_factory_vtbl}, distortion_create}}, };
HRESULT WINAPI DllGetClassObject(REFCLSID clsid, REFIID iid, void **out) diff --git a/dlls/dsdmo/tests/dsdmo.c b/dlls/dsdmo/tests/dsdmo.c index 369e02aeaa4..a3eb5a7d864 100644 --- a/dlls/dsdmo/tests/dsdmo.c +++ b/dlls/dsdmo/tests/dsdmo.c @@ -363,12 +363,14 @@ static void test_distortion_parameters(void)
hr = CoCreateInstance(&GUID_DSFX_STANDARD_DISTORTION, NULL, CLSCTX_INPROC_SERVER, &IID_IDirectSoundFXDistortion, (void **)&distortion); - todo_wine ok(hr == S_OK, "Got hr %#lx.\n", hr); + ok(hr == S_OK, "Got hr %#lx.\n", hr); if (hr != S_OK) return;
hr = IDirectSoundFXDistortion_GetAllParameters(distortion, ¶ms); - ok(hr == S_OK, "Got hr %#lx.\n", hr); + todo_wine ok(hr == S_OK, "Got hr %#lx.\n", hr); + if (hr != S_OK) + return; ok(params.fGain == -18.0f, "Got gain %.8e dB.\n", params.fGain); ok(params.fEdge == 15.0f, "Got edge %.8e%%.\n", params.fEdge); ok(params.fPostEQCenterFrequency == 2400.0f, "Got center frequency %.8e Hz.\n", params.fPostEQCenterFrequency); @@ -552,7 +554,7 @@ START_TEST(dsdmo) { {&GUID_DSFX_STANDARD_CHORUS, &IID_IDirectSoundFXChorus}, {&GUID_DSFX_STANDARD_COMPRESSOR, &IID_IDirectSoundFXCompressor}, - {&GUID_DSFX_STANDARD_DISTORTION, &IID_IDirectSoundFXDistortion, TRUE}, + {&GUID_DSFX_STANDARD_DISTORTION, &IID_IDirectSoundFXDistortion}, {&GUID_DSFX_STANDARD_ECHO, &IID_IDirectSoundFXEcho}, {&GUID_DSFX_STANDARD_FLANGER, &IID_IDirectSoundFXFlanger}, {&GUID_DSFX_STANDARD_GARGLE, &IID_IDirectSoundFXGargle, TRUE},
From: Vijay Kiran Kamuju infyquest@gmail.com
--- dlls/dsdmo/dsdmo.idl | 8 ++++ dlls/dsdmo/main.c | 95 ++++++++++++++++++++++++++++++++++++++++ dlls/dsdmo/tests/dsdmo.c | 9 ++-- 3 files changed, 108 insertions(+), 4 deletions(-)
diff --git a/dlls/dsdmo/dsdmo.idl b/dlls/dsdmo/dsdmo.idl index df76ac15e96..d1a0765fcf4 100644 --- a/dlls/dsdmo/dsdmo.idl +++ b/dlls/dsdmo/dsdmo.idl @@ -81,3 +81,11 @@ coclass DirectSoundFlangerDMO {} vi_progid("Microsoft.DirectSoundDistortionDMO") ] coclass DirectSoundDistortionDMO {} + +[ + uuid(dafd8210-5711-4b91-9fe3-f75b7ae279bf), + threading(both), + progid("Microsoft.DirectSoundGargleDMO.1"), + vi_progid("Microsoft.DirectSoundGargleDMO") +] +coclass DirectSoundGargleDMO {} diff --git a/dlls/dsdmo/main.c b/dlls/dsdmo/main.c index 59ee1c9f770..8064ba83a7f 100644 --- a/dlls/dsdmo/main.c +++ b/dlls/dsdmo/main.c @@ -1433,6 +1433,100 @@ static HRESULT distortion_create(IUnknown *outer, IUnknown **out) return S_OK; }
+struct dmo_garglefx +{ + struct effect effect; + IDirectSoundFXGargle IDirectSoundFXGargle_iface; +}; + +static inline struct dmo_garglefx *impl_from_IDirectSoundFXGargle(IDirectSoundFXGargle *iface) +{ + return CONTAINING_RECORD(iface, struct dmo_garglefx, IDirectSoundFXGargle_iface); +} + +static HRESULT WINAPI garglefx_QueryInterface(IDirectSoundFXGargle *iface, REFIID iid, void **out) +{ + struct dmo_garglefx *effect = impl_from_IDirectSoundFXGargle(iface); + return IUnknown_QueryInterface(effect->effect.outer_unk, iid, out); +} + +static ULONG WINAPI garglefx_AddRef(IDirectSoundFXGargle *iface) +{ + struct dmo_garglefx *effect = impl_from_IDirectSoundFXGargle(iface); + return IUnknown_AddRef(effect->effect.outer_unk); +} + +static ULONG WINAPI garglefx_Release(IDirectSoundFXGargle *iface) +{ + struct dmo_garglefx *effect = impl_from_IDirectSoundFXGargle(iface); + return IUnknown_Release(effect->effect.outer_unk); +} + +static HRESULT WINAPI garglefx_SetAllParameters(IDirectSoundFXGargle *iface, const DSFXGargle *gargle) +{ + struct dmo_garglefx *This = impl_from_IDirectSoundFXGargle(iface); + FIXME("(%p) %p\n", This, gargle); + return E_NOTIMPL; +} + +static HRESULT WINAPI garglefx_GetAllParameters(IDirectSoundFXGargle *iface, DSFXGargle *gargle) +{ + struct dmo_garglefx *This = impl_from_IDirectSoundFXGargle(iface); + FIXME("(%p) %p\n", This, gargle); + return E_NOTIMPL; +} + +static const struct IDirectSoundFXGargleVtbl gargle_vtbl = +{ + garglefx_QueryInterface, + garglefx_AddRef, + garglefx_Release, + garglefx_SetAllParameters, + garglefx_GetAllParameters +}; + +static struct dmo_garglefx *impl_gargle_from_effect(struct effect *iface) +{ + return CONTAINING_RECORD(iface, struct dmo_garglefx, effect); +} + +static void *gargle_query_interface(struct effect *iface, REFIID iid) +{ + struct dmo_garglefx *effect = impl_gargle_from_effect(iface); + + if (IsEqualGUID(iid, &IID_IDirectSoundFXGargle)) + return &effect->IDirectSoundFXGargle_iface; + return NULL; +} + +static void gargle_destroy(struct effect *iface) +{ + struct dmo_garglefx *effect = impl_gargle_from_effect(iface); + + free(effect); +} + +static const struct effect_ops gargle_ops = +{ + .destroy = gargle_destroy, + .query_interface = gargle_query_interface, +}; + +static HRESULT gargle_create(IUnknown *outer, IUnknown **out) +{ + struct dmo_garglefx *object; + + if (!(object = calloc(1, sizeof(*object)))) + return E_OUTOFMEMORY; + + effect_init(&object->effect, outer, &gargle_ops); + object->IDirectSoundFXGargle_iface.lpVtbl = &gargle_vtbl; + + TRACE("Created gargle effect %p.\n", object); + *out = &object->effect.IUnknown_inner; + return S_OK; +} + struct class_factory { IClassFactory IClassFactory_iface; @@ -1522,6 +1616,7 @@ class_factories[] = {&GUID_DSFX_STANDARD_CHORUS, {{&class_factory_vtbl}, chorus_create}}, {&GUID_DSFX_STANDARD_FLANGER, {{&class_factory_vtbl}, flanger_create}}, {&GUID_DSFX_STANDARD_DISTORTION, {{&class_factory_vtbl}, distortion_create}}, + {&GUID_DSFX_STANDARD_GARGLE, {{&class_factory_vtbl}, gargle_create}}, };
HRESULT WINAPI DllGetClassObject(REFCLSID clsid, REFIID iid, void **out) diff --git a/dlls/dsdmo/tests/dsdmo.c b/dlls/dsdmo/tests/dsdmo.c index a3eb5a7d864..aec1fa13ada 100644 --- a/dlls/dsdmo/tests/dsdmo.c +++ b/dlls/dsdmo/tests/dsdmo.c @@ -446,12 +446,14 @@ static void test_gargle_parameters(void)
hr = CoCreateInstance(&GUID_DSFX_STANDARD_GARGLE, NULL, CLSCTX_INPROC_SERVER, &IID_IDirectSoundFXGargle, (void **)&gargle); - todo_wine ok(hr == S_OK, "Got hr %#lx.\n", hr); + ok(hr == S_OK, "Got hr %#lx.\n", hr); if (hr != S_OK) return;
hr = IDirectSoundFXGargle_GetAllParameters(gargle, ¶ms); - ok(hr == S_OK, "Got hr %#lx.\n", hr); + todo_wine ok(hr == S_OK, "Got hr %#lx.\n", hr); + if (hr != S_OK) + return; ok(params.dwRateHz == 20, "Got rate %lu Hz.\n", params.dwRateHz); ok(params.dwWaveShape == DSFXGARGLE_WAVE_TRIANGLE, "Got wave shape %lu.\n", params.dwWaveShape);
@@ -548,7 +550,6 @@ START_TEST(dsdmo) { const GUID *clsid; const GUID *iid; - BOOL todo; } tests[] = { @@ -557,7 +558,7 @@ START_TEST(dsdmo) {&GUID_DSFX_STANDARD_DISTORTION, &IID_IDirectSoundFXDistortion}, {&GUID_DSFX_STANDARD_ECHO, &IID_IDirectSoundFXEcho}, {&GUID_DSFX_STANDARD_FLANGER, &IID_IDirectSoundFXFlanger}, - {&GUID_DSFX_STANDARD_GARGLE, &IID_IDirectSoundFXGargle, TRUE}, + {&GUID_DSFX_STANDARD_GARGLE, &IID_IDirectSoundFXGargle}, {&GUID_DSFX_STANDARD_I3DL2REVERB, &IID_IDirectSoundFXI3DL2Reverb}, {&GUID_DSFX_STANDARD_PARAMEQ, &IID_IDirectSoundFXParamEq}, {&GUID_DSFX_WAVES_REVERB, &IID_IDirectSoundFXWavesReverb},
Hi,
It looks like your patch introduced the new failures shown below. Please investigate and fix them before resubmitting your patch. If they are not new, fixing them anyway would help a lot. Otherwise please ask for the known failures list to be updated.
The full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=140663
Your paranoid android.
=== build (build log) ===
../wine/dlls/dsdmo/tests/dsdmo.c:576:30: error: ���const struct <anonymous>��� has no member named ���todo��� Task: The exe32 Wine build failed
=== debian11 (build log) ===
../wine/dlls/dsdmo/tests/dsdmo.c:576:30: error: ���const struct <anonymous>��� has no member named ���todo��� Task: The win32 Wine build failed
=== debian11b (build log) ===
../wine/dlls/dsdmo/tests/dsdmo.c:576:30: error: ���const struct <anonymous>��� has no member named ���todo��� Task: The wow64 Wine build failed
Please mention the application that needs these.
You don't need the "dmo" prefix or "fx" suffix, that's implicit. Just name these "distortion" and "gargle" like the others.