From: Zhiyi Zhang zzhang@codeweavers.com
Signed-off-by: Zhiyi Zhang zzhang@codeweavers.com --- include/Makefile.in | 1 + include/medparam.idl | 58 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 59 insertions(+) create mode 100644 include/medparam.idl
diff --git a/include/Makefile.in b/include/Makefile.in index d5f389b506a..4ea66b37f33 100644 --- a/include/Makefile.in +++ b/include/Makefile.in @@ -414,6 +414,7 @@ SOURCES = \ mcx.h \ mediaerr.h \ mediaobj.idl \ + medparam.idl \ metahost.idl \ mfapi.h \ mfd3d12.idl \ diff --git a/include/medparam.idl b/include/medparam.idl new file mode 100644 index 00000000000..f3b7f2f463e --- /dev/null +++ b/include/medparam.idl @@ -0,0 +1,58 @@ +/* + * Copyright 2022 Zhiyi Zhang for CodeWeavers + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +import "unknwn.idl"; + +typedef float MP_DATA; +typedef DWORD MP_CAPS; +typedef DWORD MP_TIMEDATA; + +typedef enum _MP_Type +{ + MPT_INT, + MPT_FLOAT, + MPT_BOOL, + MPT_ENUM, + MPT_MAX, +} MP_TYPE; + +typedef struct _MP_PARAMINFO +{ + MP_TYPE mpType; + MP_CAPS mopCaps; + MP_DATA mpdMinValue; + MP_DATA mpdMaxValue; + MP_DATA mpdNeutralValue; + WCHAR szUnitText[32]; + WCHAR szLabel[32]; +} MP_PARAMINFO; + +[ +object, +uuid(6D6CBB60-A223-44AA-842F-A2F06750BE6D), +version(1.0) +] +interface IMediaParamInfo : IUnknown +{ + HRESULT GetParamCount([out] DWORD *count); + HRESULT GetParamInfo([in] DWORD index, [out] MP_PARAMINFO *info); + HRESULT GetParamText([in] DWORD index, [out] WCHAR **text); + HRESULT GetNumTimeFormats([out] DWORD *count); + HRESULT GetSupportedTimeFormat([in] DWORD index, [out] GUID *guid); + HRESULT GetCurrentTimeFormat([out] GUID *guid, [out] MP_TIMEDATA *time_data); +}
From: Zhiyi Zhang zzhang@codeweavers.com
Signed-off-by: Zhiyi Zhang zzhang@codeweavers.com --- dlls/dsdmo/tests/dsdmo.c | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/dlls/dsdmo/tests/dsdmo.c b/dlls/dsdmo/tests/dsdmo.c index 44e4f88af8f..c2b976d05d7 100644 --- a/dlls/dsdmo/tests/dsdmo.c +++ b/dlls/dsdmo/tests/dsdmo.c @@ -24,6 +24,7 @@ #include "mmsystem.h" #include "dmo.h" #include "initguid.h" +#include "medparam.h" #include "dsound.h" #include "uuids.h" #include "wine/test.h" @@ -542,6 +543,7 @@ START_TEST(dsdmo) {&GUID_DSFX_STANDARD_GARGLE, &IID_IDirectSoundFXGargle, TRUE}, {&GUID_DSFX_STANDARD_I3DL2REVERB, &IID_IDirectSoundFXI3DL2Reverb}, {&GUID_DSFX_STANDARD_PARAMEQ, &IID_IDirectSoundFXParamEq}, + {&GUID_DSFX_STANDARD_PARAMEQ, &IID_IMediaParamInfo, TRUE}, {&GUID_DSFX_WAVES_REVERB, &IID_IDirectSoundFXWavesReverb}, }; unsigned int i;
On 7/19/22 20:56, Zhiyi Zhang wrote:
From: Zhiyi Zhang zzhang@codeweavers.com
Signed-off-by: Zhiyi Zhang zzhang@codeweavers.com
dlls/dsdmo/tests/dsdmo.c | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/dlls/dsdmo/tests/dsdmo.c b/dlls/dsdmo/tests/dsdmo.c index 44e4f88af8f..c2b976d05d7 100644 --- a/dlls/dsdmo/tests/dsdmo.c +++ b/dlls/dsdmo/tests/dsdmo.c @@ -24,6 +24,7 @@ #include "mmsystem.h" #include "dmo.h" #include "initguid.h" +#include "medparam.h" #include "dsound.h" #include "uuids.h" #include "wine/test.h" @@ -542,6 +543,7 @@ START_TEST(dsdmo) {&GUID_DSFX_STANDARD_GARGLE, &IID_IDirectSoundFXGargle, TRUE}, {&GUID_DSFX_STANDARD_I3DL2REVERB, &IID_IDirectSoundFXI3DL2Reverb}, {&GUID_DSFX_STANDARD_PARAMEQ, &IID_IDirectSoundFXParamEq},
{&GUID_DSFX_STANDARD_PARAMEQ, &IID_IMediaParamInfo, TRUE}, {&GUID_DSFX_WAVES_REVERB, &IID_IDirectSoundFXWavesReverb}, }; unsigned int i;
Do the other objects support this interface?
(If so I think we should test it in test_interfaces(), and not make the implementation specific to the EQ filter.)
From: Zhiyi Zhang zzhang@codeweavers.com
Fix Chuzzle Deluxe crash at start.
Signed-off-by: Zhiyi Zhang zzhang@codeweavers.com --- dlls/dsdmo/main.c | 78 ++++++++++++++++++++++++++++++++++++++++ dlls/dsdmo/tests/dsdmo.c | 2 +- 2 files changed, 79 insertions(+), 1 deletion(-)
diff --git a/dlls/dsdmo/main.c b/dlls/dsdmo/main.c index fe7cf1115a7..868d3495273 100644 --- a/dlls/dsdmo/main.c +++ b/dlls/dsdmo/main.c @@ -22,6 +22,7 @@ #include "mmsystem.h" #include "uuids.h" #include "initguid.h" +#include "medparam.h" #include "dsound.h" #include "rpcproxy.h"
@@ -436,6 +437,7 @@ struct eq { struct effect effect; IDirectSoundFXParamEq IDirectSoundFXParamEq_iface; + IMediaParamInfo IMediaParamInfo_iface; DSFXParamEq params; };
@@ -495,6 +497,78 @@ static const IDirectSoundFXParamEqVtbl eq_params_vtbl = eq_params_GetAllParameters, };
+static struct eq *impl_from_IMediaParamInfo(IMediaParamInfo *iface) +{ + return CONTAINING_RECORD(iface, struct eq, IMediaParamInfo_iface); +} + +static HRESULT WINAPI eq_media_param_info_QueryInterface(IMediaParamInfo *iface, REFIID iid, void **out) +{ + struct eq *effect = impl_from_IMediaParamInfo(iface); + return IUnknown_QueryInterface(effect->effect.outer_unk, iid, out); +} + +static ULONG WINAPI eq_media_param_info_AddRef(IMediaParamInfo *iface) +{ + struct eq *effect = impl_from_IMediaParamInfo(iface); + return IUnknown_AddRef(effect->effect.outer_unk); +} + +static ULONG WINAPI eq_media_param_info_Release(IMediaParamInfo *iface) +{ + struct eq *effect = impl_from_IMediaParamInfo(iface); + return IUnknown_Release(effect->effect.outer_unk); +} + +static HRESULT WINAPI eq_media_param_info_GetParamCount(IMediaParamInfo *iface, DWORD *count) +{ + FIXME("iface %p, count %p, stub!\n", iface, count); + return E_NOTIMPL; +} + +static HRESULT WINAPI eq_media_param_info_GetParamInfo(IMediaParamInfo *iface, DWORD index, MP_PARAMINFO *info) +{ + FIXME("iface %p, index %lu, info %p, stub!\n", iface, index, info); + return E_NOTIMPL; +} + +static HRESULT WINAPI eq_media_param_info_GetParamText(IMediaParamInfo *iface, DWORD index, WCHAR **text) +{ + FIXME("iface %p, index %lu, text %p, stub!\n", iface, index, text); + return E_NOTIMPL; +} + +static HRESULT WINAPI eq_media_param_info_GetNumTimeFormats(IMediaParamInfo *iface, DWORD *count) +{ + FIXME("iface %p, count %p, stub!\n", iface, count); + return E_NOTIMPL; +} + +static HRESULT WINAPI eq_media_param_info_GetSupportedTimeFormat(IMediaParamInfo *iface, DWORD index, GUID *guid) +{ + FIXME("iface %p, index %lu, guid %p, stub!\n", iface, index, guid); + return E_NOTIMPL; +} + +static HRESULT WINAPI eq_media_param_info_GetCurrentTimeFormat(IMediaParamInfo *iface, GUID *guid, MP_TIMEDATA *time_data) +{ + FIXME("iface %p, guid %p, time_data %p, stub!\n", iface, guid, time_data); + return E_NOTIMPL; +} + +static const IMediaParamInfoVtbl eq_media_param_info_vtbl = +{ + eq_media_param_info_QueryInterface, + eq_media_param_info_AddRef, + eq_media_param_info_Release, + eq_media_param_info_GetParamCount, + eq_media_param_info_GetParamInfo, + eq_media_param_info_GetParamText, + eq_media_param_info_GetNumTimeFormats, + eq_media_param_info_GetSupportedTimeFormat, + eq_media_param_info_GetCurrentTimeFormat, +}; + static struct eq *impl_eq_from_effect(struct effect *iface) { return CONTAINING_RECORD(iface, struct eq, effect); @@ -506,6 +580,9 @@ static void *eq_query_interface(struct effect *iface, REFIID iid)
if (IsEqualGUID(iid, &IID_IDirectSoundFXParamEq)) return &effect->IDirectSoundFXParamEq_iface; + else if (IsEqualGUID(iid, &IID_IMediaParamInfo)) + return &effect->IMediaParamInfo_iface; + return NULL; }
@@ -531,6 +608,7 @@ static HRESULT eq_create(IUnknown *outer, IUnknown **out)
effect_init(&object->effect, outer, &eq_ops); object->IDirectSoundFXParamEq_iface.lpVtbl = &eq_params_vtbl; + object->IMediaParamInfo_iface.lpVtbl = &eq_media_param_info_vtbl;
object->params.fCenter = 8000.0f; object->params.fBandwidth = 12.0f; diff --git a/dlls/dsdmo/tests/dsdmo.c b/dlls/dsdmo/tests/dsdmo.c index c2b976d05d7..49152590ba8 100644 --- a/dlls/dsdmo/tests/dsdmo.c +++ b/dlls/dsdmo/tests/dsdmo.c @@ -543,7 +543,7 @@ START_TEST(dsdmo) {&GUID_DSFX_STANDARD_GARGLE, &IID_IDirectSoundFXGargle, TRUE}, {&GUID_DSFX_STANDARD_I3DL2REVERB, &IID_IDirectSoundFXI3DL2Reverb}, {&GUID_DSFX_STANDARD_PARAMEQ, &IID_IDirectSoundFXParamEq}, - {&GUID_DSFX_STANDARD_PARAMEQ, &IID_IMediaParamInfo, TRUE}, + {&GUID_DSFX_STANDARD_PARAMEQ, &IID_IMediaParamInfo}, {&GUID_DSFX_WAVES_REVERB, &IID_IDirectSoundFXWavesReverb}, }; unsigned int i;