From d08bce15bcb6cd9d04a8f77170252b9f735aff42 Mon Sep 17 00:00:00 2001 From: Michael Stefaniuc Date: Tue, 3 Dec 2019 23:51:20 +0100 Subject: [PATCH] dmime: Implement the SegTrigger track Get/SetParam. Signed-off-by: Michael Stefaniuc Signed-off-by: Alexandre Julliard --- dlls/dmime/segtriggertrack.c | 23 ++++++++++++----------- dlls/dmime/tests/dmime.c | 29 +++++++++++++++++++++++++++-- 2 files changed, 39 insertions(+), 13 deletions(-) diff --git a/dlls/dmime/segtriggertrack.c b/dlls/dmime/segtriggertrack.c index 7e1d75aa052..d36412cfc3d 100644 --- a/dlls/dmime/segtriggertrack.c +++ b/dlls/dmime/segtriggertrack.c @@ -134,20 +134,22 @@ static HRESULT WINAPI segment_track_Play(IDirectMusicTrack8 *iface, void *pState return S_OK; } -static HRESULT WINAPI segment_track_GetParam(IDirectMusicTrack8 *iface, REFGUID rguidType, - MUSIC_TIME mtTime, MUSIC_TIME *pmtNext, void *pParam) +static HRESULT WINAPI segment_track_GetParam(IDirectMusicTrack8 *iface, REFGUID type, + MUSIC_TIME time, MUSIC_TIME *next, void *param) { - IDirectMusicSegTriggerTrack *This = impl_from_IDirectMusicTrack8(iface); - FIXME("(%p, %s, %d, %p, %p): stub\n", This, debugstr_dmguid(rguidType), mtTime, pmtNext, pParam); - return S_OK; + IDirectMusicSegTriggerTrack *This = impl_from_IDirectMusicTrack8(iface); + + TRACE("(%p, %s, %d, %p, %p): not supported\n", This, debugstr_dmguid(type), time, next, param); + return DMUS_E_GET_UNSUPPORTED; } -static HRESULT WINAPI segment_track_SetParam(IDirectMusicTrack8 *iface, REFGUID rguidType, - MUSIC_TIME mtTime, void *pParam) +static HRESULT WINAPI segment_track_SetParam(IDirectMusicTrack8 *iface, REFGUID type, + MUSIC_TIME time, void *param) { - IDirectMusicSegTriggerTrack *This = impl_from_IDirectMusicTrack8(iface); - FIXME("(%p, %s, %d, %p): stub\n", This, debugstr_dmguid(rguidType), mtTime, pParam); - return S_OK; + IDirectMusicSegTriggerTrack *This = impl_from_IDirectMusicTrack8(iface); + + TRACE("(%p, %s, %d, %p): not supported\n", This, debugstr_dmguid(type), time, param); + return S_OK; } static HRESULT WINAPI segment_track_IsParamSupported(IDirectMusicTrack8 *iface, REFGUID type) @@ -155,7 +157,6 @@ static HRESULT WINAPI segment_track_IsParamSupported(IDirectMusicTrack8 *iface, IDirectMusicSegTriggerTrack *This = impl_from_IDirectMusicTrack8(iface); TRACE("(%p, %s)\n", This, debugstr_dmguid(type)); - return S_OK; } diff --git a/dlls/dmime/tests/dmime.c b/dlls/dmime/tests/dmime.c index f561eb391e2..0f4c43700c9 100644 --- a/dlls/dmime/tests/dmime.c +++ b/dlls/dmime/tests/dmime.c @@ -604,6 +604,26 @@ static void test_track_identify(void) IDirectMusicSegment8_Release(seg); } +static void expect_getparam(IDirectMusicTrack *track, REFGUID type, const char *name, + HRESULT expect) +{ + HRESULT hr; + char buf[64] = { 0 }; + + hr = IDirectMusicTrack8_GetParam(track, type, 0, NULL, buf); + ok(hr == expect, "GetParam(%s) failed: %08x, expected %08x\n", name, hr, expect); +} + +static void expect_setparam(IDirectMusicTrack *track, REFGUID type, const char *name, + HRESULT expect) +{ + HRESULT hr; + char buf[64] = { 0 }; + + hr = IDirectMusicTrack8_SetParam(track, type, 0, buf); + ok(hr == expect, "SetParam(%s) failed: %08x, expected %08x\n", name, hr, expect); +} + static void test_track(void) { IDirectMusicTrack *dmt; @@ -679,10 +699,15 @@ static void test_track(void) if (class[i].has_params != ~0) { for (j = 0; j < ARRAY_SIZE(param_types); j++) { hr = IDirectMusicTrack8_IsParamSupported(dmt, param_types[j].type); - if (class[i].has_params & (1 << j)) + if (class[i].has_params & (1 << j)) { ok(hr == S_OK, "IsParamSupported(%s) failed: %08x, expected S_OK\n", param_types[j].name, hr); - else + if (class[i].clsid == &CLSID_DirectMusicSegmentTriggerTrack) { + expect_getparam(dmt, param_types[j].type, param_types[j].name, + DMUS_E_GET_UNSUPPORTED); + expect_setparam(dmt, param_types[j].type, param_types[j].name, S_OK); + } + } else ok(hr == DMUS_E_TYPE_UNSUPPORTED, "IsParamSupported(%s) failed: %08x, expected DMUS_E_TYPE_UNSUPPORTED\n", param_types[j].name, hr);