ReactOS 0.4.16-dev-338-g34e76ad
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 */
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
76typedef struct port_info {
79 DMUS_PORTCAPS *port_caps, IDirectMusicPort **port);
82
83typedef struct instrument_region {
90
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
190typedef 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
215static inline IDirectMusicInstrumentImpl *impl_from_IDirectMusicInstrument(IDirectMusicInstrument *iface)
216{
217 return CONTAINING_RECORD(iface, IDirectMusicInstrumentImpl, IDirectMusicInstrument_iface);
218}
219
220/* custom :) */
221extern HRESULT IDirectMusicInstrumentImpl_CustomLoad(IDirectMusicInstrument *iface, IStream *stream) DECLSPEC_HIDDEN;
222
223/**********************************************************************
224 * Dll lifetime tracking declaration for dmusic.dll
225 */
229
230
231/*****************************************************************************
232 * Misc.
233 */
234void dmusic_remove_port(IDirectMusic8Impl *dmusic, IDirectMusicPort *port) DECLSPEC_HIDDEN;
235
236/* for simpler reading */
237typedef 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) */
243typedef struct {
244 DWORD val;
245 const char* name;
246} flag_info;
247
248typedef 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 */
257extern DWORD MIDILOCALE2Patch (const MIDILOCALE *pLocale) DECLSPEC_HIDDEN;
258/* MIDILOCALE from dwPatch */
259extern 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 */
264extern const char *debugstr_fourcc (DWORD fourcc) DECLSPEC_HIDDEN;
265/* returns name of given GUID */
266extern 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 */
#define InterlockedIncrement
Definition: armddk.h:53
#define InterlockedDecrement
Definition: armddk.h:52
Definition: list.h:37
USHORT port
Definition: uri.c:228
DWORD FOURCC
Definition: dmdls.h:25
LONG DMUSIC_refCount
Definition: dmusic_main.c:42
void dump_DMUS_OBJECTDESC(LPDMUS_OBJECTDESC desc) DECLSPEC_HIDDEN
Definition: dmusic_main.c:459
static void DMUSIC_UnlockModule(void)
void Patch2MIDILOCALE(DWORD dwPatch, LPMIDILOCALE pLocale) DECLSPEC_HIDDEN
Definition: dmusic_main.c:205
struct _DMUS_PRIVATE_INSTRUMENT_ENTRY * LPDMUS_PRIVATE_INSTRUMENTENTRY
struct _DMUS_PRIVATE_CHUNK * LPDMUS_PRIVATE_CHUNK
HRESULT DMUSIC_CreateDirectMusicBufferImpl(LPDMUS_BUFFERDESC desc, LPVOID *ret_iface) DECLSPEC_HIDDEN
Definition: buffer.c:294
struct DMUSIC_PRIVATE_CHANNEL_GROUP_ * LPDMUSIC_PRIVATE_CHANNEL_GROUP
const char * debugstr_fourcc(DWORD fourcc) DECLSPEC_HIDDEN
Definition: dmusic_main.c:219
struct DMUSIC_PRIVATE_CHANNEL_GROUP_ DMUSIC_PRIVATE_CHANNEL_GROUP
HRESULT WINAPI DMUSIC_CreateDirectMusicImpl(LPCGUID lpcGUID, LPVOID *ppobj, LPUNKNOWN pUnkOuter) DECLSPEC_HIDDEN
Definition: dmusic.c:592
int even_or_odd(DWORD number) DECLSPEC_HIDDEN
Definition: dmusic_main.c:214
static IDirectMusicInstrumentImpl * impl_from_IDirectMusicInstrument(IDirectMusicInstrument *iface)
const char * debugstr_dmguid(const GUID *id) DECLSPEC_HIDDEN
Definition: dmusic_main.c:237
static void DMUSIC_LockModule(void)
struct _DMUS_PRIVATE_POOLCUE * LPDMUS_PRIVATE_POOLCUE
void dmusic_remove_port(IDirectMusic8Impl *dmusic, IDirectMusicPort *port) DECLSPEC_HIDDEN
Definition: dmusic.c:300
LONG DMUSIC_refCount DECLSPEC_HIDDEN
struct _DMUS_PRIVATE_POOLCUE DMUS_PRIVATE_POOLCUE
struct _DMUS_PRIVATE_CHUNK DMUS_PRIVATE_CHUNK
HRESULT DMUSIC_CreateDirectMusicInstrumentImpl(LPCGUID lpcGUID, LPVOID *ppobj, LPUNKNOWN pUnkOuter) DECLSPEC_HIDDEN
Definition: instrument.c:123
struct DMUSIC_PRIVATE_MCHANNEL_ * LPDMUSIC_PRIVATE_MCHANNEL
HRESULT DMUSIC_CreateReferenceClockImpl(LPCGUID lpcGUID, LPVOID *ppobj, LPUNKNOWN pUnkOuter) DECLSPEC_HIDDEN
Definition: clock.c:121
HRESULT DMUSIC_CreateDirectMusicDownloadImpl(LPCGUID lpcGUID, LPVOID *ppobj, LPUNKNOWN pUnkOuter) DECLSPEC_HIDDEN
HRESULT midi_in_port_create(IDirectMusic8Impl *parent, DMUS_PORTPARAMS *port_params, DMUS_PORTCAPS *port_caps, IDirectMusicPort **port) DECLSPEC_HIDDEN
Definition: port.c:1209
HRESULT WINAPI DMUSIC_CreateDirectMusicCollectionImpl(LPCGUID lpcGUID, LPVOID *ppobj, LPUNKNOWN pUnkOuter) DECLSPEC_HIDDEN
Definition: collection.c:530
HRESULT midi_out_port_create(IDirectMusic8Impl *parent, DMUS_PORTPARAMS *port_params, DMUS_PORTCAPS *port_caps, IDirectMusicPort **port) DECLSPEC_HIDDEN
Definition: port.c:1201
struct _DMUS_PRIVATE_INSTRUMENT_ENTRY DMUS_PRIVATE_INSTRUMENTENTRY
HRESULT IDirectMusicInstrumentImpl_CustomLoad(IDirectMusicInstrument *iface, IStream *stream) DECLSPEC_HIDDEN
Definition: instrument.c:291
HRESULT synth_port_create(IDirectMusic8Impl *parent, DMUS_PORTPARAMS *port_params, DMUS_PORTCAPS *port_caps, IDirectMusicPort **port) DECLSPEC_HIDDEN
Definition: port.c:814
DWORD MIDILOCALE2Patch(const MIDILOCALE *pLocale) DECLSPEC_HIDDEN
Definition: dmusic_main.c:195
struct DMUSIC_PRIVATE_MCHANNEL_ DMUSIC_PRIVATE_MCHANNEL
void dump_DMUS_PORTPARAMS(LPDMUS_PORTPARAMS params) DECLSPEC_HIDDEN
Definition: dmusic_main.c:491
#define DMUS_MAX_NAME
Definition: dmusici.h:245
LONGLONG REFERENCE_TIME
Definition: dmusicks.h:9
r parent
Definition: btrfs.c:3010
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
GLenum const GLfloat * params
Definition: glext.h:5645
GLuint GLfloat * val
Definition: glext.h:7180
static const WCHAR desc[]
Definition: protectdata.c:36
static unsigned int number
Definition: dsound.c:1479
static LPUNKNOWN
Definition: ndr_ole.c:49
long LONG
Definition: pedump.c:60
DMUSIC_PRIVATE_MCHANNEL channel[16]
IReferenceClock * master_clock
IDirectMusicPort ** ports
IDirectSound * dsound
IDirectMusic8 IDirectMusic8_iface
port_info * system_ports
IDirectMusicBuffer IDirectMusicBuffer_iface
REFERENCE_TIME start_time
IDirectMusicDownload IDirectMusicDownload_iface
IDirectMusicDownloadedInstrument IDirectMusicDownloadedInstrument_iface
IDirectMusicInstrument IDirectMusicInstrument_iface
LARGE_INTEGER liInstrumentPosition
WCHAR wszName[DMUS_MAX_NAME]
instrument_articulation * articulations
instrument_region * regions
DMUS_CLOCKINFO pClockInfo
REFERENCE_TIME rtTime
IReferenceClock IReferenceClock_iface
struct list entry
IDirectMusicInstrument * pInstrument
Definition: dls1.h:132
Definition: dls1.h:140
const GUID * guid
const char * name
CONNECTIONLIST connections_list
Definition: name.c:39
ULONG device
DMUS_PORTCAPS caps
HRESULT(* create)(IDirectMusic8Impl *parent, DMUS_PORTPARAMS *port_params, DMUS_PORTCAPS *port_caps, IDirectMusicPort **port)
Definition: parse.h:23
unsigned char * LPBYTE
Definition: typedefs.h:53
#define CONTAINING_RECORD(address, type, field)
Definition: typedefs.h:260
uint32_t ULONG
Definition: typedefs.h:59
#define HRESULT
Definition: msvc.h:7
#define WINAPI
Definition: msvc.h:6
__wchar_t WCHAR
Definition: xmlstorage.h:180