AudioUnitProperties.pas 139 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374
  1. {
  2. File: AudioUnitProperties.h
  3. Contains: Property constants for AudioUnits
  4. Copyright: (c) 2001-2008 by Apple, Inc., all rights reserved.
  5. Bugs?: For bug reports, consult the following page on
  6. the World Wide Web:
  7. http://www.freepascal.org/bugs.html
  8. }
  9. { Pascal Translation: Gorazd Krosl <[email protected]>, October 2009 }
  10. { Pascal Translation Update: Jonas Maebe <[email protected]>, October 2012 }
  11. {
  12. Modified for use with Free Pascal
  13. Version 308
  14. Please report any bugs to <[email protected]>
  15. }
  16. {$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
  17. {$mode macpas}
  18. {$packenum 1}
  19. {$macro on}
  20. {$inline on}
  21. {$calling mwpascal}
  22. unit AudioUnitProperties;
  23. interface
  24. {$setc UNIVERSAL_INTERFACES_VERSION := $0400}
  25. {$setc GAP_INTERFACES_VERSION := $0308}
  26. {$ifc not defined USE_CFSTR_CONSTANT_MACROS}
  27. {$setc USE_CFSTR_CONSTANT_MACROS := TRUE}
  28. {$endc}
  29. {$ifc defined CPUPOWERPC and defined CPUI386}
  30. {$error Conflicting initial definitions for CPUPOWERPC and CPUI386}
  31. {$endc}
  32. {$ifc defined FPC_BIG_ENDIAN and defined FPC_LITTLE_ENDIAN}
  33. {$error Conflicting initial definitions for FPC_BIG_ENDIAN and FPC_LITTLE_ENDIAN}
  34. {$endc}
  35. {$ifc not defined __ppc__ and defined CPUPOWERPC32}
  36. {$setc __ppc__ := 1}
  37. {$elsec}
  38. {$setc __ppc__ := 0}
  39. {$endc}
  40. {$ifc not defined __ppc64__ and defined CPUPOWERPC64}
  41. {$setc __ppc64__ := 1}
  42. {$elsec}
  43. {$setc __ppc64__ := 0}
  44. {$endc}
  45. {$ifc not defined __i386__ and defined CPUI386}
  46. {$setc __i386__ := 1}
  47. {$elsec}
  48. {$setc __i386__ := 0}
  49. {$endc}
  50. {$ifc not defined __x86_64__ and defined CPUX86_64}
  51. {$setc __x86_64__ := 1}
  52. {$elsec}
  53. {$setc __x86_64__ := 0}
  54. {$endc}
  55. {$ifc not defined __arm__ and defined CPUARM}
  56. {$setc __arm__ := 1}
  57. {$elsec}
  58. {$setc __arm__ := 0}
  59. {$endc}
  60. {$ifc defined cpu64}
  61. {$setc __LP64__ := 1}
  62. {$elsec}
  63. {$setc __LP64__ := 0}
  64. {$endc}
  65. {$ifc defined __ppc__ and __ppc__ and defined __i386__ and __i386__}
  66. {$error Conflicting definitions for __ppc__ and __i386__}
  67. {$endc}
  68. {$ifc defined __ppc__ and __ppc__}
  69. {$setc TARGET_CPU_PPC := TRUE}
  70. {$setc TARGET_CPU_PPC64 := FALSE}
  71. {$setc TARGET_CPU_X86 := FALSE}
  72. {$setc TARGET_CPU_X86_64 := FALSE}
  73. {$setc TARGET_CPU_ARM := FALSE}
  74. {$setc TARGET_OS_MAC := TRUE}
  75. {$setc TARGET_OS_IPHONE := FALSE}
  76. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  77. {$setc TARGET_OS_EMBEDDED := FALSE}
  78. {$elifc defined __ppc64__ and __ppc64__}
  79. {$setc TARGET_CPU_PPC := FALSE}
  80. {$setc TARGET_CPU_PPC64 := TRUE}
  81. {$setc TARGET_CPU_X86 := FALSE}
  82. {$setc TARGET_CPU_X86_64 := FALSE}
  83. {$setc TARGET_CPU_ARM := FALSE}
  84. {$setc TARGET_OS_MAC := TRUE}
  85. {$setc TARGET_OS_IPHONE := FALSE}
  86. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  87. {$setc TARGET_OS_EMBEDDED := FALSE}
  88. {$elifc defined __i386__ and __i386__}
  89. {$setc TARGET_CPU_PPC := FALSE}
  90. {$setc TARGET_CPU_PPC64 := FALSE}
  91. {$setc TARGET_CPU_X86 := TRUE}
  92. {$setc TARGET_CPU_X86_64 := FALSE}
  93. {$setc TARGET_CPU_ARM := FALSE}
  94. {$ifc defined(iphonesim)}
  95. {$setc TARGET_OS_MAC := FALSE}
  96. {$setc TARGET_OS_IPHONE := TRUE}
  97. {$setc TARGET_IPHONE_SIMULATOR := TRUE}
  98. {$elsec}
  99. {$setc TARGET_OS_MAC := TRUE}
  100. {$setc TARGET_OS_IPHONE := FALSE}
  101. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  102. {$endc}
  103. {$setc TARGET_OS_EMBEDDED := FALSE}
  104. {$elifc defined __x86_64__ and __x86_64__}
  105. {$setc TARGET_CPU_PPC := FALSE}
  106. {$setc TARGET_CPU_PPC64 := FALSE}
  107. {$setc TARGET_CPU_X86 := FALSE}
  108. {$setc TARGET_CPU_X86_64 := TRUE}
  109. {$setc TARGET_CPU_ARM := FALSE}
  110. {$setc TARGET_OS_MAC := TRUE}
  111. {$setc TARGET_OS_IPHONE := FALSE}
  112. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  113. {$setc TARGET_OS_EMBEDDED := FALSE}
  114. {$elifc defined __arm__ and __arm__}
  115. {$setc TARGET_CPU_PPC := FALSE}
  116. {$setc TARGET_CPU_PPC64 := FALSE}
  117. {$setc TARGET_CPU_X86 := FALSE}
  118. {$setc TARGET_CPU_X86_64 := FALSE}
  119. {$setc TARGET_CPU_ARM := TRUE}
  120. { will require compiler define when/if other Apple devices with ARM cpus ship }
  121. {$setc TARGET_OS_MAC := FALSE}
  122. {$setc TARGET_OS_IPHONE := TRUE}
  123. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  124. {$setc TARGET_OS_EMBEDDED := TRUE}
  125. {$elsec}
  126. {$error __ppc__ nor __ppc64__ nor __i386__ nor __x86_64__ nor __arm__ is defined.}
  127. {$endc}
  128. {$ifc defined __LP64__ and __LP64__ }
  129. {$setc TARGET_CPU_64 := TRUE}
  130. {$elsec}
  131. {$setc TARGET_CPU_64 := FALSE}
  132. {$endc}
  133. {$ifc defined FPC_BIG_ENDIAN}
  134. {$setc TARGET_RT_BIG_ENDIAN := TRUE}
  135. {$setc TARGET_RT_LITTLE_ENDIAN := FALSE}
  136. {$elifc defined FPC_LITTLE_ENDIAN}
  137. {$setc TARGET_RT_BIG_ENDIAN := FALSE}
  138. {$setc TARGET_RT_LITTLE_ENDIAN := TRUE}
  139. {$elsec}
  140. {$error Neither FPC_BIG_ENDIAN nor FPC_LITTLE_ENDIAN are defined.}
  141. {$endc}
  142. {$setc ACCESSOR_CALLS_ARE_FUNCTIONS := TRUE}
  143. {$setc CALL_NOT_IN_CARBON := FALSE}
  144. {$setc OLDROUTINENAMES := FALSE}
  145. {$setc OPAQUE_TOOLBOX_STRUCTS := TRUE}
  146. {$setc OPAQUE_UPP_TYPES := TRUE}
  147. {$setc OTCARBONAPPLICATION := TRUE}
  148. {$setc OTKERNEL := FALSE}
  149. {$setc PM_USE_SESSION_APIS := TRUE}
  150. {$setc TARGET_API_MAC_CARBON := TRUE}
  151. {$setc TARGET_API_MAC_OS8 := FALSE}
  152. {$setc TARGET_API_MAC_OSX := TRUE}
  153. {$setc TARGET_CARBON := TRUE}
  154. {$setc TARGET_CPU_68K := FALSE}
  155. {$setc TARGET_CPU_MIPS := FALSE}
  156. {$setc TARGET_CPU_SPARC := FALSE}
  157. {$setc TARGET_OS_UNIX := FALSE}
  158. {$setc TARGET_OS_WIN32 := FALSE}
  159. {$setc TARGET_RT_MAC_68881 := FALSE}
  160. {$setc TARGET_RT_MAC_CFM := FALSE}
  161. {$setc TARGET_RT_MAC_MACHO := TRUE}
  162. {$setc TYPED_FUNCTION_POINTERS := TRUE}
  163. {$setc TYPE_BOOL := FALSE}
  164. {$setc TYPE_EXTENDED := FALSE}
  165. {$setc TYPE_LONGLONG := TRUE}
  166. uses MacTypes,AUComponent,CoreAudioTypes,MIDIServices,CFBase,CFURL;
  167. {$endc} {not MACOSALLINCLUDE}
  168. {$ALIGN POWER}
  169. //=====================================================================================================================
  170. //#pragma mark Overview
  171. {!
  172. @header AudioUnitProperties
  173. This file defines a collection of property IDs and their accompanying structures that are used
  174. by audio units. Properties form the basis of much of the audio unit API. You use them with
  175. the Audio Unit framework's Get and Set property API calls declared in the AUComponent.h header
  176. file:
  177. AudioUnitGetPropertyInfo
  178. AudioUnitGetProperty
  179. AudioUnitSetProperty
  180. This file first lists generic audio unit properties (those that are potentially applicable to
  181. any audio unit), followed by properties specific to Apple audio units.
  182. Apple reserves property IDs from 0 -> 63999. Developers are free to use property IDs above this
  183. range.
  184. All property values are passed by reference. When a property's value type is listed below,
  185. that value type is always passed by reference. For example, CFStringRef is passed as
  186. &myCFString.
  187. Properties are described below using a general form:
  188. Scope: The audio unit scope that the property applies to. For example, Global,
  189. Input, Output, etc. For an explanation of audio unit scopes, see the
  190. Audio Unit Programming Guide in the ADC Reference Library.
  191. Value Type: The data type used to hold the value associated with the property. For
  192. example, CFStringRef or UInt32
  193. Access: How a host application can access the property in a hosted audio unit:
  194. read only, write only, or read/write.
  195. Description: A description of the property's role.
  196. The descriptions in this file apply to typical or recommended usage. Audio unit developers can vary
  197. the way each property is used. For example, a property may be described as applying to both input and
  198. output scopes, but a given audio unit may implement the property on the input scope only. As another
  199. example, a property may be described here as having read/write access, but an audio unit may
  200. implement the property as read only.
  201. The properties are divided into two primary sections:
  202. (1) Core/Embedded Implementation
  203. - these properties are available on all platforms where audio units are available
  204. (2) Desktop
  205. - these properties are available on only available on desktop platforms
  206. The following file is organised into these two sections
  207. }
  208. //#pragma mark -
  209. //#pragma mark Core Implementation
  210. //#pragma mark -
  211. {!
  212. @enum Audio Unit scope types
  213. @abstract The scope IDs for audio units define basic roles and contexts for an audio unit's state.
  214. @discussion Each scope is a discrete context. Apple reserves scope IDs from 0 through 1024.
  215. @constant kAudioUnitScope_Global The context for audio unit characteristics that apply to the audio unit as a
  216. whole
  217. @constant kAudioUnitScope_Input The context for audio data coming into an audio unit
  218. @constant kAudioUnitScope_Output The context for audio data leaving an audio unit
  219. @constant kAudioUnitScope_Group A context specific to the control scope of parameters (for instance,
  220. MIDI Channels is an example of this scope)
  221. @constant kAudioUnitScope_Part A distinct rendering context. For instance a single timbre in a multi-timbral
  222. instrument, a single loop in a multi looping capable looper unit, etc.
  223. @constant kAudioUnitScope_Note A scope that can be used to apply changes to an individual note. The
  224. elementID used with this scope is the unique note ID returned from
  225. a started note (see MusicDeviceStartNote)
  226. @constant kAudioUnitScope_Layer A context which functions as a layer within a part and allows
  227. grouped control of LayerItem-scope parameters.
  228. An example is the percussive attack layer for an electric organ instrument
  229. @constant kAudioUnitScope_LayerItem A scope which represents an indivual element within a particular Layer scope.
  230. The individual sample zones, envelope generators, and filters within a synth are
  231. examples of this.
  232. }
  233. const
  234. kAudioUnitScope_Global = 0;
  235. kAudioUnitScope_Input = 1;
  236. kAudioUnitScope_Output = 2;
  237. kAudioUnitScope_Group = 3;
  238. kAudioUnitScope_Part = 4;
  239. kAudioUnitScope_Note = 5;
  240. kAudioUnitScope_Layer = 6;
  241. kAudioUnitScope_LayerItem = 7;
  242. //=====================================================================================================================
  243. //#pragma mark Audio Unit Properties
  244. {!
  245. @enum Generic Property IDs
  246. @abstract Properties that can apply to any audio unit.
  247. @constant kAudioUnitProperty_ClassInfo
  248. Scope: Global (or Part for a part scope preset)
  249. Value Type: CFDictionaryRef
  250. Access: read/write
  251. The complete state of an audio unit if on global scope. An audio unit that supports part scope, may also support presets on the part scope
  252. that apply to individual parts.
  253. After a host sets this property it needs to notify the parameter listeners that the values of the parameters of an AU may have changed (so
  254. views, etc, can update their state). Something like the following code should be used:
  255. <code>
  256. AudioUnitParameter changedUnit;
  257. changedUnit.mAudioUnit = theChangedAU;
  258. changedUnit.mParameterID = kAUParameterListener_AnyParameter;
  259. AUParameterListenerNotify (NULL, NULL, &changedUnit);
  260. </code>
  261. @constant kAudioUnitProperty_MakeConnection
  262. Scope: Input
  263. Value Type: AudioUnitConnection
  264. Access: Write
  265. @constant kAudioUnitProperty_SampleRate
  266. Scope: Input / Output
  267. Value Type: Float64
  268. Access: read/write
  269. @constant kAudioUnitProperty_ParameterList
  270. Scope: Any
  271. Value Type: AudioUnitParameterID
  272. Access: Read
  273. The list of parameter IDs on the specified scope
  274. @constant kAudioUnitProperty_ParameterInfo
  275. Scope: Any
  276. Value Type: AudioUnitParameterInfo
  277. Access:
  278. The info struct describes the general characteristics of an individual parameterID
  279. @constant kAudioUnitProperty_FastDispatch
  280. Scope: Global
  281. Value Type: void* (function pointer)
  282. Access: Read
  283. The caller provides the selector for a given audio unit API, and retrieves a function pointer for that selector. For instance,
  284. this enables the caller to retrieve the function pointer for the AudioUnitRender call, so that call can be made directly
  285. through to the audio unit to avoid the overhead of the ComponentMgr's dispatch.
  286. @constant kAudioUnitProperty_CPULoad
  287. Scope: Global
  288. Value Type: Float64
  289. Access: Read
  290. Can be used to retrieve the duty cycle (as a value from 0 to 1) of the render time that an audio unit is spending in its render call.
  291. @constant kAudioUnitProperty_StreamFormat
  292. Scope: Input / Output
  293. Value Type: AudioStreamBasicDescription
  294. Access: read/write
  295. An AudioStreamBasicDescription is used to specify the basic format for an audio data path. For instance, 2 channels, 44.1KHz, Float32 linear pcm.
  296. The value can be both set and retrieve from an I/O element (bus)
  297. @constant kAudioUnitProperty_ElementCount
  298. Scope: Any (though Global scope will always have and element count of 1)
  299. Value Type: UInt32
  300. Access: read/write
  301. Most audio units will only implement the read version of this call, thus they would have a fixed bus topology (number of input and output elements/buses).
  302. Some audio units possess the capability to add or remove elements, so in that case this property will be writable.
  303. @constant kAudioUnitProperty_Latency
  304. Scope: Global
  305. Value Type: Float64
  306. Access: Read
  307. The processing latency (the time it takes an audio unit to represent an input in its audio output) specified in seconds
  308. @constant kAudioUnitProperty_SupportedNumChannels
  309. Scope: Global
  310. Value Type: AUChannelInfo array
  311. Access: Read
  312. The size of this property will represent the number of AUChannelInfo structs that an audio unit provides. Each entry describes a particular number of
  313. channels on any input, matched to a particular number of channels on any output. Thus an entry (2, 2) says the audio unit will support a channel configuration
  314. of 2 channels on an input and 2 channels on an output.
  315. Negative numbers (-1, -2) are used to indicate *any* number of channels. So (-1, -1) means any number of channels on input and output as long as they are the same.
  316. (1, -2) means any number of channels on input or output buses
  317. A negative number less than -2 is used to indicate a total number of channels across every bus on that scope, regardless of how many channels are set on any
  318. particular bus.
  319. Zero on any side (typically only input) means that the audio unit doesn't have any input elements, and is expressing the capability of configuring its output channels.
  320. @constant kAudioUnitProperty_MaximumFramesPerSlice
  321. Scope: Global
  322. Value Type: UInt32
  323. Access: read/write
  324. This property is used to describe to an audio unit the maximum number of samples it will be asked to produce on any single given call to audio unit render.
  325. If an audio unit can require more or less input data than its output request, then it should limit any given request for input to this number of frames (that is,
  326. it should "break up" its input pulls).
  327. @constant kAudioUnitProperty_SetExternalBuffer
  328. Scope: Global
  329. Value Type: AudioUnitExternalBuffer
  330. Access: Write
  331. This is used to provide to an audio unit a buffer that it can use with its input render callback's audio buffer list
  332. @constant kAudioUnitProperty_ParameterValueStrings
  333. Scope: Any
  334. Value Type: CFArrayRef
  335. Access: Read
  336. Some audio unit parameters that are of an index type, can also provide names for each value of the parameter. This property returns an array containing CFStrings, where
  337. each element in the array is the name that should be used for that parameter value. The size of the array should be the same as the range between the parameters min and max values.
  338. The array's strings can then be used to build a menu for that parameter.
  339. @constant kAudioUnitProperty_GetUIComponentList
  340. Scope: Any
  341. Value Type: AudioComponentDescription array
  342. Access: Read
  343. Presents an array of AudioComponentDescription that are of type 'auvw' (AudioUnitCarbonView). These are the carbon based custom views for that audio unit.
  344. @constant kAudioUnitProperty_AudioChannelLayout
  345. Scope: Input/Output
  346. Value Type: struct AudioChannelLayout
  347. Access: read/write
  348. Description:
  349. Describes for a given scope/element the order of channels within a given stream.
  350. The number of channels it describes must match the number of channels set for that
  351. scope/element. Each input and output bus in an audio unit can have one instance of
  352. this property.
  353. Some audio units require this property. For example, the 3DMixer unit must
  354. implement this property on its output bus. If a host application attempts to
  355. clear the value of this property on a bus that requires a valid value, the
  356. audio unit will return a kAudioUnitErr_InvalidPropertyValue error.
  357. Input and output buses can be in one of three states in regard to Audio
  358. channel layout:
  359. 1. implemented and set
  360. 2. implemented but not set
  361. 3. unimplemented
  362. Requesting the value of this property when it is implemented but not set
  363. results in a kAudioUnitErr_PropertyNotInUse error.
  364. Use the kAudioUnitProperty_AudioChannelLayout property whenever channel
  365. layout is relevant. By comparison, the kAudioUnitProperty_StreamFormat
  366. property cannot specify channel layout or purpose.
  367. See also: kAudioUnitProperty_SupportedChannelLayoutTags,
  368. kAudioUnitProperty_StreamFormat.
  369. @constant kAudioUnitProperty_TailTime
  370. Scope: Global
  371. Value Type: Float64
  372. Access: Read
  373. The time in seconds that will remain after the last valid input of any audio unit has been processed before the output is silent. For example, this could be the total
  374. decay time of a reverb or a delay. In general this will be a conservative estimate.
  375. @constant kAudioUnitProperty_BypassEffect
  376. Scope: Global
  377. Value Type: UInt32
  378. Access: read/write
  379. A boolean value that can be used to bypass the processing in an effect unit, so that the input is passed unchanged through to the output
  380. @constant kAudioUnitProperty_LastRenderError
  381. Scope: Global
  382. Value Type: OSStatus
  383. Access: Read
  384. This property is set if there is an error in AudioUnitRender. The AU will then fire a property changed notification to any listeners on this property and
  385. those listeners can then use this property ID to retrieve that error.
  386. @constant kAudioUnitProperty_SetRenderCallback
  387. Scope: Input
  388. Value Type: AURenderCallbackStruct
  389. Access: Write
  390. This is used to provide the audio unit with input on the specified element (input bus) with audio data from the provided callback. The callback is delivered a buffer list
  391. which it must fill in with audio data. If no data is available, it should set the audio data to 0 (silence). In the normal case, f an error is returned, the audio is not processed
  392. and the audio unit will return an error from AudioUnitRender.
  393. @constant kAudioUnitProperty_FactoryPresets
  394. Scope: Global
  395. Value Type: CFArray of AUPreset structures
  396. Access: Read
  397. An array of preset structures that provide a name and number for each preset. A factory preset is then chosen using the PresentPreset property.
  398. @constant kAudioUnitProperty_ContextName
  399. Scope: Global
  400. Value Type: CFString
  401. Access: read/write
  402. The host can set this as information to the audio unit to describe something about the context within which the audio unit is instantiated. For instance, "track 3" could
  403. be set as the context, so that the audio unit's view could then display "My audio unit on track 3" as information to the user of the particular context for any audio unit.
  404. @constant kAudioUnitProperty_RenderQuality
  405. Scope: Global
  406. Value Type: UInt32
  407. Access: read/write
  408. A value (0 - 127) that can be used to control the quality (complexity) of the rendering operation. A typical usage is to set render quality to maximum for best quality, but
  409. if CPU usage is a concern a lesser quality can be set to trade off render quality.
  410. @constant kAudioUnitProperty_HostCallbacks
  411. Scope: Global
  412. Value Type: HostCallbackInfo
  413. Access: Write
  414. The audio unit should only call the host callbacks while it is in its render function. The audio unit must provide the client info when calling the callbacks as provided
  415. by the host. They are provided as a means for an audio unit to gain information from the host about parameters that may affect its rendering operation.
  416. For example, what is the current beat of the host, is the transport running, and so forth.
  417. Any of the parameters of the callback function, when called by the audio unit, can be NULL. This indicates that the unit doesn't want to know that particular information.
  418. The exception is that the unit must always specify the HostUserData which was be supplied to the unit when the property was set.
  419. If the host is unable to provide the requested information then it can return the kAudioUnitErr_CannotDoInCurrentContext error code
  420. @constant kAudioUnitProperty_InPlaceProcessing
  421. Scope: Global
  422. Value Type: UInt32
  423. Access: read/write
  424. A property that can be used to determine if the audio unit can process input data on the same data as is provided to it, and if so this can be turned off if the host
  425. has a particular buffer management strategy and such an operation would defeat that.
  426. @constant kAudioUnitProperty_ElementName
  427. Scope: any
  428. Value Type: CFStringRef
  429. Access: read/write
  430. Description:
  431. The name of the specified element. The Host owns a reference to this property value
  432. (as with all other CF properties), and should release the string retrieved or used when setting.
  433. @constant kAudioUnitProperty_CocoaUI
  434. Scope: Global
  435. Value Type: struct AudioUnitCocoaViewInfo
  436. Access: read
  437. Publishes the audio unit's custom Cocoa NSViews. The Host can determine how big this structure is by
  438. querying the size of the property (i.e., How many alternate UI classes there are for the unit)
  439. Typically, most audio units will provide 1 UI class per unit
  440. @constant kAudioUnitProperty_SupportedChannelLayoutTags
  441. Scope: Input/Output
  442. Value Type: AudioChannelLayoutTags[ variable number of elements ]
  443. Access: read only
  444. Used with GetProperty to ascertain what an audio unit understands about
  445. laying out of channel orders. This will normally return one or more of the specified layout tags.
  446. When a specific set of layouts are returned, the client then uses the
  447. kAudioUnitProperty_AudioChannelLayout property (with one of those layout tags specified) to set
  448. the unit to use that layout. In this case the client (and the audio unit when reporting its
  449. AudioChannelLayout) is only expected to have set an AudioChannelLayout which only sets the
  450. layout tag as the valid field.
  451. Custom Channel Maps:
  452. Some audio units may return the tag:
  453. kAudioChannelLayoutTag_UseChannelDescriptions
  454. In this case, the host then can look at supported number of channels on that scope
  455. (using the kAudioUnitProperty_SupportedNumChannels), and supply an AudioChannelLayout with the
  456. kAudioUnitProperty_AudioChannelLayout property to specify the layout, number of channels
  457. and location of each of those channels. This custom channel map MUST have a channel valence
  458. that is supported by the Audio Unit.
  459. The UseChannelBitmap field is NOT used within the context of the AudioUnit.
  460. @constant kAudioUnitProperty_ParameterIDName
  461. Scope: any
  462. Value Type: AudioUnitParameterNameInfo
  463. Access: read
  464. An audio unit returns the full parameter name in the GetParameterInfo struct/property.
  465. In some display situations however, there may only be room for a few characters, and
  466. truncating this full name may give a less than optimal name for the user. Thus,
  467. this property can be used to ask the audio unit whether it can supply a truncated name, with
  468. the host suggesting a length (number of characters). If the unit returns a longer
  469. name than the host requests, that name maybe truncated to the requested characters in display.
  470. The unit could return a shorter name than requested as well. The unit returns a CFString
  471. that should be released by the host. When using this property, the host asks for
  472. the name in the same scope and element as the unit publishes the parameter.
  473. @constant kAudioUnitProperty_ParameterClumpName
  474. Scope: any
  475. Value Type: AudioUnitParameterNameInfo
  476. Access: read
  477. This works in a similar manner to the ParameterIDName property, except that the inID
  478. value is one of the clumpID's that are returned with the audio unit's ParameterInfo
  479. structure.
  480. @constant kAudioUnitProperty_PresentPreset
  481. Scope: Global/Part
  482. Value Type: AUPreset
  483. Access: read/write
  484. This property replaces the deprecated CurrentPreset property, due to the ambiguity of
  485. ownership of the CFString of the preset name in the older CurrentPreset property.
  486. With PresentPreset the client of the audio unit owns the CFString when it retrieves the
  487. preset with PresentPreset and is expected to release this (as with ALL properties
  488. that retrieve a CF object from an audio unit).
  489. @constant kAudioUnitProperty_OfflineRender
  490. Scope: Global
  491. Value Type: UInt32
  492. Access: read/write
  493. This is used by the host to indicate when an audio unit (that normally operates within a general real-time calling model) is
  494. rendering in an offline context. A typical usage of this is to set this to true when the rendering operation an audio unit is being used within is
  495. going to write out the results to a file. The value defaults to false, as the common usage of audio units is for real-time processing
  496. @constant kAudioUnitProperty_ParameterStringFromValue
  497. Scope: any
  498. Value Type: AudioUnitParameterStringFromValue
  499. Access: read
  500. This property is used with parameters that are marked with the
  501. kAudioUnitParameterFlag_HasName parameter info flag. This indicates that some
  502. (or all) of the values represented by the parameter can and should be
  503. represented by a special display string.
  504. This is NOT to be confused with kAudioUnitProperty_ParameterValueStrings. That property
  505. is used with parameters that are indexed and is typically used for instance to build
  506. a menu item of choices for one of several parameter values.
  507. kAudioUnitProperty_ParameterStringFromValue can have a continuous range, and merely states
  508. to the host that if it is displaying those parameter's values, they should request
  509. a name any time any value of the parameter is set when displaying that parameter.
  510. For instance (a trivial example), a unit may present a gain parameter in a dB scale,
  511. and wish to display its minimum value as "negative infinity". In this case, the audio unit
  512. will not return names for any parameter value greater than its minimum value - so the host
  513. will then just display the parameter value as is. For values less than or equal to the
  514. minimum value, the audio unit will return a string for "negative infinity" which the host can
  515. use to display appropriately.
  516. A less trivial example might be a parameter that presents its values as seconds. However,
  517. in some situations this value should be better displayed in a SMPTE style of display:
  518. HH:MM:SS:FF
  519. In this case, the audio unit would return a name for any value of the parameter.
  520. The GetProperty call is used in the same scope and element as the inParamID
  521. that is declared in the struct passed in to this property.
  522. If the *inValue member is NULL, then the audio unit should take the current value
  523. of the specified parameter. If the *inValue member is NOT NULL, then the audio unit should
  524. return the name used for the specified value.
  525. On exit, the outName may point to a CFStringRef (which if so must be released by the caller).
  526. If the parameter has no special name that should be applied to that parameter value,
  527. then outName will be NULL, and the host should display the parameter value as
  528. appropriate.
  529. @constant kAudioUnitProperty_ParameterValueFromString
  530. Scope: any
  531. Value Type: AudioUnitParameterValueFromString
  532. Access: read
  533. This property returns the value of a parameter from its string representation. See kAudioUnitProperty_ParameterStringFromValue.
  534. @constant kAudioUnitProperty_IconLocation
  535. Scope: Global
  536. Value Type: CFURLRef
  537. Access: Read
  538. A URL that will specify the location of an icon file that can be used when presenting UI for this audio unit.
  539. @constant kAudioUnitProperty_PresentationLatency
  540. Scope: Input/Output
  541. Value Type: Float64
  542. Access: write
  543. This property is set by a host to describe to the audio unit the presentation latency of both
  544. any of its input and/or output audio data.
  545. It describes this latency in seconds. A value of zero means either no latency
  546. or an unknown latency.
  547. This is a write only property because the host is telling the audio unit the latency of both the
  548. data it provides it for input and the latency from getting the data from the unit until it is
  549. presented.
  550. The property is should be set on each active input and output bus (Scope/Element pair).
  551. For example, an audio unit with multiple outputs will have the output data it produces processed
  552. by different audio units, etc before it is mixed and presented. Thus, in this case, each output
  553. element could have a different presentation latency.
  554. This should not be confused with the Latency property, where the audio unit describes to the host
  555. any processing latency it introduces between its input and its output.
  556. For input:
  557. Describes how long ago the audio given to an audio unit was acquired. For instance, when
  558. reading from a file to the first audio unit, then its input presentation latency will be zero.
  559. When processing audio input from a device, then this initial input latency will be the
  560. presentation latency of the device itself, the device's safety offset and latency.
  561. The next audio unit's (connected to that first unit) input presentation latency will be the
  562. input presentation latency of the first unit, plus the processing latency (as expressed by
  563. kAudioUnitProperty_Latency) of the first unit.
  564. For output:
  565. Describes how long before the output audio of an audio unit is to be presented. For instance,
  566. when writing to a file, then the last audio unit's output presentation latency will be zero.
  567. When the audio from that audio unit is to be played to an AudioDevice, then that initial
  568. presentation latency will be the latency of the device itself - which is the I/O buffer size,
  569. and the device's safety offset and latency
  570. The previous audio unit's (connected to this last unit) output presentation latency will be that
  571. initial presentation latency plus the processing latency (as expressed by
  572. kAudioUnitProperty_Latency) of the last unit.
  573. So, for a given audio unit anywhere within a mixing graph, the input and output presentation
  574. latencies describe to that unit how long from the moment of generation it will take for its
  575. input to arrive, and how long it will take for its output to be presented.
  576. You can use this property, for example, to provide metering for for an audio unit that
  577. is generating output to be presented to the user at a future time.
  578. @constant kAudioUnitProperty_DependentParameters
  579. Scope: any
  580. Value Type: array of AUDependentParameter
  581. Access: read
  582. This property is used for parameters with the kAudioUnitParameterFlag_IsGlobalMeta
  583. or kAudioUnitParameterFlag_IsElementMeta flags set. Hosts applications (and the
  584. AudioUnitParameterListener mechanism) can interrogate this property to determine which parameters
  585. are dependent on a
  586. meta-parameter.
  587. For parameters marked with kAudioUnitParameterFlag_IsGlobalMeta, any non-global
  588. dependent parameters are assumed to be dependent in every element of their scope.
  589. For parameters marked with kAudioUnitParameterFlag_IsElementMeta, then its dependent
  590. parameters must all be the same scope, and are assumed to apply only within a single element,
  591. not to other instances of the same parameter in other elements.
  592. @constant kAudioUnitProperty_AUHostIdentifier
  593. Scope: Global
  594. Value Type: AUHostVersionIdentifier
  595. Access: write
  596. Determine which application (and which version) an audio unit is being hosted by.
  597. This is made more complex through the intervention of audio units such as Kore, that are hosting
  598. other audio units (in this case of course, the real host of the audio unit is the hosting unit,
  599. not the host application, so the previous mechanism of getting the main bundle ID is no longer
  600. correct).
  601. There are also inconsistencies in the way that bundle identifiers are applied (with apps changing
  602. these from version to version), and we'd prefer to see a more consistent identifier used with
  603. this property. This is in spirit similar to the string returned by CFBundle API, except that we
  604. require this host string be consistent and reliable through different revisions of the host.
  605. The audio unit is responsible for retaining the hostName string if it needs to use it past the
  606. duration of the actual call. The host should set this property as early as possible within the
  607. lifetime of the unit in a session.
  608. This API used to take a NumVersion struct. It is redefined to take an AUHostVersionIdentifier struct
  609. which is binary compatible with the existing usage, but not source compatible.
  610. @constant kAudioUnitProperty_MIDIOutputCallbackInfo
  611. Scope: Global
  612. Value Type: CFArrayRef
  613. Access: read
  614. The host will also need to determine how many MIDI output streams the audio unit can generate
  615. (and the name for each of these outputs). Each MIDI output is a complete MIDI data stream,
  616. such as embodied by a MIDIEndpointRef in CoreMIDI.
  617. To do, the host uses this property and retrieves an array of CFStringRefs:
  618. - the size of the array is the number of MIDI Outputs the audio unit supports
  619. - each item in the array is the name for that output at that index
  620. The host should release the array when it is finished with it.
  621. Once the host has determined the audio unit supports this feature, it then instantiates a callback
  622. with the unit that the unit will call with MIDI data (see kAudioUnitProperty_MIDIOutputCallback).
  623. @constant kAudioUnitProperty_MIDIOutputCallback
  624. Scope: Global
  625. Value Type: AUMIDIOutputCallbackStruct
  626. Access: write
  627. The host sets this property on the audio unit with the callback (and its user data) set
  628. appropriately.
  629. Operational Parameters:
  630. In the render call, just as is the expected usage of the AUHostCallbacks, the audio unit can
  631. call the provided callback to provide MIDI data to the host that it will associate with the
  632. current AudioUnitRender call in process.
  633. The audio unit in the callback provides:
  634. - the user data provided by the host when the callback was established
  635. - the AudioTimeStamp that was provided to the audio unit for this particular call of
  636. AudioUnitRender
  637. - the output number to associate this MIDI data with
  638. - a MIDI Packet List containing MIDI data. The time stamp values contained within the
  639. MIDIPackets in this list are **sample offsets*** from the AudioTimeStamp provided.
  640. This allows MIDI data to be time-stamped with a sample offset that is directly associated
  641. with the audio data it is generating in the current call to the AudioUnitRender function
  642. There is no implied or expected association between the number (or position) of an audio unit's
  643. audio or MIDI outputs.
  644. @constant kAudioUnitProperty_InputSamplesInOutput
  645. Scope: Global
  646. Value Type: struct AUInputSamplesInOutputCallbackStruct
  647. Access: read/write
  648. An audio unit calls this callback at the end of its render call. The audio unit supplies the
  649. following information:
  650. outputTime - The timestamp passed in to the audio unit's render call. This timestamp
  651. represents the time of the first output sample.
  652. inputSample - The sample number of the first input sample that is present in the output
  653. audio.
  654. numInputSamples - The number of input samples that were used and are present in the output
  655. audio.
  656. This property allows a host application to determine which input samples correspond to a sample
  657. in the output buffer. It is useful only for audio units that do time-stretching, such as the
  658. AUVarispeed and AUTimePitch units, where the relationship between input and output samples is
  659. non-trivial. For these units, the range of input samples that correspond to an output buffer
  660. typically differs from the range of input samples that were pulled for that render call.
  661. This difference arises because of internal buffering, processing latency, and other factors.
  662. @constant kAudioUnitProperty_ClassInfoFromDocument
  663. Scope: Global
  664. Value Type: CFDictionary
  665. Access: read/write
  666. If the audio unit implements this property then it is going to do different actions establishing
  667. its state from a document rather than from a user preset. Thus, a host app should use this property
  668. first (instead of kAudioUnitProperty_ClassInfo) when restoring the state of an audio unit when
  669. opening a document. If the audio unit returns an error (or doesn't implement this property) then
  670. the host should use the same preset with the kAudioUnitProperty_ClassInfo.
  671. @constant kAudioUnitProperty_ShouldAllocateBuffer
  672. Scope: input/output elements (settable per element)
  673. Value Type: UInt32
  674. Access: read/write
  675. By default this value is true. This affects the allocations of the buffers for I/O (the mData field
  676. of the AudioBufferList used with AudioUnitRender, callbacks and connections)
  677. If true, the element will create a buffer for rendering into.
  678. If false, the element will not create a buffer for rendering.
  679. For example, if the audio unit is only ever going to have a connection as its input and never a callback, then
  680. it should not need to create a buffer (the API contract expects an audio unit to provide a buffer for
  681. callbacks, but no buffer for connections).
  682. If the audio unit is always going to be pulled for audio with the client providing audio data buffers to
  683. the AudioUnitRender call, then it will never need to create an audio buffer on the output side.
  684. So, this property can be used to control the default allocation strategy of an audio unit. If the audio unit
  685. needs a buffer, but one hasn't been allocated, then an error will be thrown from that call to AudioUnitRender.
  686. This property cannot be set on Initialised audio units as it may end up reallocating memory.
  687. @constant kAudioUnitProperty_FrequencyResponse
  688. Scope: input/output elements (settable per element)
  689. Value Type: AudioUnitFrequencyResponseBin
  690. Access: read
  691. The property provides a way for a user interface view to get points for drawing a graph of the frequency
  692. response of the AU.
  693. An array of AudioUnitFrequencyResponseBin are passed in to kAudioUnitProperty_FrequencyResponse
  694. with the mFrequency field filled in. The array is returned with the mMagnitude fields filled in.
  695. If fewer than kNumberOfResponseFrequencies are needed, then the first unused bin should be marked with
  696. a negative frequency.
  697. @constant kAudioUnitProperty_ParameterHistoryInfo
  698. Scope: Global
  699. Value Type: AudioUnitParameterHistoryInfo
  700. Access: read
  701. For parameters which have kAudioUnitParameterFlag_PlotHistory set, getting this property fills out the
  702. AudioUnitParameterHistoryInfo struct containing the recommended update rate and history duration.
  703. }
  704. const
  705. // range (0 -> 999)
  706. kAudioUnitProperty_ClassInfo = 0;
  707. kAudioUnitProperty_MakeConnection = 1;
  708. kAudioUnitProperty_SampleRate = 2;
  709. kAudioUnitProperty_ParameterList = 3;
  710. kAudioUnitProperty_ParameterInfo = 4;
  711. kAudioUnitProperty_CPULoad = 6;
  712. kAudioUnitProperty_StreamFormat = 8;
  713. kAudioUnitProperty_ElementCount = 11;
  714. kAudioUnitProperty_Latency = 12;
  715. kAudioUnitProperty_SupportedNumChannels = 13;
  716. kAudioUnitProperty_MaximumFramesPerSlice = 14;
  717. kAudioUnitProperty_ParameterValueStrings = 16;
  718. kAudioUnitProperty_AudioChannelLayout = 19;
  719. kAudioUnitProperty_TailTime = 20;
  720. kAudioUnitProperty_BypassEffect = 21;
  721. kAudioUnitProperty_LastRenderError = 22;
  722. kAudioUnitProperty_SetRenderCallback = 23;
  723. kAudioUnitProperty_FactoryPresets = 24;
  724. kAudioUnitProperty_RenderQuality = 26;
  725. kAudioUnitProperty_InPlaceProcessing = 29;
  726. kAudioUnitProperty_ElementName = 30;
  727. kAudioUnitProperty_SupportedChannelLayoutTags = 32;
  728. kAudioUnitProperty_PresentPreset = 36;
  729. kAudioUnitProperty_ShouldAllocateBuffer = 51;
  730. kAudioUnitProperty_ParameterHistoryInfo = 53;
  731. //#if !TARGET_OS_IPHONE;
  732. {$ifc not TARGET_OS_IPHONE}
  733. kAudioUnitProperty_FastDispatch = 5;
  734. kAudioUnitProperty_SetExternalBuffer = 15;
  735. kAudioUnitProperty_GetUIComponentList = 18;
  736. kAudioUnitProperty_ContextName = 25;
  737. kAudioUnitProperty_HostCallbacks = 27;
  738. kAudioUnitProperty_CocoaUI = 31;
  739. kAudioUnitProperty_ParameterIDName = 34;
  740. kAudioUnitProperty_ParameterClumpName = 35;
  741. kAudioUnitProperty_ParameterStringFromValue = 33;
  742. kAudioUnitProperty_OfflineRender = 37;
  743. kAudioUnitProperty_ParameterValueFromString = 38;
  744. kAudioUnitProperty_IconLocation = 39;
  745. kAudioUnitProperty_PresentationLatency = 40;
  746. kAudioUnitProperty_DependentParameters = 45;
  747. kAudioUnitProperty_AUHostIdentifier = 46;
  748. kAudioUnitProperty_MIDIOutputCallbackInfo = 47;
  749. kAudioUnitProperty_MIDIOutputCallback = 48;
  750. kAudioUnitProperty_InputSamplesInOutput = 49;
  751. kAudioUnitProperty_ClassInfoFromDocument = 50;
  752. kAudioUnitProperty_FrequencyResponse = 52;
  753. //#endif;
  754. {$endc}
  755. {!
  756. @abstract Keys contains in an audio unit preset (ClassInfo) dictionary
  757. @discussion These strings are used as keys in the AUPreset-"classInfo" dictionary
  758. The actual keys are CFStrings to use these keys you define the key as:
  759. static const CFStringRef kMyVersionString = CFSTR(kAUPresetVersionKey);
  760. }
  761. const
  762. kAUPresetVersionKey = 'version';
  763. const
  764. kAUPresetTypeKey = 'type';
  765. const
  766. kAUPresetSubtypeKey = 'subtype';
  767. const
  768. kAUPresetManufacturerKey = 'manufacturer';
  769. const
  770. kAUPresetDataKey = 'data';
  771. const
  772. kAUPresetNameKey = 'name';
  773. const
  774. kAUPresetRenderQualityKey = 'render-quality';
  775. const
  776. kAUPresetCPULoadKey = 'cpu-load';
  777. const
  778. kAUPresetElementNameKey = 'element-name';
  779. const
  780. kAUPresetExternalFileRefs = 'file-references';
  781. //#if !TARGET_OS_IPHONE
  782. {$ifc not TARGET_OS_IPHONE}
  783. // these are keys to use when a preset contains data from other plugin formats
  784. // vstdata is used to signify VST state from a vst "bank"
  785. const kAUPresetVSTDataKey = 'vstdata';
  786. // vstpreset is used to signify VST state from a vst "preset"
  787. const kAUPresetVSTPresetKey = 'vstpreset';
  788. const kAUPresetMASDataKey = 'masdata';
  789. //#endif
  790. {$endc}
  791. {!
  792. @defined kAUPresetPartKey
  793. @discussion This key if present, distinguishes a global preset that is set
  794. on the global scope with a part-based preset that is set on the part scope.
  795. The value of this key is audio unit defined
  796. }
  797. const
  798. kAUPresetPartKey = 'part';
  799. {!
  800. @struct AudioUnitConnection
  801. @abstract This structure contains the information needed to make a connection between a source
  802. and destination audio unit.
  803. @discussion The structure is set on the destination audio unit's input element
  804. @field sourceAudioUnit
  805. The audio unit that is the source for the connection
  806. @field sourceOutputNumber
  807. The source audio unit's output element to be used in the connection
  808. @field destInputNumber
  809. The destination audio unit's input element to be used in the connection
  810. }
  811. type
  812. AudioUnitConnection = record
  813. sourceAudioUnit: AudioUnit;
  814. sourceOutputNumber: UInt32;
  815. destInputNumber: UInt32;
  816. end;
  817. AudioUnitConnectionPtr = ^AudioUnitConnection;
  818. {!
  819. @struct AUChannelInfo
  820. @abstract Define an audio unit's channel handling capabilities
  821. }
  822. type
  823. AUChannelInfo = record
  824. inChannels: SInt16;
  825. outChannels: SInt16;
  826. end;
  827. AUChannelInfoPtr = ^AUChannelInfo;
  828. {!
  829. @struct AudioUnitExternalBuffer
  830. @abstract Allow a host to tell an audio unit to use the provided memory for its input callback
  831. }
  832. type
  833. AudioUnitExternalBuffer = record
  834. buffer: BytePtr;
  835. size: UInt32;
  836. end;
  837. AudioUnitExternalBufferPtr = ^AudioUnitExternalBuffer;
  838. {!
  839. @struct AURenderCallbackStruct
  840. @abstract Used by a host when registering a callback with the audio unit to provide input
  841. }
  842. type
  843. AURenderCallbackStruct = record
  844. inputProc: AURenderCallback;
  845. inputProcRefCon: UnivPtr;
  846. end;
  847. AURenderCallbackStructPtr = ^AURenderCallbackStruct;
  848. {!
  849. @struct AUPreset
  850. @abstract Used to publish and set factory presets on an audio unit
  851. @field presetNumber
  852. If < 0, then preset is a user preset
  853. If >= 0, then this field is used to select the factory preset
  854. @field presetName
  855. If a factory preset, the name of the specified factory preset
  856. }
  857. type
  858. AUPreset = record
  859. presetNumber: SInt32;
  860. presetName: CFStringRef;
  861. end;
  862. AUPresetPtr = ^AUPreset;
  863. {!
  864. @enum RenderQuality
  865. @abstract Used to get/set a render quality setting on an audio unit
  866. @discussion Typically, this property is used to trade-off between CPU usage, latency
  867. and the quality of the audio unit's processing/output.
  868. }
  869. const
  870. kRenderQuality_Max = $7F;
  871. kRenderQuality_High = $60;
  872. kRenderQuality_Medium = $40;
  873. kRenderQuality_Low = $20;
  874. kRenderQuality_Min = 0;
  875. //#if !TARGET_OS_IPHONE
  876. {$ifc not TARGET_OS_IPHONE}
  877. {!
  878. @enum kNumberOfResponseFrequencies
  879. @abstract The maximum number of frequency response bins for kAudioUnitProperty_FrequencyResponse.
  880. @discussion An array of AudioUnitFrequencyResponseBin are passed in to kAudioUnitProperty_FrequencyResponse
  881. with the mFrequency field filled in. The array is returned with the mMagnitude fields filled in.
  882. If fewer than kNumberOfResponseFrequencies are needed, then the first unused bin should be marked with
  883. a negative frequency.
  884. }
  885. const
  886. kNumberOfResponseFrequencies = 1024;
  887. {!
  888. @struct AudioUnitFrequencyResponseBin
  889. @abstract Structure used to get the magnitude of the frequency response at a particular frequency via kAudioUnitProperty_FrequencyResponse.
  890. @discussion An array of AudioUnitFrequencyResponseBin are passed in to kAudioUnitProperty_FrequencyResponse
  891. with the mFrequency field filled in. The array is returned with the mMagnitude fields filled in.
  892. If fewer than kNumberOfResponseFrequencies are needed, then the first unused bin should be marked with
  893. a negative frequency.
  894. }
  895. type
  896. AudioUnitFrequencyResponseBin = record
  897. mFrequency: Float64;
  898. mMagnitude: Float64;
  899. end;
  900. AudioUnitFrequencyResponseBinPtr = ^AudioUnitFrequencyResponseBin;
  901. {!
  902. @typedef HostCallback_GetBeatAndTempo
  903. @abstract Retrieve information about the current beat and/or tempo
  904. @discussion If the host app has set this callback, then the audio unit can use this to get the current beat and tempo as they relate to the first sample in the render buffer. The audio unit can call this callback only from within the audio unit render call (otherwise the host is unable to provide information accurately to the audio unit as the information obtained is relate to the current AudioUnitRender call). If the host cannot provide the requested information, it will return kAudioUnitErr_CannotDoInCurrentContext.
  905. The AudioUnit can provide NULL for any of the requested parameters (except for inHostUserData) if it is not interested in that particular piece of information
  906. @param inHostUserData Must be provided by the audio unit when it makes this call. It is the client data provided by the host when it set the HostCallbacks property
  907. @param outCurrentBeat The current beat, where 0 is the first beat. Tempo is defined as the number of whole-number (integer) beat values (as indicated by the outCurrentBeat field) per minute.
  908. @param outCurrentTempo The current tempo
  909. }
  910. type
  911. HostCallback_GetBeatAndTempo = function( inHostUserData: UnivPtr; var outCurrentBeat: Float64; var outCurrentTempo: Float64 ): OSStatus;
  912. {!
  913. @typedef HostCallback_GetMusicalTimeLocation
  914. @abstract Retrieve information about the musical time state of the host
  915. @discussion If the host app has set this callback, then the audio unit can use this to obtain information about the state of musical time in the host. The audio unit can call this callback only from within the audio unit render call (otherwise the host is unable to provide information accurately to the audio unit as the information obtained is relate to the current AudioUnitRender call). If the host cannot provide the requested information, it will return kAudioUnitErr_CannotDoInCurrentContext.
  916. The AudioUnit can provide NULL for any of the requested parameters (except for inHostUserData) if it is not interested in that particular piece of information
  917. @param inHostUserData Must be provided by the audio unit when it makes this call. It is the client data provided by the host when it set the HostCallbacks property
  918. @param outDeltaSampleOffsetToNextBeat The number of samples until the next whole beat from the start sample of the current rendering buffer
  919. @param outTimeSig_Numerator The Numerator of the current time signature
  920. @param outTimeSig_Denominator The Denominator of the current time signature (4 is a quarter note, etc)
  921. @param outCurrentMeasureDownBeat The beat that corresponds to the downbeat (first beat) of the current measure that is being rendered
  922. }
  923. type
  924. HostCallback_GetMusicalTimeLocation = function( inHostUserData: UnivPtr; var outDeltaSampleOffsetToNextBeat: UInt32; var outTimeSig_Numerator: Float32; var outTimeSig_Denominator: UInt32; var outCurrentMeasureDownBeat: Float64 ): OSStatus;
  925. {!
  926. @typedef HostCallback_GetTransportState
  927. @abstract Retrieve information about the time line's (or transport) state of the host.
  928. @discussion If the host app has set this callback, then the audio unit can use this to obtain information about the transport state of the host's time line. The audio unit can call this callback only from within the audio unit render call (otherwise the host is unable to provide information accurately to the audio unit as the information obtained is relate to the current AudioUnitRender call. If the host cannot provide the requested information, it will return kAudioUnitErr_CannotDoInCurrentContext.
  929. The AudioUnit can provide NULL for any of the requested parameters (except for inHostUserData) if it is not interested in that particular piece of information
  930. @param inHostUserData Must be provided by the audio unit when it makes this call. It is the client data provided by the host when it set the HostCallbacks property
  931. @param outIsPlaying Returns true if the host's transport is currently playing, false if stopped
  932. @param outTransportStateChanged Returns true if there was a change to the state of, or discontinuities in, the host's transport (generally since the callback was last called). Can indicate such state changes as start/top, time moves (jump from one time line to another).
  933. @param outCurrentSampleInTimeLine Returns the current sample count in the time line of the host's transport time.
  934. @param outIsCycling Returns true if the host's transport is currently cycling or looping
  935. @param outCycleStartBeat If cycling is true, the start beat of the cycle or loop point in the host's transport
  936. @param outCycleEndBeat If cycling is true, the end beat of the cycle or loop point in the host's transport
  937. }
  938. type
  939. HostCallback_GetTransportState = function( inHostUserData: UnivPtr; var outIsPlaying: Boolean; var outTransportStateChanged: Boolean; var outCurrentSampleInTimeLine: Float64; var outIsCycling: Boolean; var outCycleStartBeat: Float64; var outCycleEndBeat: Float64 ): OSStatus;
  940. {!
  941. @struct HostCallbackInfo
  942. @abstract Contains the various callbacks (or NULL) for an audio unit to call
  943. }
  944. type
  945. HostCallbackInfo = record
  946. hostUserData: UnivPtr;
  947. beatAndTempoProc: HostCallback_GetBeatAndTempo;
  948. musicalTimeLocationProc: HostCallback_GetMusicalTimeLocation;
  949. transportStateProc: HostCallback_GetTransportState;
  950. end;
  951. HostCallbackInfoPtr = ^HostCallbackInfo;
  952. {!
  953. @struct AudioUnitCocoaViewInfo
  954. @abstract The name and how many, NSView objects an audio unit publishes as a custom Cocoa view.
  955. @field mCocoaAUViewBundleLocation
  956. Contains the location of the bundle which the host app can then use to locate the bundle
  957. @field mCocoaAUViewClass
  958. Contains the names of the classes that implements the required protocol for an AUView
  959. }
  960. type
  961. AudioUnitCocoaViewInfo = record
  962. mCocoaAUViewBundleLocation: CFURLRef;
  963. mCocoaAUViewClass: array[0..0] of CFStringRef;
  964. end;
  965. AudioUnitCocoaViewInfoPtr = ^AudioUnitCocoaViewInfo;
  966. {!
  967. @struct AUDependentParameter
  968. @abstract Used to represent a dependent parameter that can change as a result of its parent meta-parameter
  969. changing
  970. }
  971. type
  972. AUDependentParameter = record
  973. mScope: AudioUnitScope;
  974. mParameterID: AudioUnitParameterID;
  975. end;
  976. AUDependentParameterPtr = ^AUDependentParameter;
  977. {!
  978. @struct AUHostVersionIdentifier
  979. @abstract Used to describe the name and version of the audio unit's host
  980. }
  981. type
  982. AUHostVersionIdentifier = record
  983. hostName: CFStringRef;
  984. hostVersion: UInt32;
  985. end;
  986. AUHostVersionIdentifierPtr = ^AUHostVersionIdentifier;
  987. {
  988. @typedef AUMIDIOutputCallback
  989. @abstract A callback used by an audio unit to provide MIDI data to a host application
  990. }
  991. type
  992. AUMIDIOutputCallback = function( userData: UnivPtr; const (*var*) timeStamp: AudioTimeStamp; midiOutNum: UInt32; {const} pktlist: MIDIPacketListPtr ): OSStatus;
  993. {!
  994. @struct AUMIDIOutputCallbackStruct
  995. @abstract Set by host application to provide the callback and user data for an audio
  996. unit that provides MIDI output
  997. }
  998. type
  999. AUMIDIOutputCallbackStruct = record
  1000. midiOutputCallback: AUMIDIOutputCallback;
  1001. userData: UnivPtr;
  1002. end;
  1003. AUMIDIOutputCallbackStructPtr = ^AUMIDIOutputCallbackStruct;
  1004. {!
  1005. @struct AUInputSamplesInOutputCallbackStruct
  1006. @abstract Used by a host when registering a callback with an audio unit, to provide
  1007. input-to-output samples mapping
  1008. }
  1009. type
  1010. AUInputSamplesInOutputCallbackStruct = record
  1011. inputToOutputCallback: AUInputSamplesInOutputCallback;
  1012. userData: UnivPtr;
  1013. end;
  1014. AUInputSamplesInOutputCallbackStructPtr = ^AUInputSamplesInOutputCallbackStruct;
  1015. {$endc} { not TARGET_OS_IPHONE }
  1016. {!
  1017. @struct AudioUnitParameterHistoryInfo
  1018. @abstract This structure contains the suggested update rate and history duration for parameters which have the kAudioUnitParameterFlag_PlotHistory flag set.
  1019. The structure is filled out by getting kAudioUnitProperty_ParameterHistoryInfo.
  1020. @field updatesPerSecond
  1021. This is the number of times per second that it is suggested that the host get the value of this parameter.
  1022. @field historyDurationInSeconds
  1023. This is the duration in seconds of history that should be plotted.
  1024. }
  1025. type
  1026. AudioUnitParameterHistoryInfo = record
  1027. updatesPerSecond: Float32;
  1028. historyDurationInSeconds: Float32;
  1029. end;
  1030. AudioUnitParameterHistoryInfoPtr = ^AudioUnitParameterHistoryInfo;
  1031. //=====================================================================================================================
  1032. //#pragma mark - Parameter Definitions
  1033. // assume kAudioUnitParameterUnit_Generic if not found in this enum
  1034. {!
  1035. @enum AudioUnitParameterUnit
  1036. @constant kAudioUnitParameterUnit_Generic
  1037. untyped value generally between 0.0 and 1.0
  1038. @constant kAudioUnitParameterUnit_Indexed
  1039. takes an integer value (good for menu selections)
  1040. @constant kAudioUnitParameterUnit_Boolean
  1041. 0.0 means FALSE, non-zero means TRUE
  1042. @constant kAudioUnitParameterUnit_Percent
  1043. usually from 0 -> 100, sometimes -50 -> +50
  1044. @constant kAudioUnitParameterUnit_Seconds
  1045. absolute or relative time
  1046. @constant kAudioUnitParameterUnit_SampleFrames
  1047. one sample frame equals (1.0/sampleRate) seconds
  1048. @constant kAudioUnitParameterUnit_Phase
  1049. -180 to 180 degrees
  1050. @constant kAudioUnitParameterUnit_Rate
  1051. rate multiplier, for playback speed, etc. (e.g. 2.0 == twice as fast)
  1052. @constant kAudioUnitParameterUnit_Hertz
  1053. absolute frequency/pitch in cycles/second
  1054. @constant kAudioUnitParameterUnit_Cents
  1055. unit of relative pitch
  1056. @constant kAudioUnitParameterUnit_RelativeSemiTones
  1057. useful for coarse detuning
  1058. @constant kAudioUnitParameterUnit_MIDINoteNumber
  1059. absolute pitch as defined in the MIDI spec (exact freq may depend on tuning table)
  1060. @constant kAudioUnitParameterUnit_MIDIController
  1061. a generic MIDI controller value from 0 -> 127
  1062. @constant kAudioUnitParameterUnit_Decibels
  1063. logarithmic relative gain
  1064. @constant kAudioUnitParameterUnit_LinearGain
  1065. linear relative gain
  1066. @constant kAudioUnitParameterUnit_Degrees
  1067. -180 to 180 degrees, similar to phase but more general (good for 3D coord system)
  1068. @constant kAudioUnitParameterUnit_EqualPowerCrossfade
  1069. 0 -> 100, crossfade mix two sources according to sqrt(x) and sqrt(1.0 - x)
  1070. @constant kAudioUnitParameterUnit_MixerFaderCurve1
  1071. 0.0 -> 1.0, pow(x, 3.0) -> linear gain to simulate a reasonable mixer channel fader response
  1072. @constant kAudioUnitParameterUnit_Pan
  1073. standard left to right mixer pan
  1074. @constant kAudioUnitParameterUnit_Meters
  1075. distance measured in meters
  1076. @constant kAudioUnitParameterUnit_AbsoluteCents
  1077. absolute frequency measurement :
  1078. if f is freq in hertz then absoluteCents = 1200 * log2(f / 440) + 6900
  1079. @constant kAudioUnitParameterUnit_Octaves
  1080. octaves in relative pitch where a value of 1 is equal to 1200 cents
  1081. @constant kAudioUnitParameterUnit_BPM
  1082. beats per minute, ie tempo
  1083. @constant kAudioUnitParameterUnit_Beats
  1084. time relative to tempo, i.e., 1.0 at 120 BPM would equal 1/2 a second
  1085. @constant kAudioUnitParameterUnit_Milliseconds
  1086. parameter is expressed in milliseconds
  1087. @constant kAudioUnitParameterUnit_Ratio
  1088. for compression, expansion ratio, etc.
  1089. @constant kAudioUnitParameterUnit_CustomUnit
  1090. this is the parameter unit type for parameters that present a custom unit name
  1091. }
  1092. const
  1093. kAudioUnitParameterUnit_Generic = 0;
  1094. kAudioUnitParameterUnit_Indexed = 1;
  1095. kAudioUnitParameterUnit_Boolean = 2;
  1096. kAudioUnitParameterUnit_Percent = 3;
  1097. kAudioUnitParameterUnit_Seconds = 4;
  1098. kAudioUnitParameterUnit_SampleFrames = 5;
  1099. kAudioUnitParameterUnit_Phase = 6;
  1100. kAudioUnitParameterUnit_Rate = 7;
  1101. kAudioUnitParameterUnit_Hertz = 8;
  1102. kAudioUnitParameterUnit_Cents = 9;
  1103. kAudioUnitParameterUnit_RelativeSemiTones = 10;
  1104. kAudioUnitParameterUnit_MIDINoteNumber = 11;
  1105. kAudioUnitParameterUnit_MIDIController = 12;
  1106. kAudioUnitParameterUnit_Decibels = 13;
  1107. kAudioUnitParameterUnit_LinearGain = 14;
  1108. kAudioUnitParameterUnit_Degrees = 15;
  1109. kAudioUnitParameterUnit_EqualPowerCrossfade = 16;
  1110. kAudioUnitParameterUnit_MixerFaderCurve1 = 17;
  1111. kAudioUnitParameterUnit_Pan = 18;
  1112. kAudioUnitParameterUnit_Meters = 19;
  1113. kAudioUnitParameterUnit_AbsoluteCents = 20;
  1114. kAudioUnitParameterUnit_Octaves = 21;
  1115. kAudioUnitParameterUnit_BPM = 22;
  1116. kAudioUnitParameterUnit_Beats = 23;
  1117. kAudioUnitParameterUnit_Milliseconds = 24;
  1118. kAudioUnitParameterUnit_Ratio = 25;
  1119. kAudioUnitParameterUnit_CustomUnit = 26;
  1120. {!
  1121. @typedef AudioUnitParameterUnit
  1122. }
  1123. type
  1124. AudioUnitParameterUnit = UInt32;
  1125. {!
  1126. @struct AudioUnitParameterInfo
  1127. @field name
  1128. UNUSED - set to zero - UTF8 encoded C string (originally).
  1129. @field unitName
  1130. only valid if kAudioUnitParameterUnit_CustomUnit is set. If kAudioUnitParameterUnit_CustomUnit
  1131. is set, this field must contain a valid CFString.
  1132. @field clumpID
  1133. only valid if kAudioUnitParameterFlag_HasClump
  1134. @field cfNameString
  1135. only valid if kAudioUnitParameterFlag_HasCFNameString
  1136. @field unit
  1137. if the "unit" field contains a value not in the enum above, then assume
  1138. kAudioUnitParameterUnit_Generic
  1139. @field minValue
  1140. @field maxValue
  1141. @field defaultValue
  1142. @field flags
  1143. Due to some vagaries about the ways in which Parameter's CFNames have been described, it was
  1144. necessary to add a flag: kAudioUnitParameterFlag_CFNameRelease
  1145. In normal usage a parameter name is essentially a static object, but sometimes an audio unit will
  1146. generate parameter names dynamically.. As these are expected to be CFStrings, in that case
  1147. the host should release those names when it is finished with them, but there was no way
  1148. to communicate this distinction in behavior.
  1149. Thus, if an audio unit will (or could) generate a name dynamically, it should set this flag in
  1150. the parameter's info. The host should check for this flag, and if present, release the parameter
  1151. name when it is finished with it.
  1152. }
  1153. type
  1154. AudioUnitParameterInfo = record
  1155. name : packed array [0..51] of char;
  1156. unitName: CFStringRef;
  1157. clumpID: UInt32;
  1158. cfNameString: CFStringRef;
  1159. unt: AudioUnitParameterUnit;
  1160. minValue: AudioUnitParameterValue;
  1161. maxValue: AudioUnitParameterValue;
  1162. defaultValue: AudioUnitParameterValue;
  1163. flags: UInt32;
  1164. end;
  1165. AudioUnitParameterInfoPtr = ^AudioUnitParameterInfo;
  1166. {!
  1167. @enum Audio Unit Parameter Flags
  1168. @discussion Bit positions 18, 17, and 16 are set aside for display scales. Bit 19 is reserved.
  1169. @constant kAudioUnitParameterFlag_CFNameRelease
  1170. @constant kAudioUnitParameterFlag_PlotHistory
  1171. @constant kAudioUnitParameterFlag_MeterReadOnly
  1172. @constant kAudioUnitParameterFlag_DisplayMask
  1173. @constant kAudioUnitParameterFlag_DisplaySquareRoot
  1174. @constant kAudioUnitParameterFlag_DisplaySquared
  1175. @constant kAudioUnitParameterFlag_DisplayCubed
  1176. @constant kAudioUnitParameterFlag_DisplayCubeRoot
  1177. @constant kAudioUnitParameterFlag_DisplayExponential
  1178. @constant kAudioUnitParameterFlag_HasClump
  1179. @constant kAudioUnitParameterFlag_ValuesHaveStrings
  1180. @constant kAudioUnitParameterFlag_DisplayLogarithmic
  1181. @constant kAudioUnitParameterFlag_IsHighResolution
  1182. @constant kAudioUnitParameterFlag_NonRealTime
  1183. @constant kAudioUnitParameterFlag_CanRamp
  1184. @constant kAudioUnitParameterFlag_ExpertMode
  1185. @constant kAudioUnitParameterFlag_HasCFNameString
  1186. @constant kAudioUnitParameterFlag_IsGlobalMeta
  1187. @constant kAudioUnitParameterFlag_IsElementMeta
  1188. @constant kAudioUnitParameterFlag_IsReadable
  1189. @constant kAudioUnitParameterFlag_IsWritable
  1190. }
  1191. const
  1192. kAudioUnitParameterFlag_CFNameRelease = 1 shl 4;
  1193. kAudioUnitParameterFlag_PlotHistory = 1 shl 14;
  1194. kAudioUnitParameterFlag_MeterReadOnly = 1 shl 15;
  1195. // bit positions 18,17,16 are set aside for display scales. bit 19 is reserved.
  1196. kAudioUnitParameterFlag_DisplayMask = (7 shl 16) or (1 shl 22);
  1197. kAudioUnitParameterFlag_DisplaySquareRoot = 1 shl 16;
  1198. kAudioUnitParameterFlag_DisplaySquared = 2 shl 16;
  1199. kAudioUnitParameterFlag_DisplayCubed = 3 shl 16;
  1200. kAudioUnitParameterFlag_DisplayCubeRoot = 4 shl 16;
  1201. kAudioUnitParameterFlag_DisplayExponential = 5 shl 16;
  1202. kAudioUnitParameterFlag_HasClump = 1 shl 20;
  1203. kAudioUnitParameterFlag_ValuesHaveStrings = 1 shl 21;
  1204. kAudioUnitParameterFlag_DisplayLogarithmic = 1 shl 22;
  1205. kAudioUnitParameterFlag_IsHighResolution = 1 shl 23;
  1206. kAudioUnitParameterFlag_NonRealTime = 1 shl 24;
  1207. kAudioUnitParameterFlag_CanRamp = 1 shl 25;
  1208. kAudioUnitParameterFlag_ExpertMode = 1 shl 26;
  1209. kAudioUnitParameterFlag_HasCFNameString = 1 shl 27;
  1210. kAudioUnitParameterFlag_IsGlobalMeta = 1 shl 28;
  1211. kAudioUnitParameterFlag_IsElementMeta = 1 shl 29;
  1212. kAudioUnitParameterFlag_IsReadable = 1 shl 30;
  1213. kAudioUnitParameterFlag_IsWritable = 1 shl 31;
  1214. {!
  1215. @enum Audio Unit Clump ID
  1216. @discussion Audio unit developers should not use a clump ID of 0. This value is reserved for system use.
  1217. }
  1218. const
  1219. kAudioUnitClumpID_System = 0;
  1220. function GetAudioUnitParameterDisplayType(flags : UInt32) : UInt32; inline;
  1221. function AudioUnitDisplayTypeIsLogarithmic(flags : UInt32) : Boolean; inline;
  1222. function AudioUnitDisplayTypeIsSquareRoot(flags : UInt32) : Boolean; inline;
  1223. function AudioUnitDisplayTypeIsSquared(flags : UInt32) : Boolean; inline;
  1224. function AudioUnitDisplayTypeIsCubed(flags : UInt32) : Boolean; inline;
  1225. function AudioUnitDisplayTypeIsCubeRoot(flags : UInt32) : Boolean; inline;
  1226. function AudioUnitDisplayTypeIsExponential(flags : UInt32) : Boolean; inline;
  1227. procedure SetAudioUnitParameterDisplayType(var flags : UInt32; displayType : UInt32); inline;
  1228. //#if !TARGET_OS_IPHONE
  1229. {$ifc not TARGET_OS_IPHONE}
  1230. {
  1231. The following properties are used with display names and are only available
  1232. in the full desktop environment
  1233. }
  1234. {!
  1235. @enum Audio Unit Parameter Full Name
  1236. @discussion Used with the AudioUnitParameterNameInfo.inDesiredLength field to indicate the full name
  1237. of the requested parameter.
  1238. }
  1239. const
  1240. kAudioUnitParameterName_Full = -1;
  1241. {!
  1242. @struct AudioUnitParameterNameInfo
  1243. @abstract Used to provide shorter names for a specified parameter
  1244. }
  1245. type
  1246. AudioUnitParameterNameInfo = record
  1247. inID: AudioUnitParameterID;
  1248. inDesiredLength: SInt32;
  1249. outName: CFStringRef;
  1250. end;
  1251. AudioUnitParameterNameInfoPtr = ^AudioUnitParameterNameInfo;
  1252. {!
  1253. @struct AudioUnitParameterStringFromValue
  1254. @abstract Provide a string representation of a parameter's value
  1255. }
  1256. type
  1257. AudioUnitParameterStringFromValue = record
  1258. inParamID: AudioUnitParameterID;
  1259. inValue: { const } AudioUnitParameterValuePtr;
  1260. outString: CFStringRef;
  1261. end;
  1262. AudioUnitParameterStringFromValuePtr = ^AudioUnitParameterStringFromValue;
  1263. {!
  1264. @struct AudioUnitParameterValueFromString
  1265. @abstract Provide the parameter's value for a given string representation of it
  1266. }
  1267. type
  1268. AudioUnitParameterValueFromString = record
  1269. inParamID: AudioUnitParameterID;
  1270. inString: CFStringRef;
  1271. outValue: AudioUnitParameterValue;
  1272. end;
  1273. AudioUnitParameterValueFromStringPtr = ^AudioUnitParameterValueFromString;
  1274. {$endc} { not TARGET_OS_IPHONE}
  1275. // These strings are used as keys to the dictionary of configuration info returned by
  1276. // AudioComponentGetConfiguationInfo(). Informaton about them is presented inline with the
  1277. // declaration.
  1278. {!
  1279. @define kAudioUnitConfigurationInfo_HasCustomView
  1280. @discussion This is a boolean value that indicates whether or not the AU has a custom view
  1281. }
  1282. const
  1283. kAudioUnitConfigurationInfo_HasCustomView = 'HasCustomView';
  1284. {!
  1285. @define kAudioUnitConfigurationInfo_ChannelConfigurations
  1286. @discussion This is an array of pairs of values where each item in the array is an array of two
  1287. numbers and is the equivalent of an AUChannelInfo. If the AudioUnit is an effect and
  1288. it doesn't implement kAudioUnitProperty_SupportedNumChannels, the array will contain
  1289. only the single entry, ( -1, -1). If the AudioUnit is an instrument or a generator
  1290. and doesn't implement kAudioUnitProperty_SupportedNumChannels, the array will be
  1291. empty and means that the AU's initial state is all that is supported.
  1292. }
  1293. const
  1294. kAudioUnitConfigurationInfo_ChannelConfigurations = 'ChannelConfigurations';
  1295. {!
  1296. @define kAudioUnitConfigurationInfo_InitialInputs
  1297. @discussion An array of numbers whose size is equal to the number of input buses posessed by the
  1298. AU. Each number in the array represents the number of channels for the corresponding
  1299. bus.
  1300. }
  1301. const
  1302. kAudioUnitConfigurationInfo_InitialInputs = 'InitialInputs';
  1303. {!
  1304. @define kAudioUnitConfigurationInfo_InitialOutputs
  1305. @discussion An array of numbers whose size is equal to the number of output buses posessed by
  1306. the AU. Each number in the array represents the number of channels for the
  1307. corresponding bus.
  1308. }
  1309. const
  1310. kAudioUnitConfigurationInfo_InitialOutputs = 'InitialOutputs';
  1311. //=====================================================================================================================
  1312. //#pragma mark - Output Unit
  1313. {!
  1314. @enum Output Unit Properties
  1315. @abstract The collection of properties for output units
  1316. @constant kAudioOutputUnitProperty_IsRunning
  1317. @discussion Scope:
  1318. Value Type:
  1319. Access:
  1320. }
  1321. const
  1322. // range (2000 -> 2999)
  1323. kAudioOutputUnitProperty_IsRunning = 2001;
  1324. //#pragma mark -
  1325. //#pragma mark Desktop Availability
  1326. //#if !TARGET_OS_IPHONE
  1327. {$ifc not TARGET_OS_IPHONE}
  1328. //=====================================================================================================================
  1329. //#pragma mark - Music Effects and Instruments
  1330. {!
  1331. @enum Music Effect and Instrument Unit (MusicDevice) Properties
  1332. @abstract The collection of Music Effects and Instrument Unit Property IDs
  1333. @discussion
  1334. These properties are used to:
  1335. Describe a current set of mappings between MIDI messages and Parameter value setting
  1336. Create a mapping between a parameter and a MIDI message through either:
  1337. - explicitly adding (or removing) the mapping
  1338. - telling the audio unit to hot-map the next MIDI message to a specified Parameter
  1339. The same MIDI Message can map to one or more parameters
  1340. These properties normally apply only to the two types of audio units that implement
  1341. the MIDI API, instrument units ('aumu') and music effects ('aumf').
  1342. These properties are used in the Global scope. The scope and element members of the structure describe
  1343. the scope and element of the parameter. In all usages, mScope, mElement and mParameterID must be
  1344. correctly specified.
  1345. * The AUParameterMIDIMapping Structure
  1346. Command mStatus mData1
  1347. Note Off 0x8n Note Num
  1348. Note On 0x9n Note Num
  1349. Key Pressure 0xAn Note Num
  1350. Control Change 0xBn ControllerID
  1351. Patch Change 0xCn Patch Num
  1352. Channel Pressure DxDn 0 (Unused)
  1353. Pitch Bend 0xEn 0 (Unused)
  1354. (where n is 0-0xF to correspond to MIDI channels 1-16)
  1355. Details:
  1356. In general MIDI Commands can be mapped to either a specific channel as specified in the mStatus bit.
  1357. If the kAUParameterMIDIMapping_AnyChannelFlag bit is set mStatus is a MIDI channel message, then the
  1358. MIDI channel number in the status byte is ignored; the mapping is from the specified MIDI message on ANY channel.
  1359. For note commands (note on, note off, key pressure), the MIDI message can trigger either with just a specific
  1360. note number, or any note number if the kAUParameterMIDIMapping_AnyNoteFlag bit is set. In these instances, the
  1361. note number is used as the trigger value (for instance, a note message could be used to set the
  1362. cut off frequency of a filter).
  1363. When the parameter mapping list changes through addition/replace, removal, the implementation should
  1364. fire a notification on the kAudioUnitProperty_AllParameterMIDIMappings property. The host can then
  1365. retrieve the full set of mappings for the audio unit.
  1366. When a hot mapping is made, the notification should just be delivered for the HotMap property. The host can
  1367. retrieve the last current hot mapping made through getting the value of that property.
  1368. @constant kAudioUnitProperty_AllParameterMIDIMappings
  1369. @discussion Scope: any
  1370. Value Type: array of AUParameterMIDIMapping
  1371. Access: read/write
  1372. This property allows setting and retrieving the current mapping state between
  1373. (some/many/all of) an audio unit's parameters and MIDI messages. When set, it should replace
  1374. any previous mapped settings the audio unit had.
  1375. If this property is implemented by a non-MIDI capable audio unit (such as an 'aufx' type),
  1376. then the property is read only and should recommend a suggested set of mappings for the host
  1377. to perform. In this case, it is the host's responsibility to map MIDI message to the audio
  1378. unit parameters.
  1379. This property's size varies depending on the number of mappings currently in effect. A host
  1380. application should always get the size of this property before retrieving it. The audio
  1381. unit should return an error if the host doesn't provide enough space to return all of the
  1382. current mappings.
  1383. @constant kAudioUnitProperty_AddParameterMIDIMapping
  1384. @discussion Scope: any
  1385. Value Type: array of AUParameterMIDIMapping
  1386. Access: write
  1387. Use this property to add parameter-to-MIDI mappings to an audio unit's existing set of
  1388. mappings. There can be only one mapping per parameter. When you set a mapping for a parameter,
  1389. it replaces the previous mapping.
  1390. @constant kAudioUnitProperty_RemoveParameterMIDIMapping
  1391. @discussion Scope: any
  1392. Value Type: array of AUParameterMIDIMapping
  1393. Access: write
  1394. Use this property to remove mappings from an audio unit. If a mapping is specified that
  1395. does not currently exist in an audio unit, then the audio unit should ignore the request.
  1396. The Scope/Element/ParameterID is used to find the mapping to remove.
  1397. @constant kAudioUnitProperty_HotMapParameterMIDIMapping
  1398. @discussion Scope: any
  1399. Value Type: AUParameterMIDIMapping
  1400. Access: read/write
  1401. This property can be used in two ways, determined by the value supplied by the host
  1402. application.
  1403. (1) If a mapping structure is provided, then that structure provides all the information
  1404. that the audio unit should use to map the parameter, except for the MIDI message. The audio
  1405. unit should then listen for the next MIDI message and associate that MIDI message with the
  1406. supplied parameter mapping. When this MIDI message is received and the mapping made, the
  1407. audio unit should also issue a notification on this property to indicate to the host that
  1408. the mapping has been made. The host can then retrieve the mapping that was made by getting the
  1409. value of this property.
  1410. To avoid possible confusion, it is recommended that once the host has retrieved this mapping
  1411. (if it is presenting a user interface to describe the mappings, for example), that the host
  1412. should then clear the mapping state, as described in (2).
  1413. The only time this property will return a valid value is when an audio unit has implemented the
  1414. requested mapping. If the audio unit's mapping state has been cleared (or if it has not been
  1415. asked to make a mapping), then the audio unit should return a kAudioUnitErr_InvalidPropertyValue
  1416. error when the host tries to read this property's value.
  1417. (2) If the value passed in this property is NULL, and if the audio unit had a parameter that
  1418. it was in the process of mapping, the audio unit should disregard the parameter mapping request
  1419. and discard the partially mapped structure. If the value is NULL and the audio unit is not in
  1420. the process of mapping, the audio unit can just ignore the request.
  1421. At all times, the _AllMappings property will completely describe the current known state of an
  1422. audio unit's mappings of MIDI messages to parameters.
  1423. }
  1424. const
  1425. kAudioUnitProperty_AllParameterMIDIMappings = 41;
  1426. kAudioUnitProperty_AddParameterMIDIMapping = 42;
  1427. kAudioUnitProperty_RemoveParameterMIDIMapping = 43;
  1428. kAudioUnitProperty_HotMapParameterMIDIMapping = 44;
  1429. {!
  1430. @enum ParameterMIDIMappings
  1431. @abstract General defined values to customize the behavior of parameter-to-MIDI mappings
  1432. @constant kAUParameterMIDIMapping_AnyChannelFlag
  1433. @discussion If this flag is set and the value of the mStatus field is a MIDI channel message, then
  1434. the MIDI channel number in the status byte is ignored; the mapping is from the specified
  1435. MIDI message on any channel.
  1436. @constant kAUParameterMIDIMapping_AnyNoteFlag
  1437. @discussion If this flag is set and the value of the mStatus field is a Note On, Note Off, or
  1438. Polyphonic Pressure message, the message's note number is ignored. The mapping is from
  1439. any note number.
  1440. @constant kAUParameterMIDIMapping_SubRange
  1441. @discussion Set this flag if the MIDI control should map only to a sub-range of the parameter's value.
  1442. Then specify that range in the mSubRangeMin and mSubRangeMax member fields.
  1443. @constant kAUParameterMIDIMapping_Toggle
  1444. @discussion Intended for Boolean typed parameters. When this property is set, it means that the
  1445. parameter's value should be toggled when the mapped MIDI message is received. For example,
  1446. if the parameter's value is currently TRUE, when the mapped MIDI message is received
  1447. the value changes to FALSE.
  1448. @constant kAUParameterMIDIMapping_Bipolar
  1449. @discussion This property is useful when mapping a parameter to a MIDI Controller. When set, it
  1450. indicates that the parameter can assume only two values: on or off. For this reason, a
  1451. parameter associated with this property is typically Boolean. For example, if this
  1452. property is set for a parameter mapped to a sustain pedal MIDI controller, controller
  1453. values from 0 to 64 result in the parameter switched to its "off" state; controller
  1454. values from 65 to 127 result in the parameter switched to its "on" state.
  1455. This property works in connection with the kAUParameterMIDIMapping_Bipolar_On property.
  1456. The value of the kAUParameterMIDIMapping_Bipolar_On property
  1457. @constant kAUParameterMIDIMapping_Bipolar_On
  1458. @discussion Determines whether the "on" state of a parameter is mapped to the "on" or "off" state
  1459. of the associated MIDI controller. Only valid if the kAUParameterMIDIMapping_Bipolar
  1460. property is set.
  1461. }
  1462. const
  1463. kAUParameterMIDIMapping_AnyChannelFlag = 1 shl 0;
  1464. kAUParameterMIDIMapping_AnyNoteFlag = 1 shl 1;
  1465. kAUParameterMIDIMapping_SubRange = 1 shl 2;
  1466. kAUParameterMIDIMapping_Toggle = 1 shl 3;
  1467. kAUParameterMIDIMapping_Bipolar = 1 shl 4;
  1468. kAUParameterMIDIMapping_Bipolar_On = 1 shl 5;
  1469. {!
  1470. @struct AUParameterMIDIMapping
  1471. @abstract Represents a mapping between a MIDI message and an audio unit's parameter.
  1472. @discussion The reserved fields in this structure are for future use. In the current implementation,
  1473. they help align the structure to 64 bit size. Do not use the names of these fields in a
  1474. host application. They are subject to change.
  1475. }
  1476. type
  1477. AUParameterMIDIMapping = record
  1478. mScope: AudioUnitScope;
  1479. mElement: AudioUnitElement;
  1480. mParameterID: AudioUnitParameterID;
  1481. mFlags: UInt32;
  1482. mSubRangeMin: AudioUnitParameterValue;
  1483. mSubRangeMax: AudioUnitParameterValue;
  1484. mStatus: UInt8;
  1485. mData1: UInt8;
  1486. reserved1: UInt8; // MUST be set to zero
  1487. reserved2: UInt8; // MUST be set to zero
  1488. reserved3: UInt32; // MUST be set to zero
  1489. end;
  1490. AUParameterMIDIMappingPtr = ^AUParameterMIDIMapping;
  1491. //=====================================================================================================================
  1492. //#pragma mark - Music Device
  1493. {!
  1494. @enum Instrument Unit (MusicDevice) Properties
  1495. @abstract The collection of Instrument Unit Property IDs
  1496. @constant kMusicDeviceProperty_InstrumentCount
  1497. @discussion Scope: Global
  1498. Value Type: UInt32
  1499. Access: read
  1500. For a mono-timbral music instrument, this property should return 0 (it should be implemented).
  1501. For a multi-timbral music instrument, this property can return the number of independent patches that
  1502. are available to be chosen as an active patch for the instrument. For instance, for Apple's DLS Music Device
  1503. this value returns the number of patches that are found in a given DLS or SoundFont file when loaded.
  1504. @constant kMusicDeviceProperty_MIDIXMLNames
  1505. @discussion Scope:
  1506. Value Type:
  1507. Access:
  1508. @constant kMusicDeviceProperty_PartGroup
  1509. @discussion Scope: Part
  1510. Value Type: AudioUnitElement
  1511. Access: read/write
  1512. This property's value specifies the group ID (the Group scope's element)
  1513. that the part is (or should be) assigned to. The property is used in the Part scope,
  1514. where the element ID is the part that is being queried (or assigned).
  1515. This property may be implemented in an audio unit as read only, as writeable only if the
  1516. audio unit is uninitialized, or as read/write. Apple recommends that it should be
  1517. writable at any time.
  1518. The effect of assigning a new group to a part is undefined. Typically, however, it can be
  1519. expected that all existing notes would be turned off before the re-assignment is made by
  1520. the audio unit.
  1521. @constant kMusicDeviceProperty_DualSchedulingMode
  1522. @discussion Scope: Global
  1523. Value Type: UInt32
  1524. Access: write
  1525. Some instrument units need to distinguish realtime note and control events (such as from
  1526. incoming MIDI) from sequenced or pre-scheduled events. To support this, a host application
  1527. may set this property to 1. If the instrument unit returns a value of noErr, it supports
  1528. an alternate interpretation of the inOffsetSampleFrame parameter for the following
  1529. functions:
  1530. MusicDeviceMIDIEvent
  1531. MusicDeviceStartNote
  1532. MusicDeviceStopNote
  1533. AudioUnitSetParameter
  1534. Once the host sets this property to 1 and the instrument unit returns noErr, the
  1535. inOffsetSampleFrame field becomes a bitfield:
  1536. kMusicDeviceSampleFrameMask_SampleOffset = 0xFFFFFF // AND with this to obtain sample offset
  1537. kMusicDeviceSampleFrameMask_IsScheduled = 0x01000000
  1538. The IsScheduled bit should be set on events which are being scheduled ahead of time from
  1539. a prerecorded track. The IsScheduled bit should be clear on events which are being sent
  1540. to the instrument unit in response to realtime events, such as incoming MIDI or control
  1541. changes in a view.
  1542. @constant kMusicDeviceProperty_SupportsStartStopNote
  1543. @discussion Scope: Global
  1544. Value Type: UInt32
  1545. Access: read
  1546. The MusicDeviceStartNote and MusicDeviceStopNote APIs have been available since Mac OS X v10.0.
  1547. However, many third-party audio units do not implement these calls. This property can
  1548. be used to determine if an audio unit does provide a compliant implementation. A compliant
  1549. audio unit will both implement the property and return !0 as the value for the property.
  1550. Apple's DLSMusicDevice unit has implemented MusicDeviceStartNote and MusicDeviceStopNote
  1551. since Mac OS X v10.0. The kMusicDeviceProperty_SupportsStartStopNote property was introduced
  1552. with Mac OS X v10.5, so the DLSMusicDevice unit will not return an appropriate value for
  1553. this property on a pre-10.5 system.
  1554. }
  1555. const
  1556. // range (1000 -> 1999)
  1557. kMusicDeviceProperty_InstrumentCount = 1000;
  1558. kMusicDeviceProperty_MIDIXMLNames = 1006;
  1559. kMusicDeviceProperty_PartGroup = 1010;
  1560. kMusicDeviceProperty_DualSchedulingMode = 1013;
  1561. kMusicDeviceProperty_SupportsStartStopNote = 1014;
  1562. {!
  1563. @enum DualSchedulingMode
  1564. }
  1565. const
  1566. kMusicDeviceSampleFrameMask_SampleOffset = $FFFFFF; // AND with this to obtain the sample offset
  1567. kMusicDeviceSampleFrameMask_IsScheduled = $01000000;
  1568. //=====================================================================================================================
  1569. //#pragma mark - Offline Unit
  1570. {!
  1571. @enum Offline Unit Properties
  1572. @abstract The collection of properties for offline units
  1573. @constant kAudioUnitOfflineProperty_InputSize
  1574. @discussion Scope: Global
  1575. Value Type: UInt64
  1576. Access: read/write
  1577. Once this property is set, an audio unit will assume that its input samples
  1578. have been reset to a new region. Setting this property will also cause the
  1579. audio unit's internal DSP state to be reset. That is, the audio unit calls
  1580. the AudioUnitReset function on itself.
  1581. This property tells the offline unit how many samples to process. Once it
  1582. knows this number it will then request from 0 to (nSamples-1) in its input
  1583. callback. The host of the audio unit is then required to provide the samples
  1584. specified in the sample count field of that Input's callback.
  1585. @constant kAudioUnitOfflineProperty_OutputSize
  1586. @discussion Scope: Global
  1587. Value Type: UInt64
  1588. Access: read
  1589. The host can use this property to estimate how many output samples an audio
  1590. unit will produce for the specified input samples. The property value
  1591. is invalid if InputSize is not set.
  1592. The host cannot assume that the value returned is exact.
  1593. It is a guide only, so is suitable for use in a progress bar, for instance.
  1594. Termination of processing is solely determined by the setting of the
  1595. kAudioUnitStatus_OfflineRenderComplete property in the
  1596. ioRenderActionFlags from the AudioUnitRender function.
  1597. @constant kAudioUnitOfflineProperty_StartOffset
  1598. @discussion Scope: Global
  1599. Value Type: UInt64
  1600. Access: read/write
  1601. The host sets this property to tell an audio unit that the start offset of
  1602. the data it is processing has been changed. This should be set along with
  1603. the InputSize property, so that the unit knows its input data has been set
  1604. or changed.
  1605. @constant kAudioUnitOfflineProperty_PreflightRequirements
  1606. @discussion Scope: Global
  1607. Value Type: UInt32
  1608. Access: read
  1609. Returns one of the kOfflinePreflight_ results (see the Offline Preflight
  1610. enumeration).
  1611. @constant kAudioUnitOfflineProperty_PreflightName
  1612. @discussion Scope: Global
  1613. Value Type: CFStringRef
  1614. Access: read
  1615. For an audio unit that allows or requires preflighting, this property lets
  1616. the unit give its host application a name to describe the preflight
  1617. operations.
  1618. }
  1619. const
  1620. // range (3020->3040)
  1621. kAudioUnitOfflineProperty_InputSize = 3020;
  1622. kAudioUnitOfflineProperty_OutputSize = 3021;
  1623. kAudioUnitOfflineProperty_StartOffset = 3022;
  1624. kAudioUnitOfflineProperty_PreflightRequirements = 3023;
  1625. kAudioUnitOfflineProperty_PreflightName = 3024;
  1626. {!
  1627. @enum Offline Preflight Flags
  1628. @abstract Used to indicate an Offline Unit's preflight requirements
  1629. @constant kOfflinePreflight_NotRequired
  1630. @discussion Offline unit does not require preflight
  1631. @constant kOfflinePreflight_Optional
  1632. @discussion Offline unit will generally behave better if it is preflighted, but it is not
  1633. required to be preflighted.
  1634. @constant kOfflinePreflight_Required
  1635. @discussion Offline unit requires preflighting or it cannot do its work
  1636. }
  1637. const
  1638. kOfflinePreflight_NotRequired = 0;
  1639. kOfflinePreflight_Optional = 1;
  1640. kOfflinePreflight_Required = 2;
  1641. //=====================================================================================================================
  1642. //#pragma mark - Panner Unit
  1643. {!
  1644. @enum Panner Unit Properties
  1645. @abstract The collection of properties for panner units
  1646. @constant kAudioUnitProperty_DistanceAttenuationData
  1647. @discussion Scope: Global
  1648. Value Type: AUDistanceAttenuationData
  1649. Access: Read
  1650. }
  1651. const
  1652. // range (3060->3999)
  1653. kAudioUnitProperty_DistanceAttenuationData = 3600;
  1654. {!
  1655. @struct AUDistanceAttenuationData
  1656. }
  1657. type
  1658. AUDistanceAttenuationDataPairsRec = record
  1659. inDistance: Float32; // 0-1000
  1660. outGain: Float32; // 0-1
  1661. end;
  1662. AUDistanceAttenuationDataPairsRecPtr = ^AUDistanceAttenuationDataPairsRec;
  1663. AUDistanceAttenuationData = record
  1664. inNumberOfPairs: UInt32;
  1665. pairs: array[0..0] of AUDistanceAttenuationDataPairsRec; // this is a variable length array of inNumberOfPairs elements
  1666. end;
  1667. AUDistanceAttenuationDataPtr = ^AUDistanceAttenuationData;
  1668. //=====================================================================================================================
  1669. //#pragma mark - Translation Service
  1670. {!
  1671. @enum Translation Properties
  1672. @abstract The collection of properties for migrating data from other audio plug-ins to the
  1673. Audio Unit architecture
  1674. @discussion While this is a general service, there are two formats that are explicitly defined:
  1675. MAS and VST. An audio unit may have MAS settings given to it in one of two ways:
  1676. (1) The settings may have a single setting. This may be set multiple times with
  1677. different settings each time. In this case, numberOfSettings will be 1.
  1678. (2) The settings may be set in one hit, providing all SettingData at once.
  1679. In this case, numberOfSettings may be more than 1, and will be the number of
  1680. settings the host has from the MAS plugin.
  1681. AU-VST - the CFDataRef data contains VST chunk data with no additional information.
  1682. In addition, this can be used to migrate settings from an older audio unit; this allows manufacturers
  1683. to deprecate older audio units and replace them with new ones. The data for the older audio unit is
  1684. the audio unit preset CFDictionary that that unit generated.
  1685. @constant kAudioUnitMigrateProperty_FromPlugin
  1686. @discussion Scope:
  1687. Value Type:
  1688. Access:
  1689. @constant kAudioUnitMigrateProperty_OldAutomation
  1690. @discussion Scope:
  1691. Value Type:
  1692. Access:
  1693. }
  1694. const
  1695. // range (4000->4020)
  1696. kAudioUnitMigrateProperty_FromPlugin = 4000;
  1697. kAudioUnitMigrateProperty_OldAutomation = 4001;
  1698. {!
  1699. @enum Other Plug-in Formats
  1700. }
  1701. const
  1702. kOtherPluginFormat_Undefined = 0; //reserving this value for future use
  1703. kOtherPluginFormat_kMAS = 1;
  1704. kOtherPluginFormat_kVST = 2;
  1705. kOtherPluginFormat_AU = 3;
  1706. {!
  1707. @struct AudioUnitOtherPluginDesc
  1708. @discussion
  1709. @field format
  1710. @discussion One of the OtherPluginFormat values
  1711. @field plugin
  1712. @discussion struct AudioClassDescription (
  1713. OSType mType;
  1714. OSType mSubType;
  1715. OSType mManufacturer;
  1716. );
  1717. is defined in <CoreAudio/CoreAudioTypes.h>
  1718. mType specifies a generic, plug-in format defined descriptor
  1719. mSubType is usually left to the manufacturer to use at their discretion
  1720. mManufacturer is a registered code to identify all plugins from the same manufacturer
  1721. }
  1722. type
  1723. AudioUnitOtherPluginDesc = record
  1724. format: UInt32;
  1725. plugin: AudioClassDescription;
  1726. end;
  1727. AudioUnitOtherPluginDescPtr = ^AudioUnitOtherPluginDesc;
  1728. {!
  1729. @struct AudioUnitParameterValueTranslation
  1730. @abstract Used to translate another plug-in's parameter values to audio unit parameter
  1731. values
  1732. }
  1733. type
  1734. AudioUnitParameterValueTranslation = record
  1735. otherDesc: AudioUnitOtherPluginDesc;
  1736. otherParamID: UInt32;
  1737. otherValue: Float32;
  1738. auParamID: AudioUnitParameterID;
  1739. auValue: AudioUnitParameterValue;
  1740. end;
  1741. AudioUnitParameterValueTranslationPtr = ^AudioUnitParameterValueTranslation;
  1742. {!
  1743. @struct AudioUnitPresetMAS_SettingData
  1744. @discussion AU-MAS specific structs for the data contained in the "masdata" key of an audio
  1745. unit preset dictionary
  1746. }
  1747. type
  1748. AudioUnitPresetMAS_SettingData = record
  1749. isStockSetting: UInt32; // zero or 1 i.e. "long bool"
  1750. settingID: UInt32;
  1751. dataLen: UInt32; //length of following data
  1752. data: array[0..0] of UInt8;
  1753. end;
  1754. AudioUnitPresetMAS_SettingDataPtr = ^AudioUnitPresetMAS_SettingData;
  1755. {!
  1756. @struct AudioUnitPresetMAS_Settings
  1757. @discussion See MAS documentation
  1758. }
  1759. type
  1760. AudioUnitPresetMAS_Settings = record
  1761. manufacturerID: UInt32;
  1762. effectID: UInt32;
  1763. variantID: UInt32;
  1764. settingsVersion: UInt32;
  1765. numberOfSettings: UInt32;
  1766. settings: array[0..0] of AudioUnitPresetMAS_SettingData;
  1767. end;
  1768. {$endc} { not TARGET_OS_IPHONE }
  1769. //=====================================================================================================================
  1770. //#pragma mark -
  1771. //#pragma mark Apple Specific Properties
  1772. //=====================================================================================================================
  1773. //#pragma mark - AUConverter
  1774. {!
  1775. @enum Apple AUConverter Property IDs
  1776. @abstract The collection of property IDs for Apple AUConverter
  1777. @constant kAudioUnitProperty_SampleRateConverterComplexity
  1778. @discussion Scope: Global
  1779. Value Type: UInt32
  1780. Access: read/write
  1781. }
  1782. const
  1783. kAudioUnitProperty_SampleRateConverterComplexity = 3014;
  1784. {!
  1785. @enum Audio Unit Sample Rate Converter Complexity
  1786. @discussion The lowest quality of the Mastering algorithm is higher than the highest quality of the Normal algorithm.
  1787. @constant kAudioUnitSampleRateConverterComplexity_Normal
  1788. @discussion Normal quality sample rate conversion.
  1789. @constant kAudioUnitSampleRateConverterComplexity_Mastering
  1790. @discussion Mastering quality sample rate conversion. More expensive.
  1791. }
  1792. const
  1793. kAudioUnitSampleRateConverterComplexity_Linear = FourCharCode('line'); // linear interpolation
  1794. kAudioUnitSampleRateConverterComplexity_Normal = FourCharCode('norm'); // the default
  1795. kAudioUnitSampleRateConverterComplexity_Mastering = FourCharCode('bats'); // higher quality, more expensive
  1796. //=====================================================================================================================
  1797. //#pragma mark - AUHAL and device units
  1798. {!
  1799. @enum Apple Output Property IDs
  1800. @abstract The collection of property IDs for Apple output units
  1801. @constant kAudioOutputUnitProperty_CurrentDevice
  1802. @discussion Scope: Global
  1803. Value Type: AudioDeviceID
  1804. Access: read/write
  1805. The audio device being used (or to be used) by and output device unit
  1806. @constant kAudioOutputUnitProperty_ChannelMap
  1807. @discussion Scope: Input/Output
  1808. Value Type: Array of UInt32
  1809. Access: read/write
  1810. This will also work with AUConverter. This property is used to map input channels from an input (source) to a destination.
  1811. The number of channels represented in the channel map is the number of channels of the destination. The channel map entries
  1812. contain a channel number of the source that should be mapped to that destination channel. If -1 is specified, than that
  1813. destination channel will not contain any channel from the source (so it will be silent)
  1814. @constant kAudioOutputUnitProperty_EnableIO
  1815. @discussion Scope: ( scope output, element 0 = output ) ( scope input, element 1 = input )
  1816. Value Type: UInt32
  1817. Access: read/write
  1818. Output units default to output-only operation. Host applications may disable
  1819. output or enable input operation using this property, if the output unit
  1820. supports it. 0=disabled, 1=enabled using I/O proc.
  1821. @constant kAudioOutputUnitProperty_StartTime
  1822. @discussion Scope: Global
  1823. Value Type: AudioOutputUnitStartAtTimeParams
  1824. Access: write only
  1825. When this property is set on an output unit, it will cause the next Start request
  1826. (but no subsequent Starts) to use AudioDeviceStartAtTime, using the specified
  1827. timestamp, passing false for inRequestedStartTimeIsInput.
  1828. @constant kAudioOutputUnitProperty_SetInputCallback
  1829. @discussion Scope: Global
  1830. Value Type: AURenderCallbackStruct
  1831. Access: read/write
  1832. When an output unit has been enabled for input operation, this callback can be
  1833. used to provide a single callback to the host application from the input
  1834. I/O proc, in order to notify the host that input is available and may be
  1835. obtained by calling the AudioUnitRender function.
  1836. Note that the inputProc will always receive a NULL AudioBufferList in ioData.
  1837. You must call AudioUnitRender in order to obtain the audio.
  1838. @constant kAudioOutputUnitProperty_HasIO
  1839. @discussion Scope: ( scope output, element 0 = output ) ( scope input, element 1 = input )
  1840. Value Type: UInt32
  1841. Access:
  1842. See kAudioOutputUnitProperty_EnableIO
  1843. Property value is 1 if input or output is enabled on the specified element.
  1844. @constant kAudioOutputUnitProperty_StartTimestampsAtZero
  1845. @discussion Scope: Global
  1846. Value Type: UInt32
  1847. Access: read/write
  1848. Apple output units typically begin their stream of timestamps presented to their
  1849. inputs at sample time 0. Some applications may wish to receive the HAL's timestamps
  1850. directly instead. When this property is set to false, the output unit's sample times
  1851. will be direct reflections of the HAL's -- except when a sample rate conversion
  1852. makes this impossible.
  1853. This property also applies to AUConverter. Its value defaults to 1 for AUHAL;
  1854. 1 for other AUs.
  1855. }
  1856. const
  1857. kAudioOutputUnitProperty_CurrentDevice = 2000;
  1858. kAudioOutputUnitProperty_ChannelMap = 2002; // this will also work with AUConverter
  1859. kAudioOutputUnitProperty_EnableIO = 2003;
  1860. kAudioOutputUnitProperty_StartTime = 2004;
  1861. kAudioOutputUnitProperty_SetInputCallback = 2005;
  1862. kAudioOutputUnitProperty_HasIO = 2006;
  1863. kAudioOutputUnitProperty_StartTimestampsAtZero = 2007; // this will also work with AUConverter
  1864. {!
  1865. @struct AudioOutputUnitStartAtTimeParams
  1866. }
  1867. type
  1868. AudioOutputUnitStartAtTimeParams = record
  1869. // see AudioDeviceStartAtTime
  1870. mTimestamp: AudioTimeStamp;
  1871. mFlags: UInt32;
  1872. end;
  1873. AudioOutputUnitStartAtTimeParamsPtr = ^AudioOutputUnitStartAtTimeParams;
  1874. //=====================================================================================================================
  1875. //#pragma mark - AUVoiceProcessing unit
  1876. {!
  1877. @enum Apple Voice Processing Property IDs
  1878. @abstract The collection of property IDs for Apple voice processing units.
  1879. @constant kAUVoiceIOProperty_BypassVoiceProcessing
  1880. @discussion Scope: Global
  1881. Value Type: UInt32
  1882. Access: read/write
  1883. Bypass all processing done by the voice processing unit. When set to 0
  1884. (default), the processing is activated otherwise it is disabled.
  1885. @constant kAUVoiceIOProperty_VoiceProcessingEnableAGC
  1886. @discussion Scope: Global
  1887. Value Type: UInt32
  1888. Access: read/write
  1889. Enable automatic gain control on the processed microphone/uplink
  1890. signal. On by default.
  1891. @constant kAUVoiceIOProperty_MuteOutput
  1892. @discussion Scope: Global
  1893. Value Type: UInt32
  1894. Access: read/write
  1895. Mutes the output of the voice processing unit.
  1896. 0 (default) = muting off. 1 = mute output.
  1897. }
  1898. const
  1899. kAUVoiceIOProperty_BypassVoiceProcessing = 2100;
  1900. kAUVoiceIOProperty_VoiceProcessingEnableAGC = 2101;
  1901. kAUVoiceIOProperty_MuteOutput = 2104;
  1902. //#pragma mark - AUVoiceProcessing unit deprecated properties
  1903. {!
  1904. @enum Apple Voice Processing Property IDs that are being deprecated
  1905. @abstract The collection of property IDs for Apple voice processing units that are
  1906. being deprecated.
  1907. @constant kAUVoiceIOProperty_VoiceProcessingQuality
  1908. @discussion Scope: Global
  1909. Value Type: UInt32
  1910. Access: read/write
  1911. DEPRECATED. Sets the quality of the voice processing unit. Quality values
  1912. are comprised between 0 (lowest) and 127 (highest).
  1913. }
  1914. const
  1915. kAUVoiceIOProperty_VoiceProcessingQuality = 2103; // deprecated
  1916. {!
  1917. @enum Apple Voice Processing AudioUnit Error IDs
  1918. @abstract These are the various error IDs returned by Voice Processing audio unit.
  1919. @constant kAUVoiceIOErr_UnexpectedNumberOfInputChannels
  1920. This error indicates that an unexpected number of input channels was encountered during initialization of voice processing audio unit
  1921. }
  1922. const
  1923. kAUVoiceIOErr_UnexpectedNumberOfInputChannels = -66784;
  1924. //=====================================================================================================================
  1925. //#pragma mark - Mixers
  1926. {!
  1927. @enum Apple Mixer Property IDs
  1928. @abstract The collection of property IDs for Apple mixers
  1929. @constant kAudioUnitProperty_MeteringMode
  1930. @discussion Scope: ( scope / element )
  1931. Value Type: UInt32
  1932. Access: read/write
  1933. Enable or disable metering on a particular scope/element
  1934. @constant kAudioUnitProperty_MatrixLevels
  1935. @discussion This property can be used for both the AUMatrixMixer and AUMultiChannelMixer.
  1936. AUMatrixMixer
  1937. Scope: Global
  1938. Value Type: Float32 array
  1939. Access: read/write
  1940. This property is used to retrieve the entire state of a matrix mixer. The size required is
  1941. the number of (input channels + 1) * (output channels + 1) - see _MatrixDimensions
  1942. So a matrix mixer that has 2 input channels and 2 output channels, will need a 3 x 3 array of Float32
  1943. Global volume is stored at volumes[2][2]
  1944. Input volumes are stored in the last column (volumes[0][2] for the first input channel, volumes[1][2] for the second)
  1945. Output volumes are stored in the last row (volumes [2][0] and [2][1])
  1946. Cross point volumes are stored at their expected locations ([0][1], etc)
  1947. AUMultiChannelMixer
  1948. Scope: Input
  1949. Value Type: Float32 array
  1950. Access: read/write
  1951. Gets/sets the matrix levels for one input element. This allows arbitrary mixing configurations
  1952. from all input channels to all output channels.
  1953. The size required is the number of (input channels) * (output channels).
  1954. The matrix stores only the crosspoint gains, there are no overall input or output channel gains.
  1955. @constant kAudioUnitProperty_MatrixDimensions
  1956. @discussion Scope: Global
  1957. Value Type: 2 x UInt32
  1958. Access: Read only
  1959. Returns the total number of channels for input and output of a given matrix mixer
  1960. @constant kAudioUnitProperty_MeterClipping
  1961. @discussion Scope: Global
  1962. Value Type: AudioUnitMeterClipping
  1963. Access: Read
  1964. A mixer returns an AudioUnitMeterClipping structure.
  1965. }
  1966. const
  1967. // General mixers
  1968. kAudioUnitProperty_MeteringMode = 3007;
  1969. // Matrix Mixer
  1970. kAudioUnitProperty_MatrixLevels = 3006;
  1971. kAudioUnitProperty_MatrixDimensions = 3009;
  1972. kAudioUnitProperty_MeterClipping = 3011;
  1973. {!
  1974. @struct AudioUnitMeterClipping
  1975. @field peakValueSinceLastCall;
  1976. @discussion The maximum value seen on the channel since the last time the property was retrieved.
  1977. @field sawInfinity;
  1978. @discussion TRUE if there was an infinite value on this channel.
  1979. @field sawNotANumber
  1980. @discussion TRUE if there was a floating point Not-A-Number value on this channel.
  1981. }
  1982. type
  1983. AudioUnitMeterClipping = record
  1984. peakValueSinceLastCall: Float32;
  1985. sawInfinity: Boolean;
  1986. sawNotANumber: Boolean;
  1987. end;
  1988. AudioUnitMeterClippingPtr = ^AudioUnitMeterClipping;
  1989. //=====================================================================================================================
  1990. //#pragma mark - _3DMixer
  1991. {!
  1992. @enum Apple Mixer Property IDs
  1993. @abstract The collection of property IDs for Apple mixers
  1994. @constant kAudioUnitProperty_MeteringMode
  1995. @discussion Scope: ( scope / element )
  1996. Value Type: UInt32
  1997. Access: read/write
  1998. Enable or disable metering on a particular scope/element
  1999. @constant kAudioUnitProperty_SpatializationAlgorithm
  2000. @discussion Scope: Input
  2001. Value Type: UInt32
  2002. Access: read/write
  2003. Used to set the spatialisation algorithm used by an input of the 3DMixer. See kSpatializationAlgorithm_
  2004. @constant kAudioUnitProperty_DopplerShift
  2005. @discussion Scope: Input
  2006. Value Type: UInt32
  2007. Access: Write
  2008. Use a boolean true/false value to enable doppler shift for any specified input
  2009. @constant kAudioUnitProperty_3DMixerRenderingFlags
  2010. @discussion Scope: Input
  2011. Value Type: UInt32
  2012. Access: read/write
  2013. Used to enable various rendering operations on a given input for the 3DMixer. See k3DMixerRenderingFlags_
  2014. @constant kAudioUnitProperty_3DMixerDistanceAtten
  2015. @discussion Scope:
  2016. Value Type:
  2017. Access:
  2018. @constant kAudioUnitProperty_3DMixerDistanceParams
  2019. @discussion Scope:
  2020. Value Type:
  2021. Access:
  2022. @constant kAudioUnitProperty_ReverbPreset
  2023. @discussion Scope:
  2024. Value Type:
  2025. Access:
  2026. @constant kAudioUnitProperty_3DMixerAttenuationCurve
  2027. @discussion Scope:
  2028. Value Type:
  2029. Access:
  2030. @constant kAudioUnitProperty_MatrixLevels
  2031. @discussion Scope:
  2032. Value Type:
  2033. Access:
  2034. @constant kAudioUnitProperty_MatrixDimensions
  2035. @discussion Scope:
  2036. Value Type:
  2037. Access:
  2038. @constant kAudioUnitProperty_MeterClipping
  2039. @discussion Scope:
  2040. Value Type: AudioUnitMeterClipping
  2041. Access:
  2042. A mixer returns an AudioUnitMeterClipping structure.
  2043. }
  2044. const
  2045. kAudioUnitProperty_3DMixerDistanceParams = 3010;
  2046. kAudioUnitProperty_3DMixerAttenuationCurve = 3013;
  2047. kAudioUnitProperty_SpatializationAlgorithm = 3000;
  2048. kAudioUnitProperty_DopplerShift = 3002;
  2049. kAudioUnitProperty_3DMixerRenderingFlags = 3003;
  2050. kAudioUnitProperty_3DMixerDistanceAtten = 3004;
  2051. kAudioUnitProperty_ReverbPreset = 3012;
  2052. {!
  2053. @enum 3D Mixer Attenuation Curves
  2054. }
  2055. const
  2056. k3DMixerAttenuationCurve_Power = 0;
  2057. k3DMixerAttenuationCurve_Exponential = 1;
  2058. k3DMixerAttenuationCurve_Inverse = 2;
  2059. k3DMixerAttenuationCurve_Linear = 3;
  2060. {!
  2061. @struct MixerDistanceParams
  2062. }
  2063. type
  2064. MixerDistanceParams = record
  2065. mReferenceDistance: Float32;
  2066. mMaxDistance: Float32;
  2067. mMaxAttenuation: Float32; // in decibels
  2068. end;
  2069. MixerDistanceParamsPtr = ^MixerDistanceParams;
  2070. {!
  2071. @enum Spatialization Algorithms
  2072. }
  2073. const
  2074. kSpatializationAlgorithm_EqualPowerPanning = 0;
  2075. kSpatializationAlgorithm_SphericalHead = 1;
  2076. kSpatializationAlgorithm_HRTF = 2;
  2077. kSpatializationAlgorithm_SoundField = 3;
  2078. kSpatializationAlgorithm_VectorBasedPanning = 4;
  2079. kSpatializationAlgorithm_StereoPassThrough = 5;
  2080. {!
  2081. @enum 3D Mixer Rendering Flags
  2082. }
  2083. const
  2084. k3DMixerRenderingFlags_InterAuralDelay = 1 shl 0;
  2085. k3DMixerRenderingFlags_DopplerShift = 1 shl 1;
  2086. k3DMixerRenderingFlags_DistanceAttenuation = 1 shl 2;
  2087. k3DMixerRenderingFlags_DistanceFilter = 1 shl 3;
  2088. k3DMixerRenderingFlags_DistanceDiffusion = 1 shl 4;
  2089. k3DMixerRenderingFlags_LinearDistanceAttenuation = 1 shl 5;
  2090. k3DMixerRenderingFlags_ConstantReverbBlend = 1 shl 6;
  2091. //=====================================================================================================================
  2092. //#pragma mark - AUScheduledSoundPlayer
  2093. {!
  2094. @enum Apple AUScheduledSoundPlayer Property IDs
  2095. @abstract The collection of property IDs for the Apple AUScheduledSoundPlayer audio unit.
  2096. @discussion The AUScheduledSoundPlayer audio unit lets a client schedule audio buffers for
  2097. future playback, with sample-accurate timing.
  2098. Elements and Formats
  2099. This unit has one output element and no input elements. The output's format
  2100. should be a canonical audio unit stream format (native Float32, deinterleaved).
  2101. Scheduling
  2102. To schedule slices of audio for future playback, set the
  2103. kAudioUnitProperty_ScheduleAudioSlice property, with a ScheduledAudioSlice
  2104. structure as the property value. The slice's mTimeStamp.mSampleTime field
  2105. determines when the slice will be played. This sample number is relative to
  2106. the unit's start time, which you must set using the
  2107. kAudioUnitProperty_ScheduleStartTimeStamp property before playback will
  2108. begin.
  2109. You must retain, unmodified, the ScheduledAudioSlice structure, including
  2110. its mBufferList and the buffers to which it points, until the slice has been
  2111. completely played, or until you stop playback by uninitializing or resetting
  2112. the unit. The format of the slice's buffer list must match the unit's output
  2113. stream format.
  2114. (The fields other than mSampleTime and mFlags in the mTimestamp structure are
  2115. currently ignored.)
  2116. Completion
  2117. To receive a callback when the slice has been played, store a pointer to a
  2118. callback function in the mCompletionProc field. This function will be called
  2119. (from the audio unit's rendering thread) when the slice has been completely
  2120. played -- or when the slice is determined to be unplayable due to an error.
  2121. As an alternative, you may also poll the slice's
  2122. (mFlags & kScheduledAudioSliceFlag_Complete).
  2123. Upon completion, you can test (mFlags & kScheduledAudioSliceFlag_BeganToRenderLate)
  2124. to determine whether some portion of the slice was not played due to its having
  2125. been scheduled too late relative to the current playback time.
  2126. Start Time
  2127. The audio unit will not play any slices following initialization or reset, until
  2128. its start time has been set. The start time establishes the beginning of a
  2129. timeline: the timestamps of all slices in the schedule are relative to the
  2130. start time.
  2131. Set a start time by setting the kAudioUnitProperty_ScheduleStartTimeStamp
  2132. property with an AudioTimeStamp structure. If the timestamp contains a valid
  2133. sample time (timestamp.mFlags & kAudioTimeStampSampleTimeValid), then playback
  2134. begins when the timestamp passed to the AudioUnitRender function reaches the
  2135. specified sample time. If the specified sample time is -1, playback begins on
  2136. the next render cycle.
  2137. If the start timestamp does not contain a valid sample time, but does contain a
  2138. valid host time (timestamp.mFlags & kAudioTimeStampHostTimeValid), then the
  2139. specified host time is translated to the sample time at which playback will
  2140. begin. A host time of 0 means "start on the next render cycle."
  2141. The kAudioUnitProperty_ScheduleStartTimeStamp property may be queried to obtain
  2142. the time at which playback began. If the start time has not yet been reached,
  2143. the timestamp returned will be whatever the host application last set.
  2144. Current play time
  2145. The kAudioUnitProperty_CurrentPlayTime property may be queried to determine the
  2146. audio unit's current time offset from its start time. This is useful, for
  2147. example, to monitor playback progress.
  2148. Unscheduling events
  2149. To clear an audio unit's play schedule, call the AudioUnitReset function. The
  2150. completion proc (if any) for each slice in the schedule will called. Playback
  2151. will not resume until a new start time has been set. This also happens when
  2152. the audio unit is uninitialized.
  2153. @constant kAudioUnitProperty_ScheduleAudioSlice
  2154. @discussion Scope:
  2155. Value Type: ScheduledAudioSlice
  2156. Access:
  2157. @constant kAudioUnitProperty_ScheduleStartTimeStamp
  2158. @discussion Scope:
  2159. Value Type: AudioTimeStamp
  2160. Access:
  2161. Sample time or host time valid. Sample time takes precedence,
  2162. -1 means "now". Host time of 0 means "now."
  2163. @constant kAudioUnitProperty_CurrentPlayTime
  2164. @discussion Scope:
  2165. Value Type: AudioTimeStamp
  2166. Access:
  2167. AudioTimeStamp, relative to start time, sample time of -1 if not yet started.
  2168. }
  2169. const
  2170. kAudioUnitProperty_ScheduleAudioSlice = 3300;
  2171. kAudioUnitProperty_ScheduleStartTimeStamp = 3301;
  2172. kAudioUnitProperty_CurrentPlayTime = 3302;
  2173. {!
  2174. @enum ScheduledAudioSlice
  2175. @abstract bits in ScheduledAudioSlice.mFlags
  2176. @constant kScheduledAudioSliceFlag_Complete
  2177. Set if the unit is done with this slice
  2178. @constant kScheduledAudioSliceFlag_BeganToRender
  2179. Set if any portion of the buffer has been played
  2180. @constant kScheduledAudioSliceFlag_BeganToRenderLate
  2181. Set if any portion of the buffer was not played because it was scheduled late
  2182. }
  2183. const
  2184. kScheduledAudioSliceFlag_Complete = 1;
  2185. kScheduledAudioSliceFlag_BeganToRender = 2;
  2186. kScheduledAudioSliceFlag_BeganToRenderLate = 4;
  2187. type
  2188. // forward dec, see definition below
  2189. ScheduledAudioSlicePtr = ^ScheduledAudioSlice;
  2190. {!
  2191. @typedef ScheduledAudioSliceCompletionProc
  2192. }
  2193. ScheduledAudioSliceCompletionProc = procedure(userData : UnivPtr; bufferList : ScheduledAudioSlicePtr);
  2194. {
  2195. @struct ScheduledAudioSlice
  2196. @field mTimeStamp;
  2197. @field mCompletionProc;
  2198. May be null
  2199. @field mCompletionProcUserData;
  2200. @field mFlags;
  2201. @field mReserved;
  2202. Must be 0
  2203. @field mReserved2;
  2204. For internal use
  2205. @field mNumberFrames;
  2206. Must be consistent with byte count of mBufferList
  2207. @field mBufferList;
  2208. Must contain deinterleaved Float32
  2209. }
  2210. ScheduledAudioSlice = record
  2211. mTimeStamp: AudioTimeStamp;
  2212. mCompletionProc: ScheduledAudioSliceCompletionProc; // may be null
  2213. mCompletionProcUserData: UnivPtr;
  2214. mFlags: UInt32;
  2215. mReserved: UInt32; // must be 0
  2216. mReserved2: UnivPtr; // for internal use
  2217. mNumberFrames: UInt32; // must be consistent with byte count of mBufferList
  2218. mBufferList: AudioBufferListPtr; // must contain deinterleaved Float32
  2219. end;
  2220. //=====================================================================================================================
  2221. //#pragma mark - AUAudioFilePlayer
  2222. {!
  2223. @enum Apple AUAudioFilePlayer Property IDs
  2224. @abstract The collection of property IDs for Apple AUAudioFilePlayer
  2225. @discussion This audio unit lets you schedule regions of audio files for future playback,
  2226. with sample-accurate timing.
  2227. The unit is a subclass of AUScheduledSoundPlayer and inherits all of its
  2228. behavior. In particular, this unit implements the kAudioUnitProperty_ScheduleStartTimeStamp
  2229. and kAudioUnitProperty_CurrentPlayTime properties. Instead of scheduling
  2230. slices (buffers) of audio to be played (via kAudioUnitProperty_ScheduleAudioSlice),
  2231. however, you schedule regions of audio files to be played. The unit reads and
  2232. converts audio file data into its own internal buffers. It performs disk I/O
  2233. on a high-priority thread shared among all instances of this unit within a
  2234. process. Upon completion of a disk read, the unit internally schedules
  2235. buffers for playback.
  2236. Elements and Formats
  2237. This unit has one output element and no input elements. The output's format
  2238. should be a canonical audio unit stream format (native Float32,
  2239. deinterleaved). This format should have at least as many channels are in the
  2240. audio file(s) to be played (otherwise channels will be dropped). During
  2241. playback, all audio file data is converted to the unit's output format.
  2242. Audio Files
  2243. Before starting playback, you must first open all audio files to be played
  2244. using the AudioFile API's (see AudioToolbox/AudioFile.h), and pass their
  2245. AudioFileIDs to the unit by setting the kAudioUnitProperty_ScheduledFileIDs
  2246. property. This property must not be set during playback. The audio files must
  2247. be kept open for the duration of playback.
  2248. Scheduling Regions
  2249. To schedule the playback of a region of an audio file, set the
  2250. kAudioUnitProperty_ScheduledFileRegion property. This is a
  2251. ScheduledAudioFileRegion structure. mTimeStamp.mSampleTime must be valid and
  2252. is interpreted relative to the unit's start time -- the start time semantics
  2253. (using kAudioUnitProperty_ScheduleStartTimeStamp) are identical to those of
  2254. AUScheduledSoundPlayer. Unlike the ScheduledAudioSlice structures, the unit
  2255. makes copies of ScheduledAudioFileRegions, so you may create them on the
  2256. stack or otherwise reuse/dispose of them immediately after scheduling them.
  2257. Priming
  2258. You should set kAudioUnitProperty_ScheduledFilePrime after scheduling
  2259. initial file regions to be played and before starting playback. This SetProperty call
  2260. will begin reading the audio files and not return until the number of frames
  2261. specified by the property value have been read.
  2262. Completion Callbacks
  2263. A region's completion callback (mCompletionProc) is called when it has been
  2264. completely scheduled for reading from disk. This callback is issued on the disk
  2265. read thread. If the region is not read from disk in time to play at its
  2266. scheduled time, mCompletionProc is called a second time with an error code,
  2267. also from the read thread. Note that the region passed to the callback will not
  2268. be the same memory object as was passed by the client (since the unit copies the region).
  2269. Start Time and Current Time
  2270. These properties work identically as in AUScheduledSoundPlayer.
  2271. Unscheduling regions
  2272. To clear the unit's play schedule, call the AudioUnitReset function. The completion proc
  2273. (if any) for each file region in the schedule will be called. Playback will
  2274. not resume until a new start time has been set. This also happens when the
  2275. unit is uninitialized.
  2276. Customization
  2277. The size and number of the player's disk read buffers default to "sensible"
  2278. values, but may be configured with the properties:
  2279. kAudioUnitProperty_ScheduledFileBufferSizeFrames
  2280. kAudioUnitProperty_ScheduledFileNumberBuffers
  2281. Bugs
  2282. kAudioUnitProperty_ScheduledFileBufferSizeFrames
  2283. kAudioUnitProperty_ScheduledFileNumberBuffers
  2284. are currently unimplemented
  2285. An option to make the unit not perform conversion from the audio file sample
  2286. rate to the unit's output rate may be desirable.
  2287. @constant kAudioUnitProperty_ScheduledFileIDs
  2288. @discussion Scope:
  2289. Value Type: Array of AudioFileIDs
  2290. Access:
  2291. Must set this property on scheduled file player for all files to be played
  2292. @constant kAudioUnitProperty_ScheduledFileRegion
  2293. @discussion Scope:
  2294. Value Type: ScheduledAudioFileRegion
  2295. Access:
  2296. @constant kAudioUnitProperty_ScheduledFilePrime
  2297. @discussion Scope:
  2298. Value Type: UInt32
  2299. Access:
  2300. The number of frames to read from disk before returning, or 0 to specify use
  2301. of a default value
  2302. @constant kAudioUnitProperty_ScheduledFileBufferSizeFrames
  2303. @discussion Scope:
  2304. Value Type: UInt32
  2305. Access:
  2306. @constant kAudioUnitProperty_ScheduledFileNumberBuffers
  2307. @discussion Scope:
  2308. Value Type: UInt32
  2309. Access:
  2310. }
  2311. const
  2312. kAudioUnitProperty_ScheduledFileIDs = 3310;
  2313. kAudioUnitProperty_ScheduledFileRegion = 3311;
  2314. kAudioUnitProperty_ScheduledFilePrime = 3312;
  2315. kAudioUnitProperty_ScheduledFileBufferSizeFrames = 3313;
  2316. kAudioUnitProperty_ScheduledFileNumberBuffers = 3314;
  2317. type
  2318. ScheduledAudioFileRegionPtr = ^ScheduledAudioFileRegion; //forward declaraion, see definition below
  2319. {!
  2320. @typedef ScheduledAudioFileRegionCompletionProc
  2321. }
  2322. ScheduledAudioFileRegionCompletionProc = procedure(userData : UnivPtr; fileRegion : ScheduledAudioFileRegionPtr; aResult : OSStatus);
  2323. {!
  2324. @struct ScheduledAudioFileRegion
  2325. @field mTimeStamp
  2326. @field mCompletionProc
  2327. may be NULL
  2328. @field mCompletionProcUserData
  2329. @field mAudioFile
  2330. must be a valid and open AudioFileID
  2331. defined in AudioToolbox/AudioFile.h: typedef struct OpaqueAudioFileID *AudioFileID;
  2332. @field mLoopCount
  2333. 0 = don't loop
  2334. @field mStartFrame
  2335. offset into file
  2336. @field mFramesToPlay
  2337. number of frames to play
  2338. }
  2339. ScheduledAudioFileRegion = record
  2340. mTimeStamp: AudioTimeStamp;
  2341. mCompletionProc: ScheduledAudioFileRegionCompletionProc;
  2342. mCompletionProcUserData: UnivPtr;
  2343. mAudioFile: Pointer; { struct OpaqueAudioFileID * }
  2344. mLoopCount: UInt32;
  2345. mStartFrame: SInt64;
  2346. mFramesToPlay: UInt32;
  2347. end;
  2348. //=====================================================================================================================
  2349. //#pragma mark -
  2350. //#pragma mark Desktop Apple Specific Properties
  2351. {$ifc not TARGET_OS_IPHONE}
  2352. //=====================================================================================================================
  2353. //#pragma mark - DLSMusicDevice and Internal Reverb
  2354. {!
  2355. @enum Generic Property IDs
  2356. @abstract The collection of general audio unit property IDs
  2357. @constant kAudioUnitProperty_ReverbRoomType
  2358. @discussion Scope:
  2359. Value Type:
  2360. Access:
  2361. @constant kAudioUnitProperty_UsesInternalReverb
  2362. @discussion Scope:
  2363. Value Type:
  2364. Access:
  2365. @constant kMusicDeviceProperty_InstrumentName
  2366. @discussion Scope:
  2367. Value Type:
  2368. Access:
  2369. @constant kMusicDeviceProperty_InstrumentNumber
  2370. @discussion Scope:
  2371. Value Type:
  2372. Access:
  2373. @constant kMusicDeviceProperty_BankName
  2374. @discussion Scope:
  2375. Value Type:
  2376. Access:
  2377. @constant kMusicDeviceProperty_SoundBankData
  2378. @discussion Scope:
  2379. Value Type:
  2380. Access:
  2381. @constant kMusicDeviceProperty_StreamFromDisk
  2382. @discussion Scope:
  2383. Value Type:
  2384. Access:
  2385. @constant kMusicDeviceProperty_SoundBankFSRef
  2386. @discussion Scope:
  2387. Value Type:
  2388. Access:
  2389. @constant kMusicDeviceProperty_SoundBankURL
  2390. @discussion Scope:
  2391. Value Type:
  2392. Access:
  2393. }
  2394. const
  2395. kAudioUnitProperty_ReverbRoomType = 10;
  2396. // 3DMixer, DLSMusicDevice
  2397. kAudioUnitProperty_UsesInternalReverb = 1005;
  2398. // DLS Music Device
  2399. kMusicDeviceProperty_InstrumentName = 1001;
  2400. kMusicDeviceProperty_InstrumentNumber = 1004;
  2401. kMusicDeviceProperty_UsesInternalReverb = kAudioUnitProperty_UsesInternalReverb;
  2402. kMusicDeviceProperty_BankName = 1007;
  2403. kMusicDeviceProperty_SoundBankData = 1008;
  2404. kMusicDeviceProperty_StreamFromDisk = 1011;
  2405. kMusicDeviceProperty_SoundBankFSRef = 1012;
  2406. kMusicDeviceProperty_SoundBankURL = 1100;
  2407. {!
  2408. @enum Reverb Room Types
  2409. @discussion Used to specify room type (as identified by a factory preset number) on Apple audio
  2410. units that use internal reverb.
  2411. }
  2412. const
  2413. kReverbRoomType_SmallRoom = 0;
  2414. kReverbRoomType_MediumRoom = 1;
  2415. kReverbRoomType_LargeRoom = 2;
  2416. kReverbRoomType_MediumHall = 3;
  2417. kReverbRoomType_LargeHall = 4;
  2418. kReverbRoomType_Plate = 5;
  2419. kReverbRoomType_MediumChamber = 6;
  2420. kReverbRoomType_LargeChamber = 7;
  2421. kReverbRoomType_Cathedral = 8;
  2422. kReverbRoomType_LargeRoom2 = 9;
  2423. kReverbRoomType_MediumHall2 = 10;
  2424. kReverbRoomType_MediumHall3 = 11;
  2425. kReverbRoomType_LargeHall2 = 12;
  2426. //=====================================================================================================================
  2427. //#pragma mark - AUSampler
  2428. {!
  2429. @enum Apple AUSampler Property IDs
  2430. @abstract The collection of property IDs for the Apple AUSampler audio unit.
  2431. @discussion The AUSampler audio unit lets a client create an editable, interactive
  2432. sampler synthesizer instrument.
  2433. @constant kAUSamplerProperty_LoadInstrument
  2434. @discussion Scope: Global
  2435. Value Type: AUSamplerInstrumentData
  2436. Access: Write
  2437. Load an instrument from an external DLS or Soundfont2 bank file, or from other file formats.
  2438. @constant kAUSamplerProperty_LoadAudioFiles
  2439. @discussion Scope: Global
  2440. Value Type: CFArrayRef
  2441. Access: Write
  2442. Create a new preset from a list of audio file paths. The CFArray should contain a set
  2443. of CFURLRefs, one per file. The previous preset will be completely cleared.
  2444. }
  2445. const
  2446. // range (4100->4999)
  2447. kAUSamplerProperty_LoadInstrument = 4102;
  2448. kAUSamplerProperty_LoadAudioFiles = 4101;
  2449. {
  2450. @struct AUSamplerInstrumentData
  2451. @abstract Used for loading an instrument from either an external bank file (i.e. DLS or SoundFont), an Apple
  2452. .aupreset, a Logic or GarageBand EXS24 sampler instrument, or creating a new default instrument from
  2453. a single audio file. The path to the bank or instrument file is specified in the fileURL field.
  2454. The instrumentType field distinguishes between the instrument types. The remaining fields of this
  2455. struct are used only for the kInstrumentType_DLSPreset and kInstrumentType_SF2Preset types to
  2456. identify the particular bank and preset IDs for the instrument you wish to load from the bank.
  2457. They represent values for MIDI controllers 0 and 32 and the MIDI present change message that would be
  2458. sent to a GM2-compatible synth for program changes. Use the provided constants
  2459. (kAUSampler_DefaultMelodicBankMSB, kAUSampler_DefaultPercussionBankMSB) to designate melodic or
  2460. percussion banks per the GM2 specification (GM-compatible DLS or Soundfont banks). For custom
  2461. non-GM-compatible DLS and Soundfont banks, use the actual MSB/LSB values associated with the desired preset.
  2462. @field fileURL
  2463. The URL of the path to the bank or instrument file. Caller is responsible for releasing the
  2464. provided CFURLRef.
  2465. @field instrumentType
  2466. The type of instrument being loaded or created. For example, use kInstrumentType_DLSPreset to load an
  2467. instrument from a DLS bank file.
  2468. @field bankMSB
  2469. For the preset instruments, the most significant byte value for a particular bank variation within that
  2470. file. Range is 0 to 127. Use kAUSampler_DefaultMelodicBankMSB by default.
  2471. @field bankLSB
  2472. For the preset instruments, the least significant byte value for a particular bank variation within that
  2473. file. Range is 0 to 127. Use kAUSampler_DefaultBankLSB by default.
  2474. @field presetID
  2475. For the preset instruments, the numeric ID of a particular preset within that bank to load.
  2476. Range is 0 to 127.
  2477. }
  2478. type
  2479. AUSamplerInstrumentData = record
  2480. fileURL: CFURLRef;
  2481. instrumentType: UInt8;
  2482. bankMSB: UInt8;
  2483. bankLSB: UInt8;
  2484. presetID: UInt8;
  2485. end;
  2486. AUSamplerInstrumentDataPtr = ^AUSamplerInstrumentData;
  2487. {
  2488. @enum InstrumentTypes
  2489. @abstract Values to specify the type of instrument being loaded.
  2490. @constant kInstrumentType_DLSPreset
  2491. @discussion A preset from a DLS bank file. Bank MSB, LSB and preset ID must be specified.
  2492. @constant kInstrumentType_SF2Preset
  2493. @discussion A preset from a SoundFont2 bank file. Bank MSB, LSB and preset ID must be specified.
  2494. @constant kInstrumentType_AUPreset
  2495. @discussion A native Apple .aupreset file created using the AUSampler's custom view.
  2496. @constant kInstrumentType_Audiofile
  2497. @discussion An audio file which will be used to create a default instrument with that file as its sole sample.
  2498. @constant kInstrumentType_EXS24
  2499. @discussion A Logic or GarageBand sampler instrument.
  2500. }
  2501. const
  2502. kInstrumentType_DLSPreset = 1;
  2503. kInstrumentType_SF2Preset = kInstrumentType_DLSPreset;
  2504. kInstrumentType_AUPreset = 2;
  2505. kInstrumentType_Audiofile = 3;
  2506. kInstrumentType_EXS24 = 4;
  2507. const
  2508. kAUSampler_DefaultPercussionBankMSB = $78;
  2509. kAUSampler_DefaultMelodicBankMSB = $79;
  2510. kAUSampler_DefaultBankLSB = $00;
  2511. //=====================================================================================================================
  2512. //#pragma mark - AUDeferredRenderer
  2513. {!
  2514. @enum AUDeferredRenderer
  2515. @discussion This audio unit has one input element and one output element. They must both have
  2516. the same format, which must be canonical (Float32 deinterleaved) and must have
  2517. the same number of channels.
  2518. The AUDeferredRenderer unit creates a high-priority producer thread, on which
  2519. calls by this AU for input are performed at a constant buffer size. This buffer size may be
  2520. set with the kAudioUnitProperty_DeferredRendererPullSize property. The deferred
  2521. renderer may be asked to render at different buffer sizes by a downstream unit or
  2522. host application, but it always pulls upstream at its constant buffer size.
  2523. The upstream pull size MUST be greater than or equal to the downstream pull
  2524. size.
  2525. The upstream producer thread runs in advance of calls to its Render
  2526. function, with respect to the timestamps being passed to Render and
  2527. PullInput. The difference between these timestamps is the unit's "latency",
  2528. which is always at least one upstream pull buffer. The client may specify
  2529. additional latency with the property
  2530. kAudioUnitProperty_DeferredRendererExtraLatency, which is a number of sample
  2531. frames.
  2532. It is possible, at Render time, for the producer thread to have not yet
  2533. finished rendering the necessary data. This generates an error. In order to
  2534. give the producer a small amount of extra time to finish rendering, the
  2535. client may set the unit's property
  2536. kAudioUnitProperty_DeferredRendererWaitFrames. If this property is non-zero,
  2537. then when Render finds that insufficient data has been produced, it will
  2538. sleep for the amount of realtime corresponding to the number of wait frames.
  2539. It will then check again to see if the required amount of data has been
  2540. produced, and fail if it hasn't.
  2541. @constant kAudioUnitProperty_DeferredRendererPullSize
  2542. @discussion Scope:
  2543. Value Type: UInt32
  2544. Access:
  2545. @constant kAudioUnitProperty_DeferredRendererExtraLatency
  2546. @discussion Scope:
  2547. Value Type: UInt32
  2548. Access:
  2549. @constant kAudioUnitProperty_DeferredRendererWaitFrames
  2550. @discussion Scope:
  2551. Value Type: UInt32
  2552. Access:
  2553. }
  2554. const
  2555. kAudioUnitProperty_DeferredRendererPullSize = 3320;
  2556. kAudioUnitProperty_DeferredRendererExtraLatency = 3321;
  2557. kAudioUnitProperty_DeferredRendererWaitFrames = 3322;
  2558. //=====================================================================================================================
  2559. //#pragma mark - AUNetReceive
  2560. {!
  2561. @enum AUNetReceive
  2562. @constant kAUNetReceiveProperty_Hostname
  2563. @discussion Scope: Global
  2564. Value Type: CFStringRef
  2565. Access:
  2566. The hostname from which you wish to receive audio.
  2567. For GetProperty, the returned CFStringRef is a copy and therefore must be released by the caller.
  2568. The UI view for AUNetReceive does the resolution of Bonjour service names to hostnames.
  2569. Clients who are using this AU programmatically using Bonjour will have to do this resolution themselves.
  2570. It is not done by the AU.
  2571. @constant kAUNetReceiveProperty_Password
  2572. @discussion Scope: Global
  2573. Value Type: CFStringRef
  2574. Access: Read / Write
  2575. The password to send to the sender. Leave unset or set to the empty string for no password.
  2576. For GetProperty, the returned CFStringRef is a copy and therefore must be released by the caller.
  2577. }
  2578. const
  2579. kAUNetReceiveProperty_Hostname = 3511;
  2580. kAUNetReceiveProperty_Password = 3512;
  2581. //=====================================================================================================================
  2582. //#pragma mark - AUNetSend
  2583. {!
  2584. @enum AUNetSend
  2585. @constant kAUNetSendProperty_PortNum
  2586. @discussion Scope: Global
  2587. Value Type: UInt32
  2588. Access: Read / Write
  2589. The network port number on which to send.
  2590. @constant kAUNetSendProperty_TransmissionFormat
  2591. @discussion Scope: Global
  2592. Value Type: AudioStreamBasicDescription
  2593. Access: Read / Write
  2594. Get or set an arbitrary format that will be used to transmit the audio.
  2595. For compressed formats, it is recommended to use kAUNetSendProperty_TransmissionFormatIndex instead of this property,
  2596. since there is no way to specify a bit rate with this property.
  2597. @constant kAUNetSendProperty_TransmissionFormatIndex
  2598. @discussion Scope: Global
  2599. Value Type: UInt32
  2600. Access: Read / Write
  2601. Get or set the index of the preset format that will be used to transmit the audio.
  2602. The format indices can be found in the NetSendPresetFormat enum.
  2603. @constant kAUNetSendProperty_ServiceName
  2604. @discussion Scope: Global
  2605. Value Type: CFStringRef
  2606. Access: Read / Write
  2607. The name you want to publish for this network service.
  2608. For GetProperty, the returned CFStringRef is a copy and therefore must be released by the caller.
  2609. @constant kAUNetSendProperty_Disconnect
  2610. @discussion Scope: Global
  2611. Value Type: UInt32
  2612. Access: Read / Write
  2613. In order to disconnect, call this with a non-zero value.
  2614. In order to connect, call this with a zero value.
  2615. For GetProperty, the returned value the last value set by the caller.
  2616. To get the current connection status, get the value of the parameter kAUNetReceiveParam_Status.
  2617. @constant kAUNetSendProperty_Password
  2618. @discussion Scope: Global
  2619. Value Type: CFStringRef
  2620. Access: Read / Write
  2621. The password that must be used by the receiver. Leave unset or set to the empty string for no password.
  2622. For GetProperty, the returned CFStringRef is a copy and therefore must be released by the caller.
  2623. }
  2624. const
  2625. kAUNetSendProperty_PortNum = 3513;
  2626. kAUNetSendProperty_TransmissionFormat = 3514;
  2627. kAUNetSendProperty_TransmissionFormatIndex = 3515;
  2628. kAUNetSendProperty_ServiceName = 3516;
  2629. kAUNetSendProperty_Disconnect = 3517;
  2630. kAUNetSendProperty_Password = 3518;
  2631. {!
  2632. @enum NetSendPresetFormat
  2633. @constant kAUNetSendPresetFormat_PCMFloat32
  2634. @discussion 1411 kilobits per second per channel @ 44100KHz (kilo == 1000 not 1024)
  2635. @constant kAUNetSendPresetFormat_PCMInt24
  2636. @discussion 1058 kilobits per second per channel @ 44100KHz
  2637. @constant kAUNetSendPresetFormat_PCMInt16
  2638. @discussion 706 kilobits per second per channel @ 44100KHz
  2639. @constant kAUNetSendPresetFormat_Lossless24
  2640. @discussion 650 kilobits per second per channel @ 44100KHz
  2641. @constant kAUNetSendPresetFormat_Lossless16
  2642. @discussion 350 kilobits per second per channel @ 44100KHz
  2643. @constant kAUNetSendPresetFormat_ULaw
  2644. @discussion 353 kilobits per second per channel @ 44100KHz
  2645. @constant kAUNetSendPresetFormat_IMA4
  2646. @discussion 176 kilobits per second per channel @ 44100KHz
  2647. @constant kAUNetSendPresetFormat_AAC_128kbpspc
  2648. @discussion 128 kilobits per second per channel
  2649. @constant kAUNetSendPresetFormat_AAC_96kbpspc
  2650. @discussion 96 kilobits per second per channel
  2651. @constant kAUNetSendPresetFormat_AAC_80kbpspc
  2652. @discussion 80 kilobits per second per channel
  2653. @constant kAUNetSendPresetFormat_AAC_64kbpspc
  2654. @discussion 64 kilobits per second per channel
  2655. @constant kAUNetSendPresetFormat_AAC_48kbpspc
  2656. @discussion 48 kilobits per second per channel
  2657. @constant kAUNetSendPresetFormat_AAC_40kbpspc
  2658. @discussion 40 kilobits per second per channel
  2659. @constant kAUNetSendPresetFormat_AAC_32kbpspc
  2660. @discussion 32 kilobits per second per channel
  2661. @constant kAUNetSendNumPresetFormats = 14
  2662. }
  2663. const
  2664. kAUNetSendPresetFormat_PCMFloat32 = 0;
  2665. kAUNetSendPresetFormat_PCMInt24 = 1;
  2666. kAUNetSendPresetFormat_PCMInt16 = 2;
  2667. kAUNetSendPresetFormat_Lossless24 = 3;
  2668. kAUNetSendPresetFormat_Lossless16 = 4;
  2669. kAUNetSendPresetFormat_ULaw = 5;
  2670. kAUNetSendPresetFormat_IMA4 = 6;
  2671. kAUNetSendPresetFormat_AAC_128kbpspc = 7;
  2672. kAUNetSendPresetFormat_AAC_96kbpspc = 8;
  2673. kAUNetSendPresetFormat_AAC_80kbpspc = 9;
  2674. kAUNetSendPresetFormat_AAC_64kbpspc = 10;
  2675. kAUNetSendPresetFormat_AAC_48kbpspc = 11;
  2676. kAUNetSendPresetFormat_AAC_40kbpspc = 12;
  2677. kAUNetSendPresetFormat_AAC_32kbpspc = 13;
  2678. kAUNetSendPresetFormat_AAC_LD_64kbpspc = 14;
  2679. kAUNetSendPresetFormat_AAC_LD_48kbpspc = 15;
  2680. kAUNetSendPresetFormat_AAC_LD_40kbpspc = 16;
  2681. kAUNetSendPresetFormat_AAC_LD_32kbpspc = 17;
  2682. kAUNetSendNumPresetFormats = 18;
  2683. {$endc} { not TARGET_OS_IPHONE }
  2684. //=====================================================================================================================
  2685. //#pragma mark -
  2686. //#pragma mark Deprecated Properties
  2687. //#if !TARGET_OS_IPHONE
  2688. {$ifc not TARGET_OS_IPHONE}
  2689. // NumVersion is no longer used (originally from MacTypes.h)
  2690. type
  2691. //#if TARGET_RT_BIG_ENDIAN
  2692. {$ifc TARGET_RT_BIG_ENDIAN}
  2693. AUNumVersion = record
  2694. { Numeric version part of 'vers' resource }
  2695. majorRev: UInt8; {1st part of version number in BCD}
  2696. minorAndBugRev: UInt8; {2nd & 3rd part of version number share a byte}
  2697. stage: UInt8; {stage code: dev, alpha, beta, final}
  2698. nonRelRev: UInt8; {revision level of non-released version}
  2699. end;
  2700. {$elsec} { TARGET_RT_BIG_ENDIAN }
  2701. AUNumVersion = record
  2702. { Numeric version part of 'vers' resource accessible in little endian format }
  2703. nonRelRev: UInt8; {revision level of non-released version}
  2704. stage: UInt8; {stage code: dev, alpha, beta, final}
  2705. minorAndBugRev: UInt8; {2nd & 3rd part of version number share a byte}
  2706. majorRev: UInt8; {1st part of version number in BCD}
  2707. end;
  2708. {$endc} { TARGET_RT_BIG_ENDIAN }
  2709. AUNumVersionPtr = ^AUNumVersion;
  2710. AUNumVersionHandle = ^AUNumVersionPtr;
  2711. {!
  2712. @struct AUHostIdentifier
  2713. @abstract Used to describe the name and version of the audio unit's host
  2714. }
  2715. type
  2716. AUHostIdentifier = record
  2717. hostName: CFStringRef;
  2718. hostVersion: AUNumVersion;
  2719. end;
  2720. // $$$ THESE NEED TO BE REMOVED FROM 64bit apps
  2721. //=====================================================================================================================
  2722. // GENERIC
  2723. const
  2724. kAudioUnitParameterFlag_Global = 1 shl 0; // parameter scope is global
  2725. kAudioUnitParameterFlag_Input = 1 shl 1; // parameter scope is input
  2726. kAudioUnitParameterFlag_Output = 1 shl 2; // parameter scope is output
  2727. kAudioUnitParameterFlag_Group = 1 shl 3; // parameter scope is group
  2728. const
  2729. kAudioUnitParameterFlag_HasName = kAudioUnitParameterFlag_ValuesHaveStrings;
  2730. const
  2731. //kAudioUnitProperty_SetInputCallback = 7 -> deprecated
  2732. kAudioUnitProperty_SRCAlgorithm = 9; // see kAudioUnitProperty_SampleRateConverterComplexity
  2733. kAudioUnitProperty_MIDIControlMapping = 17; // see ParameterMIDIMapping Properties
  2734. kAudioUnitProperty_CurrentPreset = 28; // see PresentPreset
  2735. kAudioUnitProperty_ParameterValueName = kAudioUnitProperty_ParameterStringFromValue;
  2736. kAudioUnitProperty_BusCount = kAudioUnitProperty_ElementCount;
  2737. kAudioOfflineUnitProperty_InputSize = kAudioUnitOfflineProperty_InputSize;
  2738. kAudioOfflineUnitProperty_OutputSize = kAudioUnitOfflineProperty_OutputSize;
  2739. const
  2740. kAudioUnitSRCAlgorithm_Polyphase = FourCharCode('poly'); // same as kAudioUnitSampleRateConverterComplexity_Normal
  2741. kAudioUnitSRCAlgorithm_MediumQuality = FourCharCode('csrc'); // same as kAudioUnitSampleRateConverterComplexity_Normal
  2742. // Deprecated in Mac OS X v10.2. See AUParameterMIDIMapping.
  2743. type
  2744. AudioUnitMIDIControlMapping = record
  2745. midiNRPN: UInt16;
  2746. midiControl: UInt8;
  2747. scope: UInt8;
  2748. element: AudioUnitElement;
  2749. parameter: AudioUnitParameterID;
  2750. end;
  2751. // Deprecated. See AudioUnitParameterStringFromValue for equivalent structure, but with clearer field names
  2752. type
  2753. AudioUnitParameterValueName = record
  2754. inParamID: AudioUnitParameterID;
  2755. inValue: {const} Float32Ptr; // may be NULL if should translate current parameter value
  2756. outName: CFStringRef; // see comments for kAudioUnitProperty_ParameterStringFromValue
  2757. end;
  2758. //=====================================================================================================================
  2759. // Deprecated. These properties are Apple specific.
  2760. const
  2761. kMusicDeviceProperty_GroupOutputBus = 1002;
  2762. kMusicDeviceProperty_SoundBankFSSpec = 1003;
  2763. kAudioUnitProperty_PannerMode = 3008;
  2764. ///$$$ THESE NEED TO BE EXCLUDED FROM 64BIT $$$
  2765. const
  2766. kAudioUnitProperty_SpeakerConfiguration = 3001;
  2767. // Deprecated in favor of the newer AudioChannelLayout
  2768. // structure and its supporting property.
  2769. const
  2770. kSpeakerConfiguration_HeadPhones = 0;
  2771. kSpeakerConfiguration_Stereo = 1;
  2772. kSpeakerConfiguration_Quad = 2;
  2773. kSpeakerConfiguration_5_0 = 3;
  2774. kSpeakerConfiguration_5_1 = kSpeakerConfiguration_5_0;
  2775. type
  2776. AUSamplerBankPresetData = record
  2777. bankURL: CFURLRef;
  2778. bankMSB: UInt8;
  2779. bankLSB: UInt8;
  2780. presetID: UInt8;
  2781. reserved: UInt8;
  2782. end;
  2783. AUSamplerBankPresetDataPtr = ^AUSamplerBankPresetData;
  2784. //#endif !TARGET_OS_IPHONE
  2785. {$endc} { not TARGET_OS_IPHONE }
  2786. {$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
  2787. implementation
  2788. function GetAudioUnitParameterDisplayType(flags : UInt32) : UInt32; inline;
  2789. begin
  2790. GetAudioUnitParameterDisplayType := flags and kAudioUnitParameterFlag_DisplayMask
  2791. end;
  2792. function AudioUnitDisplayTypeIsLogarithmic(flags : UInt32) : Boolean; inline;
  2793. begin
  2794. AudioUnitDisplayTypeIsLogarithmic := GetAudioUnitParameterDisplayType(flags) = kAudioUnitParameterFlag_DisplayLogarithmic
  2795. end;
  2796. function AudioUnitDisplayTypeIsSquareRoot(flags : UInt32) : Boolean; inline;
  2797. begin
  2798. AudioUnitDisplayTypeIsSquareRoot := GetAudioUnitParameterDisplayType(flags) = kAudioUnitParameterFlag_DisplaySquareRoot
  2799. end;
  2800. function AudioUnitDisplayTypeIsSquared(flags : UInt32) : Boolean; inline;
  2801. begin
  2802. AudioUnitDisplayTypeIsSquared := GetAudioUnitParameterDisplayType(flags) = kAudioUnitParameterFlag_DisplaySquared
  2803. end;
  2804. function AudioUnitDisplayTypeIsCubed(flags : UInt32) : Boolean; inline;
  2805. begin
  2806. AudioUnitDisplayTypeIsCubed := GetAudioUnitParameterDisplayType(flags) = kAudioUnitParameterFlag_DisplayCubed
  2807. end;
  2808. function AudioUnitDisplayTypeIsCubeRoot(flags : UInt32) : Boolean; inline;
  2809. begin
  2810. AudioUnitDisplayTypeIsCubeRoot := GetAudioUnitParameterDisplayType(flags) = kAudioUnitParameterFlag_DisplayCubeRoot
  2811. end;
  2812. function AudioUnitDisplayTypeIsExponential(flags : UInt32) : Boolean; inline;
  2813. begin
  2814. AudioUnitDisplayTypeIsExponential := GetAudioUnitParameterDisplayType(flags) = kAudioUnitParameterFlag_DisplayExponential
  2815. end;
  2816. procedure SetAudioUnitParameterDisplayType(var flags : UInt32; displayType : UInt32); inline;
  2817. begin
  2818. flags := (flags and (not kAudioUnitParameterFlag_DisplayMask)) or displayType
  2819. end;
  2820. end.
  2821. {$endc} {not MACOSALLINCLUDE}