ws2_32: Use assignment instead of memcpy to copy structs.
[wine] / dlls / dmime / dmime_private.h
1 /* DirectMusicInteractiveEngine Private Include
2  *
3  * Copyright (C) 2003-2004 Rok Mandeljc
4  *
5  * This program is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2.1 of the License, or (at your option) any later version.
9  *
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 GNU
13  * Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public
16  * License along with this program; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
18  */
19
20 #ifndef __WINE_DMIME_PRIVATE_H
21 #define __WINE_DMIME_PRIVATE_H
22
23 #include <stdio.h>
24 #include <stdarg.h>
25 #include <string.h>
26
27 #define COBJMACROS
28
29 #include "windef.h"
30 #include "winbase.h"
31 #include "winnt.h"
32 #include "wingdi.h"
33 #include "winuser.h"
34
35 #include "wine/debug.h"
36 #include "wine/list.h"
37 #include "wine/unicode.h"
38 #include "winreg.h"
39 #include "objbase.h"
40
41 #include "dmusici.h"
42 #include "dmusicf.h"
43 #include "dmusics.h"
44 #include "dmusicc.h"
45
46 /*****************************************************************************
47  * Interfaces
48  */
49 typedef struct IDirectMusicSegment8Impl IDirectMusicSegment8Impl;
50 typedef struct IDirectMusicSegmentState8Impl IDirectMusicSegmentState8Impl;
51 typedef struct IDirectMusicGraphImpl IDirectMusicGraphImpl;
52 typedef struct IDirectMusicAudioPathImpl IDirectMusicAudioPathImpl;
53
54 typedef struct IDirectMusicLyricsTrack IDirectMusicLyricsTrack;
55 typedef struct IDirectMusicMarkerTrack IDirectMusicMarkerTrack;
56 typedef struct IDirectMusicParamControlTrack IDirectMusicParamControlTrack;
57 typedef struct IDirectMusicSegTriggerTrack IDirectMusicSegTriggerTrack;
58 typedef struct IDirectMusicSeqTrack IDirectMusicSeqTrack;
59 typedef struct IDirectMusicSysExTrack IDirectMusicSysExTrack;
60 typedef struct IDirectMusicTempoTrack IDirectMusicTempoTrack;
61 typedef struct IDirectMusicTimeSigTrack IDirectMusicTimeSigTrack;
62 typedef struct IDirectMusicWaveTrack IDirectMusicWaveTrack;
63         
64 /*****************************************************************************
65  * ClassFactory
66  */
67 extern HRESULT WINAPI DMUSIC_CreateDirectMusicPerformanceImpl (LPCGUID lpcGUID, LPVOID *ppobj, LPUNKNOWN pUnkOuter) DECLSPEC_HIDDEN;
68 extern HRESULT WINAPI DMUSIC_CreateDirectMusicSegmentImpl (LPCGUID lpcGUID, LPVOID *ppobj, LPUNKNOWN pUnkOuter) DECLSPEC_HIDDEN;
69 extern HRESULT WINAPI DMUSIC_CreateDirectMusicSegmentStateImpl (LPCGUID lpcGUID, LPVOID *ppobj, LPUNKNOWN pUnkOuter) DECLSPEC_HIDDEN;
70 extern HRESULT WINAPI DMUSIC_CreateDirectMusicGraphImpl (LPCGUID lpcGUID, LPVOID *ppobj, LPUNKNOWN pUnkOuter) DECLSPEC_HIDDEN;
71 extern HRESULT WINAPI DMUSIC_CreateDirectMusicAudioPathImpl (LPCGUID lpcGUID, LPVOID *ppobj, LPUNKNOWN pUnkOuter) DECLSPEC_HIDDEN;
72
73 extern HRESULT WINAPI DMUSIC_CreateDirectMusicLyricsTrack (LPCGUID lpcGUID, LPVOID* ppobj, LPUNKNOWN pUnkOuter) DECLSPEC_HIDDEN;
74 extern HRESULT WINAPI DMUSIC_CreateDirectMusicMarkerTrack (LPCGUID lpcGUID, LPVOID* ppobj, LPUNKNOWN pUnkOuter) DECLSPEC_HIDDEN;
75 extern HRESULT WINAPI DMUSIC_CreateDirectMusicParamControlTrack (LPCGUID lpcGUID, LPVOID* ppobj, LPUNKNOWN pUnkOuter) DECLSPEC_HIDDEN;
76 extern HRESULT WINAPI DMUSIC_CreateDirectMusicSegTriggerTrack (LPCGUID lpcGUID, LPVOID* ppobj, LPUNKNOWN pUnkOuter) DECLSPEC_HIDDEN;
77 extern HRESULT WINAPI DMUSIC_CreateDirectMusicSeqTrack (LPCGUID lpcGUID, LPVOID* ppobj, LPUNKNOWN pUnkOuter) DECLSPEC_HIDDEN;
78 extern HRESULT WINAPI DMUSIC_CreateDirectMusicSysExTrack (LPCGUID lpcGUID, LPVOID* ppobj, LPUNKNOWN pUnkOuter) DECLSPEC_HIDDEN;
79 extern HRESULT WINAPI DMUSIC_CreateDirectMusicTempoTrack (LPCGUID lpcGUID, LPVOID* ppobj, LPUNKNOWN pUnkOuter) DECLSPEC_HIDDEN;
80 extern HRESULT WINAPI DMUSIC_CreateDirectMusicTimeSigTrack (LPCGUID lpcGUID, LPVOID* ppobj, LPUNKNOWN pUnkOuter) DECLSPEC_HIDDEN;
81 extern HRESULT WINAPI DMUSIC_CreateDirectMusicWaveTrack (LPCGUID lpcGUID, LPVOID* ppobj, LPUNKNOWN pUnkOuter) DECLSPEC_HIDDEN;
82
83
84 /*****************************************************************************
85  * Auxiliary definitions
86  */
87 typedef struct _DMUS_PRIVATE_SEGMENT_TRACK {
88   struct list entry; /* for listing elements */
89   DWORD dwGroupBits;
90   IDirectMusicTrack* pTrack;
91 } DMUS_PRIVATE_SEGMENT_TRACK, *LPDMUS_PRIVATE_SEGMENT_TRACK;
92
93 typedef struct _DMUS_PRIVATE_TEMPO_ITEM {
94   struct list entry; /* for listing elements */
95   DMUS_IO_TEMPO_ITEM item;
96 } DMUS_PRIVATE_TEMPO_ITEM, *LPDMUS_PRIVATE_TEMPO_ITEM;
97
98 typedef struct _DMUS_PRIVATE_SEGMENT_ITEM {
99   struct list entry; /* for listing elements */
100   DMUS_IO_SEGMENT_ITEM_HEADER header;
101   IDirectMusicObject* pObject;
102   WCHAR wszName[DMUS_MAX_NAME];
103 } DMUS_PRIVATE_SEGMENT_ITEM, *LPDMUS_PRIVATE_SEGMENT_ITEM;
104
105 typedef struct _DMUS_PRIVATE_GRAPH_TOOL {
106   struct list entry; /* for listing elements */
107   DWORD dwIndex;
108   IDirectMusicTool* pTool;
109 } DMUS_PRIVATE_GRAPH_TOOL, *LPDMUS_PRIVATE_GRAPH_TOOL;
110
111 typedef struct _DMUS_PRIVATE_TEMPO_PLAY_STATE {
112   DWORD dummy;
113 } DMUS_PRIVATE_TEMPO_PLAY_STATE, *LPDMUS_PRIVATE_TEMPO_PLAY_STATE;
114
115 /* some sort of aux. performance channel: as far as i can understand, these are 
116    used to represent a particular midi channel in particular group at particular
117    group; so all we need to do is to fill it with parent port, group and midi 
118    channel ? */
119 typedef struct DMUSIC_PRIVATE_PCHANNEL_ {
120         DWORD channel; /* map to this channel... */
121         DWORD group; /* ... in this group ... */
122         IDirectMusicPort *port; /* ... at this port */
123 } DMUSIC_PRIVATE_PCHANNEL, *LPDMUSIC_PRIVATE_PCHANNEL;
124
125 /*****************************************************************************
126  * IDirectMusicSegment8Impl implementation structure
127  */
128 struct IDirectMusicSegment8Impl {
129   /* IUnknown fields */
130   const IUnknownVtbl *UnknownVtbl;
131   const IDirectMusicSegment8Vtbl *SegmentVtbl;
132   const IDirectMusicObjectVtbl *ObjectVtbl;
133   const IPersistStreamVtbl *PersistStreamVtbl;
134   LONG           ref;
135
136   /* IDirectMusicSegment8Impl fields */
137   LPDMUS_OBJECTDESC      pDesc;
138   DMUS_IO_SEGMENT_HEADER header;
139   IDirectMusicGraph*     pGraph; 
140   struct list Tracks;
141 };
142
143 /*****************************************************************************
144  * IDirectMusicSegmentState8Impl implementation structure
145  */
146 struct IDirectMusicSegmentState8Impl {
147   /* IUnknown fields */
148   const IDirectMusicSegmentState8Vtbl *lpVtbl;
149   LONG           ref;
150
151   /* IDirectMusicSegmentState8Impl fields */
152 };
153
154 /*****************************************************************************
155  * IDirectMusicGraphImpl implementation structure
156  */
157 struct IDirectMusicGraphImpl {
158   /* IUnknown fields */
159   const IUnknownVtbl *UnknownVtbl;
160   const IDirectMusicGraphVtbl *GraphVtbl;
161   const IDirectMusicObjectVtbl *ObjectVtbl;
162   const IPersistStreamVtbl *PersistStreamVtbl;
163   LONG           ref;
164
165   /* IDirectMusicGraphImpl fields */
166   LPDMUS_OBJECTDESC pDesc;
167   WORD              num_tools;
168   struct list       Tools;
169 };
170
171 /*****************************************************************************
172  * IDirectMusicAudioPathImpl implementation structure
173  */
174 struct IDirectMusicAudioPathImpl {
175   /* IUnknown fields */
176   const IUnknownVtbl *UnknownVtbl;
177   const IDirectMusicAudioPathVtbl *AudioPathVtbl;
178   const IDirectMusicObjectVtbl *ObjectVtbl;
179   const IPersistStreamVtbl *PersistStreamVtbl;
180   LONG           ref;
181
182   /* IDirectMusicAudioPathImpl fields */
183   LPDMUS_OBJECTDESC pDesc;
184         
185   IDirectMusicPerformance8* pPerf;
186   IDirectMusicGraph*        pToolGraph;
187   IDirectSoundBuffer*       pDSBuffer;
188   IDirectSoundBuffer*       pPrimary;
189
190   BOOL fActive;
191 };
192
193 /*****************************************************************************
194  * IDirectMusicLyricsTrack implementation structure
195  */
196 struct IDirectMusicLyricsTrack
197 {
198   /* IUnknown fields */
199   const IUnknownVtbl *UnknownVtbl;
200   const IDirectMusicTrack8Vtbl *TrackVtbl;
201   const IPersistStreamVtbl *PersistStreamVtbl;
202   LONG           ref;
203
204   /* IDirectMusicLyricsTrack fields */
205   LPDMUS_OBJECTDESC pDesc;
206 };
207
208 /*****************************************************************************
209  * IDirectMusicMarkerTrack implementation structure
210  */
211 struct IDirectMusicMarkerTrack {
212   /* IUnknown fields */
213   const IUnknownVtbl *UnknownVtbl;
214   const IDirectMusicTrack8Vtbl *TrackVtbl;
215   const IPersistStreamVtbl *PersistStreamVtbl;
216   LONG           ref;
217
218   /* IDirectMusicMarkerTrack fields */
219   LPDMUS_OBJECTDESC pDesc;
220 };
221
222 /*****************************************************************************
223  * IDirectMusicParamControlTrack implementation structure
224  */
225 struct IDirectMusicParamControlTrack {
226   /* IUnknown fields */
227   const IUnknownVtbl *UnknownVtbl;
228   const IDirectMusicTrack8Vtbl *TrackVtbl;
229   const IPersistStreamVtbl *PersistStreamVtbl;
230   LONG           ref;
231
232   /* IDirectMusicParamControlTrack fields */
233   LPDMUS_OBJECTDESC pDesc;
234 };
235
236 /*****************************************************************************
237  * IDirectMusicSegTriggerTrack implementation structure
238  */
239 struct IDirectMusicSegTriggerTrack {
240   /* IUnknown fields */
241   const IUnknownVtbl *UnknownVtbl;
242   const IDirectMusicTrack8Vtbl *TrackVtbl;
243   const IPersistStreamVtbl *PersistStreamVtbl;
244   LONG           ref;
245
246   /* IDirectMusicSegTriggerTrack fields */
247   LPDMUS_OBJECTDESC pDesc;
248
249   struct list Items;
250 };
251
252 /*****************************************************************************
253  * IDirectMusicSeqTrack implementation structure
254  */
255 struct IDirectMusicSeqTrack {
256   /* IUnknown fields */
257   const IUnknownVtbl *UnknownVtbl;
258   const IDirectMusicTrack8Vtbl *TrackVtbl;
259   const IPersistStreamVtbl *PersistStreamVtbl;
260   LONG           ref;
261
262   /* IDirectMusicSeqTrack fields */
263   LPDMUS_OBJECTDESC pDesc;
264 };
265
266 /*****************************************************************************
267  * IDirectMusicSysExTrack implementation structure
268  */
269 struct IDirectMusicSysExTrack {
270   /* IUnknown fields */
271   const IUnknownVtbl *UnknownVtbl;
272   const IDirectMusicTrack8Vtbl *TrackVtbl;
273   const IPersistStreamVtbl *PersistStreamVtbl;
274   LONG           ref;
275
276   /* IDirectMusicSysExTrack fields */
277   LPDMUS_OBJECTDESC pDesc;
278 };
279
280 /*****************************************************************************
281  * IDirectMusicTempoTrack implementation structure
282  */
283 struct IDirectMusicTempoTrack {
284   /* IUnknown fields */
285   const IUnknownVtbl *UnknownVtbl;
286   const IDirectMusicTrack8Vtbl *TrackVtbl;
287   const IPersistStreamVtbl *PersistStreamVtbl;
288   LONG           ref;
289
290   /* IDirectMusicTempoTrack fields */
291   LPDMUS_OBJECTDESC pDesc;
292   BOOL enabled;
293   struct list Items;
294 };
295
296 /*****************************************************************************
297  * IDirectMusicTimeSigTrack implementation structure
298  */
299 struct IDirectMusicTimeSigTrack {
300   /* IUnknown fields */
301   const IUnknownVtbl *UnknownVtbl;
302   const IDirectMusicTrack8Vtbl *TrackVtbl;
303   const IPersistStreamVtbl *PersistStreamVtbl;
304   LONG           ref;
305
306   /* IDirectMusicTimeSigTrack fields */
307   LPDMUS_OBJECTDESC pDesc;
308 };
309
310 /*****************************************************************************
311  * IDirectMusicWaveTrack implementation structure
312  */
313 struct IDirectMusicWaveTrack {
314   /* IUnknown fields */
315   const IUnknownVtbl *UnknownVtbl;
316   const IDirectMusicTrack8Vtbl *TrackVtbl;
317   const IPersistStreamVtbl *PersistStreamVtbl;
318   LONG           ref;
319
320   /* IDirectMusicWaveTrack fields */
321   LPDMUS_OBJECTDESC pDesc;
322 };
323
324 /**********************************************************************
325  * Dll lifetime tracking declaration for dmime.dll
326  */
327 extern LONG DMIME_refCount DECLSPEC_HIDDEN;
328 static inline void DMIME_LockModule(void) { InterlockedIncrement( &DMIME_refCount ); }
329 static inline void DMIME_UnlockModule(void) { InterlockedDecrement( &DMIME_refCount ); }
330
331 /*****************************************************************************
332  * Misc.
333  */
334
335 #include "dmutils.h"
336
337 #endif  /* __WINE_DMIME_PRIVATE_H */