dsound/tests: Move effect parameter tests to dsdmo.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com> Signed-off-by: Andrew Eikum <aeikum@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
f324984397
commit
afd6cc7297
|
@ -1,4 +1,5 @@
|
|||
/*
|
||||
* Copyright 2019 Alistair Leslie-Hughes
|
||||
* Copyright 2020 Zebediah Figura
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
|
@ -130,6 +131,242 @@ static void test_aggregation(const GUID *clsid)
|
|||
ok(outer_ref == 1, "Got unexpected refcount %d.\n", outer_ref);
|
||||
}
|
||||
|
||||
static void test_interfaces(const GUID *clsid, const GUID *iid)
|
||||
{
|
||||
IUnknown *unk, *unk2, *unk3;
|
||||
HRESULT hr;
|
||||
ULONG ref;
|
||||
|
||||
hr = CoCreateInstance(clsid, NULL, CLSCTX_INPROC_SERVER, iid, (void **)&unk);
|
||||
todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr);
|
||||
if (hr != S_OK)
|
||||
return;
|
||||
|
||||
hr = IUnknown_QueryInterface(unk, &IID_IMediaObject, (void **)&unk2);
|
||||
ok(hr == S_OK, "Got hr %#x.\n", hr);
|
||||
hr = IUnknown_QueryInterface(unk2, iid, (void **)&unk3);
|
||||
ok(hr == S_OK, "Got hr %#x.\n", hr);
|
||||
ok(unk3 == unk, "Interface pointers didn't match.\n");
|
||||
IUnknown_Release(unk3);
|
||||
IUnknown_Release(unk2);
|
||||
|
||||
hr = IUnknown_QueryInterface(unk, &IID_IMediaObjectInPlace, (void **)&unk2);
|
||||
ok(hr == S_OK, "Got hr %#x.\n", hr);
|
||||
hr = IUnknown_QueryInterface(unk2, iid, (void **)&unk3);
|
||||
ok(hr == S_OK, "Got hr %#x.\n", hr);
|
||||
ok(unk3 == unk, "Interface pointers didn't match.\n");
|
||||
IUnknown_Release(unk3);
|
||||
IUnknown_Release(unk2);
|
||||
|
||||
ref = IUnknown_Release(unk);
|
||||
ok(!ref, "Got outstanding refcount %d.\n", ref);
|
||||
}
|
||||
|
||||
static void test_chorus_parameters(void)
|
||||
{
|
||||
IDirectSoundFXChorus *chorus;
|
||||
DSFXChorus params;
|
||||
HRESULT hr;
|
||||
ULONG ref;
|
||||
|
||||
hr = CoCreateInstance(&GUID_DSFX_STANDARD_CHORUS, NULL, CLSCTX_INPROC_SERVER,
|
||||
&IID_IDirectSoundFXChorus, (void **)&chorus);
|
||||
todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr);
|
||||
if (hr != S_OK)
|
||||
return;
|
||||
|
||||
hr = IDirectSoundFXChorus_GetAllParameters(chorus, ¶ms);
|
||||
ok(hr == S_OK, "Got hr %#x.\n", hr);
|
||||
ok(params.fWetDryMix == 50.0f, "Got wetness %.8e%%.\n", params.fWetDryMix);
|
||||
ok(params.fDepth == 10.0f, "Got depth %.8e.\n", params.fDepth);
|
||||
ok(params.fFeedback == 25.0f, "Got feedback %.8e.\n", params.fFeedback);
|
||||
ok(params.fFrequency == 1.1f, "Got LFO frequency %.8e.\n", params.fFrequency);
|
||||
ok(params.lWaveform == DSFXCHORUS_WAVE_SIN, "Got LFO waveform %d.\n", params.lWaveform);
|
||||
ok(params.fDelay == 16.0f, "Got delay %.8e.\n", params.fDelay);
|
||||
ok(params.lPhase == 3, "Got phase differential %d.\n", params.lPhase);
|
||||
|
||||
ref = IDirectSoundFXChorus_Release(chorus);
|
||||
ok(!ref, "Got outstanding refcount %d.\n", ref);
|
||||
}
|
||||
|
||||
static void test_compressor_parameters(void)
|
||||
{
|
||||
IDirectSoundFXCompressor *compressor;
|
||||
DSFXCompressor params;
|
||||
HRESULT hr;
|
||||
ULONG ref;
|
||||
|
||||
hr = CoCreateInstance(&GUID_DSFX_STANDARD_COMPRESSOR, NULL, CLSCTX_INPROC_SERVER,
|
||||
&IID_IDirectSoundFXCompressor, (void **)&compressor);
|
||||
todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr);
|
||||
if (hr != S_OK)
|
||||
return;
|
||||
|
||||
hr = IDirectSoundFXCompressor_GetAllParameters(compressor, ¶ms);
|
||||
ok(hr == S_OK, "Got hr %#x.\n", hr);
|
||||
ok(params.fGain == 0.0f, "Got gain %.8e dB.\n", params.fGain);
|
||||
ok(params.fAttack == 10.0f, "Got attack time %.8e ms.\n", params.fAttack);
|
||||
ok(params.fThreshold == -20.0f, "Got threshold %.8e dB.\n", params.fThreshold);
|
||||
ok(params.fRatio == 3.0f, "Got ratio %.8e:1.\n", params.fRatio);
|
||||
ok(params.fPredelay == 4.0f, "Got pre-delay %.8e ms.\n", params.fPredelay);
|
||||
|
||||
ref = IDirectSoundFXCompressor_Release(compressor);
|
||||
ok(!ref, "Got outstanding refcount %d.\n", ref);
|
||||
}
|
||||
|
||||
static void test_distortion_parameters(void)
|
||||
{
|
||||
IDirectSoundFXDistortion *distortion;
|
||||
DSFXDistortion params;
|
||||
HRESULT hr;
|
||||
ULONG ref;
|
||||
|
||||
hr = CoCreateInstance(&GUID_DSFX_STANDARD_DISTORTION, NULL, CLSCTX_INPROC_SERVER,
|
||||
&IID_IDirectSoundFXDistortion, (void **)&distortion);
|
||||
todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr);
|
||||
if (hr != S_OK)
|
||||
return;
|
||||
|
||||
hr = IDirectSoundFXDistortion_GetAllParameters(distortion, ¶ms);
|
||||
ok(hr == S_OK, "Got hr %#x.\n", hr);
|
||||
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);
|
||||
ok(params.fPostEQBandwidth == 2400.0f, "Got band width %.8e Hz.\n", params.fPostEQBandwidth);
|
||||
ok(params.fPreLowpassCutoff == 8000.0f, "Got pre-lowpass cutoff %.8e Hz.\n", params.fPreLowpassCutoff);
|
||||
|
||||
ref = IDirectSoundFXDistortion_Release(distortion);
|
||||
ok(!ref, "Got outstanding refcount %d.\n", ref);
|
||||
}
|
||||
|
||||
static void test_echo_parameters(void)
|
||||
{
|
||||
IDirectSoundFXEcho *echo;
|
||||
DSFXEcho params;
|
||||
HRESULT hr;
|
||||
ULONG ref;
|
||||
|
||||
hr = CoCreateInstance(&GUID_DSFX_STANDARD_ECHO, NULL, CLSCTX_INPROC_SERVER,
|
||||
&IID_IDirectSoundFXEcho, (void **)&echo);
|
||||
todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr);
|
||||
if (hr != S_OK)
|
||||
return;
|
||||
|
||||
hr = IDirectSoundFXEcho_GetAllParameters(echo, ¶ms);
|
||||
ok(hr == S_OK, "Got hr %#x.\n", hr);
|
||||
ok(params.fWetDryMix == 50.0f, "Got %.8e%% wetness.\n", params.fWetDryMix);
|
||||
ok(params.fFeedback == 50.0f, "Got %.8e%% feedback.\n", params.fFeedback);
|
||||
ok(params.fLeftDelay == 500.0f, "Got left delay %.8e ms.\n", params.fLeftDelay);
|
||||
ok(params.fRightDelay == 500.0f, "Got right delay %.8e ms.\n", params.fRightDelay);
|
||||
ok(!params.lPanDelay, "Got delay swap %d.\n", params.lPanDelay);
|
||||
|
||||
ref = IDirectSoundFXEcho_Release(echo);
|
||||
ok(!ref, "Got outstanding refcount %d.\n", ref);
|
||||
}
|
||||
|
||||
static void test_flanger_parameters(void)
|
||||
{
|
||||
IDirectSoundFXFlanger *flanger;
|
||||
DSFXFlanger params;
|
||||
HRESULT hr;
|
||||
ULONG ref;
|
||||
|
||||
hr = CoCreateInstance(&GUID_DSFX_STANDARD_FLANGER, NULL, CLSCTX_INPROC_SERVER,
|
||||
&IID_IDirectSoundFXFlanger, (void **)&flanger);
|
||||
todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr);
|
||||
if (hr != S_OK)
|
||||
return;
|
||||
|
||||
hr = IDirectSoundFXFlanger_GetAllParameters(flanger, ¶ms);
|
||||
ok(hr == S_OK, "Got hr %#x.\n", hr);
|
||||
ok(params.fWetDryMix == 50.0f, "Got %.8e%% wetness.\n", params.fWetDryMix);
|
||||
ok(params.fDepth == 100.0f, "Got %.8e * 0.01%% depth.\n", params.fDepth);
|
||||
ok(params.fFeedback == -50.0f, "Got %.8e%% feedback.\n", params.fFeedback);
|
||||
ok(params.lWaveform == DSFXFLANGER_WAVE_SIN, "Got LFO waveform %d.\n", params.lWaveform);
|
||||
ok(params.fDelay == 2.0f, "Got delay %.8e ms.\n", params.fDelay);
|
||||
ok(params.lPhase == DSFXFLANGER_PHASE_ZERO, "Got phase differential %d.\n", params.lPhase);
|
||||
|
||||
ref = IDirectSoundFXFlanger_Release(flanger);
|
||||
ok(!ref, "Got outstanding refcount %d.\n", ref);
|
||||
}
|
||||
|
||||
static void test_gargle_parameters(void)
|
||||
{
|
||||
IDirectSoundFXGargle *gargle;
|
||||
DSFXGargle params;
|
||||
HRESULT hr;
|
||||
ULONG ref;
|
||||
|
||||
hr = CoCreateInstance(&GUID_DSFX_STANDARD_GARGLE, NULL, CLSCTX_INPROC_SERVER,
|
||||
&IID_IDirectSoundFXGargle, (void **)&gargle);
|
||||
todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr);
|
||||
if (hr != S_OK)
|
||||
return;
|
||||
|
||||
hr = IDirectSoundFXGargle_GetAllParameters(gargle, ¶ms);
|
||||
ok(hr == S_OK, "Got hr %#x.\n", hr);
|
||||
ok(params.dwRateHz == 20, "Got rate %u Hz.\n", params.dwRateHz);
|
||||
ok(params.dwWaveShape == DSFXGARGLE_WAVE_TRIANGLE, "Got wave shape %u.\n", params.dwWaveShape);
|
||||
|
||||
ref = IDirectSoundFXGargle_Release(gargle);
|
||||
ok(!ref, "Got outstanding refcount %d.\n", ref);
|
||||
}
|
||||
|
||||
static void test_eq_parameters(void)
|
||||
{
|
||||
IDirectSoundFXParamEq *eq;
|
||||
DSFXParamEq params;
|
||||
HRESULT hr;
|
||||
ULONG ref;
|
||||
|
||||
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;
|
||||
|
||||
hr = IDirectSoundFXParamEq_GetAllParameters(eq, ¶ms);
|
||||
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);
|
||||
|
||||
ref = IDirectSoundFXParamEq_Release(eq);
|
||||
ok(!ref, "Got outstanding refcount %d.\n", ref);
|
||||
}
|
||||
|
||||
static void test_reverb_parameters(void)
|
||||
{
|
||||
IDirectSoundFXI3DL2Reverb *reverb;
|
||||
DSFXI3DL2Reverb params;
|
||||
HRESULT hr;
|
||||
ULONG ref;
|
||||
|
||||
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;
|
||||
|
||||
hr = IDirectSoundFXI3DL2Reverb_GetAllParameters(reverb, ¶ms);
|
||||
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);
|
||||
|
||||
ref = IDirectSoundFXI3DL2Reverb_Release(reverb);
|
||||
ok(!ref, "Got outstanding refcount %d.\n", ref);
|
||||
}
|
||||
|
||||
START_TEST(dsdmo)
|
||||
{
|
||||
static const struct
|
||||
|
@ -156,7 +393,17 @@ START_TEST(dsdmo)
|
|||
for (i = 0; i < ARRAY_SIZE(tests); ++i)
|
||||
{
|
||||
test_aggregation(tests[i].clsid);
|
||||
test_interfaces(tests[i].clsid, tests[i].iid);
|
||||
}
|
||||
|
||||
test_chorus_parameters();
|
||||
test_compressor_parameters();
|
||||
test_distortion_parameters();
|
||||
test_echo_parameters();
|
||||
test_flanger_parameters();
|
||||
test_gargle_parameters();
|
||||
test_reverb_parameters();
|
||||
test_eq_parameters();
|
||||
|
||||
CoUninitialize();
|
||||
}
|
||||
|
|
|
@ -1828,369 +1828,6 @@ static void test_effects(void)
|
|||
ok(!ref, "Got outstanding refcount %u.\n", ref);
|
||||
}
|
||||
|
||||
static void test_dsfx_interfaces(const char *test_prefix, IUnknown *dmo, REFGUID refguid)
|
||||
{
|
||||
HRESULT rc;
|
||||
IMediaObject *mediaobject;
|
||||
IMediaObjectInPlace *inplace;
|
||||
IUnknown *parent;
|
||||
|
||||
rc = IUnknown_QueryInterface(dmo, &IID_IMediaObject, (void**)&mediaobject);
|
||||
ok(rc == DS_OK, "%s: Failed: %08x\n", test_prefix, rc);
|
||||
if (rc == DS_OK)
|
||||
{
|
||||
rc = IMediaObject_QueryInterface(mediaobject, refguid, (void**)&parent);
|
||||
ok(rc == S_OK, "%s: got: %08x\n", test_prefix, rc);
|
||||
ok(dmo == parent, "%s: Objects not equal\n", test_prefix);
|
||||
IUnknown_Release(parent);
|
||||
|
||||
IMediaObject_Release(mediaobject);
|
||||
}
|
||||
|
||||
rc = IUnknown_QueryInterface(dmo, &IID_IMediaObjectInPlace, (void**)&inplace);
|
||||
ok(rc == DS_OK, "%s: Failed: %08x\n", test_prefix, rc);
|
||||
if (rc == DS_OK)
|
||||
{
|
||||
rc = IMediaObjectInPlace_QueryInterface(inplace, refguid, (void**)&parent);
|
||||
ok(rc == S_OK, "%s: got: %08x\n", test_prefix, rc);
|
||||
ok(dmo == parent, "%s: Objects not equal\n", test_prefix);
|
||||
IUnknown_Release(parent);
|
||||
|
||||
IMediaObjectInPlace_Release(inplace);
|
||||
}
|
||||
}
|
||||
|
||||
static void test_echo_parameters(IDirectSoundBuffer8 *secondary8)
|
||||
{
|
||||
HRESULT rc;
|
||||
IDirectSoundFXEcho *echo;
|
||||
|
||||
rc = IDirectSoundBuffer8_GetObjectInPath(secondary8, &GUID_DSFX_STANDARD_ECHO, 0, &IID_IDirectSoundFXEcho, (void**)&echo);
|
||||
ok(rc == DS_OK, "GetObjectInPath failed: %08x\n", rc);
|
||||
if (rc == DS_OK)
|
||||
{
|
||||
DSFXEcho params;
|
||||
|
||||
rc = IDirectSoundFXEcho_GetAllParameters(echo, ¶ms);
|
||||
todo_wine ok(rc == DS_OK, "Failed: %08x\n", rc);
|
||||
if (rc == DS_OK )
|
||||
{
|
||||
ok(params.fWetDryMix == 50.0f, "got %f\n", params.fWetDryMix);
|
||||
ok(params.fFeedback == 50.0f, "got %f\n", params.fFeedback);
|
||||
ok(params.fLeftDelay == 500.0f,"got %f\n", params.fLeftDelay);
|
||||
ok(params.fRightDelay == 500.0f,"got %f\n", params.fRightDelay);
|
||||
ok(params.lPanDelay == 0, "got %d\n", params.lPanDelay);
|
||||
}
|
||||
|
||||
test_dsfx_interfaces("FXEcho", (IUnknown *)echo, &IID_IDirectSoundFXEcho);
|
||||
|
||||
IDirectSoundFXEcho_Release(echo);
|
||||
}
|
||||
}
|
||||
|
||||
static void test_gargle_parameters(IDirectSoundBuffer8 *secondary8)
|
||||
{
|
||||
HRESULT rc;
|
||||
IDirectSoundFXGargle *gargle;
|
||||
|
||||
rc = IDirectSoundBuffer8_GetObjectInPath(secondary8, &GUID_DSFX_STANDARD_GARGLE, 0, &IID_IDirectSoundFXGargle, (void**)&gargle);
|
||||
todo_wine ok(rc == DS_OK, "GetObjectInPath failed: %08x\n", rc);
|
||||
if (rc == DS_OK)
|
||||
{
|
||||
DSFXGargle params;
|
||||
|
||||
rc = IDirectSoundFXGargle_GetAllParameters(gargle, ¶ms);
|
||||
todo_wine ok(rc == DS_OK, "Failed: %08x\n", rc);
|
||||
if (rc == DS_OK)
|
||||
{
|
||||
ok(params.dwRateHz == 20, "got %d\n", params.dwRateHz);
|
||||
ok(params.dwWaveShape == DSFXGARGLE_WAVE_TRIANGLE, "got %d\n", params.dwWaveShape);
|
||||
}
|
||||
|
||||
test_dsfx_interfaces("FXGargle", (IUnknown *)gargle, &IID_IDirectSoundFXGargle);
|
||||
|
||||
IDirectSoundFXGargle_Release(gargle);
|
||||
}
|
||||
}
|
||||
|
||||
static void test_chorus_parameters(IDirectSoundBuffer8 *secondary8)
|
||||
{
|
||||
HRESULT rc;
|
||||
IDirectSoundFXChorus *chorus;
|
||||
|
||||
rc = IDirectSoundBuffer8_GetObjectInPath(secondary8, &GUID_DSFX_STANDARD_CHORUS, 0, &IID_IDirectSoundFXChorus,(void**)&chorus);
|
||||
todo_wine ok(rc == DS_OK, "GetObjectInPath failed: %08x\n", rc);
|
||||
if (rc == DS_OK)
|
||||
{
|
||||
DSFXChorus params;
|
||||
|
||||
rc = IDirectSoundFXChorus_GetAllParameters(chorus, ¶ms);
|
||||
todo_wine ok(rc == DS_OK, "Failed: %08x\n", rc);
|
||||
if (rc == DS_OK)
|
||||
{
|
||||
ok(params.fWetDryMix == 50.0f, "got %f\n", params.fWetDryMix);
|
||||
ok(params.fDepth == 10.0f, "got %f\n", params.fDepth);
|
||||
ok(params.fFeedback == 25.0f, "got %f\n", params.fFeedback);
|
||||
ok(params.fFrequency == 1.1f, "got %f\n", params.fFrequency);
|
||||
ok(params.lWaveform == DSFXCHORUS_WAVE_SIN, "got %d\n", params.lWaveform);
|
||||
ok(params.fDelay == 16.0f, "got %f\n", params.fDelay);
|
||||
ok(params.lPhase == 3, "got %d\n", params.lPhase);
|
||||
}
|
||||
|
||||
test_dsfx_interfaces("FXChorus", (IUnknown *)chorus, &IID_IDirectSoundFXChorus);
|
||||
|
||||
IDirectSoundFXChorus_Release(chorus);
|
||||
}
|
||||
}
|
||||
|
||||
static void test_flanger_parameters(IDirectSoundBuffer8 *secondary8)
|
||||
{
|
||||
HRESULT rc;
|
||||
IDirectSoundFXFlanger *flanger;
|
||||
|
||||
rc = IDirectSoundBuffer8_GetObjectInPath(secondary8, &GUID_DSFX_STANDARD_FLANGER, 0, &IID_IDirectSoundFXFlanger,(void**)&flanger);
|
||||
todo_wine ok(rc == DS_OK, "GetObjectInPath failed: %08x\n", rc);
|
||||
if (rc == DS_OK)
|
||||
{
|
||||
DSFXFlanger params;
|
||||
|
||||
rc = IDirectSoundFXFlanger_GetAllParameters(flanger, ¶ms);
|
||||
todo_wine ok(rc == DS_OK, "Failed: %08x\n", rc);
|
||||
if (rc == DS_OK)
|
||||
{
|
||||
ok(params.fWetDryMix == 50.0f, "got %f\n", params.fWetDryMix);
|
||||
ok(params.fDepth == 100.0f, "got %f\n", params.fDepth);
|
||||
ok(params.fFeedback == -50.0f, "got %f\n", params.fFeedback);
|
||||
ok(params.fFrequency == 0.25f, "got %f\n", params.fFrequency);
|
||||
ok(params.lWaveform == DSFXFLANGER_WAVE_SIN, "got %d\n", params.lWaveform);
|
||||
ok(params.fDelay == 2.0f, "got %f\n", params.fDelay);
|
||||
ok(params.lPhase == 2, "got %d\n", params.lPhase);
|
||||
}
|
||||
|
||||
test_dsfx_interfaces("FXFlanger", (IUnknown *)flanger, &IID_IDirectSoundFXFlanger);
|
||||
|
||||
IDirectSoundFXFlanger_Release(flanger);
|
||||
}
|
||||
}
|
||||
|
||||
static void test_distortion_parameters(IDirectSoundBuffer8 *secondary8)
|
||||
{
|
||||
HRESULT rc;
|
||||
IDirectSoundFXDistortion *distortion;
|
||||
|
||||
rc = IDirectSoundBuffer8_GetObjectInPath(secondary8, &GUID_DSFX_STANDARD_DISTORTION, 0, &IID_IDirectSoundFXDistortion,(void**)&distortion);
|
||||
todo_wine ok(rc == DS_OK, "GetObjectInPath failed: %08x\n", rc);
|
||||
if (rc == DS_OK)
|
||||
{
|
||||
DSFXDistortion params;
|
||||
|
||||
rc = IDirectSoundFXDistortion_GetAllParameters(distortion, ¶ms);
|
||||
todo_wine ok(rc == DS_OK, "Failed: %08x\n", rc);
|
||||
if (rc == DS_OK)
|
||||
{
|
||||
ok(params.fGain == -18.0f, "got %f\n", params.fGain);
|
||||
ok(params.fEdge == 15.0f, "got %f\n", params.fEdge);
|
||||
ok(params.fPostEQCenterFrequency == 2400.0f, "got %f\n", params.fPostEQCenterFrequency);
|
||||
ok(params.fPostEQBandwidth == 2400.0f, "got %f\n", params.fPostEQBandwidth);
|
||||
ok(params.fPreLowpassCutoff == 3675.0f, "got %f\n", params.fPreLowpassCutoff);
|
||||
}
|
||||
|
||||
test_dsfx_interfaces("FXDistortion", (IUnknown *)distortion, &IID_IDirectSoundFXDistortion);
|
||||
|
||||
IDirectSoundFXDistortion_Release(distortion);
|
||||
}
|
||||
}
|
||||
|
||||
static void test_compressor_parameters(IDirectSoundBuffer8 *secondary8)
|
||||
{
|
||||
HRESULT rc;
|
||||
IDirectSoundFXCompressor *compressor;
|
||||
|
||||
rc = IDirectSoundBuffer8_GetObjectInPath(secondary8, &GUID_DSFX_STANDARD_COMPRESSOR, 0, &IID_IDirectSoundFXCompressor,(void**)&compressor);
|
||||
todo_wine ok(rc == DS_OK, "GetObjectInPath failed: %08x\n", rc);
|
||||
if (rc == DS_OK)
|
||||
{
|
||||
DSFXCompressor params;
|
||||
|
||||
rc = IDirectSoundFXCompressor_GetAllParameters(compressor, ¶ms);
|
||||
todo_wine ok(rc == DS_OK, "Failed: %08x\n", rc);
|
||||
if (rc == DS_OK)
|
||||
{
|
||||
ok(params.fGain == 0.0f, "got %f\n", params.fGain);
|
||||
ok(params.fAttack == 10.0f, "got %f\n", params.fAttack);
|
||||
ok(params.fThreshold == -20.0f, "got %f\n", params.fThreshold);
|
||||
ok(params.fRatio == 3.0f, "got %f\n", params.fRatio);
|
||||
ok(params.fPredelay == 4.0f, "got %f\n", params.fPredelay);
|
||||
}
|
||||
|
||||
test_dsfx_interfaces("FXCompressor", (IUnknown *)compressor, &IID_IDirectSoundFXCompressor);
|
||||
|
||||
IDirectSoundFXCompressor_Release(compressor);
|
||||
}
|
||||
}
|
||||
|
||||
static void test_parameq_parameters(IDirectSoundBuffer8 *secondary8)
|
||||
{
|
||||
HRESULT rc;
|
||||
IDirectSoundFXParamEq *parameq;
|
||||
|
||||
rc = IDirectSoundBuffer8_GetObjectInPath(secondary8, &GUID_DSFX_STANDARD_PARAMEQ, 0, &IID_IDirectSoundFXParamEq,(void**)¶meq);
|
||||
todo_wine ok(rc == DS_OK, "GetObjectInPath failed: %08x\n", rc);
|
||||
if (rc == DS_OK)
|
||||
{
|
||||
DSFXParamEq params;
|
||||
|
||||
rc = IDirectSoundFXParamEq_GetAllParameters(parameq, ¶ms);
|
||||
todo_wine ok(rc == DS_OK, "Failed: %08x\n", rc);
|
||||
if (rc == DS_OK)
|
||||
{
|
||||
ok(params.fCenter == 3675.0f, "got %f\n", params.fCenter);
|
||||
ok(params.fBandwidth == 12.0f, "got %f\n", params.fBandwidth);
|
||||
ok(params.fGain == 0.0f, "got %f\n", params.fGain);
|
||||
}
|
||||
|
||||
test_dsfx_interfaces("FXParamEq", (IUnknown *)parameq, &IID_IDirectSoundFXParamEq);
|
||||
|
||||
IDirectSoundFXParamEq_Release(parameq);
|
||||
}
|
||||
}
|
||||
|
||||
static void test_reverb_parameters(IDirectSoundBuffer8 *secondary8)
|
||||
{
|
||||
HRESULT rc;
|
||||
IDirectSoundFXI3DL2Reverb *reverb;
|
||||
|
||||
rc = IDirectSoundBuffer8_GetObjectInPath(secondary8, &GUID_DSFX_STANDARD_I3DL2REVERB, 0, &IID_IDirectSoundFXI3DL2Reverb, (void**)&reverb);
|
||||
todo_wine ok(rc == DS_OK, "GetObjectInPath failed: %08x\n", rc);
|
||||
if (rc == DS_OK)
|
||||
{
|
||||
DSFXI3DL2Reverb params;
|
||||
|
||||
rc = IDirectSoundFXI3DL2Reverb_GetAllParameters(reverb, ¶ms);
|
||||
todo_wine ok(rc == DS_OK, "Failed: %08x\n", rc);
|
||||
if (rc == DS_OK)
|
||||
{
|
||||
ok(params.lRoom == -1000, "got %d\n", params.lRoom);
|
||||
ok(params.flRoomRolloffFactor == 0.0f, "got %f\n", params.flRoomRolloffFactor);
|
||||
ok(params.flDecayTime == 1.49f, "got %f\n", params.flDecayTime);
|
||||
ok(params.flDecayHFRatio == 0.83f, "got %f\n", params.flDecayHFRatio);
|
||||
ok(params.lReflections == -2602, "got %d\n", params.lReflections);
|
||||
ok(params.lReverb == 200, "got %d\n", params.lReverb);
|
||||
ok(params.flReverbDelay == 0.011f, "got %f\n", params.flReverbDelay);
|
||||
ok(params.flDiffusion == 100.0f, "got %f\n", params.flDiffusion);
|
||||
ok(params.flDensity == 100.0f, "got %f\n", params.flDensity);
|
||||
ok(params.flHFReference == 5000.0f, "got %f\n", params.flHFReference);
|
||||
}
|
||||
|
||||
test_dsfx_interfaces("FXI3DL2Reverb", (IUnknown *)reverb, &IID_IDirectSoundFXI3DL2Reverb);
|
||||
|
||||
IDirectSoundFXI3DL2Reverb_Release(reverb);
|
||||
}
|
||||
}
|
||||
|
||||
static void test_effects_parameters(void)
|
||||
{
|
||||
HRESULT rc;
|
||||
IDirectSound8 *dso;
|
||||
IDirectSoundBuffer *primary, *secondary = NULL;
|
||||
IDirectSoundBuffer8 *secondary8 = NULL;
|
||||
DSBUFFERDESC bufdesc;
|
||||
WAVEFORMATEX wfx;
|
||||
DSEFFECTDESC effects[8];
|
||||
DWORD resultcodes[8];
|
||||
|
||||
/* Create a DirectSound8 object */
|
||||
rc = DirectSoundCreate8(NULL, &dso, NULL);
|
||||
ok(rc == DS_OK || rc == DSERR_NODRIVER, "DirectSoundCreate8() failed: %08x\n", rc);
|
||||
if (rc != DS_OK)
|
||||
return;
|
||||
|
||||
rc = IDirectSound8_SetCooperativeLevel(dso, get_hwnd(), DSSCL_PRIORITY);
|
||||
ok(rc == DS_OK, "IDirectSound8_SetCooperativeLevel() failed: %08x\n", rc);
|
||||
if (rc != DS_OK)
|
||||
goto cleanup;
|
||||
|
||||
primary = NULL;
|
||||
ZeroMemory(&bufdesc, sizeof(bufdesc));
|
||||
bufdesc.dwSize = sizeof(bufdesc);
|
||||
bufdesc.dwFlags = DSBCAPS_PRIMARYBUFFER;
|
||||
rc = IDirectSound8_CreateSoundBuffer(dso, &bufdesc, &primary, NULL);
|
||||
ok((rc == DS_OK && primary != NULL), "Failed to create a primary buffer: %08x\n", rc);
|
||||
if (rc != DS_OK)
|
||||
goto cleanup;
|
||||
|
||||
init_format(&wfx, WAVE_FORMAT_PCM, 11025, 8, 1);
|
||||
ZeroMemory(&bufdesc, sizeof(bufdesc));
|
||||
bufdesc.dwSize = sizeof(bufdesc);
|
||||
bufdesc.dwBufferBytes = align(wfx.nAvgBytesPerSec * BUFFER_LEN / 1000, wfx.nBlockAlign);
|
||||
bufdesc.lpwfxFormat=&wfx;
|
||||
|
||||
ZeroMemory(effects, sizeof(effects));
|
||||
effects[0].dwSize=sizeof(effects[0]);
|
||||
effects[0].guidDSFXClass=GUID_DSFX_STANDARD_ECHO;
|
||||
effects[1].dwSize=sizeof(effects[0]);
|
||||
effects[1].guidDSFXClass=GUID_DSFX_STANDARD_GARGLE;
|
||||
effects[2].dwSize=sizeof(effects[0]);
|
||||
effects[2].guidDSFXClass=GUID_DSFX_STANDARD_CHORUS;
|
||||
effects[3].dwSize=sizeof(effects[0]);
|
||||
effects[3].guidDSFXClass=GUID_DSFX_STANDARD_FLANGER;
|
||||
effects[4].dwSize=sizeof(effects[0]);
|
||||
effects[4].guidDSFXClass=GUID_DSFX_STANDARD_DISTORTION;
|
||||
effects[5].dwSize=sizeof(effects[0]);
|
||||
effects[5].guidDSFXClass=GUID_DSFX_STANDARD_COMPRESSOR;
|
||||
effects[6].dwSize=sizeof(effects[0]);
|
||||
effects[6].guidDSFXClass=GUID_DSFX_STANDARD_PARAMEQ;
|
||||
effects[7].dwSize=sizeof(effects[0]);
|
||||
effects[7].guidDSFXClass=GUID_DSFX_STANDARD_I3DL2REVERB;
|
||||
|
||||
bufdesc.dwFlags = DSBCAPS_CTRLFX;
|
||||
rc = IDirectSound8_CreateSoundBuffer(dso, &bufdesc, &secondary, NULL);
|
||||
ok(rc == DS_OK && secondary != NULL, "Failed to create a secondary buffer: %08x\n",rc);
|
||||
if (rc != DS_OK || !secondary)
|
||||
goto cleanup;
|
||||
|
||||
rc = IDirectSoundBuffer_QueryInterface(secondary, &IID_IDirectSoundBuffer8, (void**)&secondary8);
|
||||
ok(rc == DS_OK, "Failed: %08x\n", rc);
|
||||
if (rc != DS_OK)
|
||||
goto cleanup;
|
||||
|
||||
rc = IDirectSoundBuffer8_SetFX(secondary8, ARRAY_SIZE(effects), effects, resultcodes);
|
||||
ok(rc == DS_OK || rc == REGDB_E_CLASSNOTREG || rc == DSERR_CONTROLUNAVAIL, "Failed: %08x\n", rc);
|
||||
if (rc != DS_OK)
|
||||
goto cleanup;
|
||||
|
||||
ok (resultcodes[0] == DSFXR_LOCSOFTWARE || resultcodes[0] == DSFXR_LOCHARDWARE, "Result: %08x\n", resultcodes[0]);
|
||||
test_echo_parameters(secondary8);
|
||||
|
||||
ok (resultcodes[1] == DSFXR_LOCSOFTWARE || resultcodes[1] == DSFXR_LOCHARDWARE, "Result: %08x\n", resultcodes[1]);
|
||||
test_gargle_parameters(secondary8);
|
||||
|
||||
ok (resultcodes[2] == DSFXR_LOCSOFTWARE || resultcodes[2] == DSFXR_LOCHARDWARE, "Result: %08x\n", resultcodes[2]);
|
||||
test_chorus_parameters(secondary8);
|
||||
|
||||
ok (resultcodes[3] == DSFXR_LOCSOFTWARE || resultcodes[3] == DSFXR_LOCHARDWARE, "Result: %08x\n", resultcodes[3]);
|
||||
test_flanger_parameters(secondary8);
|
||||
|
||||
ok (resultcodes[4] == DSFXR_LOCSOFTWARE || resultcodes[4] == DSFXR_LOCHARDWARE, "Result: %08x\n", resultcodes[4]);
|
||||
test_distortion_parameters(secondary8);
|
||||
|
||||
ok (resultcodes[5] == DSFXR_LOCSOFTWARE || resultcodes[5] == DSFXR_LOCHARDWARE, "Result: %08x\n", resultcodes[5]);
|
||||
test_compressor_parameters(secondary8);
|
||||
|
||||
ok (resultcodes[6] == DSFXR_LOCSOFTWARE || resultcodes[6] == DSFXR_LOCHARDWARE, "Result: %08x\n", resultcodes[6]);
|
||||
test_parameq_parameters(secondary8);
|
||||
|
||||
ok (resultcodes[7] == DSFXR_LOCSOFTWARE || resultcodes[7] == DSFXR_LOCHARDWARE, "Result: %08x\n", resultcodes[7]);
|
||||
test_reverb_parameters(secondary8);
|
||||
|
||||
cleanup:
|
||||
if (secondary8)
|
||||
IDirectSoundBuffer8_Release(secondary8);
|
||||
if (primary)
|
||||
IDirectSoundBuffer_Release(primary);
|
||||
IDirectSound8_Release(dso);
|
||||
}
|
||||
|
||||
START_TEST(dsound8)
|
||||
{
|
||||
DWORD cookie;
|
||||
|
@ -2204,7 +1841,6 @@ START_TEST(dsound8)
|
|||
test_hw_buffers();
|
||||
test_first_device();
|
||||
test_primary_flags();
|
||||
test_effects_parameters();
|
||||
|
||||
hr = CoRegisterClassObject(&testdmo_clsid, (IUnknown *)&testdmo_cf,
|
||||
CLSCTX_INPROC_SERVER, REGCLS_MULTIPLEUSE, &cookie);
|
||||
|
|
Loading…
Reference in New Issue