1 /* IDirectMusicLyricsTrack 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 * IDirectMusicLyricsTrack implementation
36 /* IDirectMusicLyricsTrack IUnknown part: */
37 HRESULT WINAPI
IDirectMusicLyricsTrack_QueryInterface (LPDIRECTMUSICTRACK8 iface
, REFIID riid
, LPVOID
*ppobj
)
39 ICOM_THIS(IDirectMusicLyricsTrack
,iface
);
41 if (IsEqualIID (riid
, &IID_IUnknown
) ||
42 IsEqualIID (riid
, &IID_IDirectMusicTrack
) ||
43 IsEqualIID (riid
, &IID_IDirectMusicTrack8
)) {
44 IDirectMusicLyricsTrack_AddRef(iface
);
47 } else if (IsEqualIID (riid
, &IID_IPersistStream
)) {
48 IDirectMusicLyricsTrackStream_AddRef ((LPPERSISTSTREAM
)This
->pStream
);
49 *ppobj
= This
->pStream
;
52 WARN("(%p)->(%s,%p),not found\n", This
, debugstr_guid(riid
), ppobj
);
56 ULONG WINAPI
IDirectMusicLyricsTrack_AddRef (LPDIRECTMUSICTRACK8 iface
)
58 ICOM_THIS(IDirectMusicLyricsTrack
,iface
);
59 TRACE("(%p) : AddRef from %ld\n", This
, This
->ref
);
63 ULONG WINAPI
IDirectMusicLyricsTrack_Release (LPDIRECTMUSICTRACK8 iface
)
65 ICOM_THIS(IDirectMusicLyricsTrack
,iface
);
66 ULONG ref
= --This
->ref
;
67 TRACE("(%p) : ReleaseRef to %ld\n", This
, This
->ref
);
69 HeapFree(GetProcessHeap(), 0, This
);
74 /* IDirectMusicLyricsTrack IDirectMusicTrack part: */
75 HRESULT WINAPI
IDirectMusicLyricsTrack_Init (LPDIRECTMUSICTRACK8 iface
, IDirectMusicSegment
* pSegment
)
77 ICOM_THIS(IDirectMusicLyricsTrack
,iface
);
79 FIXME("(%p, %p): stub\n", This
, pSegment
);
84 HRESULT WINAPI
IDirectMusicLyricsTrack_InitPlay (LPDIRECTMUSICTRACK8 iface
, IDirectMusicSegmentState
* pSegmentState
, IDirectMusicPerformance
* pPerformance
, void** ppStateData
, DWORD dwVirtualTrack8ID
, DWORD dwFlags
)
86 ICOM_THIS(IDirectMusicLyricsTrack
,iface
);
88 FIXME("(%p, %p, %p, %p, %ld, %ld): stub\n", This
, pSegmentState
, pPerformance
, ppStateData
, dwVirtualTrack8ID
, dwFlags
);
93 HRESULT WINAPI
IDirectMusicLyricsTrack_EndPlay (LPDIRECTMUSICTRACK8 iface
, void* pStateData
)
95 ICOM_THIS(IDirectMusicLyricsTrack
,iface
);
97 FIXME("(%p, %p): stub\n", This
, pStateData
);
102 HRESULT WINAPI
IDirectMusicLyricsTrack_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(IDirectMusicLyricsTrack
,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
IDirectMusicLyricsTrack_GetParam (LPDIRECTMUSICTRACK8 iface
, REFGUID rguidType
, MUSIC_TIME mtTime
, MUSIC_TIME
* pmtNext
, void* pParam
)
113 ICOM_THIS(IDirectMusicLyricsTrack
,iface
);
115 FIXME("(%p, %s, %ld, %p, %p): stub\n", This
, debugstr_guid(rguidType
), mtTime
, pmtNext
, pParam
);
120 HRESULT WINAPI
IDirectMusicLyricsTrack_SetParam (LPDIRECTMUSICTRACK8 iface
, REFGUID rguidType
, MUSIC_TIME mtTime
, void* pParam
)
122 ICOM_THIS(IDirectMusicLyricsTrack
,iface
);
124 FIXME("(%p, %s, %ld, %p): stub\n", This
, debugstr_guid(rguidType
), mtTime
, pParam
);
129 HRESULT WINAPI
IDirectMusicLyricsTrack_IsParamSupported (LPDIRECTMUSICTRACK8 iface
, REFGUID rguidType
)
131 ICOM_THIS(IDirectMusicLyricsTrack
,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
IDirectMusicLyricsTrack_AddNotificationType (LPDIRECTMUSICTRACK8 iface
, REFGUID rguidNotificationType
)
142 ICOM_THIS(IDirectMusicLyricsTrack
,iface
);
144 FIXME("(%p, %s): stub\n", This
, debugstr_guid(rguidNotificationType
));
149 HRESULT WINAPI
IDirectMusicLyricsTrack_RemoveNotificationType (LPDIRECTMUSICTRACK8 iface
, REFGUID rguidNotificationType
)
151 ICOM_THIS(IDirectMusicLyricsTrack
,iface
);
153 FIXME("(%p, %s): stub\n", This
, debugstr_guid(rguidNotificationType
));
158 HRESULT WINAPI
IDirectMusicLyricsTrack_Clone (LPDIRECTMUSICTRACK8 iface
, MUSIC_TIME mtStart
, MUSIC_TIME mtEnd
, IDirectMusicTrack
** ppTrack
)
160 ICOM_THIS(IDirectMusicLyricsTrack
,iface
);
162 FIXME("(%p, %ld, %ld, %p): stub\n", This
, mtStart
, mtEnd
, ppTrack
);
167 /* IDirectMusicLyricsTrack IDirectMusicTrack8 part: */
168 HRESULT WINAPI
IDirectMusicLyricsTrack_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(IDirectMusicLyricsTrack
,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
IDirectMusicLyricsTrack_GetParamEx (LPDIRECTMUSICTRACK8 iface
, REFGUID rguidType
, REFERENCE_TIME rtTime
, REFERENCE_TIME
* prtNext
, void* pParam
, void* pStateData
, DWORD dwFlags
)
179 ICOM_THIS(IDirectMusicLyricsTrack
,iface
);
181 FIXME("(%p, %s, %lli, %p, %p, %p, %ld): stub\n", This
, debugstr_guid(rguidType
), rtTime
, prtNext
, pParam
, pStateData
, dwFlags
);
186 HRESULT WINAPI
IDirectMusicLyricsTrack_SetParamEx (LPDIRECTMUSICTRACK8 iface
, REFGUID rguidType
, REFERENCE_TIME rtTime
, void* pParam
, void* pStateData
, DWORD dwFlags
)
188 ICOM_THIS(IDirectMusicLyricsTrack
,iface
);
190 FIXME("(%p, %s, %lli, %p, %p, %ld): stub\n", This
, debugstr_guid(rguidType
), rtTime
, pParam
, pStateData
, dwFlags
);
195 HRESULT WINAPI
IDirectMusicLyricsTrack_Compose (LPDIRECTMUSICTRACK8 iface
, IUnknown
* pContext
, DWORD dwTrackGroup
, IDirectMusicTrack
** ppResultTrack
)
197 ICOM_THIS(IDirectMusicLyricsTrack
,iface
);
199 FIXME("(%p, %p, %ld, %p): stub\n", This
, pContext
, dwTrackGroup
, ppResultTrack
);
204 HRESULT WINAPI
IDirectMusicLyricsTrack_Join (LPDIRECTMUSICTRACK8 iface
, IDirectMusicTrack
* pNewTrack
, MUSIC_TIME mtJoin
, IUnknown
* pContext
, DWORD dwTrackGroup
, IDirectMusicTrack
** ppResultTrack
)
206 ICOM_THIS(IDirectMusicLyricsTrack
,iface
);
208 FIXME("(%p, %p, %ld, %p, %ld, %p): stub\n", This
, pNewTrack
, mtJoin
, pContext
, dwTrackGroup
, ppResultTrack
);
213 ICOM_VTABLE(IDirectMusicTrack8
) DirectMusicLyricsTrack_Vtbl
=
215 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
216 IDirectMusicLyricsTrack_QueryInterface
,
217 IDirectMusicLyricsTrack_AddRef
,
218 IDirectMusicLyricsTrack_Release
,
219 IDirectMusicLyricsTrack_Init
,
220 IDirectMusicLyricsTrack_InitPlay
,
221 IDirectMusicLyricsTrack_EndPlay
,
222 IDirectMusicLyricsTrack_Play
,
223 IDirectMusicLyricsTrack_GetParam
,
224 IDirectMusicLyricsTrack_SetParam
,
225 IDirectMusicLyricsTrack_IsParamSupported
,
226 IDirectMusicLyricsTrack_AddNotificationType
,
227 IDirectMusicLyricsTrack_RemoveNotificationType
,
228 IDirectMusicLyricsTrack_Clone
,
229 IDirectMusicLyricsTrack_PlayEx
,
230 IDirectMusicLyricsTrack_GetParamEx
,
231 IDirectMusicLyricsTrack_SetParamEx
,
232 IDirectMusicLyricsTrack_Compose
,
233 IDirectMusicLyricsTrack_Join
236 /* for ClassFactory */
237 HRESULT WINAPI
DMUSIC_CreateDirectMusicLyricsTrack (LPCGUID lpcGUID
, LPDIRECTMUSICTRACK8
*ppTrack
, LPUNKNOWN pUnkOuter
)
239 IDirectMusicLyricsTrack
* track
;
241 if (IsEqualIID (lpcGUID
, &IID_IDirectMusicTrack
)
242 || IsEqualIID (lpcGUID
, &IID_IDirectMusicTrack8
)) {
243 track
= HeapAlloc (GetProcessHeap(), HEAP_ZERO_MEMORY
, sizeof(IDirectMusicLyricsTrack
));
245 *ppTrack
= (LPDIRECTMUSICTRACK8
) NULL
;
246 return E_OUTOFMEMORY
;
248 track
->lpVtbl
= &DirectMusicLyricsTrack_Vtbl
;
250 track
->pStream
= HeapAlloc (GetProcessHeap (), HEAP_ZERO_MEMORY
, sizeof(IDirectMusicLyricsTrackStream
));
251 track
->pStream
->lpVtbl
= &DirectMusicLyricsTrackStream_Vtbl
;
252 track
->pStream
->ref
= 1;
253 track
->pStream
->pParentTrack
= track
;
254 *ppTrack
= (LPDIRECTMUSICTRACK8
) track
;
258 WARN("No interface found\n");
259 return E_NOINTERFACE
;
263 /*****************************************************************************
264 * IDirectMusicLyricsTrackStream implementation
266 /* IDirectMusicLyricsTrackStream IUnknown part follow: */
267 HRESULT WINAPI
IDirectMusicLyricsTrackStream_QueryInterface (LPPERSISTSTREAM iface
, REFIID riid
, LPVOID
*ppobj
)
269 ICOM_THIS(IDirectMusicLyricsTrackStream
,iface
);
271 if (IsEqualIID (riid
, &IID_IUnknown
)
272 || IsEqualIID (riid
, &IID_IPersistStream
)) {
273 IDirectMusicLyricsTrackStream_AddRef(iface
);
278 WARN("(%p)->(%s,%p),not found\n",This
,debugstr_guid(riid
),ppobj
);
279 return E_NOINTERFACE
;
282 ULONG WINAPI
IDirectMusicLyricsTrackStream_AddRef (LPPERSISTSTREAM iface
)
284 ICOM_THIS(IDirectMusicLyricsTrackStream
,iface
);
285 TRACE("(%p) : AddRef from %ld\n", This
, This
->ref
);
286 return ++(This
->ref
);
289 ULONG WINAPI
IDirectMusicLyricsTrackStream_Release (LPPERSISTSTREAM iface
)
291 ICOM_THIS(IDirectMusicLyricsTrackStream
,iface
);
292 ULONG ref
= --This
->ref
;
293 TRACE("(%p) : ReleaseRef to %ld\n", This
, This
->ref
);
295 HeapFree(GetProcessHeap(), 0, This
);
300 /* IDirectMusicLyricsTrackStream IPersist part: */
301 HRESULT WINAPI
IDirectMusicLyricsTrackStream_GetClassID (LPPERSISTSTREAM iface
, CLSID
* pClassID
)
306 /* IDirectMusicLyricsTrackStream IPersistStream part: */
307 HRESULT WINAPI
IDirectMusicLyricsTrackStream_IsDirty (LPPERSISTSTREAM iface
)
312 HRESULT WINAPI
IDirectMusicLyricsTrackStream_Load (LPPERSISTSTREAM iface
, IStream
* pStm
)
314 FIXME(": Loading not implemented yet\n");
318 HRESULT WINAPI
IDirectMusicLyricsTrackStream_Save (LPPERSISTSTREAM iface
, IStream
* pStm
, BOOL fClearDirty
)
323 HRESULT WINAPI
IDirectMusicLyricsTrackStream_GetSizeMax (LPPERSISTSTREAM iface
, ULARGE_INTEGER
* pcbSize
)
328 ICOM_VTABLE(IPersistStream
) DirectMusicLyricsTrackStream_Vtbl
=
330 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
331 IDirectMusicLyricsTrackStream_QueryInterface
,
332 IDirectMusicLyricsTrackStream_AddRef
,
333 IDirectMusicLyricsTrackStream_Release
,
334 IDirectMusicLyricsTrackStream_GetClassID
,
335 IDirectMusicLyricsTrackStream_IsDirty
,
336 IDirectMusicLyricsTrackStream_Load
,
337 IDirectMusicLyricsTrackStream_Save
,
338 IDirectMusicLyricsTrackStream_GetSizeMax