source: branch/egtra-stream-without-en_dec/directx9/dmusicc.sbp@ 673

Last change on this file since 673 was 497, checked in by イグトランス (egtra), 17 years ago

インクルードガードとその他不要な前処理定義などの削除

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