services: Check for services without lpBinaryPathName in get_winedevice_process.
[wine.git] / dlls / dmcompos / chordmaptrack.c
blob6ebc2740020faa868bc965ecfb5f7e9b929da5c2
1 /* IDirectMusicChordMapTrack Implementation
3 * Copyright (C) 2003-2004 Rok Mandeljc
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (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 GNU
13 * Lesser General Public License for more details.
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
20 #include "dmcompos_private.h"
21 #include "dmobject.h"
23 WINE_DEFAULT_DEBUG_CHANNEL(dmcompos);
25 /*****************************************************************************
26 * IDirectMusicChordMapTrack implementation
28 typedef struct IDirectMusicChordMapTrack {
29 IDirectMusicTrack8 IDirectMusicTrack8_iface;
30 struct dmobject dmobj; /* IPersistStream only */
31 LONG ref;
32 } IDirectMusicChordMapTrack;
34 /* IDirectMusicChordMapTrack IDirectMusicTrack8 part: */
35 static inline IDirectMusicChordMapTrack *impl_from_IDirectMusicTrack8(IDirectMusicTrack8 *iface)
37 return CONTAINING_RECORD(iface, IDirectMusicChordMapTrack, IDirectMusicTrack8_iface);
40 static HRESULT WINAPI IDirectMusicTrack8Impl_QueryInterface(IDirectMusicTrack8 *iface, REFIID riid,
41 void **ret_iface)
43 IDirectMusicChordMapTrack *This = impl_from_IDirectMusicTrack8(iface);
45 TRACE("(%p, %s, %p)\n", This, debugstr_dmguid(riid), ret_iface);
47 *ret_iface = NULL;
49 if (IsEqualIID(riid, &IID_IUnknown) || IsEqualIID(riid, &IID_IDirectMusicTrack) ||
50 IsEqualIID(riid, &IID_IDirectMusicTrack8))
51 *ret_iface = iface;
52 else if (IsEqualIID(riid, &IID_IPersistStream))
53 *ret_iface = &This->dmobj.IPersistStream_iface;
54 else {
55 WARN("(%p, %s, %p): not found\n", This, debugstr_dmguid(riid), ret_iface);
56 return E_NOINTERFACE;
59 IUnknown_AddRef((IUnknown*)*ret_iface);
60 return S_OK;
63 static ULONG WINAPI IDirectMusicTrack8Impl_AddRef(IDirectMusicTrack8 *iface)
65 IDirectMusicChordMapTrack *This = impl_from_IDirectMusicTrack8(iface);
66 LONG ref = InterlockedIncrement(&This->ref);
68 TRACE("(%p) ref=%d\n", This, ref);
70 return ref;
73 static ULONG WINAPI IDirectMusicTrack8Impl_Release(IDirectMusicTrack8 *iface)
75 IDirectMusicChordMapTrack *This = impl_from_IDirectMusicTrack8(iface);
76 LONG ref = InterlockedDecrement(&This->ref);
78 TRACE("(%p) ref=%d\n", This, ref);
80 if (!ref) {
81 HeapFree(GetProcessHeap(), 0, This);
82 DMCOMPOS_UnlockModule();
85 return ref;
88 static HRESULT WINAPI IDirectMusicTrack8Impl_Init(IDirectMusicTrack8 *iface,
89 IDirectMusicSegment *pSegment)
91 IDirectMusicChordMapTrack *This = impl_from_IDirectMusicTrack8(iface);
92 FIXME("(%p, %p): stub\n", This, pSegment);
93 return S_OK;
96 static HRESULT WINAPI IDirectMusicTrack8Impl_InitPlay(IDirectMusicTrack8 *iface,
97 IDirectMusicSegmentState *pSegmentState, IDirectMusicPerformance *pPerformance,
98 void **ppStateData, DWORD dwVirtualTrack8ID, DWORD dwFlags)
100 IDirectMusicChordMapTrack *This = impl_from_IDirectMusicTrack8(iface);
101 FIXME("(%p, %p, %p, %p, %d, %d): stub\n", This, pSegmentState, pPerformance, ppStateData, dwVirtualTrack8ID, dwFlags);
102 return S_OK;
105 static HRESULT WINAPI IDirectMusicTrack8Impl_EndPlay(IDirectMusicTrack8 *iface, void *pStateData)
107 IDirectMusicChordMapTrack *This = impl_from_IDirectMusicTrack8(iface);
108 FIXME("(%p, %p): stub\n", This, pStateData);
109 return S_OK;
112 static HRESULT WINAPI IDirectMusicTrack8Impl_Play(IDirectMusicTrack8 *iface, void *pStateData,
113 MUSIC_TIME mtStart, MUSIC_TIME mtEnd, MUSIC_TIME mtOffset, DWORD dwFlags,
114 IDirectMusicPerformance *pPerf, IDirectMusicSegmentState *pSegSt, DWORD dwVirtualID)
116 IDirectMusicChordMapTrack *This = impl_from_IDirectMusicTrack8(iface);
117 FIXME("(%p, %p, %d, %d, %d, %d, %p, %p, %d): stub\n", This, pStateData, mtStart, mtEnd, mtOffset, dwFlags, pPerf, pSegSt, dwVirtualID);
118 return S_OK;
121 static HRESULT WINAPI IDirectMusicTrack8Impl_GetParam(IDirectMusicTrack8 *iface, REFGUID rguidType, MUSIC_TIME mtTime, MUSIC_TIME *pmtNext, void *pParam)
123 IDirectMusicChordMapTrack *This = impl_from_IDirectMusicTrack8(iface);
124 FIXME("(%p, %s, %d, %p, %p): stub\n", This, debugstr_dmguid(rguidType), mtTime, pmtNext, pParam);
125 return S_OK;
128 static HRESULT WINAPI IDirectMusicTrack8Impl_SetParam(IDirectMusicTrack8 *iface, REFGUID rguidType,
129 MUSIC_TIME mtTime, void *pParam)
131 IDirectMusicChordMapTrack *This = impl_from_IDirectMusicTrack8(iface);
132 FIXME("(%p, %s, %d, %p): stub\n", This, debugstr_dmguid(rguidType), mtTime, pParam);
133 return S_OK;
136 static HRESULT WINAPI IDirectMusicTrack8Impl_IsParamSupported(IDirectMusicTrack8 *iface,
137 REFGUID rguidType)
139 IDirectMusicChordMapTrack *This = impl_from_IDirectMusicTrack8(iface);
140 TRACE("(%p, %s)\n", This, debugstr_dmguid(rguidType));
142 if (!rguidType)
143 return E_POINTER;
145 if (IsEqualGUID (rguidType, &GUID_IDirectMusicChordMap)) {
146 TRACE("param supported\n");
147 return S_OK;
149 TRACE("param unsupported\n");
150 return DMUS_E_TYPE_UNSUPPORTED;
153 static HRESULT WINAPI IDirectMusicTrack8Impl_AddNotificationType(IDirectMusicTrack8 *iface,
154 REFGUID notiftype)
156 IDirectMusicChordMapTrack *This = impl_from_IDirectMusicTrack8(iface);
158 TRACE("(%p, %s): method not implemented\n", This, debugstr_dmguid(notiftype));
159 return E_NOTIMPL;
162 static HRESULT WINAPI IDirectMusicTrack8Impl_RemoveNotificationType(IDirectMusicTrack8 *iface,
163 REFGUID notiftype)
165 IDirectMusicChordMapTrack *This = impl_from_IDirectMusicTrack8(iface);
167 TRACE("(%p, %s): method not implemented\n", This, debugstr_dmguid(notiftype));
168 return E_NOTIMPL;
171 static HRESULT WINAPI IDirectMusicTrack8Impl_Clone(IDirectMusicTrack8 *iface, MUSIC_TIME mtStart,
172 MUSIC_TIME mtEnd, IDirectMusicTrack **ppTrack)
174 IDirectMusicChordMapTrack *This = impl_from_IDirectMusicTrack8(iface);
175 FIXME("(%p, %d, %d, %p): stub\n", This, mtStart, mtEnd, ppTrack);
176 return S_OK;
179 static HRESULT WINAPI IDirectMusicTrack8Impl_PlayEx(IDirectMusicTrack8 *iface, void *pStateData,
180 REFERENCE_TIME rtStart, REFERENCE_TIME rtEnd, REFERENCE_TIME rtOffset, DWORD dwFlags,
181 IDirectMusicPerformance *pPerf, IDirectMusicSegmentState *pSegSt, DWORD dwVirtualID)
183 IDirectMusicChordMapTrack *This = impl_from_IDirectMusicTrack8(iface);
184 FIXME("(%p, %p, 0x%s, 0x%s, 0x%s, %d, %p, %p, %d): stub\n", This, pStateData, wine_dbgstr_longlong(rtStart),
185 wine_dbgstr_longlong(rtEnd), wine_dbgstr_longlong(rtOffset), dwFlags, pPerf, pSegSt, dwVirtualID);
186 return S_OK;
189 static HRESULT WINAPI IDirectMusicTrack8Impl_GetParamEx(IDirectMusicTrack8 *iface,
190 REFGUID rguidType, REFERENCE_TIME rtTime, REFERENCE_TIME *prtNext, void *pParam,
191 void *pStateData, DWORD dwFlags)
193 IDirectMusicChordMapTrack *This = impl_from_IDirectMusicTrack8(iface);
194 FIXME("(%p, %s, 0x%s, %p, %p, %p, %d): stub\n", This, debugstr_dmguid(rguidType),
195 wine_dbgstr_longlong(rtTime), prtNext, pParam, pStateData, dwFlags);
196 return S_OK;
199 static HRESULT WINAPI IDirectMusicTrack8Impl_SetParamEx(IDirectMusicTrack8 *iface,
200 REFGUID rguidType, REFERENCE_TIME rtTime, void *pParam, void *pStateData, DWORD dwFlags)
202 IDirectMusicChordMapTrack *This = impl_from_IDirectMusicTrack8(iface);
203 FIXME("(%p, %s, 0x%s, %p, %p, %d): stub\n", This, debugstr_dmguid(rguidType),
204 wine_dbgstr_longlong(rtTime), pParam, pStateData, dwFlags);
205 return S_OK;
208 static HRESULT WINAPI IDirectMusicTrack8Impl_Compose(IDirectMusicTrack8 *iface, IUnknown *context,
209 DWORD trackgroup, IDirectMusicTrack **track)
211 IDirectMusicChordMapTrack *This = impl_from_IDirectMusicTrack8(iface);
213 TRACE("(%p, %p, %d, %p): method not implemented\n", This, context, trackgroup, track);
214 return E_NOTIMPL;
217 static HRESULT WINAPI IDirectMusicTrack8Impl_Join(IDirectMusicTrack8 *iface,
218 IDirectMusicTrack *pNewTrack, MUSIC_TIME mtJoin, IUnknown *pContext, DWORD dwTrackGroup,
219 IDirectMusicTrack **ppResultTrack)
221 IDirectMusicChordMapTrack *This = impl_from_IDirectMusicTrack8(iface);
222 FIXME("(%p, %p, %d, %p, %d, %p): stub\n", This, pNewTrack, mtJoin, pContext, dwTrackGroup, ppResultTrack);
223 return S_OK;
226 static const IDirectMusicTrack8Vtbl dmtrack8_vtbl = {
227 IDirectMusicTrack8Impl_QueryInterface,
228 IDirectMusicTrack8Impl_AddRef,
229 IDirectMusicTrack8Impl_Release,
230 IDirectMusicTrack8Impl_Init,
231 IDirectMusicTrack8Impl_InitPlay,
232 IDirectMusicTrack8Impl_EndPlay,
233 IDirectMusicTrack8Impl_Play,
234 IDirectMusicTrack8Impl_GetParam,
235 IDirectMusicTrack8Impl_SetParam,
236 IDirectMusicTrack8Impl_IsParamSupported,
237 IDirectMusicTrack8Impl_AddNotificationType,
238 IDirectMusicTrack8Impl_RemoveNotificationType,
239 IDirectMusicTrack8Impl_Clone,
240 IDirectMusicTrack8Impl_PlayEx,
241 IDirectMusicTrack8Impl_GetParamEx,
242 IDirectMusicTrack8Impl_SetParamEx,
243 IDirectMusicTrack8Impl_Compose,
244 IDirectMusicTrack8Impl_Join
247 static inline IDirectMusicChordMapTrack *impl_from_IPersistStream(IPersistStream *iface)
249 return CONTAINING_RECORD(iface, IDirectMusicChordMapTrack, dmobj.IPersistStream_iface);
252 static HRESULT WINAPI IPersistStreamImpl_Load(IPersistStream *iface, IStream *pStm)
254 IDirectMusicChordMapTrack *This = impl_from_IPersistStream(iface);
255 FIXME("(%p, %p): Loading not implemented yet\n", This, pStm);
256 return S_OK;
259 static const IPersistStreamVtbl persiststream_vtbl = {
260 dmobj_IPersistStream_QueryInterface,
261 dmobj_IPersistStream_AddRef,
262 dmobj_IPersistStream_Release,
263 dmobj_IPersistStream_GetClassID,
264 unimpl_IPersistStream_IsDirty,
265 IPersistStreamImpl_Load,
266 unimpl_IPersistStream_Save,
267 unimpl_IPersistStream_GetSizeMax
270 /* for ClassFactory */
271 HRESULT WINAPI create_dmchordmaptrack(REFIID lpcGUID, void **ppobj)
273 IDirectMusicChordMapTrack* track;
274 HRESULT hr;
276 track = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*track));
277 if (!track) {
278 *ppobj = NULL;
279 return E_OUTOFMEMORY;
281 track->IDirectMusicTrack8_iface.lpVtbl = &dmtrack8_vtbl;
282 track->ref = 1;
283 dmobject_init(&track->dmobj, &CLSID_DirectMusicChordMapTrack,
284 (IUnknown *)&track->IDirectMusicTrack8_iface);
285 track->dmobj.IPersistStream_iface.lpVtbl = &persiststream_vtbl;
287 DMCOMPOS_LockModule();
288 hr = IDirectMusicTrack8_QueryInterface(&track->IDirectMusicTrack8_iface, lpcGUID, ppobj);
289 IDirectMusicTrack8_Release(&track->IDirectMusicTrack8_iface);
291 return hr;