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;
29 const IClassFactoryVtbl *lpVtbl;
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;
43 static ULONG WINAPI PerformanceCF_AddRef(LPCLASSFACTORY iface) {
46 return 2; /* non-heap based object */
49 static ULONG WINAPI PerformanceCF_Release(LPCLASSFACTORY iface) {
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);
72 static const IClassFactoryVtbl PerformanceCF_Vtbl = {
73 PerformanceCF_QueryInterface,
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;
93 static ULONG WINAPI SegmentCF_AddRef(LPCLASSFACTORY iface) {
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);
117 DMIME_UnlockModule();
122 static const IClassFactoryVtbl SegmentCF_Vtbl = {
123 SegmentCF_QueryInterface,
126 SegmentCF_CreateInstance,
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) {
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);
167 DMIME_UnlockModule();
172 static const 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) {
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);
217 DMIME_UnlockModule();
222 static const IClassFactoryVtbl GraphCF_Vtbl = {
223 GraphCF_QueryInterface,
226 GraphCF_CreateInstance,
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) {
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);
267 DMIME_UnlockModule();
272 static const IClassFactoryVtbl TempoTrackCF_Vtbl = {
273 TempoTrackCF_QueryInterface,
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) {
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);
317 DMIME_UnlockModule();
322 static const IClassFactoryVtbl SeqTrackCF_Vtbl = {
323 SeqTrackCF_QueryInterface,
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) {
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);
366 DMIME_UnlockModule();
371 static const IClassFactoryVtbl SysExTrackCF_Vtbl = {
372 SysExTrackCF_QueryInterface,
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) {
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);
416 DMIME_UnlockModule();
421 static const 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) {
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);
466 DMIME_UnlockModule();
471 static const 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) {
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);
516 DMIME_UnlockModule();
521 static const 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) {
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);
566 DMIME_UnlockModule();
571 static const 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) {
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);
617 DMIME_UnlockModule();
622 static const 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) {
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);
667 DMIME_UnlockModule();
672 static const IClassFactoryVtbl AudioPathCF_Vtbl = {
673 AudioPathCF_QueryInterface,
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) {
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);
717 DMIME_UnlockModule();
722 static const IClassFactoryVtbl WaveTrackCF_Vtbl = {
723 WaveTrackCF_QueryInterface,
726 WaveTrackCF_CreateInstance,
727 WaveTrackCF_LockServer
730 static IClassFactoryImpl WaveTrack_CF = {&WaveTrackCF_Vtbl};
732 /******************************************************************
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) {
750 /******************************************************************
751 * DllCanUnloadNow (DMIME.1)
755 HRESULT WINAPI DllCanUnloadNow(void)
757 return DMIME_refCount != 0 ? S_FALSE : S_OK;
761 /******************************************************************
762 * DllGetClassObject (DMIME.@)
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);
773 } else if (IsEqualCLSID (rclsid, &CLSID_DirectMusicSegment) && IsEqualIID (riid, &IID_IClassFactory)) {
774 *ppv = (LPVOID) &Segment_CF;
775 IClassFactory_AddRef((IClassFactory*)*ppv);
777 } else if (IsEqualCLSID (rclsid, &CLSID_DirectMusicSegmentState) && IsEqualIID (riid, &IID_IClassFactory)) {
778 *ppv = (LPVOID) &SegmentState_CF;
779 IClassFactory_AddRef((IClassFactory*)*ppv);
781 } else if (IsEqualCLSID (rclsid, &CLSID_DirectMusicGraph) && IsEqualIID (riid, &IID_IClassFactory)) {
782 *ppv = (LPVOID) &Graph_CF;
783 IClassFactory_AddRef((IClassFactory*)*ppv);
785 } else if (IsEqualCLSID (rclsid, &CLSID_DirectMusicTempoTrack) && IsEqualIID (riid, &IID_IClassFactory)) {
786 *ppv = (LPVOID) &TempoTrack_CF;
787 IClassFactory_AddRef((IClassFactory*)*ppv);
789 } else if (IsEqualCLSID (rclsid, &CLSID_DirectMusicSeqTrack) && IsEqualIID (riid, &IID_IClassFactory)) {
790 *ppv = (LPVOID) &SeqTrack_CF;
791 IClassFactory_AddRef((IClassFactory*)*ppv);
793 } else if (IsEqualCLSID (rclsid, &CLSID_DirectMusicSysExTrack) && IsEqualIID (riid, &IID_IClassFactory)) {
794 *ppv = (LPVOID) &SysExTrack_CF;
795 IClassFactory_AddRef((IClassFactory*)*ppv);
797 } else if (IsEqualCLSID (rclsid, &CLSID_DirectMusicTimeSigTrack) && IsEqualIID (riid, &IID_IClassFactory)) {
798 *ppv = (LPVOID) &TimeSigTrack_CF;
799 IClassFactory_AddRef((IClassFactory*)*ppv);
801 } else if (IsEqualCLSID (rclsid, &CLSID_DirectMusicParamControlTrack) && IsEqualIID (riid, &IID_IClassFactory)) {
802 *ppv = (LPVOID) &ParamControlTrack_CF;
803 IClassFactory_AddRef((IClassFactory*)*ppv);
805 } else if (IsEqualCLSID (rclsid, &CLSID_DirectMusicMarkerTrack) && IsEqualIID (riid, &IID_IClassFactory)) {
806 *ppv = (LPVOID) &MarkerTrack_CF;
807 IClassFactory_AddRef((IClassFactory*)*ppv);
809 } else if (IsEqualCLSID (rclsid, &CLSID_DirectMusicLyricsTrack) && IsEqualIID (riid, &IID_IClassFactory)) {
810 *ppv = (LPVOID) &LyricsTrack_CF;
811 IClassFactory_AddRef((IClassFactory*)*ppv);
813 } else if (IsEqualCLSID (rclsid, &CLSID_DirectMusicSegTriggerTrack) && IsEqualIID (riid, &IID_IClassFactory)) {
814 *ppv = (LPVOID) &SegTriggerTrack_CF;
815 IClassFactory_AddRef((IClassFactory*)*ppv);
817 } else if (IsEqualCLSID (rclsid, &CLSID_DirectMusicAudioPath) && IsEqualIID (riid, &IID_IClassFactory)) {
818 *ppv = (LPVOID) &AudioPath_CF;
819 IClassFactory_AddRef((IClassFactory*)*ppv);
821 } else if (IsEqualCLSID (rclsid, &CLSID_DirectMusicWaveTrack) && IsEqualIID (riid, &IID_IClassFactory)) {
822 *ppv = (LPVOID) &WaveTrack_CF;
823 IClassFactory_AddRef((IClassFactory*)*ppv);
827 WARN("(%s, %s, %p): no interface found.\n", debugstr_dmguid(rclsid), debugstr_dmguid(riid), ppv);
828 return CLASS_E_CLASSNOTAVAILABLE;