ReactOS  0.4.15-dev-1377-ga59cecd
dmusic_private.h
Go to the documentation of this file.
1 /*
2  * DirectMusic Private Include
3  *
4  * Copyright (C) 2003-2004 Rok Mandeljc
5  * Copyright (C) 2012 Christian Costa
6  *
7  * This program is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU Lesser General Public
9  * License as published by the Free Software Foundation; either
10  * version 2.1 of the License, or (at your option) any later version.
11  *
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 GNU
15  * Lesser General Public License for more details.
16  *
17  * You should have received a copy of the GNU Lesser General Public
18  * License along with this program; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
20  */
21 
22 #ifndef __WINE_DMUSIC_PRIVATE_H
23 #define __WINE_DMUSIC_PRIVATE_H
24 
25 #include <stdarg.h>
26 
27 #define COBJMACROS
28 #define NONAMELESSUNION
29 #define NONAMELESSSTRUCT
30 
31 #include "windef.h"
32 #include "winbase.h"
33 #include "winnt.h"
34 #include "wingdi.h"
35 #include "winuser.h"
36 #ifdef __REACTOS__
37 #include "winnls.h"
38 #endif
39 
40 #include "wine/debug.h"
41 #include "wine/list.h"
42 #include "winreg.h"
43 #include "objbase.h"
44 
45 #include "dmusici.h"
46 #include "dmusicf.h"
47 #include "dmusics.h"
48 #include "dmksctrl.h"
49 
50 /*****************************************************************************
51  * Interfaces
52  */
58 
60 
61 /*****************************************************************************
62  * Some stuff to make my life easier :=)
63  */
64 
65 /* some sort of aux. midi channel: big fake at the moment; accepts only priority
66  changes... more coming soon */
67 typedef struct DMUSIC_PRIVATE_MCHANNEL_ {
70 
71 /* some sort of aux. channel group: collection of 16 midi channels */
73  DMUSIC_PRIVATE_MCHANNEL channel[16]; /* 16 channels in a group */
75 
76 typedef struct port_info {
79  DMUS_PORTCAPS *port_caps, IDirectMusicPort **port);
81 } port_info;
82 
83 typedef struct instrument_region {
90 
91 typedef struct instrument_articulation {
95 
96 /*****************************************************************************
97  * ClassFactory
98  */
99 
100 /* CLSID */
103 
104 /* Internal */
109 
110 /*****************************************************************************
111  * IDirectMusic8Impl implementation structure
112  */
114  IDirectMusic8 IDirectMusic8_iface;
116  IDirectSound *dsound;
118  IDirectMusicPort **ports;
122 };
123 
124 /*****************************************************************************
125  * IDirectMusicBufferImpl implementation structure
126  */
128  /* IUnknown fields */
129  IDirectMusicBuffer IDirectMusicBuffer_iface;
131 
132  /* IDirectMusicBufferImpl fields */
138 };
139 
140 /*****************************************************************************
141  * IDirectMusicDownloadedInstrumentImpl implementation structure
142  */
144  /* IUnknown fields */
145  IDirectMusicDownloadedInstrument IDirectMusicDownloadedInstrument_iface;
147 
148  /* IDirectMusicDownloadedInstrumentImpl fields */
150  void *data;
151 };
152 
153 /*****************************************************************************
154  * IDirectMusicDownloadImpl implementation structure
155  */
157  /* IUnknown fields */
158  IDirectMusicDownload IDirectMusicDownload_iface;
160 
161  /* IDirectMusicDownloadImpl fields */
162 };
163 
166  DMUS_PORTCAPS *port_caps, IDirectMusicPort **port) DECLSPEC_HIDDEN;
168  DMUS_PORTCAPS *port_caps, IDirectMusicPort **port) DECLSPEC_HIDDEN;
170  DMUS_PORTCAPS *port_caps, IDirectMusicPort **port) DECLSPEC_HIDDEN;
171 
172 /*****************************************************************************
173  * IReferenceClockImpl implementation structure
174  */
176  /* IUnknown fields */
179 
180  /* IReferenceClockImpl fields */
183 };
184 
186  struct list entry; /* for listing elements */
187  IDirectMusicInstrument* pInstrument;
189 
190 typedef struct _DMUS_PRIVATE_POOLCUE {
191  struct list entry; /* for listing elements */
193 
194 /*****************************************************************************
195  * IDirectMusicInstrumentImpl implementation structure
196  */
198  /* IUnknown fields */
199  IDirectMusicInstrument IDirectMusicInstrument_iface;
201 
202  /* IDirectMusicInstrumentImpl fields */
203  LARGE_INTEGER liInstrumentPosition; /* offset in a stream where instrument chunk can be found */
204  ULONG length; /* Length of the instrument in the stream */
208  /* instrument data */
213 };
214 
215 static inline IDirectMusicInstrumentImpl *impl_from_IDirectMusicInstrument(IDirectMusicInstrument *iface)
216 {
217  return CONTAINING_RECORD(iface, IDirectMusicInstrumentImpl, IDirectMusicInstrument_iface);
218 }
219 
220 /* custom :) */
221 extern HRESULT IDirectMusicInstrumentImpl_CustomLoad(IDirectMusicInstrument *iface, IStream *stream) DECLSPEC_HIDDEN;
222 
223 /**********************************************************************
224  * Dll lifetime tracking declaration for dmusic.dll
225  */
227 static inline void DMUSIC_LockModule(void) { InterlockedIncrement( &DMUSIC_refCount ); }
229 
230 
231 /*****************************************************************************
232  * Misc.
233  */
234 void dmusic_remove_port(IDirectMusic8Impl *dmusic, IDirectMusicPort *port) DECLSPEC_HIDDEN;
235 
236 /* for simpler reading */
237 typedef struct _DMUS_PRIVATE_CHUNK {
238  FOURCC fccID; /* FOURCC ID of the chunk */
239  DWORD dwSize; /* size of the chunk */
241 
242 /* used for generic dumping (copied from ddraw) */
243 typedef struct {
244  DWORD val;
245  const char* name;
246 } flag_info;
247 
248 typedef struct {
249  const GUID *guid;
250  const char* name;
251 } guid_info;
252 
253 #define FE(x) { x, #x }
254 #define GE(x) { &x, #x }
255 
256 /* dwPatch from MIDILOCALE */
257 extern DWORD MIDILOCALE2Patch (const MIDILOCALE *pLocale) DECLSPEC_HIDDEN;
258 /* MIDILOCALE from dwPatch */
259 extern void Patch2MIDILOCALE (DWORD dwPatch, LPMIDILOCALE pLocale) DECLSPEC_HIDDEN;
260 
261 /* check whether the given DWORD is even (return 0) or odd (return 1) */
263 /* FOURCC to string conversion for debug messages */
264 extern const char *debugstr_fourcc (DWORD fourcc) DECLSPEC_HIDDEN;
265 /* returns name of given GUID */
266 extern const char *debugstr_dmguid (const GUID *id) DECLSPEC_HIDDEN;
267 /* Dump whole DMUS_OBJECTDESC struct */
269 /* Dump whole DMUS_PORTPARAMS struct */
271 
272 #endif /* __WINE_DMUSIC_PRIVATE_H */
LARGE_INTEGER liInstrumentPosition
#define HRESULT
Definition: msvc.h:7
const char * name
static IDirectMusicInstrumentImpl * impl_from_IDirectMusicInstrument(IDirectMusicInstrument *iface)
struct _DMUS_PRIVATE_POOLCUE * LPDMUS_PRIVATE_POOLCUE
REFERENCE_TIME start_time
struct DMUSIC_PRIVATE_MCHANNEL_ * LPDMUSIC_PRIVATE_MCHANNEL
struct DMUSIC_PRIVATE_CHANNEL_GROUP_ * LPDMUSIC_PRIVATE_CHANNEL_GROUP
HRESULT DMUSIC_CreateReferenceClockImpl(LPCGUID lpcGUID, LPVOID *ppobj, LPUNKNOWN pUnkOuter) DECLSPEC_HIDDEN
Definition: clock.c:121
HRESULT DMUSIC_CreateDirectMusicBufferImpl(LPDMUS_BUFFERDESC desc, LPVOID *ret_iface) DECLSPEC_HIDDEN
Definition: buffer.c:294
const char * debugstr_fourcc(DWORD fourcc) DECLSPEC_HIDDEN
Definition: dmusic_main.c:219
IDirectMusicInstrument IDirectMusicInstrument_iface
void dump_DMUS_OBJECTDESC(LPDMUS_OBJECTDESC desc) DECLSPEC_HIDDEN
Definition: dmusic_main.c:459
REFERENCE_TIME rtTime
IDirectMusicDownloadedInstrument IDirectMusicDownloadedInstrument_iface
struct _DMUS_PRIVATE_CHUNK * LPDMUS_PRIVATE_CHUNK
port_info * system_ports
static void DMUSIC_UnlockModule(void)
int even_or_odd(DWORD number) DECLSPEC_HIDDEN
Definition: dmusic_main.c:214
HRESULT synth_port_create(IDirectMusic8Impl *parent, DMUS_PORTPARAMS *port_params, DMUS_PORTCAPS *port_caps, IDirectMusicPort **port) DECLSPEC_HIDDEN
Definition: port.c:814
Definition: dls1.h:131
unsigned char * LPBYTE
Definition: typedefs.h:53
GLenum const GLfloat * params
Definition: glext.h:5645
unsigned int BOOL
Definition: ntddk_ex.h:94
long LONG
Definition: pedump.c:60
static size_t double number
Definition: printf.c:69
static LPUNKNOWN
Definition: ndr_ole.c:49
static const WCHAR desc[]
Definition: protectdata.c:36
IDirectMusicInstrument * pInstrument
HRESULT DMUSIC_CreateDirectMusicInstrumentImpl(LPCGUID lpcGUID, LPVOID *ppobj, LPUNKNOWN pUnkOuter) DECLSPEC_HIDDEN
Definition: instrument.c:123
static void DMUSIC_LockModule(void)
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560
GLuint GLfloat * val
Definition: glext.h:7180
void Patch2MIDILOCALE(DWORD dwPatch, LPMIDILOCALE pLocale) DECLSPEC_HIDDEN
Definition: dmusic_main.c:205
ULONG device
struct _DMUS_PRIVATE_CHUNK DMUS_PRIVATE_CHUNK
HRESULT DMUSIC_CreateDirectMusicDownloadImpl(LPCGUID lpcGUID, LPVOID *ppobj, LPUNKNOWN pUnkOuter) DECLSPEC_HIDDEN
struct _DMUS_PRIVATE_INSTRUMENT_ENTRY * LPDMUS_PRIVATE_INSTRUMENTENTRY
LONG DMUSIC_refCount DECLSPEC_HIDDEN
r parent
Definition: btrfs.c:2944
LONGLONG REFERENCE_TIME
Definition: dmusicks.h:9
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:79
struct instrument_region instrument_region
#define WINAPI
Definition: msvc.h:6
unsigned long DWORD
Definition: ntddk_ex.h:95
struct port_info port_info
Definition: dls1.h:139
HRESULT WINAPI DMUSIC_CreateDirectMusicImpl(LPCGUID lpcGUID, LPVOID *ppobj, LPUNKNOWN pUnkOuter) DECLSPEC_HIDDEN
Definition: dmusic.c:592
#define InterlockedDecrement
Definition: armddk.h:52
Definition: parse.h:22
void dump_DMUS_PORTPARAMS(LPDMUS_PORTPARAMS params) DECLSPEC_HIDDEN
Definition: dmusic_main.c:491
LONG DMUSIC_refCount
Definition: dmusic_main.c:42
Definition: _list.h:228
DMUSIC_PRIVATE_MCHANNEL channel[16]
const GUID * guid
DWORD FOURCC
Definition: dmdls.h:25
CONNECTIONLIST connections_list
instrument_articulation * articulations
IDirectSound * dsound
DMUS_PORTCAPS caps
void dmusic_remove_port(IDirectMusic8Impl *dmusic, IDirectMusicPort *port) DECLSPEC_HIDDEN
Definition: dmusic.c:300
struct DMUSIC_PRIVATE_CHANNEL_GROUP_ DMUSIC_PRIVATE_CHANNEL_GROUP
HRESULT midi_out_port_create(IDirectMusic8Impl *parent, DMUS_PORTPARAMS *port_params, DMUS_PORTCAPS *port_caps, IDirectMusicPort **port) DECLSPEC_HIDDEN
Definition: port.c:1201
#define InterlockedIncrement
Definition: armddk.h:53
HRESULT(* create)(IDirectMusic8Impl *parent, DMUS_PORTPARAMS *port_params, DMUS_PORTCAPS *port_caps, IDirectMusicPort **port)
IDirectMusicPort ** ports
IReferenceClock IReferenceClock_iface
IDirectMusicDownload IDirectMusicDownload_iface
IDirectMusicBuffer IDirectMusicBuffer_iface
DWORD MIDILOCALE2Patch(const MIDILOCALE *pLocale) DECLSPEC_HIDDEN
Definition: dmusic_main.c:195
struct _DMUS_PRIVATE_INSTRUMENT_ENTRY DMUS_PRIVATE_INSTRUMENTENTRY
instrument_region * regions
struct instrument_articulation instrument_articulation
unsigned int ULONG
Definition: retypes.h:1
IDirectMusic8 IDirectMusic8_iface
HRESULT IDirectMusicInstrumentImpl_CustomLoad(IDirectMusicInstrument *iface, IStream *stream) DECLSPEC_HIDDEN
Definition: instrument.c:291
struct _DMUS_PRIVATE_POOLCUE DMUS_PRIVATE_POOLCUE
DMUS_CLOCKINFO pClockInfo
struct list entry
USHORT port
Definition: uri.c:228
struct DMUSIC_PRIVATE_MCHANNEL_ DMUSIC_PRIVATE_MCHANNEL
IReferenceClock * master_clock
HRESULT WINAPI DMUSIC_CreateDirectMusicCollectionImpl(LPCGUID lpcGUID, LPVOID *ppobj, LPUNKNOWN pUnkOuter) DECLSPEC_HIDDEN
Definition: collection.c:530
const char * debugstr_dmguid(const GUID *id) DECLSPEC_HIDDEN
Definition: dmusic_main.c:237
#define DMUS_MAX_NAME
Definition: dmusici.h:245
WCHAR wszName[DMUS_MAX_NAME]
HRESULT midi_in_port_create(IDirectMusic8Impl *parent, DMUS_PORTPARAMS *port_params, DMUS_PORTCAPS *port_caps, IDirectMusicPort **port) DECLSPEC_HIDDEN
Definition: port.c:1209
GLuint const GLchar * name
Definition: glext.h:6031