[PATCH] dmstyle: Implement IsParamSupported() for the Audition track

Michael Stefaniuc mstefani at winehq.org
Tue Nov 19 14:02:52 CST 2019


Signed-off-by: Michael Stefaniuc <mstefani at winehq.org>
---
 dlls/dmstyle/auditiontrack.c | 28 ++++++++++++++++++++--------
 dlls/dmstyle/tests/dmstyle.c | 20 +++++++++-----------
 2 files changed, 29 insertions(+), 19 deletions(-)

diff --git a/dlls/dmstyle/auditiontrack.c b/dlls/dmstyle/auditiontrack.c
index 7555da0c6c..ae455893b5 100644
--- a/dlls/dmstyle/auditiontrack.c
+++ b/dlls/dmstyle/auditiontrack.c
@@ -137,18 +137,30 @@ static HRESULT WINAPI audition_track_SetParam(IDirectMusicTrack8 *iface, REFGUID
 	return S_OK;
 }
 
-static HRESULT WINAPI audition_track_IsParamSupported(IDirectMusicTrack8 *iface, REFGUID rguidType)
+static HRESULT WINAPI audition_track_IsParamSupported(IDirectMusicTrack8 *iface, REFGUID type)
 {
-        IDirectMusicAuditionTrack *This = impl_from_IDirectMusicTrack8(iface);
+    IDirectMusicAuditionTrack *This = impl_from_IDirectMusicTrack8(iface);
+    static const REFGUID valid[] = {
+        &GUID_DisableTimeSig,
+        &GUID_EnableTimeSig,
+        &GUID_SeedVariations,
+        &GUID_Valid_Start_Time,
+        &GUID_Variations
+    };
+    unsigned int i;
+
 
-	TRACE("(%p, %s)\n", This, debugstr_dmguid(rguidType));
+    TRACE("(%p, %s)\n", This, debugstr_dmguid(type));
+
+    if (!type)
+        return E_POINTER;
 
-        if (!rguidType)
-                return E_POINTER;
+    for (i = 0; i < ARRAY_SIZE(valid); i++)
+        if (IsEqualGUID(type, valid[i]))
+            return S_OK;
 
-	/* didn't find any params */
-	TRACE("param unsupported\n");
-	return DMUS_E_TYPE_UNSUPPORTED;
+    TRACE("param unsupported\n");
+    return DMUS_E_TYPE_UNSUPPORTED;
 }
 
 static HRESULT WINAPI audition_track_AddNotificationType(IDirectMusicTrack8 *iface,
diff --git a/dlls/dmstyle/tests/dmstyle.c b/dlls/dmstyle/tests/dmstyle.c
index 6419f6f810..a63d1dbd1c 100644
--- a/dlls/dmstyle/tests/dmstyle.c
+++ b/dlls/dmstyle/tests/dmstyle.c
@@ -286,16 +286,15 @@ static void test_track(void)
         const char *name;
         BOOL has_save;
         BOOL has_join;
-        /* bitfields with supported param types */
+        /* bitfield with supported param types */
         unsigned int has_params;
-        unsigned int todo_params;
     } class[] = {
-        { X(DirectMusicAuditionTrack), TRUE, FALSE, 0x18204200, 0x18204200 },
-        { X(DirectMusicChordTrack), TRUE, TRUE, 0x100002, 0 },
-        { X(DirectMusicCommandTrack), TRUE, TRUE, 0x38, 0 },
-        { X(DirectMusicMotifTrack), FALSE, FALSE, 0x8204200, 0 },
-        { X(DirectMusicMuteTrack), TRUE, FALSE, 0x40000, 0 },
-        { X(DirectMusicStyleTrack), FALSE, TRUE, 0x1224200, 0 },
+        { X(DirectMusicAuditionTrack), TRUE, FALSE, 0x18204200 },
+        { X(DirectMusicChordTrack), TRUE, TRUE, 0x100002 },
+        { X(DirectMusicCommandTrack), TRUE, TRUE, 0x38 },
+        { X(DirectMusicMotifTrack), FALSE, FALSE, 0x8204200 },
+        { X(DirectMusicMuteTrack), TRUE, FALSE, 0x40000 },
+        { X(DirectMusicStyleTrack), FALSE, TRUE, 0x1224200 },
     };
 #undef X
     unsigned int i, j;
@@ -329,9 +328,8 @@ static void test_track(void)
         for (j = 0; j < ARRAY_SIZE(param_types); j++) {
             hr = IDirectMusicTrack8_IsParamSupported(dmt8, param_types[j].type);
             if (class[i].has_params & (1 << j))
-                todo_wine_if(class[i].todo_params & (1 << j))
-                    ok(hr == S_OK, "IsParamSupported(%s) failed: %08x, expected S_OK\n",
-                            param_types[j].name, hr);
+                ok(hr == S_OK, "IsParamSupported(%s) failed: %08x, expected S_OK\n",
+                        param_types[j].name, hr);
             else
                 ok(hr == DMUS_E_TYPE_UNSUPPORTED,
                         "IsParamSupported(%s) failed: %08x, expected DMUS_E_TYPE_UNSUPPORTED\n",
-- 
2.20.1




More information about the wine-devel mailing list