[PATCH 8/9] dmime: Tempo track supports only GUID_TempoParam in GetParam() (original) (raw)
Michael Stefaniuc mstefani at winehq.org
Tue Dec 3 16:51:25 CST 2019
- Previous message (by thread): [PATCH 7/9] dmime: Partial implementation of the Tempo track SetParam()
- Next message (by thread): [PATCH 9/9] dmime/tests: Add GetParam/SetParam tests for unsupported types
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Signed-off-by: Michael Stefaniuc <mstefani at winehq.org>
dlls/dmime/tempotrack.c | 77 ++++++++++++++++++---------------------- dlls/dmime/tests/dmime.c | 5 +++ 2 files changed, 39 insertions(+), 43 deletions(-)
diff --git a/dlls/dmime/tempotrack.c b/dlls/dmime/tempotrack.c index 442aec37bf..94e4430b7f 100644 --- a/dlls/dmime/tempotrack.c +++ b/dlls/dmime/tempotrack.c @@ -153,52 +153,43 @@ static HRESULT WINAPI tempo_track_Play(IDirectMusicTrack8 *iface, void *pStateDa return S_OK; } -static HRESULT WINAPI tempo_track_GetParam(IDirectMusicTrack8 *iface, REFGUID rguidType, - MUSIC_TIME mtTime, MUSIC_TIME *pmtNext, void *pParam) +static HRESULT WINAPI tempo_track_GetParam(IDirectMusicTrack8 *iface, REFGUID type, MUSIC_TIME time, + MUSIC_TIME *next, void *param) { - IDirectMusicTempoTrack *This = impl_from_IDirectMusicTrack8(iface);
- HRESULT hr = S_OK;
- struct list* pEntry = NULL;
- LPDMUS_PRIVATE_TEMPO_ITEM pIt = NULL;
- DMUS_TEMPO_PARAM* prm = pParam;
- FIXME("(%p, %s, %d, %p, %p): almost stub\n", This, debugstr_dmguid(rguidType), mtTime, pmtNext, pParam);
- if (NULL == pParam) {
- return E_POINTER;
- }
- IDirectMusicTempoTrack *This = impl_from_IDirectMusicTrack8(iface);
- DMUS_PRIVATE_TEMPO_ITEM *item = NULL;
- DMUS_TEMPO_PARAM *prm = param;
- TRACE("(%p, %s, %d, %p, %p)\n", This, debugstr_dmguid(type), time, next, param);
- if (!param)
return E_POINTER;
- if (!IsEqualGUID(type, &GUID_TempoParam))
return DMUS_E_GET_UNSUPPORTED;
- 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 (FAILED(hr)) {
- return hr;
- }
- if (0.123456 == prm->dblTempo)
return DMUS_E_NOT_FOUND;
- if (NULL != pmtNext) *pmtNext = 0;
- 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;
- return S_OK;
} static HRESULT WINAPI tempo_track_SetParam(IDirectMusicTrack8 *iface, REFGUID type, MUSIC_TIME time, diff --git a/dlls/dmime/tests/dmime.c b/dlls/dmime/tests/dmime.c index 3e25328cd8..a35470b4cd 100644 --- a/dlls/dmime/tests/dmime.c +++ b/dlls/dmime/tests/dmime.c @@ -724,6 +724,11 @@ static void test_track(void) DMUS_E_GET_UNSUPPORTED); expect_setparam(dmt, &GUID_TimeSignature, "GUID_TimeSignature", 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 {
2.23.0
- Previous message (by thread): [PATCH 7/9] dmime: Partial implementation of the Tempo track SetParam()
- Next message (by thread): [PATCH 9/9] dmime/tests: Add GetParam/SetParam tests for unsupported types
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]