2 * DirectMusic Software Synth Definitions
4 * Copyright (C) 2003 Rok Mandeljc
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU Library General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
21 #ifndef __WINE_DMUSIC_SOFTWARESYNTH_H
22 #define __WINE_DMUSIC_SOFTWARESYNTH_H
27 /*****************************************************************************
30 #define REGSTR_PATH_SOFTWARESYNTHS "Software\\Microsoft\\DirectMusic\\SoftwareSynths"
31 #define REFRESH_F_LASTBUFFER 0x00000001
34 /*****************************************************************************
35 * Predeclare the interfaces
38 DEFINE_GUID(IID_IDirectMusicSynth
, 0x9823661,0x5c85,0x11d2,0xaf,0xa6,0x0,0xaa,0x0,0x24,0xd8,0xb6);
39 typedef struct IDirectMusicSynth IDirectMusicSynth
, *LPDIRECTMUSICSYNTH
;
40 DEFINE_GUID(IID_IDirectMusicSynth8
, 0x53cab625,0x2711,0x4c9f,0x9d,0xe7,0x1b,0x7f,0x92,0x5f,0x6f,0xc8);
41 typedef struct IDirectMusicSynth8 IDirectMusicSynth8
, *LPDIRECTMUSICSYNTH8
;
42 DEFINE_GUID(IID_IDirectMusicSynthSink
, 0x9823663,0x5c85,0x11d2,0xaf,0xa6,0x0,0xaa, 0x0,0x24,0xd8,0xb6);
43 typedef struct IDirectMusicSynthSink IDirectMusicSynthSink
, *LPDIRECTMUSICSYNTHSINK
;
44 DEFINE_GUID(GUID_DMUS_PROP_SetSynthSink
, 0x0a3a5ba5,0x37b6,0x11d2,0xb9,0xf9,0x00,0x00,0xf8,0x75,0xac,0x12);
45 DEFINE_GUID(GUID_DMUS_PROP_SinkUsesDSound
, 0xbe208857,0x8952,0x11d2,0xba,0x1c,0x00,0x00,0xf8,0x75,0xac,0x12);
48 /*****************************************************************************
51 #ifndef _DMUS_VOICE_STATE_DEFINED
52 #define _DMUS_VOICE_STATE_DEFINED
54 typedef struct _DMUS_VOICE_STATE
57 SAMPLE_POSITION spPosition
;
60 #endif /* _DMUS_VOICE_STATE_DEFINED */
63 /*****************************************************************************
64 * IDirectMusicSynth interface
67 #define ICOM_INTERFACE IDirectMusicSynth
68 #define IDirectMusicSynth_METHODS \
69 /*** IDirectMusicSynth methods ***/ \
70 ICOM_METHOD1(HRESULT, Open, LPDMUS_PORTPARAMS,pPortParams) \
71 ICOM_METHOD (HRESULT, Close) \
72 ICOM_METHOD1(HRESULT, SetNumChannelGroups, DWORD,dwGroups) \
73 ICOM_METHOD3(HRESULT, Download, LPHANDLE,phDownload, LPVOID,pvData, LPBOOL,pbFree) \
74 ICOM_METHOD3(HRESULT, Unload, HANDLE,hDownload, HRESULT,(CALLBACK* lpFreeHandle)(HANDLE,HANDLE), HANDLE,hUserData) \
75 ICOM_METHOD3(HRESULT, PlayBuffer, REFERENCE_TIME,rt, LPBYTE,pbBuffer, DWORD,cbBuffer) \
76 ICOM_METHOD1(HRESULT, GetRunningStats, LPDMUS_SYNTHSTATS,pStats) \
77 ICOM_METHOD1(HRESULT, GetPortCaps, LPDMUS_PORTCAPS,pCaps) \
78 ICOM_METHOD1(HRESULT, SetMasterClock, IReferenceClock*,pClock) \
79 ICOM_METHOD1(HRESULT, GetLatencyClock, IReferenceClock**,ppClock) \
80 ICOM_METHOD1(HRESULT, Activate, BOOL,fEnable) \
81 ICOM_METHOD1(HRESULT, SetSynthSink, IDirectMusicSynthSink*,pSynthSink) \
82 ICOM_METHOD3(HRESULT, Render, short*,pBuffer, DWORD,dwLength, LONGLONG,llPosition) \
83 ICOM_METHOD3(HRESULT, SetChannelPriority, DWORD,dwChannelGroup, DWORD,dwChannel, DWORD,dwPriority) \
84 ICOM_METHOD3(HRESULT, GetChannelPriority, DWORD,dwChannelGroup, DWORD,dwChannel, LPDWORD,pdwPriority) \
85 ICOM_METHOD2(HRESULT, GetFormat, LPWAVEFORMATEX,pWaveFormatEx, LPDWORD,pdwWaveFormatExSiz) \
86 ICOM_METHOD1(HRESULT, GetAppend, DWORD*,pdwAppend)
88 /*** IDirectMusicSynth methods ***/
89 #define IDirectMusicSynth_IMETHODS \
91 IDirectMusicSynth_METHODS
92 ICOM_DEFINE(IDirectMusicSynth
,IUnknown
)
95 /*** IUnknown methods ***/
96 #define IDirectMusicSynth_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b)
97 #define IDirectMusicSynth_AddRef(p) ICOM_CALL (AddRef,p)
98 #define IDirectMusicSynth_Release(p) ICOM_CALL (Release,p)
99 /*** IDirectMusicSynth methods ***/
100 #define IDirectMusicSynth_Open(p,a) ICOM_CALL1(Open,p,a)
101 #define IDirectMusicSynth_Close(p) ICOM_CALL (Close,p)
102 #define IDirectMusicSynth_SetNumChannelGroups(p,a) ICOM_CALL1(SetNumChannelGroups,p,a)
103 #define IDirectMusicSynth_Download(p,a,b,c) ICOM_CALL3(Download,p,a,b,c)
104 #define IDirectMusicSynth_Unload(p,a,b,c) ICOM_CALL3(Unload,p,a,b,c)
105 #define IDirectMusicSynth_PlayBuffer(p,a,b,c) ICOM_CALL3(PlayBuffer,p,a,b,c)
106 #define IDirectMusicSynth_GetRunningStats(p,a) ICOM_CALL1(GetRunningStats,p,a)
107 #define IDirectMusicSynth_GetPortCaps(p,a) ICOM_CALL1(GetPortCaps,p,a)
108 #define IDirectMusicSynth_SetMasterClock(p,a) ICOM_CALL1(SetMasterClock,p,a)
109 #define IDirectMusicSynth_GetLatencyClock(p,a) ICOM_CALL1(GetLatencyClock,p,a)
110 #define IDirectMusicSynth_Activate(p,a) ICOM_CALL1(Activate,p,a)
111 #define IDirectMusicSynth_SetSynthSink(p,a) ICOM_CALL1(SetSynthSink,p,a)
112 #define IDirectMusicSynth_Render(p,a,b,c) ICOM_CALL3(Render,p,a,b,c)
113 #define IDirectMusicSynth_SetChannelPriority(p,a,b,c) ICOM_CALL3(SetChannelPriority,p,a,b,c)
114 #define IDirectMusicSynth_GetChannelPriority(p,a,b,c) ICOM_CALL3(GetChannelPriority,p,a,b,c)
115 #define IDirectMusicSynth_GetFormat(p,a,b) ICOM_CALL2(GetFormat,p,a,b)
116 #define IDirectMusicSynth_GetAppend(p,a) ICOM_CALL1(GetAppend,p,a)
119 /*****************************************************************************
120 * IDirectMusicSynth8 interface
122 #undef ICOM_INTERFACE
123 #define ICOM_INTERFACE IDirectMusicSynth8
124 #define IDirectMusicSynth8_METHODS \
125 /*** IDirectMusicSynth8 methods ***/ \
126 ICOM_METHOD10(HRESULT, PlayVoice, REFERENCE_TIME,rt, DWORD,dwVoiceId, DWORD,dwChannelGroup, DWORD,dwChannel, DWORD,dwDLId, long,prPitch, long,vrVolume, SAMPLE_TIME,stVoiceStart, SAMPLE_TIME,stLoopStart, SAMPLE_TIME,stLoopEnd) \
127 ICOM_METHOD2(HRESULT, StopVoice, REFERENCE_TIME,rt, DWORD,dwVoiceId) \
128 ICOM_METHOD3(HRESULT, GetVoiceState, DWORD,dwVoice[], DWORD,cbVoice, DMUS_VOICE_STATE,dwVoiceState[]) \
129 ICOM_METHOD2(HRESULT, Refresh, DWORD,dwDownloadID, DWORD,dwFlags) \
130 ICOM_METHOD4(HRESULT, AssignChannelToBuses, DWORD,dwChannelGroup, DWORD,dwChannel, LPDWORD,pdwBuses, DWORD,cBuses)
132 /*** IDirectMusicSynth methods ***/
133 #define IDirectMusicSynth8_IMETHODS \
135 IDirectMusicSynth_METHODS \
136 IDirectMusicSynth8_METHODS
137 ICOM_DEFINE(IDirectMusicSynth8
,IDirectMusicSynth
)
138 #undef ICOM_INTERFACE
140 /*** IUnknown methods ***/
141 #define IDirectMusicSynth8_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b)
142 #define IDirectMusicSynth8_AddRef(p) ICOM_CALL (AddRef,p)
143 #define IDirectMusicSynth8_Release(p) ICOM_CALL (Release,p)
144 /*** IDirectMusicSynth methods ***/
145 #define IDirectMusicSynth8_Open(p,a) ICOM_CALL1(Open,p,a)
146 #define IDirectMusicSynth8_Close(p) ICOM_CALL (Close,p)
147 #define IDirectMusicSynth8_SetNumChannelGroups(p,a) ICOM_CALL1(SetNumChannelGroups,p,a)
148 #define IDirectMusicSynth8_Download(p,a,b,c) ICOM_CALL3(Download,p,a,b,c)
149 #define IDirectMusicSynth8_Unload(p,a,b,c) ICOM_CALL3(Unload,p,a,b,c)
150 #define IDirectMusicSynth8_PlayBuffer(p,a,b,c) ICOM_CALL3(PlayBuffer,p,a,b,c)
151 #define IDirectMusicSynth8_GetRunningStats(p,a) ICOM_CALL1(GetRunningStats,p,a)
152 #define IDirectMusicSynth8_GetPortCaps(p,a) ICOM_CALL1(GetPortCaps,p,a)
153 #define IDirectMusicSynth8_SetMasterClock(p,a) ICOM_CALL1(SetMasterClock,p,a)
154 #define IDirectMusicSynth8_GetLatencyClock(p,a) ICOM_CALL1(GetLatencyClock,p,a)
155 #define IDirectMusicSynth8_Activate(p,a) ICOM_CALL1(Activate,p,a)
156 #define IDirectMusicSynth8_SetSynthSink(p,a) ICOM_CALL1(SetSynthSink,p,a)
157 #define IDirectMusicSynth8_Render(p,a,b,c) ICOM_CALL3(Render,p,a,b,c)
158 #define IDirectMusicSynth8_SetChannelPriority(p,a,b,c) ICOM_CALL3(SetChannelPriority,p,a,b,c)
159 #define IDirectMusicSynth8_GetChannelPriority(p,a,b,c) ICOM_CALL3(GetChannelPriority,p,a,b,c)
160 #define IDirectMusicSynth8_GetFormat(p,a,b) ICOM_CALL2(GetFormat,p,a,b)
161 #define IDirectMusicSynth8_GetAppend(p,a) ICOM_CALL1(GetAppend,p,a)
162 /*** IDirectMusicSynth8 methods ***/
163 #define IDirectMusicSynth8_PlayVoice(p,a,b,c,d,e,f,g,h,i,j) ICOM_CALL10(PlayVoice,p,a,b,c,d,e,f,g,h,i,j)
164 #define IDirectMusicSynth8_StopVoice(p,a,b) ICOM_CALL2(StopVoice,p,a,b)
165 #define IDirectMusicSynth8_GetVoiceState(p,a,b,c) ICOM_CALL3(GetVoiceState,p,a,b,c)
166 #define IDirectMusicSynth8_Refresh(p,a,b) ICOM_CALL2(Refresh,p,a,b)
167 #define IDirectMusicSynth8_AssignChannelToBuses(p,a,b,c,d) ICOM_CALL4(AssignChannelToBuses,p,a,b,c,d)
170 /*****************************************************************************
171 * IDirectMusicSynthSink interface
173 #undef ICOM_INTERFACE
174 #define ICOM_INTERFACE IDirectMusicSynthSink
175 #define IDirectMusicSynthSink_METHODS \
176 /*** IDirectMusicSynthSink methods ***/ \
177 ICOM_METHOD1(HRESULT, Init, IDirectMusicSynth*,pSynth) \
178 ICOM_METHOD1(HRESULT, SetMasterClock, IReferenceClock*,pClock) \
179 ICOM_METHOD1(HRESULT, GetLatencyClock, IReferenceClock**,ppClock) \
180 ICOM_METHOD1(HRESULT, Activate, BOOL,fEnable) \
181 ICOM_METHOD2(HRESULT, SampleToRefTime, LONGLONG,llSampleTime, REFERENCE_TIME*,prfTime) \
182 ICOM_METHOD2(HRESULT, RefTimeToSample, REFERENCE_TIME,rfTime, LONGLONG*,pllSampleTime) \
183 ICOM_METHOD2(HRESULT, SetDirectSound, LPDIRECTSOUND,pDirectSound, LPDIRECTSOUNDBUFFER,pDirectSoundBuffer) \
184 ICOM_METHOD1(HRESULT, GetDesiredBufferSize, LPDWORD,pdwBufferSizeInSamples)
186 /*** IDirectMusicSynthSink methods ***/
187 #define IDirectMusicSynthSink_IMETHODS \
189 IDirectMusicSynthSink_METHODS
190 ICOM_DEFINE(IDirectMusicSynthSink
,IUnknown
)
191 #undef ICOM_INTERFACE
193 /*** IUnknown methods ***/
194 #define IDirectMusicSynthSink_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b)
195 #define IDirectMusicSynthSink_AddRef(p) ICOM_CALL (AddRef,p)
196 #define IDirectMusicSynthSink_Release(p) ICOM_CALL (Release,p)
197 /*** IDirectMusicSynth methods ***/
198 #define IDirectMusicSynthSink_Init(p,a) ICOM_CALL1(Init,p,a)
199 #define IDirectMusicSynthSink_SetMasterClock(p,a) ICOM_CALL1(SetMasterClock,p,a)
200 #define IDirectMusicSynthSink_GetLatencyClock(p,a) ICOM_CALL1(GetLatencyClock,p,a)
201 #define IDirectMusicSynthSink_Activate(p,a) ICOM_CALL1(Activate,p,a)
202 #define IDirectMusicSynthSink_SampleToRefTime(p,a,b) ICOM_CALL2(SampleToRefTime,p,a,b)
203 #define IDirectMusicSynthSink_RefTimeToSample(p,a,b) ICOM_CALL2(RefTimeToSample,p,a,b)
204 #define IDirectMusicSynthSink_SetDirectSound(p,a,b) ICOM_CALL2(SetDirectSound,p,a,b)
205 #define IDirectMusicSynthSink_GetDesiredBufferSize(p,a) ICOM_CALL1(GetDesiredBufferSize,p,a)
207 #endif /* __WINE_DMUSIC_SOFTWARESYNTH_H */