Fixed bad non-client calculation.
[wine.git] / dlls / dmusic / dmusic_instrument.c
blobdcb030fe25ea646280d6b0a89f51879477112192
1 /* IDirectMusicInstrument Implementation
2 * IDirectMusicDownloadedInstrument Implementation
3 * IDirectMusicCollection Implementation
5 * Copyright (C) 2003 Rok Mandeljc
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU Library General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
22 #include "windef.h"
23 #include "winbase.h"
24 #include "winuser.h"
25 #include "wingdi.h"
26 #include "wine/debug.h"
28 #include "dmusic_private.h"
30 WINE_DEFAULT_DEBUG_CHANNEL(dmusic);
32 /* IDirectMusicInstrument IUnknown parts follow: */
33 HRESULT WINAPI IDirectMusicInstrumentImpl_QueryInterface (LPDIRECTMUSICINSTRUMENT iface, REFIID riid, LPVOID *ppobj)
35 ICOM_THIS(IDirectMusicInstrumentImpl,iface);
37 if (IsEqualGUID(riid, &IID_IUnknown) || IsEqualGUID(riid, &IID_IDirectMusicInstrument))
39 IDirectMusicInstrumentImpl_AddRef(iface);
40 *ppobj = This;
41 return DS_OK;
43 WARN("(%p)->(%s,%p),not found\n",This,debugstr_guid(riid),ppobj);
44 return E_NOINTERFACE;
47 ULONG WINAPI IDirectMusicInstrumentImpl_AddRef (LPDIRECTMUSICINSTRUMENT iface)
49 ICOM_THIS(IDirectMusicInstrumentImpl,iface);
50 TRACE("(%p) : AddRef from %ld\n", This, This->ref);
51 return ++(This->ref);
54 ULONG WINAPI IDirectMusicInstrumentImpl_Release (LPDIRECTMUSICINSTRUMENT iface)
56 ICOM_THIS(IDirectMusicInstrumentImpl,iface);
57 ULONG ref = --This->ref;
58 TRACE("(%p) : ReleaseRef to %ld\n", This, This->ref);
59 if (ref == 0)
61 HeapFree(GetProcessHeap(), 0, This);
63 return ref;
66 /* IDirectMusicInstrument Interface follow: */
67 HRESULT WINAPI IDirectMusicInstrumentImpl_GetPatch (LPDIRECTMUSICINSTRUMENT iface, DWORD* pdwPatch)
69 FIXME("stub\n");
70 return DS_OK;
73 HRESULT WINAPI IDirectMusicInstrumentImpl_SetPatch (LPDIRECTMUSICINSTRUMENT iface, DWORD dwPatch)
75 FIXME("stub\n");
76 return DS_OK;
79 ICOM_VTABLE(IDirectMusicInstrument) DirectMusicInstrument_Vtbl =
81 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
82 IDirectMusicInstrumentImpl_QueryInterface,
83 IDirectMusicInstrumentImpl_AddRef,
84 IDirectMusicInstrumentImpl_Release,
85 IDirectMusicInstrumentImpl_GetPatch,
86 IDirectMusicInstrumentImpl_SetPatch
90 /* IDirectMusicDownloadedInstrument IUnknown parts follow: */
91 HRESULT WINAPI IDirectMusicDownloadedInstrumentImpl_QueryInterface (LPDIRECTMUSICDOWNLOADEDINSTRUMENT iface, REFIID riid, LPVOID *ppobj)
93 ICOM_THIS(IDirectMusicDownloadedInstrumentImpl,iface);
95 if (IsEqualGUID(riid, &IID_IUnknown) || IsEqualGUID(riid, &IID_IDirectMusicDownloadedInstrument))
97 IDirectMusicDownloadedInstrumentImpl_AddRef(iface);
98 *ppobj = This;
99 return DS_OK;
101 WARN("(%p)->(%s,%p),not found\n",This,debugstr_guid(riid),ppobj);
102 return E_NOINTERFACE;
105 ULONG WINAPI IDirectMusicDownloadedInstrumentImpl_AddRef (LPDIRECTMUSICDOWNLOADEDINSTRUMENT iface)
107 ICOM_THIS(IDirectMusicDownloadedInstrumentImpl,iface);
108 TRACE("(%p) : AddRef from %ld\n", This, This->ref);
109 return ++(This->ref);
112 ULONG WINAPI IDirectMusicDownloadedInstrumentImpl_Release (LPDIRECTMUSICDOWNLOADEDINSTRUMENT iface)
114 ICOM_THIS(IDirectMusicDownloadedInstrumentImpl,iface);
115 ULONG ref = --This->ref;
116 TRACE("(%p) : ReleaseRef to %ld\n", This, This->ref);
117 if (ref == 0)
119 HeapFree(GetProcessHeap(), 0, This);
121 return ref;
124 /* IDirectMusicDownloadedInstrument Interface follow: */
125 /* none at this time */
127 ICOM_VTABLE(IDirectMusicDownloadedInstrument) DirectMusicDownloadedInstrument_Vtbl =
129 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
130 IDirectMusicDownloadedInstrumentImpl_QueryInterface,
131 IDirectMusicDownloadedInstrumentImpl_AddRef,
132 IDirectMusicDownloadedInstrumentImpl_Release
136 /* IDirectMusicCollection IUnknown parts follow: */
137 HRESULT WINAPI IDirectMusicCollectionImpl_QueryInterface (LPDIRECTMUSICCOLLECTION iface, REFIID riid, LPVOID *ppobj)
139 ICOM_THIS(IDirectMusicCollectionImpl,iface);
141 if (IsEqualGUID(riid, &IID_IUnknown) || IsEqualGUID(riid, &IID_IDirectMusicCollection))
143 IDirectMusicCollectionImpl_AddRef(iface);
144 *ppobj = This;
145 return DS_OK;
147 WARN("(%p)->(%s,%p),not found\n",This,debugstr_guid(riid),ppobj);
148 return E_NOINTERFACE;
151 ULONG WINAPI IDirectMusicCollectionImpl_AddRef (LPDIRECTMUSICCOLLECTION iface)
153 ICOM_THIS(IDirectMusicCollectionImpl,iface);
154 TRACE("(%p) : AddRef from %ld\n", This, This->ref);
155 return ++(This->ref);
158 ULONG WINAPI IDirectMusicCollectionImpl_Release (LPDIRECTMUSICCOLLECTION iface)
160 ICOM_THIS(IDirectMusicCollectionImpl,iface);
161 ULONG ref = --This->ref;
162 TRACE("(%p) : ReleaseRef to %ld\n", This, This->ref);
163 if (ref == 0)
165 HeapFree(GetProcessHeap(), 0, This);
167 return ref;
170 /* IDirectMusicCollection Interface follow: */
171 HRESULT WINAPI IDirectMusicCollectionImpl_GetInstrument (LPDIRECTMUSICCOLLECTION iface, DWORD dwPatch, IDirectMusicInstrument** ppInstrument)
173 FIXME("stub\n");
174 return DS_OK;
177 HRESULT WINAPI IDirectMusicCollectionImpl_EnumInstrument (LPDIRECTMUSICCOLLECTION iface, DWORD dwIndex, DWORD* pdwPatch, LPWSTR pwszName, DWORD dwNameLen)
179 FIXME("stub\n");
180 return DS_OK;
183 ICOM_VTABLE(IDirectMusicCollection) DirectMusicCollection_Vtbl =
185 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
186 IDirectMusicCollectionImpl_QueryInterface,
187 IDirectMusicCollectionImpl_AddRef,
188 IDirectMusicCollectionImpl_Release,
189 IDirectMusicCollectionImpl_GetInstrument,
190 IDirectMusicCollectionImpl_EnumInstrument