1 /* IDirectMusicChordMapTrack Implementation
3 * Copyright (C) 2003-2004 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.
20 #include "dmcompos_private.h"
22 WINE_DEFAULT_DEBUG_CHANNEL(dmcompos
);
23 WINE_DECLARE_DEBUG_CHANNEL(dmfile
);
25 /*****************************************************************************
26 * IDirectMusicChordMapTrack implementation
28 /* IDirectMusicChordMapTrack IUnknown part: */
29 HRESULT WINAPI
IDirectMusicChordMapTrack_IUnknown_QueryInterface (LPUNKNOWN iface
, REFIID riid
, LPVOID
*ppobj
) {
30 ICOM_THIS_MULTI(IDirectMusicChordMapTrack
, UnknownVtbl
, iface
);
31 TRACE("(%p, %s, %p)\n", This
, debugstr_dmguid(riid
), ppobj
);
33 if (IsEqualIID (riid
, &IID_IUnknown
)) {
34 *ppobj
= (LPUNKNOWN
)&This
->UnknownVtbl
;
35 IDirectMusicChordMapTrack_IUnknown_AddRef ((LPUNKNOWN
)&This
->UnknownVtbl
);
37 } else if (IsEqualIID (riid
, &IID_IDirectMusicTrack
)
38 || IsEqualIID (riid
, &IID_IDirectMusicTrack8
)) {
39 *ppobj
= (LPDIRECTMUSICTRACK8
)&This
->TrackVtbl
;
40 IDirectMusicChordMapTrack_IDirectMusicTrack_AddRef ((LPDIRECTMUSICTRACK8
)&This
->TrackVtbl
);
42 } else if (IsEqualIID (riid
, &IID_IPersistStream
)) {
43 *ppobj
= (LPPERSISTSTREAM
)&This
->PersistStreamVtbl
;
44 IDirectMusicChordMapTrack_IPersistStream_AddRef ((LPPERSISTSTREAM
)&This
->PersistStreamVtbl
);
48 WARN("(%p, %s, %p): not found\n", This
, debugstr_dmguid(riid
), ppobj
);
52 ULONG WINAPI
IDirectMusicChordMapTrack_IUnknown_AddRef (LPUNKNOWN iface
) {
53 ICOM_THIS_MULTI(IDirectMusicChordMapTrack
, UnknownVtbl
, iface
);
54 ULONG ref
= InterlockedIncrement(&This
->ref
);
56 TRACE("(%p): AddRef from %ld\n", This
, ref
- 1);
58 DMCOMPOS_LockModule();
63 ULONG WINAPI
IDirectMusicChordMapTrack_IUnknown_Release (LPUNKNOWN iface
) {
64 ICOM_THIS_MULTI(IDirectMusicChordMapTrack
, UnknownVtbl
, iface
);
65 ULONG ref
= InterlockedDecrement(&This
->ref
);
67 TRACE("(%p): ReleaseRef to %ld\n", This
, ref
);
70 HeapFree(GetProcessHeap(), 0, This
);
73 DMCOMPOS_UnlockModule();
78 IUnknownVtbl DirectMusicChordMapTrack_Unknown_Vtbl
= {
79 IDirectMusicChordMapTrack_IUnknown_QueryInterface
,
80 IDirectMusicChordMapTrack_IUnknown_AddRef
,
81 IDirectMusicChordMapTrack_IUnknown_Release
84 /* IDirectMusicChordMapTrack IDirectMusicTrack8 part: */
85 HRESULT WINAPI
IDirectMusicChordMapTrack_IDirectMusicTrack_QueryInterface (LPDIRECTMUSICTRACK8 iface
, REFIID riid
, LPVOID
*ppobj
) {
86 ICOM_THIS_MULTI(IDirectMusicChordMapTrack
, TrackVtbl
, iface
);
87 return IDirectMusicChordMapTrack_IUnknown_QueryInterface ((LPUNKNOWN
)&This
->UnknownVtbl
, riid
, ppobj
);
90 ULONG WINAPI
IDirectMusicChordMapTrack_IDirectMusicTrack_AddRef (LPDIRECTMUSICTRACK8 iface
) {
91 ICOM_THIS_MULTI(IDirectMusicChordMapTrack
, TrackVtbl
, iface
);
92 return IDirectMusicChordMapTrack_IUnknown_AddRef ((LPUNKNOWN
)&This
->UnknownVtbl
);
95 ULONG WINAPI
IDirectMusicChordMapTrack_IDirectMusicTrack_Release (LPDIRECTMUSICTRACK8 iface
) {
96 ICOM_THIS_MULTI(IDirectMusicChordMapTrack
, TrackVtbl
, iface
);
97 return IDirectMusicChordMapTrack_IUnknown_Release ((LPUNKNOWN
)&This
->UnknownVtbl
);
100 HRESULT WINAPI
IDirectMusicChordMapTrack_IDirectMusicTrack_Init (LPDIRECTMUSICTRACK8 iface
, IDirectMusicSegment
* pSegment
) {
101 ICOM_THIS_MULTI(IDirectMusicChordMapTrack
, TrackVtbl
, iface
);
102 FIXME("(%p, %p): stub\n", This
, pSegment
);
106 HRESULT WINAPI
IDirectMusicChordMapTrack_IDirectMusicTrack_InitPlay (LPDIRECTMUSICTRACK8 iface
, IDirectMusicSegmentState
* pSegmentState
, IDirectMusicPerformance
* pPerformance
, void** ppStateData
, DWORD dwVirtualTrack8ID
, DWORD dwFlags
) {
107 ICOM_THIS_MULTI(IDirectMusicChordMapTrack
, TrackVtbl
, iface
);
108 FIXME("(%p, %p, %p, %p, %ld, %ld): stub\n", This
, pSegmentState
, pPerformance
, ppStateData
, dwVirtualTrack8ID
, dwFlags
);
112 HRESULT WINAPI
IDirectMusicChordMapTrack_IDirectMusicTrack_EndPlay (LPDIRECTMUSICTRACK8 iface
, void* pStateData
) {
113 ICOM_THIS_MULTI(IDirectMusicChordMapTrack
, TrackVtbl
, iface
);
114 FIXME("(%p, %p): stub\n", This
, pStateData
);
118 HRESULT WINAPI
IDirectMusicChordMapTrack_IDirectMusicTrack_Play (LPDIRECTMUSICTRACK8 iface
, void* pStateData
, MUSIC_TIME mtStart
, MUSIC_TIME mtEnd
, MUSIC_TIME mtOffset
, DWORD dwFlags
, IDirectMusicPerformance
* pPerf
, IDirectMusicSegmentState
* pSegSt
, DWORD dwVirtualID
) {
119 ICOM_THIS_MULTI(IDirectMusicChordMapTrack
, TrackVtbl
, iface
);
120 FIXME("(%p, %p, %ld, %ld, %ld, %ld, %p, %p, %ld): stub\n", This
, pStateData
, mtStart
, mtEnd
, mtOffset
, dwFlags
, pPerf
, pSegSt
, dwVirtualID
);
124 HRESULT WINAPI
IDirectMusicChordMapTrack_IDirectMusicTrack_GetParam (LPDIRECTMUSICTRACK8 iface
, REFGUID rguidType
, MUSIC_TIME mtTime
, MUSIC_TIME
* pmtNext
, void* pParam
) {
125 ICOM_THIS_MULTI(IDirectMusicChordMapTrack
, TrackVtbl
, iface
);
126 FIXME("(%p, %s, %ld, %p, %p): stub\n", This
, debugstr_dmguid(rguidType
), mtTime
, pmtNext
, pParam
);
130 HRESULT WINAPI
IDirectMusicChordMapTrack_IDirectMusicTrack_SetParam (LPDIRECTMUSICTRACK8 iface
, REFGUID rguidType
, MUSIC_TIME mtTime
, void* pParam
) {
131 ICOM_THIS_MULTI(IDirectMusicChordMapTrack
, TrackVtbl
, iface
);
132 FIXME("(%p, %s, %ld, %p): stub\n", This
, debugstr_dmguid(rguidType
), mtTime
, pParam
);
136 HRESULT WINAPI
IDirectMusicChordMapTrack_IDirectMusicTrack_IsParamSupported (LPDIRECTMUSICTRACK8 iface
, REFGUID rguidType
) {
137 ICOM_THIS_MULTI(IDirectMusicChordMapTrack
, TrackVtbl
, iface
);
138 TRACE("(%p, %s): ", This
, debugstr_dmguid(rguidType
));
139 if (IsEqualGUID (rguidType
, &GUID_IDirectMusicChordMap
)) {
140 TRACE("param supported\n");
143 TRACE("param unsupported\n");
144 return DMUS_E_TYPE_UNSUPPORTED
;
147 HRESULT WINAPI
IDirectMusicChordMapTrack_IDirectMusicTrack_AddNotificationType (LPDIRECTMUSICTRACK8 iface
, REFGUID rguidNotificationType
) {
148 ICOM_THIS_MULTI(IDirectMusicChordMapTrack
, TrackVtbl
, iface
);
149 FIXME("(%p, %s): stub\n", This
, debugstr_dmguid(rguidNotificationType
));
153 HRESULT WINAPI
IDirectMusicChordMapTrack_IDirectMusicTrack_RemoveNotificationType (LPDIRECTMUSICTRACK8 iface
, REFGUID rguidNotificationType
) {
154 ICOM_THIS_MULTI(IDirectMusicChordMapTrack
, TrackVtbl
, iface
);
155 FIXME("(%p, %s): stub\n", This
, debugstr_dmguid(rguidNotificationType
));
159 HRESULT WINAPI
IDirectMusicChordMapTrack_IDirectMusicTrack_Clone (LPDIRECTMUSICTRACK8 iface
, MUSIC_TIME mtStart
, MUSIC_TIME mtEnd
, IDirectMusicTrack
** ppTrack
) {
160 ICOM_THIS_MULTI(IDirectMusicChordMapTrack
, TrackVtbl
, iface
);
161 FIXME("(%p, %ld, %ld, %p): stub\n", This
, mtStart
, mtEnd
, ppTrack
);
165 HRESULT WINAPI
IDirectMusicChordMapTrack_IDirectMusicTrack_PlayEx (LPDIRECTMUSICTRACK8 iface
, void* pStateData
, REFERENCE_TIME rtStart
, REFERENCE_TIME rtEnd
, REFERENCE_TIME rtOffset
, DWORD dwFlags
, IDirectMusicPerformance
* pPerf
, IDirectMusicSegmentState
* pSegSt
, DWORD dwVirtualID
) {
166 ICOM_THIS_MULTI(IDirectMusicChordMapTrack
, TrackVtbl
, iface
);
167 FIXME("(%p, %p, %lli, %lli, %lli, %ld, %p, %p, %ld): stub\n", This
, pStateData
, rtStart
, rtEnd
, rtOffset
, dwFlags
, pPerf
, pSegSt
, dwVirtualID
);
171 HRESULT WINAPI
IDirectMusicChordMapTrack_IDirectMusicTrack_GetParamEx (LPDIRECTMUSICTRACK8 iface
, REFGUID rguidType
, REFERENCE_TIME rtTime
, REFERENCE_TIME
* prtNext
, void* pParam
, void* pStateData
, DWORD dwFlags
) {
172 ICOM_THIS_MULTI(IDirectMusicChordMapTrack
, TrackVtbl
, iface
);
173 FIXME("(%p, %s, %lli, %p, %p, %p, %ld): stub\n", This
, debugstr_dmguid(rguidType
), rtTime
, prtNext
, pParam
, pStateData
, dwFlags
);
177 HRESULT WINAPI
IDirectMusicChordMapTrack_IDirectMusicTrack_SetParamEx (LPDIRECTMUSICTRACK8 iface
, REFGUID rguidType
, REFERENCE_TIME rtTime
, void* pParam
, void* pStateData
, DWORD dwFlags
) {
178 ICOM_THIS_MULTI(IDirectMusicChordMapTrack
, TrackVtbl
, iface
);
179 FIXME("(%p, %s, %lli, %p, %p, %ld): stub\n", This
, debugstr_dmguid(rguidType
), rtTime
, pParam
, pStateData
, dwFlags
);
183 HRESULT WINAPI
IDirectMusicChordMapTrack_IDirectMusicTrack_Compose (LPDIRECTMUSICTRACK8 iface
, IUnknown
* pContext
, DWORD dwTrackGroup
, IDirectMusicTrack
** ppResultTrack
) {
184 ICOM_THIS_MULTI(IDirectMusicChordMapTrack
, TrackVtbl
, iface
);
185 FIXME("(%p, %p, %ld, %p): stub\n", This
, pContext
, dwTrackGroup
, ppResultTrack
);
189 HRESULT WINAPI
IDirectMusicChordMapTrack_IDirectMusicTrack_Join (LPDIRECTMUSICTRACK8 iface
, IDirectMusicTrack
* pNewTrack
, MUSIC_TIME mtJoin
, IUnknown
* pContext
, DWORD dwTrackGroup
, IDirectMusicTrack
** ppResultTrack
) {
190 ICOM_THIS_MULTI(IDirectMusicChordMapTrack
, TrackVtbl
, iface
);
191 FIXME("(%p, %p, %ld, %p, %ld, %p): stub\n", This
, pNewTrack
, mtJoin
, pContext
, dwTrackGroup
, ppResultTrack
);
195 IDirectMusicTrack8Vtbl DirectMusicChordMapTrack_Track_Vtbl
= {
196 IDirectMusicChordMapTrack_IDirectMusicTrack_QueryInterface
,
197 IDirectMusicChordMapTrack_IDirectMusicTrack_AddRef
,
198 IDirectMusicChordMapTrack_IDirectMusicTrack_Release
,
199 IDirectMusicChordMapTrack_IDirectMusicTrack_Init
,
200 IDirectMusicChordMapTrack_IDirectMusicTrack_InitPlay
,
201 IDirectMusicChordMapTrack_IDirectMusicTrack_EndPlay
,
202 IDirectMusicChordMapTrack_IDirectMusicTrack_Play
,
203 IDirectMusicChordMapTrack_IDirectMusicTrack_GetParam
,
204 IDirectMusicChordMapTrack_IDirectMusicTrack_SetParam
,
205 IDirectMusicChordMapTrack_IDirectMusicTrack_IsParamSupported
,
206 IDirectMusicChordMapTrack_IDirectMusicTrack_AddNotificationType
,
207 IDirectMusicChordMapTrack_IDirectMusicTrack_RemoveNotificationType
,
208 IDirectMusicChordMapTrack_IDirectMusicTrack_Clone
,
209 IDirectMusicChordMapTrack_IDirectMusicTrack_PlayEx
,
210 IDirectMusicChordMapTrack_IDirectMusicTrack_GetParamEx
,
211 IDirectMusicChordMapTrack_IDirectMusicTrack_SetParamEx
,
212 IDirectMusicChordMapTrack_IDirectMusicTrack_Compose
,
213 IDirectMusicChordMapTrack_IDirectMusicTrack_Join
216 /* IDirectMusicChordMapTrack IPersistStream part: */
217 HRESULT WINAPI
IDirectMusicChordMapTrack_IPersistStream_QueryInterface (LPPERSISTSTREAM iface
, REFIID riid
, LPVOID
*ppobj
) {
218 ICOM_THIS_MULTI(IDirectMusicChordMapTrack
, PersistStreamVtbl
, iface
);
219 return IDirectMusicChordMapTrack_IUnknown_QueryInterface ((LPUNKNOWN
)&This
->UnknownVtbl
, riid
, ppobj
);
222 ULONG WINAPI
IDirectMusicChordMapTrack_IPersistStream_AddRef (LPPERSISTSTREAM iface
) {
223 ICOM_THIS_MULTI(IDirectMusicChordMapTrack
, PersistStreamVtbl
, iface
);
224 return IDirectMusicChordMapTrack_IUnknown_AddRef ((LPUNKNOWN
)&This
->UnknownVtbl
);
227 ULONG WINAPI
IDirectMusicChordMapTrack_IPersistStream_Release (LPPERSISTSTREAM iface
) {
228 ICOM_THIS_MULTI(IDirectMusicChordMapTrack
, PersistStreamVtbl
, iface
);
229 return IDirectMusicChordMapTrack_IUnknown_Release ((LPUNKNOWN
)&This
->UnknownVtbl
);
232 HRESULT WINAPI
IDirectMusicChordMapTrack_IPersistStream_GetClassID (LPPERSISTSTREAM iface
, CLSID
* pClassID
) {
236 HRESULT WINAPI
IDirectMusicChordMapTrack_IPersistStream_IsDirty (LPPERSISTSTREAM iface
) {
240 HRESULT WINAPI
IDirectMusicChordMapTrack_IPersistStream_Load (LPPERSISTSTREAM iface
, IStream
* pStm
) {
241 ICOM_THIS_MULTI(IDirectMusicChordMapTrack
, PersistStreamVtbl
, iface
);
242 FIXME("(%p, %p): Loading not implemented yet\n", This
, pStm
);
246 HRESULT WINAPI
IDirectMusicChordMapTrack_IPersistStream_Save (LPPERSISTSTREAM iface
, IStream
* pStm
, BOOL fClearDirty
) {
250 HRESULT WINAPI
IDirectMusicChordMapTrack_IPersistStream_GetSizeMax (LPPERSISTSTREAM iface
, ULARGE_INTEGER
* pcbSize
) {
254 IPersistStreamVtbl DirectMusicChordMapTrack_PersistStream_Vtbl
= {
255 IDirectMusicChordMapTrack_IPersistStream_QueryInterface
,
256 IDirectMusicChordMapTrack_IPersistStream_AddRef
,
257 IDirectMusicChordMapTrack_IPersistStream_Release
,
258 IDirectMusicChordMapTrack_IPersistStream_GetClassID
,
259 IDirectMusicChordMapTrack_IPersistStream_IsDirty
,
260 IDirectMusicChordMapTrack_IPersistStream_Load
,
261 IDirectMusicChordMapTrack_IPersistStream_Save
,
262 IDirectMusicChordMapTrack_IPersistStream_GetSizeMax
265 /* for ClassFactory */
266 HRESULT WINAPI
DMUSIC_CreateDirectMusicChordMapTrack (LPCGUID lpcGUID
, LPVOID
*ppobj
, LPUNKNOWN pUnkOuter
) {
267 IDirectMusicChordMapTrack
* track
;
269 track
= HeapAlloc (GetProcessHeap(), HEAP_ZERO_MEMORY
, sizeof(IDirectMusicChordMapTrack
));
272 return E_OUTOFMEMORY
;
274 track
->UnknownVtbl
= &DirectMusicChordMapTrack_Unknown_Vtbl
;
275 track
->TrackVtbl
= &DirectMusicChordMapTrack_Track_Vtbl
;
276 track
->PersistStreamVtbl
= &DirectMusicChordMapTrack_PersistStream_Vtbl
;
277 track
->pDesc
= HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY
, sizeof(DMUS_OBJECTDESC
));
278 DM_STRUCT_INIT(track
->pDesc
);
279 track
->pDesc
->dwValidData
|= DMUS_OBJ_CLASS
;
280 memcpy (&track
->pDesc
->guidClass
, &CLSID_DirectMusicChordMapTrack
, sizeof (CLSID
));
281 track
->ref
= 0; /* will be inited by QueryInterface */
283 return IDirectMusicChordMapTrack_IUnknown_QueryInterface ((LPUNKNOWN
)&track
->UnknownVtbl
, lpcGUID
, ppobj
);