gdi32: Change an ERR to a WARN for fonts with too-long names.
[wine/multimedia.git] / dlls / dmcompos / composer.c
blobf2d826020d2f474b05800942db98f5895e97a6b4
1 /* IDirectMusicComposer
3 * Copyright (C) 2003-2004 Rok Mandeljc
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (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 GNU
13 * Lesser General Public License for more details.
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
20 #include "dmcompos_private.h"
22 WINE_DEFAULT_DEBUG_CHANNEL(dmcompos);
24 typedef struct IDirectMusicComposerImpl {
25 IDirectMusicComposer IDirectMusicComposer_iface;
26 LONG ref;
27 } IDirectMusicComposerImpl;
29 static inline IDirectMusicComposerImpl *impl_from_IDirectMusicComposer(IDirectMusicComposer *iface)
31 return CONTAINING_RECORD(iface, IDirectMusicComposerImpl, IDirectMusicComposer_iface);
34 static HRESULT WINAPI IDirectMusicComposerImpl_QueryInterface(IDirectMusicComposer *iface,
35 REFIID riid, void **ret_iface)
37 TRACE("(%p, %s, %p)\n", iface, debugstr_dmguid(riid), ret_iface);
39 if (IsEqualIID(riid, &IID_IUnknown) || IsEqualIID(riid, &IID_IDirectMusicComposer))
41 *ret_iface = iface;
42 IDirectMusicComposer_AddRef(iface);
43 return S_OK;
46 WARN("(%p, %s, %p): not found\n", iface, debugstr_dmguid(riid), ret_iface);
47 *ret_iface = NULL;
49 return E_NOINTERFACE;
52 static ULONG WINAPI IDirectMusicComposerImpl_AddRef(IDirectMusicComposer *iface)
54 IDirectMusicComposerImpl *This = impl_from_IDirectMusicComposer(iface);
55 ULONG ref = InterlockedIncrement(&This->ref);
57 TRACE("(%p) ref=%d\n", This, ref);
59 return ref;
62 static ULONG WINAPI IDirectMusicComposerImpl_Release(IDirectMusicComposer *iface)
64 IDirectMusicComposerImpl *This = impl_from_IDirectMusicComposer(iface);
65 ULONG ref = InterlockedDecrement(&This->ref);
67 TRACE("(%p) ref=%d\n", This, ref);
69 if (ref == 0) {
70 HeapFree(GetProcessHeap(), 0, This);
71 DMCOMPOS_UnlockModule();
74 return ref;
77 /* IDirectMusicComposerImpl IDirectMusicComposer part: */
78 static HRESULT WINAPI IDirectMusicComposerImpl_ComposeSegmentFromTemplate(IDirectMusicComposer *iface,
79 IDirectMusicStyle *pStyle, IDirectMusicSegment *pTemplate, WORD wActivity,
80 IDirectMusicChordMap *pChordMap, IDirectMusicSegment **ppSegment)
82 IDirectMusicComposerImpl *This = impl_from_IDirectMusicComposer(iface);
83 FIXME("(%p, %p, %p, %d, %p, %p): stub\n", This, pStyle, pTemplate, wActivity, pChordMap, ppSegment);
84 return S_OK;
87 static HRESULT WINAPI IDirectMusicComposerImpl_ComposeSegmentFromShape(IDirectMusicComposer *iface,
88 IDirectMusicStyle *pStyle, WORD wNumMeasures, WORD wShape, WORD wActivity, BOOL fIntro,
89 BOOL fEnd, IDirectMusicChordMap *pChordMap, IDirectMusicSegment **ppSegment)
91 IDirectMusicComposerImpl *This = impl_from_IDirectMusicComposer(iface);
92 FIXME("(%p, %p, %d, %d, %d, %d, %d, %p, %p): stub\n", This, pStyle, wNumMeasures, wShape, wActivity, fIntro, fEnd, pChordMap, ppSegment);
93 return S_OK;
96 static HRESULT WINAPI IDirectMusicComposerImpl_ComposeTransition(IDirectMusicComposer *iface,
97 IDirectMusicSegment *pFromSeg, IDirectMusicSegment *pToSeg, MUSIC_TIME mtTime,
98 WORD wCommand, DWORD dwFlags, IDirectMusicChordMap *pChordMap,
99 IDirectMusicSegment **ppTransSeg)
101 IDirectMusicComposerImpl *This = impl_from_IDirectMusicComposer(iface);
102 FIXME("(%p, %p, %p, %d, %d, %d, %p, %p): stub\n", This, pFromSeg, pToSeg, mtTime, wCommand, dwFlags, pChordMap, ppTransSeg);
103 return S_OK;
106 static HRESULT WINAPI IDirectMusicComposerImpl_AutoTransition(IDirectMusicComposer *iface,
107 IDirectMusicPerformance *pPerformance, IDirectMusicSegment *pToSeg, WORD wCommand,
108 DWORD dwFlags, IDirectMusicChordMap *pChordMap, IDirectMusicSegment **ppTransSeg,
109 IDirectMusicSegmentState **ppToSegState, IDirectMusicSegmentState **ppTransSegState)
111 IDirectMusicComposerImpl *This = impl_from_IDirectMusicComposer(iface);
112 FIXME("(%p, %p, %d, %d, %p, %p, %p, %p): stub\n", This, pPerformance, wCommand, dwFlags, pChordMap, ppTransSeg, ppToSegState, ppTransSegState);
113 return S_OK;
116 static HRESULT WINAPI IDirectMusicComposerImpl_ComposeTemplateFromShape(IDirectMusicComposer *iface,
117 WORD wNumMeasures, WORD wShape, BOOL fIntro, BOOL fEnd, WORD wEndLength,
118 IDirectMusicSegment **ppTemplate)
120 IDirectMusicComposerImpl *This = impl_from_IDirectMusicComposer(iface);
121 FIXME("(%p, %d, %d, %d, %d, %d, %p): stub\n", This, wNumMeasures, wShape, fIntro, fEnd, wEndLength, ppTemplate);
122 return S_OK;
125 static HRESULT WINAPI IDirectMusicComposerImpl_ChangeChordMap(IDirectMusicComposer *iface,
126 IDirectMusicSegment *pSegment, BOOL fTrackScale, IDirectMusicChordMap *pChordMap)
128 IDirectMusicComposerImpl *This = impl_from_IDirectMusicComposer(iface);
129 FIXME("(%p, %p, %d, %p): stub\n", This, pSegment, fTrackScale, pChordMap);
130 return S_OK;
133 static const IDirectMusicComposerVtbl dmcomposer_vtbl = {
134 IDirectMusicComposerImpl_QueryInterface,
135 IDirectMusicComposerImpl_AddRef,
136 IDirectMusicComposerImpl_Release,
137 IDirectMusicComposerImpl_ComposeSegmentFromTemplate,
138 IDirectMusicComposerImpl_ComposeSegmentFromShape,
139 IDirectMusicComposerImpl_ComposeTransition,
140 IDirectMusicComposerImpl_AutoTransition,
141 IDirectMusicComposerImpl_ComposeTemplateFromShape,
142 IDirectMusicComposerImpl_ChangeChordMap
145 /* for ClassFactory */
146 HRESULT WINAPI create_dmcomposer(REFIID riid, void **ret_iface)
148 IDirectMusicComposerImpl *obj;
149 HRESULT hr;
151 obj = HeapAlloc(GetProcessHeap(), 0, sizeof(*obj));
152 if (!obj) {
153 *ret_iface = NULL;
154 return E_OUTOFMEMORY;
156 obj->IDirectMusicComposer_iface.lpVtbl = &dmcomposer_vtbl;
157 obj->ref = 1;
159 DMCOMPOS_LockModule();
160 hr = IDirectMusicComposer_QueryInterface(&obj->IDirectMusicComposer_iface, riid, ret_iface);
161 IDirectMusicComposer_Release(&obj->IDirectMusicComposer_iface);
163 return hr;