Mercurial > projects > dstep
comparison dstep/coreaudio/AudioHardware.d @ 16:19885b43130e
Huge update, the bridge actually works now
author | Jacob Carlborg <doob@me.com> |
---|---|
date | Sun, 03 Jan 2010 22:06:11 +0100 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
15:7ff919f595d5 | 16:19885b43130e |
---|---|
1 /** | |
2 * Copyright: Copyright (c) 2009 Jacob Carlborg. | |
3 * Authors: Jacob Carlborg | |
4 * Version: Initial created: Sep 30, 2009 | |
5 * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0) | |
6 */ | |
7 module dstep.coreaudio.AudioHardware; | |
8 | |
9 import dstep.coreaudio.CoreAudioTypes; | |
10 import dstep.corefoundation.CoreFoundation; | |
11 import dstep.internal.Version; | |
12 import dstep.objc.bridge.TypeEncoding; | |
13 | |
14 alias uint AudioObjectPropertySelector; | |
15 alias uint AudioObjectPropertyScope; | |
16 alias uint AudioObjectPropertyElement; | |
17 alias uint AudioClassID; | |
18 alias uint AudioObjectID; | |
19 alias uint AudioHardwarePropertyID; | |
20 alias uint AudioDeviceID; | |
21 alias uint AudioDevicePropertyID; | |
22 alias AudioDeviceIOProc AudioDeviceIOProcID; | |
23 alias uint AudioStreamID; | |
24 | |
25 extern (C) | |
26 { | |
27 alias int function (AudioDeviceID inDevice, uint inChannel, bool isInput, AudioDevicePropertyID inPropertyID) AudioDevicePropertyListenerProc; | |
28 alias int function (AudioDevicePropertyID inPropertyID, void* inClientData) AudioHardwarePropertyListenerProc; | |
29 alias int function (AudioDeviceID inDevice, AudioTimeStamp* inNow, AudioBufferList* inInputData, AudioTimeStamp* inInputTime, AudioBufferList* outOutputData, AudioTimeStamp* inOutputTime, void* inClientData) AudioDeviceIOProc; | |
30 alias int function (AudioStreamID inStream, uint inChannel, AudioDevicePropertyID inPropertyID, void* inClientData) AudioStreamPropertyListenerProc; | |
31 alias int function (AudioObjectID inObjectID, uint inNumberAddresses, AudioObjectPropertyAddress* inAddresses, void* inClientData) AudioObjectPropertyListenerProc; | |
32 } | |
33 | |
34 // This is needed otherwise the enums will fail compiling with gdc | |
35 version (GNU) | |
36 { | |
37 private | |
38 { | |
39 const __kAudioHardwareNotRunningError = getOSType!("stop"); | |
40 const __kAudioHardwareUnspecifiedError = getOSType!("what"); | |
41 const __kAudioHardwareUnknownPropertyError = getOSType!("who?"); | |
42 const __kAudioHardwareBadPropertySizeError = getOSType!("!siz"); | |
43 const __kAudioHardwareIllegalOperationError = getOSType!("nope"); | |
44 const __kAudioHardwareBadObjectError = getOSType!("!obj"); | |
45 const __kAudioHardwareBadDeviceError = getOSType!("!dev"); | |
46 const __kAudioHardwareBadStreamError = getOSType!("!str"); | |
47 const __kAudioHardwareUnsupportedOperationError = getOSType!("unop"); | |
48 const __kAudioDeviceUnsupportedFormatError = getOSType!("!dat"); | |
49 const __kAudioDevicePermissionsError = getOSType!("!hog"); | |
50 const __kAudioObjectPropertySelectorWildcard = getOSType!("****"); | |
51 const __kAudioObjectPropertyScopeWildcard = getOSType!("****"); | |
52 const __kAudioObjectPropertyScopeGlobal = getOSType!("glob"); | |
53 const __kAudioObjectClassID = getOSType!("aobj"); | |
54 const __kAudioObjectClassIDWildcard = getOSType!("****"); | |
55 const __kAudioObjectPropertyClass = getOSType!("clas"); | |
56 const __kAudioObjectPropertyOwner = getOSType!("stdv"); | |
57 const __kAudioObjectPropertyCreator = getOSType!("oplg"); | |
58 const __kAudioObjectPropertyName = getOSType!("lnam"); | |
59 const __kAudioObjectPropertyManufacturer = getOSType!("lmak"); | |
60 const __kAudioObjectPropertyElementName = getOSType!("lchn"); | |
61 const __kAudioObjectPropertyElementCategoryName = getOSType!("lccn"); | |
62 const __kAudioObjectPropertyElementNumberName = getOSType!("lcnn"); | |
63 const __kAudioObjectPropertyOwnedObjects = getOSType!("ownd"); | |
64 const __kAudioObjectPropertyListenerAdded = getOSType!("lisa"); | |
65 const __kAudioObjectPropertyListenerRemoved = getOSType!("lisr"); | |
66 const __kAudioControlClassID = getOSType!("actl"); | |
67 const __kAudioLevelControlClassID = getOSType!("levl"); | |
68 const __kAudioBooleanControlClassID = getOSType!("togl"); | |
69 const __kAudioSelectorControlClassID = getOSType!("slct"); | |
70 const __kAudioStereoPanControlClassID = getOSType!("span"); | |
71 const __kAudioVolumeControlClassID = getOSType!("vlme"); | |
72 const __kAudioLFEVolumeControlClassID = getOSType!("subv"); | |
73 const __kAudioBootChimeVolumeControlClassID = getOSType!("pram"); | |
74 const __kAudioMuteControlClassID = getOSType!("mute"); | |
75 const __kAudioSoloControlClassID = getOSType!("solo"); | |
76 const __kAudioJackControlClassID = getOSType!("jack"); | |
77 const __kAudioLFEMuteControlClassID = getOSType!("subm"); | |
78 const __kAudioISubOwnerControlClassID = getOSType!("atch"); | |
79 const __kAudioDataSourceControlClassID = getOSType!("dsrc"); | |
80 const __kAudioDataDestinationControlClassID = getOSType!("dest"); | |
81 const __kAudioClockSourceControlClassID = getOSType!("clck"); | |
82 const __kAudioLineLevelControlClassID = getOSType!("nlvl"); | |
83 const __kAudioControlPropertyScope = getOSType!("cscp"); | |
84 const __kAudioControlPropertyElement = getOSType!("celm"); | |
85 const __kAudioControlPropertyVariant = getOSType!("cvar"); | |
86 const __kAudioLevelControlPropertyScalarValue = getOSType!("lcsv"); | |
87 const __kAudioLevelControlPropertyDecibelValue = getOSType!("lcdv"); | |
88 const __kAudioLevelControlPropertyDecibelRange = getOSType!("lcdr"); | |
89 const __kAudioLevelControlPropertyConvertScalarToDecibels = getOSType!("lcsd"); | |
90 const __kAudioLevelControlPropertyConvertDecibelsToScalar = getOSType!("lcds"); | |
91 const __kAudioLevelControlPropertyDecibelsToScalarTransferFunction = getOSType!("lctf"); | |
92 const __kAudioBooleanControlPropertyValue = getOSType!("bcvl"); | |
93 const __kAudioSelectorControlPropertyCurrentItem = getOSType!("scci"); | |
94 const __kAudioSelectorControlPropertyAvailableItems = getOSType!("scai"); | |
95 const __kAudioSelectorControlPropertyItemName = getOSType!("scin"); | |
96 const __kAudioClockSourceControlPropertyItemKind = getOSType!("clkk"); | |
97 const __kAudioStereoPanControlPropertyValue = getOSType!("spcv"); | |
98 const __kAudioStereoPanControlPropertyPanningChannels = getOSType!("spcc"); | |
99 const __kAudioSystemObjectClassID = getOSType!("asys"); | |
100 const __kAudioHardwarePropertyProcessIsMaster = getOSType!("mast"); | |
101 const __kAudioHardwarePropertyIsInitingOrExiting = getOSType!("inot"); | |
102 const __kAudioHardwarePropertyDevices = getOSType!("dev#"); | |
103 const __kAudioHardwarePropertyDefaultInputDevice = getOSType!("dIn "); | |
104 const __kAudioHardwarePropertyDefaultOutputDevice = getOSType!("dOut"); | |
105 const __kAudioHardwarePropertyDefaultSystemOutputDevice = getOSType!("sOut"); | |
106 const __kAudioHardwarePropertyDeviceForUID = getOSType!("duid"); | |
107 const __kAudioHardwarePropertyProcessIsAudible = getOSType!("pmut"); | |
108 const __kAudioHardwarePropertySleepingIsAllowed = getOSType!("slep"); | |
109 const __kAudioHardwarePropertyUnloadingIsAllowed = getOSType!("unld"); | |
110 const __kAudioHardwarePropertyHogModeIsAllowed = getOSType!("hogr"); | |
111 const __kAudioHardwarePropertyRunLoop = getOSType!("rnlp"); | |
112 const __kAudioHardwarePropertyPlugInForBundleID = getOSType!("pibi"); | |
113 const __kAudioHardwarePropertyUserSessionIsActiveOrHeadless = getOSType!("user"); | |
114 const __kAudioHardwarePropertyBootChimeVolumeScalar = getOSType!("bbvs"); | |
115 const __kAudioHardwarePropertyBootChimeVolumeDecibels = getOSType!("bbvd"); | |
116 const __kAudioHardwarePropertyBootChimeVolumeRangeDecibels = getOSType!("bbd#"); | |
117 const __kAudioHardwarePropertyBootChimeVolumeScalarToDecibels = getOSType!("bv2d"); | |
118 const __kAudioHardwarePropertyBootChimeVolumeDecibelsToScalar = getOSType!("bd2v"); | |
119 const __kAudioHardwarePropertyBootChimeVolumeDecibelsToScalarTransferFunction = getOSType!("bvtf"); | |
120 const __kAudioPlugInClassID = getOSType!("aplg"); | |
121 const __kAudioPlugInPropertyBundleID = getOSType!("piid"); | |
122 const __kAudioPlugInCreateAggregateDevice = getOSType!("cagg"); | |
123 const __kAudioPlugInDestroyAggregateDevice = getOSType!("dagg"); | |
124 const __kAudioDevicePropertyScopeInput = getOSType!("inpt"); | |
125 const __kAudioDevicePropertyScopeOutput = getOSType!("outp"); | |
126 const __kAudioDevicePropertyScopePlayThrough = getOSType!("ptru"); | |
127 const __kAudioDeviceClassID = getOSType!("adev"); | |
128 const __kAudioDevicePropertyPlugIn = getOSType!("plug"); | |
129 const __kAudioDevicePropertyConfigurationApplication = getOSType!("capp"); | |
130 const __kAudioDevicePropertyDeviceUID = getOSType!("uid "); | |
131 const __kAudioDevicePropertyModelUID = getOSType!("muid"); | |
132 const __kAudioDevicePropertyTransportType = getOSType!("tran"); | |
133 const __kAudioDevicePropertyRelatedDevices = getOSType!("akin"); | |
134 const __kAudioDevicePropertyClockDomain = getOSType!("clkd"); | |
135 const __kAudioDevicePropertyDeviceIsAlive = getOSType!("livn"); | |
136 const __kAudioDevicePropertyDeviceHasChanged = getOSType!("diff"); | |
137 const __kAudioDevicePropertyDeviceIsRunning = getOSType!("goin"); | |
138 const __kAudioDevicePropertyDeviceIsRunningSomewhere = getOSType!("gone"); | |
139 const __kAudioDevicePropertyDeviceCanBeDefaultDevice = getOSType!("dflt"); | |
140 const __kAudioDevicePropertyDeviceCanBeDefaultSystemDevice = getOSType!("sflt"); | |
141 const __kAudioDeviceProcessorOverload = getOSType!("over"); | |
142 const __kAudioDevicePropertyHogMode = getOSType!("oink"); | |
143 const __kAudioDevicePropertyLatency = getOSType!("ltnc"); | |
144 const __kAudioDevicePropertyBufferFrameSize = getOSType!("fsiz"); | |
145 const __kAudioDevicePropertyBufferFrameSizeRange = getOSType!("fsz#"); | |
146 const __kAudioDevicePropertyUsesVariableBufferFrameSizes = getOSType!("vfsz"); | |
147 const __kAudioDevicePropertyStreams = getOSType!("stm#"); | |
148 const __kAudioDevicePropertySafetyOffset = getOSType!("saft"); | |
149 const __kAudioDevicePropertyIOCycleUsage = getOSType!("ncyc"); | |
150 const __kAudioDevicePropertyStreamConfiguration = getOSType!("slay"); | |
151 const __kAudioDevicePropertyIOProcStreamUsage = getOSType!("suse"); | |
152 const __kAudioDevicePropertyPreferredChannelsForStereo = getOSType!("dch2"); | |
153 const __kAudioDevicePropertyPreferredChannelLayout = getOSType!("srnd"); | |
154 const __kAudioDevicePropertyNominalSampleRate = getOSType!("nsrt"); | |
155 const __kAudioDevicePropertyAvailableNominalSampleRates = getOSType!("nsr#"); | |
156 const __kAudioDevicePropertyActualSampleRate = getOSType!("asrt"); | |
157 const __kAudioDevicePropertyIcon = getOSType!("icon"); | |
158 const __kAudioDevicePropertyIsHidden = getOSType!("hidn"); | |
159 const __kAudioDevicePropertyJackIsConnected = getOSType!("jack"); | |
160 const __kAudioDevicePropertyVolumeScalar = getOSType!("volm"); | |
161 const __kAudioDevicePropertyVolumeDecibels = getOSType!("vold"); | |
162 const __kAudioDevicePropertyVolumeRangeDecibels = getOSType!("vdb#"); | |
163 const __kAudioDevicePropertyVolumeScalarToDecibels = getOSType!("v2db"); | |
164 const __kAudioDevicePropertyVolumeDecibelsToScalar = getOSType!("db2v"); | |
165 const __kAudioDevicePropertyVolumeDecibelsToScalarTransferFunction = getOSType!("vctf"); | |
166 const __kAudioDevicePropertyStereoPan = getOSType!("span"); | |
167 const __kAudioDevicePropertyStereoPanChannels = getOSType!("spn#"); | |
168 const __kAudioDevicePropertyMute = getOSType!("mute"); | |
169 const __kAudioDevicePropertySolo = getOSType!("solo"); | |
170 const __kAudioDevicePropertyDataSource = getOSType!("ssrc"); | |
171 const __kAudioDevicePropertyDataSources = getOSType!("ssc#"); | |
172 const __kAudioDevicePropertyDataSourceNameForIDCFString = getOSType!("lscn"); | |
173 const __kAudioDevicePropertyClockSource = getOSType!("csrc"); | |
174 const __kAudioDevicePropertyClockSources = getOSType!("csc#"); | |
175 const __kAudioDevicePropertyClockSourceNameForIDCFString = getOSType!("lcsn"); | |
176 const __kAudioDevicePropertyClockSourceKindForID = getOSType!("csck"); | |
177 const __kAudioDevicePropertyPlayThru = getOSType!("thru"); | |
178 const __kAudioDevicePropertyPlayThruSolo = getOSType!("thrs"); | |
179 const __kAudioDevicePropertyPlayThruVolumeScalar = getOSType!("mvsc"); | |
180 const __kAudioDevicePropertyPlayThruVolumeDecibels = getOSType!("mvdb"); | |
181 const __kAudioDevicePropertyPlayThruVolumeRangeDecibels = getOSType!("mvd#"); | |
182 const __kAudioDevicePropertyPlayThruVolumeScalarToDecibels = getOSType!("mv2d"); | |
183 const __kAudioDevicePropertyPlayThruVolumeDecibelsToScalar = getOSType!("mv2s"); | |
184 const __kAudioDevicePropertyPlayThruVolumeDecibelsToScalarTransferFunction = getOSType!("mvtf"); | |
185 const __kAudioDevicePropertyPlayThruStereoPan = getOSType!("mspn"); | |
186 const __kAudioDevicePropertyPlayThruStereoPanChannels = getOSType!("msp#"); | |
187 const __kAudioDevicePropertyPlayThruDestination = getOSType!("mdds"); | |
188 const __kAudioDevicePropertyPlayThruDestinations = getOSType!("mdd#"); | |
189 const __kAudioDevicePropertyPlayThruDestinationNameForIDCFString = getOSType!("mddc"); | |
190 const __kAudioDevicePropertyChannelNominalLineLevel = getOSType!("nlvl"); | |
191 const __kAudioDevicePropertyChannelNominalLineLevels = getOSType!("nlv#"); | |
192 const __kAudioDevicePropertyChannelNominalLineLevelNameForIDCFString = getOSType!("lcnl"); | |
193 const __kAudioDevicePropertyDriverShouldOwniSub = getOSType!("isub"); | |
194 const __kAudioDevicePropertySubVolumeScalar = getOSType!("svlm"); | |
195 const __kAudioDevicePropertySubVolumeDecibels = getOSType!("svld"); | |
196 const __kAudioDevicePropertySubVolumeRangeDecibels = getOSType!("svd#"); | |
197 const __kAudioDevicePropertySubVolumeScalarToDecibels = getOSType!("sv2d"); | |
198 const __kAudioDevicePropertySubVolumeDecibelsToScalar = getOSType!("sd2v"); | |
199 const __kAudioDevicePropertySubVolumeDecibelsToScalarTransferFunction = getOSType!("svtf"); | |
200 const __kAudioDevicePropertySubMute = getOSType!("smut"); | |
201 const __kAudioDevicePropertyDeviceName = getOSType!("name"); | |
202 const __kAudioDevicePropertyDeviceManufacturer = getOSType!("makr"); | |
203 const __kAudioDevicePropertyRegisterBufferList = getOSType!("rbuf"); | |
204 const __kAudioDevicePropertyBufferSize = getOSType!("bsiz"); | |
205 const __kAudioDevicePropertyBufferSizeRange = getOSType!("bsz#"); | |
206 const __kAudioDevicePropertyChannelName = getOSType!("chnm"); | |
207 const __kAudioDevicePropertyChannelCategoryName = getOSType!("ccnm"); | |
208 const __kAudioDevicePropertyChannelNumberName = getOSType!("cnnm"); | |
209 const __kAudioDevicePropertySupportsMixing = getOSType!("mix?"); | |
210 const __kAudioDevicePropertyStreamFormat = getOSType!("sfmt"); | |
211 const __kAudioDevicePropertyStreamFormats = getOSType!("sfm#"); | |
212 const __kAudioDevicePropertyStreamFormatSupported = getOSType!("sfm?"); | |
213 const __kAudioDevicePropertyStreamFormatMatch = getOSType!("sfmm"); | |
214 const __kAudioDevicePropertyDataSourceNameForID = getOSType!("sscn"); | |
215 const __kAudioDevicePropertyClockSourceNameForID = getOSType!("cscn"); | |
216 const __kAudioDevicePropertyPlayThruDestinationNameForID = getOSType!("mddn"); | |
217 const __kAudioDevicePropertyChannelNominalLineLevelNameForID = getOSType!("cnlv"); | |
218 const __kAudioStreamClassID = getOSType!("astr"); | |
219 const __kAudioStreamPropertyDirection = getOSType!("sdir"); | |
220 const __kAudioStreamPropertyTerminalType = getOSType!("term"); | |
221 const __kAudioStreamPropertyStartingChannel = getOSType!("schn"); | |
222 const __kAudioStreamPropertyVirtualFormat = getOSType!("sfmt"); | |
223 const __kAudioStreamPropertyAvailableVirtualFormats = getOSType!("sfma"); | |
224 const __kAudioStreamPropertyPhysicalFormat = getOSType!("pft "); | |
225 const __kAudioStreamPropertyAvailablePhysicalFormats = getOSType!("pfta"); | |
226 const __kAudioStreamPropertyPhysicalFormats = getOSType!("pft#"); | |
227 const __kAudioStreamPropertyPhysicalFormatSupported = getOSType!("pft?"); | |
228 const __kAudioStreamPropertyPhysicalFormatMatch = getOSType!("pftm"); | |
229 const __kAudioAggregateDeviceClassID = getOSType!("aagg"); | |
230 const __kAudioDeviceTransportTypeAggregate = getOSType!("grup"); | |
231 const __kAudioDeviceTransportTypeAutoAggregate = getOSType!("fgrp"); | |
232 const __kAudioAggregateDevicePropertyFullSubDeviceList = getOSType!("grup"); | |
233 const __kAudioAggregateDevicePropertyActiveSubDeviceList = getOSType!("agrp"); | |
234 const __kAudioAggregateDevicePropertyComposition = getOSType!("acom"); | |
235 const __kAudioAggregateDevicePropertyMasterSubDevice = getOSType!("amst"); | |
236 const __kAudioSubDeviceClassID = getOSType!("asub"); | |
237 const __kAudioSubDevicePropertyExtraLatency = getOSType!("xltc"); | |
238 const __kAudioSubDevicePropertyDriftCompensation = getOSType!("drft"); | |
239 const __kAudioSubDevicePropertyDriftCompensationQuality = getOSType!("drfq"); | |
240 } | |
241 } | |
242 | |
243 enum | |
244 { | |
245 kAudioHardwareNoError = 0, | |
246 kAudioHardwareNotRunningError = getOSType!("stop"), | |
247 kAudioHardwareUnspecifiedError = getOSType!("what"), | |
248 kAudioHardwareUnknownPropertyError = getOSType!("who?"), | |
249 kAudioHardwareBadPropertySizeError = getOSType!("!siz"), | |
250 kAudioHardwareIllegalOperationError = getOSType!("nope"), | |
251 kAudioHardwareBadObjectError = getOSType!("!obj"), | |
252 kAudioHardwareBadDeviceError = getOSType!("!dev"), | |
253 kAudioHardwareBadStreamError = getOSType!("!str"), | |
254 kAudioHardwareUnsupportedOperationError = getOSType!("unop"), | |
255 kAudioDeviceUnsupportedFormatError = getOSType!("!dat"), | |
256 kAudioDevicePermissionsError = getOSType!("!hog") | |
257 } | |
258 | |
259 version (D_LP64) | |
260 { | |
261 enum : ulong | |
262 { | |
263 kAudioObjectPropertySelectorWildcard = getOSType!("****"), | |
264 kAudioObjectPropertyScopeWildcard = getOSType!("****"), | |
265 kAudioObjectPropertyElementWildcard = 0xFFFFFFFFUL, | |
266 kAudioPropertyWildcardPropertyID = kAudioObjectPropertySelectorWildcard, | |
267 kAudioPropertyWildcardSection = 0xFF, | |
268 kAudioPropertyWildcardChannel = kAudioObjectPropertyElementWildcard | |
269 } | |
270 } | |
271 | |
272 else | |
273 { | |
274 enum | |
275 { | |
276 kAudioObjectPropertySelectorWildcard = getOSType!("****"), | |
277 kAudioObjectPropertyScopeWildcard = getOSType!("****"), | |
278 kAudioObjectPropertyElementWildcard = 0xFFFFFFFFU, | |
279 kAudioPropertyWildcardPropertyID = kAudioObjectPropertySelectorWildcard, | |
280 kAudioPropertyWildcardSection = 0xFF, | |
281 kAudioPropertyWildcardChannel = kAudioObjectPropertyElementWildcard | |
282 } | |
283 } | |
284 | |
285 enum | |
286 { | |
287 kAudioObjectPropertyScopeGlobal = getOSType!("glob"), | |
288 kAudioObjectPropertyElementMaster = 0UL, | |
289 kAudioObjectClassID = getOSType!("aobj"), | |
290 kAudioObjectClassIDWildcard = getOSType!("****"), | |
291 kAudioObjectUnknown = 0UL | |
292 } | |
293 | |
294 enum | |
295 { | |
296 kAudioObjectPropertyClass = getOSType!("clas"), | |
297 kAudioObjectPropertyOwner = getOSType!("stdv"), | |
298 kAudioObjectPropertyCreator = getOSType!("oplg"), | |
299 kAudioObjectPropertyName = getOSType!("lnam"), | |
300 kAudioObjectPropertyManufacturer = getOSType!("lmak"), | |
301 kAudioObjectPropertyElementName = getOSType!("lchn"), | |
302 kAudioObjectPropertyElementCategoryName = getOSType!("lccn"), | |
303 kAudioObjectPropertyElementNumberName = getOSType!("lcnn"), | |
304 kAudioObjectPropertyOwnedObjects = getOSType!("ownd"), | |
305 kAudioObjectPropertyListenerAdded = getOSType!("lisa"), | |
306 kAudioObjectPropertyListenerRemoved = getOSType!("lisr") | |
307 } | |
308 | |
309 enum | |
310 { | |
311 kAudioControlClassID = getOSType!("actl"), | |
312 kAudioLevelControlClassID = getOSType!("levl"), | |
313 kAudioBooleanControlClassID = getOSType!("togl"), | |
314 kAudioSelectorControlClassID = getOSType!("slct"), | |
315 kAudioStereoPanControlClassID = getOSType!("span") | |
316 } | |
317 | |
318 enum | |
319 { | |
320 kAudioVolumeControlClassID = getOSType!("vlme"), | |
321 kAudioLFEVolumeControlClassID = getOSType!("subv"), | |
322 kAudioBootChimeVolumeControlClassID = getOSType!("pram") | |
323 } | |
324 | |
325 enum | |
326 { | |
327 kAudioMuteControlClassID = getOSType!("mute"), | |
328 kAudioSoloControlClassID = getOSType!("solo"), | |
329 kAudioJackControlClassID = getOSType!("jack"), | |
330 kAudioLFEMuteControlClassID = getOSType!("subm"), | |
331 kAudioISubOwnerControlClassID = getOSType!("atch") | |
332 } | |
333 | |
334 enum | |
335 { | |
336 kAudioDataSourceControlClassID = getOSType!("dsrc"), | |
337 kAudioDataDestinationControlClassID = getOSType!("dest"), | |
338 kAudioClockSourceControlClassID = getOSType!("clck"), | |
339 kAudioLineLevelControlClassID = getOSType!("nlvl") | |
340 } | |
341 | |
342 enum | |
343 { | |
344 kAudioControlPropertyScope = getOSType!("cscp"), | |
345 kAudioControlPropertyElement = getOSType!("celm"), | |
346 kAudioControlPropertyVariant = getOSType!("cvar") | |
347 } | |
348 | |
349 enum | |
350 { | |
351 kAudioLevelControlPropertyScalarValue = getOSType!("lcsv"), | |
352 kAudioLevelControlPropertyDecibelValue = getOSType!("lcdv"), | |
353 kAudioLevelControlPropertyDecibelRange = getOSType!("lcdr"), | |
354 kAudioLevelControlPropertyConvertScalarToDecibels = getOSType!("lcsd"), | |
355 kAudioLevelControlPropertyConvertDecibelsToScalar = getOSType!("lcds"), | |
356 kAudioLevelControlPropertyDecibelsToScalarTransferFunction = getOSType!("lctf") | |
357 } | |
358 | |
359 enum | |
360 { | |
361 kAudioBooleanControlPropertyValue = getOSType!("bcvl") | |
362 } | |
363 | |
364 enum | |
365 { | |
366 kAudioSelectorControlPropertyCurrentItem = getOSType!("scci"), | |
367 kAudioSelectorControlPropertyAvailableItems = getOSType!("scai"), | |
368 kAudioSelectorControlPropertyItemName = getOSType!("scin") | |
369 } | |
370 | |
371 enum | |
372 { | |
373 kAudioClockSourceControlPropertyItemKind = getOSType!("clkk") | |
374 } | |
375 | |
376 enum | |
377 { | |
378 kAudioStereoPanControlPropertyValue = getOSType!("spcv"), | |
379 kAudioStereoPanControlPropertyPanningChannels = getOSType!("spcc") | |
380 } | |
381 | |
382 enum | |
383 { | |
384 kAudioSystemObjectClassID = getOSType!("asys"), | |
385 kAudioObjectSystemObject = 1UL | |
386 } | |
387 | |
388 enum | |
389 { | |
390 kAudioHardwarePropertyProcessIsMaster = getOSType!("mast"), | |
391 kAudioHardwarePropertyIsInitingOrExiting = getOSType!("inot"), | |
392 kAudioHardwarePropertyDevices = getOSType!("dev#"), | |
393 kAudioHardwarePropertyDefaultInputDevice = getOSType!("dIn "), | |
394 kAudioHardwarePropertyDefaultOutputDevice = getOSType!("dOut"), | |
395 kAudioHardwarePropertyDefaultSystemOutputDevice = getOSType!("sOut"), | |
396 kAudioHardwarePropertyDeviceForUID = getOSType!("duid"), | |
397 kAudioHardwarePropertyProcessIsAudible = getOSType!("pmut"), | |
398 kAudioHardwarePropertySleepingIsAllowed = getOSType!("slep"), | |
399 kAudioHardwarePropertyUnloadingIsAllowed = getOSType!("unld"), | |
400 kAudioHardwarePropertyHogModeIsAllowed = getOSType!("hogr"), | |
401 kAudioHardwarePropertyRunLoop = getOSType!("rnlp"), | |
402 kAudioHardwarePropertyPlugInForBundleID = getOSType!("pibi"), | |
403 kAudioHardwarePropertyUserSessionIsActiveOrHeadless = getOSType!("user") | |
404 } | |
405 | |
406 enum | |
407 { | |
408 kAudioHardwarePropertyBootChimeVolumeScalar = getOSType!("bbvs"), | |
409 kAudioHardwarePropertyBootChimeVolumeDecibels = getOSType!("bbvd"), | |
410 kAudioHardwarePropertyBootChimeVolumeRangeDecibels = getOSType!("bbd#"), | |
411 kAudioHardwarePropertyBootChimeVolumeScalarToDecibels = getOSType!("bv2d"), | |
412 kAudioHardwarePropertyBootChimeVolumeDecibelsToScalar = getOSType!("bd2v"), | |
413 kAudioHardwarePropertyBootChimeVolumeDecibelsToScalarTransferFunction = getOSType!("bvtf") | |
414 } | |
415 | |
416 enum | |
417 { | |
418 kAudioPlugInClassID = getOSType!("aplg") | |
419 } | |
420 | |
421 enum | |
422 { | |
423 kAudioPlugInPropertyBundleID = getOSType!("piid"), | |
424 kAudioPlugInCreateAggregateDevice = getOSType!("cagg"), | |
425 kAudioPlugInDestroyAggregateDevice = getOSType!("dagg") | |
426 } | |
427 | |
428 enum | |
429 { | |
430 kAudioDevicePropertyScopeInput = getOSType!("inpt"), | |
431 kAudioDevicePropertyScopeOutput = getOSType!("outp"), | |
432 kAudioDevicePropertyScopePlayThrough = getOSType!("ptru"), | |
433 kAudioDeviceClassID = getOSType!("adev"), | |
434 kAudioDeviceUnknown = kAudioObjectUnknown | |
435 } | |
436 | |
437 enum | |
438 { | |
439 kAudioDeviceStartTimeIsInputFlag = (1L << 0), | |
440 kAudioDeviceStartTimeDontConsultDeviceFlag = (1L << 1), | |
441 kAudioDeviceStartTimeDontConsultHALFlag = (1L << 2) | |
442 } | |
443 | |
444 enum | |
445 { | |
446 kAudioDevicePropertyPlugIn = getOSType!("plug"), | |
447 kAudioDevicePropertyConfigurationApplication = getOSType!("capp"), | |
448 kAudioDevicePropertyDeviceUID = getOSType!("uid "), | |
449 kAudioDevicePropertyModelUID = getOSType!("muid"), | |
450 kAudioDevicePropertyTransportType = getOSType!("tran"), | |
451 kAudioDevicePropertyRelatedDevices = getOSType!("akin"), | |
452 kAudioDevicePropertyClockDomain = getOSType!("clkd"), | |
453 kAudioDevicePropertyDeviceIsAlive = getOSType!("livn"), | |
454 kAudioDevicePropertyDeviceHasChanged = getOSType!("diff"), | |
455 kAudioDevicePropertyDeviceIsRunning = getOSType!("goin"), | |
456 kAudioDevicePropertyDeviceIsRunningSomewhere = getOSType!("gone"), | |
457 kAudioDevicePropertyDeviceCanBeDefaultDevice = getOSType!("dflt"), | |
458 kAudioDevicePropertyDeviceCanBeDefaultSystemDevice = getOSType!("sflt"), | |
459 kAudioDeviceProcessorOverload = getOSType!("over"), | |
460 kAudioDevicePropertyHogMode = getOSType!("oink"), | |
461 kAudioDevicePropertyLatency = getOSType!("ltnc"), | |
462 kAudioDevicePropertyBufferFrameSize = getOSType!("fsiz"), | |
463 kAudioDevicePropertyBufferFrameSizeRange = getOSType!("fsz#"), | |
464 kAudioDevicePropertyUsesVariableBufferFrameSizes = getOSType!("vfsz"), | |
465 kAudioDevicePropertyStreams = getOSType!("stm#"), | |
466 kAudioDevicePropertySafetyOffset = getOSType!("saft"), | |
467 kAudioDevicePropertyIOCycleUsage = getOSType!("ncyc"), | |
468 kAudioDevicePropertyStreamConfiguration = getOSType!("slay"), | |
469 kAudioDevicePropertyIOProcStreamUsage = getOSType!("suse"), | |
470 kAudioDevicePropertyPreferredChannelsForStereo = getOSType!("dch2"), | |
471 kAudioDevicePropertyPreferredChannelLayout = getOSType!("srnd"), | |
472 kAudioDevicePropertyNominalSampleRate = getOSType!("nsrt"), | |
473 kAudioDevicePropertyAvailableNominalSampleRates = getOSType!("nsr#"), | |
474 kAudioDevicePropertyActualSampleRate = getOSType!("asrt"), | |
475 kAudioDevicePropertyIcon = getOSType!("icon"), | |
476 kAudioDevicePropertyIsHidden = getOSType!("hidn") | |
477 } | |
478 | |
479 enum | |
480 { | |
481 kAudioDevicePropertyJackIsConnected = getOSType!("jack"), | |
482 kAudioDevicePropertyVolumeScalar = getOSType!("volm"), | |
483 kAudioDevicePropertyVolumeDecibels = getOSType!("vold"), | |
484 kAudioDevicePropertyVolumeRangeDecibels = getOSType!("vdb#"), | |
485 kAudioDevicePropertyVolumeScalarToDecibels = getOSType!("v2db"), | |
486 kAudioDevicePropertyVolumeDecibelsToScalar = getOSType!("db2v"), | |
487 kAudioDevicePropertyVolumeDecibelsToScalarTransferFunction = getOSType!("vctf"), | |
488 kAudioDevicePropertyStereoPan = getOSType!("span"), | |
489 kAudioDevicePropertyStereoPanChannels = getOSType!("spn#"), | |
490 kAudioDevicePropertyMute = getOSType!("mute"), | |
491 kAudioDevicePropertySolo = getOSType!("solo"), | |
492 kAudioDevicePropertyDataSource = getOSType!("ssrc"), | |
493 kAudioDevicePropertyDataSources = getOSType!("ssc#"), | |
494 kAudioDevicePropertyDataSourceNameForIDCFString = getOSType!("lscn"), | |
495 kAudioDevicePropertyClockSource = getOSType!("csrc"), | |
496 kAudioDevicePropertyClockSources = getOSType!("csc#"), | |
497 kAudioDevicePropertyClockSourceNameForIDCFString = getOSType!("lcsn"), | |
498 kAudioDevicePropertyClockSourceKindForID = getOSType!("csck"), | |
499 kAudioDevicePropertyPlayThru = getOSType!("thru"), | |
500 kAudioDevicePropertyPlayThruSolo = getOSType!("thrs"), | |
501 kAudioDevicePropertyPlayThruVolumeScalar = getOSType!("mvsc"), | |
502 kAudioDevicePropertyPlayThruVolumeDecibels = getOSType!("mvdb"), | |
503 kAudioDevicePropertyPlayThruVolumeRangeDecibels = getOSType!("mvd#"), | |
504 kAudioDevicePropertyPlayThruVolumeScalarToDecibels = getOSType!("mv2d"), | |
505 kAudioDevicePropertyPlayThruVolumeDecibelsToScalar = getOSType!("mv2s"), | |
506 kAudioDevicePropertyPlayThruVolumeDecibelsToScalarTransferFunction = getOSType!("mvtf"), | |
507 kAudioDevicePropertyPlayThruStereoPan = getOSType!("mspn"), | |
508 kAudioDevicePropertyPlayThruStereoPanChannels = getOSType!("msp#"), | |
509 kAudioDevicePropertyPlayThruDestination = getOSType!("mdds"), | |
510 kAudioDevicePropertyPlayThruDestinations = getOSType!("mdd#"), | |
511 kAudioDevicePropertyPlayThruDestinationNameForIDCFString = getOSType!("mddc"), | |
512 kAudioDevicePropertyChannelNominalLineLevel = getOSType!("nlvl"), | |
513 kAudioDevicePropertyChannelNominalLineLevels = getOSType!("nlv#"), | |
514 kAudioDevicePropertyChannelNominalLineLevelNameForIDCFString = getOSType!("lcnl"), | |
515 kAudioDevicePropertyDriverShouldOwniSub = getOSType!("isub"), | |
516 kAudioDevicePropertySubVolumeScalar = getOSType!("svlm"), | |
517 kAudioDevicePropertySubVolumeDecibels = getOSType!("svld"), | |
518 kAudioDevicePropertySubVolumeRangeDecibels = getOSType!("svd#"), | |
519 kAudioDevicePropertySubVolumeScalarToDecibels = getOSType!("sv2d"), | |
520 kAudioDevicePropertySubVolumeDecibelsToScalar = getOSType!("sd2v"), | |
521 kAudioDevicePropertySubVolumeDecibelsToScalarTransferFunction = getOSType!("svtf"), | |
522 kAudioDevicePropertySubMute = getOSType!("smut") | |
523 } | |
524 | |
525 enum | |
526 { | |
527 kAudioDevicePropertyDeviceName = getOSType!("name"), | |
528 kAudioDevicePropertyDeviceNameCFString = kAudioObjectPropertyName, | |
529 kAudioDevicePropertyDeviceManufacturer = getOSType!("makr"), | |
530 kAudioDevicePropertyDeviceManufacturerCFString = kAudioObjectPropertyManufacturer, | |
531 kAudioDevicePropertyRegisterBufferList = getOSType!("rbuf"), | |
532 kAudioDevicePropertyBufferSize = getOSType!("bsiz"), | |
533 kAudioDevicePropertyBufferSizeRange = getOSType!("bsz#"), | |
534 kAudioDevicePropertyChannelName = getOSType!("chnm"), | |
535 kAudioDevicePropertyChannelNameCFString = kAudioObjectPropertyElementName, | |
536 kAudioDevicePropertyChannelCategoryName = getOSType!("ccnm"), | |
537 kAudioDevicePropertyChannelCategoryNameCFString = kAudioObjectPropertyElementCategoryName, | |
538 kAudioDevicePropertyChannelNumberName = getOSType!("cnnm"), | |
539 kAudioDevicePropertyChannelNumberNameCFString = kAudioObjectPropertyElementNumberName, | |
540 kAudioDevicePropertySupportsMixing = getOSType!("mix?"), | |
541 kAudioDevicePropertyStreamFormat = getOSType!("sfmt"), | |
542 kAudioDevicePropertyStreamFormats = getOSType!("sfm#"), | |
543 kAudioDevicePropertyStreamFormatSupported = getOSType!("sfm?"), | |
544 kAudioDevicePropertyStreamFormatMatch = getOSType!("sfmm"), | |
545 kAudioDevicePropertyDataSourceNameForID = getOSType!("sscn"), | |
546 kAudioDevicePropertyClockSourceNameForID = getOSType!("cscn"), | |
547 kAudioDevicePropertyPlayThruDestinationNameForID = getOSType!("mddn"), | |
548 kAudioDevicePropertyChannelNominalLineLevelNameForID = getOSType!("cnlv") | |
549 } | |
550 | |
551 enum | |
552 { | |
553 kAudioStreamClassID = getOSType!("astr"), | |
554 kAudioStreamUnknown = kAudioObjectUnknown | |
555 } | |
556 | |
557 enum | |
558 { | |
559 kAudioStreamPropertyDirection = getOSType!("sdir"), | |
560 kAudioStreamPropertyTerminalType = getOSType!("term"), | |
561 kAudioStreamPropertyStartingChannel = getOSType!("schn"), | |
562 kAudioStreamPropertyLatency = kAudioDevicePropertyLatency, | |
563 kAudioStreamPropertyVirtualFormat = getOSType!("sfmt"), | |
564 kAudioStreamPropertyAvailableVirtualFormats = getOSType!("sfma"), | |
565 kAudioStreamPropertyPhysicalFormat = getOSType!("pft "), | |
566 kAudioStreamPropertyAvailablePhysicalFormats = getOSType!("pfta") | |
567 } | |
568 | |
569 enum | |
570 { | |
571 kAudioStreamPropertyOwningDevice = kAudioObjectPropertyOwner, | |
572 kAudioStreamPropertyPhysicalFormats = getOSType!("pft#"), | |
573 kAudioStreamPropertyPhysicalFormatSupported = getOSType!("pft?"), | |
574 kAudioStreamPropertyPhysicalFormatMatch = getOSType!("pftm") | |
575 } | |
576 | |
577 enum | |
578 { | |
579 kAudioAggregateDeviceClassID = getOSType!("aagg"), | |
580 kAudioDeviceTransportTypeAggregate = getOSType!("grup"), | |
581 kAudioDeviceTransportTypeAutoAggregate = getOSType!("fgrp") | |
582 } | |
583 | |
584 enum | |
585 { | |
586 kAudioAggregateDevicePropertyFullSubDeviceList = getOSType!("grup"), | |
587 kAudioAggregateDevicePropertyActiveSubDeviceList = getOSType!("agrp"), | |
588 kAudioAggregateDevicePropertyComposition = getOSType!("acom") | |
589 } | |
590 | |
591 enum | |
592 { | |
593 kAudioAggregateDevicePropertyMasterSubDevice = getOSType!("amst") | |
594 } | |
595 | |
596 enum | |
597 { | |
598 kAudioSubDeviceClassID = getOSType!("asub") | |
599 } | |
600 | |
601 enum | |
602 { | |
603 kAudioSubDeviceDriftCompensationMinQuality = 0, | |
604 kAudioSubDeviceDriftCompensationLowQuality = 0x20, | |
605 kAudioSubDeviceDriftCompensationMediumQuality = 0x40, | |
606 kAudioSubDeviceDriftCompensationHighQuality = 0x60, | |
607 kAudioSubDeviceDriftCompensationMaxQuality = 0x7F | |
608 } | |
609 | |
610 enum | |
611 { | |
612 kAudioSubDevicePropertyExtraLatency = getOSType!("xltc"), | |
613 kAudioSubDevicePropertyDriftCompensation = getOSType!("drft"), | |
614 kAudioSubDevicePropertyDriftCompensationQuality = getOSType!("drfq") | |
615 } | |
616 | |
617 struct AudioObjectPropertyAddress | |
618 { | |
619 uint mSelector; | |
620 uint mScope; | |
621 uint mElement; | |
622 } | |
623 | |
624 | |
625 struct AudioHardwareIOProcStreamUsage | |
626 { | |
627 void* mIOProc; | |
628 uint mNumberStreams; | |
629 uint* mStreamIsOn; | |
630 } | |
631 | |
632 | |
633 struct AudioStreamRangedDescription | |
634 { | |
635 AudioStreamBasicDescription mFormat; | |
636 AudioValueRange mSampleRateRange; | |
637 } | |
638 | |
639 extern (C) | |
640 { | |
641 void AudioObjectShow (uint inObjectID); | |
642 ubyte AudioObjectHasProperty (uint inObjectID, AudioObjectPropertyAddress* inAddress); | |
643 int AudioObjectIsPropertySettable (uint inObjectID, AudioObjectPropertyAddress* inAddress, char* outIsSettable); | |
644 int AudioObjectGetPropertyDataSize (uint inObjectID, AudioObjectPropertyAddress* inAddress, uint inQualifierDataSize, void* inQualifierData, uint* outDataSize); | |
645 int AudioObjectGetPropertyData (uint inObjectID, AudioObjectPropertyAddress* inAddress, uint inQualifierDataSize, void* inQualifierData, uint* ioDataSize, void* outData); | |
646 int AudioObjectSetPropertyData (uint inObjectID, AudioObjectPropertyAddress* inAddress, uint inQualifierDataSize, void* inQualifierData, uint inDataSize, void* inData); | |
647 int AudioObjectAddPropertyListener (uint inObjectID, AudioObjectPropertyAddress* inAddress, AudioObjectPropertyListenerProc inListener, void* inClientData); | |
648 int AudioObjectRemovePropertyListener (uint inObjectID, AudioObjectPropertyAddress* inAddress, AudioObjectPropertyListenerProc inListener, void* inClientData); | |
649 int AudioHardwareAddRunLoopSource (CFRunLoopSourceRef inRunLoopSource); | |
650 int AudioHardwareRemoveRunLoopSource (CFRunLoopSourceRef inRunLoopSource); | |
651 int AudioHardwareUnload (); | |
652 int AudioHardwareGetPropertyInfo (uint inPropertyID, uint* outSize, char* outWritable); | |
653 int AudioHardwareGetProperty (uint inPropertyID, uint* ioPropertyDataSize, void* outPropertyData); | |
654 int AudioHardwareSetProperty (uint inPropertyID, uint inPropertyDataSize, void* inPropertyData); | |
655 int AudioHardwareAddPropertyListener (uint inPropertyID, AudioHardwarePropertyListenerProc inProc, void* inClientData); | |
656 int AudioHardwareRemovePropertyListener (uint inPropertyID, AudioHardwarePropertyListenerProc inProc); | |
657 int AudioDeviceCreateIOProcID (uint inDevice, AudioDeviceIOProc inProc, void* inClientData, AudioDeviceIOProcID* outIOProcID); | |
658 int AudioDeviceDestroyIOProcID (uint inDevice, AudioDeviceIOProcID inIOProcID); | |
659 int AudioDeviceAddIOProc (uint inDevice, AudioDeviceIOProc inProc, void* inClientData); | |
660 int AudioDeviceRemoveIOProc (uint inDevice, AudioDeviceIOProc inProc); | |
661 int AudioDeviceStart (uint inDevice, AudioDeviceIOProcID inProcID); | |
662 int AudioDeviceStartAtTime (uint inDevice, AudioDeviceIOProcID inProcID, AudioTimeStamp* ioRequestedStartTime, uint inFlags); | |
663 int AudioDeviceStop (uint inDevice, AudioDeviceIOProcID inProcID); | |
664 int AudioDeviceRead (uint inDevice, AudioTimeStamp* inStartTime, AudioBufferList* outData); | |
665 int AudioDeviceGetCurrentTime (uint inDevice, AudioTimeStamp* outTime); | |
666 int AudioDeviceTranslateTime (uint inDevice, AudioTimeStamp* inTime, AudioTimeStamp* outTime); | |
667 int AudioDeviceGetNearestStartTime (uint inDevice, AudioTimeStamp* ioRequestedStartTime, uint inFlags); | |
668 int AudioDeviceGetPropertyInfo (uint inDevice, uint inChannel, ubyte isInput, uint inPropertyID, uint* outSize, char* outWritable); | |
669 int AudioDeviceGetProperty (uint inDevice, uint inChannel, ubyte isInput, uint inPropertyID, uint* ioPropertyDataSize, void* outPropertyData); | |
670 int AudioDeviceSetProperty (uint inDevice, AudioTimeStamp* inWhen, uint inChannel, ubyte isInput, uint inPropertyID, uint inPropertyDataSize, void* inPropertyData); | |
671 int AudioDeviceAddPropertyListener (uint inDevice, uint inChannel, ubyte isInput, uint inPropertyID, AudioDevicePropertyListenerProc inProc, void* inClientData); | |
672 int AudioDeviceRemovePropertyListener (uint inDevice, uint inChannel, ubyte isInput, uint inPropertyID, AudioDevicePropertyListenerProc inProc); | |
673 int AudioStreamGetPropertyInfo (uint inStream, uint inChannel, uint inPropertyID, uint* outSize, char* outWritable); | |
674 int AudioStreamGetProperty (uint inStream, uint inChannel, uint inPropertyID, uint* ioPropertyDataSize, void* outPropertyData); | |
675 int AudioStreamSetProperty (uint inStream, AudioTimeStamp* inWhen, uint inChannel, uint inPropertyID, uint inPropertyDataSize, void* inPropertyData); | |
676 int AudioStreamAddPropertyListener (uint inStream, uint inChannel, uint inPropertyID, AudioStreamPropertyListenerProc inProc, void* inClientData); | |
677 int AudioStreamRemovePropertyListener (uint inStream, uint inChannel, uint inPropertyID, AudioStreamPropertyListenerProc inProc); | |
678 } |