1 /* IDirectMusicComposer
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 "dmcompos_private.h"
28 WINE_DEFAULT_DEBUG_CHANNEL(dmcompos
);
30 /* IDirectMusicComposer IUnknown parts follow: */
31 HRESULT WINAPI
IDirectMusicComposerImpl_QueryInterface (LPDIRECTMUSICCOMPOSER iface
, REFIID riid
, LPVOID
*ppobj
)
33 ICOM_THIS(IDirectMusicComposerImpl
,iface
);
35 if (IsEqualIID (riid
, &IID_IUnknown
) ||
36 IsEqualIID (riid
, &IID_IDirectMusicComposer
)) {
37 IDirectMusicComposerImpl_AddRef(iface
);
41 WARN("(%p)->(%s,%p),not found\n", This
, debugstr_guid(riid
), ppobj
);
45 ULONG WINAPI
IDirectMusicComposerImpl_AddRef (LPDIRECTMUSICCOMPOSER iface
)
47 ICOM_THIS(IDirectMusicComposerImpl
,iface
);
48 TRACE("(%p) : AddRef from %ld\n", This
, This
->ref
);
52 ULONG WINAPI
IDirectMusicComposerImpl_Release (LPDIRECTMUSICCOMPOSER iface
)
54 ICOM_THIS(IDirectMusicComposerImpl
,iface
);
55 ULONG ref
= --This
->ref
;
56 TRACE("(%p) : ReleaseRef to %ld\n", This
, This
->ref
);
58 HeapFree(GetProcessHeap(), 0, This
);
63 /* IDirectMusicComposer Interface follow: */
64 HRESULT WINAPI
IDirectMusicComposerImpl_ComposeSegmentFromTemplate (LPDIRECTMUSICCOMPOSER iface
, IDirectMusicStyle
* pStyle
, IDirectMusicSegment
* pTemplate
, WORD wActivity
, IDirectMusicChordMap
* pChordMap
, IDirectMusicSegment
** ppSegment
)
66 ICOM_THIS(IDirectMusicComposerImpl
,iface
);
68 FIXME("(%p, %p, %p, %d, %p, %p): stub\n", This
, pStyle
, pTemplate
, wActivity
, pChordMap
, ppSegment
);
73 HRESULT WINAPI
IDirectMusicComposerImpl_ComposeSegmentFromShape (LPDIRECTMUSICCOMPOSER iface
, IDirectMusicStyle
* pStyle
, WORD wNumMeasures
, WORD wShape
, WORD wActivity
, BOOL fIntro
, BOOL fEnd
, IDirectMusicChordMap
* pChordMap
, IDirectMusicSegment
** ppSegment
)
75 ICOM_THIS(IDirectMusicComposerImpl
,iface
);
77 FIXME("(%p, %p, %d, %d, %d, %d, %d, %p, %p): stub\n", This
, pStyle
, wNumMeasures
, wShape
, wActivity
, fIntro
, fEnd
, pChordMap
, ppSegment
);
82 HRESULT WINAPI
IDirectMusicComposerImpl_ComposeTransition (LPDIRECTMUSICCOMPOSER iface
, IDirectMusicSegment
* pFromSeg
, IDirectMusicSegment
* pToSeg
, MUSIC_TIME mtTime
, WORD wCommand
, DWORD dwFlags
, IDirectMusicChordMap
* pChordMap
, IDirectMusicSegment
** ppTransSeg
)
84 ICOM_THIS(IDirectMusicComposerImpl
,iface
);
86 FIXME("(%p, %p, %p, %ld, %d, %ld, %p, %p): stub\n", This
, pFromSeg
, pToSeg
, mtTime
, wCommand
, dwFlags
, pChordMap
, ppTransSeg
);
91 HRESULT WINAPI
IDirectMusicComposerImpl_AutoTransition (LPDIRECTMUSICCOMPOSER iface
, IDirectMusicPerformance
* pPerformance
, IDirectMusicSegment
* pToSeg
, WORD wCommand
, DWORD dwFlags
, IDirectMusicChordMap
* pChordMap
, IDirectMusicSegment
** ppTransSeg
, IDirectMusicSegmentState
** ppToSegState
, IDirectMusicSegmentState
** ppTransSegState
)
93 ICOM_THIS(IDirectMusicComposerImpl
,iface
);
95 FIXME("(%p, %p, %d, %ld, %p, %p, %p, %p): stub\n", This
, pPerformance
, wCommand
, dwFlags
, pChordMap
, ppTransSeg
, ppToSegState
, ppTransSegState
);
100 HRESULT WINAPI
IDirectMusicComposerImpl_ComposeTemplateFromShape (LPDIRECTMUSICCOMPOSER iface
, WORD wNumMeasures
, WORD wShape
, BOOL fIntro
, BOOL fEnd
, WORD wEndLength
, IDirectMusicSegment
** ppTemplate
)
102 ICOM_THIS(IDirectMusicComposerImpl
,iface
);
104 FIXME("(%p, %d, %d, %d, %d, %d, %p): stub\n", This
, wNumMeasures
, wShape
, fIntro
, fEnd
, wEndLength
, ppTemplate
);
109 HRESULT WINAPI
IDirectMusicComposerImpl_ChangeChordMap (LPDIRECTMUSICCOMPOSER iface
, IDirectMusicSegment
* pSegment
, BOOL fTrackScale
, IDirectMusicChordMap
* pChordMap
)
111 ICOM_THIS(IDirectMusicComposerImpl
,iface
);
113 FIXME("(%p, %p, %d, %p): stub\n", This
, pSegment
, fTrackScale
, pChordMap
);
118 ICOM_VTABLE(IDirectMusicComposer
) DirectMusicComposer_Vtbl
=
120 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
121 IDirectMusicComposerImpl_QueryInterface
,
122 IDirectMusicComposerImpl_AddRef
,
123 IDirectMusicComposerImpl_Release
,
124 IDirectMusicComposerImpl_ComposeSegmentFromTemplate
,
125 IDirectMusicComposerImpl_ComposeSegmentFromShape
,
126 IDirectMusicComposerImpl_ComposeTransition
,
127 IDirectMusicComposerImpl_AutoTransition
,
128 IDirectMusicComposerImpl_ComposeTemplateFromShape
,
129 IDirectMusicComposerImpl_ChangeChordMap
132 /* for ClassFactory */
133 HRESULT WINAPI
DMUSIC_CreateDirectMusicComposer (LPCGUID lpcGUID
, LPDIRECTMUSICCOMPOSER
* ppDMCP
, LPUNKNOWN pUnkOuter
)
135 IDirectMusicComposerImpl
* dmcompos
;
137 if (IsEqualIID (lpcGUID
, &IID_IDirectMusicComposer
)) {
138 dmcompos
= HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY
, sizeof(IDirectMusicComposerImpl
));
139 if (NULL
== dmcompos
) {
140 *ppDMCP
= (LPDIRECTMUSICCOMPOSER
) NULL
;
141 return E_OUTOFMEMORY
;
143 dmcompos
->lpVtbl
= &DirectMusicComposer_Vtbl
;
145 *ppDMCP
= (LPDIRECTMUSICCOMPOSER
) dmcompos
;
148 WARN("No interface found\n");
150 return E_NOINTERFACE
;