Commit 274427aa authored by Michael Stefaniuc's avatar Michael Stefaniuc Committed by Alexandre Julliard

dmstyle: Implement IsParamSupported() for the Audition track.

parent de11d172
......@@ -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 GUID *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,
......
......@@ -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",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment