winex11.drv: Map coordinates before calling send_mouse_input.
[wine/zf.git] / dlls / dmime / paramcontroltrack.c
blob8fb3d40332f2239db39a12537f6234ffc5cc23ce
1 /* IDirectMusicParamControlTrack 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 "dmime_private.h"
21 #include "dmobject.h"
23 WINE_DEFAULT_DEBUG_CHANNEL(dmime);
25 /*****************************************************************************
26 * IDirectMusicParamControlTrack implementation
28 typedef struct IDirectMusicParamControlTrack {
29 IDirectMusicTrack8 IDirectMusicTrack8_iface;
30 struct dmobject dmobj; /* IPersistStream only */
31 LONG ref;
32 } IDirectMusicParamControlTrack;
34 /* IDirectMusicParamControlTrack IDirectMusicTrack8 part: */
35 static inline IDirectMusicParamControlTrack *impl_from_IDirectMusicTrack8(IDirectMusicTrack8 *iface)
37 return CONTAINING_RECORD(iface, IDirectMusicParamControlTrack, IDirectMusicTrack8_iface);
40 static HRESULT WINAPI paramcontrol_track_QueryInterface(IDirectMusicTrack8 *iface, REFIID riid,
41 void **ret_iface)
43 IDirectMusicParamControlTrack *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 paramcontrol_track_AddRef(IDirectMusicTrack8 *iface)
65 IDirectMusicParamControlTrack *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 paramcontrol_track_Release(IDirectMusicTrack8 *iface)
75 IDirectMusicParamControlTrack *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 DMIME_UnlockModule();
85 return ref;
88 static HRESULT WINAPI paramcontrol_track_Init(IDirectMusicTrack8 *iface,
89 IDirectMusicSegment *pSegment)
91 IDirectMusicParamControlTrack *This = impl_from_IDirectMusicTrack8(iface);
92 FIXME("(%p, %p): stub\n", This, pSegment);
93 return S_OK;
96 static HRESULT WINAPI paramcontrol_track_InitPlay(IDirectMusicTrack8 *iface,
97 IDirectMusicSegmentState *pSegmentState, IDirectMusicPerformance *pPerformance,
98 void **ppStateData, DWORD dwVirtualTrack8ID, DWORD dwFlags)
100 IDirectMusicParamControlTrack *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 paramcontrol_track_EndPlay(IDirectMusicTrack8 *iface, void *pStateData)
107 IDirectMusicParamControlTrack *This = impl_from_IDirectMusicTrack8(iface);
108 FIXME("(%p, %p): stub\n", This, pStateData);
109 return S_OK;
112 static HRESULT WINAPI paramcontrol_track_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 IDirectMusicParamControlTrack *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 paramcontrol_track_GetParam(IDirectMusicTrack8 *iface, REFGUID type,
122 MUSIC_TIME time, MUSIC_TIME *next, void *param)
124 IDirectMusicParamControlTrack *This = impl_from_IDirectMusicTrack8(iface);
126 TRACE("(%p, %s, %d, %p, %p): not supported\n", This, debugstr_dmguid(type), time, next, param);
127 return DMUS_E_GET_UNSUPPORTED;
130 static HRESULT WINAPI paramcontrol_track_SetParam(IDirectMusicTrack8 *iface, REFGUID type,
131 MUSIC_TIME time, void *param)
133 IDirectMusicParamControlTrack *This = impl_from_IDirectMusicTrack8(iface);
135 TRACE("(%p, %s, %d, %p): not supported\n", This, debugstr_dmguid(type), time, param);
136 return DMUS_E_SET_UNSUPPORTED;
139 static HRESULT WINAPI paramcontrol_track_IsParamSupported(IDirectMusicTrack8 *iface, REFGUID type)
141 IDirectMusicParamControlTrack *This = impl_from_IDirectMusicTrack8(iface);
143 TRACE("(%p, %s): param type not supported\n", This, debugstr_dmguid(type));
144 return DMUS_E_TYPE_UNSUPPORTED;
147 static HRESULT WINAPI paramcontrol_track_AddNotificationType(IDirectMusicTrack8 *iface,
148 REFGUID notiftype)
150 IDirectMusicParamControlTrack *This = impl_from_IDirectMusicTrack8(iface);
152 TRACE("(%p, %s): method not implemented\n", This, debugstr_dmguid(notiftype));
153 return E_NOTIMPL;
156 static HRESULT WINAPI paramcontrol_track_RemoveNotificationType(IDirectMusicTrack8 *iface,
157 REFGUID notiftype)
159 IDirectMusicParamControlTrack *This = impl_from_IDirectMusicTrack8(iface);
161 TRACE("(%p, %s): method not implemented\n", This, debugstr_dmguid(notiftype));
162 return E_NOTIMPL;
165 static HRESULT WINAPI paramcontrol_track_Clone(IDirectMusicTrack8 *iface, MUSIC_TIME mtStart,
166 MUSIC_TIME mtEnd, IDirectMusicTrack **ppTrack)
168 IDirectMusicParamControlTrack *This = impl_from_IDirectMusicTrack8(iface);
169 FIXME("(%p, %d, %d, %p): stub\n", This, mtStart, mtEnd, ppTrack);
170 return S_OK;
173 static HRESULT WINAPI paramcontrol_track_PlayEx(IDirectMusicTrack8 *iface, void *pStateData,
174 REFERENCE_TIME rtStart, REFERENCE_TIME rtEnd, REFERENCE_TIME rtOffset, DWORD dwFlags,
175 IDirectMusicPerformance *pPerf, IDirectMusicSegmentState *pSegSt, DWORD dwVirtualID)
177 IDirectMusicParamControlTrack *This = impl_from_IDirectMusicTrack8(iface);
178 FIXME("(%p, %p, 0x%s, 0x%s, 0x%s, %d, %p, %p, %d): stub\n", This, pStateData, wine_dbgstr_longlong(rtStart),
179 wine_dbgstr_longlong(rtEnd), wine_dbgstr_longlong(rtOffset), dwFlags, pPerf, pSegSt, dwVirtualID);
180 return S_OK;
183 static HRESULT WINAPI paramcontrol_track_GetParamEx(IDirectMusicTrack8 *iface, REFGUID rguidType,
184 REFERENCE_TIME rtTime, REFERENCE_TIME *prtNext, void *pParam, void *pStateData,
185 DWORD dwFlags)
187 IDirectMusicParamControlTrack *This = impl_from_IDirectMusicTrack8(iface);
188 FIXME("(%p, %s, 0x%s, %p, %p, %p, %d): stub\n", This, debugstr_dmguid(rguidType),
189 wine_dbgstr_longlong(rtTime), prtNext, pParam, pStateData, dwFlags);
190 return S_OK;
193 static HRESULT WINAPI paramcontrol_track_SetParamEx(IDirectMusicTrack8 *iface, REFGUID rguidType,
194 REFERENCE_TIME rtTime, void *pParam, void *pStateData, DWORD dwFlags)
196 IDirectMusicParamControlTrack *This = impl_from_IDirectMusicTrack8(iface);
197 FIXME("(%p, %s, 0x%s, %p, %p, %d): stub\n", This, debugstr_dmguid(rguidType),
198 wine_dbgstr_longlong(rtTime), pParam, pStateData, dwFlags);
199 return S_OK;
202 static HRESULT WINAPI paramcontrol_track_Compose(IDirectMusicTrack8 *iface, IUnknown *context,
203 DWORD trackgroup, IDirectMusicTrack **track)
205 IDirectMusicParamControlTrack *This = impl_from_IDirectMusicTrack8(iface);
207 TRACE("(%p, %p, %d, %p): method not implemented\n", This, context, trackgroup, track);
208 return E_NOTIMPL;
211 static HRESULT WINAPI paramcontrol_track_Join(IDirectMusicTrack8 *iface,
212 IDirectMusicTrack *newtrack, MUSIC_TIME join, IUnknown *context, DWORD trackgroup,
213 IDirectMusicTrack **resulttrack)
215 IDirectMusicParamControlTrack *This = impl_from_IDirectMusicTrack8(iface);
216 TRACE("(%p, %p, %d, %p, %d, %p): method not implemented\n", This, newtrack, join, context,
217 trackgroup, resulttrack);
218 return E_NOTIMPL;
221 static const IDirectMusicTrack8Vtbl dmtrack8_vtbl = {
222 paramcontrol_track_QueryInterface,
223 paramcontrol_track_AddRef,
224 paramcontrol_track_Release,
225 paramcontrol_track_Init,
226 paramcontrol_track_InitPlay,
227 paramcontrol_track_EndPlay,
228 paramcontrol_track_Play,
229 paramcontrol_track_GetParam,
230 paramcontrol_track_SetParam,
231 paramcontrol_track_IsParamSupported,
232 paramcontrol_track_AddNotificationType,
233 paramcontrol_track_RemoveNotificationType,
234 paramcontrol_track_Clone,
235 paramcontrol_track_PlayEx,
236 paramcontrol_track_GetParamEx,
237 paramcontrol_track_SetParamEx,
238 paramcontrol_track_Compose,
239 paramcontrol_track_Join
242 static HRESULT WINAPI param_IPersistStream_Load(IPersistStream *iface, IStream *stream)
244 FIXME(": Loading not implemented yet\n");
245 return S_OK;
248 static const IPersistStreamVtbl persiststream_vtbl = {
249 dmobj_IPersistStream_QueryInterface,
250 dmobj_IPersistStream_AddRef,
251 dmobj_IPersistStream_Release,
252 dmobj_IPersistStream_GetClassID,
253 unimpl_IPersistStream_IsDirty,
254 param_IPersistStream_Load,
255 unimpl_IPersistStream_Save,
256 unimpl_IPersistStream_GetSizeMax
259 /* for ClassFactory */
260 HRESULT WINAPI create_dmparamcontroltrack(REFIID lpcGUID, void **ppobj)
262 IDirectMusicParamControlTrack *track;
263 HRESULT hr;
265 track = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*track));
266 if (!track) {
267 *ppobj = NULL;
268 return E_OUTOFMEMORY;
270 track->IDirectMusicTrack8_iface.lpVtbl = &dmtrack8_vtbl;
271 track->ref = 1;
272 dmobject_init(&track->dmobj, &CLSID_DirectMusicParamControlTrack,
273 (IUnknown *)&track->IDirectMusicTrack8_iface);
274 track->dmobj.IPersistStream_iface.lpVtbl = &persiststream_vtbl;
276 DMIME_LockModule();
277 hr = IDirectMusicTrack8_QueryInterface(&track->IDirectMusicTrack8_iface, lpcGUID, ppobj);
278 IDirectMusicTrack8_Release(&track->IDirectMusicTrack8_iface);
280 return hr;