dmime_private.h 12.9 KB
Newer Older
1 2
/* DirectMusicInteractiveEngine Private Include
 *
3
 * Copyright (C) 2003-2004 Rok Mandeljc
4
 *
5 6 7 8
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
9 10 11
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
14
 *
15 16 17
 * You should have received a copy of the GNU Lesser General Public
 * License along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
18 19 20 21 22
 */

#ifndef __WINE_DMIME_PRIVATE_H
#define __WINE_DMIME_PRIVATE_H

23
#include <stdio.h>
24
#include <stdarg.h>
25
#include <string.h>
26

27 28
#define COBJMACROS

29 30 31
#include "windef.h"
#include "winbase.h"
#include "winnt.h"
32
#include "wingdi.h"
33 34 35 36 37 38
#include "winuser.h"

#include "wine/debug.h"
#include "wine/list.h"
#include "wine/unicode.h"
#include "winreg.h"
39
#include "objbase.h"
40

41 42
#include "dmusici.h"
#include "dmusicf.h"
43
#include "dmusics.h"
44
#include "dmusicc.h"
45 46 47 48 49 50 51 52 53 54

/*****************************************************************************
 * Interfaces
 */
typedef struct IDirectMusicPerformance8Impl IDirectMusicPerformance8Impl;
typedef struct IDirectMusicSegment8Impl IDirectMusicSegment8Impl;
typedef struct IDirectMusicSegmentState8Impl IDirectMusicSegmentState8Impl;
typedef struct IDirectMusicGraphImpl IDirectMusicGraphImpl;
typedef struct IDirectMusicAudioPathImpl IDirectMusicAudioPathImpl;

55 56 57 58 59 60 61 62 63 64
typedef struct IDirectMusicLyricsTrack IDirectMusicLyricsTrack;
typedef struct IDirectMusicMarkerTrack IDirectMusicMarkerTrack;
typedef struct IDirectMusicParamControlTrack IDirectMusicParamControlTrack;
typedef struct IDirectMusicSegTriggerTrack IDirectMusicSegTriggerTrack;
typedef struct IDirectMusicSeqTrack IDirectMusicSeqTrack;
typedef struct IDirectMusicSysExTrack IDirectMusicSysExTrack;
typedef struct IDirectMusicTempoTrack IDirectMusicTempoTrack;
typedef struct IDirectMusicTimeSigTrack IDirectMusicTimeSigTrack;
typedef struct IDirectMusicWaveTrack IDirectMusicWaveTrack;
	
65 66 67
/*****************************************************************************
 * ClassFactory
 */
68 69 70 71 72 73 74 75 76 77 78 79 80 81 82
extern HRESULT WINAPI DMUSIC_CreateDirectMusicPerformanceImpl (LPCGUID lpcGUID, LPVOID *ppobj, LPUNKNOWN pUnkOuter) DECLSPEC_HIDDEN;
extern HRESULT WINAPI DMUSIC_CreateDirectMusicSegmentImpl (LPCGUID lpcGUID, LPVOID *ppobj, LPUNKNOWN pUnkOuter) DECLSPEC_HIDDEN;
extern HRESULT WINAPI DMUSIC_CreateDirectMusicSegmentStateImpl (LPCGUID lpcGUID, LPVOID *ppobj, LPUNKNOWN pUnkOuter) DECLSPEC_HIDDEN;
extern HRESULT WINAPI DMUSIC_CreateDirectMusicGraphImpl (LPCGUID lpcGUID, LPVOID *ppobj, LPUNKNOWN pUnkOuter) DECLSPEC_HIDDEN;
extern HRESULT WINAPI DMUSIC_CreateDirectMusicAudioPathImpl (LPCGUID lpcGUID, LPVOID *ppobj, LPUNKNOWN pUnkOuter) DECLSPEC_HIDDEN;

extern HRESULT WINAPI DMUSIC_CreateDirectMusicLyricsTrack (LPCGUID lpcGUID, LPVOID* ppobj, LPUNKNOWN pUnkOuter) DECLSPEC_HIDDEN;
extern HRESULT WINAPI DMUSIC_CreateDirectMusicMarkerTrack (LPCGUID lpcGUID, LPVOID* ppobj, LPUNKNOWN pUnkOuter) DECLSPEC_HIDDEN;
extern HRESULT WINAPI DMUSIC_CreateDirectMusicParamControlTrack (LPCGUID lpcGUID, LPVOID* ppobj, LPUNKNOWN pUnkOuter) DECLSPEC_HIDDEN;
extern HRESULT WINAPI DMUSIC_CreateDirectMusicSegTriggerTrack (LPCGUID lpcGUID, LPVOID* ppobj, LPUNKNOWN pUnkOuter) DECLSPEC_HIDDEN;
extern HRESULT WINAPI DMUSIC_CreateDirectMusicSeqTrack (LPCGUID lpcGUID, LPVOID* ppobj, LPUNKNOWN pUnkOuter) DECLSPEC_HIDDEN;
extern HRESULT WINAPI DMUSIC_CreateDirectMusicSysExTrack (LPCGUID lpcGUID, LPVOID* ppobj, LPUNKNOWN pUnkOuter) DECLSPEC_HIDDEN;
extern HRESULT WINAPI DMUSIC_CreateDirectMusicTempoTrack (LPCGUID lpcGUID, LPVOID* ppobj, LPUNKNOWN pUnkOuter) DECLSPEC_HIDDEN;
extern HRESULT WINAPI DMUSIC_CreateDirectMusicTimeSigTrack (LPCGUID lpcGUID, LPVOID* ppobj, LPUNKNOWN pUnkOuter) DECLSPEC_HIDDEN;
extern HRESULT WINAPI DMUSIC_CreateDirectMusicWaveTrack (LPCGUID lpcGUID, LPVOID* ppobj, LPUNKNOWN pUnkOuter) DECLSPEC_HIDDEN;
83

84

85 86 87 88 89 90 91 92 93
/*****************************************************************************
 * Auxiliary definitions
 */
typedef struct _DMUS_PRIVATE_SEGMENT_TRACK {
  struct list entry; /* for listing elements */
  DWORD dwGroupBits;
  IDirectMusicTrack* pTrack;
} DMUS_PRIVATE_SEGMENT_TRACK, *LPDMUS_PRIVATE_SEGMENT_TRACK;

94 95 96 97 98
typedef struct _DMUS_PRIVATE_TEMPO_ITEM {
  struct list entry; /* for listing elements */
  DMUS_IO_TEMPO_ITEM item;
} DMUS_PRIVATE_TEMPO_ITEM, *LPDMUS_PRIVATE_TEMPO_ITEM;

99 100 101 102 103 104 105
typedef struct _DMUS_PRIVATE_SEGMENT_ITEM {
  struct list entry; /* for listing elements */
  DMUS_IO_SEGMENT_ITEM_HEADER header;
  IDirectMusicObject* pObject;
  WCHAR wszName[DMUS_MAX_NAME];
} DMUS_PRIVATE_SEGMENT_ITEM, *LPDMUS_PRIVATE_SEGMENT_ITEM;

106 107 108 109 110 111
typedef struct _DMUS_PRIVATE_GRAPH_TOOL {
  struct list entry; /* for listing elements */
  DWORD dwIndex;
  IDirectMusicTool* pTool;
} DMUS_PRIVATE_GRAPH_TOOL, *LPDMUS_PRIVATE_GRAPH_TOOL;

112 113 114
typedef struct _DMUS_PRIVATE_TEMPO_PLAY_STATE {
  DWORD dummy;
} DMUS_PRIVATE_TEMPO_PLAY_STATE, *LPDMUS_PRIVATE_TEMPO_PLAY_STATE;
115

116 117 118 119
/* some sort of aux. performance channel: as far as i can understand, these are 
   used to represent a particular midi channel in particular group at particular
   group; so all we need to do is to fill it with parent port, group and midi 
   channel ? */
120
typedef struct DMUSIC_PRIVATE_PCHANNEL_ {
121 122 123 124 125
	DWORD channel; /* map to this channel... */
	DWORD group; /* ... in this group ... */
	IDirectMusicPort *port; /* ... at this port */
} DMUSIC_PRIVATE_PCHANNEL, *LPDMUSIC_PRIVATE_PCHANNEL;

126 127 128
/*****************************************************************************
 * IDirectMusicPerformance8Impl implementation structure
 */
129
struct IDirectMusicPerformance8Impl {
130
  /* IUnknown fields */
131
  const IDirectMusicPerformance8Vtbl *lpVtbl;
132
  LONG                   ref;
133 134 135 136 137 138 139 140 141 142 143 144 145 146

  /* IDirectMusicPerformanceImpl fields */
  IDirectMusic8*         pDirectMusic;
  IDirectSound*          pDirectSound;
  IDirectMusicGraph*     pToolGraph;
  DMUS_AUDIOPARAMS       pParams;

  /* global parameters */
  BOOL  fAutoDownload;
  char  cMasterGrooveLevel;
  float fMasterTempo;
  long  lMasterVolume;
	
  /* performance channels */
147
  DMUSIC_PRIVATE_PCHANNEL PChannel[32];
148 149 150

   /* IDirectMusicPerformance8Impl fields */
  IDirectMusicAudioPath* pDefaultPath;
151 152
  HANDLE hNotification;
  REFERENCE_TIME rtMinimum;
153

154 155 156
  REFERENCE_TIME rtLatencyTime;
  DWORD dwBumperLength;
  DWORD dwPrepareTime;
157 158
  /** Message Processing */
  HANDLE         procThread;
159
  DWORD          procThreadId;
160 161
  REFERENCE_TIME procThreadStartTime;
  BOOL           procThreadTicStarted;
162 163 164
  CRITICAL_SECTION safe;
  struct DMUS_PMSGItem* head; 
  struct DMUS_PMSGItem* imm_head; 
165 166 167 168 169
};

/*****************************************************************************
 * IDirectMusicSegment8Impl implementation structure
 */
170
struct IDirectMusicSegment8Impl {
171
  /* IUnknown fields */
172 173 174 175
  const IUnknownVtbl *UnknownVtbl;
  const IDirectMusicSegment8Vtbl *SegmentVtbl;
  const IDirectMusicObjectVtbl *ObjectVtbl;
  const IPersistStreamVtbl *PersistStreamVtbl;
176
  LONG           ref;
177 178

  /* IDirectMusicSegment8Impl fields */
179 180
  LPDMUS_OBJECTDESC      pDesc;
  DMUS_IO_SEGMENT_HEADER header;
181 182
  IDirectMusicGraph*     pGraph; 
  struct list Tracks;
183 184 185 186 187
};

/*****************************************************************************
 * IDirectMusicSegmentState8Impl implementation structure
 */
188
struct IDirectMusicSegmentState8Impl {
189
  /* IUnknown fields */
190
  const IDirectMusicSegmentState8Vtbl *lpVtbl;
191
  LONG           ref;
192 193 194 195 196 197 198

  /* IDirectMusicSegmentState8Impl fields */
};

/*****************************************************************************
 * IDirectMusicGraphImpl implementation structure
 */
199
struct IDirectMusicGraphImpl {
200
  /* IUnknown fields */
201 202 203 204
  const IUnknownVtbl *UnknownVtbl;
  const IDirectMusicGraphVtbl *GraphVtbl;
  const IDirectMusicObjectVtbl *ObjectVtbl;
  const IPersistStreamVtbl *PersistStreamVtbl;
205
  LONG           ref;
206 207

  /* IDirectMusicGraphImpl fields */
208
  LPDMUS_OBJECTDESC pDesc;
209 210
  WORD              num_tools;
  struct list       Tools;
211 212 213 214 215
};

/*****************************************************************************
 * IDirectMusicAudioPathImpl implementation structure
 */
216
struct IDirectMusicAudioPathImpl {
217
  /* IUnknown fields */
218 219 220 221
  const IUnknownVtbl *UnknownVtbl;
  const IDirectMusicAudioPathVtbl *AudioPathVtbl;
  const IDirectMusicObjectVtbl *ObjectVtbl;
  const IPersistStreamVtbl *PersistStreamVtbl;
222
  LONG           ref;
223 224

  /* IDirectMusicAudioPathImpl fields */
225
  LPDMUS_OBJECTDESC pDesc;
226
	
227 228 229 230
  IDirectMusicPerformance8* pPerf;
  IDirectMusicGraph*        pToolGraph;
  IDirectSoundBuffer*       pDSBuffer;
  IDirectSoundBuffer*       pPrimary;
231 232

  BOOL fActive;
233 234
};

235 236 237 238
/*****************************************************************************
 * IDirectMusicLyricsTrack implementation structure
 */
struct IDirectMusicLyricsTrack
239 240
{
  /* IUnknown fields */
241 242 243
  const IUnknownVtbl *UnknownVtbl;
  const IDirectMusicTrack8Vtbl *TrackVtbl;
  const IPersistStreamVtbl *PersistStreamVtbl;
244
  LONG           ref;
245

246
  /* IDirectMusicLyricsTrack fields */
247
  LPDMUS_OBJECTDESC pDesc;
248 249
};

250 251 252
/*****************************************************************************
 * IDirectMusicMarkerTrack implementation structure
 */
253
struct IDirectMusicMarkerTrack {
254
  /* IUnknown fields */
255 256 257
  const IUnknownVtbl *UnknownVtbl;
  const IDirectMusicTrack8Vtbl *TrackVtbl;
  const IPersistStreamVtbl *PersistStreamVtbl;
258
  LONG           ref;
259 260

  /* IDirectMusicMarkerTrack fields */
261
  LPDMUS_OBJECTDESC pDesc;
262 263 264 265 266
};

/*****************************************************************************
 * IDirectMusicParamControlTrack implementation structure
 */
267
struct IDirectMusicParamControlTrack {
268
  /* IUnknown fields */
269 270 271
  const IUnknownVtbl *UnknownVtbl;
  const IDirectMusicTrack8Vtbl *TrackVtbl;
  const IPersistStreamVtbl *PersistStreamVtbl;
272
  LONG           ref;
273 274

  /* IDirectMusicParamControlTrack fields */
275
  LPDMUS_OBJECTDESC pDesc;
276 277 278 279 280
};

/*****************************************************************************
 * IDirectMusicSegTriggerTrack implementation structure
 */
281
struct IDirectMusicSegTriggerTrack {
282
  /* IUnknown fields */
283 284 285
  const IUnknownVtbl *UnknownVtbl;
  const IDirectMusicTrack8Vtbl *TrackVtbl;
  const IPersistStreamVtbl *PersistStreamVtbl;
286
  LONG           ref;
287 288

  /* IDirectMusicSegTriggerTrack fields */
289
  LPDMUS_OBJECTDESC pDesc;
290 291

  struct list Items;
292 293 294 295 296
};

/*****************************************************************************
 * IDirectMusicSeqTrack implementation structure
 */
297
struct IDirectMusicSeqTrack {
298
  /* IUnknown fields */
299 300 301
  const IUnknownVtbl *UnknownVtbl;
  const IDirectMusicTrack8Vtbl *TrackVtbl;
  const IPersistStreamVtbl *PersistStreamVtbl;
302
  LONG           ref;
303 304

  /* IDirectMusicSeqTrack fields */
305
  LPDMUS_OBJECTDESC pDesc;
306 307 308 309 310
};

/*****************************************************************************
 * IDirectMusicSysExTrack implementation structure
 */
311
struct IDirectMusicSysExTrack {
312
  /* IUnknown fields */
313 314 315
  const IUnknownVtbl *UnknownVtbl;
  const IDirectMusicTrack8Vtbl *TrackVtbl;
  const IPersistStreamVtbl *PersistStreamVtbl;
316
  LONG           ref;
317 318

  /* IDirectMusicSysExTrack fields */
319
  LPDMUS_OBJECTDESC pDesc;
320 321 322 323 324
};

/*****************************************************************************
 * IDirectMusicTempoTrack implementation structure
 */
325
struct IDirectMusicTempoTrack {
326
  /* IUnknown fields */
327 328 329
  const IUnknownVtbl *UnknownVtbl;
  const IDirectMusicTrack8Vtbl *TrackVtbl;
  const IPersistStreamVtbl *PersistStreamVtbl;
330
  LONG           ref;
331 332

  /* IDirectMusicTempoTrack fields */
333
  LPDMUS_OBJECTDESC pDesc;
334 335
  BOOL enabled;
  struct list Items;
336 337 338 339 340
};

/*****************************************************************************
 * IDirectMusicTimeSigTrack implementation structure
 */
341
struct IDirectMusicTimeSigTrack {
342
  /* IUnknown fields */
343 344 345
  const IUnknownVtbl *UnknownVtbl;
  const IDirectMusicTrack8Vtbl *TrackVtbl;
  const IPersistStreamVtbl *PersistStreamVtbl;
346
  LONG           ref;
347 348

  /* IDirectMusicTimeSigTrack fields */
349
  LPDMUS_OBJECTDESC pDesc;
350 351 352
};

/*****************************************************************************
353
 * IDirectMusicWaveTrack implementation structure
354
 */
355
struct IDirectMusicWaveTrack {
356
  /* IUnknown fields */
357 358 359
  const IUnknownVtbl *UnknownVtbl;
  const IDirectMusicTrack8Vtbl *TrackVtbl;
  const IPersistStreamVtbl *PersistStreamVtbl;
360
  LONG           ref;
361

362 363
  /* IDirectMusicWaveTrack fields */
  LPDMUS_OBJECTDESC pDesc;
364 365
};

366 367 368
/**********************************************************************
 * Dll lifetime tracking declaration for dmime.dll
 */
369
extern LONG DMIME_refCount DECLSPEC_HIDDEN;
370 371
static inline void DMIME_LockModule(void) { InterlockedIncrement( &DMIME_refCount ); }
static inline void DMIME_UnlockModule(void) { InterlockedDecrement( &DMIME_refCount ); }
372 373

/*****************************************************************************
374
 * Misc.
375
 */
376 377

#include "dmutils.h"
378

379
#endif	/* __WINE_DMIME_PRIVATE_H */