dsdmo: Implement IDirectSoundFXParamEq parameters methods.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
861cfee25d
commit
3ba24075f2
|
@ -438,6 +438,7 @@ struct eq
|
||||||
{
|
{
|
||||||
struct effect effect;
|
struct effect effect;
|
||||||
IDirectSoundFXParamEq IDirectSoundFXParamEq_iface;
|
IDirectSoundFXParamEq IDirectSoundFXParamEq_iface;
|
||||||
|
DSFXParamEq params;
|
||||||
};
|
};
|
||||||
|
|
||||||
static struct eq *impl_from_IDirectSoundFXParamEq(IDirectSoundFXParamEq *iface)
|
static struct eq *impl_from_IDirectSoundFXParamEq(IDirectSoundFXParamEq *iface)
|
||||||
|
@ -467,18 +468,24 @@ static HRESULT WINAPI eq_params_SetAllParameters(IDirectSoundFXParamEq *iface, c
|
||||||
{
|
{
|
||||||
struct eq *effect = impl_from_IDirectSoundFXParamEq(iface);
|
struct eq *effect = impl_from_IDirectSoundFXParamEq(iface);
|
||||||
|
|
||||||
FIXME("effect %p, params %p, stub!\n", effect, params);
|
TRACE("effect %p, params %p.\n", effect, params);
|
||||||
|
|
||||||
return E_NOTIMPL;
|
EnterCriticalSection(&effect->effect.cs);
|
||||||
|
effect->params = *params;
|
||||||
|
LeaveCriticalSection(&effect->effect.cs);
|
||||||
|
return S_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
static HRESULT WINAPI eq_params_GetAllParameters(IDirectSoundFXParamEq *iface, DSFXParamEq *params)
|
static HRESULT WINAPI eq_params_GetAllParameters(IDirectSoundFXParamEq *iface, DSFXParamEq *params)
|
||||||
{
|
{
|
||||||
struct eq *effect = impl_from_IDirectSoundFXParamEq(iface);
|
struct eq *effect = impl_from_IDirectSoundFXParamEq(iface);
|
||||||
|
|
||||||
FIXME("effect %p, params %p, stub!\n", effect, params);
|
TRACE("effect %p, params %p.\n", effect, params);
|
||||||
|
|
||||||
return E_NOTIMPL;
|
EnterCriticalSection(&effect->effect.cs);
|
||||||
|
*params = effect->params;
|
||||||
|
LeaveCriticalSection(&effect->effect.cs);
|
||||||
|
return S_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
static const IDirectSoundFXParamEqVtbl eq_params_vtbl =
|
static const IDirectSoundFXParamEqVtbl eq_params_vtbl =
|
||||||
|
@ -527,6 +534,10 @@ static HRESULT eq_create(IUnknown *outer, IUnknown **out)
|
||||||
effect_init(&object->effect, outer, &eq_ops);
|
effect_init(&object->effect, outer, &eq_ops);
|
||||||
object->IDirectSoundFXParamEq_iface.lpVtbl = &eq_params_vtbl;
|
object->IDirectSoundFXParamEq_iface.lpVtbl = &eq_params_vtbl;
|
||||||
|
|
||||||
|
object->params.fCenter = 8000.0f;
|
||||||
|
object->params.fBandwidth = 12.0f;
|
||||||
|
object->params.fGain = 0.0f;
|
||||||
|
|
||||||
TRACE("Created equalizer effect %p.\n", object);
|
TRACE("Created equalizer effect %p.\n", object);
|
||||||
*out = &object->effect.IUnknown_inner;
|
*out = &object->effect.IUnknown_inner;
|
||||||
return S_OK;
|
return S_OK;
|
||||||
|
|
|
@ -453,13 +453,27 @@ static void test_eq_parameters(void)
|
||||||
ok(hr == S_OK, "Got hr %#x.\n", hr);
|
ok(hr == S_OK, "Got hr %#x.\n", hr);
|
||||||
|
|
||||||
hr = IDirectSoundFXParamEq_GetAllParameters(eq, ¶ms);
|
hr = IDirectSoundFXParamEq_GetAllParameters(eq, ¶ms);
|
||||||
todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr);
|
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.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.fBandwidth == 12.0f, "Got band width %.8e semitones.\n", params.fBandwidth);
|
||||||
ok(params.fGain == 0.0f, "Got gain %.8e.\n", params.fGain);
|
ok(params.fGain == 0.0f, "Got gain %.8e.\n", params.fGain);
|
||||||
}
|
|
||||||
|
params.fCenter = 79.0f;
|
||||||
|
hr = IDirectSoundFXParamEq_SetAllParameters(eq, ¶ms);
|
||||||
|
todo_wine ok(hr == E_INVALIDARG, "Got hr %#x.\n", hr);
|
||||||
|
params.fCenter = 16001.0f;
|
||||||
|
hr = IDirectSoundFXParamEq_SetAllParameters(eq, ¶ms);
|
||||||
|
todo_wine ok(hr == E_INVALIDARG, "Got hr %#x.\n", hr);
|
||||||
|
params.fCenter = 738.0f;
|
||||||
|
hr = IDirectSoundFXParamEq_SetAllParameters(eq, ¶ms);
|
||||||
|
ok(hr == S_OK, "Got hr %#x.\n", hr);
|
||||||
|
|
||||||
|
memset(¶ms, 0xcc, sizeof(params));
|
||||||
|
hr = IDirectSoundFXParamEq_GetAllParameters(eq, ¶ms);
|
||||||
|
ok(hr == S_OK, "Got hr %#x.\n", hr);
|
||||||
|
ok(params.fCenter == 738.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);
|
ref = IDirectSoundFXParamEq_Release(eq);
|
||||||
ok(!ref, "Got outstanding refcount %d.\n", ref);
|
ok(!ref, "Got outstanding refcount %d.\n", ref);
|
||||||
|
|
Loading…
Reference in New Issue