dmime: Implement the SegTrigger track Get/SetParam.

Signed-off-by: Michael Stefaniuc <mstefani@winehq.org>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Michael Stefaniuc 2019-12-03 23:51:20 +01:00 committed by Alexandre Julliard
parent c88fd286f3
commit d08bce15bc
2 changed files with 39 additions and 13 deletions

View File

@ -134,19 +134,21 @@ 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;
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);
TRACE("(%p, %s, %d, %p): not supported\n", This, debugstr_dmguid(type), time, param);
return S_OK;
}
@ -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;
}

View File

@ -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);