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