source: Include/directx9/dmusicc.sbp@ 176

Last change on this file since 176 was 1, checked in by (none), 18 years ago
File size: 11.7 KB
Line 
1' dmusicc.sbp - This module defines the DirectMusic core API's
2
3
4#ifndef _INC_DMUSICC
5#define _INC_DMUSICC
6
7
8Const DMUS_MAX_DESCRIPTION = 128
9
10Type DMUS_BUFFERDESC
11 dwSize As DWord
12 dwFlags As DWord
13 guidBufferFormat As GUID
14 cbBuffer As DWord
15End Type
16
17' dwEffectFlags fields of both DMUS_PORTCAPS and DMUS_PORTPARAMS.
18Const DMUS_EFFECT_NONE = &H00000000
19Const DMUS_EFFECT_REVERB = &H00000001
20Const DMUS_EFFECT_CHORUS = &H00000002
21Const DMUS_EFFECT_DELAY = &H00000004
22
23' For DMUS_PORTCAPS dwClass
24Const DMUS_PC_INPUTCLASS = 0
25Const DMUS_PC_OUTPUTCLASS = 1
26
27' For DMUS_PORTCAPS dwFlags
28Const DMUS_PC_DLS = &H00000001 'Supports DLS downloading and DLS level 1.
29Const DMUS_PC_EXTERNAL = &H00000002 'External MIDI module.
30Const DMUS_PC_SOFTWARESYNTH = &H00000004 'Software synthesizer.
31Const DMUS_PC_MEMORYSIZEFIXED = &H00000008 'Memory size is fixed.
32Const DMUS_PC_GMINHARDWARE = &H00000010 'GM sound set is built in, no need to download.
33Const DMUS_PC_GSINHARDWARE = &H00000020 'GS sound set is built in.
34Const DMUS_PC_XGINHARDWARE = &H00000040 'XG sound set is built in.
35Const DMUS_PC_DIRECTSOUND = &H00000080 'Connects to DirectSound via a DSound buffer.
36Const DMUS_PC_SHAREABLE = &H00000100 'Synth can be actively shared by multiple apps at once.
37Const DMUS_PC_DLS2 = &H00000200 'Supports DLS2 instruments.
38Const DMUS_PC_AUDIOPATH = &H00000400 'Multiple outputs can be connected to DirectSound for audiopaths.
39Const DMUS_PC_WAVE = &H00000800 'Supports streaming and one shot waves.
40Const DMUS_PC_SYSTEMMEMORY = &H7FFFFFFF 'Sample memory is system memory.
41
42' For DMUS_PORTCAPS dwType
43Const DMUS_PORT_WINMM_DRIVER = 0
44Const DMUS_PORT_USER_MODE_SYNTH = 1
45Const DMUS_PORT_KERNEL_MODE = 2
46
47Type 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
59End Type
60
61' For DMUS_PORTPARAMS8 dwValidParams
62Const DMUS_PORTPARAMS_VOICES = &H00000001
63Const DMUS_PORTPARAMS_CHANNELGROUPS = &H00000002
64Const DMUS_PORTPARAMS_AUDIOCHANNELS = &H00000004
65Const DMUS_PORTPARAMS_SAMPLERATE = &H00000008
66Const DMUS_PORTPARAMS_EFFECTS = &H00000020
67Const DMUS_PORTPARAMS_SHARE = &H00000040
68Const DMUS_PORTPARAMS_FEATURES = &H00000080
69
70' For DMUS_PORTPARAMS8 dwFeatures
71Const DMUS_PORT_FEATURE_AUDIOPATH = &H00000001 'Supports audiopath connection to DSound buffers.
72Const DMUS_PORT_FEATURE_STREAMING = &H00000002 'Supports streaming waves through the synth.
73
74Type 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
84End Type
85TypeDef DMUS_PORTPARAMS = DMUS_PORTPARAMS8
86
87Type 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.
96End Type
97
98Const Enum DMUS_CLOCKTYPE
99 DMUS_CLOCK_SYSTEM = 0
100 DMUS_CLOCK_WAVE = 1
101End Enum
102
103Type 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
109End Type
110TypeDef DMUS_CLOCKINFO8 = DMUS_CLOCKINFO
111
112
113'-----------------
114' Interface
115'-----------------
116
117Class IDirectMusic
118 Inherits IUnknown
119Public
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
130End Class
131TypeDef LPDIRECTMUSIC = *IDirectMusic
132
133Class IDirectMusic8
134 Inherits IDirectMusic
135Public
136 'IDirectMusic8
137 Abstract Function SetExternalMasterClock(pClock As *IReferenceClock) As DWord
138End Class
139TypeDef LPDIRECTMUSIC8 = *IDirectMusic8
140
141Class IDirectMusicBuffer
142 Inherits IUnknown
143Public
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
158End Class
159TypeDef LPDIRECTMUSICBUFFER = *IDirectMusicBuffer
160TypeDef IDirectMusicBuffer8 = IDirectMusicBuffer
161TypeDef LPDIRECTMUSICBUFFER8 = *IDirectMusicBuffer8
162
163Class IDirectMusicInstrument
164 Inherits IUnknown
165Public
166 'IDirectMusicInstrument
167 Abstract Function GetPatch(pdwPatch As DWordPtr) As DWord
168 Abstract Function SetPatch(dwPatch As DWord) As DWord
169End Class
170TypeDef IDirectMusicInstrument8 = IDirectMusicInstrument
171TypeDef LPDIRECTMUSICINSTRUMENT8 = *IDirectMusicInstrument8
172
173Class IDirectMusicDownloadedInstrument
174 Inherits IUnknown
175End Class
176TypeDef IDirectMusicDownloadedInstrument8 = IDirectMusicDownloadedInstrument
177TypeDef LPDIRECTMUSICDOWNLOADEDINSTRUMENT8 = *IDirectMusicDownloadedInstrument8
178
179Class IDirectMusicCollection
180 Inherits IUnknown
181Public
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
185End Class
186TypeDef IDirectMusicCollection8 = IDirectMusicCollection
187TypeDef LPDIRECTMUSICCOLLECTION8 = *IDirectMusicCollection8
188
189Class IDirectMusicDownload
190 Inherits IUnknown
191Public
192 'IDirectMusicDownload
193 Abstract Function GetBuffer(ppvBuffer As DWordPtr, pdwSize As DWordPtr) As DWord
194End Class
195TypeDef IDirectMusicDownload8 = IDirectMusicDownload
196TypeDef LPDIRECTMUSICDOWNLOAD8 = *IDirectMusicDownload8
197
198Class IDirectMusicPortDownload
199 Inherits IUnknown
200Public
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
208End Class
209TypeDef IDirectMusicPortDownload8 = IDirectMusicPortDownload
210TypeDef LPDIRECTMUSICPORTDOWNLOAD8 = *IDirectMusicPortDownload8
211
212Class IDirectMusicPort
213 Inherits IUnknown
214Public
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
233End Class
234TypeDef IDirectMusicPort8 = IDirectMusicPort
235TypeDef LPDIRECTMUSICPORT8 = *IDirectMusicPort8
236
237Class IDirectMusicThru
238 Inherits IUnknown
239Public
240 'IDirectMusicThru
241 Abstract Function ThruChannel(dwSourceChannelGroup As DWord, dwSourceChannel As DWord, dwDestinationChannelGroup As DWord, dwDestinationChannel As DWord, pDestinationPort As LPDIRECTMUSICPORT8) As DWord
242End Class
243TypeDef IDirectMusicThru8 = IDirectMusicThru
244TypeDef LPDIRECTMUSICTHRU8 = *IDirectMusicThru8
245
246
247'-----------------
248' CLSID and IID
249'-----------------
250
251Dim CLSID_DirectMusic = [&H636b9f10,&H0c7d,&H11d1,[&H95,&Hb2,&H00,&H20,&Haf,&Hdc,&H74,&H21]] As GUID
252Dim CLSID_DirectMusicCollection = [&H480ff4b0, &H28b2, &H11d1, [&Hbe, &Hf7, &H0, &Hc0, &H4f, &Hbf, &H8f, &Hef]] As GUID
253Dim CLSID_DirectMusicSynth = [&H58C2B4D0,&H46E7,&H11D1,[&H89,&HAC,&H00,&HA0,&HC9,&H05,&H41,&H29]] As GUID
254
255Dim IID_IDirectMusic = [&H6536115a,&H7b2d,&H11d2,[&Hba,&H18,&H00,&H00,&Hf8,&H75,&Hac,&H12]] As GUID
256Dim IID_IDirectMusicBuffer = [&Hd2ac2878, &Hb39b, &H11d1, [&H87, &H4, &H0, &H60, &H8, &H93, &Hb1, &Hbd]] As GUID
257Dim IID_IDirectMusicPort = [&H08f2d8c9,&H37c2,&H11d2,[&Hb9,&Hf9,&H00,&H00,&Hf8,&H75,&Hac,&H12]] As GUID
258Dim IID_IDirectMusicThru = [&Hced153e7, &H3606, &H11d2, [&Hb9, &Hf9, &H00, &H00, &Hf8, &H75, &Hac, &H12]] As GUID
259Dim IID_IDirectMusicPortDownload = [&Hd2ac287a, &Hb39b, &H11d1, [&H87, &H4, &H0, &H60, &H8, &H93, &Hb1, &Hbd]] As GUID
260Dim IID_IDirectMusicDownload = [&Hd2ac287b, &Hb39b, &H11d1, [&H87, &H4, &H0, &H60, &H8, &H93, &Hb1, &Hbd]] As GUID
261Dim IID_IDirectMusicCollection = [&Hd2ac287c, &Hb39b, &H11d1, [&H87, &H4, &H0, &H60, &H8, &H93, &Hb1, &Hbd]] As GUID
262Dim IID_IDirectMusicInstrument = [&Hd2ac287d, &Hb39b, &H11d1, [&H87, &H4, &H0, &H60, &H8, &H93, &Hb1, &Hbd]] As GUID
263Dim IID_IDirectMusicDownloadedInstrument = [&Hd2ac287e, &Hb39b, &H11d1, [&H87, &H4, &H0, &H60, &H8, &H93, &Hb1, &Hbd]] As GUID
264
265
266#endif '_INC_DMUSICC
Note: See TracBrowser for help on using the repository browser.