1 | ' dmusicc.sbp - This module defines the DirectMusic core API's
|
---|
2 |
|
---|
3 |
|
---|
4 | #ifndef _INC_DMUSICC
|
---|
5 | #define _INC_DMUSICC
|
---|
6 |
|
---|
7 |
|
---|
8 | Const DMUS_MAX_DESCRIPTION = 128
|
---|
9 |
|
---|
10 | Type DMUS_BUFFERDESC
|
---|
11 | dwSize As DWord
|
---|
12 | dwFlags As DWord
|
---|
13 | guidBufferFormat As GUID
|
---|
14 | cbBuffer As DWord
|
---|
15 | End Type
|
---|
16 |
|
---|
17 | ' dwEffectFlags fields of both DMUS_PORTCAPS and DMUS_PORTPARAMS.
|
---|
18 | Const DMUS_EFFECT_NONE = &H00000000
|
---|
19 | Const DMUS_EFFECT_REVERB = &H00000001
|
---|
20 | Const DMUS_EFFECT_CHORUS = &H00000002
|
---|
21 | Const DMUS_EFFECT_DELAY = &H00000004
|
---|
22 |
|
---|
23 | ' For DMUS_PORTCAPS dwClass
|
---|
24 | Const DMUS_PC_INPUTCLASS = 0
|
---|
25 | Const DMUS_PC_OUTPUTCLASS = 1
|
---|
26 |
|
---|
27 | ' For DMUS_PORTCAPS dwFlags
|
---|
28 | Const DMUS_PC_DLS = &H00000001 'Supports DLS downloading and DLS level 1.
|
---|
29 | Const DMUS_PC_EXTERNAL = &H00000002 'External MIDI module.
|
---|
30 | Const DMUS_PC_SOFTWARESYNTH = &H00000004 'Software synthesizer.
|
---|
31 | Const DMUS_PC_MEMORYSIZEFIXED = &H00000008 'Memory size is fixed.
|
---|
32 | Const DMUS_PC_GMINHARDWARE = &H00000010 'GM sound set is built in, no need to download.
|
---|
33 | Const DMUS_PC_GSINHARDWARE = &H00000020 'GS sound set is built in.
|
---|
34 | Const DMUS_PC_XGINHARDWARE = &H00000040 'XG sound set is built in.
|
---|
35 | Const DMUS_PC_DIRECTSOUND = &H00000080 'Connects to DirectSound via a DSound buffer.
|
---|
36 | Const DMUS_PC_SHAREABLE = &H00000100 'Synth can be actively shared by multiple apps at once.
|
---|
37 | Const DMUS_PC_DLS2 = &H00000200 'Supports DLS2 instruments.
|
---|
38 | Const DMUS_PC_AUDIOPATH = &H00000400 'Multiple outputs can be connected to DirectSound for audiopaths.
|
---|
39 | Const DMUS_PC_WAVE = &H00000800 'Supports streaming and one shot waves.
|
---|
40 | Const DMUS_PC_SYSTEMMEMORY = &H7FFFFFFF 'Sample memory is system memory.
|
---|
41 |
|
---|
42 | ' For DMUS_PORTCAPS dwType
|
---|
43 | Const DMUS_PORT_WINMM_DRIVER = 0
|
---|
44 | Const DMUS_PORT_USER_MODE_SYNTH = 1
|
---|
45 | Const DMUS_PORT_KERNEL_MODE = 2
|
---|
46 |
|
---|
47 | Type DMUS_PORTCAPS
|
---|
48 | dwSize As DWord
|
---|
49 | dwFlags As DWord
|
---|
50 | guidPort As GUID
|
---|
51 | dwClass As DWord
|
---|
52 | dwType As DWord
|
---|
53 | dwMemorySize As DWord
|
---|
54 | dwMaxChannelGroups As DWord
|
---|
55 | dwMaxVoices As DWord
|
---|
56 | dwMaxAudioChannels As DWord
|
---|
57 | dwEffectFlags As DWord
|
---|
58 | wszDescription[DMUS_MAX_DESCRIPTION-1] As WCHAR
|
---|
59 | End Type
|
---|
60 |
|
---|
61 | ' For DMUS_PORTPARAMS8 dwValidParams
|
---|
62 | Const DMUS_PORTPARAMS_VOICES = &H00000001
|
---|
63 | Const DMUS_PORTPARAMS_CHANNELGROUPS = &H00000002
|
---|
64 | Const DMUS_PORTPARAMS_AUDIOCHANNELS = &H00000004
|
---|
65 | Const DMUS_PORTPARAMS_SAMPLERATE = &H00000008
|
---|
66 | Const DMUS_PORTPARAMS_EFFECTS = &H00000020
|
---|
67 | Const DMUS_PORTPARAMS_SHARE = &H00000040
|
---|
68 | Const DMUS_PORTPARAMS_FEATURES = &H00000080
|
---|
69 |
|
---|
70 | ' For DMUS_PORTPARAMS8 dwFeatures
|
---|
71 | Const DMUS_PORT_FEATURE_AUDIOPATH = &H00000001 'Supports audiopath connection to DSound buffers.
|
---|
72 | Const DMUS_PORT_FEATURE_STREAMING = &H00000002 'Supports streaming waves through the synth.
|
---|
73 |
|
---|
74 | Type DMUS_PORTPARAMS8
|
---|
75 | dwSize As DWord
|
---|
76 | dwValidParams As DWord
|
---|
77 | dwVoices As DWord
|
---|
78 | dwChannelGroups As DWord
|
---|
79 | dwAudioChannels As DWord
|
---|
80 | dwSampleRate As DWord
|
---|
81 | dwEffectFlags As DWord
|
---|
82 | fShare As Long
|
---|
83 | dwFeatures As DWord
|
---|
84 | End Type
|
---|
85 | TypeDef DMUS_PORTPARAMS = DMUS_PORTPARAMS8
|
---|
86 |
|
---|
87 | Type DMUS_SYNTHSTATS
|
---|
88 | dwSize As DWord 'Size in bytes of the structure
|
---|
89 | dwValidStats As DWord 'Flags indicating which fields below are valid.
|
---|
90 | dwVoices As DWord 'Average number of voices playing.
|
---|
91 | dwTotalCPU As DWord 'Total CPU usage as percent * 100.
|
---|
92 | dwCPUPerVoice As DWord 'CPU per voice as percent * 100.
|
---|
93 | dwLostNotes As DWord 'Number of notes lost in 1 second.
|
---|
94 | dwFreeMemory As DWord 'Free memory in bytes
|
---|
95 | lPeakVolume As Long 'Decibel level * 100.
|
---|
96 | End Type
|
---|
97 |
|
---|
98 | Const Enum DMUS_CLOCKTYPE
|
---|
99 | DMUS_CLOCK_SYSTEM = 0
|
---|
100 | DMUS_CLOCK_WAVE = 1
|
---|
101 | End Enum
|
---|
102 |
|
---|
103 | Type DMUS_CLOCKINFO
|
---|
104 | dwSize As DWord
|
---|
105 | ctType As DMUS_CLOCKTYPE
|
---|
106 | guidClock As GUID
|
---|
107 | wszDescription[DMUS_MAX_DESCRIPTION-1] As WCHAR
|
---|
108 | dwFlags As DWord
|
---|
109 | End Type
|
---|
110 | TypeDef DMUS_CLOCKINFO8 = DMUS_CLOCKINFO
|
---|
111 |
|
---|
112 |
|
---|
113 | '-----------------
|
---|
114 | ' Interface
|
---|
115 | '-----------------
|
---|
116 |
|
---|
117 | Class IDirectMusic
|
---|
118 | Inherits IUnknown
|
---|
119 | Public
|
---|
120 | 'IDirectMusic
|
---|
121 | Abstract Function EnumPort(dwIndex As DWord, pPortCaps As *DMUS_PORTCAPS) As DWord
|
---|
122 | Abstract Function CreateMusicBuffer(pBufferDesc As *DMUS_BUFFERDESC, ppBuffer As *LPDIRECTMUSICBUFFER, pUnkOuter As LPUNKNOWN) As DWord
|
---|
123 | Abstract Function CreatePort(ByRef rclsidPort As GUID, pPortParams As *DMUS_PORTPARAMS, ppPort As *LPDIRECTMUSICPORT8, pUnkOuter As LPUNKNOWN) As DWord
|
---|
124 | Abstract Function EnumMasterClock(dwIndex As DWord, lpClockInfo As *DMUS_CLOCKINFO) As DWord
|
---|
125 | Abstract Function GetMasterClock(pguidClock As *GUID, ppReferenceClock As **IReferenceClock) As DWord
|
---|
126 | Abstract Function SetMasterClock(ByRef rguidClock As GUID) As DWord
|
---|
127 | Abstract Function Activate(fEnable As Long) As DWord
|
---|
128 | Abstract Function GetDefaultPort(pguidPort As *GUID) As DWord
|
---|
129 | Abstract Function SetDirectSound(pDirectSound As LPDIRECTSOUND, hWnd As HWND) As DWord
|
---|
130 | End Class
|
---|
131 | TypeDef LPDIRECTMUSIC = *IDirectMusic
|
---|
132 |
|
---|
133 | Class IDirectMusic8
|
---|
134 | Inherits IDirectMusic
|
---|
135 | Public
|
---|
136 | 'IDirectMusic8
|
---|
137 | Abstract Function SetExternalMasterClock(pClock As *IReferenceClock) As DWord
|
---|
138 | End Class
|
---|
139 | TypeDef LPDIRECTMUSIC8 = *IDirectMusic8
|
---|
140 |
|
---|
141 | Class IDirectMusicBuffer
|
---|
142 | Inherits IUnknown
|
---|
143 | Public
|
---|
144 | 'IDirectMusicBuffer
|
---|
145 | Abstract Function Flush() As DWord
|
---|
146 | Abstract Function TotalTime(prtTime As *REFERENCE_TIME) As DWord
|
---|
147 | Abstract Function PackStructured(rt As REFERENCE_TIME, dwChannelGroup As DWord, dwChannelMessage As DWord) As DWord
|
---|
148 | Abstract Function PackUnstructured(rt As REFERENCE_TIME, dwChannelGroup As DWord, cb As DWord, lpb As BytePtr) As DWord
|
---|
149 | Abstract Function ResetReadPtr() As DWord
|
---|
150 | Abstract Function GetNextEvent(prt As *REFERENCE_TIME, pdwChannelGroup As DWordPtr, pdwLength As DWordPtr, ppData As **Byte) As DWord
|
---|
151 | Abstract Function GetRawBufferPtr(ppData As **Byte) As DWord
|
---|
152 | Abstract Function GetStartTime(prt As *REFERENCE_TIME) As DWord
|
---|
153 | Abstract Function GetUsedBytes(pcb As DWordPtr) As DWord
|
---|
154 | Abstract Function GetMaxBytes(pcb As DWordPtr) As DWord
|
---|
155 | Abstract Function GetBufferFormat(pGuidFormat As *GUID) As DWord
|
---|
156 | Abstract Function SetStartTime(rt As REFERENCE_TIME) As DWord
|
---|
157 | Abstract Function SetUsedBytes(cb As DWord) As DWord
|
---|
158 | End Class
|
---|
159 | TypeDef LPDIRECTMUSICBUFFER = *IDirectMusicBuffer
|
---|
160 | TypeDef IDirectMusicBuffer8 = IDirectMusicBuffer
|
---|
161 | TypeDef LPDIRECTMUSICBUFFER8 = *IDirectMusicBuffer8
|
---|
162 |
|
---|
163 | Class IDirectMusicInstrument
|
---|
164 | Inherits IUnknown
|
---|
165 | Public
|
---|
166 | 'IDirectMusicInstrument
|
---|
167 | Abstract Function GetPatch(pdwPatch As DWordPtr) As DWord
|
---|
168 | Abstract Function SetPatch(dwPatch As DWord) As DWord
|
---|
169 | End Class
|
---|
170 | TypeDef IDirectMusicInstrument8 = IDirectMusicInstrument
|
---|
171 | TypeDef LPDIRECTMUSICINSTRUMENT8 = *IDirectMusicInstrument8
|
---|
172 |
|
---|
173 | Class IDirectMusicDownloadedInstrument
|
---|
174 | Inherits IUnknown
|
---|
175 | End Class
|
---|
176 | TypeDef IDirectMusicDownloadedInstrument8 = IDirectMusicDownloadedInstrument
|
---|
177 | TypeDef LPDIRECTMUSICDOWNLOADEDINSTRUMENT8 = *IDirectMusicDownloadedInstrument8
|
---|
178 |
|
---|
179 | Class IDirectMusicCollection
|
---|
180 | Inherits IUnknown
|
---|
181 | Public
|
---|
182 | 'IDirectMusicCollection
|
---|
183 | Abstract Function GetInstrument(dwPatch As DWord, ppInstrument As **IDirectMusicInstrument) As DWord
|
---|
184 | Abstract Function EnumInstrument(dwIndex As DWord, pdwPatch As DWordPtr, pwszName As *WCHAR, dwNameLen As DWord) As DWord
|
---|
185 | End Class
|
---|
186 | TypeDef IDirectMusicCollection8 = IDirectMusicCollection
|
---|
187 | TypeDef LPDIRECTMUSICCOLLECTION8 = *IDirectMusicCollection8
|
---|
188 |
|
---|
189 | Class IDirectMusicDownload
|
---|
190 | Inherits IUnknown
|
---|
191 | Public
|
---|
192 | 'IDirectMusicDownload
|
---|
193 | Abstract Function GetBuffer(ppvBuffer As DWordPtr, pdwSize As DWordPtr) As DWord
|
---|
194 | End Class
|
---|
195 | TypeDef IDirectMusicDownload8 = IDirectMusicDownload
|
---|
196 | TypeDef LPDIRECTMUSICDOWNLOAD8 = *IDirectMusicDownload8
|
---|
197 |
|
---|
198 | Class IDirectMusicPortDownload
|
---|
199 | Inherits IUnknown
|
---|
200 | Public
|
---|
201 | 'IDirectMusicPortDownload
|
---|
202 | Abstract Function GetBuffer(dwDLId As DWord, ppIDMDownload As **IDirectMusicDownload) As DWord
|
---|
203 | Abstract Function AllocateBuffer(dwSize As DWord, ppIDMDownload As **IDirectMusicDownload) As DWord
|
---|
204 | Abstract Function GetDLId(pdwStartDLId As DWordPtr, dwCount As DWord) As DWord
|
---|
205 | Abstract Function GetAppend(pdwAppend As DWordPtr) As DWord
|
---|
206 | Abstract Function Download(pIDMDownload As *IDirectMusicDownload) As DWord
|
---|
207 | Abstract Function Unload(pIDMDownload As *IDirectMusicDownload) As DWord
|
---|
208 | End Class
|
---|
209 | TypeDef IDirectMusicPortDownload8 = IDirectMusicPortDownload
|
---|
210 | TypeDef LPDIRECTMUSICPORTDOWNLOAD8 = *IDirectMusicPortDownload8
|
---|
211 |
|
---|
212 | Class IDirectMusicPort
|
---|
213 | Inherits IUnknown
|
---|
214 | Public
|
---|
215 | 'IDirectMusicPort
|
---|
216 | Abstract Function PlayBuffer(pBuffer As LPDIRECTMUSICBUFFER) As DWord
|
---|
217 | Abstract Function SetReadNotificationHandle(hEvent As HANDLE) As DWord
|
---|
218 | Abstract Function Read(pBuffer As LPDIRECTMUSICBUFFER) As DWord
|
---|
219 | Abstract Function DownloadInstrument(pInstrument As *IDirectMusicInstrument, ppDownloadedInstrument As **IDirectMusicDownloadedInstrument, pNoteRanges As *DMUS_NOTERANGE, dwNumNoteRanges As DWord) As DWord
|
---|
220 | Abstract Function UnloadInstrument(pDownloadedInstrument As *IDirectMusicDownloadedInstrument) As DWord
|
---|
221 | Abstract Function GetLatencyClock(ppClock As **IReferenceClock) As DWord
|
---|
222 | Abstract Function GetRunningStats(pStats As *DMUS_SYNTHSTATS) As DWord
|
---|
223 | Abstract Function Compact() As DWord
|
---|
224 | Abstract Function GetCaps(pPortCaps As *DMUS_PORTCAPS) As DWord
|
---|
225 | Abstract Function DeviceIoControl(dwIoControlCode As DWord, lpInBuffer As VoidPtr, nInBufferSize As DWord, lpOutBuffer As VoidPtr, nOutBufferSize As DWord, lpBytesReturned As DWordPtr, lpOverlapped As *OVERLAPPED) As DWord
|
---|
226 | Abstract Function SetNumChannelGroups(dwChannelGroups As DWord) As DWord
|
---|
227 | Abstract Function GetNumChannelGroups(pdwChannelGroups As DWordPtr) As DWord
|
---|
228 | Abstract Function Activate(fActive As Long) As DWord
|
---|
229 | Abstract Function SetChannelPriority(dwChannelGroup As DWord, dwChannel As DWord, dwPriority As DWord) As DWord
|
---|
230 | Abstract Function GetChannelPriority(dwChannelGroup As DWord, dwChannel As DWord, pdwPriority As DWordPtr) As DWord
|
---|
231 | Abstract Function SetDirectSound(pDirectSound As LPDIRECTSOUND, pDirectSoundBuffer As LPDIRECTSOUNDBUFFER) As DWord
|
---|
232 | Abstract Function GetFormat(pWaveFormatEx As *WAVEFORMATEX, pdwWaveFormatExSize As DWordPtr, pdwBufferSize As DWordPtr) As DWord
|
---|
233 | End Class
|
---|
234 | TypeDef IDirectMusicPort8 = IDirectMusicPort
|
---|
235 | TypeDef LPDIRECTMUSICPORT8 = *IDirectMusicPort8
|
---|
236 |
|
---|
237 | Class IDirectMusicThru
|
---|
238 | Inherits IUnknown
|
---|
239 | Public
|
---|
240 | 'IDirectMusicThru
|
---|
241 | Abstract Function ThruChannel(dwSourceChannelGroup As DWord, dwSourceChannel As DWord, dwDestinationChannelGroup As DWord, dwDestinationChannel As DWord, pDestinationPort As LPDIRECTMUSICPORT8) As DWord
|
---|
242 | End Class
|
---|
243 | TypeDef IDirectMusicThru8 = IDirectMusicThru
|
---|
244 | TypeDef LPDIRECTMUSICTHRU8 = *IDirectMusicThru8
|
---|
245 |
|
---|
246 |
|
---|
247 | '-----------------
|
---|
248 | ' CLSID and IID
|
---|
249 | '-----------------
|
---|
250 |
|
---|
251 | Dim CLSID_DirectMusic = [&H636b9f10,&H0c7d,&H11d1,[&H95,&Hb2,&H00,&H20,&Haf,&Hdc,&H74,&H21]] As GUID
|
---|
252 | Dim CLSID_DirectMusicCollection = [&H480ff4b0, &H28b2, &H11d1, [&Hbe, &Hf7, &H0, &Hc0, &H4f, &Hbf, &H8f, &Hef]] As GUID
|
---|
253 | Dim CLSID_DirectMusicSynth = [&H58C2B4D0,&H46E7,&H11D1,[&H89,&HAC,&H00,&HA0,&HC9,&H05,&H41,&H29]] As GUID
|
---|
254 |
|
---|
255 | Dim IID_IDirectMusic = [&H6536115a,&H7b2d,&H11d2,[&Hba,&H18,&H00,&H00,&Hf8,&H75,&Hac,&H12]] As GUID
|
---|
256 | Dim IID_IDirectMusicBuffer = [&Hd2ac2878, &Hb39b, &H11d1, [&H87, &H4, &H0, &H60, &H8, &H93, &Hb1, &Hbd]] As GUID
|
---|
257 | Dim IID_IDirectMusicPort = [&H08f2d8c9,&H37c2,&H11d2,[&Hb9,&Hf9,&H00,&H00,&Hf8,&H75,&Hac,&H12]] As GUID
|
---|
258 | Dim IID_IDirectMusicThru = [&Hced153e7, &H3606, &H11d2, [&Hb9, &Hf9, &H00, &H00, &Hf8, &H75, &Hac, &H12]] As GUID
|
---|
259 | Dim IID_IDirectMusicPortDownload = [&Hd2ac287a, &Hb39b, &H11d1, [&H87, &H4, &H0, &H60, &H8, &H93, &Hb1, &Hbd]] As GUID
|
---|
260 | Dim IID_IDirectMusicDownload = [&Hd2ac287b, &Hb39b, &H11d1, [&H87, &H4, &H0, &H60, &H8, &H93, &Hb1, &Hbd]] As GUID
|
---|
261 | Dim IID_IDirectMusicCollection = [&Hd2ac287c, &Hb39b, &H11d1, [&H87, &H4, &H0, &H60, &H8, &H93, &Hb1, &Hbd]] As GUID
|
---|
262 | Dim IID_IDirectMusicInstrument = [&Hd2ac287d, &Hb39b, &H11d1, [&H87, &H4, &H0, &H60, &H8, &H93, &Hb1, &Hbd]] As GUID
|
---|
263 | Dim IID_IDirectMusicDownloadedInstrument = [&Hd2ac287e, &Hb39b, &H11d1, [&H87, &H4, &H0, &H60, &H8, &H93, &Hb1, &Hbd]] As GUID
|
---|
264 |
|
---|
265 |
|
---|
266 | #endif '_INC_DMUSICC
|
---|