1 /* IDirectMusicBand Implementation
3 * Copyright (C) 2003 Rok Mandeljc
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU Library General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
24 #include "wine/debug.h"
26 #include "dmband_private.h"
28 WINE_DEFAULT_DEBUG_CHANNEL(dmusic
);
30 /* IDirectMusicBand IUnknown parts follow: */
31 HRESULT WINAPI
IDirectMusicBandImpl_QueryInterface (LPDIRECTMUSICBAND iface
, REFIID riid
, LPVOID
*ppobj
)
33 ICOM_THIS(IDirectMusicBandImpl
,iface
);
35 if (IsEqualGUID(riid
, &IID_IUnknown
) ||
36 IsEqualGUID(riid
, &IID_IDirectMusicBand
))
38 IDirectMusicBandImpl_AddRef(iface
);
42 WARN("(%p)->(%s,%p),not found\n", This
, debugstr_guid(riid
), ppobj
);
46 ULONG WINAPI
IDirectMusicBandImpl_AddRef (LPDIRECTMUSICBAND iface
)
48 ICOM_THIS(IDirectMusicBandImpl
,iface
);
49 TRACE("(%p) : AddRef from %ld\n", This
, This
->ref
);
53 ULONG WINAPI
IDirectMusicBandImpl_Release (LPDIRECTMUSICBAND iface
)
55 ICOM_THIS(IDirectMusicBandImpl
,iface
);
56 ULONG ref
= --This
->ref
;
57 TRACE("(%p) : ReleaseRef to %ld\n", This
, This
->ref
);
60 HeapFree(GetProcessHeap(), 0, This
);
65 /* IDirectMusicBand Interface follow: */
66 HRESULT WINAPI
IDirectMusicBandImpl_CreateSegment (LPDIRECTMUSICBAND iface
, IDirectMusicSegment
** ppSegment
)
68 ICOM_THIS(IDirectMusicBandImpl
,iface
);
70 FIXME("(%p, %p): stub\n", This
, ppSegment
);
75 HRESULT WINAPI
IDirectMusicBandImpl_Download (LPDIRECTMUSICBAND iface
, IDirectMusicPerformance
* pPerformance
)
77 ICOM_THIS(IDirectMusicBandImpl
,iface
);
79 FIXME("(%p, %p): stub\n", This
, pPerformance
);
84 HRESULT WINAPI
IDirectMusicBandImpl_Unload (LPDIRECTMUSICBAND iface
, IDirectMusicPerformance
* pPerformance
)
86 ICOM_THIS(IDirectMusicBandImpl
,iface
);
88 FIXME("(%p, %p): stub\n", This
, pPerformance
);
93 ICOM_VTABLE(IDirectMusicBand
) DirectMusicBand_Vtbl
=
95 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
96 IDirectMusicBandImpl_QueryInterface
,
97 IDirectMusicBandImpl_AddRef
,
98 IDirectMusicBandImpl_Release
,
99 IDirectMusicBandImpl_CreateSegment
,
100 IDirectMusicBandImpl_Download
,
101 IDirectMusicBandImpl_Unload
104 /* for ClassFactory */
105 HRESULT WINAPI
DMUSIC_CreateDirectMusicBand (LPCGUID lpcGUID
, LPDIRECTMUSICBAND
* ppDMBand
, LPUNKNOWN pUnkOuter
)
107 IDirectMusicBandImpl
* dmband
;
109 if (IsEqualGUID (lpcGUID
, &IID_IDirectMusicBand
))
111 dmband
= HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY
, sizeof(IDirectMusicBandImpl
));
112 if (NULL
== dmband
) {
113 *ppDMBand
= (LPDIRECTMUSICBAND
) NULL
;
114 return E_OUTOFMEMORY
;
116 dmband
->lpVtbl
= &DirectMusicBand_Vtbl
;
118 *ppDMBand
= (LPDIRECTMUSICBAND
) dmband
;
121 WARN("No interface found\n");
123 return E_NOINTERFACE
;