dmplugin.h 14.3 KB
Newer Older
1 2 3
/*
 *  DirectMusic Performance Layer Plugins API
 *
4
 *  Copyright (C) 2003-2004 Rok Mandeljc
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
 *
 *  This program is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation; either version 2 of the License, or
 *  (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU Library General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program; if not, write to the Free Software
 *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 */

#ifndef __WINE_DMUSIC_PLUGIN_H
#define __WINE_DMUSIC_PLUGIN_H

24 25 26 27
#ifndef __WINESRC__
#include <windows.h>
#endif /* __WINESRC__ */

28 29
#include <objbase.h>
#include <mmsystem.h>
30 31
#include <dmusici.h>
#include <pshpack8.h>
32 33 34 35 36

#ifdef __cplusplus
extern "C" {
#endif

37 38 39 40
/*****************************************************************************
 * Registry path
 */
#define DMUS_REGSTR_PATH_TOOLS "Software\\Microsoft\\DirectMusic\\Tools"
41

42
	
43 44 45
/*****************************************************************************
 * Predeclare the interfaces
 */
46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106
/* CLSIDs */	
DEFINE_GUID(CLSID_DirectMusicBandTrack,              0xd2ac2894,0xb39b,0x11d1,0x87,0x04,0x00,0x60,0x08,0x93,0xb1,0xbd);
DEFINE_GUID(CLSID_DirectMusicChordTrack,             0xd2ac288b,0xb39b,0x11d1,0x87,0x04,0x00,0x60,0x08,0x93,0xb1,0xbd);
DEFINE_GUID(CLSID_DirectMusicChordMapTrack,          0xd2ac2896,0xb39b,0x11d1,0x87,0x04,0x00,0x60,0x08,0x93,0xb1,0xbd);
DEFINE_GUID(CLSID_DirectMusicCommandTrack,           0xd2ac288c,0xb39b,0x11d1,0x87,0x04,0x00,0x60,0x08,0x93,0xb1,0xbd);
DEFINE_GUID(CLSID_DirectMusicLyricsTrack,            0x995c1cf5,0x54ff,0x11d3,0x8b,0xda,0x00,0x60,0x08,0x93,0xb1,0xb6);
DEFINE_GUID(CLSID_DirectMusicMarkerTrack,            0x55a8fd00,0x4288,0x11d3,0x9b,0xd1,0x8a,0x0d,0x61,0xc8,0x88,0x35);
DEFINE_GUID(CLSID_DirectMusicMotifTrack,             0xd2ac288e,0xb39b,0x11d1,0x87,0x04,0x00,0x60,0x08,0x93,0xb1,0xbd);
DEFINE_GUID(CLSID_DirectMusicMuteTrack,              0xd2ac2898,0xb39b,0x11d1,0x87,0x04,0x00,0x60,0x08,0x93,0xb1,0xbd);
DEFINE_GUID(CLSID_DirectMusicParamControlTrack,      0x4be0537b,0x5c19,0x11d3,0x8b,0xdc,0x00,0x60,0x08,0x93,0xb1,0xb6);
DEFINE_GUID(CLSID_DirectMusicScriptTrack,            0x4108fa85,0x3586,0x11d3,0x8b,0xd7,0x00,0x60,0x08,0x93,0xb1,0xb6);
DEFINE_GUID(CLSID_DirectMusicSegmentTriggerTrack,    0xbae4d665,0x4ea1,0x11d3,0x8b,0xda,0x00,0x60,0x08,0x93,0xb1,0xb6);
DEFINE_GUID(CLSID_DirectMusicSeqTrack,               0xd2ac2886,0xb39b,0x11d1,0x87,0x04,0x00,0x60,0x08,0x93,0xb1,0xbd);
DEFINE_GUID(CLSID_DirectMusicSignPostTrack,          0xf17e8672,0xc3b4,0x11d1,0x87,0x0b,0x00,0x60,0x08,0x93,0xb1,0xbd);
DEFINE_GUID(CLSID_DirectMusicStyleTrack,             0xd2ac288d,0xb39b,0x11d1,0x87,0x04,0x00,0x60,0x08,0x93,0xb1,0xbd);
DEFINE_GUID(CLSID_DirectMusicSysExTrack,             0xd2ac2887,0xb39b,0x11d1,0x87,0x04,0x00,0x60,0x08,0x93,0xb1,0xbd);
DEFINE_GUID(CLSID_DirectMusicTempoTrack,             0xd2ac2885,0xb39b,0x11d1,0x87,0x04,0x00,0x60,0x08,0x93,0xb1,0xbd);
DEFINE_GUID(CLSID_DirectMusicTimeSigTrack,           0xd2ac2888,0xb39b,0x11d1,0x87,0x04,0x00,0x60,0x08,0x93,0xb1,0xbd);
DEFINE_GUID(CLSID_DirectMusicWaveTrack,              0xeed36461,0x9ea5,0x11d3,0x9b,0xd1,0x00,0x80,0xc7,0x15,0x0a,0x74);
/* MS doesn't support this in DX 9.0 and newer... but there's no harm in keeping it around */
DEFINE_GUID(CLSID_DirectMusicMelodyFormulationTrack, 0xb0684266,0xb57f,0x11d2,0x97,0xf9,0x00,0xc0,0x4f,0xa3,0x6e,0x58);

/* IIDs */
DEFINE_GUID(IID_IDirectMusicTool,                    0xd2ac28ba,0xb39b,0x11d1,0x87,0x04,0x00,0x60,0x08,0x93,0xb1,0xbd);
DEFINE_GUID(IID_IDirectMusicTool8,                   0x0e674303,0x3b05,0x11d3,0x9b,0xd1,0xf9,0xe7,0xf0,0xa0,0x15,0x36);
DEFINE_GUID(IID_IDirectMusicTrack,                   0xf96029a1,0x4282,0x11d2,0x87,0x17,0x00,0x60,0x08,0x93,0xb1,0xbd);
DEFINE_GUID(IID_IDirectMusicTrack8,                  0x0e674304,0x3b05,0x11d3,0x9b,0xd1,0xf9,0xe7,0xf0,0xa0,0x15,0x36);

/* typedef definitions */
typedef struct IDirectMusicTrack         IDirectMusicTrack,         *LPDIRECTMUSICTRACK;
typedef struct IDirectMusicTrack         IDirectMusicTrack8,        *LPDIRECTMUSICTRACK8;
typedef struct IDirectMusicTool          IDirectMusicTool,          *LPDIRECTMUSICTOOL;
typedef struct IDirectMusicTool8         IDirectMusicTool8,         *LPDIRECTMUSICTOOL8;
/* these are from dmusici.h and are needed here */
typedef struct IDirectMusicPerformance   IDirectMusicPerformance,   *LPDIRECTMUSICPERFORMANCE;
typedef struct IDirectMusicPerformance8  IDirectMusicPerformance8,  *LPDIRECTMUSICPERFORMANCE8;
typedef struct IDirectMusicSegment       IDirectMusicSegment,       *LPDIRECTMUSICSEGMENT;
typedef struct IDirectMusicSegment       IDirectMusicSegment8,      *LPDIRECTMUSICSEGMENT8;
typedef struct IDirectMusicSegmentState  IDirectMusicSegmentState,  *LPDIRECTMUSICSEGMENTSTATE;
typedef struct IDirectMusicSegmentState8 IDirectMusicSegmentState8, *LPDIRECTMUSICSEGMENTSTATE8;
typedef struct IDirectMusicGraph         IDirectMusicGraph,         *LPDIRECTMUSICGRAPH;
typedef struct IDirectMusicGraph         IDirectMusicGraph8,        *LPDIRECTMUSICGRAPH8;


/*****************************************************************************
 * Typedef definitions
 */
typedef struct _DMUS_PMSG DMUS_PMSG;
typedef long MUSIC_TIME;


/*****************************************************************************
 * Flags
 */
#define DMUS_TRACK_PARAMF_CLOCK 0x1

/*****************************************************************************
 * Enumerations
 */
/* typedef definitions */
typedef enum enumDMUS_TRACKF_FLAGS DMUS_TRACKF_FLAGS;
107

108 109 110 111 112 113 114 115 116 117 118 119 120 121
/* actual enumerations */
enum enumDMUS_TRACKF_FLAGS {
	DMUS_TRACKF_SEEK       = 0x001,
	DMUS_TRACKF_LOOP       = 0x002,
	DMUS_TRACKF_START      = 0x004,
	DMUS_TRACKF_FLUSH      = 0x008,
	DMUS_TRACKF_DIRTY      = 0x010,
	DMUS_TRACKF_NOTIFY_OFF = 0x020,
	DMUS_TRACKF_PLAY_OFF   = 0x040,
	DMUS_TRACKF_LOOPEND    = 0x080,
	DMUS_TRACKF_STOP       = 0x100,
	DMUS_TRACKF_RECOMPOSE  = 0x200,
	DMUS_TRACKF_CLOCK      = 0x400,
};
122 123 124 125

/*****************************************************************************
 * IDirectMusicTool interface
 */
126 127
#undef  INTERFACE
#define INTERFACE IDirectMusicTool
128
#define IDirectMusicTool_METHODS \
129
    IUnknown_METHODS \
130 131 132 133 134 135
    STDMETHOD(Init)(THIS_ IDirectMusicGraph *pGraph) PURE; \
    STDMETHOD(GetMsgDeliveryType)(THIS_ DWORD *pdwDeliveryType) PURE; \
    STDMETHOD(GetMediaTypeArraySize)(THIS_ DWORD *pdwNumElements) PURE; \
    STDMETHOD(GetMediaTypes)(THIS_ DWORD **padwMediaTypes, DWORD dwNumElements) PURE; \
    STDMETHOD(ProcessPMsg)(THIS_ IDirectMusicPerformance *pPerf, DMUS_PMSG *pPMSG) PURE; \
    STDMETHOD(Flush)(THIS_ IDirectMusicPerformance *pPerf, DMUS_PMSG *pPMSG, REFERENCE_TIME rtTime) PURE;
136
ICOM_DEFINE(IDirectMusicTool,IUnknown)
137
#undef INTERFACE
138

139
#ifdef COBJMACROS
140
/*** IUnknown methods ***/
141 142 143
#define IDirectMusicTool_QueryInterface(p,a,b)      (p)->lpVtbl->QueryInterface(p,a,b)
#define IDirectMusicTool_AddRef(p)                  (p)->lpVtbl->AddRef(p)
#define IDirectMusicTool_Release(p)                 (p)->lpVtbl->Release(p)
144
/*** IDirectMusicTool methods ***/
145 146 147 148 149 150
#define IDirectMusicTool_Init(p,a)                  (p)->lpVtbl->Init(p,a)
#define IDirectMusicTool_GetMsgDeliveryType(p,a)    (p)->lpVtbl->GetMsgDeliveryType(p,a)
#define IDirectMusicTool_GetMediaTypeArraySize(p,a) (p)->lpVtbl->GetMediaTypeArraySize(p,a)
#define IDirectMusicTool_GetMediaTypes(p,a,b)       (p)->lpVtbl->GetMediaTypes(p,a,b)
#define IDirectMusicTool_ProcessPMsg(p,a,b)         (p)->lpVtbl->ProcessPMsg(p,a,b)
#define IDirectMusicTool_Flush(p,a,b,c)             (p)->lpVtbl->Flush(p,a,b,c)
151
#endif
152 153 154 155 156


/*****************************************************************************
 * IDirectMusicTool8 interface
 */
157 158
#undef  INTERFACE
#define INTERFACE IDirectMusicTool8
159 160
#define IDirectMusicTool8_METHODS \
    IDirectMusicTool_METHODS \
161
    STDMETHOD(Clone)(THIS_ IDirectMusicTool **ppTool) PURE;
162
ICOM_DEFINE(IDirectMusicTool8,IDirectMusicTool)
163
#undef INTERFACE
164

165
#ifdef COBJMACROS
166
/*** IUnknown methods ***/
167 168 169
#define IDirectMusicTool8_QueryInterface(p,a,b)      (p)->lpVtbl->QueryInterface(p,a,b)
#define IDirectMusicTool8_AddRef(p)                  (p)->lpVtbl->AddRef(p)
#define IDirectMusicTool8_Release(p)                 (p)->lpVtbl->Release(p)
170
/*** IDirectMusicTool methods ***/
171 172 173 174 175 176
#define IDirectMusicTool8_Init(p,a)                  (p)->lpVtbl->Init(p,a)
#define IDirectMusicTool8_GetMsgDeliveryType(p,a)    (p)->lpVtbl->GetMsgDeliveryType(p,a)
#define IDirectMusicTool8_GetMediaTypeArraySize(p,a) (p)->lpVtbl->GetMediaTypeArraySize(p,a)
#define IDirectMusicTool8_GetMediaTypes(p,a,b)       (p)->lpVtbl->GetMediaTypes(p,a,b)
#define IDirectMusicTool8_ProcessPMsg(p,a,b)         (p)->lpVtbl->ProcessPMsg(p,a,b)
#define IDirectMusicTool8_Flush(p,a,b)               (p)->lpVtbl->Flush(p,a,b)
177
/*** IDirectMusicTool8 methods ***/
178
#define IDirectMusicTool8_Clone(p,a)                 (p)->lpVtbl->Clone(p,a)
179
#endif
180 181 182 183 184


/*****************************************************************************
 * IDirectMusicTrack interface
 */
185 186
#undef  INTERFACE
#define INTERFACE IDirectMusicTrack
187
#define IDirectMusicTrack_METHODS \
188
    IUnknown_METHODS \
189 190 191 192 193 194 195 196 197 198
    STDMETHOD(Init)(THIS_ IDirectMusicSegment *pSegment) PURE; \
    STDMETHOD(InitPlay)(THIS_ IDirectMusicSegmentState *pSegmentState, IDirectMusicPerformance *pPerformance, void **ppStateData, DWORD dwVirtualTrackID, DWORD dwFlags) PURE; \
    STDMETHOD(EndPlay)(THIS_ void *pStateData) PURE; \
    STDMETHOD(Play)(THIS_ void *pStateData, MUSIC_TIME mtStart, MUSIC_TIME mtEnd, MUSIC_TIME mtOffset, DWORD dwFlags, IDirectMusicPerformance *pPerf, IDirectMusicSegmentState *pSegSt, DWORD dwVirtualID) PURE; \
    STDMETHOD(GetParam)(THIS_ REFGUID rguidType, MUSIC_TIME mtTime, MUSIC_TIME *pmtNext, void *pParam) PURE; \
    STDMETHOD(SetParam)(THIS_ REFGUID rguidType, MUSIC_TIME mtTime, void *pParam) PURE; \
    STDMETHOD(IsParamSupported)(THIS_ REFGUID rguidType) PURE; \
    STDMETHOD(AddNotificationType)(THIS_ REFGUID rguidNotificationType) PURE; \
    STDMETHOD(RemoveNotificationType)(THIS_ REFGUID rguidNotificationType) PURE; \
    STDMETHOD(Clone)(THIS_ MUSIC_TIME mtStart, MUSIC_TIME mtEnd, IDirectMusicTrack **ppTrack) PURE;
199
ICOM_DEFINE(IDirectMusicTrack,IUnknown)
200
#undef INTERFACE
201

202
#ifdef COBJMACROS
203
/*** IUnknown methods ***/
204 205 206
#define IDirectMusicTrack_QueryInterface(p,a,b)       (p)->lpVtbl->QueryInterface(p,a,b)
#define IDirectMusicTrack_AddRef(p)                   (p)->lpVtbl->AddRef(p)
#define IDirectMusicTrack_Release(p)                  (p)->lpVtbl->Release(p)
207
/*** IDirectMusicTrack methods ***/
208 209 210 211 212 213 214 215 216 217
#define IDirectMusicTrack_Init(p,a)                   (p)->lpVtbl->Init(p,a)
#define IDirectMusicTrack_InitPlay(p,a,b,c,d,e)       (p)->lpVtbl->InitPlay(p,a,b,c,d,e)
#define IDirectMusicTrack_EndPlay(p,a)                (p)->lpVtbl->EndPlay(p,a)
#define IDirectMusicTrack_Play(p,a,b,c,d,e,f,g,h)     (p)->lpVtbl->Play(p,a,b,c,d,e,f,g,h)
#define IDirectMusicTrack_GetParam(p,a,b,c,d)         (p)->lpVtbl->GetParam(p,a,b,c,d)
#define IDirectMusicTrack_SetParam(p,a,b,c)           (p)->lpVtbl->SetParam(p,a,b,c)
#define IDirectMusicTrack_IsParamSupported(p,a)       (p)->lpVtbl->IsParamSupported(p,a)
#define IDirectMusicTrack_AddNotificationType(p,a)    (p)->lpVtbl->AddNotificationType(p,a)
#define IDirectMusicTrack_RemoveNotificationType(p,a) (p)->lpVtbl->RemoveNotificationType(p,a)
#define IDirectMusicTrack_Clone(p,a,b,c)              (p)->lpVtbl->Clone(p,a,b,c)
218
#endif
219 220 221 222 223


/*****************************************************************************
 * IDirectMusicTrack8 interface
 */
224 225
#undef  INTERFACE
#define INTERFACE IDirectMusicTrack8
226
#define IDirectMusicTrack8_METHODS \
227
    IDirectMusicTrack_METHODS \
228 229 230 231 232
    STDMETHOD(PlayEx)(THIS_ void *pStateData, REFERENCE_TIME rtStart, REFERENCE_TIME rtEnd, REFERENCE_TIME rtOffset, DWORD dwFlags, IDirectMusicPerformance *pPerf, IDirectMusicSegmentState *pSegSt, DWORD dwVirtualID) PURE; \
    STDMETHOD(GetParamEx)(THIS_ REFGUID rguidType, REFERENCE_TIME rtTime, REFERENCE_TIME *prtNext, void *pParam, void *pStateData, DWORD dwFlags) PURE; \
    STDMETHOD(SetParamEx)(THIS_ REFGUID rguidType, REFERENCE_TIME rtTime, void *pParam, void *pStateData, DWORD dwFlags) PURE; \
    STDMETHOD(Compose)(THIS_ IUnknown *pContext, DWORD dwTrackGroup, IDirectMusicTrack **ppResultTrack) PURE; \
    STDMETHOD(Join)(THIS_ IDirectMusicTrack *pNewTrack, MUSIC_TIME mtJoin, IUnknown *pContext, DWORD dwTrackGroup, IDirectMusicTrack **ppResultTrack) PURE;
233
ICOM_DEFINE(IDirectMusicTrack8,IDirectMusicTrack)
234
#undef INTERFACE
235

236
#ifdef COBJMACROS
237
/*** IUnknown methods ***/
238 239 240
#define IDirectMusicTrack8_QueryInterface(p,a,b)       (p)->lpVtbl->QueryInterface(p,a,b)
#define IDirectMusicTrack8_AddRef(p)                   (p)->lpVtbl->AddRef(p)
#define IDirectMusicTrack8_Release(p)                  (p)->lpVtbl->Release(p)
241
/*** IDirectMusicTrack methods ***/
242 243 244 245 246 247 248 249 250 251
#define IDirectMusicTrack8_Init(p,a)                   (p)->lpVtbl->Init(p,a)
#define IDirectMusicTrack8_InitPlay(p,a,b,c,d,e)       (p)->lpVtbl->InitPlay(p,a,b,c,d,e)
#define IDirectMusicTrack8_EndPlay(p,a)                (p)->lpVtbl->EndPlay(p,a)
#define IDirectMusicTrack8_Play(p,a,b,c,d,e,f,g,h)     (p)->lpVtbl->Play(p,a,b,c,d,e,f,g,h)
#define IDirectMusicTrack8_GetParam(p,a,b,c,d)         (p)->lpVtbl->GetParam(p,a,b,c,d)
#define IDirectMusicTrack8_SetParam(p,a,b,c)           (p)->lpVtbl->SetParam(p,a,b,c)
#define IDirectMusicTrack8_IsParamSupported(p,a)       (p)->lpVtbl->IsParamSupported(p,a)
#define IDirectMusicTrack8_AddNotificationType(p,a)    (p)->lpVtbl->AddNotificationType(p,a)
#define IDirectMusicTrack8_RemoveNotificationType(p,a) (p)->lpVtbl->RemoveNotificationType(p,a)
#define IDirectMusicTrack8_Clone(p,a,b,c)              (p)->lpVtbl->Clone(p,a,b,c)
252
/*** IDirectMusicTrack8 methods ***/
253 254 255 256 257
#define IDirectMusicTrack8_PlayEx(p,a,b,c,d,e,f,g,h)   (p)->lpVtbl->PlayEx(p,a,b,c,d,e,f,g,h)
#define IDirectMusicTrack8_GetParamEx(p,a,b,c,d,e,f)   (p)->lpVtbl->GetParamEx(p,a,b,c,d,e,f)
#define IDirectMusicTrack8_SetParamEx(p,a,b,c,d,e)     (p)->lpVtbl->SetParamEx(p,a,b,c,d,e)
#define IDirectMusicTrack8_Compose(p,a,b,c)            (p)->lpVtbl->Compose(p,a,b,c)
#define IDirectMusicTrack8_Join(p,a,b,c,d,e)           (p)->lpVtbl->Join(p,a,b,c,d,e)
258
#endif
259 260 261 262 263

#ifdef __cplusplus
}
#endif

264 265
#include <poppack.h>

266
#endif /* __WINE_DMUSIC_PLUGIN_H */