Added YUV routines needed for v4l driver, and in the future possibly
[wine/gsoc-2012-control.git] / dlls / dmime / dmime_main.c
blob8920791d42db5218ea443cbee93ec94049363958
1 /* DirectMusicInteractiveEngine Main
3 * Copyright (C) 2003-2004 Rok Mandeljc
4 * Copyright (C) 2003-2004 Raphael Junqueira
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.
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.
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.
21 #include "dmime_private.h"
23 WINE_DEFAULT_DEBUG_CHANNEL(dmime);
24 WINE_DECLARE_DEBUG_CHANNEL(dmfile);
26 LONG DMIME_refCount = 0;
28 typedef struct {
29 IClassFactoryVtbl *lpVtbl;
30 } IClassFactoryImpl;
32 /******************************************************************
33 * DirectMusicPerformance ClassFactory
35 static HRESULT WINAPI PerformanceCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj) {
36 FIXME("- no interface\n\tIID:\t%s\n", debugstr_guid(riid));
38 if (ppobj == NULL) return E_POINTER;
40 return E_NOINTERFACE;
43 static ULONG WINAPI PerformanceCF_AddRef(LPCLASSFACTORY iface) {
44 DMIME_LockModule();
46 return 2; /* non-heap based object */
49 static ULONG WINAPI PerformanceCF_Release(LPCLASSFACTORY iface) {
50 DMIME_UnlockModule();
52 return 1; /* non-heap based object */
55 static HRESULT WINAPI PerformanceCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj) {
56 TRACE ("(%p, %s, %p)\n", pOuter, debugstr_dmguid(riid), ppobj);
58 return DMUSIC_CreateDirectMusicPerformanceImpl (riid, ppobj, pOuter);
61 static HRESULT WINAPI PerformanceCF_LockServer(LPCLASSFACTORY iface,BOOL dolock) {
62 TRACE("(%d)\n", dolock);
64 if (dolock)
65 DMIME_LockModule();
66 else
67 DMIME_UnlockModule();
69 return S_OK;
72 static IClassFactoryVtbl PerformanceCF_Vtbl = {
73 PerformanceCF_QueryInterface,
74 PerformanceCF_AddRef,
75 PerformanceCF_Release,
76 PerformanceCF_CreateInstance,
77 PerformanceCF_LockServer
80 static IClassFactoryImpl Performance_CF = {&PerformanceCF_Vtbl};
82 /******************************************************************
83 * DirectMusicSegment ClassFactory
85 static HRESULT WINAPI SegmentCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj) {
86 FIXME("- no interface\n\tIID:\t%s\n", debugstr_guid(riid));
88 if (ppobj == NULL) return E_POINTER;
90 return E_NOINTERFACE;
93 static ULONG WINAPI SegmentCF_AddRef(LPCLASSFACTORY iface) {
94 DMIME_LockModule();
96 return 2; /* non-heap based object */
99 static ULONG WINAPI SegmentCF_Release(LPCLASSFACTORY iface) {
100 DMIME_UnlockModule();
102 return 1; /* non-heap based object */
105 static HRESULT WINAPI SegmentCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj) {
106 TRACE ("(%p, %s, %p)\n", pOuter, debugstr_dmguid(riid), ppobj);
108 return DMUSIC_CreateDirectMusicSegmentImpl (riid, ppobj, pOuter);
111 static HRESULT WINAPI SegmentCF_LockServer(LPCLASSFACTORY iface,BOOL dolock) {
112 TRACE("(%d)\n", dolock);
114 if (dolock)
115 DMIME_LockModule();
116 else
117 DMIME_UnlockModule();
119 return S_OK;
122 static IClassFactoryVtbl SegmentCF_Vtbl = {
123 SegmentCF_QueryInterface,
124 SegmentCF_AddRef,
125 SegmentCF_Release,
126 SegmentCF_CreateInstance,
127 SegmentCF_LockServer
130 static IClassFactoryImpl Segment_CF = {&SegmentCF_Vtbl};
132 /******************************************************************
133 * DirectMusicSegmentState ClassFactory
135 static HRESULT WINAPI SegmentStateCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj) {
136 FIXME("- no interface\n\tIID:\t%s\n", debugstr_guid(riid));
138 if (ppobj == NULL) return E_POINTER;
140 return E_NOINTERFACE;
143 static ULONG WINAPI SegmentStateCF_AddRef(LPCLASSFACTORY iface) {
144 DMIME_LockModule();
146 return 2; /* non-heap based objects */
149 static ULONG WINAPI SegmentStateCF_Release(LPCLASSFACTORY iface) {
150 DMIME_UnlockModule();
152 return 1; /* non-heap based object */
155 static HRESULT WINAPI SegmentStateCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj) {
156 TRACE ("(%p, %s, %p)\n", pOuter, debugstr_dmguid(riid), ppobj);
158 return DMUSIC_CreateDirectMusicSegmentStateImpl (riid, ppobj, pOuter);
161 static HRESULT WINAPI SegmentStateCF_LockServer(LPCLASSFACTORY iface,BOOL dolock) {
162 TRACE("(%d)\n", dolock);
164 if (dolock)
165 DMIME_LockModule();
166 else
167 DMIME_UnlockModule();
169 return S_OK;
172 static IClassFactoryVtbl SegmentStateCF_Vtbl = {
173 SegmentStateCF_QueryInterface,
174 SegmentStateCF_AddRef,
175 SegmentStateCF_Release,
176 SegmentStateCF_CreateInstance,
177 SegmentStateCF_LockServer
180 static IClassFactoryImpl SegmentState_CF = {&SegmentStateCF_Vtbl};
182 /******************************************************************
183 * DirectMusicGraph ClassFactory
185 static HRESULT WINAPI GraphCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj) {
186 FIXME("- no interface\n\tIID:\t%s\n", debugstr_guid(riid));
188 if (ppobj == NULL) return E_POINTER;
190 return E_NOINTERFACE;
193 static ULONG WINAPI GraphCF_AddRef(LPCLASSFACTORY iface) {
194 DMIME_LockModule();
196 return 2; /* non-heap based object */
199 static ULONG WINAPI GraphCF_Release(LPCLASSFACTORY iface) {
200 DMIME_UnlockModule();
202 return 1; /* non-heap based object */
205 static HRESULT WINAPI GraphCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj) {
206 TRACE ("(%p, %s, %p)\n", pOuter, debugstr_dmguid(riid), ppobj);
208 return DMUSIC_CreateDirectMusicGraphImpl (riid, ppobj, pOuter);
211 static HRESULT WINAPI GraphCF_LockServer(LPCLASSFACTORY iface,BOOL dolock) {
212 TRACE("(%d)\n", dolock);
214 if (dolock)
215 DMIME_LockModule();
216 else
217 DMIME_UnlockModule();
219 return S_OK;
222 static IClassFactoryVtbl GraphCF_Vtbl = {
223 GraphCF_QueryInterface,
224 GraphCF_AddRef,
225 GraphCF_Release,
226 GraphCF_CreateInstance,
227 GraphCF_LockServer
230 static IClassFactoryImpl Graph_CF = {&GraphCF_Vtbl};
232 /******************************************************************
233 * DirectMusicTempoTrack ClassFactory
235 static HRESULT WINAPI TempoTrackCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj) {
236 FIXME("- no interface\n\tIID:\t%s\n", debugstr_guid(riid));
238 if (ppobj == NULL) return E_POINTER;
240 return E_NOINTERFACE;
243 static ULONG WINAPI TempoTrackCF_AddRef(LPCLASSFACTORY iface) {
244 DMIME_LockModule();
246 return 2; /* non-heap based object */
249 static ULONG WINAPI TempoTrackCF_Release(LPCLASSFACTORY iface) {
250 DMIME_UnlockModule();
252 return 1; /* non-heap based object */
255 static HRESULT WINAPI TempoTrackCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj) {
256 TRACE ("(%p, %s, %p)\n", pOuter, debugstr_dmguid(riid), ppobj);
258 return DMUSIC_CreateDirectMusicTempoTrack (riid, ppobj, pOuter);
261 static HRESULT WINAPI TempoTrackCF_LockServer(LPCLASSFACTORY iface,BOOL dolock) {
262 TRACE("(%d)\n", dolock);
264 if (dolock)
265 DMIME_LockModule();
266 else
267 DMIME_UnlockModule();
269 return S_OK;
272 static IClassFactoryVtbl TempoTrackCF_Vtbl = {
273 TempoTrackCF_QueryInterface,
274 TempoTrackCF_AddRef,
275 TempoTrackCF_Release,
276 TempoTrackCF_CreateInstance,
277 TempoTrackCF_LockServer
280 static IClassFactoryImpl TempoTrack_CF = {&TempoTrackCF_Vtbl};
282 /******************************************************************
283 * DirectMusicSeqTrack ClassFactory
285 static HRESULT WINAPI SeqTrackCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj) {
286 FIXME("- no interface\n\tIID:\t%s\n", debugstr_guid(riid));
288 if (ppobj == NULL) return E_POINTER;
290 return E_NOINTERFACE;
293 static ULONG WINAPI SeqTrackCF_AddRef(LPCLASSFACTORY iface) {
294 DMIME_LockModule();
296 return 2; /* non-heap based object */
299 static ULONG WINAPI SeqTrackCF_Release(LPCLASSFACTORY iface) {
300 DMIME_UnlockModule();
302 return 1; /* non-heap based object */
305 static HRESULT WINAPI SeqTrackCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj) {
306 TRACE ("(%p, %s, %p)\n", pOuter, debugstr_dmguid(riid), ppobj);
308 return DMUSIC_CreateDirectMusicSeqTrack (riid, ppobj, pOuter);
311 static HRESULT WINAPI SeqTrackCF_LockServer(LPCLASSFACTORY iface,BOOL dolock) {
312 TRACE("(%d)\n", dolock);
314 if (dolock)
315 DMIME_LockModule();
316 else
317 DMIME_UnlockModule();
319 return S_OK;
322 static IClassFactoryVtbl SeqTrackCF_Vtbl = {
323 SeqTrackCF_QueryInterface,
324 SeqTrackCF_AddRef,
325 SeqTrackCF_Release,
326 SeqTrackCF_CreateInstance,
327 SeqTrackCF_LockServer
330 static IClassFactoryImpl SeqTrack_CF = {&SeqTrackCF_Vtbl};
332 /******************************************************************
333 * DirectMusicSysExTrack ClassFactory
335 static HRESULT WINAPI SysExTrackCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj) {
336 FIXME("- no interface\n\tIID:\t%s\n", debugstr_guid(riid));
338 if (ppobj == NULL) return E_POINTER;
340 return E_NOINTERFACE;
343 static ULONG WINAPI SysExTrackCF_AddRef(LPCLASSFACTORY iface) {
344 DMIME_LockModule();
346 return 2; /* non-heap based object */
349 static ULONG WINAPI SysExTrackCF_Release(LPCLASSFACTORY iface) {
350 DMIME_UnlockModule();
352 return 1; /* non-heap based object */
355 static HRESULT WINAPI SysExTrackCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj) {
356 TRACE ("(%p, %s, %p)\n", pOuter, debugstr_dmguid(riid), ppobj);
357 return DMUSIC_CreateDirectMusicSysExTrack (riid, ppobj, pOuter);
360 static HRESULT WINAPI SysExTrackCF_LockServer(LPCLASSFACTORY iface,BOOL dolock) {
361 TRACE("(%d)\n", dolock);
363 if (dolock)
364 DMIME_LockModule();
365 else
366 DMIME_UnlockModule();
368 return S_OK;
371 static IClassFactoryVtbl SysExTrackCF_Vtbl = {
372 SysExTrackCF_QueryInterface,
373 SysExTrackCF_AddRef,
374 SysExTrackCF_Release,
375 SysExTrackCF_CreateInstance,
376 SysExTrackCF_LockServer
379 static IClassFactoryImpl SysExTrack_CF = {&SysExTrackCF_Vtbl};
381 /******************************************************************
382 * DirectMusicTimeSigTrack ClassFactory
384 static HRESULT WINAPI TimeSigTrackCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj) {
385 FIXME("- no interface\n\tIID:\t%s\n", debugstr_guid(riid));
387 if (ppobj == NULL) return E_POINTER;
389 return E_NOINTERFACE;
392 static ULONG WINAPI TimeSigTrackCF_AddRef(LPCLASSFACTORY iface) {
393 DMIME_LockModule();
395 return 2; /* non-heap based object */
398 static ULONG WINAPI TimeSigTrackCF_Release(LPCLASSFACTORY iface) {
399 DMIME_UnlockModule();
401 return 1; /* non-heap based object */
404 static HRESULT WINAPI TimeSigTrackCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj) {
405 TRACE ("(%p, %s, %p)\n", pOuter, debugstr_dmguid(riid), ppobj);
407 return DMUSIC_CreateDirectMusicTimeSigTrack (riid, ppobj, pOuter);
410 static HRESULT WINAPI TimeSigTrackCF_LockServer(LPCLASSFACTORY iface,BOOL dolock) {
411 TRACE("(%d)\n", dolock);
413 if (dolock)
414 DMIME_LockModule();
415 else
416 DMIME_UnlockModule();
418 return S_OK;
421 static IClassFactoryVtbl TimeSigTrackCF_Vtbl = {
422 TimeSigTrackCF_QueryInterface,
423 TimeSigTrackCF_AddRef,
424 TimeSigTrackCF_Release,
425 TimeSigTrackCF_CreateInstance,
426 TimeSigTrackCF_LockServer
429 static IClassFactoryImpl TimeSigTrack_CF = {&TimeSigTrackCF_Vtbl};
431 /******************************************************************
432 * DirectMusicParamControlTrack ClassFactory
434 static HRESULT WINAPI ParamControlTrackCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj) {
435 FIXME("- no interface\n\tIID:\t%s\n", debugstr_guid(riid));
437 if (ppobj == NULL) return E_POINTER;
439 return E_NOINTERFACE;
442 static ULONG WINAPI ParamControlTrackCF_AddRef(LPCLASSFACTORY iface) {
443 DMIME_LockModule();
445 return 2; /* non-heap based object */
448 static ULONG WINAPI ParamControlTrackCF_Release(LPCLASSFACTORY iface) {
449 DMIME_UnlockModule();
451 return 1; /* non-heap based object */
454 static HRESULT WINAPI ParamControlTrackCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj) {
455 TRACE ("(%p, %s, %p)\n", pOuter, debugstr_dmguid(riid), ppobj);
457 return DMUSIC_CreateDirectMusicParamControlTrack (riid, ppobj, pOuter);
460 static HRESULT WINAPI ParamControlTrackCF_LockServer(LPCLASSFACTORY iface,BOOL dolock) {
461 TRACE("(%d)\n", dolock);
463 if (dolock)
464 DMIME_LockModule();
465 else
466 DMIME_UnlockModule();
468 return S_OK;
471 static IClassFactoryVtbl ParamControlTrackCF_Vtbl = {
472 ParamControlTrackCF_QueryInterface,
473 ParamControlTrackCF_AddRef,
474 ParamControlTrackCF_Release,
475 ParamControlTrackCF_CreateInstance,
476 ParamControlTrackCF_LockServer
479 static IClassFactoryImpl ParamControlTrack_CF = {&ParamControlTrackCF_Vtbl};
481 /******************************************************************
482 * DirectMusicMarkerTrack ClassFactory
484 static HRESULT WINAPI MarkerTrackCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj) {
485 FIXME("- no interface\n\tIID:\t%s\n", debugstr_guid(riid));
487 if (ppobj == NULL) return E_POINTER;
489 return E_NOINTERFACE;
492 static ULONG WINAPI MarkerTrackCF_AddRef(LPCLASSFACTORY iface) {
493 DMIME_LockModule();
495 return 2; /* non-heap based object */
498 static ULONG WINAPI MarkerTrackCF_Release(LPCLASSFACTORY iface) {
499 DMIME_UnlockModule();
501 return 1; /* non-heap based object */
504 static HRESULT WINAPI MarkerTrackCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj) {
505 TRACE ("(%p, %s, %p)\n", pOuter, debugstr_dmguid(riid), ppobj);
507 return DMUSIC_CreateDirectMusicMarkerTrack (riid, ppobj, pOuter);
510 static HRESULT WINAPI MarkerTrackCF_LockServer(LPCLASSFACTORY iface,BOOL dolock) {
511 TRACE("(%d)\n", dolock);
513 if (dolock)
514 DMIME_LockModule();
515 else
516 DMIME_UnlockModule();
518 return S_OK;
521 static IClassFactoryVtbl MarkerTrackCF_Vtbl = {
522 MarkerTrackCF_QueryInterface,
523 MarkerTrackCF_AddRef,
524 MarkerTrackCF_Release,
525 MarkerTrackCF_CreateInstance,
526 MarkerTrackCF_LockServer
529 static IClassFactoryImpl MarkerTrack_CF = {&MarkerTrackCF_Vtbl};
531 /******************************************************************
532 * DirectMusicLyricsTrack ClassFactory
534 static HRESULT WINAPI LyricsTrackCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj) {
535 FIXME("- no interface\n\tIID:\t%s\n", debugstr_guid(riid));
537 if (ppobj == NULL) return E_POINTER;
539 return E_NOINTERFACE;
542 static ULONG WINAPI LyricsTrackCF_AddRef(LPCLASSFACTORY iface) {
543 DMIME_LockModule();
545 return 2; /* non-heap based object */
548 static ULONG WINAPI LyricsTrackCF_Release(LPCLASSFACTORY iface) {
549 DMIME_UnlockModule();
551 return 1; /* non-heap based object */
554 static HRESULT WINAPI LyricsTrackCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj) {
555 TRACE ("(%p, %s, %p)\n", pOuter, debugstr_dmguid(riid), ppobj);
557 return DMUSIC_CreateDirectMusicLyricsTrack (riid, ppobj, pOuter);
560 static HRESULT WINAPI LyricsTrackCF_LockServer(LPCLASSFACTORY iface,BOOL dolock) {
561 TRACE("(%d)\n", dolock);
563 if (dolock)
564 DMIME_LockModule();
565 else
566 DMIME_UnlockModule();
568 return S_OK;
571 static IClassFactoryVtbl LyricsTrackCF_Vtbl = {
572 LyricsTrackCF_QueryInterface,
573 LyricsTrackCF_AddRef,
574 LyricsTrackCF_Release,
575 LyricsTrackCF_CreateInstance,
576 LyricsTrackCF_LockServer
579 static IClassFactoryImpl LyricsTrack_CF = {&LyricsTrackCF_Vtbl};
582 /******************************************************************
583 * DirectMusicSegTriggerTrack ClassFactory
585 static HRESULT WINAPI SegTriggerTrackCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj) {
586 FIXME("- no interface\n\tIID:\t%s\n", debugstr_guid(riid));
588 if (ppobj == NULL) return E_POINTER;
590 return E_NOINTERFACE;
593 static ULONG WINAPI SegTriggerTrackCF_AddRef(LPCLASSFACTORY iface) {
594 DMIME_LockModule();
596 return 2; /* non-heap based object */
599 static ULONG WINAPI SegTriggerTrackCF_Release(LPCLASSFACTORY iface) {
600 DMIME_UnlockModule();
602 return 1; /* non-heap based object */
605 static HRESULT WINAPI SegTriggerTrackCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj) {
606 TRACE ("(%p, %s, %p)\n", pOuter, debugstr_dmguid(riid), ppobj);
608 return DMUSIC_CreateDirectMusicSegTriggerTrack (riid, ppobj, pOuter);
611 static HRESULT WINAPI SegTriggerTrackCF_LockServer(LPCLASSFACTORY iface,BOOL dolock) {
612 TRACE("(%d)\n", dolock);
614 if (dolock)
615 DMIME_LockModule();
616 else
617 DMIME_UnlockModule();
619 return S_OK;
622 static IClassFactoryVtbl SegTriggerTrackCF_Vtbl = {
623 SegTriggerTrackCF_QueryInterface,
624 SegTriggerTrackCF_AddRef,
625 SegTriggerTrackCF_Release,
626 SegTriggerTrackCF_CreateInstance,
627 SegTriggerTrackCF_LockServer
630 static IClassFactoryImpl SegTriggerTrack_CF = {&SegTriggerTrackCF_Vtbl};
632 /******************************************************************
633 * DirectMusicAudioPath ClassFactory
635 static HRESULT WINAPI AudioPathCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj) {
636 FIXME("- no interface\n\tIID:\t%s\n", debugstr_guid(riid));
638 if (ppobj == NULL) return E_POINTER;
640 return E_NOINTERFACE;
643 static ULONG WINAPI AudioPathCF_AddRef(LPCLASSFACTORY iface) {
644 DMIME_LockModule();
646 return 2; /* non-heap based object */
649 static ULONG WINAPI AudioPathCF_Release(LPCLASSFACTORY iface) {
650 DMIME_UnlockModule();
652 return 1; /* non-heap based object */
655 static HRESULT WINAPI AudioPathCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj) {
656 TRACE ("(%p, %s, %p)\n", pOuter, debugstr_dmguid(riid), ppobj);
658 return DMUSIC_CreateDirectMusicAudioPathImpl (riid, ppobj, pOuter);
661 static HRESULT WINAPI AudioPathCF_LockServer(LPCLASSFACTORY iface,BOOL dolock) {
662 TRACE("(%d)\n", dolock);
664 if (dolock)
665 DMIME_LockModule();
666 else
667 DMIME_UnlockModule();
669 return S_OK;
672 static IClassFactoryVtbl AudioPathCF_Vtbl = {
673 AudioPathCF_QueryInterface,
674 AudioPathCF_AddRef,
675 AudioPathCF_Release,
676 AudioPathCF_CreateInstance,
677 AudioPathCF_LockServer
680 static IClassFactoryImpl AudioPath_CF = {&AudioPathCF_Vtbl};
682 /******************************************************************
683 * DirectMusicWaveTrack ClassFactory
685 static HRESULT WINAPI WaveTrackCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj) {
686 FIXME("- no interface\n\tIID:\t%s\n", debugstr_guid(riid));
688 if (ppobj == NULL) return E_POINTER;
690 return E_NOINTERFACE;
693 static ULONG WINAPI WaveTrackCF_AddRef(LPCLASSFACTORY iface) {
694 DMIME_LockModule();
696 return 2; /* non-heap based object */
699 static ULONG WINAPI WaveTrackCF_Release(LPCLASSFACTORY iface) {
700 DMIME_UnlockModule();
702 return 1; /* non-heap based object */
705 static HRESULT WINAPI WaveTrackCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj) {
706 TRACE ("(%p, %s, %p)\n", pOuter, debugstr_dmguid(riid), ppobj);
708 return DMUSIC_CreateDirectMusicWaveTrack (riid, ppobj, pOuter);
711 static HRESULT WINAPI WaveTrackCF_LockServer(LPCLASSFACTORY iface,BOOL dolock) {
712 TRACE("(%d)\n", dolock);
714 if (dolock)
715 DMIME_LockModule();
716 else
717 DMIME_UnlockModule();
719 return S_OK;
722 static IClassFactoryVtbl WaveTrackCF_Vtbl = {
723 WaveTrackCF_QueryInterface,
724 WaveTrackCF_AddRef,
725 WaveTrackCF_Release,
726 WaveTrackCF_CreateInstance,
727 WaveTrackCF_LockServer
730 static IClassFactoryImpl WaveTrack_CF = {&WaveTrackCF_Vtbl};
732 /******************************************************************
733 * DllMain
737 BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) {
738 if (fdwReason == DLL_PROCESS_ATTACH) {
739 DisableThreadLibraryCalls(hinstDLL);
740 /* FIXME: Initialisation */
742 else if (fdwReason == DLL_PROCESS_DETACH) {
743 /* FIXME: Cleanup */
746 return TRUE;
750 /******************************************************************
751 * DllCanUnloadNow (DMIME.1)
755 HRESULT WINAPI DllCanUnloadNow(void)
757 return DMIME_refCount != 0 ? S_FALSE : S_OK;
761 /******************************************************************
762 * DllGetClassObject (DMIME.2)
766 HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv)
768 TRACE("(%s, %s, %p)\n", debugstr_dmguid(rclsid), debugstr_dmguid(riid), ppv);
769 if (IsEqualCLSID (rclsid, &CLSID_DirectMusicPerformance) && IsEqualIID (riid, &IID_IClassFactory)) {
770 *ppv = (LPVOID) &Performance_CF;
771 IClassFactory_AddRef((IClassFactory*)*ppv);
772 return S_OK;
773 } else if (IsEqualCLSID (rclsid, &CLSID_DirectMusicSegment) && IsEqualIID (riid, &IID_IClassFactory)) {
774 *ppv = (LPVOID) &Segment_CF;
775 IClassFactory_AddRef((IClassFactory*)*ppv);
776 return S_OK;
777 } else if (IsEqualCLSID (rclsid, &CLSID_DirectMusicSegmentState) && IsEqualIID (riid, &IID_IClassFactory)) {
778 *ppv = (LPVOID) &SegmentState_CF;
779 IClassFactory_AddRef((IClassFactory*)*ppv);
780 return S_OK;
781 } else if (IsEqualCLSID (rclsid, &CLSID_DirectMusicGraph) && IsEqualIID (riid, &IID_IClassFactory)) {
782 *ppv = (LPVOID) &Graph_CF;
783 IClassFactory_AddRef((IClassFactory*)*ppv);
784 return S_OK;
785 } else if (IsEqualCLSID (rclsid, &CLSID_DirectMusicTempoTrack) && IsEqualIID (riid, &IID_IClassFactory)) {
786 *ppv = (LPVOID) &TempoTrack_CF;
787 IClassFactory_AddRef((IClassFactory*)*ppv);
788 return S_OK;
789 } else if (IsEqualCLSID (rclsid, &CLSID_DirectMusicSeqTrack) && IsEqualIID (riid, &IID_IClassFactory)) {
790 *ppv = (LPVOID) &SeqTrack_CF;
791 IClassFactory_AddRef((IClassFactory*)*ppv);
792 return S_OK;
793 } else if (IsEqualCLSID (rclsid, &CLSID_DirectMusicSysExTrack) && IsEqualIID (riid, &IID_IClassFactory)) {
794 *ppv = (LPVOID) &SysExTrack_CF;
795 IClassFactory_AddRef((IClassFactory*)*ppv);
796 return S_OK;
797 } else if (IsEqualCLSID (rclsid, &CLSID_DirectMusicTimeSigTrack) && IsEqualIID (riid, &IID_IClassFactory)) {
798 *ppv = (LPVOID) &TimeSigTrack_CF;
799 IClassFactory_AddRef((IClassFactory*)*ppv);
800 return S_OK;
801 } else if (IsEqualCLSID (rclsid, &CLSID_DirectMusicParamControlTrack) && IsEqualIID (riid, &IID_IClassFactory)) {
802 *ppv = (LPVOID) &ParamControlTrack_CF;
803 IClassFactory_AddRef((IClassFactory*)*ppv);
804 return S_OK;
805 } else if (IsEqualCLSID (rclsid, &CLSID_DirectMusicMarkerTrack) && IsEqualIID (riid, &IID_IClassFactory)) {
806 *ppv = (LPVOID) &MarkerTrack_CF;
807 IClassFactory_AddRef((IClassFactory*)*ppv);
808 return S_OK;
809 } else if (IsEqualCLSID (rclsid, &CLSID_DirectMusicLyricsTrack) && IsEqualIID (riid, &IID_IClassFactory)) {
810 *ppv = (LPVOID) &LyricsTrack_CF;
811 IClassFactory_AddRef((IClassFactory*)*ppv);
812 return S_OK;
813 } else if (IsEqualCLSID (rclsid, &CLSID_DirectMusicSegTriggerTrack) && IsEqualIID (riid, &IID_IClassFactory)) {
814 *ppv = (LPVOID) &SegTriggerTrack_CF;
815 IClassFactory_AddRef((IClassFactory*)*ppv);
816 return S_OK;
817 } else if (IsEqualCLSID (rclsid, &CLSID_DirectMusicAudioPath) && IsEqualIID (riid, &IID_IClassFactory)) {
818 *ppv = (LPVOID) &AudioPath_CF;
819 IClassFactory_AddRef((IClassFactory*)*ppv);
820 return S_OK;
821 } else if (IsEqualCLSID (rclsid, &CLSID_DirectMusicWaveTrack) && IsEqualIID (riid, &IID_IClassFactory)) {
822 *ppv = (LPVOID) &WaveTrack_CF;
823 IClassFactory_AddRef((IClassFactory*)*ppv);
824 return S_OK;
827 WARN("(%s, %s, %p): no interface found.\n", debugstr_dmguid(rclsid), debugstr_dmguid(riid), ppv);
828 return CLASS_E_CLASSNOTAVAILABLE;