2003-03-21 01:42:38 +01:00
|
|
|
/* DirectMusic Private Include
|
|
|
|
*
|
2004-01-20 01:21:40 +01:00
|
|
|
* Copyright (C) 2003-2004 Rok Mandeljc
|
2003-03-21 01:42:38 +01:00
|
|
|
*
|
2007-05-30 12:54:07 +02:00
|
|
|
* 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.
|
2003-03-21 01:42:38 +01:00
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
2007-05-30 12:54:07 +02:00
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
2003-03-21 01:42:38 +01:00
|
|
|
*
|
2007-05-30 12:54:07 +02:00
|
|
|
* 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
|
2003-03-21 01:42:38 +01:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __WINE_DMUSIC_PRIVATE_H
|
|
|
|
#define __WINE_DMUSIC_PRIVATE_H
|
|
|
|
|
2003-09-06 01:08:26 +02:00
|
|
|
#include <stdarg.h>
|
|
|
|
|
2004-08-11 21:43:45 +02:00
|
|
|
#define COBJMACROS
|
|
|
|
|
2003-03-21 01:42:38 +01:00
|
|
|
#include "windef.h"
|
|
|
|
#include "winbase.h"
|
|
|
|
#include "winnt.h"
|
2003-09-06 01:08:26 +02:00
|
|
|
#include "wingdi.h"
|
2004-01-20 01:21:40 +01:00
|
|
|
#include "winuser.h"
|
|
|
|
|
|
|
|
#include "wine/debug.h"
|
|
|
|
#include "wine/list.h"
|
|
|
|
#include "wine/unicode.h"
|
|
|
|
#include "winreg.h"
|
2004-08-22 23:38:46 +02:00
|
|
|
#include "objbase.h"
|
2004-01-20 01:21:40 +01:00
|
|
|
|
2003-04-08 23:42:00 +02:00
|
|
|
#include "dmusici.h"
|
|
|
|
#include "dmusicf.h"
|
2004-01-20 01:21:40 +01:00
|
|
|
#include "dmusics.h"
|
2003-03-21 01:42:38 +01:00
|
|
|
|
|
|
|
/*****************************************************************************
|
|
|
|
* Interfaces
|
|
|
|
*/
|
|
|
|
typedef struct IDirectMusic8Impl IDirectMusic8Impl;
|
|
|
|
typedef struct IDirectMusicBufferImpl IDirectMusicBufferImpl;
|
|
|
|
typedef struct IDirectMusicDownloadedInstrumentImpl IDirectMusicDownloadedInstrumentImpl;
|
|
|
|
typedef struct IDirectMusicDownloadImpl IDirectMusicDownloadImpl;
|
|
|
|
typedef struct IDirectMusicPortDownloadImpl IDirectMusicPortDownloadImpl;
|
|
|
|
typedef struct IDirectMusicPortImpl IDirectMusicPortImpl;
|
|
|
|
typedef struct IDirectMusicThruImpl IDirectMusicThruImpl;
|
2003-07-22 00:10:14 +02:00
|
|
|
typedef struct IReferenceClockImpl IReferenceClockImpl;
|
2003-04-08 23:42:00 +02:00
|
|
|
|
2004-01-20 01:21:40 +01:00
|
|
|
typedef struct IDirectMusicCollectionImpl IDirectMusicCollectionImpl;
|
|
|
|
typedef struct IDirectMusicInstrumentImpl IDirectMusicInstrumentImpl;
|
|
|
|
|
2003-08-23 01:53:27 +02:00
|
|
|
|
2003-06-07 02:39:18 +02:00
|
|
|
/*****************************************************************************
|
|
|
|
* Some stuff to make my life easier :=)
|
|
|
|
*/
|
|
|
|
|
|
|
|
/* some sort of aux. midi channel: big fake at the moment; accepts only priority
|
|
|
|
changes... more coming soon */
|
2004-01-20 01:21:40 +01:00
|
|
|
typedef struct DMUSIC_PRIVATE_MCHANNEL_ {
|
2003-06-07 02:39:18 +02:00
|
|
|
DWORD priority;
|
|
|
|
} DMUSIC_PRIVATE_MCHANNEL, *LPDMUSIC_PRIVATE_MCHANNEL;
|
|
|
|
|
|
|
|
/* some sort of aux. channel group: collection of 16 midi channels */
|
2004-01-20 01:21:40 +01:00
|
|
|
typedef struct DMUSIC_PRIVATE_CHANNEL_GROUP_ {
|
2003-06-07 02:39:18 +02:00
|
|
|
DMUSIC_PRIVATE_MCHANNEL channel[16]; /* 16 channels in a group */
|
|
|
|
} DMUSIC_PRIVATE_CHANNEL_GROUP, *LPDMUSIC_PRIVATE_CHANNEL_GROUP;
|
|
|
|
|
2003-06-30 20:28:52 +02:00
|
|
|
|
2003-03-21 01:42:38 +01:00
|
|
|
/*****************************************************************************
|
2003-06-27 21:43:13 +02:00
|
|
|
* ClassFactory
|
2003-07-22 00:10:14 +02:00
|
|
|
*/
|
2004-01-20 01:21:40 +01:00
|
|
|
extern HRESULT WINAPI DMUSIC_CreateDirectMusicImpl (LPCGUID lpcGUID, LPVOID* ppobj, LPUNKNOWN pUnkOuter);
|
|
|
|
extern HRESULT WINAPI DMUSIC_CreateDirectMusicBufferImpl (LPCGUID lpcGUID, LPVOID* ppobj, LPUNKNOWN pUnkOuter);
|
|
|
|
extern HRESULT WINAPI DMUSIC_CreateDirectMusicDownloadedInstrumentImpl (LPCGUID lpcGUID, LPVOID* ppobj, LPUNKNOWN pUnkOuter);
|
|
|
|
extern HRESULT WINAPI DMUSIC_CreateDirectMusicDownloadImpl (LPCGUID lpcGUID, LPVOID* ppobj, LPUNKNOWN pUnkOuter);
|
|
|
|
extern HRESULT WINAPI DMUSIC_CreateReferenceClockImpl (LPCGUID lpcGUID, LPVOID* ppobj, LPUNKNOWN pUnkOuter);
|
2003-08-23 01:53:27 +02:00
|
|
|
|
2004-01-20 01:21:40 +01:00
|
|
|
extern HRESULT WINAPI DMUSIC_CreateDirectMusicCollectionImpl (LPCGUID lpcGUID, LPVOID* ppobj, LPUNKNOWN pUnkOuter);
|
|
|
|
extern HRESULT WINAPI DMUSIC_CreateDirectMusicInstrumentImpl (LPCGUID lpcGUID, LPVOID* ppobj, LPUNKNOWN pUnkOuter);
|
2003-08-23 01:53:27 +02:00
|
|
|
|
2003-03-21 01:42:38 +01:00
|
|
|
/*****************************************************************************
|
|
|
|
* IDirectMusic8Impl implementation structure
|
|
|
|
*/
|
2004-01-20 01:21:40 +01:00
|
|
|
struct IDirectMusic8Impl {
|
2003-03-21 01:42:38 +01:00
|
|
|
/* IUnknown fields */
|
2005-06-01 21:57:42 +02:00
|
|
|
const IDirectMusic8Vtbl *lpVtbl;
|
2005-07-12 21:21:36 +02:00
|
|
|
LONG ref;
|
2003-03-21 01:42:38 +01:00
|
|
|
|
2003-06-27 21:43:13 +02:00
|
|
|
/* IDirectMusicImpl fields */
|
2003-07-22 00:10:14 +02:00
|
|
|
IReferenceClockImpl* pMasterClock;
|
2005-11-29 10:43:18 +01:00
|
|
|
IDirectMusicPort** ppPorts;
|
2003-06-07 02:39:18 +02:00
|
|
|
int nrofports;
|
2003-03-21 01:42:38 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
/*****************************************************************************
|
|
|
|
* IDirectMusicBufferImpl implementation structure
|
|
|
|
*/
|
2004-01-20 01:21:40 +01:00
|
|
|
struct IDirectMusicBufferImpl {
|
2003-03-21 01:42:38 +01:00
|
|
|
/* IUnknown fields */
|
2005-06-01 21:57:42 +02:00
|
|
|
const IDirectMusicBufferVtbl *lpVtbl;
|
2005-07-12 21:21:36 +02:00
|
|
|
LONG ref;
|
2003-03-21 01:42:38 +01:00
|
|
|
|
|
|
|
/* IDirectMusicBufferImpl fields */
|
|
|
|
};
|
|
|
|
|
|
|
|
/*****************************************************************************
|
|
|
|
* IDirectMusicDownloadedInstrumentImpl implementation structure
|
|
|
|
*/
|
2004-01-20 01:21:40 +01:00
|
|
|
struct IDirectMusicDownloadedInstrumentImpl {
|
2003-03-21 01:42:38 +01:00
|
|
|
/* IUnknown fields */
|
2005-06-01 21:57:42 +02:00
|
|
|
const IDirectMusicDownloadedInstrumentVtbl *lpVtbl;
|
2005-07-12 21:21:36 +02:00
|
|
|
LONG ref;
|
2003-03-21 01:42:38 +01:00
|
|
|
|
|
|
|
/* IDirectMusicDownloadedInstrumentImpl fields */
|
|
|
|
};
|
|
|
|
|
|
|
|
/*****************************************************************************
|
|
|
|
* IDirectMusicDownloadImpl implementation structure
|
|
|
|
*/
|
2004-01-20 01:21:40 +01:00
|
|
|
struct IDirectMusicDownloadImpl {
|
2003-03-21 01:42:38 +01:00
|
|
|
/* IUnknown fields */
|
2005-06-01 21:57:42 +02:00
|
|
|
const IDirectMusicDownloadVtbl *lpVtbl;
|
2005-07-12 21:21:36 +02:00
|
|
|
LONG ref;
|
2003-03-21 01:42:38 +01:00
|
|
|
|
|
|
|
/* IDirectMusicDownloadImpl fields */
|
|
|
|
};
|
|
|
|
|
|
|
|
/*****************************************************************************
|
|
|
|
* IDirectMusicPortImpl implementation structure
|
|
|
|
*/
|
2004-01-20 01:21:40 +01:00
|
|
|
struct IDirectMusicPortImpl {
|
2003-03-21 01:42:38 +01:00
|
|
|
/* IUnknown fields */
|
2005-06-01 21:57:42 +02:00
|
|
|
const IDirectMusicPortVtbl *lpVtbl;
|
2008-12-18 21:24:58 +01:00
|
|
|
const IDirectMusicPortDownloadVtbl *lpDownloadVtbl;
|
|
|
|
const IDirectMusicThruVtbl *lpThruVtbl;
|
2005-07-12 21:21:36 +02:00
|
|
|
LONG ref;
|
2003-03-21 01:42:38 +01:00
|
|
|
|
|
|
|
/* IDirectMusicPortImpl fields */
|
2003-07-22 00:10:14 +02:00
|
|
|
IDirectSound* pDirectSound;
|
|
|
|
IReferenceClock* pLatencyClock;
|
|
|
|
BOOL fActive;
|
2005-11-29 10:43:18 +01:00
|
|
|
DMUS_PORTCAPS caps;
|
|
|
|
DMUS_PORTPARAMS params;
|
2003-06-07 02:39:18 +02:00
|
|
|
int nrofgroups;
|
|
|
|
DMUSIC_PRIVATE_CHANNEL_GROUP group[1];
|
2003-03-21 01:42:38 +01:00
|
|
|
};
|
|
|
|
|
2005-11-29 10:43:18 +01:00
|
|
|
extern HRESULT WINAPI IDirectMusicPortImpl_Activate (LPDIRECTMUSICPORT iface, BOOL fActive);
|
|
|
|
|
|
|
|
/** Internal factory */
|
|
|
|
extern HRESULT WINAPI DMUSIC_CreateDirectMusicPortImpl (LPCGUID lpcGUID, LPVOID *ppobj, LPUNKNOWN pUnkOuter, LPDMUS_PORTPARAMS pPortParams, LPDMUS_PORTCAPS pPortCaps);
|
2003-03-21 01:42:38 +01:00
|
|
|
|
2003-04-08 23:42:00 +02:00
|
|
|
/*****************************************************************************
|
2003-07-22 00:10:14 +02:00
|
|
|
* IReferenceClockImpl implementation structure
|
2003-04-08 23:42:00 +02:00
|
|
|
*/
|
2004-01-20 01:21:40 +01:00
|
|
|
struct IReferenceClockImpl {
|
2003-04-08 23:42:00 +02:00
|
|
|
/* IUnknown fields */
|
2005-06-01 21:57:42 +02:00
|
|
|
const IReferenceClockVtbl *lpVtbl;
|
2005-07-12 21:21:36 +02:00
|
|
|
LONG ref;
|
2003-04-08 23:42:00 +02:00
|
|
|
|
2003-07-22 00:10:14 +02:00
|
|
|
/* IReferenceClockImpl fields */
|
|
|
|
REFERENCE_TIME rtTime;
|
|
|
|
DMUS_CLOCKINFO pClockInfo;
|
2003-04-08 23:42:00 +02:00
|
|
|
};
|
|
|
|
|
2004-01-20 01:21:40 +01:00
|
|
|
typedef struct _DMUS_PRIVATE_INSTRUMENT_ENTRY {
|
|
|
|
struct list entry; /* for listing elements */
|
|
|
|
IDirectMusicInstrument* pInstrument;
|
|
|
|
} DMUS_PRIVATE_INSTRUMENTENTRY, *LPDMUS_PRIVATE_INSTRUMENTENTRY;
|
|
|
|
|
|
|
|
typedef struct _DMUS_PRIVATE_POOLCUE {
|
|
|
|
struct list entry; /* for listing elements */
|
|
|
|
} DMUS_PRIVATE_POOLCUE, *LPDMUS_PRIVATE_POOLCUE;
|
|
|
|
|
2003-08-23 01:53:27 +02:00
|
|
|
/*****************************************************************************
|
2004-01-20 01:21:40 +01:00
|
|
|
* IDirectMusicCollectionImpl implementation structure
|
2003-08-23 01:53:27 +02:00
|
|
|
*/
|
2004-01-20 01:21:40 +01:00
|
|
|
struct IDirectMusicCollectionImpl {
|
2003-08-23 01:53:27 +02:00
|
|
|
/* IUnknown fields */
|
2005-06-01 21:57:42 +02:00
|
|
|
const IUnknownVtbl *UnknownVtbl;
|
|
|
|
const IDirectMusicCollectionVtbl *CollectionVtbl;
|
|
|
|
const IDirectMusicObjectVtbl *ObjectVtbl;
|
|
|
|
const IPersistStreamVtbl *PersistStreamVtbl;
|
2005-07-12 21:21:36 +02:00
|
|
|
LONG ref;
|
2003-08-23 01:53:27 +02:00
|
|
|
|
2004-01-20 01:21:40 +01:00
|
|
|
/* IDirectMusicCollectionImpl fields */
|
|
|
|
IStream *pStm; /* stream from which we load collection and later instruments */
|
|
|
|
LARGE_INTEGER liCollectionPosition; /* offset in a stream where collection was loaded from */
|
|
|
|
LARGE_INTEGER liWavePoolTablePosition; /* offset in a stream where wave pool table can be found */
|
2003-08-23 01:53:27 +02:00
|
|
|
LPDMUS_OBJECTDESC pDesc;
|
2004-01-20 01:21:40 +01:00
|
|
|
CHAR* szCopyright; /* FIXME: should probably placed somewhere else */
|
|
|
|
LPDLSHEADER pHeader;
|
|
|
|
/* pool table */
|
|
|
|
LPPOOLTABLE pPoolTable;
|
|
|
|
LPPOOLCUE pPoolCues;
|
|
|
|
/* instruments */
|
|
|
|
struct list Instruments;
|
2003-08-23 01:53:27 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
/*****************************************************************************
|
2004-01-20 01:21:40 +01:00
|
|
|
* IDirectMusicInstrumentImpl implementation structure
|
2003-08-23 01:53:27 +02:00
|
|
|
*/
|
2004-01-20 01:21:40 +01:00
|
|
|
struct IDirectMusicInstrumentImpl {
|
2003-08-23 01:53:27 +02:00
|
|
|
/* IUnknown fields */
|
2005-06-01 21:57:42 +02:00
|
|
|
const IUnknownVtbl *UnknownVtbl;
|
|
|
|
const IDirectMusicInstrumentVtbl *InstrumentVtbl;
|
2005-07-12 21:21:36 +02:00
|
|
|
LONG ref;
|
2003-08-23 01:53:27 +02:00
|
|
|
|
2004-01-20 01:21:40 +01:00
|
|
|
/* IDirectMusicInstrumentImpl fields */
|
|
|
|
LARGE_INTEGER liInstrumentPosition; /* offset in a stream where instrument chunk can be found */
|
|
|
|
LPGUID pInstrumentID;
|
|
|
|
LPINSTHEADER pHeader;
|
|
|
|
WCHAR wszName[DMUS_MAX_NAME];
|
|
|
|
/* instrument data */
|
2003-08-23 01:53:27 +02:00
|
|
|
};
|
|
|
|
|
2004-01-20 01:21:40 +01:00
|
|
|
/* custom :) */
|
|
|
|
extern HRESULT WINAPI IDirectMusicInstrumentImpl_Custom_Load (LPDIRECTMUSICINSTRUMENT iface, LPSTREAM pStm);
|
2003-08-23 01:53:27 +02:00
|
|
|
|
2005-01-26 20:41:43 +01:00
|
|
|
/**********************************************************************
|
|
|
|
* Dll lifetime tracking declaration for dmusic.dll
|
|
|
|
*/
|
|
|
|
extern LONG DMUSIC_refCount;
|
2005-06-20 16:18:03 +02:00
|
|
|
static inline void DMUSIC_LockModule(void) { InterlockedIncrement( &DMUSIC_refCount ); }
|
|
|
|
static inline void DMUSIC_UnlockModule(void) { InterlockedDecrement( &DMUSIC_refCount ); }
|
2003-08-23 01:53:27 +02:00
|
|
|
|
2004-01-20 01:21:40 +01:00
|
|
|
|
|
|
|
/*****************************************************************************
|
|
|
|
* Misc.
|
|
|
|
*/
|
|
|
|
/* my custom ICOM stuff */
|
|
|
|
#define ICOM_NAME_MULTI(impl,field,iface,name) impl* const name=(impl*)((char*)(iface) - offsetof(impl,field))
|
2004-08-13 02:44:22 +02:00
|
|
|
#define ICOM_THIS_MULTI(impl,field,iface) ICOM_NAME_MULTI(impl,field,iface,This)
|
2004-01-20 01:21:40 +01:00
|
|
|
|
|
|
|
/* for simpler reading */
|
|
|
|
typedef struct _DMUS_PRIVATE_CHUNK {
|
|
|
|
FOURCC fccID; /* FOURCC ID of the chunk */
|
|
|
|
DWORD dwSize; /* size of the chunk */
|
|
|
|
} DMUS_PRIVATE_CHUNK, *LPDMUS_PRIVATE_CHUNK;
|
|
|
|
|
2004-02-25 02:30:03 +01:00
|
|
|
/* used for generic dumping (copied from ddraw) */
|
|
|
|
typedef struct {
|
|
|
|
DWORD val;
|
|
|
|
const char* name;
|
|
|
|
} flag_info;
|
2004-01-20 01:21:40 +01:00
|
|
|
|
2004-02-25 02:30:03 +01:00
|
|
|
typedef struct {
|
|
|
|
const GUID *guid;
|
|
|
|
const char* name;
|
|
|
|
} guid_info;
|
2004-01-20 01:21:40 +01:00
|
|
|
|
|
|
|
/* used for initialising structs (primarily for DMUS_OBJECTDESC) */
|
|
|
|
#define DM_STRUCT_INIT(x) \
|
|
|
|
do { \
|
|
|
|
memset((x), 0, sizeof(*(x))); \
|
|
|
|
(x)->dwSize = sizeof(*x); \
|
|
|
|
} while (0)
|
|
|
|
|
2004-02-25 02:30:03 +01:00
|
|
|
#define FE(x) { x, #x }
|
|
|
|
#define GE(x) { &x, #x }
|
2004-01-20 01:21:40 +01:00
|
|
|
|
2004-02-25 02:30:03 +01:00
|
|
|
/* dwPatch from MIDILOCALE */
|
2010-09-05 13:36:31 +02:00
|
|
|
extern DWORD MIDILOCALE2Patch (const MIDILOCALE *pLocale);
|
2004-02-25 02:30:03 +01:00
|
|
|
/* MIDILOCALE from dwPatch */
|
|
|
|
extern void Patch2MIDILOCALE (DWORD dwPatch, LPMIDILOCALE pLocale);
|
2004-01-20 01:21:40 +01:00
|
|
|
|
2004-02-25 02:30:03 +01:00
|
|
|
/* check whether the given DWORD is even (return 0) or odd (return 1) */
|
|
|
|
extern int even_or_odd (DWORD number);
|
|
|
|
/* FOURCC to string conversion for debug messages */
|
|
|
|
extern const char *debugstr_fourcc (DWORD fourcc);
|
|
|
|
/* returns name of given GUID */
|
|
|
|
extern const char *debugstr_dmguid (const GUID *id);
|
|
|
|
/* dump whole DMUS_OBJECTDESC struct */
|
|
|
|
extern const char *debugstr_DMUS_OBJECTDESC (LPDMUS_OBJECTDESC pDesc);
|
2004-01-20 01:21:40 +01:00
|
|
|
|
2003-03-21 01:42:38 +01:00
|
|
|
#endif /* __WINE_DMUSIC_PRIVATE_H */
|