Module: wine
Branch: master
Commit: 8645d9eb4e97c7347405a51518b6a31b0ac7deef
URL:
https://gitlab.winehq.org/wine/wine/-/commit/8645d9eb4e97c7347405a51518b6a3…
Author: Rémi Bernon <rbernon(a)codeweavers.com>
Date: Wed Sep 6 09:54:12 2023 +0200
dmime: Implement IDirectMusicSegment_SetParam.
---
dlls/dmime/segment.c | 24 ++++++++++++++++++++----
1 file changed, 20 insertions(+), 4 deletions(-)
diff --git a/dlls/dmime/segment.c b/dlls/dmime/segment.c
index a72ec786623..bc52931f667 100644
--- a/dlls/dmime/segment.c
+++ b/dlls/dmime/segment.c
@@ -392,12 +392,28 @@ static HRESULT WINAPI segment_GetParam(IDirectMusicSegment8 *iface,
REFGUID type
return hr;
}
-static HRESULT WINAPI segment_SetParam(IDirectMusicSegment8 *iface, REFGUID rguidType,
- DWORD dwGroupBits, DWORD dwIndex, MUSIC_TIME mtTime, void *pParam)
+static HRESULT WINAPI segment_SetParam(IDirectMusicSegment8 *iface, REFGUID type,
+ DWORD group, DWORD index, MUSIC_TIME music_time, void *param)
{
struct segment *This = impl_from_IDirectMusicSegment8(iface);
- FIXME("(%p, %s, %#lx, %ld, %ld, %p): stub\n", This,
debugstr_dmguid(rguidType), dwGroupBits,
- dwIndex, mtTime, pParam);
+ struct track_entry *entry;
+ HRESULT hr;
+
+ TRACE("(%p, %s, %#lx, %ld, %ld, %p)\n", This, debugstr_dmguid(type),
group,
+ index, music_time, param);
+
+ LIST_FOR_EACH_ENTRY(entry, &This->tracks, struct track_entry, entry)
+ {
+ if (group != -1 && !(group & entry->dwGroupBits)) continue;
+ if (index != DMUS_SEG_ALLTRACKS && index--) continue;
+
+ hr = IDirectMusicTrack_IsParamSupported(entry->pTrack, type);
+ if (hr == DMUS_E_TYPE_UNSUPPORTED) continue;
+
+ hr = IDirectMusicTrack_SetParam(entry->pTrack, type, music_time, param);
+ if (FAILED(hr)) break;
+ }
+
return S_OK;
}