1 /* DirectMusicBand Main
3 * Copyright (C) 2003-2004 Rok Mandeljc
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU Library General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
20 #include "dmband_private.h"
22 WINE_DEFAULT_DEBUG_CHANNEL(dmband
);
26 ICOM_VFIELD(IClassFactory
);
30 /******************************************************************
31 * DirectMusicBand ClassFactory
34 static HRESULT WINAPI
BandCF_QueryInterface(LPCLASSFACTORY iface
,REFIID riid
,LPVOID
*ppobj
) {
35 ICOM_THIS(IClassFactoryImpl
,iface
);
36 FIXME("(%p, %s, %p): stub\n",This
, debugstr_dmguid(riid
), ppobj
);
40 static ULONG WINAPI
BandCF_AddRef(LPCLASSFACTORY iface
) {
41 ICOM_THIS(IClassFactoryImpl
,iface
);
45 static ULONG WINAPI
BandCF_Release(LPCLASSFACTORY iface
) {
46 ICOM_THIS(IClassFactoryImpl
,iface
);
47 /* static class, won't be freed */
51 static HRESULT WINAPI
BandCF_CreateInstance(LPCLASSFACTORY iface
, LPUNKNOWN pOuter
, REFIID riid
, LPVOID
*ppobj
) {
52 ICOM_THIS(IClassFactoryImpl
,iface
);
53 TRACE ("(%p, %p, %s, %p)\n", This
, pOuter
, debugstr_dmguid(riid
), ppobj
);
54 return DMUSIC_CreateDirectMusicBandImpl (riid
, ppobj
, pOuter
);
57 static HRESULT WINAPI
BandCF_LockServer(LPCLASSFACTORY iface
,BOOL dolock
) {
58 ICOM_THIS(IClassFactoryImpl
,iface
);
59 FIXME("(%p, %d): stub\n", This
, dolock
);
63 static ICOM_VTABLE(IClassFactory
) BandCF_Vtbl
= {
64 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
65 BandCF_QueryInterface
,
68 BandCF_CreateInstance
,
72 static IClassFactoryImpl Band_CF
= {&BandCF_Vtbl
, 1 };
75 /******************************************************************
76 * DirectMusicBandTrack ClassFactory
79 static HRESULT WINAPI
BandTrackCF_QueryInterface(LPCLASSFACTORY iface
,REFIID riid
,LPVOID
*ppobj
) {
80 ICOM_THIS(IClassFactoryImpl
,iface
);
82 FIXME("(%p, %s, %p): stub\n", This
, debugstr_dmguid(riid
), ppobj
);
86 static ULONG WINAPI
BandTrackCF_AddRef(LPCLASSFACTORY iface
) {
87 ICOM_THIS(IClassFactoryImpl
,iface
);
91 static ULONG WINAPI
BandTrackCF_Release(LPCLASSFACTORY iface
) {
92 ICOM_THIS(IClassFactoryImpl
,iface
);
93 /* static class, won't be freed */
97 static HRESULT WINAPI
BandTrackCF_CreateInstance(LPCLASSFACTORY iface
, LPUNKNOWN pOuter
, REFIID riid
, LPVOID
*ppobj
) {
98 ICOM_THIS(IClassFactoryImpl
,iface
);
99 TRACE ("(%p, %p, %s, %p)\n", This
, pOuter
, debugstr_dmguid(riid
), ppobj
);
100 return DMUSIC_CreateDirectMusicBandTrack (riid
, ppobj
, pOuter
);
103 static HRESULT WINAPI
BandTrackCF_LockServer(LPCLASSFACTORY iface
,BOOL dolock
) {
104 ICOM_THIS(IClassFactoryImpl
,iface
);
105 FIXME("(%p, %d): stub\n", This
, dolock
);
109 static ICOM_VTABLE(IClassFactory
) BandTrackCF_Vtbl
= {
110 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
111 BandTrackCF_QueryInterface
,
114 BandTrackCF_CreateInstance
,
115 BandTrackCF_LockServer
118 static IClassFactoryImpl BandTrack_CF
= {&BandTrackCF_Vtbl
, 1 };
120 /******************************************************************
125 BOOL WINAPI
DllMain(HINSTANCE hinstDLL
, DWORD fdwReason
, LPVOID lpvReserved
) {
126 if (fdwReason
== DLL_PROCESS_ATTACH
) {
127 DisableThreadLibraryCalls(hinstDLL
);
128 /* FIXME: Initialisation */
129 } else if (fdwReason
== DLL_PROCESS_DETACH
) {
137 /******************************************************************
138 * DllCanUnloadNow (DMBAND.1)
142 HRESULT WINAPI
DMBAND_DllCanUnloadNow(void) {
143 FIXME("(void): stub\n");
148 /******************************************************************
149 * DllGetClassObject (DMBAND.2)
153 HRESULT WINAPI
DMBAND_DllGetClassObject(REFCLSID rclsid
, REFIID riid
, LPVOID
*ppv
) {
154 TRACE("(%s, %s, %p)\n", debugstr_dmguid(rclsid
), debugstr_dmguid(riid
), ppv
);
156 if (IsEqualCLSID (rclsid
, &CLSID_DirectMusicBand
) && IsEqualIID (riid
, &IID_IClassFactory
)) {
157 *ppv
= (LPVOID
) &Band_CF
;
158 IClassFactory_AddRef((IClassFactory
*)*ppv
);
160 } else if (IsEqualCLSID (rclsid
, &CLSID_DirectMusicBandTrack
) && IsEqualIID (riid
, &IID_IClassFactory
)) {
161 *ppv
= (LPVOID
) &BandTrack_CF
;
162 IClassFactory_AddRef((IClassFactory
*)*ppv
);
166 WARN("(%s, %s, %p): no interface found.\n", debugstr_dmguid(rclsid
), debugstr_dmguid(riid
), ppv
);
167 return CLASS_E_CLASSNOTAVAILABLE
;
170 /******************************************************************
175 /* check whether the given DWORD is even (return 0) or odd (return 1) */
176 int even_or_odd (DWORD number
) {
177 return (number
& 0x1); /* basically, check if bit 0 is set ;) */
180 /* FOURCC to string conversion for debug messages */
181 const char *debugstr_fourcc (DWORD fourcc
) {
182 if (!fourcc
) return "'null'";
183 return wine_dbg_sprintf ("\'%c%c%c%c\'",
184 (char)(fourcc
), (char)(fourcc
>> 8),
185 (char)(fourcc
>> 16), (char)(fourcc
>> 24));
188 /* DMUS_VERSION struct to string conversion for debug messages */
189 const char *debugstr_dmversion (LPDMUS_VERSION version
) {
190 if (!version
) return "'null'";
191 return wine_dbg_sprintf ("\'%i,%i,%i,%i\'",
192 (int)((version
->dwVersionMS
&& 0xFFFF0000) >> 8), (int)(version
->dwVersionMS
&& 0x0000FFFF),
193 (int)((version
->dwVersionLS
&& 0xFFFF0000) >> 8), (int)(version
->dwVersionLS
&& 0x0000FFFF));
196 /* returns name of given GUID */
197 const char *debugstr_dmguid (const GUID
*id
) {
199 static const guid_info guids
[] = {
201 GE(CLSID_AudioVBScript
),
202 GE(CLSID_DirectMusic
),
203 GE(CLSID_DirectMusicAudioPath
),
204 GE(CLSID_DirectMusicAudioPathConfig
),
205 GE(CLSID_DirectMusicAuditionTrack
),
206 GE(CLSID_DirectMusicBand
),
207 GE(CLSID_DirectMusicBandTrack
),
208 GE(CLSID_DirectMusicChordMapTrack
),
209 GE(CLSID_DirectMusicChordMap
),
210 GE(CLSID_DirectMusicChordTrack
),
211 GE(CLSID_DirectMusicCollection
),
212 GE(CLSID_DirectMusicCommandTrack
),
213 GE(CLSID_DirectMusicComposer
),
214 GE(CLSID_DirectMusicContainer
),
215 GE(CLSID_DirectMusicGraph
),
216 GE(CLSID_DirectMusicLoader
),
217 GE(CLSID_DirectMusicLyricsTrack
),
218 GE(CLSID_DirectMusicMarkerTrack
),
219 GE(CLSID_DirectMusicMelodyFormulationTrack
),
220 GE(CLSID_DirectMusicMotifTrack
),
221 GE(CLSID_DirectMusicMuteTrack
),
222 GE(CLSID_DirectMusicParamControlTrack
),
223 GE(CLSID_DirectMusicPatternTrack
),
224 GE(CLSID_DirectMusicPerformance
),
225 GE(CLSID_DirectMusicScript
),
226 GE(CLSID_DirectMusicScriptAutoImpSegment
),
227 GE(CLSID_DirectMusicScriptAutoImpPerformance
),
228 GE(CLSID_DirectMusicScriptAutoImpSegmentState
),
229 GE(CLSID_DirectMusicScriptAutoImpAudioPathConfig
),
230 GE(CLSID_DirectMusicScriptAutoImpAudioPath
),
231 GE(CLSID_DirectMusicScriptAutoImpSong
),
232 GE(CLSID_DirectMusicScriptSourceCodeLoader
),
233 GE(CLSID_DirectMusicScriptTrack
),
234 GE(CLSID_DirectMusicSection
),
235 GE(CLSID_DirectMusicSegment
),
236 GE(CLSID_DirectMusicSegmentState
),
237 GE(CLSID_DirectMusicSegmentTriggerTrack
),
238 GE(CLSID_DirectMusicSegTriggerTrack
),
239 GE(CLSID_DirectMusicSeqTrack
),
240 GE(CLSID_DirectMusicSignPostTrack
),
241 GE(CLSID_DirectMusicSong
),
242 GE(CLSID_DirectMusicStyle
),
243 GE(CLSID_DirectMusicStyleTrack
),
244 GE(CLSID_DirectMusicSynth
),
245 GE(CLSID_DirectMusicSynthSink
),
246 GE(CLSID_DirectMusicSysExTrack
),
247 GE(CLSID_DirectMusicTemplate
),
248 GE(CLSID_DirectMusicTempoTrack
),
249 GE(CLSID_DirectMusicTimeSigTrack
),
250 GE(CLSID_DirectMusicWaveTrack
),
251 GE(CLSID_DirectSoundWave
),
253 GE(IID_IDirectMusic
),
254 GE(IID_IDirectMusic2
),
255 GE(IID_IDirectMusic8
),
256 GE(IID_IDirectMusicAudioPath
),
257 GE(IID_IDirectMusicBand
),
258 GE(IID_IDirectMusicBuffer
),
259 GE(IID_IDirectMusicChordMap
),
260 GE(IID_IDirectMusicCollection
),
261 GE(IID_IDirectMusicComposer
),
262 GE(IID_IDirectMusicContainer
),
263 GE(IID_IDirectMusicDownload
),
264 GE(IID_IDirectMusicDownloadedInstrument
),
265 GE(IID_IDirectMusicGetLoader
),
266 GE(IID_IDirectMusicGraph
),
267 GE(IID_IDirectMusicInstrument
),
268 GE(IID_IDirectMusicLoader
),
269 GE(IID_IDirectMusicLoader8
),
270 GE(IID_IDirectMusicObject
),
271 GE(IID_IDirectMusicPatternTrack
),
272 GE(IID_IDirectMusicPerformance
),
273 GE(IID_IDirectMusicPerformance2
),
274 GE(IID_IDirectMusicPerformance8
),
275 GE(IID_IDirectMusicPort
),
276 GE(IID_IDirectMusicPortDownload
),
277 GE(IID_IDirectMusicScript
),
278 GE(IID_IDirectMusicSegment
),
279 GE(IID_IDirectMusicSegment2
),
280 GE(IID_IDirectMusicSegment8
),
281 GE(IID_IDirectMusicSegmentState
),
282 GE(IID_IDirectMusicSegmentState8
),
283 GE(IID_IDirectMusicStyle
),
284 GE(IID_IDirectMusicStyle8
),
285 GE(IID_IDirectMusicSynth
),
286 GE(IID_IDirectMusicSynth8
),
287 GE(IID_IDirectMusicSynthSink
),
288 GE(IID_IDirectMusicThru
),
289 GE(IID_IDirectMusicTool
),
290 GE(IID_IDirectMusicTool8
),
291 GE(IID_IDirectMusicTrack
),
292 GE(IID_IDirectMusicTrack8
),
294 GE(IID_IPersistStream
),
296 GE(IID_IClassFactory
),
298 GE(GUID_DirectMusicAllTypes
),
299 GE(GUID_NOTIFICATION_CHORD
),
300 GE(GUID_NOTIFICATION_COMMAND
),
301 GE(GUID_NOTIFICATION_MEASUREANDBEAT
),
302 GE(GUID_NOTIFICATION_PERFORMANCE
),
303 GE(GUID_NOTIFICATION_RECOMPOSE
),
304 GE(GUID_NOTIFICATION_SEGMENT
),
307 GE(GUID_CommandParam
),
308 GE(GUID_CommandParam2
),
309 GE(GUID_CommandParamNext
),
310 GE(GUID_IDirectMusicBand
),
311 GE(GUID_IDirectMusicChordMap
),
312 GE(GUID_IDirectMusicStyle
),
314 GE(GUID_Play_Marker
),
315 GE(GUID_RhythmParam
),
317 GE(GUID_TimeSignature
),
318 GE(GUID_Valid_Start_Time
),
319 GE(GUID_Clear_All_Bands
),
320 GE(GUID_ConnectToDLSCollection
),
321 GE(GUID_Disable_Auto_Download
),
322 GE(GUID_DisableTempo
),
323 GE(GUID_DisableTimeSig
),
325 GE(GUID_DownloadToAudioPath
),
326 GE(GUID_Enable_Auto_Download
),
327 GE(GUID_EnableTempo
),
328 GE(GUID_EnableTimeSig
),
329 GE(GUID_IgnoreBankSelectForGM
),
330 GE(GUID_SeedVariations
),
331 GE(GUID_StandardMIDIFile
),
333 GE(GUID_UnloadFromAudioPath
),
335 GE(GUID_PerfMasterTempo
),
336 GE(GUID_PerfMasterVolume
),
337 GE(GUID_PerfMasterGrooveLevel
),
338 GE(GUID_PerfAutoDownload
),
339 GE(GUID_DefaultGMCollection
),
340 GE(GUID_Synth_Default
),
341 GE(GUID_Buffer_Reverb
),
342 GE(GUID_Buffer_EnvReverb
),
343 GE(GUID_Buffer_Stereo
),
344 GE(GUID_Buffer_3D_Dry
),
345 GE(GUID_Buffer_Mono
),
346 GE(GUID_DMUS_PROP_GM_Hardware
),
347 GE(GUID_DMUS_PROP_GS_Capable
),
348 GE(GUID_DMUS_PROP_GS_Hardware
),
349 GE(GUID_DMUS_PROP_DLS1
),
350 GE(GUID_DMUS_PROP_DLS2
),
351 GE(GUID_DMUS_PROP_Effects
),
352 GE(GUID_DMUS_PROP_INSTRUMENT2
),
353 GE(GUID_DMUS_PROP_LegacyCaps
),
354 GE(GUID_DMUS_PROP_MemorySize
),
355 GE(GUID_DMUS_PROP_SampleMemorySize
),
356 GE(GUID_DMUS_PROP_SamplePlaybackRate
),
357 GE(GUID_DMUS_PROP_SetSynthSink
),
358 GE(GUID_DMUS_PROP_SinkUsesDSound
),
359 GE(GUID_DMUS_PROP_SynthSink_DSOUND
),
360 GE(GUID_DMUS_PROP_SynthSink_WAVE
),
361 GE(GUID_DMUS_PROP_Volume
),
362 GE(GUID_DMUS_PROP_WavesReverb
),
363 GE(GUID_DMUS_PROP_WriteLatency
),
364 GE(GUID_DMUS_PROP_WritePeriod
),
365 GE(GUID_DMUS_PROP_XG_Capable
),
366 GE(GUID_DMUS_PROP_XG_Hardware
)
371 if (!id
) return "(null)";
373 for (i
= 0; i
< sizeof(guids
)/sizeof(guids
[0]); i
++) {
374 if (IsEqualGUID(id
, &guids
[i
].guid
))
375 return guids
[i
].name
;
377 /* if we didn't find it, act like standard debugstr_guid */
378 return debugstr_guid(id
);
381 /* returns name of given error code */
382 const char *debugstr_dmreturn (DWORD code
) {
383 static const flag_info codes
[] = {
386 FE(DMUS_S_PARTIALLOAD
),
387 FE(DMUS_S_PARTIALDOWNLOAD
),
391 FE(DMUS_S_STRING_TRUNCATED
),
392 FE(DMUS_S_LAST_TOOL
),
393 FE(DMUS_S_OVER_CHORD
),
394 FE(DMUS_S_UP_OCTAVE
),
395 FE(DMUS_S_DOWN_OCTAVE
),
396 FE(DMUS_S_NOBUFFERCONTROL
),
397 FE(DMUS_S_GARBAGE_COLLECTED
),
398 FE(DMUS_E_DRIVER_FAILED
),
399 FE(DMUS_E_PORTS_OPEN
),
400 FE(DMUS_E_DEVICE_IN_USE
),
401 FE(DMUS_E_INSUFFICIENTBUFFER
),
402 FE(DMUS_E_BUFFERNOTSET
),
403 FE(DMUS_E_BUFFERNOTAVAILABLE
),
404 FE(DMUS_E_NOTADLSCOL
),
405 FE(DMUS_E_INVALIDOFFSET
),
406 FE(DMUS_E_ALREADY_LOADED
),
407 FE(DMUS_E_INVALIDPOS
),
408 FE(DMUS_E_INVALIDPATCH
),
409 FE(DMUS_E_CANNOTSEEK
),
410 FE(DMUS_E_CANNOTWRITE
),
411 FE(DMUS_E_CHUNKNOTFOUND
),
412 FE(DMUS_E_INVALID_DOWNLOADID
),
413 FE(DMUS_E_NOT_DOWNLOADED_TO_PORT
),
414 FE(DMUS_E_ALREADY_DOWNLOADED
),
415 FE(DMUS_E_UNKNOWN_PROPERTY
),
416 FE(DMUS_E_SET_UNSUPPORTED
),
417 FE(DMUS_E_GET_UNSUPPORTED
),
419 FE(DMUS_E_BADARTICULATION
),
420 FE(DMUS_E_BADINSTRUMENT
),
421 FE(DMUS_E_BADWAVELINK
),
422 FE(DMUS_E_NOARTICULATION
),
425 FE(DMUS_E_BADOFFSETTABLE
),
426 FE(DMUS_E_UNKNOWNDOWNLOAD
),
427 FE(DMUS_E_NOSYNTHSINK
),
428 FE(DMUS_E_ALREADYOPEN
),
429 FE(DMUS_E_ALREADYCLOSED
),
430 FE(DMUS_E_SYNTHNOTCONFIGURED
),
431 FE(DMUS_E_SYNTHACTIVE
),
432 FE(DMUS_E_CANNOTREAD
),
433 FE(DMUS_E_DMUSIC_RELEASED
),
434 FE(DMUS_E_BUFFER_EMPTY
),
435 FE(DMUS_E_BUFFER_FULL
),
436 FE(DMUS_E_PORT_NOT_CAPTURE
),
437 FE(DMUS_E_PORT_NOT_RENDER
),
438 FE(DMUS_E_DSOUND_NOT_SET
),
439 FE(DMUS_E_ALREADY_ACTIVATED
),
440 FE(DMUS_E_INVALIDBUFFER
),
441 FE(DMUS_E_WAVEFORMATNOTSUPPORTED
),
442 FE(DMUS_E_SYNTHINACTIVE
),
443 FE(DMUS_E_DSOUND_ALREADY_SET
),
444 FE(DMUS_E_INVALID_EVENT
),
445 FE(DMUS_E_UNSUPPORTED_STREAM
),
446 FE(DMUS_E_ALREADY_INITED
),
447 FE(DMUS_E_INVALID_BAND
),
448 FE(DMUS_E_TRACK_HDR_NOT_FIRST_CK
),
449 FE(DMUS_E_TOOL_HDR_NOT_FIRST_CK
),
450 FE(DMUS_E_INVALID_TRACK_HDR
),
451 FE(DMUS_E_INVALID_TOOL_HDR
),
452 FE(DMUS_E_ALL_TOOLS_FAILED
),
453 FE(DMUS_E_ALL_TRACKS_FAILED
),
454 FE(DMUS_E_NOT_FOUND
),
456 FE(DMUS_E_TYPE_DISABLED
),
457 FE(DMUS_E_TYPE_UNSUPPORTED
),
458 FE(DMUS_E_TIME_PAST
),
459 FE(DMUS_E_TRACK_NOT_FOUND
),
460 FE(DMUS_E_TRACK_NO_CLOCKTIME_SUPPORT
),
461 FE(DMUS_E_NO_MASTER_CLOCK
),
462 FE(DMUS_E_LOADER_NOCLASSID
),
463 FE(DMUS_E_LOADER_BADPATH
),
464 FE(DMUS_E_LOADER_FAILEDOPEN
),
465 FE(DMUS_E_LOADER_FORMATNOTSUPPORTED
),
466 FE(DMUS_E_LOADER_FAILEDCREATE
),
467 FE(DMUS_E_LOADER_OBJECTNOTFOUND
),
468 FE(DMUS_E_LOADER_NOFILENAME
),
469 FE(DMUS_E_INVALIDFILE
),
470 FE(DMUS_E_ALREADY_EXISTS
),
471 FE(DMUS_E_OUT_OF_RANGE
),
472 FE(DMUS_E_SEGMENT_INIT_FAILED
),
473 FE(DMUS_E_ALREADY_SENT
),
474 FE(DMUS_E_CANNOT_FREE
),
475 FE(DMUS_E_CANNOT_OPEN_PORT
),
476 FE(DMUS_E_CANNOT_CONVERT
),
477 FE(DMUS_E_DESCEND_CHUNK_FAIL
),
478 FE(DMUS_E_NOT_LOADED
),
479 FE(DMUS_E_SCRIPT_LANGUAGE_INCOMPATIBLE
),
480 FE(DMUS_E_SCRIPT_UNSUPPORTED_VARTYPE
),
481 FE(DMUS_E_SCRIPT_ERROR_IN_SCRIPT
),
482 FE(DMUS_E_SCRIPT_CANTLOAD_OLEAUT32
),
483 FE(DMUS_E_SCRIPT_LOADSCRIPT_ERROR
),
484 FE(DMUS_E_SCRIPT_INVALID_FILE
),
485 FE(DMUS_E_INVALID_SCRIPTTRACK
),
486 FE(DMUS_E_SCRIPT_VARIABLE_NOT_FOUND
),
487 FE(DMUS_E_SCRIPT_ROUTINE_NOT_FOUND
),
488 FE(DMUS_E_SCRIPT_CONTENT_READONLY
),
489 FE(DMUS_E_SCRIPT_NOT_A_REFERENCE
),
490 FE(DMUS_E_SCRIPT_VALUE_NOT_SUPPORTED
),
491 FE(DMUS_E_INVALID_SEGMENTTRIGGERTRACK
),
492 FE(DMUS_E_INVALID_LYRICSTRACK
),
493 FE(DMUS_E_INVALID_PARAMCONTROLTRACK
),
494 FE(DMUS_E_AUDIOVBSCRIPT_SYNTAXERROR
),
495 FE(DMUS_E_AUDIOVBSCRIPT_RUNTIMEERROR
),
496 FE(DMUS_E_AUDIOVBSCRIPT_OPERATIONFAILURE
),
497 FE(DMUS_E_AUDIOPATHS_NOT_VALID
),
498 FE(DMUS_E_AUDIOPATHS_IN_USE
),
499 FE(DMUS_E_NO_AUDIOPATH_CONFIG
),
500 FE(DMUS_E_AUDIOPATH_INACTIVE
),
501 FE(DMUS_E_AUDIOPATH_NOBUFFER
),
502 FE(DMUS_E_AUDIOPATH_NOPORT
),
503 FE(DMUS_E_NO_AUDIOPATH
),
504 FE(DMUS_E_INVALIDCHUNK
),
505 FE(DMUS_E_AUDIOPATH_NOGLOBALFXBUFFER
),
506 FE(DMUS_E_INVALID_CONTAINER_OBJECT
)
509 for (i
= 0; i
< sizeof(codes
)/sizeof(codes
[0]); i
++) {
510 if (code
== codes
[i
].val
)
511 return codes
[i
].name
;
513 /* if we didn't find it, return value */
514 return wine_dbg_sprintf("0x%08lx", code
);
517 /* generic flag-dumping function */
518 const char* debugstr_flags (DWORD flags
, const flag_info
* names
, size_t num_names
){
519 char buffer
[128] = "", *ptr
= &buffer
[0];
520 unsigned int i
, size
= sizeof(buffer
);
522 for (i
=0; i
< num_names
; i
++)
524 if ((flags
& names
[i
].val
) || /* standard flag*/
525 ((!flags
) && (!names
[i
].val
))) { /* zero value only */
526 int cnt
= snprintf(ptr
, size
, "%s ", names
[i
].name
);
527 if (cnt
< 0 || cnt
>= size
) break;
533 return wine_dbg_sprintf("%s", buffer
);
536 /* dump DMUS_OBJ flags */
537 const char *debugstr_DMUS_OBJ_FLAGS (DWORD flagmask
) {
538 static const flag_info flags
[] = {
542 FE(DMUS_OBJ_CATEGORY
),
543 FE(DMUS_OBJ_FILENAME
),
544 FE(DMUS_OBJ_FULLPATH
),
546 FE(DMUS_OBJ_VERSION
),
552 return debugstr_flags (flagmask
, flags
, sizeof(flags
)/sizeof(flags
[0]));
555 /* dump whole DMUS_OBJECTDESC struct */
556 const char *debugstr_DMUS_OBJECTDESC (LPDMUS_OBJECTDESC pDesc
) {
558 char buffer
[1024] = "", *ptr
= &buffer
[0];
560 ptr
+= sprintf(ptr
, "DMUS_OBJECTDESC (%p):\n", pDesc
);
561 ptr
+= sprintf(ptr
, " - dwSize = %ld\n", pDesc
->dwSize
);
562 ptr
+= sprintf(ptr
, " - dwValidData = %s\n", debugstr_DMUS_OBJ_FLAGS (pDesc
->dwValidData
));
563 if (pDesc
->dwValidData
& DMUS_OBJ_CLASS
) ptr
+= sprintf(ptr
, " - guidClass = %s\n", debugstr_dmguid(&pDesc
->guidClass
));
564 if (pDesc
->dwValidData
& DMUS_OBJ_OBJECT
) ptr
+= sprintf(ptr
, " - guidObject = %s\n", debugstr_guid(&pDesc
->guidObject
));
565 if (pDesc
->dwValidData
& DMUS_OBJ_DATE
) ptr
+= sprintf(ptr
, " - ftDate = FIXME\n");
566 if (pDesc
->dwValidData
& DMUS_OBJ_VERSION
) ptr
+= sprintf(ptr
, " - vVersion = %s\n", debugstr_dmversion(&pDesc
->vVersion
));
567 if (pDesc
->dwValidData
& DMUS_OBJ_NAME
) ptr
+= sprintf(ptr
, " - wszName = %s\n", debugstr_w(pDesc
->wszName
));
568 if (pDesc
->dwValidData
& DMUS_OBJ_CATEGORY
) ptr
+= sprintf(ptr
, " - wszCategory = %s\n", debugstr_w(pDesc
->wszCategory
));
569 if (pDesc
->dwValidData
& DMUS_OBJ_FILENAME
) ptr
+= sprintf(ptr
, " - wszFileName = %s\n", debugstr_w(pDesc
->wszFileName
));
570 if (pDesc
->dwValidData
& DMUS_OBJ_MEMORY
) ptr
+= sprintf(ptr
, " - llMemLength = %lli\n - pbMemData = %p\n", pDesc
->llMemLength
, pDesc
->pbMemData
);
571 if (pDesc
->dwValidData
& DMUS_OBJ_STREAM
) ptr
+= sprintf(ptr
, " - pStream = %p", pDesc
->pStream
);
573 return wine_dbg_sprintf("%s", buffer
);
575 return wine_dbg_sprintf("(NULL)");