1 /* IDirectMusicTool Implementation
2 * IDirectMusicTool8 Implementation
3 * IDirectMusicTrack Implementation
4 * IDirectMusicTrack8 Implementation
6 * Copyright (C) 2003 Rok Mandeljc
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU Library General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
27 #include "wine/debug.h"
29 #include "dmusic_private.h"
31 WINE_DEFAULT_DEBUG_CHANNEL(dmusic
);
33 /* IDirectMusicTool IUnknown parts follow: */
34 HRESULT WINAPI
IDirectMusicToolImpl_QueryInterface (LPDIRECTMUSICTOOL iface
, REFIID riid
, LPVOID
*ppobj
)
36 ICOM_THIS(IDirectMusicToolImpl
,iface
);
38 if (IsEqualGUID(riid
, &IID_IUnknown
) || IsEqualGUID(riid
, &IID_IDirectMusicTool
))
40 IDirectMusicToolImpl_AddRef(iface
);
44 WARN("(%p)->(%s,%p),not found\n",This
,debugstr_guid(riid
),ppobj
);
48 ULONG WINAPI
IDirectMusicToolImpl_AddRef (LPDIRECTMUSICTOOL iface
)
50 ICOM_THIS(IDirectMusicToolImpl
,iface
);
51 TRACE("(%p) : AddRef from %ld\n", This
, This
->ref
);
55 ULONG WINAPI
IDirectMusicToolImpl_Release (LPDIRECTMUSICTOOL iface
)
57 ICOM_THIS(IDirectMusicToolImpl
,iface
);
58 ULONG ref
= --This
->ref
;
59 TRACE("(%p) : ReleaseRef to %ld\n", This
, This
->ref
);
62 HeapFree(GetProcessHeap(), 0, This
);
67 /* IDirectMusicTool Interface follow: */
68 HRESULT WINAPI
IDirectMusicToolImpl_Init (LPDIRECTMUSICTOOL iface
, IDirectMusicGraph
* pGraph
)
74 HRESULT WINAPI
IDirectMusicToolImpl_GetMsgDeliveryType (LPDIRECTMUSICTOOL iface
, DWORD
* pdwDeliveryType
)
80 HRESULT WINAPI
IDirectMusicToolImpl_GetMediaTypeArraySize (LPDIRECTMUSICTOOL iface
, DWORD
* pdwNumElements
)
86 HRESULT WINAPI
IDirectMusicToolImpl_GetMediaTypes (LPDIRECTMUSICTOOL iface
, DWORD
** padwMediaTypes
, DWORD dwNumElements
)
92 HRESULT WINAPI
IDirectMusicToolImpl_ProcessPMsg (LPDIRECTMUSICTOOL iface
, IDirectMusicPerformance
* pPerf
, DMUS_PMSG
* pPMSG
)
98 HRESULT WINAPI
IDirectMusicToolImpl_Flush (LPDIRECTMUSICTOOL iface
, IDirectMusicPerformance
* pPerf
, DMUS_PMSG
* pPMSG
, REFERENCE_TIME rtTime
)
104 ICOM_VTABLE(IDirectMusicTool
) DirectMusicTool_Vtbl
=
106 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
107 IDirectMusicToolImpl_QueryInterface
,
108 IDirectMusicToolImpl_AddRef
,
109 IDirectMusicToolImpl_Release
,
110 IDirectMusicToolImpl_Init
,
111 IDirectMusicToolImpl_GetMsgDeliveryType
,
112 IDirectMusicToolImpl_GetMediaTypeArraySize
,
113 IDirectMusicToolImpl_GetMediaTypes
,
114 IDirectMusicToolImpl_ProcessPMsg
,
115 IDirectMusicToolImpl_Flush
119 /* IDirectMusicTool8 IUnknown parts follow: */
120 HRESULT WINAPI
IDirectMusicTool8Impl_QueryInterface (LPDIRECTMUSICTOOL8 iface
, REFIID riid
, LPVOID
*ppobj
)
122 ICOM_THIS(IDirectMusicTool8Impl
,iface
);
124 if (IsEqualGUID(riid
, &IID_IUnknown
) || IsEqualGUID(riid
, &IID_IDirectMusicTool8
))
126 IDirectMusicTool8Impl_AddRef(iface
);
130 WARN("(%p)->(%s,%p),not found\n",This
,debugstr_guid(riid
),ppobj
);
131 return E_NOINTERFACE
;
134 ULONG WINAPI
IDirectMusicTool8Impl_AddRef (LPDIRECTMUSICTOOL8 iface
)
136 ICOM_THIS(IDirectMusicTool8Impl
,iface
);
137 TRACE("(%p) : AddRef from %ld\n", This
, This
->ref
);
138 return ++(This
->ref
);
141 ULONG WINAPI
IDirectMusicTool8Impl_Release (LPDIRECTMUSICTOOL8 iface
)
143 ICOM_THIS(IDirectMusicTool8Impl
,iface
);
144 ULONG ref
= --This
->ref
;
145 TRACE("(%p) : ReleaseRef to %ld\n", This
, This
->ref
);
148 HeapFree(GetProcessHeap(), 0, This
);
153 /* IDirectMusicTool8 Interface follow: */
154 HRESULT WINAPI
IDirectMusicTool8Impl_Init (LPDIRECTMUSICTOOL8 iface
, IDirectMusicGraph
* pGraph
)
160 HRESULT WINAPI
IDirectMusicTool8Impl_GetMsgDeliveryType (LPDIRECTMUSICTOOL8 iface
, DWORD
* pdwDeliveryType
)
166 HRESULT WINAPI
IDirectMusicTool8Impl_GetMediaTypeArraySize (LPDIRECTMUSICTOOL8 iface
, DWORD
* pdwNumElements
)
172 HRESULT WINAPI
IDirectMusicTool8Impl_GetMediaTypes (LPDIRECTMUSICTOOL8 iface
, DWORD
** padwMediaTypes
, DWORD dwNumElements
)
178 HRESULT WINAPI
IDirectMusicTool8Impl_ProcessPMsg (LPDIRECTMUSICTOOL8 iface
, IDirectMusicPerformance
* pPerf
, DMUS_PMSG
* pPMSG
)
184 HRESULT WINAPI
IDirectMusicTool8Impl_Flush (LPDIRECTMUSICTOOL8 iface
, IDirectMusicPerformance
* pPerf
, DMUS_PMSG
* pPMSG
, REFERENCE_TIME rtTime
)
190 HRESULT WINAPI
IDirectMusicTool8Impl_Clone (LPDIRECTMUSICTOOL8 iface
, IDirectMusicTool
** ppTool
)
196 ICOM_VTABLE(IDirectMusicTool8
) DirectMusicTool8_Vtbl
=
198 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
199 IDirectMusicTool8Impl_QueryInterface
,
200 IDirectMusicTool8Impl_AddRef
,
201 IDirectMusicTool8Impl_Release
,
202 IDirectMusicTool8Impl_Init
,
203 IDirectMusicTool8Impl_GetMsgDeliveryType
,
204 IDirectMusicTool8Impl_GetMediaTypeArraySize
,
205 IDirectMusicTool8Impl_GetMediaTypes
,
206 IDirectMusicTool8Impl_ProcessPMsg
,
207 IDirectMusicTool8Impl_Flush
,
208 IDirectMusicTool8Impl_Clone
212 /* IDirectMusicTrack IUnknown parts follow: */
213 HRESULT WINAPI
IDirectMusicTrackImpl_QueryInterface (LPDIRECTMUSICTRACK iface
, REFIID riid
, LPVOID
*ppobj
)
215 ICOM_THIS(IDirectMusicTrackImpl
,iface
);
217 if (IsEqualGUID(riid
, &IID_IUnknown
) || IsEqualGUID(riid
, &IID_IDirectMusicTrack
))
219 IDirectMusicTrackImpl_AddRef(iface
);
223 WARN("(%p)->(%s,%p),not found\n",This
,debugstr_guid(riid
),ppobj
);
224 return E_NOINTERFACE
;
227 ULONG WINAPI
IDirectMusicTrackImpl_AddRef (LPDIRECTMUSICTRACK iface
)
229 ICOM_THIS(IDirectMusicTrackImpl
,iface
);
230 TRACE("(%p) : AddRef from %ld\n", This
, This
->ref
);
231 return ++(This
->ref
);
234 ULONG WINAPI
IDirectMusicTrackImpl_Release (LPDIRECTMUSICTRACK iface
)
236 ICOM_THIS(IDirectMusicTrackImpl
,iface
);
237 ULONG ref
= --This
->ref
;
238 TRACE("(%p) : ReleaseRef to %ld\n", This
, This
->ref
);
241 HeapFree(GetProcessHeap(), 0, This
);
245 /* IDirectMusicTrack Interface follow: */
246 HRESULT WINAPI
IDirectMusicTrackImpl_Init (LPDIRECTMUSICTRACK iface
, IDirectMusicSegment
* pSegment
)
252 HRESULT WINAPI
IDirectMusicTrackImpl_InitPlay (LPDIRECTMUSICTRACK iface
, IDirectMusicSegmentState
* pSegmentState
, IDirectMusicPerformance
* pPerformance
, void** ppStateData
, DWORD dwVirtualTrackID
, DWORD dwFlags
)
258 HRESULT WINAPI
IDirectMusicTrackImpl_EndPlay (LPDIRECTMUSICTRACK iface
, void* pStateData
)
264 HRESULT WINAPI
IDirectMusicTrackImpl_Play (LPDIRECTMUSICTRACK iface
, void* pStateData
, MUSIC_TIME mtStart
, MUSIC_TIME mtEnd
, MUSIC_TIME mtOffset
, DWORD dwFlags
, IDirectMusicPerformance
* pPerf
, IDirectMusicSegmentState
* pSegSt
, DWORD dwVirtualID
)
270 HRESULT WINAPI
IDirectMusicTrackImpl_GetParam (LPDIRECTMUSICTRACK iface
, REFGUID rguidType
, MUSIC_TIME mtTime
, MUSIC_TIME
* pmtNext
, void* pParam
)
276 HRESULT WINAPI
IDirectMusicTrackImpl_SetParam (LPDIRECTMUSICTRACK iface
, REFGUID rguidType
, MUSIC_TIME mtTime
, void* pParam
)
282 HRESULT WINAPI
IDirectMusicTrackImpl_IsParamSupported (LPDIRECTMUSICTRACK iface
, REFGUID rguidType
)
288 HRESULT WINAPI
IDirectMusicTrackImpl_AddNotificationType (LPDIRECTMUSICTRACK iface
, REFGUID rguidNotificationType
)
294 HRESULT WINAPI
IDirectMusicTrackImpl_RemoveNotificationType (LPDIRECTMUSICTRACK iface
, REFGUID rguidNotificationType
)
300 HRESULT WINAPI
IDirectMusicTrackImpl_Clone (LPDIRECTMUSICTRACK iface
, MUSIC_TIME mtStart
, MUSIC_TIME mtEnd
, IDirectMusicTrack
** ppTrack
)
306 ICOM_VTABLE(IDirectMusicTrack
) DirectMusicTrack_Vtbl
=
308 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
309 IDirectMusicTrackImpl_QueryInterface
,
310 IDirectMusicTrackImpl_AddRef
,
311 IDirectMusicTrackImpl_Release
,
312 IDirectMusicTrackImpl_Init
,
313 IDirectMusicTrackImpl_InitPlay
,
314 IDirectMusicTrackImpl_EndPlay
,
315 IDirectMusicTrackImpl_Play
,
316 IDirectMusicTrackImpl_GetParam
,
317 IDirectMusicTrackImpl_SetParam
,
318 IDirectMusicTrackImpl_IsParamSupported
,
319 IDirectMusicTrackImpl_AddNotificationType
,
320 IDirectMusicTrackImpl_RemoveNotificationType
,
321 IDirectMusicTrackImpl_Clone
324 /* IDirectMusicTrack8 IUnknown parts follow: */
325 HRESULT WINAPI
IDirectMusicTrack8Impl_QueryInterface (LPDIRECTMUSICTRACK8 iface
, REFIID riid
, LPVOID
*ppobj
)
327 ICOM_THIS(IDirectMusicTrack8Impl
,iface
);
329 if (IsEqualGUID(riid
, &IID_IUnknown
) || IsEqualGUID(riid
, &IID_IDirectMusicTrack8
))
331 IDirectMusicTrack8Impl_AddRef(iface
);
335 WARN("(%p)->(%s,%p),not found\n",This
,debugstr_guid(riid
),ppobj
);
336 return E_NOINTERFACE
;
339 ULONG WINAPI
IDirectMusicTrack8Impl_AddRef (LPDIRECTMUSICTRACK8 iface
)
341 ICOM_THIS(IDirectMusicTrack8Impl
,iface
);
342 TRACE("(%p) : AddRef from %ld\n", This
, This
->ref
);
343 return ++(This
->ref
);
346 ULONG WINAPI
IDirectMusicTrack8Impl_Release (LPDIRECTMUSICTRACK8 iface
)
348 ICOM_THIS(IDirectMusicTrack8Impl
,iface
);
349 ULONG ref
= --This
->ref
;
350 TRACE("(%p) : ReleaseRef to %ld\n", This
, This
->ref
);
353 HeapFree(GetProcessHeap(), 0, This
);
357 /* IDirectMusicTrack Interface part follow: */
358 HRESULT WINAPI
IDirectMusicTrack8Impl_Init (LPDIRECTMUSICTRACK8 iface
, IDirectMusicSegment
* pSegment
)
364 HRESULT WINAPI
IDirectMusicTrack8Impl_InitPlay (LPDIRECTMUSICTRACK8 iface
, IDirectMusicSegmentState
* pSegmentState
, IDirectMusicPerformance
* pPerformance
, void** ppStateData
, DWORD dwVirtualTrack8ID
, DWORD dwFlags
)
370 HRESULT WINAPI
IDirectMusicTrack8Impl_EndPlay (LPDIRECTMUSICTRACK8 iface
, void* pStateData
)
376 HRESULT WINAPI
IDirectMusicTrack8Impl_Play (LPDIRECTMUSICTRACK8 iface
, void* pStateData
, MUSIC_TIME mtStart
, MUSIC_TIME mtEnd
, MUSIC_TIME mtOffset
, DWORD dwFlags
, IDirectMusicPerformance
* pPerf
, IDirectMusicSegmentState
* pSegSt
, DWORD dwVirtualID
)
382 HRESULT WINAPI
IDirectMusicTrack8Impl_GetParam (LPDIRECTMUSICTRACK8 iface
, REFGUID rguidType
, MUSIC_TIME mtTime
, MUSIC_TIME
* pmtNext
, void* pParam
)
388 HRESULT WINAPI
IDirectMusicTrack8Impl_SetParam (LPDIRECTMUSICTRACK8 iface
, REFGUID rguidType
, MUSIC_TIME mtTime
, void* pParam
)
394 HRESULT WINAPI
IDirectMusicTrack8Impl_IsParamSupported (LPDIRECTMUSICTRACK8 iface
, REFGUID rguidType
)
400 HRESULT WINAPI
IDirectMusicTrack8Impl_AddNotificationType (LPDIRECTMUSICTRACK8 iface
, REFGUID rguidNotificationType
)
406 HRESULT WINAPI
IDirectMusicTrack8Impl_RemoveNotificationType (LPDIRECTMUSICTRACK8 iface
, REFGUID rguidNotificationType
)
412 HRESULT WINAPI
IDirectMusicTrack8Impl_Clone (LPDIRECTMUSICTRACK8 iface
, MUSIC_TIME mtStart
, MUSIC_TIME mtEnd
, IDirectMusicTrack
** ppTrack
)
418 /* IDirectMusicTrack8 Interface part follow: */
420 HRESULT WINAPI
IDirectMusicTrack8Impl_PlayEx (LPDIRECTMUSICTRACK8 iface
, void* pStateData
, REFERENCE_TIME rtStart
, REFERENCE_TIME rtEnd
, REFERENCE_TIME rtOffset
, DWORD dwFlags
, IDirectMusicPerformance
* pPerf
, IDirectMusicSegmentState
* pSegSt
, DWORD dwVirtualID
)
426 HRESULT WINAPI
IDirectMusicTrack8Impl_GetParamEx (LPDIRECTMUSICTRACK8 iface
, REFGUID rguidType
, REFERENCE_TIME rtTime
, REFERENCE_TIME
* prtNext
, void* pParam
, void* pStateData
, DWORD dwFlags
)
432 HRESULT WINAPI
IDirectMusicTrack8Impl_SetParamEx (LPDIRECTMUSICTRACK8 iface
, REFGUID rguidType
, REFERENCE_TIME rtTime
, void* pParam
, void* pStateData
, DWORD dwFlags
)
438 HRESULT WINAPI
IDirectMusicTrack8Impl_Compose (LPDIRECTMUSICTRACK8 iface
, IUnknown
* pContext
, DWORD dwTrackGroup
, IDirectMusicTrack
** ppResultTrack
)
444 HRESULT WINAPI
IDirectMusicTrack8Impl_Join (LPDIRECTMUSICTRACK8 iface
, IDirectMusicTrack
* pNewTrack
, MUSIC_TIME mtJoin
, IUnknown
* pContext
, DWORD dwTrackGroup
, IDirectMusicTrack
** ppResultTrack
)
450 ICOM_VTABLE(IDirectMusicTrack8
) DirectMusicTrack8_Vtbl
=
452 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
453 IDirectMusicTrack8Impl_QueryInterface
,
454 IDirectMusicTrack8Impl_AddRef
,
455 IDirectMusicTrack8Impl_Release
,
456 IDirectMusicTrack8Impl_Init
,
457 IDirectMusicTrack8Impl_InitPlay
,
458 IDirectMusicTrack8Impl_EndPlay
,
459 IDirectMusicTrack8Impl_Play
,
460 IDirectMusicTrack8Impl_GetParam
,
461 IDirectMusicTrack8Impl_SetParam
,
462 IDirectMusicTrack8Impl_IsParamSupported
,
463 IDirectMusicTrack8Impl_AddNotificationType
,
464 IDirectMusicTrack8Impl_RemoveNotificationType
,
465 IDirectMusicTrack8Impl_Clone
,
466 IDirectMusicTrack8Impl_PlayEx
,
467 IDirectMusicTrack8Impl_GetParamEx
,
468 IDirectMusicTrack8Impl_SetParamEx
,
469 IDirectMusicTrack8Impl_Compose
,
470 IDirectMusicTrack8Impl_Join