Only ignore certain keyboard events if a XLookupString returned a
[wine/hacks.git] / dlls / dmusic / port.c
blobe6095333225200990ef833948e735f0a88da9e0a
1 /* IDirectMusicPort Implementation
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 <stdarg.h>
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 /* IDirectMusicPort IUnknown parts follow: */
33 HRESULT WINAPI IDirectMusicPortImpl_QueryInterface (LPDIRECTMUSICPORT iface, REFIID riid, LPVOID *ppobj)
35 ICOM_THIS(IDirectMusicPortImpl,iface);
37 if (IsEqualIID (riid, &IID_IUnknown) || IsEqualGUID(riid, &IID_IDirectMusicPort)) {
38 IDirectMusicPortImpl_AddRef(iface);
39 *ppobj = This;
40 return S_OK;
43 WARN("(%p)->(%s,%p),not found\n",This,debugstr_guid(riid),ppobj);
44 return E_NOINTERFACE;
47 ULONG WINAPI IDirectMusicPortImpl_AddRef (LPDIRECTMUSICPORT iface)
49 ICOM_THIS(IDirectMusicPortImpl,iface);
50 TRACE("(%p) : AddRef from %ld\n", This, This->ref);
51 return ++(This->ref);
54 ULONG WINAPI IDirectMusicPortImpl_Release (LPDIRECTMUSICPORT iface)
56 ICOM_THIS(IDirectMusicPortImpl,iface);
57 ULONG ref = --This->ref;
58 TRACE("(%p) : ReleaseRef to %ld\n", This, This->ref);
59 if (ref == 0) {
60 HeapFree(GetProcessHeap(), 0, This);
62 return ref;
65 /* IDirectMusicPort Interface follow: */
66 HRESULT WINAPI IDirectMusicPortImpl_PlayBuffer (LPDIRECTMUSICPORT iface, LPDIRECTMUSICBUFFER pBuffer)
68 ICOM_THIS(IDirectMusicPortImpl,iface);
70 FIXME("(%p, %p): stub\n", This, pBuffer);
72 return S_OK;
75 HRESULT WINAPI IDirectMusicPortImpl_SetReadNotificationHandle (LPDIRECTMUSICPORT iface, HANDLE hEvent)
77 ICOM_THIS(IDirectMusicPortImpl,iface);
79 FIXME("(%p, %p): stub\n", This, hEvent);
81 return S_OK;
84 HRESULT WINAPI IDirectMusicPortImpl_Read (LPDIRECTMUSICPORT iface, LPDIRECTMUSICBUFFER pBuffer)
86 ICOM_THIS(IDirectMusicPortImpl,iface);
88 FIXME("(%p, %p): stub\n", This, pBuffer);
90 return S_OK;
93 HRESULT WINAPI IDirectMusicPortImpl_DownloadInstrument (LPDIRECTMUSICPORT iface, IDirectMusicInstrument* pInstrument, IDirectMusicDownloadedInstrument** ppDownloadedInstrument, DMUS_NOTERANGE* pNoteRanges, DWORD dwNumNoteRanges)
95 ICOM_THIS(IDirectMusicPortImpl,iface);
97 FIXME("(%p, %p, %p, %p, %ld): stub\n", This, pInstrument, ppDownloadedInstrument, pNoteRanges, dwNumNoteRanges);
99 return S_OK;
102 HRESULT WINAPI IDirectMusicPortImpl_UnloadInstrument (LPDIRECTMUSICPORT iface, IDirectMusicDownloadedInstrument *pDownloadedInstrument)
104 ICOM_THIS(IDirectMusicPortImpl,iface);
106 FIXME("(%p, %p): stub\n", This, pDownloadedInstrument);
108 return S_OK;
111 HRESULT WINAPI IDirectMusicPortImpl_GetLatencyClock (LPDIRECTMUSICPORT iface, IReferenceClock** ppClock)
113 ICOM_THIS(IDirectMusicPortImpl,iface);
115 TRACE("(%p, %p)\n", This, ppClock);
116 *ppClock = This->pLatencyClock;
117 IReferenceClock_AddRef (*ppClock);
119 return S_OK;
122 HRESULT WINAPI IDirectMusicPortImpl_GetRunningStats (LPDIRECTMUSICPORT iface, LPDMUS_SYNTHSTATS pStats)
124 ICOM_THIS(IDirectMusicPortImpl,iface);
126 FIXME("(%p, %p): stub\n", This, pStats);
128 return S_OK;
131 HRESULT WINAPI IDirectMusicPortImpl_GetCaps (LPDIRECTMUSICPORT iface, LPDMUS_PORTCAPS pPortCaps)
133 ICOM_THIS(IDirectMusicPortImpl,iface);
135 TRACE("(%p, %p)\n", This, pPortCaps);
136 pPortCaps = This->pCaps;
138 return S_OK;
141 HRESULT WINAPI IDirectMusicPortImpl_DeviceIoControl (LPDIRECTMUSICPORT iface, DWORD dwIoControlCode, LPVOID lpInBuffer, DWORD nInBufferSize, LPVOID lpOutBuffer, DWORD nOutBufferSize, LPDWORD lpBytesReturned, LPOVERLAPPED lpOverlapped)
143 ICOM_THIS(IDirectMusicPortImpl,iface);
145 FIXME("(%p, %ld, %p, %ld, %p, %ld, %p, %p): stub\n", This, dwIoControlCode, lpInBuffer, nInBufferSize, lpOutBuffer, nOutBufferSize, lpBytesReturned, lpOverlapped);
147 return S_OK;
150 HRESULT WINAPI IDirectMusicPortImpl_SetNumChannelGroups (LPDIRECTMUSICPORT iface, DWORD dwChannelGroups)
152 ICOM_THIS(IDirectMusicPortImpl,iface);
154 FIXME("(%p, %ld): semi-stub\n", This, dwChannelGroups);
155 This->nrofgroups = dwChannelGroups;
157 return S_OK;
160 HRESULT WINAPI IDirectMusicPortImpl_GetNumChannelGroups (LPDIRECTMUSICPORT iface, LPDWORD pdwChannelGroups)
162 ICOM_THIS(IDirectMusicPortImpl,iface);
164 TRACE("(%p, %p)\n", This, pdwChannelGroups);
165 *pdwChannelGroups = This->nrofgroups;
167 return S_OK;
170 HRESULT WINAPI IDirectMusicPortImpl_Activate (LPDIRECTMUSICPORT iface, BOOL fActive)
172 ICOM_THIS(IDirectMusicPortImpl,iface);
174 TRACE("(%p, %d)\n", This, fActive);
175 This->fActive = fActive;
177 return S_OK;
180 HRESULT WINAPI IDirectMusicPortImpl_SetChannelPriority (LPDIRECTMUSICPORT iface, DWORD dwChannelGroup, DWORD dwChannel, DWORD dwPriority)
182 ICOM_THIS(IDirectMusicPortImpl,iface);
184 FIXME("(%p, %ld, %ld, %ld): semi-stub\n", This, dwChannelGroup, dwChannel, dwPriority);
186 if (dwChannel > 16)
188 WARN("isn't there supposed to be 16 channels (no. %ld requested)?! (faking as it is ok)\n", dwChannel);
189 /*return E_INVALIDARG;*/
192 return S_OK;
195 HRESULT WINAPI IDirectMusicPortImpl_GetChannelPriority (LPDIRECTMUSICPORT iface, DWORD dwChannelGroup, DWORD dwChannel, LPDWORD pdwPriority)
197 ICOM_THIS(IDirectMusicPortImpl,iface);
199 TRACE("(%p, %ld, %ld, %p)\n", This, dwChannelGroup, dwChannel, pdwPriority);
200 *pdwPriority = This->group[dwChannelGroup-1].channel[dwChannel].priority;
202 return S_OK;
205 HRESULT WINAPI IDirectMusicPortImpl_SetDirectSound (LPDIRECTMUSICPORT iface, LPDIRECTSOUND pDirectSound, LPDIRECTSOUNDBUFFER pDirectSoundBuffer)
207 ICOM_THIS(IDirectMusicPortImpl,iface);
209 FIXME("(%p, %p, %p): stub\n", This, pDirectSound, pDirectSoundBuffer);
211 return S_OK;
214 HRESULT WINAPI IDirectMusicPortImpl_GetFormat (LPDIRECTMUSICPORT iface, LPWAVEFORMATEX pWaveFormatEx, LPDWORD pdwWaveFormatExSize, LPDWORD pdwBufferSize)
216 ICOM_THIS(IDirectMusicPortImpl,iface);
218 FIXME("(%p, %p, %p, %p): stub\n", This, pWaveFormatEx, pdwWaveFormatExSize, pdwBufferSize);
220 return S_OK;
223 ICOM_VTABLE(IDirectMusicPort) DirectMusicPort_Vtbl =
225 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
226 IDirectMusicPortImpl_QueryInterface,
227 IDirectMusicPortImpl_AddRef,
228 IDirectMusicPortImpl_Release,
229 IDirectMusicPortImpl_PlayBuffer,
230 IDirectMusicPortImpl_SetReadNotificationHandle,
231 IDirectMusicPortImpl_Read,
232 IDirectMusicPortImpl_DownloadInstrument,
233 IDirectMusicPortImpl_UnloadInstrument,
234 IDirectMusicPortImpl_GetLatencyClock,
235 IDirectMusicPortImpl_GetRunningStats,
236 IDirectMusicPortImpl_GetCaps,
237 IDirectMusicPortImpl_DeviceIoControl,
238 IDirectMusicPortImpl_SetNumChannelGroups,
239 IDirectMusicPortImpl_GetNumChannelGroups,
240 IDirectMusicPortImpl_Activate,
241 IDirectMusicPortImpl_SetChannelPriority,
242 IDirectMusicPortImpl_GetChannelPriority,
243 IDirectMusicPortImpl_SetDirectSound,
244 IDirectMusicPortImpl_GetFormat
247 /* for ClassFactory */
248 HRESULT WINAPI DMUSIC_CreateDirectMusicPort (LPCGUID lpcGUID, LPDIRECTMUSICPORT* ppDMPort, LPUNKNOWN pUnkOuter)
250 if (IsEqualIID (lpcGUID, &IID_IDirectMusicPort))
252 FIXME("Not yet\n");
253 return E_NOINTERFACE;
255 WARN("No interface found\n");
257 return E_NOINTERFACE;