Added YUV routines needed for v4l driver, and in the future possibly
[wine/gsoc-2012-control.git] / dlls / dmsynth / dmsynth_private.h
blob9559c5d26901da43ac6349e059633249a56e57f2
1 /* DirectMusicSynthesizer Private Include
3 * Copyright (C) 2003-2004 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 #ifndef __WINE_DMSYNTH_PRIVATE_H
21 #define __WINE_DMSYNTH_PRIVATE_H
23 #include <stdarg.h>
25 #define COBJMACROS
27 #include "windef.h"
28 #include "winbase.h"
29 #include "winnt.h"
30 #include "wingdi.h"
31 #include "winuser.h"
33 #include "wine/debug.h"
34 #include "wine/list.h"
35 #include "wine/unicode.h"
36 #include "winreg.h"
37 #include "objbase.h"
39 #include "dmusici.h"
40 #include "dmusicf.h"
41 #include "dmusics.h"
43 /*****************************************************************************
44 * Interfaces
46 typedef struct IDirectMusicSynth8Impl IDirectMusicSynth8Impl;
47 typedef struct IDirectMusicSynthSinkImpl IDirectMusicSynthSinkImpl;
49 /*****************************************************************************
50 * Predeclare the interface implementation structures
52 extern IDirectMusicSynth8Vtbl DirectMusicSynth8_Vtbl;
53 extern IDirectMusicSynthSinkVtbl DirectMusicSynthSink_Vtbl;
55 /*****************************************************************************
56 * ClassFactory
58 extern HRESULT WINAPI DMUSIC_CreateDirectMusicSynthImpl (LPCGUID lpcGUID, LPVOID* ppobj, LPUNKNOWN pUnkOuter);
59 extern HRESULT WINAPI DMUSIC_CreateDirectMusicSynthSinkImpl (LPCGUID lpcGUID, LPVOID* ppobj, LPUNKNOWN pUnkOuter);
61 /*****************************************************************************
62 * IDirectMusicSynth8Impl implementation structure
64 struct IDirectMusicSynth8Impl {
65 /* IUnknown fields */
66 IDirectMusicSynth8Vtbl *lpVtbl;
67 DWORD ref;
69 /* IDirectMusicSynth8 fields */
70 DMUS_PORTCAPS pCaps;
71 BOOL fActive;
72 IReferenceClock* pLatencyClock;
73 IDirectMusicSynthSinkImpl* pSynthSink;
76 /* IUnknown: */
77 extern HRESULT WINAPI IDirectMusicSynth8Impl_QueryInterface (LPDIRECTMUSICSYNTH8 iface, REFIID riid, LPVOID *ppobj);
78 extern ULONG WINAPI IDirectMusicSynth8Impl_AddRef (LPDIRECTMUSICSYNTH8 iface);
79 extern ULONG WINAPI IDirectMusicSynth8Impl_Release (LPDIRECTMUSICSYNTH8 iface);
80 /* IDirectMusicSynth: */
81 extern HRESULT WINAPI IDirectMusicSynth8Impl_Open (LPDIRECTMUSICSYNTH8 iface, LPDMUS_PORTPARAMS pPortParams);
82 extern HRESULT WINAPI IDirectMusicSynth8Impl_Close (LPDIRECTMUSICSYNTH8 iface);
83 extern HRESULT WINAPI IDirectMusicSynth8Impl_SetNumChannelGroups (LPDIRECTMUSICSYNTH8 iface, DWORD dwGroups);
84 extern HRESULT WINAPI IDirectMusicSynth8Impl_Download (LPDIRECTMUSICSYNTH8 iface, LPHANDLE phDownload, LPVOID pvData, LPBOOL pbFree);
85 extern HRESULT WINAPI IDirectMusicSynth8Impl_Unload (LPDIRECTMUSICSYNTH8 iface, HANDLE hDownload, HRESULT (CALLBACK* lpFreeHandle)(HANDLE,HANDLE), HANDLE hUserData);
86 extern HRESULT WINAPI IDirectMusicSynth8Impl_PlayBuffer (LPDIRECTMUSICSYNTH8 iface, REFERENCE_TIME rt, LPBYTE pbBuffer, DWORD cbBuffer);
87 extern HRESULT WINAPI IDirectMusicSynth8Impl_GetRunningStats (LPDIRECTMUSICSYNTH8 iface, LPDMUS_SYNTHSTATS pStats);
88 extern HRESULT WINAPI IDirectMusicSynth8Impl_GetPortCaps (LPDIRECTMUSICSYNTH8 iface, LPDMUS_PORTCAPS pCaps);
89 extern HRESULT WINAPI IDirectMusicSynth8Impl_SetMasterClock (LPDIRECTMUSICSYNTH8 iface, IReferenceClock* pClock);
90 extern HRESULT WINAPI IDirectMusicSynth8Impl_GetLatencyClock (LPDIRECTMUSICSYNTH8 iface, IReferenceClock** ppClock);
91 extern HRESULT WINAPI IDirectMusicSynth8Impl_Activate (LPDIRECTMUSICSYNTH8 iface, BOOL fEnable);
92 extern HRESULT WINAPI IDirectMusicSynth8Impl_SetSynthSink (LPDIRECTMUSICSYNTH8 iface, IDirectMusicSynthSink* pSynthSink);
93 extern HRESULT WINAPI IDirectMusicSynth8Impl_Render (LPDIRECTMUSICSYNTH8 iface, short* pBuffer, DWORD dwLength, LONGLONG llPosition);
94 extern HRESULT WINAPI IDirectMusicSynth8Impl_SetChannelPriority (LPDIRECTMUSICSYNTH8 iface, DWORD dwChannelGroup, DWORD dwChannel, DWORD dwPriority);
95 extern HRESULT WINAPI IDirectMusicSynth8Impl_GetChannelPriority (LPDIRECTMUSICSYNTH8 iface, DWORD dwChannelGroup, DWORD dwChannel, LPDWORD pdwPriority);
96 extern HRESULT WINAPI IDirectMusicSynth8Impl_GetFormat (LPDIRECTMUSICSYNTH8 iface, LPWAVEFORMATEX pWaveFormatEx, LPDWORD pdwWaveFormatExSiz);
97 extern HRESULT WINAPI IDirectMusicSynth8Impl_GetAppend (LPDIRECTMUSICSYNTH8 iface, DWORD* pdwAppend);
98 /* IDirectMusicSynth8: */
99 extern HRESULT WINAPI IDirectMusicSynth8Impl_PlayVoice (LPDIRECTMUSICSYNTH8 iface, REFERENCE_TIME rt, DWORD dwVoiceId, DWORD dwChannelGroup, DWORD dwChannel, DWORD dwDLId, long prPitch, long vrVolume, SAMPLE_TIME stVoiceStart, SAMPLE_TIME stLoopStart, SAMPLE_TIME stLoopEnd);
100 extern HRESULT WINAPI IDirectMusicSynth8Impl_StopVoice (LPDIRECTMUSICSYNTH8 iface, REFERENCE_TIME rt, DWORD dwVoiceId);
101 extern HRESULT WINAPI IDirectMusicSynth8Impl_GetVoiceState (LPDIRECTMUSICSYNTH8 iface, DWORD dwVoice[], DWORD cbVoice, DMUS_VOICE_STATE dwVoiceState[]);
102 extern HRESULT WINAPI IDirectMusicSynth8Impl_Refresh (LPDIRECTMUSICSYNTH8 iface, DWORD dwDownloadID, DWORD dwFlags);
103 extern HRESULT WINAPI IDirectMusicSynth8Impl_AssignChannelToBuses (LPDIRECTMUSICSYNTH8 iface, DWORD dwChannelGroup, DWORD dwChannel, LPDWORD pdwBuses, DWORD cBuses);
105 /*****************************************************************************
106 * IDirectMusicSynthSinkImpl implementation structure
108 struct IDirectMusicSynthSinkImpl {
109 /* IUnknown fields */
110 IDirectMusicSynthSinkVtbl *lpVtbl;
111 DWORD ref;
113 /* IDirectMusicSynthSinkImpl fields */
116 /* IUnknown: */
117 extern HRESULT WINAPI IDirectMusicSynthSinkImpl_QueryInterface (LPDIRECTMUSICSYNTHSINK iface, REFIID riid, LPVOID *ppobj);
118 extern ULONG WINAPI IDirectMusicSynthSinkImpl_AddRef (LPDIRECTMUSICSYNTHSINK iface);
119 extern ULONG WINAPI IDirectMusicSynthSinkImpl_Release (LPDIRECTMUSICSYNTHSINK iface);
120 /* IDirectMusicSynthSinkImpl: */
121 extern HRESULT WINAPI IDirectMusicSynthSinkImpl_Init (LPDIRECTMUSICSYNTHSINK iface, IDirectMusicSynth* pSynth);
122 extern HRESULT WINAPI IDirectMusicSynthSinkImpl_SetMasterClock (LPDIRECTMUSICSYNTHSINK iface, IReferenceClock* pClock);
123 extern HRESULT WINAPI IDirectMusicSynthSinkImpl_GetLatencyClock (LPDIRECTMUSICSYNTHSINK iface, IReferenceClock** ppClock);
124 extern HRESULT WINAPI IDirectMusicSynthSinkImpl_Activate (LPDIRECTMUSICSYNTHSINK iface, BOOL fEnable);
125 extern HRESULT WINAPI IDirectMusicSynthSinkImpl_SampleToRefTime (LPDIRECTMUSICSYNTHSINK iface, LONGLONG llSampleTime, REFERENCE_TIME* prfTime);
126 extern HRESULT WINAPI IDirectMusicSynthSinkImpl_RefTimeToSample (LPDIRECTMUSICSYNTHSINK iface, REFERENCE_TIME rfTime, LONGLONG* pllSampleTime);
127 extern HRESULT WINAPI IDirectMusicSynthSinkImpl_SetDirectSound (LPDIRECTMUSICSYNTHSINK iface, LPDIRECTSOUND pDirectSound, LPDIRECTSOUNDBUFFER pDirectSoundBuffer);
128 extern HRESULT WINAPI IDirectMusicSynthSinkImpl_GetDesiredBufferSize (LPDIRECTMUSICSYNTHSINK iface, LPDWORD pdwBufferSizeInSamples);
130 /**********************************************************************
131 * Dll lifetime tracking declaration for dmsynth.dll
133 extern LONG DMSYNTH_refCount;
134 static inline void DMSYNTH_LockModule() { InterlockedIncrement( &DMSYNTH_refCount ); }
135 static inline void DMSYNTH_UnlockModule() { InterlockedDecrement( &DMSYNTH_refCount ); }
137 /*****************************************************************************
138 * Misc.
140 /* used for generic dumping (copied from ddraw) */
141 typedef struct {
142 DWORD val;
143 const char* name;
144 } flag_info;
146 typedef struct {
147 const GUID *guid;
148 const char* name;
149 } guid_info;
151 /* used for initialising structs (primarily for DMUS_OBJECTDESC) */
152 #define DM_STRUCT_INIT(x) \
153 do { \
154 memset((x), 0, sizeof(*(x))); \
155 (x)->dwSize = sizeof(*x); \
156 } while (0)
158 #define FE(x) { x, #x }
159 #define GE(x) { &x, #x }
161 /* FOURCC to string conversion for debug messages */
162 extern const char *debugstr_fourcc (DWORD fourcc);
163 /* DMUS_VERSION struct to string conversion for debug messages */
164 extern const char *debugstr_dmversion (LPDMUS_VERSION version);
165 /* returns name of given GUID */
166 extern const char *debugstr_dmguid (const GUID *id);
167 /* returns name of given error code */
168 extern const char *debugstr_dmreturn (DWORD code);
169 /* generic flags-dumping function */
170 extern const char *debugstr_flags (DWORD flags, const flag_info* names, size_t num_names);
173 #endif /* __WINE_DMSYNTH_PRIVATE_H */