Commit ac528a49 authored by Zebediah Figura's avatar Zebediah Figura Committed by Alexandre Julliard

dsdmo: Add a stub equalizer effect.

parent baddd558
...@@ -28,6 +28,14 @@ coclass DirectSoundI3DL2ReverbDMO {} ...@@ -28,6 +28,14 @@ coclass DirectSoundI3DL2ReverbDMO {}
[ [
threading(both), threading(both),
progid("Microsoft.DirectSoundParamEqDMO.1"),
vi_progid("Microsoft.DirectSoundParamEqDMO"),
uuid(120ced89-3bf4-4173-a132-3cb406cf3231)
]
coclass DirectSoundParamEqDMO {}
[
threading(both),
progid("Microsoft.DirectSoundWavesReverbDMO.1"), progid("Microsoft.DirectSoundWavesReverbDMO.1"),
vi_progid("Microsoft.DirectSoundWavesReverbDMO"), vi_progid("Microsoft.DirectSoundWavesReverbDMO"),
uuid(87fc0268-9a55-4360-95aa-004a1d9de26c) uuid(87fc0268-9a55-4360-95aa-004a1d9de26c)
......
...@@ -434,6 +434,48 @@ static void effect_init(struct effect *effect, IUnknown *outer, const struct eff ...@@ -434,6 +434,48 @@ static void effect_init(struct effect *effect, IUnknown *outer, const struct eff
effect->ops = ops; 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 reverb
{ {
struct effect effect; struct effect effect;
...@@ -787,6 +829,7 @@ static struct ...@@ -787,6 +829,7 @@ static struct
class_factories[] = class_factories[] =
{ {
{&GUID_DSFX_STANDARD_I3DL2REVERB, {{&class_factory_vtbl}, reverb_create}}, {&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}}, {&GUID_DSFX_WAVES_REVERB, {{&class_factory_vtbl}, waves_reverb_create}},
}; };
......
...@@ -1617,8 +1617,8 @@ static void test_effects(void) ...@@ -1617,8 +1617,8 @@ static void test_effects(void)
results[0] = 0xdeadbeef; results[0] = 0xdeadbeef;
hr = IDirectSoundBuffer8_SetFX(buffer8, 1, effects, results); hr = IDirectSoundBuffer8_SetFX(buffer8, 1, effects, results);
todo_wine ok(hr == DS_OK, "Got hr %#x.\n", hr); ok(hr == DS_OK, "Got hr %#x.\n", hr);
todo_wine ok(results[0] == DSFXR_LOCSOFTWARE, "Got result %#x.\n", results[0]); ok(results[0] == DSFXR_LOCSOFTWARE, "Got result %#x.\n", results[0]);
hr = IDirectSoundBuffer8_Lock(buffer8, 0, 0, &ptr1, &size1, &ptr2, &size2, DSBLOCK_ENTIREBUFFER); hr = IDirectSoundBuffer8_Lock(buffer8, 0, 0, &ptr1, &size1, &ptr2, &size2, DSBLOCK_ENTIREBUFFER);
ok(hr == DS_OK, "Got hr %#x.\n", hr); ok(hr == DS_OK, "Got hr %#x.\n", hr);
...@@ -1648,38 +1648,33 @@ static void test_effects(void) ...@@ -1648,38 +1648,33 @@ static void test_effects(void)
effects[0].guidDSFXClass = GUID_DSFX_STANDARD_PARAMEQ; effects[0].guidDSFXClass = GUID_DSFX_STANDARD_PARAMEQ;
results[0] = 0xdeadbeef; results[0] = 0xdeadbeef;
hr = IDirectSoundBuffer8_SetFX(buffer8, 1, effects, results); hr = IDirectSoundBuffer8_SetFX(buffer8, 1, effects, results);
todo_wine ok(hr == DS_OK, "Got hr %#x.\n", hr); ok(hr == DS_OK, "Got hr %#x.\n", hr);
todo_wine ok(results[0] == DSFXR_LOCSOFTWARE, "Got result %#x.\n", results[0]); ok(results[0] == DSFXR_LOCSOFTWARE, "Got result %#x.\n", results[0]);
hr = IDirectSoundBuffer8_GetObjectInPath(buffer8, &GUID_All_Objects, 0, &IID_IMediaObject, NULL); 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; dmo = (IMediaObject *)0xdeadbeef;
hr = IDirectSoundBuffer8_GetObjectInPath(buffer8, &GUID_All_Objects, 0, &GUID_NULL, (void **)&dmo); hr = IDirectSoundBuffer8_GetObjectInPath(buffer8, &GUID_All_Objects, 0, &GUID_NULL, (void **)&dmo);
todo_wine ok(hr == E_NOINTERFACE, "Got hr %#x.\n", hr); ok(hr == E_NOINTERFACE, "Got hr %#x.\n", hr);
todo_wine ok(!dmo, "Got object %p.\n", dmo); ok(!dmo, "Got object %p.\n", dmo);
dmo = (IMediaObject *)0xdeadbeef; dmo = (IMediaObject *)0xdeadbeef;
hr = IDirectSoundBuffer8_GetObjectInPath(buffer8, &GUID_NULL, 0, &IID_IMediaObject, (void **)&dmo); 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); ok(dmo == (IMediaObject *)0xdeadbeef, "Got object %p.\n", dmo);
dmo = NULL; dmo = NULL;
hr = IDirectSoundBuffer8_GetObjectInPath(buffer8, &GUID_All_Objects, 0, &IID_IMediaObject, (void **)&dmo); hr = IDirectSoundBuffer8_GetObjectInPath(buffer8, &GUID_All_Objects, 0, &IID_IMediaObject, (void **)&dmo);
todo_wine ok(hr == DS_OK, "Got hr %#x.\n", hr); ok(hr == DS_OK, "Got hr %#x.\n", hr);
if (hr == DS_OK)
{
ok(!!dmo, "Expected a non-NULL object.\n"); ok(!!dmo, "Expected a non-NULL object.\n");
IMediaObject_Release(dmo); IMediaObject_Release(dmo);
}
dmo = NULL; dmo = NULL;
hr = IDirectSoundBuffer8_GetObjectInPath(buffer8, &GUID_DSFX_STANDARD_PARAMEQ, 0, &IID_IMediaObject, (void **)&dmo); 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"); ok(!!dmo, "Expected a non-NULL object.\n");
IMediaObject_Release(dmo); IMediaObject_Release(dmo);
}
dmo = (IMediaObject *)0xdeadbeef; dmo = (IMediaObject *)0xdeadbeef;
hr = IDirectSoundBuffer8_GetObjectInPath(buffer8, &GUID_All_Objects, 1, &IID_IMediaObject, (void **)&dmo); hr = IDirectSoundBuffer8_GetObjectInPath(buffer8, &GUID_All_Objects, 1, &IID_IMediaObject, (void **)&dmo);
...@@ -1691,7 +1686,7 @@ static void test_effects(void) ...@@ -1691,7 +1686,7 @@ static void test_effects(void)
results[0] = results[1] = 0xdeadbeef; results[0] = results[1] = 0xdeadbeef;
hr = IDirectSoundBuffer8_SetFX(buffer8, 2, effects, results); hr = IDirectSoundBuffer8_SetFX(buffer8, 2, effects, results);
ok(hr == REGDB_E_CLASSNOTREG, "Got hr %#x.\n", hr); 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]); ok(results[1] == DSFXR_UNKNOWN, "Got result %#x.\n", results[1]);
hr = IDirectSoundBuffer8_GetObjectInPath(buffer8, &GUID_All_Objects, 0, &IID_IMediaObject, (void **)&dmo); hr = IDirectSoundBuffer8_GetObjectInPath(buffer8, &GUID_All_Objects, 0, &IID_IMediaObject, (void **)&dmo);
...@@ -1701,13 +1696,12 @@ static void test_effects(void) ...@@ -1701,13 +1696,12 @@ static void test_effects(void)
effects[1].guidDSFXClass = GUID_DSFX_STANDARD_I3DL2REVERB; effects[1].guidDSFXClass = GUID_DSFX_STANDARD_I3DL2REVERB;
results[0] = results[1] = 0xdeadbeef; results[0] = results[1] = 0xdeadbeef;
hr = IDirectSoundBuffer8_SetFX(buffer8, 2, effects, results); hr = IDirectSoundBuffer8_SetFX(buffer8, 2, effects, results);
todo_wine ok(hr == DS_OK, "Got hr %#x.\n", hr); ok(hr == DS_OK, "Got hr %#x.\n", hr);
todo_wine ok(results[0] == DSFXR_LOCSOFTWARE, "Got result %#x.\n", results[0]); 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(results[1] == DSFXR_LOCSOFTWARE, "Got result %#x.\n", results[1]);
hr = IDirectSoundBuffer8_GetObjectInPath(buffer8, &GUID_DSFX_STANDARD_PARAMEQ, 0, &IID_IMediaObject, (void **)&dmo); hr = IDirectSoundBuffer8_GetObjectInPath(buffer8, &GUID_DSFX_STANDARD_PARAMEQ, 0, &IID_IMediaObject, (void **)&dmo);
todo_wine ok(hr == DS_OK, "Got hr %#x.\n", hr); ok(hr == DS_OK, "Got hr %#x.\n", hr);
if (hr == DS_OK)
echo = dmo; echo = dmo;
hr = IDirectSoundBuffer8_GetObjectInPath(buffer8, hr = IDirectSoundBuffer8_GetObjectInPath(buffer8,
&GUID_DSFX_STANDARD_I3DL2REVERB, 0, &IID_IMediaObject, (void **)&dmo); &GUID_DSFX_STANDARD_I3DL2REVERB, 0, &IID_IMediaObject, (void **)&dmo);
...@@ -1716,20 +1710,14 @@ static void test_effects(void) ...@@ -1716,20 +1710,14 @@ static void test_effects(void)
reverb = dmo; reverb = dmo;
hr = IDirectSoundBuffer8_GetObjectInPath(buffer8, &GUID_All_Objects, 0, &IID_IMediaObject, (void **)&dmo); hr = IDirectSoundBuffer8_GetObjectInPath(buffer8, &GUID_All_Objects, 0, &IID_IMediaObject, (void **)&dmo);
todo_wine ok(hr == DS_OK, "Got hr %#x.\n", hr); ok(hr == DS_OK, "Got hr %#x.\n", hr);
if (hr == DS_OK)
{
ok(dmo == echo, "Expected %p, got %p.\n", echo, dmo); ok(dmo == echo, "Expected %p, got %p.\n", echo, dmo);
IMediaObject_Release(dmo); IMediaObject_Release(dmo);
}
hr = IDirectSoundBuffer8_GetObjectInPath(buffer8, &GUID_All_Objects, 1, &IID_IMediaObject, (void **)&dmo); hr = IDirectSoundBuffer8_GetObjectInPath(buffer8, &GUID_All_Objects, 1, &IID_IMediaObject, (void **)&dmo);
todo_wine ok(hr == DS_OK, "Got hr %#x.\n", hr); ok(hr == DS_OK, "Got hr %#x.\n", hr);
if (hr == DS_OK) todo_wine ok(dmo == reverb, "Expected %p, got %p.\n", reverb, dmo);
{
ok(dmo == reverb, "Expected %p, got %p.\n", reverb, dmo);
IMediaObject_Release(dmo); IMediaObject_Release(dmo);
}
hr = IDirectSoundBuffer8_GetObjectInPath(buffer8, hr = IDirectSoundBuffer8_GetObjectInPath(buffer8,
&GUID_DSFX_STANDARD_I3DL2REVERB, 1, &IID_IMediaObject, (void **)&dmo); &GUID_DSFX_STANDARD_I3DL2REVERB, 1, &IID_IMediaObject, (void **)&dmo);
...@@ -1748,12 +1736,11 @@ static void test_effects(void) ...@@ -1748,12 +1736,11 @@ static void test_effects(void)
hr = IDirectSoundBuffer8_GetObjectInPath(buffer8, &GUID_All_Objects, 0, hr = IDirectSoundBuffer8_GetObjectInPath(buffer8, &GUID_All_Objects, 0,
&IID_IDirectSoundFXI3DL2Reverb, (void **)&unk); &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, hr = IDirectSoundBuffer8_GetObjectInPath(buffer8, &GUID_All_Objects, 1,
&IID_IDirectSoundFXI3DL2Reverb, (void **)&unk); &IID_IDirectSoundFXI3DL2Reverb, (void **)&unk);
todo_wine ok(hr == DS_OK, "Got hr %#x.\n", hr); ok(hr == DS_OK, "Got hr %#x.\n", hr);
if (hr == DS_OK)
IUnknown_Release(unk); IUnknown_Release(unk);
hr = IDirectSoundBuffer8_GetObjectInPath(buffer8, hr = IDirectSoundBuffer8_GetObjectInPath(buffer8,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment