Moved most of the kernel resource APIs to dlls/kernel.
[wine] / dlls / dmusic / dmusic_performance.c
1 /* IDirectMusicPerformance Implementation
2  * IDirectMusicPerformance8 Implementation
3  *
4  * Copyright (C) 2003 Rok Mandeljc
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  * GNU Library General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19  */
20
21 #include "windef.h"
22 #include "winbase.h"
23 #include "winuser.h"
24 #include "wingdi.h"
25 #include "wine/debug.h"
26
27 #include "dmusic_private.h"
28
29 WINE_DEFAULT_DEBUG_CHANNEL(dmusic);
30
31 /* IDirectMusicPerformance IUnknown parts follow: */
32 HRESULT WINAPI IDirectMusicPerformanceImpl_QueryInterface (LPDIRECTMUSICPERFORMANCE iface, REFIID riid, LPVOID *ppobj)
33 {
34         ICOM_THIS(IDirectMusicPerformanceImpl,iface);
35
36         if (IsEqualGUID(riid, &IID_IUnknown) || IsEqualGUID(riid, &IID_IDirectMusicPerformance))
37         {
38                 IDirectMusicPerformanceImpl_AddRef(iface);
39                 *ppobj = This;
40                 return DS_OK;
41         }
42         WARN("(%p)->(%s,%p),not found\n",This,debugstr_guid(riid),ppobj);
43         return E_NOINTERFACE;
44 }
45
46 ULONG WINAPI IDirectMusicPerformanceImpl_AddRef (LPDIRECTMUSICPERFORMANCE iface)
47 {
48         ICOM_THIS(IDirectMusicPerformanceImpl,iface);
49         TRACE("(%p) : AddRef from %ld\n", This, This->ref);
50         return ++(This->ref);
51 }
52
53 ULONG WINAPI IDirectMusicPerformanceImpl_Release (LPDIRECTMUSICPERFORMANCE iface)
54 {
55         ICOM_THIS(IDirectMusicPerformanceImpl,iface);
56         ULONG ref = --This->ref;
57         TRACE("(%p) : ReleaseRef to %ld\n", This, This->ref);
58         if (ref == 0)
59         {
60                 HeapFree(GetProcessHeap(), 0, This);
61         }
62         return ref;
63 }
64
65 /* IDirectMusicPerformance Interface follow: */
66 HRESULT WINAPI IDirectMusicPerformanceImpl_Init (LPDIRECTMUSICPERFORMANCE iface, IDirectMusic** ppDirectMusic, LPDIRECTSOUND pDirectSound, HWND hWnd)
67 {
68         ICOM_THIS(IDirectMusicPerformanceImpl,iface);
69         FIXME("(iface = %p, dmusic = %p (*dmusic = %p), dsound = %p, hwnd = %p): semi-stub\n", This, ppDirectMusic, *ppDirectMusic, pDirectSound, hWnd);
70         
71         /* app creates it's own dmusic object and gives it to performance */
72         if (*ppDirectMusic)
73         {
74                 TRACE("App provides DirectMusic\n");
75                 /* FIXME: is this correct? */
76                 memcpy(This->dmusic, *ppDirectMusic, sizeof(*ppDirectMusic));
77                 IDirectMusic_AddRef(This->dmusic);
78                 /* app is supposed to be in charge of everything else */
79                 return S_OK;
80         }
81         /* app allows the performance to initialise itfself and needs a pointer to object*/
82         if (!*ppDirectMusic)
83         {
84                 TRACE("DirectMusic to be created; needed\n");
85                 if (!This->dmusic)
86                         DMUSIC_CreateDirectMusic(&IID_IDirectMusic, &This->dmusic, NULL);
87                 *ppDirectMusic = This->dmusic;
88                 if (*ppDirectMusic)
89                         IDirectMusic_AddRef(*ppDirectMusic);
90         }
91         /* app allows the performance to initialise itself and does not need a pointer to object*/
92         if (!ppDirectMusic)
93         {
94                 TRACE("DirectMusic to be created; not needed\n");
95         }
96         
97         return S_OK;
98 }
99
100 HRESULT WINAPI IDirectMusicPerformanceImpl_PlaySegment (LPDIRECTMUSICPERFORMANCE iface, IDirectMusicSegment* pSegment, DWORD dwFlags, __int64 i64StartTime, IDirectMusicSegmentState** ppSegmentState)
101 {
102         FIXME("stub\n");
103         return DS_OK;
104 }
105
106 HRESULT WINAPI IDirectMusicPerformanceImpl_Stop (LPDIRECTMUSICPERFORMANCE iface, IDirectMusicSegment* pSegment, IDirectMusicSegmentState* pSegmentState, MUSIC_TIME mtTime, DWORD dwFlags)
107 {
108         FIXME("stub\n");
109         return DS_OK;
110 }
111
112 HRESULT WINAPI IDirectMusicPerformanceImpl_GetSegmentState (LPDIRECTMUSICPERFORMANCE iface, IDirectMusicSegmentState** ppSegmentState, MUSIC_TIME mtTime)
113 {
114         FIXME("stub\n");
115         return DS_OK;
116 }
117
118 HRESULT WINAPI IDirectMusicPerformanceImpl_SetPrepareTime (LPDIRECTMUSICPERFORMANCE iface, DWORD dwMilliSeconds)
119 {
120         FIXME("stub\n");
121         return DS_OK;
122 }
123
124 HRESULT WINAPI IDirectMusicPerformanceImpl_GetPrepareTime (LPDIRECTMUSICPERFORMANCE iface, DWORD* pdwMilliSeconds)
125 {
126         FIXME("stub\n");
127         return DS_OK;
128 }
129
130 HRESULT WINAPI IDirectMusicPerformanceImpl_SetBumperLength (LPDIRECTMUSICPERFORMANCE iface, DWORD dwMilliSeconds)
131 {
132         FIXME("stub\n");
133         return DS_OK;
134 }
135
136 HRESULT WINAPI IDirectMusicPerformanceImpl_GetBumperLength (LPDIRECTMUSICPERFORMANCE iface, DWORD* pdwMilliSeconds)
137 {
138         FIXME("stub\n");
139         return DS_OK;
140 }
141
142 HRESULT WINAPI IDirectMusicPerformanceImpl_SendPMsg (LPDIRECTMUSICPERFORMANCE iface, DMUS_PMSG* pPMSG)
143 {
144         FIXME("stub\n");
145         return DS_OK;
146 }
147
148 HRESULT WINAPI IDirectMusicPerformanceImpl_MusicToReferenceTime (LPDIRECTMUSICPERFORMANCE iface, MUSIC_TIME mtTime, REFERENCE_TIME* prtTime)
149 {
150         FIXME("stub\n");
151         return DS_OK;
152 }
153
154 HRESULT WINAPI IDirectMusicPerformanceImpl_ReferenceToMusicTime (LPDIRECTMUSICPERFORMANCE iface, REFERENCE_TIME rtTime, MUSIC_TIME* pmtTime)
155 {
156         FIXME("stub\n");
157         return DS_OK;
158 }
159
160 HRESULT WINAPI IDirectMusicPerformanceImpl_IsPlaying (LPDIRECTMUSICPERFORMANCE iface, IDirectMusicSegment* pSegment, IDirectMusicSegmentState* pSegState)
161 {
162         FIXME("stub\n");
163         return DS_OK;
164 }
165
166 HRESULT WINAPI IDirectMusicPerformanceImpl_GetTime (LPDIRECTMUSICPERFORMANCE iface, REFERENCE_TIME* prtNow, MUSIC_TIME* pmtNow)
167 {
168         FIXME("stub\n");
169         return DS_OK;
170 }
171
172 HRESULT WINAPI IDirectMusicPerformanceImpl_AllocPMsg (LPDIRECTMUSICPERFORMANCE iface, ULONG cb, DMUS_PMSG** ppPMSG)
173 {
174         FIXME("stub\n");
175         return DS_OK;
176 }
177
178 HRESULT WINAPI IDirectMusicPerformanceImpl_FreePMsg (LPDIRECTMUSICPERFORMANCE iface, DMUS_PMSG* pPMSG)
179 {
180         FIXME("stub\n");
181         return DS_OK;
182 }
183
184 HRESULT WINAPI IDirectMusicPerformanceImpl_GetGraph (LPDIRECTMUSICPERFORMANCE iface, IDirectMusicGraph** ppGraph)
185 {
186         FIXME("stub\n");
187         return DS_OK;
188 }
189
190 HRESULT WINAPI IDirectMusicPerformanceImpl_SetGraph (LPDIRECTMUSICPERFORMANCE iface, IDirectMusicGraph* pGraph)
191 {
192         FIXME("stub\n");
193         return DS_OK;
194 }
195
196 HRESULT WINAPI IDirectMusicPerformanceImpl_SetNotificationHandle (LPDIRECTMUSICPERFORMANCE iface, HANDLE hNotification, REFERENCE_TIME rtMinimum)
197 {
198         FIXME("stub\n");
199         return DS_OK;
200 }
201
202 HRESULT WINAPI IDirectMusicPerformanceImpl_GetNotificationPMsg (LPDIRECTMUSICPERFORMANCE iface, DMUS_NOTIFICATION_PMSG** ppNotificationPMsg)
203 {
204         FIXME("stub\n");
205         return DS_OK;
206 }
207
208 HRESULT WINAPI IDirectMusicPerformanceImpl_AddNotificationType (LPDIRECTMUSICPERFORMANCE iface, REFGUID rguidNotificationType)
209 {
210         FIXME("stub\n");
211         return DS_OK;
212 }
213
214 HRESULT WINAPI IDirectMusicPerformanceImpl_RemoveNotificationType (LPDIRECTMUSICPERFORMANCE iface, REFGUID rguidNotificationType)
215 {
216         FIXME("stub\n");
217         return DS_OK;
218 }
219
220 HRESULT WINAPI IDirectMusicPerformanceImpl_AddPort (LPDIRECTMUSICPERFORMANCE iface, IDirectMusicPort* pPort)
221 {
222         FIXME("stub\n");
223         return DS_OK;
224 }
225
226 HRESULT WINAPI IDirectMusicPerformanceImpl_RemovePort (LPDIRECTMUSICPERFORMANCE iface, IDirectMusicPort* pPort)
227 {
228         FIXME("stub\n");
229         return DS_OK;
230 }
231
232 HRESULT WINAPI IDirectMusicPerformanceImpl_AssignPChannelBlock (LPDIRECTMUSICPERFORMANCE iface, DWORD dwBlockNum, IDirectMusicPort* pPort, DWORD dwGroup)
233 {
234         FIXME("stub\n");
235         return DS_OK;
236 }
237
238 HRESULT WINAPI IDirectMusicPerformanceImpl_AssignPChannel (LPDIRECTMUSICPERFORMANCE iface, DWORD dwPChannel, IDirectMusicPort* pPort, DWORD dwGroup, DWORD dwMChannel)
239 {
240         FIXME("stub\n");
241         return DS_OK;
242 }
243
244 HRESULT WINAPI IDirectMusicPerformanceImpl_PChannelInfo (LPDIRECTMUSICPERFORMANCE iface, DWORD dwPChannel, IDirectMusicPort** ppPort, DWORD* pdwGroup, DWORD* pdwMChannel)
245 {
246         FIXME("stub\n");
247         return DS_OK;
248 }
249
250 HRESULT WINAPI IDirectMusicPerformanceImpl_DownloadInstrument (LPDIRECTMUSICPERFORMANCE iface, IDirectMusicInstrument* pInst, DWORD dwPChannel, IDirectMusicDownloadedInstrument** ppDownInst, DMUS_NOTERANGE* pNoteRanges, DWORD dwNumNoteRanges, IDirectMusicPort** ppPort, DWORD* pdwGroup, DWORD* pdwMChannel)
251 {
252         FIXME("stub\n");
253         return DS_OK;
254 }
255
256 HRESULT WINAPI IDirectMusicPerformanceImpl_Invalidate (LPDIRECTMUSICPERFORMANCE iface, MUSIC_TIME mtTime, DWORD dwFlags)
257 {
258         FIXME("stub\n");
259         return DS_OK;
260 }
261
262 HRESULT WINAPI IDirectMusicPerformanceImpl_GetParam (LPDIRECTMUSICPERFORMANCE iface, REFGUID rguidType, DWORD dwGroupBits, DWORD dwIndex, MUSIC_TIME mtTime, MUSIC_TIME* pmtNext, void* pParam)
263 {
264         FIXME("stub\n");
265         return DS_OK;
266 }
267
268 HRESULT WINAPI IDirectMusicPerformanceImpl_SetParam (LPDIRECTMUSICPERFORMANCE iface, REFGUID rguidType, DWORD dwGroupBits, DWORD dwIndex, MUSIC_TIME mtTime, void* pParam)
269 {
270         FIXME("stub\n");
271         return DS_OK;
272 }
273
274 HRESULT WINAPI IDirectMusicPerformanceImpl_GetGlobalParam (LPDIRECTMUSICPERFORMANCE iface, REFGUID rguidType, void* pParam, DWORD dwSize)
275 {
276         FIXME("stub\n");
277         return DS_OK;
278 }
279
280 HRESULT WINAPI IDirectMusicPerformanceImpl_SetGlobalParam (LPDIRECTMUSICPERFORMANCE iface, REFGUID rguidType, void* pParam, DWORD dwSize)
281 {
282         FIXME("stub\n");
283         return DS_OK;
284 }
285
286 HRESULT WINAPI IDirectMusicPerformanceImpl_GetLatencyTime (LPDIRECTMUSICPERFORMANCE iface, REFERENCE_TIME* prtTime)
287 {
288         FIXME("stub\n");
289         return DS_OK;
290 }
291
292 HRESULT WINAPI IDirectMusicPerformanceImpl_GetQueueTime (LPDIRECTMUSICPERFORMANCE iface, REFERENCE_TIME* prtTime)
293 {
294         FIXME("stub\n");
295         return DS_OK;
296 }
297
298 HRESULT WINAPI IDirectMusicPerformanceImpl_AdjustTime (LPDIRECTMUSICPERFORMANCE iface, REFERENCE_TIME rtAmount)
299 {
300         FIXME("stub\n");
301         return DS_OK;
302 }
303
304 HRESULT WINAPI IDirectMusicPerformanceImpl_CloseDown (LPDIRECTMUSICPERFORMANCE iface)
305 {
306         ICOM_THIS(IDirectMusicPerformanceImpl,iface);
307         FIXME("(%p): semi-stub\n", This);
308         return S_OK;
309 }
310
311 HRESULT WINAPI IDirectMusicPerformanceImpl_GetResolvedTime (LPDIRECTMUSICPERFORMANCE iface, REFERENCE_TIME rtTime, REFERENCE_TIME* prtResolved, DWORD dwTimeResolveFlags)
312 {
313         FIXME("stub\n");
314         return DS_OK;
315 }
316
317 HRESULT WINAPI IDirectMusicPerformanceImpl_MIDIToMusic (LPDIRECTMUSICPERFORMANCE iface, BYTE bMIDIValue, DMUS_CHORD_KEY* pChord, BYTE bPlayMode, BYTE bChordLevel, WORD* pwMusicValue)
318 {
319         FIXME("stub\n");
320         return DS_OK;
321 }
322
323 HRESULT WINAPI IDirectMusicPerformanceImpl_MusicToMIDI (LPDIRECTMUSICPERFORMANCE iface, WORD wMusicValue, DMUS_CHORD_KEY* pChord, BYTE bPlayMode, BYTE bChordLevel, BYTE* pbMIDIValue)
324 {
325         FIXME("stub\n");
326         return DS_OK;
327 }
328
329 HRESULT WINAPI IDirectMusicPerformanceImpl_TimeToRhythm (LPDIRECTMUSICPERFORMANCE iface, MUSIC_TIME mtTime, DMUS_TIMESIGNATURE* pTimeSig, WORD* pwMeasure, BYTE* pbBeat, BYTE* pbGrid, short* pnOffset)
330 {
331         FIXME("stub\n");
332         return DS_OK;
333 }
334
335 HRESULT WINAPI IDirectMusicPerformanceImpl_RhythmToTime (LPDIRECTMUSICPERFORMANCE iface, WORD wMeasure, BYTE bBeat, BYTE bGrid, short nOffset, DMUS_TIMESIGNATURE* pTimeSig, MUSIC_TIME* pmtTime)
336 {
337         FIXME("stub\n");
338         return DS_OK;
339 }
340
341 ICOM_VTABLE(IDirectMusicPerformance) DirectMusicPerformance_Vtbl =
342 {
343     ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
344         IDirectMusicPerformanceImpl_QueryInterface,
345         IDirectMusicPerformanceImpl_AddRef,
346         IDirectMusicPerformanceImpl_Release,
347         IDirectMusicPerformanceImpl_Init,
348         IDirectMusicPerformanceImpl_PlaySegment,
349         IDirectMusicPerformanceImpl_Stop,
350         IDirectMusicPerformanceImpl_GetSegmentState,
351         IDirectMusicPerformanceImpl_SetPrepareTime,
352         IDirectMusicPerformanceImpl_GetPrepareTime,
353         IDirectMusicPerformanceImpl_SetBumperLength,
354         IDirectMusicPerformanceImpl_GetBumperLength,
355         IDirectMusicPerformanceImpl_SendPMsg,
356         IDirectMusicPerformanceImpl_MusicToReferenceTime,
357         IDirectMusicPerformanceImpl_ReferenceToMusicTime,
358         IDirectMusicPerformanceImpl_IsPlaying,
359         IDirectMusicPerformanceImpl_GetTime,
360         IDirectMusicPerformanceImpl_AllocPMsg,
361         IDirectMusicPerformanceImpl_FreePMsg,
362         IDirectMusicPerformanceImpl_GetGraph,
363         IDirectMusicPerformanceImpl_SetGraph,
364         IDirectMusicPerformanceImpl_SetNotificationHandle,
365         IDirectMusicPerformanceImpl_GetNotificationPMsg,
366         IDirectMusicPerformanceImpl_AddNotificationType,
367         IDirectMusicPerformanceImpl_RemoveNotificationType,
368         IDirectMusicPerformanceImpl_AddPort,
369         IDirectMusicPerformanceImpl_RemovePort,
370         IDirectMusicPerformanceImpl_AssignPChannelBlock,
371         IDirectMusicPerformanceImpl_AssignPChannel,
372         IDirectMusicPerformanceImpl_PChannelInfo,
373         IDirectMusicPerformanceImpl_DownloadInstrument,
374         IDirectMusicPerformanceImpl_Invalidate,
375         IDirectMusicPerformanceImpl_GetParam,
376         IDirectMusicPerformanceImpl_SetParam,
377         IDirectMusicPerformanceImpl_GetGlobalParam,
378         IDirectMusicPerformanceImpl_SetGlobalParam,
379         IDirectMusicPerformanceImpl_GetLatencyTime,
380         IDirectMusicPerformanceImpl_GetQueueTime,
381         IDirectMusicPerformanceImpl_AdjustTime,
382         IDirectMusicPerformanceImpl_CloseDown,
383         IDirectMusicPerformanceImpl_GetResolvedTime,
384         IDirectMusicPerformanceImpl_MIDIToMusic,
385         IDirectMusicPerformanceImpl_MusicToMIDI,
386         IDirectMusicPerformanceImpl_TimeToRhythm,
387         IDirectMusicPerformanceImpl_RhythmToTime
388 };
389
390 HRESULT WINAPI DMUSIC_CreateDirectMusicPerformance (LPCGUID lpcGUID, LPDIRECTMUSICPERFORMANCE *ppDMPerf, LPUNKNOWN pUnkOuter)
391 {
392         IDirectMusicPerformanceImpl *pPerf;
393
394         TRACE("(%p,%p,%p)\n",lpcGUID, ppDMPerf, pUnkOuter);
395
396         if (IsEqualGUID(lpcGUID, &IID_IDirectMusicPerformance))
397         {
398                 pPerf = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirectMusicPerformanceImpl));
399                 if (NULL == pPerf)
400                 {
401                         *ppDMPerf = (LPDIRECTMUSICPERFORMANCE)NULL;
402                         return E_OUTOFMEMORY;
403                 }
404
405                 pPerf->lpVtbl = &DirectMusicPerformance_Vtbl;
406                 pPerf->ref = 1;
407                 *ppDMPerf = (LPDIRECTMUSICPERFORMANCE)pPerf;
408                 return S_OK;
409         }
410
411         WARN("No interface found\n");
412         return E_NOINTERFACE;
413 }
414
415 /* IDirectMusicPerformance8 IUnknown parts follow: */
416 HRESULT WINAPI IDirectMusicPerformance8Impl_QueryInterface (LPDIRECTMUSICPERFORMANCE8 iface, REFIID riid, LPVOID *ppobj)
417 {
418         ICOM_THIS(IDirectMusicPerformance8Impl,iface);
419
420         if (IsEqualGUID(riid, &IID_IUnknown) || IsEqualGUID(riid, &IID_IDirectMusicPerformance8))
421         {
422                 IDirectMusicPerformance8Impl_AddRef(iface);
423                 *ppobj = This;
424                 return DS_OK;
425         }
426         WARN("(%p)->(%s,%p),not found\n",This,debugstr_guid(riid),ppobj);
427         return E_NOINTERFACE;
428 }
429
430 ULONG WINAPI IDirectMusicPerformance8Impl_AddRef (LPDIRECTMUSICPERFORMANCE8 iface)
431 {
432         ICOM_THIS(IDirectMusicPerformance8Impl,iface);
433         TRACE("(%p) : AddRef from %ld\n", This, This->ref);
434         return ++(This->ref);
435 }
436
437 ULONG WINAPI IDirectMusicPerformance8Impl_Release (LPDIRECTMUSICPERFORMANCE8 iface)
438 {
439         ICOM_THIS(IDirectMusicPerformance8Impl,iface);
440         ULONG ref = --This->ref;
441         TRACE("(%p) : ReleaseRef to %ld\n", This, This->ref);
442         if (ref == 0)
443         {
444                 HeapFree(GetProcessHeap(), 0, This);
445         }
446         return ref;
447 }
448
449 /* IDirectMusicPerformance Interface part follow: */
450 HRESULT WINAPI IDirectMusicPerformance8Impl_Init (LPDIRECTMUSICPERFORMANCE8 iface, IDirectMusic** ppDirectMusic, LPDIRECTSOUND pDirectSound, HWND hWnd)
451 {
452         FIXME("stub\n");
453         return DS_OK;
454 }
455
456 HRESULT WINAPI IDirectMusicPerformance8Impl_PlaySegment (LPDIRECTMUSICPERFORMANCE8 iface, IDirectMusicSegment* pSegment, DWORD dwFlags, __int64 i64StartTime, IDirectMusicSegmentState** ppSegmentState)
457 {
458         FIXME("stub\n");
459         return DS_OK;
460 }
461
462 HRESULT WINAPI IDirectMusicPerformance8Impl_Stop (LPDIRECTMUSICPERFORMANCE8 iface, IDirectMusicSegment* pSegment, IDirectMusicSegmentState* pSegmentState, MUSIC_TIME mtTime, DWORD dwFlags)
463 {
464         FIXME("stub\n");
465         return DS_OK;
466 }
467
468 HRESULT WINAPI IDirectMusicPerformance8Impl_GetSegmentState (LPDIRECTMUSICPERFORMANCE8 iface, IDirectMusicSegmentState** ppSegmentState, MUSIC_TIME mtTime)
469 {
470         FIXME("stub\n");
471         return DS_OK;
472 }
473
474 HRESULT WINAPI IDirectMusicPerformance8Impl_SetPrepareTime (LPDIRECTMUSICPERFORMANCE8 iface, DWORD dwMilliSeconds)
475 {
476         FIXME("stub\n");
477         return DS_OK;
478 }
479
480 HRESULT WINAPI IDirectMusicPerformance8Impl_GetPrepareTime (LPDIRECTMUSICPERFORMANCE8 iface, DWORD* pdwMilliSeconds)
481 {
482         FIXME("stub\n");
483         return DS_OK;
484 }
485
486 HRESULT WINAPI IDirectMusicPerformance8Impl_SetBumperLength (LPDIRECTMUSICPERFORMANCE8 iface, DWORD dwMilliSeconds)
487 {
488         FIXME("stub\n");
489         return DS_OK;
490 }
491
492 HRESULT WINAPI IDirectMusicPerformance8Impl_GetBumperLength (LPDIRECTMUSICPERFORMANCE8 iface, DWORD* pdwMilliSeconds)
493 {
494         FIXME("stub\n");
495         return DS_OK;
496 }
497
498 HRESULT WINAPI IDirectMusicPerformance8Impl_SendPMsg (LPDIRECTMUSICPERFORMANCE8 iface, DMUS_PMSG* pPMSG)
499 {
500         FIXME("stub\n");
501         return DS_OK;
502 }
503
504 HRESULT WINAPI IDirectMusicPerformance8Impl_MusicToReferenceTime (LPDIRECTMUSICPERFORMANCE8 iface, MUSIC_TIME mtTime, REFERENCE_TIME* prtTime)
505 {
506         FIXME("stub\n");
507         return DS_OK;
508 }
509
510 HRESULT WINAPI IDirectMusicPerformance8Impl_ReferenceToMusicTime (LPDIRECTMUSICPERFORMANCE8 iface, REFERENCE_TIME rtTime, MUSIC_TIME* pmtTime)
511 {
512         FIXME("stub\n");
513         return DS_OK;
514 }
515
516 HRESULT WINAPI IDirectMusicPerformance8Impl_IsPlaying (LPDIRECTMUSICPERFORMANCE8 iface, IDirectMusicSegment* pSegment, IDirectMusicSegmentState* pSegState)
517 {
518         FIXME("stub\n");
519         return DS_OK;
520 }
521
522 HRESULT WINAPI IDirectMusicPerformance8Impl_GetTime (LPDIRECTMUSICPERFORMANCE8 iface, REFERENCE_TIME* prtNow, MUSIC_TIME* pmtNow)
523 {
524         FIXME("stub\n");
525         return DS_OK;
526 }
527
528 HRESULT WINAPI IDirectMusicPerformance8Impl_AllocPMsg (LPDIRECTMUSICPERFORMANCE8 iface, ULONG cb, DMUS_PMSG** ppPMSG)
529 {
530         FIXME("stub\n");
531         return DS_OK;
532 }
533
534 HRESULT WINAPI IDirectMusicPerformance8Impl_FreePMsg (LPDIRECTMUSICPERFORMANCE8 iface, DMUS_PMSG* pPMSG)
535 {
536         FIXME("stub\n");
537         return DS_OK;
538 }
539
540 HRESULT WINAPI IDirectMusicPerformance8Impl_GetGraph (LPDIRECTMUSICPERFORMANCE8 iface, IDirectMusicGraph** ppGraph)
541 {
542         FIXME("stub\n");
543         return DS_OK;
544 }
545
546 HRESULT WINAPI IDirectMusicPerformance8Impl_SetGraph (LPDIRECTMUSICPERFORMANCE8 iface, IDirectMusicGraph* pGraph)
547 {
548         FIXME("stub\n");
549         return DS_OK;
550 }
551
552 HRESULT WINAPI IDirectMusicPerformance8Impl_SetNotificationHandle (LPDIRECTMUSICPERFORMANCE8 iface, HANDLE hNotification, REFERENCE_TIME rtMinimum)
553 {
554         FIXME("stub\n");
555         return DS_OK;
556 }
557
558 HRESULT WINAPI IDirectMusicPerformance8Impl_GetNotificationPMsg (LPDIRECTMUSICPERFORMANCE8 iface, DMUS_NOTIFICATION_PMSG** ppNotificationPMsg)
559 {
560         FIXME("stub\n");
561         return DS_OK;
562 }
563
564 HRESULT WINAPI IDirectMusicPerformance8Impl_AddNotificationType (LPDIRECTMUSICPERFORMANCE8 iface, REFGUID rguidNotificationType)
565 {
566         FIXME("stub\n");
567         return DS_OK;
568 }
569
570 HRESULT WINAPI IDirectMusicPerformance8Impl_RemoveNotificationType (LPDIRECTMUSICPERFORMANCE8 iface, REFGUID rguidNotificationType)
571 {
572         FIXME("stub\n");
573         return DS_OK;
574 }
575
576 HRESULT WINAPI IDirectMusicPerformance8Impl_AddPort (LPDIRECTMUSICPERFORMANCE8 iface, IDirectMusicPort* pPort)
577 {
578         FIXME("stub\n");
579         return DS_OK;
580 }
581
582 HRESULT WINAPI IDirectMusicPerformance8Impl_RemovePort (LPDIRECTMUSICPERFORMANCE8 iface, IDirectMusicPort* pPort)
583 {
584         FIXME("stub\n");
585         return DS_OK;
586 }
587
588 HRESULT WINAPI IDirectMusicPerformance8Impl_AssignPChannelBlock (LPDIRECTMUSICPERFORMANCE8 iface, DWORD dwBlockNum, IDirectMusicPort* pPort, DWORD dwGroup)
589 {
590         FIXME("stub\n");
591         return DS_OK;
592 }
593
594 HRESULT WINAPI IDirectMusicPerformance8Impl_AssignPChannel (LPDIRECTMUSICPERFORMANCE8 iface, DWORD dwPChannel, IDirectMusicPort* pPort, DWORD dwGroup, DWORD dwMChannel)
595 {
596         FIXME("stub\n");
597         return DS_OK;
598 }
599
600 HRESULT WINAPI IDirectMusicPerformance8Impl_PChannelInfo (LPDIRECTMUSICPERFORMANCE8 iface, DWORD dwPChannel, IDirectMusicPort** ppPort, DWORD* pdwGroup, DWORD* pdwMChannel)
601 {
602         FIXME("stub\n");
603         return DS_OK;
604 }
605
606 HRESULT WINAPI IDirectMusicPerformance8Impl_DownloadInstrument (LPDIRECTMUSICPERFORMANCE8 iface, IDirectMusicInstrument* pInst, DWORD dwPChannel, IDirectMusicDownloadedInstrument** ppDownInst, DMUS_NOTERANGE* pNoteRanges, DWORD dwNumNoteRanges, IDirectMusicPort** ppPort, DWORD* pdwGroup, DWORD* pdwMChannel)
607 {
608         FIXME("stub\n");
609         return DS_OK;
610 }
611
612 HRESULT WINAPI IDirectMusicPerformance8Impl_Invalidate (LPDIRECTMUSICPERFORMANCE8 iface, MUSIC_TIME mtTime, DWORD dwFlags)
613 {
614         FIXME("stub\n");
615         return DS_OK;
616 }
617
618 HRESULT WINAPI IDirectMusicPerformance8Impl_GetParam (LPDIRECTMUSICPERFORMANCE8 iface, REFGUID rguidType, DWORD dwGroupBits, DWORD dwIndex, MUSIC_TIME mtTime, MUSIC_TIME* pmtNext, void* pParam)
619 {
620         FIXME("stub\n");
621         return DS_OK;
622 }
623
624 HRESULT WINAPI IDirectMusicPerformance8Impl_SetParam (LPDIRECTMUSICPERFORMANCE8 iface, REFGUID rguidType, DWORD dwGroupBits, DWORD dwIndex, MUSIC_TIME mtTime, void* pParam)
625 {
626         FIXME("stub\n");
627         return DS_OK;
628 }
629
630 HRESULT WINAPI IDirectMusicPerformance8Impl_GetGlobalParam (LPDIRECTMUSICPERFORMANCE8 iface, REFGUID rguidType, void* pParam, DWORD dwSize)
631 {
632         FIXME("stub\n");
633         return DS_OK;
634 }
635
636 HRESULT WINAPI IDirectMusicPerformance8Impl_SetGlobalParam (LPDIRECTMUSICPERFORMANCE8 iface, REFGUID rguidType, void* pParam, DWORD dwSize)
637 {
638         FIXME("stub\n");
639         return DS_OK;
640 }
641
642 HRESULT WINAPI IDirectMusicPerformance8Impl_GetLatencyTime (LPDIRECTMUSICPERFORMANCE8 iface, REFERENCE_TIME* prtTime)
643 {
644         FIXME("stub\n");
645         return DS_OK;
646 }
647
648 HRESULT WINAPI IDirectMusicPerformance8Impl_GetQueueTime (LPDIRECTMUSICPERFORMANCE8 iface, REFERENCE_TIME* prtTime)
649 {
650         FIXME("stub\n");
651         return DS_OK;
652 }
653
654 HRESULT WINAPI IDirectMusicPerformance8Impl_AdjustTime (LPDIRECTMUSICPERFORMANCE8 iface, REFERENCE_TIME rtAmount)
655 {
656         FIXME("stub\n");
657         return DS_OK;
658 }
659
660 HRESULT WINAPI IDirectMusicPerformance8Impl_CloseDown (LPDIRECTMUSICPERFORMANCE8 iface)
661 {
662         FIXME("stub\n");
663         return DS_OK;
664 }
665
666 HRESULT WINAPI IDirectMusicPerformance8Impl_GetResolvedTime (LPDIRECTMUSICPERFORMANCE8 iface, REFERENCE_TIME rtTime, REFERENCE_TIME* prtResolved, DWORD dwTimeResolveFlags)
667 {
668         FIXME("stub\n");
669         return DS_OK;
670 }
671
672 HRESULT WINAPI IDirectMusicPerformance8Impl_MIDIToMusic (LPDIRECTMUSICPERFORMANCE8 iface, BYTE bMIDIValue, DMUS_CHORD_KEY* pChord, BYTE bPlayMode, BYTE bChordLevel, WORD* pwMusicValue)
673 {
674         FIXME("stub\n");
675         return DS_OK;
676 }
677
678 HRESULT WINAPI IDirectMusicPerformance8Impl_MusicToMIDI (LPDIRECTMUSICPERFORMANCE8 iface, WORD wMusicValue, DMUS_CHORD_KEY* pChord, BYTE bPlayMode, BYTE bChordLevel, BYTE* pbMIDIValue)
679 {
680         FIXME("stub\n");
681         return DS_OK;
682 }
683
684 HRESULT WINAPI IDirectMusicPerformance8Impl_TimeToRhythm (LPDIRECTMUSICPERFORMANCE8 iface, MUSIC_TIME mtTime, DMUS_TIMESIGNATURE* pTimeSig, WORD* pwMeasure, BYTE* pbBeat, BYTE* pbGrid, short* pnOffset)
685 {
686         FIXME("stub\n");
687         return DS_OK;
688 }
689
690 HRESULT WINAPI IDirectMusicPerformance8Impl_RhythmToTime (LPDIRECTMUSICPERFORMANCE8 iface, WORD wMeasure, BYTE bBeat, BYTE bGrid, short nOffset, DMUS_TIMESIGNATURE* pTimeSig, MUSIC_TIME* pmtTime)
691 {
692         FIXME("stub\n");
693         return DS_OK;
694 }
695
696 /* IDirectMusicPerformance8 Interface part follow: */
697 HRESULT WINAPI IDirectMusicPerformance8ImplInitAudio (LPDIRECTMUSICPERFORMANCE8 iface, IDirectMusic** ppDirectMusic, IDirectSound** ppDirectSound, HWND hWnd, DWORD dwDefaultPathType, DWORD dwPChannelCount, DWORD dwFlags, DMUS_AUDIOPARAMS* pParams)
698 {
699         FIXME("stub\n");
700         return DS_OK;
701 }
702
703 HRESULT WINAPI IDirectMusicPerformance8ImplPlaySegmentEx (LPDIRECTMUSICPERFORMANCE8 iface, IUnknown* pSource, WCHAR* pwzSegmentName, IUnknown* pTransition, DWORD dwFlags, __int64 i64StartTime, IDirectMusicSegmentState** ppSegmentState, IUnknown* pFrom, IUnknown* pAudioPath)
704 {
705         FIXME("stub\n");
706         return DS_OK;
707 }
708
709 HRESULT WINAPI IDirectMusicPerformance8ImplStopEx (LPDIRECTMUSICPERFORMANCE8 iface, IUnknown* pObjectToStop, __int64 i64StopTime, DWORD dwFlags)
710 {
711         FIXME("stub\n");
712         return DS_OK;
713 }
714
715 HRESULT WINAPI IDirectMusicPerformance8ImplClonePMsg (LPDIRECTMUSICPERFORMANCE8 iface, DMUS_PMSG* pSourcePMSG, DMUS_PMSG** ppCopyPMSG)
716 {
717         FIXME("stub\n");
718         return DS_OK;
719 }
720
721 HRESULT WINAPI IDirectMusicPerformance8ImplCreateAudioPath (LPDIRECTMUSICPERFORMANCE8 iface, IUnknown* pSourceConfig, BOOL fActivate, IDirectMusicAudioPath** ppNewPath)
722 {
723         FIXME("stub\n");
724         return DS_OK;
725 }
726
727 HRESULT WINAPI IDirectMusicPerformance8ImplCreateStandardAudioPath (LPDIRECTMUSICPERFORMANCE8 iface, DWORD dwType, DWORD dwPChannelCount, BOOL fActivate, IDirectMusicAudioPath** ppNewPath)
728 {
729         FIXME("stub\n");
730         return DS_OK;
731 }
732
733 HRESULT WINAPI IDirectMusicPerformance8ImplSetDefaultAudioPath (LPDIRECTMUSICPERFORMANCE8 iface, IDirectMusicAudioPath* pAudioPath)
734 {
735         FIXME("stub\n");
736         return DS_OK;
737 }
738
739 HRESULT WINAPI IDirectMusicPerformance8ImplGetDefaultAudioPath (LPDIRECTMUSICPERFORMANCE8 iface, IDirectMusicAudioPath** ppAudioPath)
740 {
741         FIXME("stub\n");
742         return DS_OK;
743 }
744
745 HRESULT WINAPI IDirectMusicPerformance8ImplGetParamEx (LPDIRECTMUSICPERFORMANCE8 iface, REFGUID rguidType, DWORD dwTrackID, DWORD dwGroupBits, DWORD dwIndex, MUSIC_TIME mtTime, MUSIC_TIME* pmtNext, void* pParam)
746 {
747         FIXME("stub\n");
748         return DS_OK;
749 }
750
751 ICOM_VTABLE(IDirectMusicPerformance8) DirectMusicPerformance8_Vtbl =
752 {
753     ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
754         IDirectMusicPerformance8Impl_QueryInterface,
755         IDirectMusicPerformance8Impl_AddRef,
756         IDirectMusicPerformance8Impl_Release,
757         IDirectMusicPerformance8Impl_Init,
758         IDirectMusicPerformance8Impl_PlaySegment,
759         IDirectMusicPerformance8Impl_Stop,
760         IDirectMusicPerformance8Impl_GetSegmentState,
761         IDirectMusicPerformance8Impl_SetPrepareTime,
762         IDirectMusicPerformance8Impl_GetPrepareTime,
763         IDirectMusicPerformance8Impl_SetBumperLength,
764         IDirectMusicPerformance8Impl_GetBumperLength,
765         IDirectMusicPerformance8Impl_SendPMsg,
766         IDirectMusicPerformance8Impl_MusicToReferenceTime,
767         IDirectMusicPerformance8Impl_ReferenceToMusicTime,
768         IDirectMusicPerformance8Impl_IsPlaying,
769         IDirectMusicPerformance8Impl_GetTime,
770         IDirectMusicPerformance8Impl_AllocPMsg,
771         IDirectMusicPerformance8Impl_FreePMsg,
772         IDirectMusicPerformance8Impl_GetGraph,
773         IDirectMusicPerformance8Impl_SetGraph,
774         IDirectMusicPerformance8Impl_SetNotificationHandle,
775         IDirectMusicPerformance8Impl_GetNotificationPMsg,
776         IDirectMusicPerformance8Impl_AddNotificationType,
777         IDirectMusicPerformance8Impl_RemoveNotificationType,
778         IDirectMusicPerformance8Impl_AddPort,
779         IDirectMusicPerformance8Impl_RemovePort,
780         IDirectMusicPerformance8Impl_AssignPChannelBlock,
781         IDirectMusicPerformance8Impl_AssignPChannel,
782         IDirectMusicPerformance8Impl_PChannelInfo,
783         IDirectMusicPerformance8Impl_DownloadInstrument,
784         IDirectMusicPerformance8Impl_Invalidate,
785         IDirectMusicPerformance8Impl_GetParam,
786         IDirectMusicPerformance8Impl_SetParam,
787         IDirectMusicPerformance8Impl_GetGlobalParam,
788         IDirectMusicPerformance8Impl_SetGlobalParam,
789         IDirectMusicPerformance8Impl_GetLatencyTime,
790         IDirectMusicPerformance8Impl_GetQueueTime,
791         IDirectMusicPerformance8Impl_AdjustTime,
792         IDirectMusicPerformance8Impl_CloseDown,
793         IDirectMusicPerformance8Impl_GetResolvedTime,
794         IDirectMusicPerformance8Impl_MIDIToMusic,
795         IDirectMusicPerformance8Impl_MusicToMIDI,
796         IDirectMusicPerformance8Impl_TimeToRhythm,
797         IDirectMusicPerformance8Impl_RhythmToTime,
798         IDirectMusicPerformance8ImplInitAudio,
799         IDirectMusicPerformance8ImplPlaySegmentEx,
800         IDirectMusicPerformance8ImplStopEx,
801         IDirectMusicPerformance8ImplClonePMsg,
802         IDirectMusicPerformance8ImplCreateAudioPath,
803         IDirectMusicPerformance8ImplCreateStandardAudioPath,
804         IDirectMusicPerformance8ImplSetDefaultAudioPath,
805         IDirectMusicPerformance8ImplGetDefaultAudioPath,
806         IDirectMusicPerformance8ImplGetParamEx
807 };