Module: wine Branch: master Commit: 63661495b4256a115eaf0f144fc986f1252cbd66 URL: https://gitlab.winehq.org/wine/wine/-/commit/63661495b4256a115eaf0f144fc986f...
Author: Rémi Bernon rbernon@codeweavers.com Date: Tue Oct 24 14:54:23 2023 +0200
dmime: Support start_time and end_time Play parameters.
---
dlls/dmime/seqtrack.c | 8 ++++++-- dlls/dmime/wavetrack.c | 11 ++++++----- 2 files changed, 12 insertions(+), 7 deletions(-)
diff --git a/dlls/dmime/seqtrack.c b/dlls/dmime/seqtrack.c index 56c61c02576..3252580afb6 100644 --- a/dlls/dmime/seqtrack.c +++ b/dlls/dmime/seqtrack.c @@ -120,8 +120,6 @@ static HRESULT WINAPI sequence_track_Play(IDirectMusicTrack8 *iface, void *state TRACE("(%p, %p, %ld, %ld, %ld, %#lx, %p, %p, %ld)\n", This, state_data, start_time, end_time, time_offset, segment_flags, performance, segment_state, track_id);
- if (start_time != 0) FIXME("start_time %ld not implemented\n", start_time); - if (end_time != -1) FIXME("end_time %ld not implemented\n", end_time); if (segment_flags) FIXME("segment_flags %#lx not implemented\n", segment_flags); if (segment_state) FIXME("segment_state %p not implemented\n", segment_state);
@@ -134,6 +132,9 @@ static HRESULT WINAPI sequence_track_Play(IDirectMusicTrack8 *iface, void *state DMUS_IO_SEQ_ITEM *item = This->items + i; DMUS_NOTE_PMSG *msg;
+ if (item->mtTime < start_time) continue; + if (item->mtTime >= end_time) continue; + if (FAILED(hr = IDirectMusicPerformance_AllocPMsg(performance, sizeof(*msg), (DMUS_PMSG **)&msg))) break; @@ -164,6 +165,9 @@ static HRESULT WINAPI sequence_track_Play(IDirectMusicTrack8 *iface, void *state DMUS_IO_CURVE_ITEM *item = This->curve_items + i; DMUS_CURVE_PMSG *msg;
+ if (item->mtStart < start_time) continue; + if (item->mtStart >= end_time) continue; + if (FAILED(hr = IDirectMusicPerformance_AllocPMsg(performance, sizeof(*msg), (DMUS_PMSG **)&msg))) break; diff --git a/dlls/dmime/wavetrack.c b/dlls/dmime/wavetrack.c index 974e656cfe5..7f2fe4a8e5f 100644 --- a/dlls/dmime/wavetrack.c +++ b/dlls/dmime/wavetrack.c @@ -144,7 +144,7 @@ static HRESULT WINAPI wave_track_EndPlay(IDirectMusicTrack8 *iface, void *pState }
static HRESULT WINAPI wave_track_Play(IDirectMusicTrack8 *iface, void *state_data, - MUSIC_TIME start_time, MUSIC_TIME end_time, MUSIC_TIME time_offset, DWORD segment_flags, + MUSIC_TIME start_time, MUSIC_TIME end_time, MUSIC_TIME time_offset, DWORD track_flags, IDirectMusicPerformance *performance, IDirectMusicSegmentState *segment_state, DWORD track_id) { struct wave_track *This = impl_from_IDirectMusicTrack8(iface); @@ -155,12 +155,11 @@ static HRESULT WINAPI wave_track_Play(IDirectMusicTrack8 *iface, void *state_dat HRESULT hr;
TRACE("(%p, %p, %ld, %ld, %ld, %#lx, %p, %p, %ld)\n", This, state_data, start_time, end_time, - time_offset, segment_flags, performance, segment_state, track_id); + time_offset, track_flags, performance, segment_state, track_id);
- if (start_time != 0) FIXME("start_time %ld not implemented\n", start_time); - if (end_time != -1) FIXME("end_time %ld not implemented\n", end_time); - if (segment_flags) FIXME("segment_flags %#lx not implemented\n", segment_flags); + if (track_flags) FIXME("track_flags %#lx not implemented\n", track_flags); if (segment_state) FIXME("segment_state %p not implemented\n", segment_state); + if (!(track_flags & DMUS_TRACKF_START)) return S_OK;
if (FAILED(hr = IDirectMusicPerformance_QueryInterface(performance, &IID_IDirectMusicGraph, (void **)&graph))) @@ -175,6 +174,8 @@ static HRESULT WINAPI wave_track_Play(IDirectMusicTrack8 *iface, void *state_dat DMUS_WAVE_PMSG *msg;
if (!item->buffer) continue; + if (item->header.rtTime < start_time) continue; + if (item->header.rtTime >= end_time) continue;
if (FAILED(hr = IDirectMusicPerformance_AllocPMsg(performance, sizeof(*msg), (DMUS_PMSG **)&msg)))