- implemented loader, loader's stream and loading of objects (now you
[wine/wine64.git] / dlls / dmcompos / composer.c
blobf60a5573fe70bc9498c4bae68042c2e99fa43e51
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.
20 #include "windef.h"
21 #include "winbase.h"
22 #include "winuser.h"
23 #include "wingdi.h"
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);
38 *ppobj = This;
39 return S_OK;
41 WARN("(%p)->(%s,%p),not found\n", This, debugstr_guid(riid), ppobj);
42 return E_NOINTERFACE;
45 ULONG WINAPI IDirectMusicComposerImpl_AddRef (LPDIRECTMUSICCOMPOSER iface)
47 ICOM_THIS(IDirectMusicComposerImpl,iface);
48 TRACE("(%p) : AddRef from %ld\n", This, This->ref);
49 return ++(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);
57 if (ref == 0) {
58 HeapFree(GetProcessHeap(), 0, This);
60 return ref;
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);
70 return S_OK;
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);
79 return S_OK;
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);
88 return S_OK;
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);
97 return S_OK;
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);
106 return S_OK;
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);
115 return S_OK;
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;
144 dmcompos->ref = 1;
145 *ppDMCP = (LPDIRECTMUSICCOMPOSER) dmcompos;
146 return S_OK;
148 WARN("No interface found\n");
150 return E_NOINTERFACE;