Commit ca060d45 authored by Michael Stefaniuc's avatar Michael Stefaniuc Committed by Alexandre Julliard

dmime: Tempo track supports only GUID_TempoParam in GetParam().

parent dc96d1b1
...@@ -153,52 +153,43 @@ static HRESULT WINAPI tempo_track_Play(IDirectMusicTrack8 *iface, void *pStateDa ...@@ -153,52 +153,43 @@ static HRESULT WINAPI tempo_track_Play(IDirectMusicTrack8 *iface, void *pStateDa
return S_OK; return S_OK;
} }
static HRESULT WINAPI tempo_track_GetParam(IDirectMusicTrack8 *iface, REFGUID rguidType, static HRESULT WINAPI tempo_track_GetParam(IDirectMusicTrack8 *iface, REFGUID type, MUSIC_TIME time,
MUSIC_TIME mtTime, MUSIC_TIME *pmtNext, void *pParam) MUSIC_TIME *next, void *param)
{ {
IDirectMusicTempoTrack *This = impl_from_IDirectMusicTrack8(iface); IDirectMusicTempoTrack *This = impl_from_IDirectMusicTrack8(iface);
DMUS_PRIVATE_TEMPO_ITEM *item = NULL;
HRESULT hr = S_OK; DMUS_TEMPO_PARAM *prm = param;
struct list* pEntry = NULL;
LPDMUS_PRIVATE_TEMPO_ITEM pIt = NULL; TRACE("(%p, %s, %d, %p, %p)\n", This, debugstr_dmguid(type), time, next, param);
DMUS_TEMPO_PARAM* prm = pParam;
if (!param)
FIXME("(%p, %s, %d, %p, %p): almost stub\n", This, debugstr_dmguid(rguidType), mtTime, pmtNext, pParam); return E_POINTER;
if (!IsEqualGUID(type, &GUID_TempoParam))
if (NULL == pParam) { return DMUS_E_GET_UNSUPPORTED;
return E_POINTER;
} FIXME("Partial support for GUID_TempoParam\n");
if (next)
*next = 0;
prm->mtTime = 0;
prm->dblTempo = 0.123456;
LIST_FOR_EACH_ENTRY(item, &This->Items, DMUS_PRIVATE_TEMPO_ITEM, entry) {
if (item->item.lTime <= time) {
MUSIC_TIME ofs = item->item.lTime - time;
if (ofs > prm->mtTime) {
prm->mtTime = ofs;
prm->dblTempo = item->item.dblTempo;
}
if (next && item->item.lTime > time && item->item.lTime < *next)
*next = item->item.lTime;
}
}
hr = IDirectMusicTrack_IsParamSupported (iface, rguidType); if (0.123456 == prm->dblTempo)
if (FAILED(hr)) { return DMUS_E_NOT_FOUND;
return hr;
}
if (NULL != pmtNext) *pmtNext = 0; return S_OK;
prm->mtTime = 0;
prm->dblTempo = 0.123456;
LIST_FOR_EACH (pEntry, &This->Items) {
pIt = LIST_ENTRY(pEntry, DMUS_PRIVATE_TEMPO_ITEM, entry);
/*TRACE(" - %p -> 0x%lx,%p\n", pIt, pIt->item.lTime, pIt->item.dblTempo);*/
if (pIt->item.lTime <= mtTime) {
MUSIC_TIME ofs = pIt->item.lTime - mtTime;
if (ofs > prm->mtTime) {
prm->mtTime = ofs;
prm->dblTempo = pIt->item.dblTempo;
}
if (NULL != pmtNext && pIt->item.lTime > mtTime) {
if (pIt->item.lTime < *pmtNext) {
*pmtNext = pIt->item.lTime;
}
}
}
}
if (0.123456 == prm->dblTempo) {
return DMUS_E_NOT_FOUND;
}
return S_OK;
} }
static HRESULT WINAPI tempo_track_SetParam(IDirectMusicTrack8 *iface, REFGUID type, MUSIC_TIME time, static HRESULT WINAPI tempo_track_SetParam(IDirectMusicTrack8 *iface, REFGUID type, MUSIC_TIME time,
......
...@@ -724,6 +724,11 @@ static void test_track(void) ...@@ -724,6 +724,11 @@ static void test_track(void)
DMUS_E_GET_UNSUPPORTED); DMUS_E_GET_UNSUPPORTED);
expect_setparam(dmt, &GUID_TimeSignature, "GUID_TimeSignature", expect_setparam(dmt, &GUID_TimeSignature, "GUID_TimeSignature",
DMUS_E_SET_UNSUPPORTED); DMUS_E_SET_UNSUPPORTED);
} else if (class[i].clsid == &CLSID_DirectMusicTempoTrack) {
expect_getparam(dmt, &GUID_DisableTempo, "GUID_DisableTempo",
DMUS_E_GET_UNSUPPORTED);
expect_getparam(dmt, &GUID_EnableTempo, "GUID_EnableTempo",
DMUS_E_GET_UNSUPPORTED);
} }
} }
} else { } else {
......
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