dsdmo: Stub IDirectSoundFXParamEq.

Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Zebediah Figura 2020-07-27 20:26:04 -05:00 committed by Alexandre Julliard
parent ac528a492b
commit 861cfee25d
3 changed files with 69 additions and 14 deletions

View File

@ -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;

View File

@ -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;

View File

@ -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);