1 /* IDirectMusicTempoTrack 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.
24 #include "wine/debug.h"
26 #include "dmime_private.h"
28 WINE_DEFAULT_DEBUG_CHANNEL(dmime
);
29 WINE_DECLARE_DEBUG_CHANNEL(dmfile
);
31 /*****************************************************************************
32 * IDirectMusicTempoTrack implementation
34 /* IDirectMusicTempoTrack IUnknown part: */
35 HRESULT WINAPI
IDirectMusicTempoTrack_QueryInterface (LPDIRECTMUSICTRACK8 iface
, REFIID riid
, LPVOID
*ppobj
)
37 ICOM_THIS(IDirectMusicTempoTrack
,iface
);
39 if (IsEqualIID (riid
, &IID_IUnknown
) ||
40 IsEqualIID (riid
, &IID_IDirectMusicTrack
) ||
41 IsEqualIID (riid
, &IID_IDirectMusicTrack8
)) {
42 IDirectMusicTempoTrack_AddRef(iface
);
45 } else if (IsEqualIID (riid
, &IID_IPersistStream
)) {
46 IDirectMusicTempoTrackStream_AddRef ((LPPERSISTSTREAM
)This
->pStream
);
47 *ppobj
= This
->pStream
;
51 WARN("(%p)->(%s,%p),not found\n", This
, debugstr_guid(riid
), ppobj
);
55 ULONG WINAPI
IDirectMusicTempoTrack_AddRef (LPDIRECTMUSICTRACK8 iface
)
57 ICOM_THIS(IDirectMusicTempoTrack
,iface
);
58 TRACE("(%p) : AddRef from %ld\n", This
, This
->ref
);
62 ULONG WINAPI
IDirectMusicTempoTrack_Release (LPDIRECTMUSICTRACK8 iface
)
64 ICOM_THIS(IDirectMusicTempoTrack
,iface
);
65 ULONG ref
= --This
->ref
;
66 TRACE("(%p) : ReleaseRef to %ld\n", This
, This
->ref
);
68 HeapFree(GetProcessHeap(), 0, This
);
73 /* IDirectMusicTempoTrack IDirectMusicTrack part: */
74 HRESULT WINAPI
IDirectMusicTempoTrack_Init (LPDIRECTMUSICTRACK8 iface
, IDirectMusicSegment
* pSegment
)
76 ICOM_THIS(IDirectMusicTempoTrack
,iface
);
78 FIXME("(%p, %p): stub\n", This
, pSegment
);
83 HRESULT WINAPI
IDirectMusicTempoTrack_InitPlay (LPDIRECTMUSICTRACK8 iface
, IDirectMusicSegmentState
* pSegmentState
, IDirectMusicPerformance
* pPerformance
, void** ppStateData
, DWORD dwVirtualTrack8ID
, DWORD dwFlags
)
85 ICOM_THIS(IDirectMusicTempoTrack
,iface
);
87 FIXME("(%p, %p, %p, %p, %ld, %ld): stub\n", This
, pSegmentState
, pPerformance
, ppStateData
, dwVirtualTrack8ID
, dwFlags
);
92 HRESULT WINAPI
IDirectMusicTempoTrack_EndPlay (LPDIRECTMUSICTRACK8 iface
, void* pStateData
)
94 ICOM_THIS(IDirectMusicTempoTrack
,iface
);
96 FIXME("(%p, %p): stub\n", This
, pStateData
);
101 HRESULT WINAPI
IDirectMusicTempoTrack_Play (LPDIRECTMUSICTRACK8 iface
, void* pStateData
, MUSIC_TIME mtStart
, MUSIC_TIME mtEnd
, MUSIC_TIME mtOffset
, DWORD dwFlags
, IDirectMusicPerformance
* pPerf
, IDirectMusicSegmentState
* pSegSt
, DWORD dwVirtualID
)
103 ICOM_THIS(IDirectMusicTempoTrack
,iface
);
105 FIXME("(%p, %p, %ld, %ld, %ld, %ld, %p, %p, %ld): stub\n", This
, pStateData
, mtStart
, mtEnd
, mtOffset
, dwFlags
, pPerf
, pSegSt
, dwVirtualID
);
110 HRESULT WINAPI
IDirectMusicTempoTrack_GetParam (LPDIRECTMUSICTRACK8 iface
, REFGUID rguidType
, MUSIC_TIME mtTime
, MUSIC_TIME
* pmtNext
, void* pParam
)
112 ICOM_THIS(IDirectMusicTempoTrack
,iface
);
114 FIXME("(%p, %s, %ld, %p, %p): stub\n", This
, debugstr_guid(rguidType
), mtTime
, pmtNext
, pParam
);
119 HRESULT WINAPI
IDirectMusicTempoTrack_SetParam (LPDIRECTMUSICTRACK8 iface
, REFGUID rguidType
, MUSIC_TIME mtTime
, void* pParam
)
121 ICOM_THIS(IDirectMusicTempoTrack
,iface
);
123 FIXME("(%p, %s, %ld, %p): stub\n", This
, debugstr_guid(rguidType
), mtTime
, pParam
);
128 HRESULT WINAPI
IDirectMusicTempoTrack_IsParamSupported (LPDIRECTMUSICTRACK8 iface
, REFGUID rguidType
)
130 ICOM_THIS(IDirectMusicTempoTrack
,iface
);
132 TRACE("(%p, %s): ", This
, debugstr_guid(rguidType
));
133 if (IsEqualGUID (rguidType
, &GUID_DisableTempo
)
134 || IsEqualGUID (rguidType
, &GUID_EnableTempo
)
135 || IsEqualGUID (rguidType
, &GUID_TempoParam
)) {
136 TRACE("param supported\n");
140 TRACE("param unsupported\n");
141 return DMUS_E_TYPE_UNSUPPORTED
;
144 HRESULT WINAPI
IDirectMusicTempoTrack_AddNotificationType (LPDIRECTMUSICTRACK8 iface
, REFGUID rguidNotificationType
)
146 ICOM_THIS(IDirectMusicTempoTrack
,iface
);
148 FIXME("(%p, %s): stub\n", This
, debugstr_guid(rguidNotificationType
));
153 HRESULT WINAPI
IDirectMusicTempoTrack_RemoveNotificationType (LPDIRECTMUSICTRACK8 iface
, REFGUID rguidNotificationType
)
155 ICOM_THIS(IDirectMusicTempoTrack
,iface
);
157 FIXME("(%p, %s): stub\n", This
, debugstr_guid(rguidNotificationType
));
162 HRESULT WINAPI
IDirectMusicTempoTrack_Clone (LPDIRECTMUSICTRACK8 iface
, MUSIC_TIME mtStart
, MUSIC_TIME mtEnd
, IDirectMusicTrack
** ppTrack
)
164 ICOM_THIS(IDirectMusicTempoTrack
,iface
);
166 FIXME("(%p, %ld, %ld, %p): stub\n", This
, mtStart
, mtEnd
, ppTrack
);
171 /* IDirectMusicTempoTrack IDirectMusicTrack8 part: */
172 HRESULT WINAPI
IDirectMusicTempoTrack_PlayEx (LPDIRECTMUSICTRACK8 iface
, void* pStateData
, REFERENCE_TIME rtStart
, REFERENCE_TIME rtEnd
, REFERENCE_TIME rtOffset
, DWORD dwFlags
, IDirectMusicPerformance
* pPerf
, IDirectMusicSegmentState
* pSegSt
, DWORD dwVirtualID
)
174 ICOM_THIS(IDirectMusicTempoTrack
,iface
);
176 FIXME("(%p, %p, %lli, %lli, %lli, %ld, %p, %p, %ld): stub\n", This
, pStateData
, rtStart
, rtEnd
, rtOffset
, dwFlags
, pPerf
, pSegSt
, dwVirtualID
);
181 HRESULT WINAPI
IDirectMusicTempoTrack_GetParamEx (LPDIRECTMUSICTRACK8 iface
, REFGUID rguidType
, REFERENCE_TIME rtTime
, REFERENCE_TIME
* prtNext
, void* pParam
, void* pStateData
, DWORD dwFlags
)
183 ICOM_THIS(IDirectMusicTempoTrack
,iface
);
185 FIXME("(%p, %s, %lli, %p, %p, %p, %ld): stub\n", This
, debugstr_guid(rguidType
), rtTime
, prtNext
, pParam
, pStateData
, dwFlags
);
190 HRESULT WINAPI
IDirectMusicTempoTrack_SetParamEx (LPDIRECTMUSICTRACK8 iface
, REFGUID rguidType
, REFERENCE_TIME rtTime
, void* pParam
, void* pStateData
, DWORD dwFlags
)
192 ICOM_THIS(IDirectMusicTempoTrack
,iface
);
194 FIXME("(%p, %s, %lli, %p, %p, %ld): stub\n", This
, debugstr_guid(rguidType
), rtTime
, pParam
, pStateData
, dwFlags
);
199 HRESULT WINAPI
IDirectMusicTempoTrack_Compose (LPDIRECTMUSICTRACK8 iface
, IUnknown
* pContext
, DWORD dwTrackGroup
, IDirectMusicTrack
** ppResultTrack
)
201 ICOM_THIS(IDirectMusicTempoTrack
,iface
);
203 FIXME("(%p, %p, %ld, %p): stub\n", This
, pContext
, dwTrackGroup
, ppResultTrack
);
208 HRESULT WINAPI
IDirectMusicTempoTrack_Join (LPDIRECTMUSICTRACK8 iface
, IDirectMusicTrack
* pNewTrack
, MUSIC_TIME mtJoin
, IUnknown
* pContext
, DWORD dwTrackGroup
, IDirectMusicTrack
** ppResultTrack
)
210 ICOM_THIS(IDirectMusicTempoTrack
,iface
);
212 FIXME("(%p, %p, %ld, %p, %ld, %p): stub\n", This
, pNewTrack
, mtJoin
, pContext
, dwTrackGroup
, ppResultTrack
);
217 ICOM_VTABLE(IDirectMusicTrack8
) DirectMusicTempoTrack_Vtbl
=
219 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
220 IDirectMusicTempoTrack_QueryInterface
,
221 IDirectMusicTempoTrack_AddRef
,
222 IDirectMusicTempoTrack_Release
,
223 IDirectMusicTempoTrack_Init
,
224 IDirectMusicTempoTrack_InitPlay
,
225 IDirectMusicTempoTrack_EndPlay
,
226 IDirectMusicTempoTrack_Play
,
227 IDirectMusicTempoTrack_GetParam
,
228 IDirectMusicTempoTrack_SetParam
,
229 IDirectMusicTempoTrack_IsParamSupported
,
230 IDirectMusicTempoTrack_AddNotificationType
,
231 IDirectMusicTempoTrack_RemoveNotificationType
,
232 IDirectMusicTempoTrack_Clone
,
233 IDirectMusicTempoTrack_PlayEx
,
234 IDirectMusicTempoTrack_GetParamEx
,
235 IDirectMusicTempoTrack_SetParamEx
,
236 IDirectMusicTempoTrack_Compose
,
237 IDirectMusicTempoTrack_Join
240 /* for ClassFactory */
241 HRESULT WINAPI
DMUSIC_CreateDirectMusicTempoTrack (LPCGUID lpcGUID
, LPDIRECTMUSICTRACK8
*ppTrack
, LPUNKNOWN pUnkOuter
)
243 IDirectMusicTempoTrack
* track
;
245 if (IsEqualIID (lpcGUID
, &IID_IDirectMusicTrack
)
246 || IsEqualIID (lpcGUID
, &IID_IDirectMusicTrack8
)) {
247 track
= HeapAlloc (GetProcessHeap(), HEAP_ZERO_MEMORY
, sizeof(IDirectMusicTempoTrack
));
249 *ppTrack
= (LPDIRECTMUSICTRACK8
) NULL
;
250 return E_OUTOFMEMORY
;
252 track
->lpVtbl
= &DirectMusicTempoTrack_Vtbl
;
254 track
->pStream
= HeapAlloc (GetProcessHeap (), HEAP_ZERO_MEMORY
, sizeof(IDirectMusicTempoTrackStream
));
255 track
->pStream
->lpVtbl
= &DirectMusicTempoTrackStream_Vtbl
;
256 track
->pStream
->ref
= 1;
257 track
->pStream
->pParentTrack
= track
;
258 *ppTrack
= (LPDIRECTMUSICTRACK8
) track
;
261 WARN("No interface found\n");
263 return E_NOINTERFACE
;
267 /*****************************************************************************
268 * IDirectMusicTempoTrackStream implementation
270 /* IDirectMusicTempoTrackStream IUnknown part follow: */
271 HRESULT WINAPI
IDirectMusicTempoTrackStream_QueryInterface (LPPERSISTSTREAM iface
, REFIID riid
, LPVOID
*ppobj
)
273 ICOM_THIS(IDirectMusicTempoTrackStream
,iface
);
275 if (IsEqualIID (riid
, &IID_IUnknown
)
276 || IsEqualIID (riid
, &IID_IPersistStream
)) {
277 IDirectMusicTempoTrackStream_AddRef(iface
);
281 WARN("(%p)->(%s,%p),not found\n", This
, debugstr_guid(riid
),ppobj
);
282 return E_NOINTERFACE
;
285 ULONG WINAPI
IDirectMusicTempoTrackStream_AddRef (LPPERSISTSTREAM iface
)
287 ICOM_THIS(IDirectMusicTempoTrackStream
,iface
);
288 TRACE("(%p) : AddRef from %ld\n", This
, This
->ref
);
289 return ++(This
->ref
);
292 ULONG WINAPI
IDirectMusicTempoTrackStream_Release (LPPERSISTSTREAM iface
)
294 ICOM_THIS(IDirectMusicTempoTrackStream
,iface
);
295 ULONG ref
= --This
->ref
;
296 TRACE("(%p) : ReleaseRef to %ld\n", This
, This
->ref
);
298 HeapFree(GetProcessHeap(), 0, This
);
303 /* IDirectMusicTempoTrackStream IPersist part: */
304 HRESULT WINAPI
IDirectMusicTempoTrackStream_GetClassID (LPPERSISTSTREAM iface
, CLSID
* pClassID
)
309 /* IDirectMusicTempoTrackStream IPersistStream part: */
310 HRESULT WINAPI
IDirectMusicTempoTrackStream_IsDirty (LPPERSISTSTREAM iface
)
315 HRESULT WINAPI
IDirectMusicTempoTrackStream_Load (LPPERSISTSTREAM iface
, IStream
* pStm
)
317 FIXME(": Loading not implemented yet\n");
321 HRESULT WINAPI
IDirectMusicTempoTrackStream_Save (LPPERSISTSTREAM iface
, IStream
* pStm
, BOOL fClearDirty
)
326 HRESULT WINAPI
IDirectMusicTempoTrackStream_GetSizeMax (LPPERSISTSTREAM iface
, ULARGE_INTEGER
* pcbSize
)
331 ICOM_VTABLE(IPersistStream
) DirectMusicTempoTrackStream_Vtbl
=
333 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
334 IDirectMusicTempoTrackStream_QueryInterface
,
335 IDirectMusicTempoTrackStream_AddRef
,
336 IDirectMusicTempoTrackStream_Release
,
337 IDirectMusicTempoTrackStream_GetClassID
,
338 IDirectMusicTempoTrackStream_IsDirty
,
339 IDirectMusicTempoTrackStream_Load
,
340 IDirectMusicTempoTrackStream_Save
,
341 IDirectMusicTempoTrackStream_GetSizeMax