1 /* IDirectMusicPatternTrack Implementation
3 * Copyright (C) 2003-2004 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.
20 #include "dmime_private.h"
22 WINE_DEFAULT_DEBUG_CHANNEL(dmime
);
24 /* IDirectMusicPatternTrack IUnknown parts follow: */
25 HRESULT WINAPI
IDirectMusicPatternTrackImpl_QueryInterface (LPDIRECTMUSICPATTERNTRACK iface
, REFIID riid
, LPVOID
*ppobj
) {
26 ICOM_THIS(IDirectMusicPatternTrackImpl
,iface
);
27 TRACE("(%p, %s, %p)\n", This
, debugstr_dmguid(riid
), ppobj
);
29 if (IsEqualIID (riid
, &IID_IUnknown
) ||
30 IsEqualIID (riid
, &IID_IDirectMusicPatternTrack
)) {
31 IDirectMusicPatternTrackImpl_AddRef(iface
);
36 WARN("(%p, %s, %p): not found\n", This
, debugstr_dmguid(riid
), ppobj
);
40 ULONG WINAPI
IDirectMusicPatternTrackImpl_AddRef (LPDIRECTMUSICPATTERNTRACK iface
) {
41 ICOM_THIS(IDirectMusicPatternTrackImpl
,iface
);
42 TRACE("(%p): AddRef from %ld\n", This
, This
->ref
);
46 ULONG WINAPI
IDirectMusicPatternTrackImpl_Release (LPDIRECTMUSICPATTERNTRACK iface
) {
47 ICOM_THIS(IDirectMusicPatternTrackImpl
,iface
);
48 ULONG ref
= --This
->ref
;
49 TRACE("(%p): ReleaseRef to %ld\n", This
, This
->ref
);
51 HeapFree(GetProcessHeap(), 0, This
);
56 /* IDirectMusicPatternTrack Interface follow: */
57 HRESULT WINAPI
IDirectMusicPatternTrackImpl_CreateSegment (LPDIRECTMUSICPATTERNTRACK iface
, IDirectMusicStyle
* pStyle
, IDirectMusicSegment
** ppSegment
) {
58 ICOM_THIS(IDirectMusicPatternTrackImpl
,iface
);
59 FIXME("(%p, %p, %p): stub\n", This
, pStyle
, ppSegment
);
63 HRESULT WINAPI
IDirectMusicPatternTrackImpl_SetVariation (LPDIRECTMUSICPATTERNTRACK iface
, IDirectMusicSegmentState
* pSegState
, DWORD dwVariationFlags
, DWORD dwPart
) {
64 ICOM_THIS(IDirectMusicPatternTrackImpl
,iface
);
65 FIXME("(%p, %p, %ld, %ld): stub\n", This
, pSegState
, dwVariationFlags
, dwPart
);
69 HRESULT WINAPI
IDirectMusicPatternTrackImpl_SetPatternByName (LPDIRECTMUSICPATTERNTRACK iface
, IDirectMusicSegmentState
* pSegState
, WCHAR
* wszName
, IDirectMusicStyle
* pStyle
, DWORD dwPatternType
, DWORD
* pdwLength
) {
70 ICOM_THIS(IDirectMusicPatternTrackImpl
,iface
);
71 FIXME("(%p, %p, %p, %p, %ld, %p): stub\n", This
, pSegState
, wszName
, pStyle
, dwPatternType
, pdwLength
);
75 ICOM_VTABLE(IDirectMusicPatternTrack
) DirectMusicPatternTrack_Vtbl
= {
76 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
77 IDirectMusicPatternTrackImpl_QueryInterface
,
78 IDirectMusicPatternTrackImpl_AddRef
,
79 IDirectMusicPatternTrackImpl_Release
,
80 IDirectMusicPatternTrackImpl_CreateSegment
,
81 IDirectMusicPatternTrackImpl_SetVariation
,
82 IDirectMusicPatternTrackImpl_SetPatternByName
85 /* for ClassFactory */
86 HRESULT WINAPI
DMUSIC_CreateDirectMusicPatternTrackImpl (LPCGUID lpcGUID
, LPVOID
*ppobj
, LPUNKNOWN pUnkOuter
) {
87 IDirectMusicPatternTrackImpl
* track
;
89 track
= HeapAlloc (GetProcessHeap(), HEAP_ZERO_MEMORY
, sizeof(IDirectMusicPatternTrackImpl
));
91 *ppobj
= (LPVOID
) NULL
;
94 track
->lpVtbl
= &DirectMusicPatternTrack_Vtbl
;
95 track
->ref
= 0; /* will be inited by QueryInterface */
97 return IDirectMusicPatternTrackImpl_QueryInterface ((LPDIRECTMUSICPATTERNTRACK
)track
, lpcGUID
, ppobj
);