1 /* IDirectMusicParamControlTrack Implementation
3 * Copyright (C) 2003 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.
26 #include "wine/debug.h"
28 #include "dmime_private.h"
30 WINE_DEFAULT_DEBUG_CHANNEL(dmime
);
31 WINE_DECLARE_DEBUG_CHANNEL(dmfile
);
33 /*****************************************************************************
34 * IDirectMusicParamControlTrack implementation
36 /* IDirectMusicParamControlTrack IUnknown part: */
37 HRESULT WINAPI
IDirectMusicParamControlTrack_QueryInterface (LPDIRECTMUSICTRACK8 iface
, REFIID riid
, LPVOID
*ppobj
)
39 ICOM_THIS(IDirectMusicParamControlTrack
,iface
);
41 if (IsEqualIID (riid
, &IID_IUnknown
) ||
42 IsEqualIID (riid
, &IID_IDirectMusicTrack
) ||
43 IsEqualIID (riid
, &IID_IDirectMusicTrack8
)) {
44 IDirectMusicParamControlTrack_AddRef(iface
);
47 } else if (IsEqualIID (riid
, &IID_IPersistStream
)) {
48 IDirectMusicParamControlTrackStream_AddRef ((LPPERSISTSTREAM
)This
->pStream
);
49 *ppobj
= This
->pStream
;
52 WARN("(%p)->(%s,%p),not found\n", This
, debugstr_guid(riid
), ppobj
);
56 ULONG WINAPI
IDirectMusicParamControlTrack_AddRef (LPDIRECTMUSICTRACK8 iface
)
58 ICOM_THIS(IDirectMusicParamControlTrack
,iface
);
59 TRACE("(%p) : AddRef from %ld\n", This
, This
->ref
);
63 ULONG WINAPI
IDirectMusicParamControlTrack_Release (LPDIRECTMUSICTRACK8 iface
)
65 ICOM_THIS(IDirectMusicParamControlTrack
,iface
);
66 ULONG ref
= --This
->ref
;
67 TRACE("(%p) : ReleaseRef to %ld\n", This
, This
->ref
);
69 HeapFree(GetProcessHeap(), 0, This
);
74 /* IDirectMusicParamControlTrack IDirectMusicTrack part: */
75 HRESULT WINAPI
IDirectMusicParamControlTrack_Init (LPDIRECTMUSICTRACK8 iface
, IDirectMusicSegment
* pSegment
)
77 ICOM_THIS(IDirectMusicParamControlTrack
,iface
);
79 FIXME("(%p, %p): stub\n", This
, pSegment
);
84 HRESULT WINAPI
IDirectMusicParamControlTrack_InitPlay (LPDIRECTMUSICTRACK8 iface
, IDirectMusicSegmentState
* pSegmentState
, IDirectMusicPerformance
* pPerformance
, void** ppStateData
, DWORD dwVirtualTrack8ID
, DWORD dwFlags
)
86 ICOM_THIS(IDirectMusicParamControlTrack
,iface
);
88 FIXME("(%p, %p, %p, %p, %ld, %ld): stub\n", This
, pSegmentState
, pPerformance
, ppStateData
, dwVirtualTrack8ID
, dwFlags
);
93 HRESULT WINAPI
IDirectMusicParamControlTrack_EndPlay (LPDIRECTMUSICTRACK8 iface
, void* pStateData
)
95 ICOM_THIS(IDirectMusicParamControlTrack
,iface
);
97 FIXME("(%p, %p): stub\n", This
, pStateData
);
102 HRESULT WINAPI
IDirectMusicParamControlTrack_Play (LPDIRECTMUSICTRACK8 iface
, void* pStateData
, MUSIC_TIME mtStart
, MUSIC_TIME mtEnd
, MUSIC_TIME mtOffset
, DWORD dwFlags
, IDirectMusicPerformance
* pPerf
, IDirectMusicSegmentState
* pSegSt
, DWORD dwVirtualID
)
104 ICOM_THIS(IDirectMusicParamControlTrack
,iface
);
106 FIXME("(%p, %p, %ld, %ld, %ld, %ld, %p, %p, %ld): stub\n", This
, pStateData
, mtStart
, mtEnd
, mtOffset
, dwFlags
, pPerf
, pSegSt
, dwVirtualID
);
111 HRESULT WINAPI
IDirectMusicParamControlTrack_GetParam (LPDIRECTMUSICTRACK8 iface
, REFGUID rguidType
, MUSIC_TIME mtTime
, MUSIC_TIME
* pmtNext
, void* pParam
)
113 ICOM_THIS(IDirectMusicParamControlTrack
,iface
);
115 FIXME("(%p, %s, %ld, %p, %p): stub\n", This
, debugstr_guid(rguidType
), mtTime
, pmtNext
, pParam
);
120 HRESULT WINAPI
IDirectMusicParamControlTrack_SetParam (LPDIRECTMUSICTRACK8 iface
, REFGUID rguidType
, MUSIC_TIME mtTime
, void* pParam
)
122 ICOM_THIS(IDirectMusicParamControlTrack
,iface
);
124 FIXME("(%p, %s, %ld, %p): stub\n", This
, debugstr_guid(rguidType
), mtTime
, pParam
);
129 HRESULT WINAPI
IDirectMusicParamControlTrack_IsParamSupported (LPDIRECTMUSICTRACK8 iface
, REFGUID rguidType
)
131 ICOM_THIS(IDirectMusicParamControlTrack
,iface
);
133 TRACE("(%p, %s): ", This
, debugstr_guid(rguidType
));
134 /* didn't find any params */
136 TRACE("param unsupported\n");
137 return DMUS_E_TYPE_UNSUPPORTED
;
140 HRESULT WINAPI
IDirectMusicParamControlTrack_AddNotificationType (LPDIRECTMUSICTRACK8 iface
, REFGUID rguidNotificationType
)
142 ICOM_THIS(IDirectMusicParamControlTrack
,iface
);
144 FIXME("(%p, %s): stub\n", This
, debugstr_guid(rguidNotificationType
));
149 HRESULT WINAPI
IDirectMusicParamControlTrack_RemoveNotificationType (LPDIRECTMUSICTRACK8 iface
, REFGUID rguidNotificationType
)
151 ICOM_THIS(IDirectMusicParamControlTrack
,iface
);
153 FIXME("(%p, %s): stub\n", This
, debugstr_guid(rguidNotificationType
));
158 HRESULT WINAPI
IDirectMusicParamControlTrack_Clone (LPDIRECTMUSICTRACK8 iface
, MUSIC_TIME mtStart
, MUSIC_TIME mtEnd
, IDirectMusicTrack
** ppTrack
)
160 ICOM_THIS(IDirectMusicParamControlTrack
,iface
);
162 FIXME("(%p, %ld, %ld, %p): stub\n", This
, mtStart
, mtEnd
, ppTrack
);
167 /* IDirectMusicParamControlTrack IDirectMusicTrack8 part: */
168 HRESULT WINAPI
IDirectMusicParamControlTrack_PlayEx (LPDIRECTMUSICTRACK8 iface
, void* pStateData
, REFERENCE_TIME rtStart
, REFERENCE_TIME rtEnd
, REFERENCE_TIME rtOffset
, DWORD dwFlags
, IDirectMusicPerformance
* pPerf
, IDirectMusicSegmentState
* pSegSt
, DWORD dwVirtualID
)
170 ICOM_THIS(IDirectMusicParamControlTrack
,iface
);
172 FIXME("(%p, %p, %lli, %lli, %lli, %ld, %p, %p, %ld): stub\n", This
, pStateData
, rtStart
, rtEnd
, rtOffset
, dwFlags
, pPerf
, pSegSt
, dwVirtualID
);
177 HRESULT WINAPI
IDirectMusicParamControlTrack_GetParamEx (LPDIRECTMUSICTRACK8 iface
, REFGUID rguidType
, REFERENCE_TIME rtTime
, REFERENCE_TIME
* prtNext
, void* pParam
, void* pStateData
, DWORD dwFlags
)
179 ICOM_THIS(IDirectMusicParamControlTrack
,iface
);
181 FIXME("(%p, %s, %lli, %p, %p, %p, %ld): stub\n", This
, debugstr_guid(rguidType
), rtTime
, prtNext
, pParam
, pStateData
, dwFlags
);
186 HRESULT WINAPI
IDirectMusicParamControlTrack_SetParamEx (LPDIRECTMUSICTRACK8 iface
, REFGUID rguidType
, REFERENCE_TIME rtTime
, void* pParam
, void* pStateData
, DWORD dwFlags
)
188 ICOM_THIS(IDirectMusicParamControlTrack
,iface
);
190 FIXME("(%p, %s, %lli, %p, %p, %ld): stub\n", This
, debugstr_guid(rguidType
), rtTime
, pParam
, pStateData
, dwFlags
);
195 HRESULT WINAPI
IDirectMusicParamControlTrack_Compose (LPDIRECTMUSICTRACK8 iface
, IUnknown
* pContext
, DWORD dwTrackGroup
, IDirectMusicTrack
** ppResultTrack
)
197 ICOM_THIS(IDirectMusicParamControlTrack
,iface
);
199 FIXME("(%p, %p, %ld, %p): stub\n", This
, pContext
, dwTrackGroup
, ppResultTrack
);
204 HRESULT WINAPI
IDirectMusicParamControlTrack_Join (LPDIRECTMUSICTRACK8 iface
, IDirectMusicTrack
* pNewTrack
, MUSIC_TIME mtJoin
, IUnknown
* pContext
, DWORD dwTrackGroup
, IDirectMusicTrack
** ppResultTrack
)
206 ICOM_THIS(IDirectMusicParamControlTrack
,iface
);
208 FIXME("(%p, %p, %ld, %p, %ld, %p): stub\n", This
, pNewTrack
, mtJoin
, pContext
, dwTrackGroup
, ppResultTrack
);
213 ICOM_VTABLE(IDirectMusicTrack8
) DirectMusicParamControlTrack_Vtbl
=
215 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
216 IDirectMusicParamControlTrack_QueryInterface
,
217 IDirectMusicParamControlTrack_AddRef
,
218 IDirectMusicParamControlTrack_Release
,
219 IDirectMusicParamControlTrack_Init
,
220 IDirectMusicParamControlTrack_InitPlay
,
221 IDirectMusicParamControlTrack_EndPlay
,
222 IDirectMusicParamControlTrack_Play
,
223 IDirectMusicParamControlTrack_GetParam
,
224 IDirectMusicParamControlTrack_SetParam
,
225 IDirectMusicParamControlTrack_IsParamSupported
,
226 IDirectMusicParamControlTrack_AddNotificationType
,
227 IDirectMusicParamControlTrack_RemoveNotificationType
,
228 IDirectMusicParamControlTrack_Clone
,
229 IDirectMusicParamControlTrack_PlayEx
,
230 IDirectMusicParamControlTrack_GetParamEx
,
231 IDirectMusicParamControlTrack_SetParamEx
,
232 IDirectMusicParamControlTrack_Compose
,
233 IDirectMusicParamControlTrack_Join
236 /* for ClassFactory */
237 HRESULT WINAPI
DMUSIC_CreateDirectMusicParamControlTrack (LPCGUID lpcGUID
, LPDIRECTMUSICTRACK8
*ppTrack
, LPUNKNOWN pUnkOuter
)
239 IDirectMusicParamControlTrack
* track
;
241 if (IsEqualIID (lpcGUID
, &IID_IDirectMusicTrack
)
242 || IsEqualIID (lpcGUID
, &IID_IDirectMusicTrack8
)) {
243 track
= HeapAlloc (GetProcessHeap(), HEAP_ZERO_MEMORY
, sizeof(IDirectMusicParamControlTrack
));
245 *ppTrack
= (LPDIRECTMUSICTRACK8
) NULL
;
246 return E_OUTOFMEMORY
;
248 track
->lpVtbl
= &DirectMusicParamControlTrack_Vtbl
;
250 track
->pStream
= HeapAlloc (GetProcessHeap (), HEAP_ZERO_MEMORY
, sizeof(IDirectMusicParamControlTrackStream
));
251 track
->pStream
->lpVtbl
= &DirectMusicParamControlTrackStream_Vtbl
;
252 track
->pStream
->ref
= 1;
253 track
->pStream
->pParentTrack
= track
;
254 *ppTrack
= (LPDIRECTMUSICTRACK8
) track
;
257 WARN("No interface found\n");
259 return E_NOINTERFACE
;
263 /*****************************************************************************
264 * IDirectMusicParamControlTrackStream implementation
266 /* IDirectMusicParamControlTrackStream IUnknown part follow: */
267 HRESULT WINAPI
IDirectMusicParamControlTrackStream_QueryInterface (LPPERSISTSTREAM iface
, REFIID riid
, LPVOID
*ppobj
)
269 ICOM_THIS(IDirectMusicParamControlTrackStream
,iface
);
271 if (IsEqualIID (riid
, &IID_IUnknown
)
272 || IsEqualIID (riid
, &IID_IPersistStream
)) {
273 IDirectMusicParamControlTrackStream_AddRef(iface
);
277 WARN("(%p)->(%s,%p),not found\n",This
,debugstr_guid(riid
),ppobj
);
278 return E_NOINTERFACE
;
281 ULONG WINAPI
IDirectMusicParamControlTrackStream_AddRef (LPPERSISTSTREAM iface
)
283 ICOM_THIS(IDirectMusicParamControlTrackStream
,iface
);
284 TRACE("(%p) : AddRef from %ld\n", This
, This
->ref
);
285 return ++(This
->ref
);
288 ULONG WINAPI
IDirectMusicParamControlTrackStream_Release (LPPERSISTSTREAM iface
)
290 ICOM_THIS(IDirectMusicParamControlTrackStream
,iface
);
291 ULONG ref
= --This
->ref
;
292 TRACE("(%p) : ReleaseRef to %ld\n", This
, This
->ref
);
294 HeapFree(GetProcessHeap(), 0, This
);
299 /* IDirectMusicParamControlTrackStream IPersist part: */
300 HRESULT WINAPI
IDirectMusicParamControlTrackStream_GetClassID (LPPERSISTSTREAM iface
, CLSID
* pClassID
)
305 /* IDirectMusicParamControlTrackStream IPersistStream part: */
306 HRESULT WINAPI
IDirectMusicParamControlTrackStream_IsDirty (LPPERSISTSTREAM iface
)
311 HRESULT WINAPI
IDirectMusicParamControlTrackStream_Load (LPPERSISTSTREAM iface
, IStream
* pStm
)
313 FIXME(": Loading not implemented yet\n");
317 HRESULT WINAPI
IDirectMusicParamControlTrackStream_Save (LPPERSISTSTREAM iface
, IStream
* pStm
, BOOL fClearDirty
)
322 HRESULT WINAPI
IDirectMusicParamControlTrackStream_GetSizeMax (LPPERSISTSTREAM iface
, ULARGE_INTEGER
* pcbSize
)
327 ICOM_VTABLE(IPersistStream
) DirectMusicParamControlTrackStream_Vtbl
=
329 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
330 IDirectMusicParamControlTrackStream_QueryInterface
,
331 IDirectMusicParamControlTrackStream_AddRef
,
332 IDirectMusicParamControlTrackStream_Release
,
333 IDirectMusicParamControlTrackStream_GetClassID
,
334 IDirectMusicParamControlTrackStream_IsDirty
,
335 IDirectMusicParamControlTrackStream_Load
,
336 IDirectMusicParamControlTrackStream_Save
,
337 IDirectMusicParamControlTrackStream_GetSizeMax