dsdmo: Add a stub equalizer effect.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
baddd55817
commit
ac528a492b
|
@ -26,6 +26,14 @@
|
|||
]
|
||||
coclass DirectSoundI3DL2ReverbDMO {}
|
||||
|
||||
[
|
||||
threading(both),
|
||||
progid("Microsoft.DirectSoundParamEqDMO.1"),
|
||||
vi_progid("Microsoft.DirectSoundParamEqDMO"),
|
||||
uuid(120ced89-3bf4-4173-a132-3cb406cf3231)
|
||||
]
|
||||
coclass DirectSoundParamEqDMO {}
|
||||
|
||||
[
|
||||
threading(both),
|
||||
progid("Microsoft.DirectSoundWavesReverbDMO.1"),
|
||||
|
|
|
@ -434,6 +434,48 @@ static void effect_init(struct effect *effect, IUnknown *outer, const struct eff
|
|||
effect->ops = ops;
|
||||
}
|
||||
|
||||
struct eq
|
||||
{
|
||||
struct effect effect;
|
||||
};
|
||||
|
||||
static struct eq *impl_eq_from_effect(struct effect *iface)
|
||||
{
|
||||
return CONTAINING_RECORD(iface, struct eq, effect);
|
||||
}
|
||||
|
||||
static void *eq_query_interface(struct effect *iface, REFIID iid)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static void eq_destroy(struct effect *iface)
|
||||
{
|
||||
struct eq *effect = impl_eq_from_effect(iface);
|
||||
|
||||
free(effect);
|
||||
}
|
||||
|
||||
static const struct effect_ops eq_ops =
|
||||
{
|
||||
.destroy = eq_destroy,
|
||||
.query_interface = eq_query_interface,
|
||||
};
|
||||
|
||||
static HRESULT eq_create(IUnknown *outer, IUnknown **out)
|
||||
{
|
||||
struct eq *object;
|
||||
|
||||
if (!(object = calloc(1, sizeof(*object))))
|
||||
return E_OUTOFMEMORY;
|
||||
|
||||
effect_init(&object->effect, outer, &eq_ops);
|
||||
|
||||
TRACE("Created equalizer effect %p.\n", object);
|
||||
*out = &object->effect.IUnknown_inner;
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
struct reverb
|
||||
{
|
||||
struct effect effect;
|
||||
|
@ -787,6 +829,7 @@ static struct
|
|||
class_factories[] =
|
||||
{
|
||||
{&GUID_DSFX_STANDARD_I3DL2REVERB, {{&class_factory_vtbl}, reverb_create}},
|
||||
{&GUID_DSFX_STANDARD_PARAMEQ, {{&class_factory_vtbl}, eq_create}},
|
||||
{&GUID_DSFX_WAVES_REVERB, {{&class_factory_vtbl}, waves_reverb_create}},
|
||||
};
|
||||
|
||||
|
|
|
@ -1617,8 +1617,8 @@ static void test_effects(void)
|
|||
|
||||
results[0] = 0xdeadbeef;
|
||||
hr = IDirectSoundBuffer8_SetFX(buffer8, 1, effects, results);
|
||||
todo_wine ok(hr == DS_OK, "Got hr %#x.\n", hr);
|
||||
todo_wine ok(results[0] == DSFXR_LOCSOFTWARE, "Got result %#x.\n", results[0]);
|
||||
ok(hr == DS_OK, "Got hr %#x.\n", hr);
|
||||
ok(results[0] == DSFXR_LOCSOFTWARE, "Got result %#x.\n", results[0]);
|
||||
|
||||
hr = IDirectSoundBuffer8_Lock(buffer8, 0, 0, &ptr1, &size1, &ptr2, &size2, DSBLOCK_ENTIREBUFFER);
|
||||
ok(hr == DS_OK, "Got hr %#x.\n", hr);
|
||||
|
@ -1648,38 +1648,33 @@ static void test_effects(void)
|
|||
effects[0].guidDSFXClass = GUID_DSFX_STANDARD_PARAMEQ;
|
||||
results[0] = 0xdeadbeef;
|
||||
hr = IDirectSoundBuffer8_SetFX(buffer8, 1, effects, results);
|
||||
todo_wine ok(hr == DS_OK, "Got hr %#x.\n", hr);
|
||||
todo_wine ok(results[0] == DSFXR_LOCSOFTWARE, "Got result %#x.\n", results[0]);
|
||||
ok(hr == DS_OK, "Got hr %#x.\n", hr);
|
||||
ok(results[0] == DSFXR_LOCSOFTWARE, "Got result %#x.\n", results[0]);
|
||||
|
||||
hr = IDirectSoundBuffer8_GetObjectInPath(buffer8, &GUID_All_Objects, 0, &IID_IMediaObject, NULL);
|
||||
todo_wine ok(hr == DSERR_INVALIDPARAM, "Got hr %#x.\n", hr);
|
||||
ok(hr == DSERR_INVALIDPARAM, "Got hr %#x.\n", hr);
|
||||
|
||||
dmo = (IMediaObject *)0xdeadbeef;
|
||||
hr = IDirectSoundBuffer8_GetObjectInPath(buffer8, &GUID_All_Objects, 0, &GUID_NULL, (void **)&dmo);
|
||||
todo_wine ok(hr == E_NOINTERFACE, "Got hr %#x.\n", hr);
|
||||
todo_wine ok(!dmo, "Got object %p.\n", dmo);
|
||||
ok(hr == E_NOINTERFACE, "Got hr %#x.\n", hr);
|
||||
ok(!dmo, "Got object %p.\n", dmo);
|
||||
|
||||
dmo = (IMediaObject *)0xdeadbeef;
|
||||
hr = IDirectSoundBuffer8_GetObjectInPath(buffer8, &GUID_NULL, 0, &IID_IMediaObject, (void **)&dmo);
|
||||
todo_wine ok(hr == DSERR_OBJECTNOTFOUND, "Got hr %#x.\n", hr);
|
||||
ok(hr == DSERR_OBJECTNOTFOUND, "Got hr %#x.\n", hr);
|
||||
ok(dmo == (IMediaObject *)0xdeadbeef, "Got object %p.\n", dmo);
|
||||
|
||||
dmo = NULL;
|
||||
hr = IDirectSoundBuffer8_GetObjectInPath(buffer8, &GUID_All_Objects, 0, &IID_IMediaObject, (void **)&dmo);
|
||||
todo_wine ok(hr == DS_OK, "Got hr %#x.\n", hr);
|
||||
if (hr == DS_OK)
|
||||
{
|
||||
ok(hr == DS_OK, "Got hr %#x.\n", hr);
|
||||
ok(!!dmo, "Expected a non-NULL object.\n");
|
||||
IMediaObject_Release(dmo);
|
||||
}
|
||||
|
||||
dmo = NULL;
|
||||
hr = IDirectSoundBuffer8_GetObjectInPath(buffer8, &GUID_DSFX_STANDARD_PARAMEQ, 0, &IID_IMediaObject, (void **)&dmo);
|
||||
if (hr == DS_OK)
|
||||
{
|
||||
ok(hr == DS_OK, "Got hr %#x.\n", hr);
|
||||
ok(!!dmo, "Expected a non-NULL object.\n");
|
||||
IMediaObject_Release(dmo);
|
||||
}
|
||||
|
||||
dmo = (IMediaObject *)0xdeadbeef;
|
||||
hr = IDirectSoundBuffer8_GetObjectInPath(buffer8, &GUID_All_Objects, 1, &IID_IMediaObject, (void **)&dmo);
|
||||
|
@ -1691,7 +1686,7 @@ static void test_effects(void)
|
|||
results[0] = results[1] = 0xdeadbeef;
|
||||
hr = IDirectSoundBuffer8_SetFX(buffer8, 2, effects, results);
|
||||
ok(hr == REGDB_E_CLASSNOTREG, "Got hr %#x.\n", hr);
|
||||
todo_wine ok(results[0] == DSFXR_PRESENT, "Got result %#x.\n", results[0]);
|
||||
ok(results[0] == DSFXR_PRESENT, "Got result %#x.\n", results[0]);
|
||||
ok(results[1] == DSFXR_UNKNOWN, "Got result %#x.\n", results[1]);
|
||||
|
||||
hr = IDirectSoundBuffer8_GetObjectInPath(buffer8, &GUID_All_Objects, 0, &IID_IMediaObject, (void **)&dmo);
|
||||
|
@ -1701,13 +1696,12 @@ static void test_effects(void)
|
|||
effects[1].guidDSFXClass = GUID_DSFX_STANDARD_I3DL2REVERB;
|
||||
results[0] = results[1] = 0xdeadbeef;
|
||||
hr = IDirectSoundBuffer8_SetFX(buffer8, 2, effects, results);
|
||||
todo_wine ok(hr == DS_OK, "Got hr %#x.\n", hr);
|
||||
todo_wine ok(results[0] == DSFXR_LOCSOFTWARE, "Got result %#x.\n", results[0]);
|
||||
todo_wine ok(results[1] == DSFXR_LOCSOFTWARE, "Got result %#x.\n", results[1]);
|
||||
ok(hr == DS_OK, "Got hr %#x.\n", hr);
|
||||
ok(results[0] == DSFXR_LOCSOFTWARE, "Got result %#x.\n", results[0]);
|
||||
ok(results[1] == DSFXR_LOCSOFTWARE, "Got result %#x.\n", results[1]);
|
||||
|
||||
hr = IDirectSoundBuffer8_GetObjectInPath(buffer8, &GUID_DSFX_STANDARD_PARAMEQ, 0, &IID_IMediaObject, (void **)&dmo);
|
||||
todo_wine ok(hr == DS_OK, "Got hr %#x.\n", hr);
|
||||
if (hr == DS_OK)
|
||||
ok(hr == DS_OK, "Got hr %#x.\n", hr);
|
||||
echo = dmo;
|
||||
hr = IDirectSoundBuffer8_GetObjectInPath(buffer8,
|
||||
&GUID_DSFX_STANDARD_I3DL2REVERB, 0, &IID_IMediaObject, (void **)&dmo);
|
||||
|
@ -1716,20 +1710,14 @@ static void test_effects(void)
|
|||
reverb = dmo;
|
||||
|
||||
hr = IDirectSoundBuffer8_GetObjectInPath(buffer8, &GUID_All_Objects, 0, &IID_IMediaObject, (void **)&dmo);
|
||||
todo_wine ok(hr == DS_OK, "Got hr %#x.\n", hr);
|
||||
if (hr == DS_OK)
|
||||
{
|
||||
ok(hr == DS_OK, "Got hr %#x.\n", hr);
|
||||
ok(dmo == echo, "Expected %p, got %p.\n", echo, dmo);
|
||||
IMediaObject_Release(dmo);
|
||||
}
|
||||
|
||||
hr = IDirectSoundBuffer8_GetObjectInPath(buffer8, &GUID_All_Objects, 1, &IID_IMediaObject, (void **)&dmo);
|
||||
todo_wine ok(hr == DS_OK, "Got hr %#x.\n", hr);
|
||||
if (hr == DS_OK)
|
||||
{
|
||||
ok(dmo == reverb, "Expected %p, got %p.\n", reverb, dmo);
|
||||
ok(hr == DS_OK, "Got hr %#x.\n", hr);
|
||||
todo_wine ok(dmo == reverb, "Expected %p, got %p.\n", reverb, dmo);
|
||||
IMediaObject_Release(dmo);
|
||||
}
|
||||
|
||||
hr = IDirectSoundBuffer8_GetObjectInPath(buffer8,
|
||||
&GUID_DSFX_STANDARD_I3DL2REVERB, 1, &IID_IMediaObject, (void **)&dmo);
|
||||
|
@ -1748,12 +1736,11 @@ static void test_effects(void)
|
|||
|
||||
hr = IDirectSoundBuffer8_GetObjectInPath(buffer8, &GUID_All_Objects, 0,
|
||||
&IID_IDirectSoundFXI3DL2Reverb, (void **)&unk);
|
||||
todo_wine ok(hr == E_NOINTERFACE, "Got hr %#x.\n", hr);
|
||||
ok(hr == E_NOINTERFACE, "Got hr %#x.\n", hr);
|
||||
|
||||
hr = IDirectSoundBuffer8_GetObjectInPath(buffer8, &GUID_All_Objects, 1,
|
||||
&IID_IDirectSoundFXI3DL2Reverb, (void **)&unk);
|
||||
todo_wine ok(hr == DS_OK, "Got hr %#x.\n", hr);
|
||||
if (hr == DS_OK)
|
||||
ok(hr == DS_OK, "Got hr %#x.\n", hr);
|
||||
IUnknown_Release(unk);
|
||||
|
||||
hr = IDirectSoundBuffer8_GetObjectInPath(buffer8,
|
||||
|
|
Loading…
Reference in New Issue