AudioUnitProperties.pas 154 KB

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