Home | Info | Community | Development | myReactOS | Contact Us
ReactOS Development > Doxygendmusic_private.h
Go to the documentation of this file.
00001 /* DirectMusic Private Include 00002 * 00003 * Copyright (C) 2003-2004 Rok Mandeljc 00004 * 00005 * This program is free software; you can redistribute it and/or 00006 * modify it under the terms of the GNU Lesser General Public 00007 * License as published by the Free Software Foundation; either 00008 * version 2.1 of the License, or (at your option) any later version. 00009 * 00010 * This program is distributed in the hope that it will be useful, 00011 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00013 * Lesser General Public License for more details. 00014 * 00015 * You should have received a copy of the GNU Lesser General Public 00016 * License along with this program; if not, write to the Free Software 00017 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA 00018 */ 00019 00020 #ifndef __WINE_DMUSIC_PRIVATE_H 00021 #define __WINE_DMUSIC_PRIVATE_H 00022 00023 #include <stdarg.h> 00024 00025 #define COBJMACROS 00026 00027 #include "windef.h" 00028 #include "winbase.h" 00029 #include "winnt.h" 00030 #include "wingdi.h" 00031 #include "winuser.h" 00032 00033 #include "wine/debug.h" 00034 #include "wine/list.h" 00035 #include "wine/unicode.h" 00036 #include "winreg.h" 00037 #include "objbase.h" 00038 00039 #include "dmusici.h" 00040 #include "dmusicf.h" 00041 #include "dmusics.h" 00042 00043 /***************************************************************************** 00044 * Interfaces 00045 */ 00046 typedef struct IDirectMusic8Impl IDirectMusic8Impl; 00047 typedef struct IDirectMusicBufferImpl IDirectMusicBufferImpl; 00048 typedef struct IDirectMusicDownloadedInstrumentImpl IDirectMusicDownloadedInstrumentImpl; 00049 typedef struct IDirectMusicDownloadImpl IDirectMusicDownloadImpl; 00050 typedef struct IDirectMusicPortDownloadImpl IDirectMusicPortDownloadImpl; 00051 typedef struct IDirectMusicPortImpl IDirectMusicPortImpl; 00052 typedef struct IDirectMusicThruImpl IDirectMusicThruImpl; 00053 typedef struct IReferenceClockImpl IReferenceClockImpl; 00054 00055 typedef struct IDirectMusicCollectionImpl IDirectMusicCollectionImpl; 00056 typedef struct IDirectMusicInstrumentImpl IDirectMusicInstrumentImpl; 00057 00058 00059 /***************************************************************************** 00060 * Some stuff to make my life easier :=) 00061 */ 00062 00063 /* some sort of aux. midi channel: big fake at the moment; accepts only priority 00064 changes... more coming soon */ 00065 typedef struct DMUSIC_PRIVATE_MCHANNEL_ { 00066 DWORD priority; 00067 } DMUSIC_PRIVATE_MCHANNEL, *LPDMUSIC_PRIVATE_MCHANNEL; 00068 00069 /* some sort of aux. channel group: collection of 16 midi channels */ 00070 typedef struct DMUSIC_PRIVATE_CHANNEL_GROUP_ { 00071 DMUSIC_PRIVATE_MCHANNEL channel[16]; /* 16 channels in a group */ 00072 } DMUSIC_PRIVATE_CHANNEL_GROUP, *LPDMUSIC_PRIVATE_CHANNEL_GROUP; 00073 00074 00075 /***************************************************************************** 00076 * ClassFactory 00077 */ 00078 extern HRESULT WINAPI DMUSIC_CreateDirectMusicImpl (LPCGUID lpcGUID, LPVOID* ppobj, LPUNKNOWN pUnkOuter); 00079 extern HRESULT WINAPI DMUSIC_CreateDirectMusicBufferImpl (LPCGUID lpcGUID, LPVOID* ppobj, LPUNKNOWN pUnkOuter); 00080 extern HRESULT WINAPI DMUSIC_CreateDirectMusicDownloadedInstrumentImpl (LPCGUID lpcGUID, LPVOID* ppobj, LPUNKNOWN pUnkOuter); 00081 extern HRESULT WINAPI DMUSIC_CreateDirectMusicDownloadImpl (LPCGUID lpcGUID, LPVOID* ppobj, LPUNKNOWN pUnkOuter); 00082 extern HRESULT WINAPI DMUSIC_CreateReferenceClockImpl (LPCGUID lpcGUID, LPVOID* ppobj, LPUNKNOWN pUnkOuter); 00083 00084 extern HRESULT WINAPI DMUSIC_CreateDirectMusicCollectionImpl (LPCGUID lpcGUID, LPVOID* ppobj, LPUNKNOWN pUnkOuter); 00085 extern HRESULT WINAPI DMUSIC_CreateDirectMusicInstrumentImpl (LPCGUID lpcGUID, LPVOID* ppobj, LPUNKNOWN pUnkOuter); 00086 00087 /***************************************************************************** 00088 * IDirectMusic8Impl implementation structure 00089 */ 00090 struct IDirectMusic8Impl { 00091 /* IUnknown fields */ 00092 const IDirectMusic8Vtbl *lpVtbl; 00093 LONG ref; 00094 00095 /* IDirectMusicImpl fields */ 00096 IReferenceClockImpl* pMasterClock; 00097 IDirectMusicPort** ppPorts; 00098 int nrofports; 00099 }; 00100 00101 /***************************************************************************** 00102 * IDirectMusicBufferImpl implementation structure 00103 */ 00104 struct IDirectMusicBufferImpl { 00105 /* IUnknown fields */ 00106 const IDirectMusicBufferVtbl *lpVtbl; 00107 LONG ref; 00108 00109 /* IDirectMusicBufferImpl fields */ 00110 }; 00111 00112 /***************************************************************************** 00113 * IDirectMusicDownloadedInstrumentImpl implementation structure 00114 */ 00115 struct IDirectMusicDownloadedInstrumentImpl { 00116 /* IUnknown fields */ 00117 const IDirectMusicDownloadedInstrumentVtbl *lpVtbl; 00118 LONG ref; 00119 00120 /* IDirectMusicDownloadedInstrumentImpl fields */ 00121 }; 00122 00123 /***************************************************************************** 00124 * IDirectMusicDownloadImpl implementation structure 00125 */ 00126 struct IDirectMusicDownloadImpl { 00127 /* IUnknown fields */ 00128 const IDirectMusicDownloadVtbl *lpVtbl; 00129 LONG ref; 00130 00131 /* IDirectMusicDownloadImpl fields */ 00132 }; 00133 00134 /***************************************************************************** 00135 * IDirectMusicPortImpl implementation structure 00136 */ 00137 struct IDirectMusicPortImpl { 00138 /* IUnknown fields */ 00139 const IDirectMusicPortVtbl *lpVtbl; 00140 const IDirectMusicPortDownloadVtbl *lpDownloadVtbl; 00141 const IDirectMusicThruVtbl *lpThruVtbl; 00142 LONG ref; 00143 00144 /* IDirectMusicPortImpl fields */ 00145 IDirectSound* pDirectSound; 00146 IReferenceClock* pLatencyClock; 00147 BOOL fActive; 00148 DMUS_PORTCAPS caps; 00149 DMUS_PORTPARAMS params; 00150 int nrofgroups; 00151 DMUSIC_PRIVATE_CHANNEL_GROUP group[1]; 00152 }; 00153 00154 extern HRESULT WINAPI IDirectMusicPortImpl_Activate (LPDIRECTMUSICPORT iface, BOOL fActive); 00155 00157 extern HRESULT WINAPI DMUSIC_CreateDirectMusicPortImpl (LPCGUID lpcGUID, LPVOID *ppobj, LPUNKNOWN pUnkOuter, LPDMUS_PORTPARAMS pPortParams, LPDMUS_PORTCAPS pPortCaps); 00158 00159 /***************************************************************************** 00160 * IReferenceClockImpl implementation structure 00161 */ 00162 struct IReferenceClockImpl { 00163 /* IUnknown fields */ 00164 const IReferenceClockVtbl *lpVtbl; 00165 LONG ref; 00166 00167 /* IReferenceClockImpl fields */ 00168 REFERENCE_TIME rtTime; 00169 DMUS_CLOCKINFO pClockInfo; 00170 }; 00171 00172 typedef struct _DMUS_PRIVATE_INSTRUMENT_ENTRY { 00173 struct list entry; /* for listing elements */ 00174 IDirectMusicInstrument* pInstrument; 00175 } DMUS_PRIVATE_INSTRUMENTENTRY, *LPDMUS_PRIVATE_INSTRUMENTENTRY; 00176 00177 typedef struct _DMUS_PRIVATE_POOLCUE { 00178 struct list entry; /* for listing elements */ 00179 } DMUS_PRIVATE_POOLCUE, *LPDMUS_PRIVATE_POOLCUE; 00180 00181 /***************************************************************************** 00182 * IDirectMusicCollectionImpl implementation structure 00183 */ 00184 struct IDirectMusicCollectionImpl { 00185 /* IUnknown fields */ 00186 const IUnknownVtbl *UnknownVtbl; 00187 const IDirectMusicCollectionVtbl *CollectionVtbl; 00188 const IDirectMusicObjectVtbl *ObjectVtbl; 00189 const IPersistStreamVtbl *PersistStreamVtbl; 00190 LONG ref; 00191 00192 /* IDirectMusicCollectionImpl fields */ 00193 IStream *pStm; /* stream from which we load collection and later instruments */ 00194 LARGE_INTEGER liCollectionPosition; /* offset in a stream where collection was loaded from */ 00195 LARGE_INTEGER liWavePoolTablePosition; /* offset in a stream where wave pool table can be found */ 00196 LPDMUS_OBJECTDESC pDesc; 00197 CHAR* szCopyright; /* FIXME: should probably placed somewhere else */ 00198 LPDLSHEADER pHeader; 00199 /* pool table */ 00200 LPPOOLTABLE pPoolTable; 00201 LPPOOLCUE pPoolCues; 00202 /* instruments */ 00203 struct list Instruments; 00204 }; 00205 00206 /***************************************************************************** 00207 * IDirectMusicInstrumentImpl implementation structure 00208 */ 00209 struct IDirectMusicInstrumentImpl { 00210 /* IUnknown fields */ 00211 const IUnknownVtbl *UnknownVtbl; 00212 const IDirectMusicInstrumentVtbl *InstrumentVtbl; 00213 LONG ref; 00214 00215 /* IDirectMusicInstrumentImpl fields */ 00216 LARGE_INTEGER liInstrumentPosition; /* offset in a stream where instrument chunk can be found */ 00217 LPGUID pInstrumentID; 00218 LPINSTHEADER pHeader; 00219 WCHAR wszName[DMUS_MAX_NAME]; 00220 /* instrument data */ 00221 }; 00222 00223 /* custom :) */ 00224 extern HRESULT WINAPI IDirectMusicInstrumentImpl_Custom_Load (LPDIRECTMUSICINSTRUMENT iface, LPSTREAM pStm); 00225 00226 /********************************************************************** 00227 * Dll lifetime tracking declaration for dmusic.dll 00228 */ 00229 extern LONG DMUSIC_refCount; 00230 static inline void DMUSIC_LockModule(void) { InterlockedIncrement( &DMUSIC_refCount ); } 00231 static inline void DMUSIC_UnlockModule(void) { InterlockedDecrement( &DMUSIC_refCount ); } 00232 00233 00234 /***************************************************************************** 00235 * Misc. 00236 */ 00237 /* my custom ICOM stuff */ 00238 #define ICOM_NAME_MULTI(impl,field,iface,name) impl* const name=(impl*)((char*)(iface) - offsetof(impl,field)) 00239 #define ICOM_THIS_MULTI(impl,field,iface) ICOM_NAME_MULTI(impl,field,iface,This) 00240 00241 /* for simpler reading */ 00242 typedef struct _DMUS_PRIVATE_CHUNK { 00243 FOURCC fccID; /* FOURCC ID of the chunk */ 00244 DWORD dwSize; /* size of the chunk */ 00245 } DMUS_PRIVATE_CHUNK, *LPDMUS_PRIVATE_CHUNK; 00246 00247 /* used for generic dumping (copied from ddraw) */ 00248 typedef struct { 00249 DWORD val; 00250 const char* name; 00251 } flag_info; 00252 00253 typedef struct { 00254 const GUID *guid; 00255 const char* name; 00256 } guid_info; 00257 00258 /* used for initialising structs (primarily for DMUS_OBJECTDESC) */ 00259 #define DM_STRUCT_INIT(x) \ 00260 do { \ 00261 memset((x), 0, sizeof(*(x))); \ 00262 (x)->dwSize = sizeof(*x); \ 00263 } while (0) 00264 00265 #define FE(x) { x, #x } 00266 #define GE(x) { &x, #x } 00267 00268 /* dwPatch from MIDILOCALE */ 00269 extern DWORD MIDILOCALE2Patch (LPMIDILOCALE pLocale); 00270 /* MIDILOCALE from dwPatch */ 00271 extern void Patch2MIDILOCALE (DWORD dwPatch, LPMIDILOCALE pLocale); 00272 00273 /* check whether the given DWORD is even (return 0) or odd (return 1) */ 00274 extern int even_or_odd (DWORD number); 00275 /* FOURCC to string conversion for debug messages */ 00276 extern const char *debugstr_fourcc (DWORD fourcc); 00277 /* returns name of given GUID */ 00278 extern const char *debugstr_dmguid (const GUID *id); 00279 /* dump whole DMUS_OBJECTDESC struct */ 00280 extern const char *debugstr_DMUS_OBJECTDESC (LPDMUS_OBJECTDESC pDesc); 00281 00282 #endif /* __WINE_DMUSIC_PRIVATE_H */ Generated on Mon May 28 2012 04:21:04 for ReactOS by
1.7.6.1
|