From 7776591ff43e9a98f1d3d6412ffe3e282670d894 Mon Sep 17 00:00:00 2001 From: Christian Costa Date: Tue, 10 Apr 2012 22:30:29 +0200 Subject: [PATCH] dmusic: Add dump function for DMUS_PORTPARAMS struct. --- dlls/dmusic/dmusic.c | 3 +++ dlls/dmusic/dmusic_main.c | 28 ++++++++++++++++++++++++++++ dlls/dmusic/dmusic_private.h | 2 ++ 3 files changed, 33 insertions(+) diff --git a/dlls/dmusic/dmusic.c b/dlls/dmusic/dmusic.c index ef3143fb848..eab37700934 100644 --- a/dlls/dmusic/dmusic.c +++ b/dlls/dmusic/dmusic.c @@ -178,6 +178,9 @@ static HRESULT WINAPI IDirectMusic8Impl_CreatePort (LPDIRECTMUSIC8 iface, REFCLS TRACE("(%p, %s, %p, %p, %p)\n", This, debugstr_dmguid(rclsidPort), pPortParams, ppPort, pUnkOuter); + if (TRACE_ON(dmusic)) + dump_DMUS_PORTPARAMS(pPortParams); + if(!rclsidPort) return E_POINTER; diff --git a/dlls/dmusic/dmusic_main.c b/dlls/dmusic/dmusic_main.c index be6fb566394..66080a7b874 100644 --- a/dlls/dmusic/dmusic_main.c +++ b/dlls/dmusic/dmusic_main.c @@ -463,3 +463,31 @@ void dump_DMUS_OBJECTDESC(LPDMUS_OBJECTDESC desc) wine_dbgstr_longlong(desc->llMemLength), desc->pbMemData); if (desc->dwValidData & DMUS_OBJ_STREAM) TRACE(" - pStream = %p\n", desc->pStream); } + +/* Dump DMUS_PORTPARAMS flags */ +static const char* debugstr_DMUS_PORTPARAMS_FLAGS(DWORD flagmask) +{ + static const flag_info flags[] = { + FE(DMUS_PORTPARAMS_VOICES), + FE(DMUS_PORTPARAMS_CHANNELGROUPS), + FE(DMUS_PORTPARAMS_AUDIOCHANNELS), + FE(DMUS_PORTPARAMS_SAMPLERATE), + FE(DMUS_PORTPARAMS_EFFECTS), + FE(DMUS_PORTPARAMS_SHARE) + }; + return debugstr_flags(flagmask, flags, sizeof(flags)/sizeof(flags[0])); +} + +/* Dump whole DMUS_PORTPARAMS struct */ +void dump_DMUS_PORTPARAMS(LPDMUS_PORTPARAMS params) +{ + TRACE("DMUS_PORTPARAMS (%p):\n", params); + TRACE(" - dwSize = %d\n", params->dwSize); + TRACE(" - dwValidParams = %s\n", debugstr_DMUS_PORTPARAMS_FLAGS(params->dwValidParams)); + if (params->dwValidParams & DMUS_PORTPARAMS_VOICES) TRACE(" - dwVoices = %u\n", params->dwVoices); + if (params->dwValidParams & DMUS_PORTPARAMS_CHANNELGROUPS) TRACE(" - dwChannelGroup = %u\n", params->dwChannelGroups); + if (params->dwValidParams & DMUS_PORTPARAMS_AUDIOCHANNELS) TRACE(" - dwAudioChannels = %u\n", params->dwAudioChannels); + if (params->dwValidParams & DMUS_PORTPARAMS_SAMPLERATE) TRACE(" - dwSampleRate = %u\n", params->dwSampleRate); + if (params->dwValidParams & DMUS_PORTPARAMS_EFFECTS) TRACE(" - dwEffectFlags = %x\n", params->dwEffectFlags); + if (params->dwValidParams & DMUS_PORTPARAMS_SHARE) TRACE(" - fShare = %u\n", params->fShare); +} diff --git a/dlls/dmusic/dmusic_private.h b/dlls/dmusic/dmusic_private.h index 498df9ef660..cffea346d2f 100644 --- a/dlls/dmusic/dmusic_private.h +++ b/dlls/dmusic/dmusic_private.h @@ -276,5 +276,7 @@ extern const char *debugstr_fourcc (DWORD fourcc) DECLSPEC_HIDDEN; extern const char *debugstr_dmguid (const GUID *id) DECLSPEC_HIDDEN; /* Dump whole DMUS_OBJECTDESC struct */ extern void dump_DMUS_OBJECTDESC(LPDMUS_OBJECTDESC desc) DECLSPEC_HIDDEN; +/* Dump whole DMUS_PORTPARAMS struct */ +extern void dump_DMUS_PORTPARAMS(LPDMUS_PORTPARAMS params) DECLSPEC_HIDDEN; #endif /* __WINE_DMUSIC_PRIVATE_H */