1 /* IDirectMusic Implementation
2 * IDirectMusic8 Implementation
3 * IDirectMusicDownload Implementation
4 * IDirectMusicBuffer Implementation
5 * IDirectMusicObject Implementation
7 * Copyright (C) 2003 Rok Mandeljc
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU Library General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
36 #include "wine/windef16.h"
37 #include "wine/winbase16.h"
38 #include "wine/debug.h"
41 #include "dmusic_private.h"
43 WINE_DEFAULT_DEBUG_CHANNEL(dmusic
);
45 /* IDirectMusic IUnknown parts follow: */
46 HRESULT WINAPI
IDirectMusicImpl_QueryInterface (LPDIRECTMUSIC iface
, REFIID riid
, LPVOID
*ppobj
)
48 ICOM_THIS(IDirectMusicImpl
,iface
);
50 if (IsEqualGUID(riid
, &IID_IUnknown
) || IsEqualGUID(riid
, &IID_IDirectMusic
))
52 IDirectMusicImpl_AddRef(iface
);
57 WARN("(%p)->(%s,%p),not found\n",This
,debugstr_guid(riid
),ppobj
);
61 ULONG WINAPI
IDirectMusicImpl_AddRef (LPDIRECTMUSIC iface
)
63 ICOM_THIS(IDirectMusicImpl
,iface
);
64 TRACE("(%p) : AddRef from %ld\n", This
, This
->ref
);
68 ULONG WINAPI
IDirectMusicImpl_Release (LPDIRECTMUSIC iface
)
70 ICOM_THIS(IDirectMusicImpl
,iface
);
71 ULONG ref
= --This
->ref
;
72 TRACE("(%p) : ReleaseRef to %ld\n", This
, This
->ref
);
75 HeapFree(GetProcessHeap(), 0, This
);
80 /* IDirectMusic Interface follow: */
81 HRESULT WINAPI
IDirectMusicImpl_EnumPort (LPDIRECTMUSIC iface
, DWORD dwIndex
, LPDMUS_PORTCAPS pPortCaps
)
83 ICOM_THIS(IDirectMusicImpl
,iface
);
84 int numMIDI
= midiOutGetNumDevs();
85 int numWAVE
= waveOutGetNumDevs();
88 TRACE("(%p, %ld, %p)\n", This
, dwIndex
, pPortCaps
);
89 TRACE("1 software synth. + %i WAVE + %i MIDI available\n", numWAVE
, numMIDI
);
90 /* i guess the first port shown is always software synthesizer */
93 TRACE("enumerating 'Microsoft Software Synthesizer' port\n");
94 pPortCaps
->dwSize
= sizeof(DMUS_PORTCAPS
);
95 pPortCaps
->dwFlags
= DMUS_PC_DLS
| DMUS_PC_SOFTWARESYNTH
| DMUS_PC_DIRECTSOUND
| DMUS_PC_DLS2
| DMUS_PC_AUDIOPATH
| DMUS_PC_WAVE
;
96 pPortCaps
->guidPort
= CLSID_DirectMusicSynth
;
97 pPortCaps
->dwClass
= DMUS_PC_OUTPUTCLASS
;
98 pPortCaps
->dwType
= DMUS_PORT_WINMM_DRIVER
;
99 pPortCaps
->dwMemorySize
= DMUS_PC_SYSTEMMEMORY
;
100 pPortCaps
->dwMaxChannelGroups
= 1000;
101 pPortCaps
->dwMaxVoices
= 1000;
102 pPortCaps
->dwMaxAudioChannels
= -1;
103 pPortCaps
->dwEffectFlags
= DMUS_EFFECT_REVERB
| DMUS_EFFECT_CHORUS
| DMUS_EFFECT_DELAY
;
104 MultiByteToWideChar (CP_ACP
, 0, "Microsotf Synthesizer", -1, pPortCaps
->wszDescription
, sizeof(pPortCaps
->wszDescription
)/sizeof(WCHAR
));
107 /* then return digital sound ports */
108 for (i
= 1; i
<= numWAVE
; i
++)
110 TRACE("enumerating 'digital sound' ports\n");
113 DirectSoundEnumerateA((LPDSENUMCALLBACKA
)register_waveport
, (VOID
*)pPortCaps
);
117 /* finally, list all *real* MIDI ports*/
118 for (i
= numWAVE
+1; i
<= numWAVE
+ numMIDI
; i
++)
120 TRACE("enumerating 'real MIDI' ports\n");
122 FIXME("Found MIDI port, but *real* MIDI ports not supported yet\n");
128 HRESULT WINAPI
IDirectMusicImpl_CreateMusicBuffer (LPDIRECTMUSIC iface
, LPDMUS_BUFFERDESC pBufferDesc
, LPDIRECTMUSICBUFFER
** ppBuffer
, LPUNKNOWN pUnkOuter
)
134 HRESULT WINAPI
IDirectMusicImpl_CreatePort (LPDIRECTMUSIC iface
, REFCLSID rclsidPort
, LPDMUS_PORTPARAMS pPortParams
, LPDIRECTMUSICPORT
* ppPort
, LPUNKNOWN pUnkOuter
)
136 ICOM_THIS(IDirectMusicImpl
,iface
);
138 DMUS_PORTCAPS PortCaps
;
140 TRACE("(%p, %s, %p, %p, %p)\n", This
, debugstr_guid(rclsidPort
), pPortParams
, ppPort
, pUnkOuter
);
141 for (i
= 0; IDirectMusicImpl_EnumPort (iface
, i
, &PortCaps
) != S_FALSE
; i
++)
143 if (IsEqualGUID(rclsidPort
, &PortCaps
.guidPort
))
145 This
->ports
= HeapReAlloc(GetProcessHeap(),0,This
->ports
,sizeof(LPDIRECTMUSICPORT
)*This
->nrofports
);
146 if (NULL
== This
->ports
[This
->nrofports
])
148 *ppPort
= (LPDIRECTMUSICPORT
)NULL
;
149 return E_OUTOFMEMORY
;
151 This
->ports
[This
->nrofports
]->lpVtbl
= &DirectMusicPort_Vtbl
;
152 This
->ports
[This
->nrofports
]->ref
= 0;
153 This
->ports
[This
->nrofports
]->active
= FALSE
;
154 This
->ports
[This
->nrofports
]->caps
= &PortCaps
;
155 This
->ports
[This
->nrofports
]->params
= pPortParams
;
156 *ppPort
= (LPDIRECTMUSICPORT
)This
->ports
[This
->nrofports
];
157 IDirectMusicPortImpl_AddRef ((LPDIRECTMUSICPORT
)This
->ports
[This
->nrofports
]);
162 /* FIXME: place correct error here */
163 return E_NOINTERFACE
;
166 HRESULT WINAPI
IDirectMusicImpl_EnumMasterClock (LPDIRECTMUSIC iface
, DWORD dwIndex
, LPDMUS_CLOCKINFO lpClockInfo
)
168 ICOM_THIS(IDirectMusicImpl
,iface
);
170 FIXME("(%p, %ld, %p): stub\n", This
, dwIndex
, lpClockInfo
);
175 HRESULT WINAPI
IDirectMusicImpl_GetMasterClock (LPDIRECTMUSIC iface
, LPGUID pguidClock
, IReferenceClock
** ppReferenceClock
)
177 ICOM_THIS(IDirectMusicImpl
,iface
);
179 FIXME("(%p, %s, %p): stub\n", This
, debugstr_guid (pguidClock
), ppReferenceClock
);
184 HRESULT WINAPI
IDirectMusicImpl_SetMasterClock (LPDIRECTMUSIC iface
, REFGUID rguidClock
)
186 ICOM_THIS(IDirectMusicImpl
,iface
);
188 FIXME("(%p, %s): stub\n", This
, debugstr_guid(rguidClock
));
193 HRESULT WINAPI
IDirectMusicImpl_Activate (LPDIRECTMUSIC iface
, BOOL fEnable
)
195 ICOM_THIS(IDirectMusicImpl
,iface
);
198 TRACE("(%p, %i)", This
, fEnable
);
199 for (i
= 0; i
< This
->nrofports
; i
++)
201 This
->ports
[i
]->active
= fEnable
;
207 HRESULT WINAPI
IDirectMusicImpl_GetDefaultPort (LPDIRECTMUSIC iface
, LPGUID pguidPort
)
209 ICOM_THIS(IDirectMusicImpl
,iface
);
211 DWORD returnTypeGUID
, sizeOfReturnBuffer
= 50;
212 char returnBuffer
[51];
213 GUID defaultPortGUID
;
216 TRACE("(%p, %p)\n", This
, pguidPort
);
217 if ((RegOpenKeyExA (HKEY_LOCAL_MACHINE
, "Software\\Microsoft\\DirectMusic\\Defaults" , 0, KEY_READ
, &hkGUID
) != ERROR_SUCCESS
) || (RegQueryValueExA (hkGUID
, "DefaultOutputPort", NULL
, &returnTypeGUID
, returnBuffer
, &sizeOfReturnBuffer
) != ERROR_SUCCESS
))
219 WARN(": registry entry missing\n" );
220 *pguidPort
= CLSID_DirectMusicSynth
;
223 /* FIXME: Check return types to ensure we're interpreting data right */
224 MultiByteToWideChar (CP_ACP
, 0, returnBuffer
, -1, buff
, sizeof(buff
)/sizeof(WCHAR
));
225 CLSIDFromString ((LPCOLESTR
)buff
, &defaultPortGUID
);
226 *pguidPort
= defaultPortGUID
;
231 HRESULT WINAPI
IDirectMusicImpl_SetDirectSound (LPDIRECTMUSIC iface
, LPDIRECTSOUND pDirectSound
, HWND hWnd
)
233 ICOM_THIS(IDirectMusicImpl
,iface
);
235 FIXME("(%p, %p, %p): stub\n", This
, pDirectSound
, hWnd
);
240 ICOM_VTABLE(IDirectMusic
) DirectMusic_Vtbl
=
242 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
243 IDirectMusicImpl_QueryInterface
,
244 IDirectMusicImpl_AddRef
,
245 IDirectMusicImpl_Release
,
246 IDirectMusicImpl_EnumPort
,
247 IDirectMusicImpl_CreateMusicBuffer
,
248 IDirectMusicImpl_CreatePort
,
249 IDirectMusicImpl_EnumMasterClock
,
250 IDirectMusicImpl_GetMasterClock
,
251 IDirectMusicImpl_SetMasterClock
,
252 IDirectMusicImpl_Activate
,
253 IDirectMusicImpl_GetDefaultPort
,
254 IDirectMusicImpl_SetDirectSound
257 /* for ClassFactory */
258 HRESULT WINAPI
DMUSIC_CreateDirectMusic (LPCGUID lpcGUID
, LPDIRECTMUSIC
*ppDM
, LPUNKNOWN pUnkOuter
)
260 IDirectMusicImpl
*dmusic
;
262 TRACE("(%p,%p,%p)\n",lpcGUID
, ppDM
, pUnkOuter
);
263 if (IsEqualGUID(lpcGUID
, &IID_IDirectMusic
))
265 dmusic
= HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY
, sizeof(IDirectMusicImpl
));
268 *ppDM
= (LPDIRECTMUSIC
)NULL
;
269 return E_OUTOFMEMORY
;
271 dmusic
->lpVtbl
= &DirectMusic_Vtbl
;
273 *ppDM
= (LPDIRECTMUSIC
)dmusic
;
276 WARN("No interface found\n");
278 return E_NOINTERFACE
;
282 /* IDirectMusic8 IUnknown parts follow: */
283 HRESULT WINAPI
IDirectMusic8Impl_QueryInterface (LPDIRECTMUSIC8 iface
, REFIID riid
, LPVOID
*ppobj
)
285 ICOM_THIS(IDirectMusic8Impl
,iface
);
287 if (IsEqualGUID(riid
, &IID_IUnknown
) || IsEqualGUID(riid
, &IID_IDirectMusic8
))
289 IDirectMusic8Impl_AddRef(iface
);
293 WARN("(%p)->(%s,%p),not found\n",This
,debugstr_guid(riid
),ppobj
);
294 return E_NOINTERFACE
;
297 ULONG WINAPI
IDirectMusic8Impl_AddRef (LPDIRECTMUSIC8 iface
)
299 ICOM_THIS(IDirectMusic8Impl
,iface
);
300 TRACE("(%p) : AddRef from %ld\n", This
, This
->ref
);
301 return ++(This
->ref
);
304 ULONG WINAPI
IDirectMusic8Impl_Release (LPDIRECTMUSIC8 iface
)
306 ICOM_THIS(IDirectMusic8Impl
,iface
);
307 ULONG ref
= --This
->ref
;
308 TRACE("(%p) : ReleaseRef to %ld\n", This
, This
->ref
);
311 HeapFree(GetProcessHeap(), 0, This
);
316 /* IDirectMusic8 Interface follow: */
317 HRESULT WINAPI
IDirectMusic8Impl_EnumPort (LPDIRECTMUSIC8 iface
, DWORD dwIndex
, LPDMUS_PORTCAPS pPortCaps
)
323 HRESULT WINAPI
IDirectMusic8Impl_CreateMusicBuffer (LPDIRECTMUSIC8 iface
, LPDMUS_BUFFERDESC pBufferDesc
, LPDIRECTMUSICBUFFER
** ppBuffer
, LPUNKNOWN pUnkOuter
)
329 HRESULT WINAPI
IDirectMusic8Impl_CreatePort (LPDIRECTMUSIC8 iface
, REFCLSID rclsidPort
, LPDMUS_PORTPARAMS pPortParams
, LPDIRECTMUSICPORT
* ppPort
, LPUNKNOWN pUnkOuter
)
331 ICOM_THIS(IDirectMusic8Impl
,iface
);
332 FIXME("(%p, %s, %p, %p, %p): stub\n", This
, debugstr_guid(rclsidPort
), pPortParams
, ppPort
, pUnkOuter
);
336 HRESULT WINAPI
IDirectMusic8Impl_EnumMasterClock (LPDIRECTMUSIC8 iface
, DWORD dwIndex
, LPDMUS_CLOCKINFO lpClockInfo
)
342 HRESULT WINAPI
IDirectMusic8Impl_GetMasterClock (LPDIRECTMUSIC8 iface
, LPGUID pguidClock
, IReferenceClock
** ppReferenceClock
)
348 HRESULT WINAPI
IDirectMusic8Impl_SetMasterClock (LPDIRECTMUSIC8 iface
, REFGUID rguidClock
)
354 HRESULT WINAPI
IDirectMusic8Impl_Activate (LPDIRECTMUSIC8 iface
, BOOL fEnable
)
360 HRESULT WINAPI
IDirectMusic8Impl_GetDefaultPort (LPDIRECTMUSIC8 iface
, LPGUID pguidPort
)
366 HRESULT WINAPI
IDirectMusic8Impl_SetDirectSound (LPDIRECTMUSIC8 iface
, LPDIRECTSOUND pDirectSound
, HWND hWnd
)
372 HRESULT WINAPI
IDirectMusic8Impl_SetExternalMasterClock (LPDIRECTMUSIC8 iface
, IReferenceClock
* pClock
)
378 ICOM_VTABLE(IDirectMusic8
) DirectMusic8_Vtbl
=
380 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
381 IDirectMusic8Impl_QueryInterface
,
382 IDirectMusic8Impl_AddRef
,
383 IDirectMusic8Impl_Release
,
384 IDirectMusic8Impl_EnumPort
,
385 IDirectMusic8Impl_CreateMusicBuffer
,
386 IDirectMusic8Impl_CreatePort
,
387 IDirectMusic8Impl_EnumMasterClock
,
388 IDirectMusic8Impl_GetMasterClock
,
389 IDirectMusic8Impl_SetMasterClock
,
390 IDirectMusic8Impl_Activate
,
391 IDirectMusic8Impl_GetDefaultPort
,
392 IDirectMusic8Impl_SetDirectSound
,
393 IDirectMusic8Impl_SetExternalMasterClock
397 /* IDirectMusicDownload IUnknown parts follow: */
398 HRESULT WINAPI
IDirectMusicDownloadImpl_QueryInterface (LPDIRECTMUSICDOWNLOAD iface
, REFIID riid
, LPVOID
*ppobj
)
400 ICOM_THIS(IDirectMusicDownloadImpl
,iface
);
402 if (IsEqualGUID(riid
, &IID_IUnknown
) || IsEqualGUID(riid
, &IID_IDirectMusicDownload
))
404 IDirectMusicDownloadImpl_AddRef(iface
);
408 WARN("(%p)->(%s,%p),not found\n",This
,debugstr_guid(riid
),ppobj
);
409 return E_NOINTERFACE
;
412 ULONG WINAPI
IDirectMusicDownloadImpl_AddRef (LPDIRECTMUSICDOWNLOAD iface
)
414 ICOM_THIS(IDirectMusicDownloadImpl
,iface
);
415 TRACE("(%p) : AddRef from %ld\n", This
, This
->ref
);
416 return ++(This
->ref
);
419 ULONG WINAPI
IDirectMusicDownloadImpl_Release (LPDIRECTMUSICDOWNLOAD iface
)
421 ICOM_THIS(IDirectMusicDownloadImpl
,iface
);
422 ULONG ref
= --This
->ref
;
423 TRACE("(%p) : ReleaseRef to %ld\n", This
, This
->ref
);
426 HeapFree(GetProcessHeap(), 0, This
);
431 /* IDirectMusicDownload Interface follow: */
432 HRESULT WINAPI
IDirectMusicDownloadImpl_GetBuffer (LPDIRECTMUSICDOWNLOAD iface
, void** ppvBuffer
, DWORD
* pdwSize
)
438 ICOM_VTABLE(IDirectMusicDownload
) DirectMusicDownload_Vtbl
=
440 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
441 IDirectMusicDownloadImpl_QueryInterface
,
442 IDirectMusicDownloadImpl_AddRef
,
443 IDirectMusicDownloadImpl_Release
,
444 IDirectMusicDownloadImpl_GetBuffer
448 /* IDirectMusicBuffer IUnknown parts follow: */
449 HRESULT WINAPI
IDirectMusicBufferImpl_QueryInterface (LPDIRECTMUSICBUFFER iface
, REFIID riid
, LPVOID
*ppobj
)
451 ICOM_THIS(IDirectMusicBufferImpl
,iface
);
453 if (IsEqualGUID(riid
, &IID_IUnknown
) || IsEqualGUID(riid
, &IID_IDirectMusicBuffer
))
455 IDirectMusicBufferImpl_AddRef(iface
);
459 WARN("(%p)->(%s,%p),not found\n",This
,debugstr_guid(riid
),ppobj
);
460 return E_NOINTERFACE
;
463 ULONG WINAPI
IDirectMusicBufferImpl_AddRef (LPDIRECTMUSICBUFFER iface
)
465 ICOM_THIS(IDirectMusicBufferImpl
,iface
);
466 TRACE("(%p) : AddRef from %ld\n", This
, This
->ref
);
467 return ++(This
->ref
);
470 ULONG WINAPI
IDirectMusicBufferImpl_Release (LPDIRECTMUSICBUFFER iface
)
472 ICOM_THIS(IDirectMusicBufferImpl
,iface
);
473 ULONG ref
= --This
->ref
;
474 TRACE("(%p) : ReleaseRef to %ld\n", This
, This
->ref
);
477 HeapFree(GetProcessHeap(), 0, This
);
482 /* IDirectMusicBuffer Interface follow: */
483 HRESULT WINAPI
IDirectMusicBufferImpl_Flush (LPDIRECTMUSICBUFFER iface
)
489 HRESULT WINAPI
IDirectMusicBufferImpl_TotalTime (LPDIRECTMUSICBUFFER iface
, LPREFERENCE_TIME prtTime
)
495 HRESULT WINAPI
IDirectMusicBufferImpl_PackStructured (LPDIRECTMUSICBUFFER iface
, REFERENCE_TIME rt
, DWORD dwChannelGroup
, DWORD dwChannelMessage
)
501 HRESULT WINAPI
IDirectMusicBufferImpl_PackUnstructured (LPDIRECTMUSICBUFFER iface
, REFERENCE_TIME rt
, DWORD dwChannelGroup
, DWORD cb
, LPBYTE lpb
)
507 HRESULT WINAPI
IDirectMusicBufferImpl_ResetReadPtr (LPDIRECTMUSICBUFFER iface
)
513 HRESULT WINAPI
IDirectMusicBufferImpl_GetNextEvent (LPDIRECTMUSICBUFFER iface
, LPREFERENCE_TIME prt
, LPDWORD pdwChannelGroup
, LPDWORD pdwLength
, LPBYTE
* ppData
)
519 HRESULT WINAPI
IDirectMusicBufferImpl_GetRawBufferPtr (LPDIRECTMUSICBUFFER iface
, LPBYTE
* ppData
)
525 HRESULT WINAPI
IDirectMusicBufferImpl_GetStartTime (LPDIRECTMUSICBUFFER iface
, LPREFERENCE_TIME prt
)
531 HRESULT WINAPI
IDirectMusicBufferImpl_GetUsedBytes (LPDIRECTMUSICBUFFER iface
, LPDWORD pcb
)
537 HRESULT WINAPI
IDirectMusicBufferImpl_GetMaxBytes (LPDIRECTMUSICBUFFER iface
, LPDWORD pcb
)
543 HRESULT WINAPI
IDirectMusicBufferImpl_GetBufferFormat (LPDIRECTMUSICBUFFER iface
, LPGUID pGuidFormat
)
549 HRESULT WINAPI
IDirectMusicBufferImpl_SetStartTime (LPDIRECTMUSICBUFFER iface
, REFERENCE_TIME rt
)
555 HRESULT WINAPI
IDirectMusicBufferImpl_SetUsedBytes (LPDIRECTMUSICBUFFER iface
, DWORD cb
)
561 ICOM_VTABLE(IDirectMusicBuffer
) DirectMusicBuffer_Vtbl
=
563 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
564 IDirectMusicBufferImpl_QueryInterface
,
565 IDirectMusicBufferImpl_AddRef
,
566 IDirectMusicBufferImpl_Release
,
567 IDirectMusicBufferImpl_Flush
,
568 IDirectMusicBufferImpl_TotalTime
,
569 IDirectMusicBufferImpl_PackStructured
,
570 IDirectMusicBufferImpl_PackUnstructured
,
571 IDirectMusicBufferImpl_ResetReadPtr
,
572 IDirectMusicBufferImpl_GetNextEvent
,
573 IDirectMusicBufferImpl_GetRawBufferPtr
,
574 IDirectMusicBufferImpl_GetStartTime
,
575 IDirectMusicBufferImpl_GetUsedBytes
,
576 IDirectMusicBufferImpl_GetMaxBytes
,
577 IDirectMusicBufferImpl_GetBufferFormat
,
578 IDirectMusicBufferImpl_SetStartTime
,
579 IDirectMusicBufferImpl_SetUsedBytes
583 /* IDirectMusicObject IUnknown parts follow: */
584 HRESULT WINAPI
IDirectMusicObjectImpl_QueryInterface (LPDIRECTMUSICOBJECT iface
, REFIID riid
, LPVOID
*ppobj
)
586 ICOM_THIS(IDirectMusicObjectImpl
,iface
);
588 if (IsEqualGUID(riid
, &IID_IUnknown
) || IsEqualGUID(riid
, &IID_IDirectMusicObject
))
590 IDirectMusicObjectImpl_AddRef(iface
);
594 WARN("(%p)->(%s,%p),not found\n",This
,debugstr_guid(riid
),ppobj
);
595 return E_NOINTERFACE
;
598 ULONG WINAPI
IDirectMusicObjectImpl_AddRef (LPDIRECTMUSICOBJECT iface
)
600 ICOM_THIS(IDirectMusicObjectImpl
,iface
);
601 TRACE("(%p) : AddRef from %ld\n", This
, This
->ref
);
602 return ++(This
->ref
);
605 ULONG WINAPI
IDirectMusicObjectImpl_Release (LPDIRECTMUSICOBJECT iface
)
607 ICOM_THIS(IDirectMusicObjectImpl
,iface
);
608 ULONG ref
= --This
->ref
;
609 TRACE("(%p) : ReleaseRef to %ld\n", This
, This
->ref
);
612 HeapFree(GetProcessHeap(), 0, This
);
617 /* IDirectMusicObject Interface follow: */
618 HRESULT WINAPI
IDirectMusicObjectImpl_GetDescriptor (LPDIRECTMUSICOBJECT iface
, LPDMUS_OBJECTDESC pDesc
)
624 HRESULT WINAPI
IDirectMusicObjectImpl_SetDescriptor (LPDIRECTMUSICOBJECT iface
, LPDMUS_OBJECTDESC pDesc
)
630 HRESULT WINAPI
IDirectMusicObjectImpl_ParseDescriptor (LPDIRECTMUSICOBJECT iface
, LPSTREAM pStream
, LPDMUS_OBJECTDESC pDesc
)
636 ICOM_VTABLE(IDirectMusicObject
) DirectMusicObject_Vtbl
=
638 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
639 IDirectMusicObjectImpl_QueryInterface
,
640 IDirectMusicObjectImpl_AddRef
,
641 IDirectMusicObjectImpl_Release
,
642 IDirectMusicObjectImpl_GetDescriptor
,
643 IDirectMusicObjectImpl_SetDescriptor
,
644 IDirectMusicObjectImpl_ParseDescriptor
649 void register_waveport (LPGUID lpGUID
, LPCSTR lpszDesc
, LPCSTR lpszDrvName
, LPVOID lpContext
)
651 LPDMUS_PORTCAPS pPortCaps
= (LPDMUS_PORTCAPS
)lpContext
;
653 pPortCaps
->dwSize
= sizeof(DMUS_PORTCAPS
);
654 pPortCaps
->dwFlags
= DMUS_PC_DLS
| DMUS_PC_SOFTWARESYNTH
| DMUS_PC_DIRECTSOUND
| DMUS_PC_DLS2
| DMUS_PC_AUDIOPATH
| DMUS_PC_WAVE
;
655 pPortCaps
->guidPort
= *lpGUID
;
656 pPortCaps
->dwClass
= DMUS_PC_OUTPUTCLASS
;
657 pPortCaps
->dwType
= DMUS_PORT_WINMM_DRIVER
;
658 pPortCaps
->dwMemorySize
= DMUS_PC_SYSTEMMEMORY
;
659 pPortCaps
->dwMaxChannelGroups
= 1000;
660 pPortCaps
->dwMaxVoices
= 1000;
661 pPortCaps
->dwMaxAudioChannels
= -1;
662 pPortCaps
->dwEffectFlags
= DMUS_EFFECT_REVERB
| DMUS_EFFECT_CHORUS
| DMUS_EFFECT_DELAY
;
663 MultiByteToWideChar (CP_ACP
, 0, lpszDesc
, -1, pPortCaps
->wszDescription
, sizeof(pPortCaps
->wszDescription
)/sizeof(WCHAR
));