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
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (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 GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
21 #include "dmime_private.h"
23 WINE_DEFAULT_DEBUG_CHANNEL(dmime);
25 LONG DMIME_refCount = 0;
28 const IClassFactoryVtbl *lpVtbl;
31 /******************************************************************
32 * DirectMusicPerformance ClassFactory
34 static HRESULT WINAPI PerformanceCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj) {
35 FIXME("- no interface\n\tIID:\t%s\n", debugstr_guid(riid));
37 if (ppobj == NULL) return E_POINTER;
42 static ULONG WINAPI PerformanceCF_AddRef(LPCLASSFACTORY iface) {
45 return 2; /* non-heap based object */
48 static ULONG WINAPI PerformanceCF_Release(LPCLASSFACTORY iface) {
51 return 1; /* non-heap based object */
54 static HRESULT WINAPI PerformanceCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj) {
55 TRACE ("(%p, %s, %p)\n", pOuter, debugstr_dmguid(riid), ppobj);
57 return DMUSIC_CreateDirectMusicPerformanceImpl (riid, ppobj, pOuter);
60 static HRESULT WINAPI PerformanceCF_LockServer(LPCLASSFACTORY iface,BOOL dolock) {
61 TRACE("(%d)\n", dolock);
71 static const IClassFactoryVtbl PerformanceCF_Vtbl = {
72 PerformanceCF_QueryInterface,
74 PerformanceCF_Release,
75 PerformanceCF_CreateInstance,
76 PerformanceCF_LockServer
79 static IClassFactoryImpl Performance_CF = {&PerformanceCF_Vtbl};
81 /******************************************************************
82 * DirectMusicSegment ClassFactory
84 static HRESULT WINAPI SegmentCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj) {
85 FIXME("- no interface\n\tIID:\t%s\n", debugstr_guid(riid));
87 if (ppobj == NULL) return E_POINTER;
92 static ULONG WINAPI SegmentCF_AddRef(LPCLASSFACTORY iface) {
95 return 2; /* non-heap based object */
98 static ULONG WINAPI SegmentCF_Release(LPCLASSFACTORY iface) {
101 return 1; /* non-heap based object */
104 static HRESULT WINAPI SegmentCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj) {
105 TRACE ("(%p, %s, %p)\n", pOuter, debugstr_dmguid(riid), ppobj);
107 return DMUSIC_CreateDirectMusicSegmentImpl (riid, ppobj, pOuter);
110 static HRESULT WINAPI SegmentCF_LockServer(LPCLASSFACTORY iface,BOOL dolock) {
111 TRACE("(%d)\n", dolock);
116 DMIME_UnlockModule();
121 static const IClassFactoryVtbl SegmentCF_Vtbl = {
122 SegmentCF_QueryInterface,
125 SegmentCF_CreateInstance,
129 static IClassFactoryImpl Segment_CF = {&SegmentCF_Vtbl};
131 /******************************************************************
132 * DirectMusicSegmentState ClassFactory
134 static HRESULT WINAPI SegmentStateCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj) {
135 FIXME("- no interface\n\tIID:\t%s\n", debugstr_guid(riid));
137 if (ppobj == NULL) return E_POINTER;
139 return E_NOINTERFACE;
142 static ULONG WINAPI SegmentStateCF_AddRef(LPCLASSFACTORY iface) {
145 return 2; /* non-heap based objects */
148 static ULONG WINAPI SegmentStateCF_Release(LPCLASSFACTORY iface) {
149 DMIME_UnlockModule();
151 return 1; /* non-heap based object */
154 static HRESULT WINAPI SegmentStateCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj) {
155 TRACE ("(%p, %s, %p)\n", pOuter, debugstr_dmguid(riid), ppobj);
157 return DMUSIC_CreateDirectMusicSegmentStateImpl (riid, ppobj, pOuter);
160 static HRESULT WINAPI SegmentStateCF_LockServer(LPCLASSFACTORY iface,BOOL dolock) {
161 TRACE("(%d)\n", dolock);
166 DMIME_UnlockModule();
171 static const IClassFactoryVtbl SegmentStateCF_Vtbl = {
172 SegmentStateCF_QueryInterface,
173 SegmentStateCF_AddRef,
174 SegmentStateCF_Release,
175 SegmentStateCF_CreateInstance,
176 SegmentStateCF_LockServer
179 static IClassFactoryImpl SegmentState_CF = {&SegmentStateCF_Vtbl};
181 /******************************************************************
182 * DirectMusicGraph ClassFactory
184 static HRESULT WINAPI GraphCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj) {
185 FIXME("- no interface\n\tIID:\t%s\n", debugstr_guid(riid));
187 if (ppobj == NULL) return E_POINTER;
189 return E_NOINTERFACE;
192 static ULONG WINAPI GraphCF_AddRef(LPCLASSFACTORY iface) {
195 return 2; /* non-heap based object */
198 static ULONG WINAPI GraphCF_Release(LPCLASSFACTORY iface) {
199 DMIME_UnlockModule();
201 return 1; /* non-heap based object */
204 static HRESULT WINAPI GraphCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj) {
205 TRACE ("(%p, %s, %p)\n", pOuter, debugstr_dmguid(riid), ppobj);
207 return DMUSIC_CreateDirectMusicGraphImpl (riid, ppobj, pOuter);
210 static HRESULT WINAPI GraphCF_LockServer(LPCLASSFACTORY iface,BOOL dolock) {
211 TRACE("(%d)\n", dolock);
216 DMIME_UnlockModule();
221 static const IClassFactoryVtbl GraphCF_Vtbl = {
222 GraphCF_QueryInterface,
225 GraphCF_CreateInstance,
229 static IClassFactoryImpl Graph_CF = {&GraphCF_Vtbl};
231 /******************************************************************
232 * DirectMusicTempoTrack ClassFactory
234 static HRESULT WINAPI TempoTrackCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj) {
235 FIXME("- no interface\n\tIID:\t%s\n", debugstr_guid(riid));
237 if (ppobj == NULL) return E_POINTER;
239 return E_NOINTERFACE;
242 static ULONG WINAPI TempoTrackCF_AddRef(LPCLASSFACTORY iface) {
245 return 2; /* non-heap based object */
248 static ULONG WINAPI TempoTrackCF_Release(LPCLASSFACTORY iface) {
249 DMIME_UnlockModule();
251 return 1; /* non-heap based object */
254 static HRESULT WINAPI TempoTrackCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj) {
255 TRACE ("(%p, %s, %p)\n", pOuter, debugstr_dmguid(riid), ppobj);
257 return DMUSIC_CreateDirectMusicTempoTrack (riid, ppobj, pOuter);
260 static HRESULT WINAPI TempoTrackCF_LockServer(LPCLASSFACTORY iface,BOOL dolock) {
261 TRACE("(%d)\n", dolock);
266 DMIME_UnlockModule();
271 static const IClassFactoryVtbl TempoTrackCF_Vtbl = {
272 TempoTrackCF_QueryInterface,
274 TempoTrackCF_Release,
275 TempoTrackCF_CreateInstance,
276 TempoTrackCF_LockServer
279 static IClassFactoryImpl TempoTrack_CF = {&TempoTrackCF_Vtbl};
281 /******************************************************************
282 * DirectMusicSeqTrack ClassFactory
284 static HRESULT WINAPI SeqTrackCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj) {
285 FIXME("- no interface\n\tIID:\t%s\n", debugstr_guid(riid));
287 if (ppobj == NULL) return E_POINTER;
289 return E_NOINTERFACE;
292 static ULONG WINAPI SeqTrackCF_AddRef(LPCLASSFACTORY iface) {
295 return 2; /* non-heap based object */
298 static ULONG WINAPI SeqTrackCF_Release(LPCLASSFACTORY iface) {
299 DMIME_UnlockModule();
301 return 1; /* non-heap based object */
304 static HRESULT WINAPI SeqTrackCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj) {
305 TRACE ("(%p, %s, %p)\n", pOuter, debugstr_dmguid(riid), ppobj);
307 return DMUSIC_CreateDirectMusicSeqTrack (riid, ppobj, pOuter);
310 static HRESULT WINAPI SeqTrackCF_LockServer(LPCLASSFACTORY iface,BOOL dolock) {
311 TRACE("(%d)\n", dolock);
316 DMIME_UnlockModule();
321 static const IClassFactoryVtbl SeqTrackCF_Vtbl = {
322 SeqTrackCF_QueryInterface,
325 SeqTrackCF_CreateInstance,
326 SeqTrackCF_LockServer
329 static IClassFactoryImpl SeqTrack_CF = {&SeqTrackCF_Vtbl};
331 /******************************************************************
332 * DirectMusicSysExTrack ClassFactory
334 static HRESULT WINAPI SysExTrackCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj) {
335 FIXME("- no interface\n\tIID:\t%s\n", debugstr_guid(riid));
337 if (ppobj == NULL) return E_POINTER;
339 return E_NOINTERFACE;
342 static ULONG WINAPI SysExTrackCF_AddRef(LPCLASSFACTORY iface) {
345 return 2; /* non-heap based object */
348 static ULONG WINAPI SysExTrackCF_Release(LPCLASSFACTORY iface) {
349 DMIME_UnlockModule();
351 return 1; /* non-heap based object */
354 static HRESULT WINAPI SysExTrackCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj) {
355 TRACE ("(%p, %s, %p)\n", pOuter, debugstr_dmguid(riid), ppobj);
356 return DMUSIC_CreateDirectMusicSysExTrack (riid, ppobj, pOuter);
359 static HRESULT WINAPI SysExTrackCF_LockServer(LPCLASSFACTORY iface,BOOL dolock) {
360 TRACE("(%d)\n", dolock);
365 DMIME_UnlockModule();
370 static const IClassFactoryVtbl SysExTrackCF_Vtbl = {
371 SysExTrackCF_QueryInterface,
373 SysExTrackCF_Release,
374 SysExTrackCF_CreateInstance,
375 SysExTrackCF_LockServer
378 static IClassFactoryImpl SysExTrack_CF = {&SysExTrackCF_Vtbl};
380 /******************************************************************
381 * DirectMusicTimeSigTrack ClassFactory
383 static HRESULT WINAPI TimeSigTrackCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj) {
384 FIXME("- no interface\n\tIID:\t%s\n", debugstr_guid(riid));
386 if (ppobj == NULL) return E_POINTER;
388 return E_NOINTERFACE;
391 static ULONG WINAPI TimeSigTrackCF_AddRef(LPCLASSFACTORY iface) {
394 return 2; /* non-heap based object */
397 static ULONG WINAPI TimeSigTrackCF_Release(LPCLASSFACTORY iface) {
398 DMIME_UnlockModule();
400 return 1; /* non-heap based object */
403 static HRESULT WINAPI TimeSigTrackCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj) {
404 TRACE ("(%p, %s, %p)\n", pOuter, debugstr_dmguid(riid), ppobj);
406 return DMUSIC_CreateDirectMusicTimeSigTrack (riid, ppobj, pOuter);
409 static HRESULT WINAPI TimeSigTrackCF_LockServer(LPCLASSFACTORY iface,BOOL dolock) {
410 TRACE("(%d)\n", dolock);
415 DMIME_UnlockModule();
420 static const IClassFactoryVtbl TimeSigTrackCF_Vtbl = {
421 TimeSigTrackCF_QueryInterface,
422 TimeSigTrackCF_AddRef,
423 TimeSigTrackCF_Release,
424 TimeSigTrackCF_CreateInstance,
425 TimeSigTrackCF_LockServer
428 static IClassFactoryImpl TimeSigTrack_CF = {&TimeSigTrackCF_Vtbl};
430 /******************************************************************
431 * DirectMusicParamControlTrack ClassFactory
433 static HRESULT WINAPI ParamControlTrackCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj) {
434 FIXME("- no interface\n\tIID:\t%s\n", debugstr_guid(riid));
436 if (ppobj == NULL) return E_POINTER;
438 return E_NOINTERFACE;
441 static ULONG WINAPI ParamControlTrackCF_AddRef(LPCLASSFACTORY iface) {
444 return 2; /* non-heap based object */
447 static ULONG WINAPI ParamControlTrackCF_Release(LPCLASSFACTORY iface) {
448 DMIME_UnlockModule();
450 return 1; /* non-heap based object */
453 static HRESULT WINAPI ParamControlTrackCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj) {
454 TRACE ("(%p, %s, %p)\n", pOuter, debugstr_dmguid(riid), ppobj);
456 return DMUSIC_CreateDirectMusicParamControlTrack (riid, ppobj, pOuter);
459 static HRESULT WINAPI ParamControlTrackCF_LockServer(LPCLASSFACTORY iface,BOOL dolock) {
460 TRACE("(%d)\n", dolock);
465 DMIME_UnlockModule();
470 static const IClassFactoryVtbl ParamControlTrackCF_Vtbl = {
471 ParamControlTrackCF_QueryInterface,
472 ParamControlTrackCF_AddRef,
473 ParamControlTrackCF_Release,
474 ParamControlTrackCF_CreateInstance,
475 ParamControlTrackCF_LockServer
478 static IClassFactoryImpl ParamControlTrack_CF = {&ParamControlTrackCF_Vtbl};
480 /******************************************************************
481 * DirectMusicMarkerTrack ClassFactory
483 static HRESULT WINAPI MarkerTrackCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj) {
484 FIXME("- no interface\n\tIID:\t%s\n", debugstr_guid(riid));
486 if (ppobj == NULL) return E_POINTER;
488 return E_NOINTERFACE;
491 static ULONG WINAPI MarkerTrackCF_AddRef(LPCLASSFACTORY iface) {
494 return 2; /* non-heap based object */
497 static ULONG WINAPI MarkerTrackCF_Release(LPCLASSFACTORY iface) {
498 DMIME_UnlockModule();
500 return 1; /* non-heap based object */
503 static HRESULT WINAPI MarkerTrackCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj) {
504 TRACE ("(%p, %s, %p)\n", pOuter, debugstr_dmguid(riid), ppobj);
506 return DMUSIC_CreateDirectMusicMarkerTrack (riid, ppobj, pOuter);
509 static HRESULT WINAPI MarkerTrackCF_LockServer(LPCLASSFACTORY iface,BOOL dolock) {
510 TRACE("(%d)\n", dolock);
515 DMIME_UnlockModule();
520 static const IClassFactoryVtbl MarkerTrackCF_Vtbl = {
521 MarkerTrackCF_QueryInterface,
522 MarkerTrackCF_AddRef,
523 MarkerTrackCF_Release,
524 MarkerTrackCF_CreateInstance,
525 MarkerTrackCF_LockServer
528 static IClassFactoryImpl MarkerTrack_CF = {&MarkerTrackCF_Vtbl};
530 /******************************************************************
531 * DirectMusicLyricsTrack ClassFactory
533 static HRESULT WINAPI LyricsTrackCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj) {
534 FIXME("- no interface\n\tIID:\t%s\n", debugstr_guid(riid));
536 if (ppobj == NULL) return E_POINTER;
538 return E_NOINTERFACE;
541 static ULONG WINAPI LyricsTrackCF_AddRef(LPCLASSFACTORY iface) {
544 return 2; /* non-heap based object */
547 static ULONG WINAPI LyricsTrackCF_Release(LPCLASSFACTORY iface) {
548 DMIME_UnlockModule();
550 return 1; /* non-heap based object */
553 static HRESULT WINAPI LyricsTrackCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj) {
554 TRACE ("(%p, %s, %p)\n", pOuter, debugstr_dmguid(riid), ppobj);
556 return DMUSIC_CreateDirectMusicLyricsTrack (riid, ppobj, pOuter);
559 static HRESULT WINAPI LyricsTrackCF_LockServer(LPCLASSFACTORY iface,BOOL dolock) {
560 TRACE("(%d)\n", dolock);
565 DMIME_UnlockModule();
570 static const IClassFactoryVtbl LyricsTrackCF_Vtbl = {
571 LyricsTrackCF_QueryInterface,
572 LyricsTrackCF_AddRef,
573 LyricsTrackCF_Release,
574 LyricsTrackCF_CreateInstance,
575 LyricsTrackCF_LockServer
578 static IClassFactoryImpl LyricsTrack_CF = {&LyricsTrackCF_Vtbl};
581 /******************************************************************
582 * DirectMusicSegTriggerTrack ClassFactory
584 static HRESULT WINAPI SegTriggerTrackCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj) {
585 FIXME("- no interface\n\tIID:\t%s\n", debugstr_guid(riid));
587 if (ppobj == NULL) return E_POINTER;
589 return E_NOINTERFACE;
592 static ULONG WINAPI SegTriggerTrackCF_AddRef(LPCLASSFACTORY iface) {
595 return 2; /* non-heap based object */
598 static ULONG WINAPI SegTriggerTrackCF_Release(LPCLASSFACTORY iface) {
599 DMIME_UnlockModule();
601 return 1; /* non-heap based object */
604 static HRESULT WINAPI SegTriggerTrackCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj) {
605 TRACE ("(%p, %s, %p)\n", pOuter, debugstr_dmguid(riid), ppobj);
607 return DMUSIC_CreateDirectMusicSegTriggerTrack (riid, ppobj, pOuter);
610 static HRESULT WINAPI SegTriggerTrackCF_LockServer(LPCLASSFACTORY iface,BOOL dolock) {
611 TRACE("(%d)\n", dolock);
616 DMIME_UnlockModule();
621 static const IClassFactoryVtbl SegTriggerTrackCF_Vtbl = {
622 SegTriggerTrackCF_QueryInterface,
623 SegTriggerTrackCF_AddRef,
624 SegTriggerTrackCF_Release,
625 SegTriggerTrackCF_CreateInstance,
626 SegTriggerTrackCF_LockServer
629 static IClassFactoryImpl SegTriggerTrack_CF = {&SegTriggerTrackCF_Vtbl};
631 /******************************************************************
632 * DirectMusicAudioPath ClassFactory
634 static HRESULT WINAPI AudioPathCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj) {
635 FIXME("- no interface\n\tIID:\t%s\n", debugstr_guid(riid));
637 if (ppobj == NULL) return E_POINTER;
639 return E_NOINTERFACE;
642 static ULONG WINAPI AudioPathCF_AddRef(LPCLASSFACTORY iface) {
645 return 2; /* non-heap based object */
648 static ULONG WINAPI AudioPathCF_Release(LPCLASSFACTORY iface) {
649 DMIME_UnlockModule();
651 return 1; /* non-heap based object */
654 static HRESULT WINAPI AudioPathCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj) {
655 TRACE ("(%p, %s, %p)\n", pOuter, debugstr_dmguid(riid), ppobj);
657 return DMUSIC_CreateDirectMusicAudioPathImpl (riid, ppobj, pOuter);
660 static HRESULT WINAPI AudioPathCF_LockServer(LPCLASSFACTORY iface,BOOL dolock) {
661 TRACE("(%d)\n", dolock);
666 DMIME_UnlockModule();
671 static const IClassFactoryVtbl AudioPathCF_Vtbl = {
672 AudioPathCF_QueryInterface,
675 AudioPathCF_CreateInstance,
676 AudioPathCF_LockServer
679 static IClassFactoryImpl AudioPath_CF = {&AudioPathCF_Vtbl};
681 /******************************************************************
682 * DirectMusicWaveTrack ClassFactory
684 static HRESULT WINAPI WaveTrackCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj) {
685 FIXME("- no interface\n\tIID:\t%s\n", debugstr_guid(riid));
687 if (ppobj == NULL) return E_POINTER;
689 return E_NOINTERFACE;
692 static ULONG WINAPI WaveTrackCF_AddRef(LPCLASSFACTORY iface) {
695 return 2; /* non-heap based object */
698 static ULONG WINAPI WaveTrackCF_Release(LPCLASSFACTORY iface) {
699 DMIME_UnlockModule();
701 return 1; /* non-heap based object */
704 static HRESULT WINAPI WaveTrackCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj) {
705 TRACE ("(%p, %s, %p)\n", pOuter, debugstr_dmguid(riid), ppobj);
707 return DMUSIC_CreateDirectMusicWaveTrack (riid, ppobj, pOuter);
710 static HRESULT WINAPI WaveTrackCF_LockServer(LPCLASSFACTORY iface,BOOL dolock) {
711 TRACE("(%d)\n", dolock);
716 DMIME_UnlockModule();
721 static const IClassFactoryVtbl WaveTrackCF_Vtbl = {
722 WaveTrackCF_QueryInterface,
725 WaveTrackCF_CreateInstance,
726 WaveTrackCF_LockServer
729 static IClassFactoryImpl WaveTrack_CF = {&WaveTrackCF_Vtbl};
731 /******************************************************************
736 BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) {
737 if (fdwReason == DLL_PROCESS_ATTACH) {
738 DisableThreadLibraryCalls(hinstDLL);
739 /* FIXME: Initialisation */
741 else if (fdwReason == DLL_PROCESS_DETACH) {
749 /******************************************************************
750 * DllCanUnloadNow (DMIME.1)
754 HRESULT WINAPI DllCanUnloadNow(void)
756 return DMIME_refCount != 0 ? S_FALSE : S_OK;
760 /******************************************************************
761 * DllGetClassObject (DMIME.@)
765 HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv)
767 TRACE("(%s, %s, %p)\n", debugstr_dmguid(rclsid), debugstr_dmguid(riid), ppv);
768 if (IsEqualCLSID (rclsid, &CLSID_DirectMusicPerformance) && IsEqualIID (riid, &IID_IClassFactory)) {
769 *ppv = (LPVOID) &Performance_CF;
770 IClassFactory_AddRef((IClassFactory*)*ppv);
772 } else if (IsEqualCLSID (rclsid, &CLSID_DirectMusicSegment) && IsEqualIID (riid, &IID_IClassFactory)) {
773 *ppv = (LPVOID) &Segment_CF;
774 IClassFactory_AddRef((IClassFactory*)*ppv);
776 } else if (IsEqualCLSID (rclsid, &CLSID_DirectMusicSegmentState) && IsEqualIID (riid, &IID_IClassFactory)) {
777 *ppv = (LPVOID) &SegmentState_CF;
778 IClassFactory_AddRef((IClassFactory*)*ppv);
780 } else if (IsEqualCLSID (rclsid, &CLSID_DirectMusicGraph) && IsEqualIID (riid, &IID_IClassFactory)) {
781 *ppv = (LPVOID) &Graph_CF;
782 IClassFactory_AddRef((IClassFactory*)*ppv);
784 } else if (IsEqualCLSID (rclsid, &CLSID_DirectMusicTempoTrack) && IsEqualIID (riid, &IID_IClassFactory)) {
785 *ppv = (LPVOID) &TempoTrack_CF;
786 IClassFactory_AddRef((IClassFactory*)*ppv);
788 } else if (IsEqualCLSID (rclsid, &CLSID_DirectMusicSeqTrack) && IsEqualIID (riid, &IID_IClassFactory)) {
789 *ppv = (LPVOID) &SeqTrack_CF;
790 IClassFactory_AddRef((IClassFactory*)*ppv);
792 } else if (IsEqualCLSID (rclsid, &CLSID_DirectMusicSysExTrack) && IsEqualIID (riid, &IID_IClassFactory)) {
793 *ppv = (LPVOID) &SysExTrack_CF;
794 IClassFactory_AddRef((IClassFactory*)*ppv);
796 } else if (IsEqualCLSID (rclsid, &CLSID_DirectMusicTimeSigTrack) && IsEqualIID (riid, &IID_IClassFactory)) {
797 *ppv = (LPVOID) &TimeSigTrack_CF;
798 IClassFactory_AddRef((IClassFactory*)*ppv);
800 } else if (IsEqualCLSID (rclsid, &CLSID_DirectMusicParamControlTrack) && IsEqualIID (riid, &IID_IClassFactory)) {
801 *ppv = (LPVOID) &ParamControlTrack_CF;
802 IClassFactory_AddRef((IClassFactory*)*ppv);
804 } else if (IsEqualCLSID (rclsid, &CLSID_DirectMusicMarkerTrack) && IsEqualIID (riid, &IID_IClassFactory)) {
805 *ppv = (LPVOID) &MarkerTrack_CF;
806 IClassFactory_AddRef((IClassFactory*)*ppv);
808 } else if (IsEqualCLSID (rclsid, &CLSID_DirectMusicLyricsTrack) && IsEqualIID (riid, &IID_IClassFactory)) {
809 *ppv = (LPVOID) &LyricsTrack_CF;
810 IClassFactory_AddRef((IClassFactory*)*ppv);
812 } else if (IsEqualCLSID (rclsid, &CLSID_DirectMusicSegTriggerTrack) && IsEqualIID (riid, &IID_IClassFactory)) {
813 *ppv = (LPVOID) &SegTriggerTrack_CF;
814 IClassFactory_AddRef((IClassFactory*)*ppv);
816 } else if (IsEqualCLSID (rclsid, &CLSID_DirectMusicAudioPath) && IsEqualIID (riid, &IID_IClassFactory)) {
817 *ppv = (LPVOID) &AudioPath_CF;
818 IClassFactory_AddRef((IClassFactory*)*ppv);
820 } else if (IsEqualCLSID (rclsid, &CLSID_DirectMusicWaveTrack) && IsEqualIID (riid, &IID_IClassFactory)) {
821 *ppv = (LPVOID) &WaveTrack_CF;
822 IClassFactory_AddRef((IClassFactory*)*ppv);
826 WARN("(%s, %s, %p): no interface found.\n", debugstr_dmguid(rclsid), debugstr_dmguid(riid), ppv);
827 return CLASS_E_CLASSNOTAVAILABLE;