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 /* for ClassFactory */
46 HRESULT WINAPI
DMUSIC_CreateDirectMusic (LPCGUID lpcGUID
, LPDIRECTMUSIC
*ppDM
, LPUNKNOWN pUnkOuter
)
48 IDirectMusic8Impl
*dmusic
;
50 TRACE("(%p,%p,%p)\n",lpcGUID
, ppDM
, pUnkOuter
);
51 if (IsEqualGUID(lpcGUID
, &IID_IDirectMusic
) ||
52 IsEqualGUID(lpcGUID
, &IID_IDirectMusic2
) ||
53 IsEqualGUID(lpcGUID
, &IID_IDirectMusic8
)) {
54 dmusic
= HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY
, sizeof(IDirectMusic8Impl
));
56 *ppDM
= (LPDIRECTMUSIC
) NULL
;
59 dmusic
->lpVtbl
= &DirectMusic8_Vtbl
;
61 *ppDM
= (LPDIRECTMUSIC
) dmusic
;
64 WARN("No interface found\n");
70 /* IDirectMusic8 IUnknown parts follow: */
71 HRESULT WINAPI
IDirectMusic8Impl_QueryInterface (LPDIRECTMUSIC8 iface
, REFIID riid
, LPVOID
*ppobj
)
73 ICOM_THIS(IDirectMusic8Impl
,iface
);
75 if (IsEqualGUID(riid
, &IID_IUnknown
) ||
76 IsEqualGUID(riid
, &IID_IDirectMusic2
) ||
77 IsEqualGUID(riid
, &IID_IDirectMusic8
))
79 IDirectMusic8Impl_AddRef(iface
);
83 WARN("(%p)->(%s,%p),not found\n",This
,debugstr_guid(riid
),ppobj
);
87 ULONG WINAPI
IDirectMusic8Impl_AddRef (LPDIRECTMUSIC8 iface
)
89 ICOM_THIS(IDirectMusic8Impl
,iface
);
90 TRACE("(%p) : AddRef from %ld\n", This
, This
->ref
);
94 ULONG WINAPI
IDirectMusic8Impl_Release (LPDIRECTMUSIC8 iface
)
96 ICOM_THIS(IDirectMusic8Impl
,iface
);
97 ULONG ref
= --This
->ref
;
98 TRACE("(%p) : ReleaseRef to %ld\n", This
, This
->ref
);
101 HeapFree(GetProcessHeap(), 0, This
);
106 /* IDirectMusic8 Interface follow: */
107 HRESULT WINAPI
IDirectMusic8Impl_EnumPort(LPDIRECTMUSIC8 iface
, DWORD dwIndex
, LPDMUS_PORTCAPS pPortCaps
)
109 ICOM_THIS(IDirectMusic8Impl
,iface
);
110 int numMIDI
= midiOutGetNumDevs();
111 int numWAVE
= waveOutGetNumDevs();
114 TRACE("(%p, %ld, %p)\n", This
, dwIndex
, pPortCaps
);
115 TRACE("1 software synth. + %i WAVE + %i MIDI available\n", numWAVE
, numMIDI
);
116 /* i guess the first port shown is always software synthesizer */
119 TRACE("enumerating 'Microsoft Software Synthesizer' port\n");
120 pPortCaps
->dwSize
= sizeof(DMUS_PORTCAPS
);
121 pPortCaps
->dwFlags
= DMUS_PC_DLS
| DMUS_PC_SOFTWARESYNTH
| DMUS_PC_DIRECTSOUND
| DMUS_PC_DLS2
| DMUS_PC_AUDIOPATH
| DMUS_PC_WAVE
;
122 pPortCaps
->guidPort
= CLSID_DirectMusicSynth
;
123 pPortCaps
->dwClass
= DMUS_PC_OUTPUTCLASS
;
124 pPortCaps
->dwType
= DMUS_PORT_WINMM_DRIVER
;
125 pPortCaps
->dwMemorySize
= DMUS_PC_SYSTEMMEMORY
;
126 pPortCaps
->dwMaxChannelGroups
= 1000;
127 pPortCaps
->dwMaxVoices
= 1000;
128 pPortCaps
->dwMaxAudioChannels
= -1;
129 pPortCaps
->dwEffectFlags
= DMUS_EFFECT_REVERB
| DMUS_EFFECT_CHORUS
| DMUS_EFFECT_DELAY
;
130 MultiByteToWideChar(CP_ACP
, 0, "Microsotf Synthesizer", -1, pPortCaps
->wszDescription
, sizeof(pPortCaps
->wszDescription
)/sizeof(WCHAR
));
133 /* then return digital sound ports */
134 for (i
= 1; i
<= numWAVE
; i
++)
136 TRACE("enumerating 'digital sound' ports\n");
139 DirectSoundEnumerateA((LPDSENUMCALLBACKA
) register_waveport
, (VOID
*) pPortCaps
);
143 /* finally, list all *real* MIDI ports*/
144 for (i
= numWAVE
+ 1; i
<= numWAVE
+ numMIDI
; i
++)
146 TRACE("enumerating 'real MIDI' ports\n");
148 FIXME("Found MIDI port, but *real* MIDI ports not supported yet\n");
154 HRESULT WINAPI
IDirectMusic8Impl_CreateMusicBuffer (LPDIRECTMUSIC8 iface
, LPDMUS_BUFFERDESC pBufferDesc
, LPDIRECTMUSICBUFFER
** ppBuffer
, LPUNKNOWN pUnkOuter
)
156 ICOM_THIS(IDirectMusic8Impl
,iface
);
158 FIXME("(%p, %p, %p, %p): stub\n", This
, pBufferDesc
, ppBuffer
, pUnkOuter
);
163 HRESULT WINAPI
IDirectMusic8Impl_CreatePort (LPDIRECTMUSIC8 iface
, REFCLSID rclsidPort
, LPDMUS_PORTPARAMS pPortParams
, LPDIRECTMUSICPORT
* ppPort
, LPUNKNOWN pUnkOuter
)
165 ICOM_THIS(IDirectMusic8Impl
,iface
);
167 DMUS_PORTCAPS PortCaps
;
169 TRACE("(%p, %s, %p, %p, %p)\n", This
, debugstr_guid(rclsidPort
), pPortParams
, ppPort
, pUnkOuter
);
170 for (i
= 0; S_FALSE
!= IDirectMusic8Impl_EnumPort(iface
, i
, &PortCaps
); i
++) {
171 if (IsEqualGUID(rclsidPort
, &PortCaps
.guidPort
)) {
172 This
->ports
= HeapReAlloc(GetProcessHeap(), 0, This
->ports
, sizeof(LPDIRECTMUSICPORT
) * This
->nrofports
);
173 if (NULL
== This
->ports
[This
->nrofports
]) {
174 *ppPort
= (LPDIRECTMUSICPORT
)NULL
;
175 return E_OUTOFMEMORY
;
177 This
->ports
[This
->nrofports
]->lpVtbl
= &DirectMusicPort_Vtbl
;
178 This
->ports
[This
->nrofports
]->ref
= 0;
179 This
->ports
[This
->nrofports
]->active
= FALSE
;
180 This
->ports
[This
->nrofports
]->caps
= &PortCaps
;
181 This
->ports
[This
->nrofports
]->params
= pPortParams
; /* this one is here just because there's a funct. which retrieves it back */
183 if (pPortParams
->dwValidParams
& DMUS_PORTPARAMS_CHANNELGROUPS
) {
184 This
->ports
[This
->nrofports
]->nrofgroups
= pPortParams
->dwChannelGroups
;
185 /* setting default priorities */
186 for (j
= 0; j
< This
->ports
[This
->nrofports
]->nrofgroups
; j
++) {
187 TRACE ("Setting default channel priorities on channel group %i\n", j
+ 1);
188 This
->ports
[This
->nrofports
]->group
[j
].channel
[0].priority
= DAUD_CHAN1_DEF_VOICE_PRIORITY
;
189 This
->ports
[This
->nrofports
]->group
[j
].channel
[1].priority
= DAUD_CHAN2_DEF_VOICE_PRIORITY
;
190 This
->ports
[This
->nrofports
]->group
[j
].channel
[2].priority
= DAUD_CHAN3_DEF_VOICE_PRIORITY
;
191 This
->ports
[This
->nrofports
]->group
[j
].channel
[3].priority
= DAUD_CHAN4_DEF_VOICE_PRIORITY
;
192 This
->ports
[This
->nrofports
]->group
[j
].channel
[4].priority
= DAUD_CHAN5_DEF_VOICE_PRIORITY
;
193 This
->ports
[This
->nrofports
]->group
[j
].channel
[5].priority
= DAUD_CHAN6_DEF_VOICE_PRIORITY
;
194 This
->ports
[This
->nrofports
]->group
[j
].channel
[6].priority
= DAUD_CHAN7_DEF_VOICE_PRIORITY
;
195 This
->ports
[This
->nrofports
]->group
[j
].channel
[7].priority
= DAUD_CHAN8_DEF_VOICE_PRIORITY
;
196 This
->ports
[This
->nrofports
]->group
[j
].channel
[8].priority
= DAUD_CHAN9_DEF_VOICE_PRIORITY
;
197 This
->ports
[This
->nrofports
]->group
[j
].channel
[9].priority
= DAUD_CHAN10_DEF_VOICE_PRIORITY
;
198 This
->ports
[This
->nrofports
]->group
[j
].channel
[10].priority
= DAUD_CHAN11_DEF_VOICE_PRIORITY
;
199 This
->ports
[This
->nrofports
]->group
[j
].channel
[11].priority
= DAUD_CHAN12_DEF_VOICE_PRIORITY
;
200 This
->ports
[This
->nrofports
]->group
[j
].channel
[12].priority
= DAUD_CHAN13_DEF_VOICE_PRIORITY
;
201 This
->ports
[This
->nrofports
]->group
[j
].channel
[13].priority
= DAUD_CHAN14_DEF_VOICE_PRIORITY
;
202 This
->ports
[This
->nrofports
]->group
[j
].channel
[14].priority
= DAUD_CHAN15_DEF_VOICE_PRIORITY
;
203 This
->ports
[This
->nrofports
]->group
[j
].channel
[15].priority
= DAUD_CHAN16_DEF_VOICE_PRIORITY
;
207 *ppPort
= (LPDIRECTMUSICPORT
) This
->ports
[This
->nrofports
];
208 IDirectMusicPortImpl_AddRef((LPDIRECTMUSICPORT
) This
->ports
[This
->nrofports
]);
213 /* FIXME: place correct error here */
214 return E_NOINTERFACE
;
217 HRESULT WINAPI
IDirectMusic8Impl_EnumMasterClock (LPDIRECTMUSIC8 iface
, DWORD dwIndex
, LPDMUS_CLOCKINFO lpClockInfo
)
219 ICOM_THIS(IDirectMusic8Impl
,iface
);
221 FIXME("(%p, %ld, %p): stub\n", This
, dwIndex
, lpClockInfo
);
226 HRESULT WINAPI
IDirectMusic8Impl_GetMasterClock (LPDIRECTMUSIC8 iface
, LPGUID pguidClock
, IReferenceClock
** ppReferenceClock
)
228 ICOM_THIS(IDirectMusic8Impl
,iface
);
230 FIXME("(%p, %p, %p): stub\n", This
, pguidClock
, ppReferenceClock
);
235 HRESULT WINAPI
IDirectMusic8Impl_SetMasterClock (LPDIRECTMUSIC8 iface
, REFGUID rguidClock
)
237 ICOM_THIS(IDirectMusic8Impl
,iface
);
239 FIXME("(%p, %s): stub\n", This
, debugstr_guid(rguidClock
));
244 HRESULT WINAPI
IDirectMusic8Impl_Activate (LPDIRECTMUSIC8 iface
, BOOL fEnable
)
246 ICOM_THIS(IDirectMusic8Impl
,iface
);
249 FIXME("(%p, %d): stub\n", This
, fEnable
);
250 for (i
= 0; i
< This
->nrofports
; i
++)
252 This
->ports
[i
]->active
= fEnable
;
258 HRESULT WINAPI
IDirectMusic8Impl_GetDefaultPort (LPDIRECTMUSIC8 iface
, LPGUID pguidPort
)
260 ICOM_THIS(IDirectMusic8Impl
,iface
);
262 DWORD returnTypeGUID
, sizeOfReturnBuffer
= 50;
263 char returnBuffer
[51];
264 GUID defaultPortGUID
;
267 TRACE("(%p, %p)\n", This
, pguidPort
);
268 if ((RegOpenKeyExA(HKEY_LOCAL_MACHINE
, "Software\\Microsoft\\DirectMusic\\Defaults" , 0, KEY_READ
, &hkGUID
) != ERROR_SUCCESS
) ||
269 (RegQueryValueExA(hkGUID
, "DefaultOutputPort", NULL
, &returnTypeGUID
, returnBuffer
, &sizeOfReturnBuffer
) != ERROR_SUCCESS
))
271 WARN(": registry entry missing\n" );
272 *pguidPort
= CLSID_DirectMusicSynth
;
275 /* FIXME: Check return types to ensure we're interpreting data right */
276 MultiByteToWideChar(CP_ACP
, 0, returnBuffer
, -1, buff
, sizeof(buff
) / sizeof(WCHAR
));
277 CLSIDFromString((LPCOLESTR
) buff
, &defaultPortGUID
);
278 *pguidPort
= defaultPortGUID
;
283 HRESULT WINAPI
IDirectMusic8Impl_SetDirectSound (LPDIRECTMUSIC8 iface
, LPDIRECTSOUND pDirectSound
, HWND hWnd
)
285 ICOM_THIS(IDirectMusic8Impl
,iface
);
287 FIXME("(%p, %p, %p): stub\n", This
, pDirectSound
, hWnd
);
292 HRESULT WINAPI
IDirectMusic8Impl_SetExternalMasterClock (LPDIRECTMUSIC8 iface
, IReferenceClock
* pClock
)
294 ICOM_THIS(IDirectMusic8Impl
,iface
);
296 FIXME("(%p, %p): stub\n", This
, pClock
);
301 ICOM_VTABLE(IDirectMusic8
) DirectMusic8_Vtbl
=
303 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
304 IDirectMusic8Impl_QueryInterface
,
305 IDirectMusic8Impl_AddRef
,
306 IDirectMusic8Impl_Release
,
307 IDirectMusic8Impl_EnumPort
,
308 IDirectMusic8Impl_CreateMusicBuffer
,
309 IDirectMusic8Impl_CreatePort
,
310 IDirectMusic8Impl_EnumMasterClock
,
311 IDirectMusic8Impl_GetMasterClock
,
312 IDirectMusic8Impl_SetMasterClock
,
313 IDirectMusic8Impl_Activate
,
314 IDirectMusic8Impl_GetDefaultPort
,
315 IDirectMusic8Impl_SetDirectSound
,
316 IDirectMusic8Impl_SetExternalMasterClock
320 /* IDirectMusicDownload IUnknown parts follow: */
321 HRESULT WINAPI
IDirectMusicDownloadImpl_QueryInterface (LPDIRECTMUSICDOWNLOAD iface
, REFIID riid
, LPVOID
*ppobj
)
323 ICOM_THIS(IDirectMusicDownloadImpl
,iface
);
325 if (IsEqualGUID(riid
, &IID_IUnknown
) || IsEqualGUID(riid
, &IID_IDirectMusicDownload
))
327 IDirectMusicDownloadImpl_AddRef(iface
);
331 WARN("(%p)->(%s,%p),not found\n",This
,debugstr_guid(riid
),ppobj
);
332 return E_NOINTERFACE
;
335 ULONG WINAPI
IDirectMusicDownloadImpl_AddRef (LPDIRECTMUSICDOWNLOAD iface
)
337 ICOM_THIS(IDirectMusicDownloadImpl
,iface
);
338 TRACE("(%p) : AddRef from %ld\n", This
, This
->ref
);
339 return ++(This
->ref
);
342 ULONG WINAPI
IDirectMusicDownloadImpl_Release (LPDIRECTMUSICDOWNLOAD iface
)
344 ICOM_THIS(IDirectMusicDownloadImpl
,iface
);
345 ULONG ref
= --This
->ref
;
346 TRACE("(%p) : ReleaseRef to %ld\n", This
, This
->ref
);
349 HeapFree(GetProcessHeap(), 0, This
);
354 /* IDirectMusicDownload Interface follow: */
355 HRESULT WINAPI
IDirectMusicDownloadImpl_GetBuffer (LPDIRECTMUSICDOWNLOAD iface
, void** ppvBuffer
, DWORD
* pdwSize
)
357 ICOM_THIS(IDirectMusicDownloadImpl
,iface
);
359 FIXME("(%p,%p, %p): stub\n", This
, ppvBuffer
, pdwSize
);
364 ICOM_VTABLE(IDirectMusicDownload
) DirectMusicDownload_Vtbl
=
366 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
367 IDirectMusicDownloadImpl_QueryInterface
,
368 IDirectMusicDownloadImpl_AddRef
,
369 IDirectMusicDownloadImpl_Release
,
370 IDirectMusicDownloadImpl_GetBuffer
374 /* IDirectMusicBuffer IUnknown parts follow: */
375 HRESULT WINAPI
IDirectMusicBufferImpl_QueryInterface (LPDIRECTMUSICBUFFER iface
, REFIID riid
, LPVOID
*ppobj
)
377 ICOM_THIS(IDirectMusicBufferImpl
,iface
);
379 if (IsEqualGUID(riid
, &IID_IUnknown
) || IsEqualGUID(riid
, &IID_IDirectMusicBuffer
))
381 IDirectMusicBufferImpl_AddRef(iface
);
385 WARN("(%p)->(%s,%p),not found\n",This
,debugstr_guid(riid
),ppobj
);
386 return E_NOINTERFACE
;
389 ULONG WINAPI
IDirectMusicBufferImpl_AddRef (LPDIRECTMUSICBUFFER iface
)
391 ICOM_THIS(IDirectMusicBufferImpl
,iface
);
392 TRACE("(%p) : AddRef from %ld\n", This
, This
->ref
);
393 return ++(This
->ref
);
396 ULONG WINAPI
IDirectMusicBufferImpl_Release (LPDIRECTMUSICBUFFER iface
)
398 ICOM_THIS(IDirectMusicBufferImpl
,iface
);
399 ULONG ref
= --This
->ref
;
400 TRACE("(%p) : ReleaseRef to %ld\n", This
, This
->ref
);
403 HeapFree(GetProcessHeap(), 0, This
);
408 /* IDirectMusicBuffer Interface follow: */
409 HRESULT WINAPI
IDirectMusicBufferImpl_Flush (LPDIRECTMUSICBUFFER iface
)
411 ICOM_THIS(IDirectMusicBufferImpl
,iface
);
413 FIXME("(%p): stub\n", This
);
418 HRESULT WINAPI
IDirectMusicBufferImpl_TotalTime (LPDIRECTMUSICBUFFER iface
, LPREFERENCE_TIME prtTime
)
420 ICOM_THIS(IDirectMusicBufferImpl
,iface
);
422 FIXME("(%p, %p): stub\n", This
, prtTime
);
427 HRESULT WINAPI
IDirectMusicBufferImpl_PackStructured (LPDIRECTMUSICBUFFER iface
, REFERENCE_TIME rt
, DWORD dwChannelGroup
, DWORD dwChannelMessage
)
429 ICOM_THIS(IDirectMusicBufferImpl
,iface
);
431 FIXME("(%p, FIXME, %ld, %ld): stub\n", This
,/* rt,*/ dwChannelGroup
, dwChannelMessage
);
436 HRESULT WINAPI
IDirectMusicBufferImpl_PackUnstructured (LPDIRECTMUSICBUFFER iface
, REFERENCE_TIME rt
, DWORD dwChannelGroup
, DWORD cb
, LPBYTE lpb
)
438 ICOM_THIS(IDirectMusicBufferImpl
,iface
);
440 FIXME("(%p, FIXME, %ld, %ld, %p): stub\n", This
,/* rt,*/ dwChannelGroup
, cb
, lpb
);
445 HRESULT WINAPI
IDirectMusicBufferImpl_ResetReadPtr (LPDIRECTMUSICBUFFER iface
)
447 ICOM_THIS(IDirectMusicBufferImpl
,iface
);
449 FIXME("(%p): stub\n", This
);
454 HRESULT WINAPI
IDirectMusicBufferImpl_GetNextEvent (LPDIRECTMUSICBUFFER iface
, LPREFERENCE_TIME prt
, LPDWORD pdwChannelGroup
, LPDWORD pdwLength
, LPBYTE
* ppData
)
456 ICOM_THIS(IDirectMusicBufferImpl
,iface
);
458 FIXME("(%p, %p, %p, %p, %p): stub\n", This
, prt
, pdwChannelGroup
, pdwLength
, ppData
);
463 HRESULT WINAPI
IDirectMusicBufferImpl_GetRawBufferPtr (LPDIRECTMUSICBUFFER iface
, LPBYTE
* ppData
)
465 ICOM_THIS(IDirectMusicBufferImpl
,iface
);
467 FIXME("(%p, %p): stub\n", This
, ppData
);
472 HRESULT WINAPI
IDirectMusicBufferImpl_GetStartTime (LPDIRECTMUSICBUFFER iface
, LPREFERENCE_TIME prt
)
474 ICOM_THIS(IDirectMusicBufferImpl
,iface
);
476 FIXME("(%p, %p): stub\n", This
, prt
);
481 HRESULT WINAPI
IDirectMusicBufferImpl_GetUsedBytes (LPDIRECTMUSICBUFFER iface
, LPDWORD pcb
)
483 ICOM_THIS(IDirectMusicBufferImpl
,iface
);
485 FIXME("(%p, %p): stub\n", This
, pcb
);
490 HRESULT WINAPI
IDirectMusicBufferImpl_GetMaxBytes (LPDIRECTMUSICBUFFER iface
, LPDWORD pcb
)
492 ICOM_THIS(IDirectMusicBufferImpl
,iface
);
494 FIXME("(%p, %p): stub\n", This
, pcb
);
499 HRESULT WINAPI
IDirectMusicBufferImpl_GetBufferFormat (LPDIRECTMUSICBUFFER iface
, LPGUID pGuidFormat
)
501 ICOM_THIS(IDirectMusicBufferImpl
,iface
);
503 FIXME("(%p, %p): stub\n", This
, pGuidFormat
);
508 HRESULT WINAPI
IDirectMusicBufferImpl_SetStartTime (LPDIRECTMUSICBUFFER iface
, REFERENCE_TIME rt
)
510 ICOM_THIS(IDirectMusicBufferImpl
,iface
);
512 FIXME("(%p, FIXME): stub\n", This
/*, rt*/);
517 HRESULT WINAPI
IDirectMusicBufferImpl_SetUsedBytes (LPDIRECTMUSICBUFFER iface
, DWORD cb
)
519 ICOM_THIS(IDirectMusicBufferImpl
,iface
);
521 FIXME("(%p, %ld): stub\n", This
, cb
);
526 ICOM_VTABLE(IDirectMusicBuffer
) DirectMusicBuffer_Vtbl
=
528 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
529 IDirectMusicBufferImpl_QueryInterface
,
530 IDirectMusicBufferImpl_AddRef
,
531 IDirectMusicBufferImpl_Release
,
532 IDirectMusicBufferImpl_Flush
,
533 IDirectMusicBufferImpl_TotalTime
,
534 IDirectMusicBufferImpl_PackStructured
,
535 IDirectMusicBufferImpl_PackUnstructured
,
536 IDirectMusicBufferImpl_ResetReadPtr
,
537 IDirectMusicBufferImpl_GetNextEvent
,
538 IDirectMusicBufferImpl_GetRawBufferPtr
,
539 IDirectMusicBufferImpl_GetStartTime
,
540 IDirectMusicBufferImpl_GetUsedBytes
,
541 IDirectMusicBufferImpl_GetMaxBytes
,
542 IDirectMusicBufferImpl_GetBufferFormat
,
543 IDirectMusicBufferImpl_SetStartTime
,
544 IDirectMusicBufferImpl_SetUsedBytes
548 /* IDirectMusicObject IUnknown parts follow: */
549 HRESULT WINAPI
IDirectMusicObjectImpl_QueryInterface (LPDIRECTMUSICOBJECT iface
, REFIID riid
, LPVOID
*ppobj
)
551 ICOM_THIS(IDirectMusicObjectImpl
,iface
);
553 if (IsEqualGUID(riid
, &IID_IUnknown
) || IsEqualGUID(riid
, &IID_IDirectMusicObject
))
555 IDirectMusicObjectImpl_AddRef(iface
);
559 WARN("(%p)->(%s,%p),not found\n",This
,debugstr_guid(riid
),ppobj
);
560 return E_NOINTERFACE
;
563 ULONG WINAPI
IDirectMusicObjectImpl_AddRef (LPDIRECTMUSICOBJECT iface
)
565 ICOM_THIS(IDirectMusicObjectImpl
,iface
);
566 TRACE("(%p) : AddRef from %ld\n", This
, This
->ref
);
567 return ++(This
->ref
);
570 ULONG WINAPI
IDirectMusicObjectImpl_Release (LPDIRECTMUSICOBJECT iface
)
572 ICOM_THIS(IDirectMusicObjectImpl
,iface
);
573 ULONG ref
= --This
->ref
;
574 TRACE("(%p) : ReleaseRef to %ld\n", This
, This
->ref
);
577 HeapFree(GetProcessHeap(), 0, This
);
582 /* IDirectMusicObject Interface follow: */
583 HRESULT WINAPI
IDirectMusicObjectImpl_GetDescriptor (LPDIRECTMUSICOBJECT iface
, LPDMUS_OBJECTDESC pDesc
)
585 ICOM_THIS(IDirectMusicObjectImpl
,iface
);
587 TRACE("(%p, %p)\n", This
, pDesc
);
593 HRESULT WINAPI
IDirectMusicObjectImpl_SetDescriptor (LPDIRECTMUSICOBJECT iface
, LPDMUS_OBJECTDESC pDesc
)
595 ICOM_THIS(IDirectMusicObjectImpl
,iface
);
597 TRACE("(%p, %p)\n", This
, pDesc
);
603 HRESULT WINAPI
IDirectMusicObjectImpl_ParseDescriptor (LPDIRECTMUSICOBJECT iface
, LPSTREAM pStream
, LPDMUS_OBJECTDESC pDesc
)
605 ICOM_THIS(IDirectMusicObjectImpl
,iface
);
607 FIXME("(%p, %p, %p): stub\n", This
, pStream
, pDesc
);
612 ICOM_VTABLE(IDirectMusicObject
) DirectMusicObject_Vtbl
=
614 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
615 IDirectMusicObjectImpl_QueryInterface
,
616 IDirectMusicObjectImpl_AddRef
,
617 IDirectMusicObjectImpl_Release
,
618 IDirectMusicObjectImpl_GetDescriptor
,
619 IDirectMusicObjectImpl_SetDescriptor
,
620 IDirectMusicObjectImpl_ParseDescriptor
625 void register_waveport (LPGUID lpGUID
, LPCSTR lpszDesc
, LPCSTR lpszDrvName
, LPVOID lpContext
)
627 LPDMUS_PORTCAPS pPortCaps
= (LPDMUS_PORTCAPS
)lpContext
;
629 pPortCaps
->dwSize
= sizeof(DMUS_PORTCAPS
);
630 pPortCaps
->dwFlags
= DMUS_PC_DLS
| DMUS_PC_SOFTWARESYNTH
| DMUS_PC_DIRECTSOUND
| DMUS_PC_DLS2
| DMUS_PC_AUDIOPATH
| DMUS_PC_WAVE
;
631 pPortCaps
->guidPort
= *lpGUID
;
632 pPortCaps
->dwClass
= DMUS_PC_OUTPUTCLASS
;
633 pPortCaps
->dwType
= DMUS_PORT_WINMM_DRIVER
;
634 pPortCaps
->dwMemorySize
= DMUS_PC_SYSTEMMEMORY
;
635 pPortCaps
->dwMaxChannelGroups
= 2;
636 pPortCaps
->dwMaxVoices
= -1;
637 pPortCaps
->dwMaxAudioChannels
= -1;
638 pPortCaps
->dwEffectFlags
= DMUS_EFFECT_REVERB
| DMUS_EFFECT_CHORUS
| DMUS_EFFECT_DELAY
;
639 MultiByteToWideChar (CP_ACP
, 0, lpszDesc
, -1, pPortCaps
->wszDescription
, sizeof(pPortCaps
->wszDescription
)/sizeof(WCHAR
));