Michael Stefaniuc : dmime: Implement the SegTrigger track Get/SetParam.

Alexandre Julliard julliard at winehq.org
Wed Dec 4 16:13:03 CST 2019


Module: wine
Branch: master
Commit: d08bce15bcb6cd9d04a8f77170252b9f735aff42
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=d08bce15bcb6cd9d04a8f77170252b9f735aff42

Author: Michael Stefaniuc <mstefani at winehq.org>
Date:   Tue Dec  3 23:51:20 2019 +0100

dmime: Implement the SegTrigger track Get/SetParam.

Signed-off-by: Michael Stefaniuc <mstefani at winehq.org>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/dmime/segtriggertrack.c | 23 ++++++++++++-----------
 dlls/dmime/tests/dmime.c     | 29 +++++++++++++++++++++++++++--
 2 files changed, 39 insertions(+), 13 deletions(-)

diff --git a/dlls/dmime/segtriggertrack.c b/dlls/dmime/segtriggertrack.c
index 7e1d75aa05..d36412cfc3 100644
--- a/dlls/dmime/segtriggertrack.c
+++ b/dlls/dmime/segtriggertrack.c
@@ -134,20 +134,22 @@ 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;
+    IDirectMusicSegTriggerTrack *This = impl_from_IDirectMusicTrack8(iface);
+
+    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);
-	return S_OK;
+    IDirectMusicSegTriggerTrack *This = impl_from_IDirectMusicTrack8(iface);
+
+    TRACE("(%p, %s, %d, %p): not supported\n", This, debugstr_dmguid(type), time, param);
+    return S_OK;
 }
 
 static HRESULT WINAPI segment_track_IsParamSupported(IDirectMusicTrack8 *iface, REFGUID type)
@@ -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;
 }
 
diff --git a/dlls/dmime/tests/dmime.c b/dlls/dmime/tests/dmime.c
index f561eb391e..0f4c43700c 100644
--- a/dlls/dmime/tests/dmime.c
+++ b/dlls/dmime/tests/dmime.c
@@ -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);




More information about the wine-cvs mailing list