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 3046 3047 3048 3049 3050 3051 3052 3053 3054 3055 3056 3057 3058 3059 3060 3061 3062 3063 3064 3065 3066 3067 3068 3069 3070 3071 3072 3073 3074 3075 3076 3077 3078 3079 3080 3081 3082 3083 3084 3085 3086 3087 3088 3089 3090 3091 3092 3093 3094 3095 3096 3097 3098 3099 3100 3101 3102 3103 3104 3105 3106 3107 3108 3109 3110 3111 3112 3113 3114 3115 3116 3117 3118 3119 3120 3121 3122 3123 3124 3125 3126 3127 3128 3129 3130 3131 3132 3133 3134 3135 3136 3137 3138 3139 3140 3141 3142 3143 3144 3145 3146 3147 3148 3149 3150 3151 3152 3153 3154 3155 3156 3157 3158 3159 3160 3161 3162 3163 3164 3165 3166 3167 3168 3169 3170 3171 3172 3173 3174 3175 3176 3177 3178 3179 3180 3181 3182 3183 3184 3185 3186 3187 3188 3189 3190 3191 3192 3193 3194 3195 3196 3197 3198 3199 3200 3201 3202 3203 3204 3205 3206 3207 3208 3209 3210 3211 3212 3213 3214 3215 3216 3217 3218 3219 3220 3221 3222 3223 3224 3225 3226 3227 3228 3229 3230 3231 3232 3233 3234 3235 3236 3237 3238 3239 3240 3241 3242 3243 3244 3245 3246 3247 3248 3249 3250 3251 3252 3253 3254 3255 3256 3257 3258 3259 3260 3261 3262 3263 3264 3265 3266 3267 3268 3269 3270 3271 3272 3273 3274 3275 3276 3277 3278 3279 3280 3281 3282 3283 3284 3285 3286 3287 3288 3289 3290 3291 3292 3293 3294 3295 3296 3297 3298 3299 3300 3301 3302 3303 3304 3305 3306 3307 3308 3309 3310 3311 3312 3313 3314 3315 3316 3317 3318 3319 3320 3321 3322 3323 3324 3325 3326 3327 3328 3329 3330 3331 3332 3333 3334 3335 3336 3337 3338 3339 3340 3341 3342 3343 3344 3345 3346 3347 3348 3349 3350 3351 3352 3353 3354 3355 3356 3357 3358 3359 3360 3361 3362 3363 3364 3365 3366 3367 3368 3369 3370 3371 3372 3373 3374 3375 3376 3377 3378 3379 3380 3381 3382 3383 3384 3385 3386 3387 3388 3389 3390 3391 3392 3393 3394 3395 3396 3397 3398 3399 3400 3401 3402 3403 3404 3405 3406 3407 3408 3409 3410 3411 3412 3413 3414 3415 3416 3417 3418 3419 3420 3421 3422 3423 3424 3425 3426 3427 3428 3429 3430 3431 3432 3433 3434 3435 3436 3437 3438 3439 3440 3441 3442 3443 3444 3445 3446 3447 3448 3449 3450 3451 3452 3453 3454 3455 3456 3457 3458 3459 3460 3461 3462 3463 3464 3465 3466 3467 3468 3469 3470 3471 3472 3473 3474 3475 3476 3477 3478 3479 3480 3481 3482 3483 3484 3485 3486 3487 3488 3489 3490 3491 3492 3493 3494 3495 3496 3497 3498 3499 3500 3501 3502 3503 3504 3505 3506 3507 3508 3509 3510 3511 3512 3513 3514 3515 3516 3517 3518 3519 3520 3521 3522 3523 3524 3525 3526 3527 3528 3529 3530 3531 3532 3533 3534 3535 3536 3537 3538 3539 3540 3541 3542 3543 3544 3545 3546 3547 3548 3549 3550 3551 3552 3553 3554 3555 3556 3557 3558 3559 3560 3561 3562 3563 3564 3565 3566 3567 3568 3569 3570 3571 3572 3573 3574 3575 3576 3577 3578 3579 3580 3581 3582 3583 3584 3585 3586 3587 3588 3589 3590 3591 3592 3593 3594 3595 3596 3597 3598 3599 3600 3601 3602 3603 3604 3605 3606 3607 3608 3609 3610 3611 3612 3613 3614 3615 3616 3617 3618 3619 3620 3621 3622 3623 3624 3625 3626 3627 3628 3629 3630 3631 3632 3633 3634 3635 3636 3637 3638 3639 3640 3641 3642 3643 3644 3645 3646 3647 3648 3649 3650 3651 3652 3653 3654 3655 3656 3657 3658 3659 3660 3661 3662 3663 3664 3665 3666 3667 3668 3669 3670 3671 3672 3673 3674 3675 3676 3677 3678 3679 3680 3681 3682 3683 3684 3685 3686 3687 3688 3689 3690 3691 3692 3693 3694 3695 3696 3697 3698 3699 3700 3701 3702 3703 3704 3705 3706 3707 3708 3709 3710 3711 3712 3713 3714 3715 3716 3717 3718 3719 3720 3721 3722 3723 3724 3725 3726 3727 3728 3729 3730 3731 3732 3733 3734 3735 3736 3737 3738 3739 3740 3741 3742 3743 3744 3745 3746 3747 3748 3749 3750 3751 3752 3753 3754 3755 3756 3757 3758 3759 3760 3761 3762 3763 3764 3765 3766 3767 3768 3769 3770 3771 3772 3773 3774 3775 3776 3777 3778 3779 3780 3781 3782 3783 3784 3785 3786 3787 3788 3789 3790 3791 3792 3793 3794 3795 3796 3797 3798 3799 3800 3801 3802 3803 3804 3805 3806 3807 3808 3809 3810 3811 3812 3813 3814 3815 3816 3817 3818 3819 3820 3821 3822 3823 3824 3825 3826 3827 3828 3829 3830 3831 3832 3833 3834 3835 3836 3837 3838 3839 3840 3841 3842 3843 3844 3845 3846 3847 3848 3849 3850 3851 3852 3853 3854 3855 3856 3857 3858 3859 3860 3861 3862 3863 3864 3865 3866 3867 3868 3869 3870 3871 3872 3873 3874 3875 3876 3877 3878 3879 3880 3881 3882 3883 3884 3885 3886 3887 3888 3889 3890 3891 3892 3893 3894 3895 3896 3897 3898
|
/*
Copyright 2017 Linux Studio Plugins Project <lsp.plugin@gmail.com>
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THIS SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
#ifndef _3RDPARTY_STEINBERG_VST2_H_
#define _3RDPARTY_STEINBERG_VST2_H_
#include <string.h>
#include <stdint.h>
#include <limits.h>
//-------------------------------------------------------------------------------------------------------
// Configure compilation options
//-------------------------------------------------------------------------------------------------------
#if ((defined(__GNUC__) && (defined(__APPLE_CPP__) || defined(__APPLE_CC__))) || (defined (__MWERKS__) && defined (__MACH__)))
#ifndef TARGET_API_MAC_CARBON
#define TARGET_API_MAC_CARBON 1
#endif
#endif
// Define __cdecl modifier
#if defined(__GNUC__) || defined(__clang__)
#if defined(__i386__) || defined(__i386)
#ifndef __cdecl
#define __cdecl __attribute__((__cdecl__))
#endif
#elif defined(__x86_64__) || defined(__x86_64) || defined(__amd64__) || defined(__amd64) || defined(_M_AMD64)
#define VST_64BIT_PLATFORM 1
#elif defined(__aarch64__)
#define VST_64BIT_PLATFORM 1
#elif defined(__arm__) || defined(__arm) || defined(_M_ARM) || defined(_ARM)
#define VST_64BIT_PLATFORM 0
#elif defined(__PPC64__) || defined(__ppc64__) || defined(__ppc64) || defined(__powerpc64__) || defined(_ARCH_PPC64)
#define VST_64BIT_PLATFORM 1
#elif defined(__PPC__) || defined(__ppc__) || defined(__powerpc__) || defined(__ppc) || defined(_M_PPC) || defined(_ARCH_PPC)
#define VST_64BIT_PLATFORM 0
#elif defined(__s390x__) || defined(__s390__) || defined(__zarch__)
#define VST_64BIT_PLATFORM 1
#elif defined(__mips__) || defined(__mips) || defined(__MIPS__)
#elif defined(__riscv) && (__riscv_xlen == 64)
#define VST_64BIT_PLATFORM 1
#elif defined(__riscv) && (__riscv_xlen == 32)
#define VST_64BIT_PLATFORM 0
#elif defined(__loongarch64)
#define VST_64BIT_PLATFORM 1
#elif defined(__loongarch32)
#define VST_64BIT_PLATFORM 0
#endif
#endif /* __GNUC__ || __clang__ */
#ifndef __cdecl
#define __cdecl
#endif
#ifndef VST_64BIT_PLATFORM
#if defined(__WORDSIZE) && (__WORDSIZE == 64)
#define VST_64BIT_PLATFORM 1
#elif defined(__SIZE_WIDTH__) && (__SIZE_WIDTH__ == 64)
#define VST_64BIT_PLATFORM 1
#elif defined(__WORDSIZE) && (__WORDSIZE == 32)
#define VST_64BIT_PLATFORM 0
#elif defined(__SIZE_WIDTH__) && (__SIZE_WIDTH__ == 32)
#define VST_64BIT_PLATFORM 0
#endif /* __WORDSIZE, __SIZE_WIDTH__ */
#if defined(_WIN64) || defined(__LP64__)
#define VST_64BIT_PLATFORM 1
#else
#define VST_64BIT_PLATFORM 0
#endif
#endif /* VST_64BIT_PLATFORM */
#ifdef __cplusplus
#define VST_C_EXTERN extern "C"
#else
#define VST_C_EXTERN
#endif /* __cplusplus */
/** Test whether system runs in 64-bit mode */
#if defined(__GNUC__) || defined(__clang__)
#ifndef VST_64BIT_PLATFORM
#if defined(__WORDSIZE) && (__WORDSIZE == 64)
#define VST_64BIT_PLATFORM 1
#elif defined(__SIZE_WIDTH__) && (__SIZE_WIDTH__ == 64)
#define VST_64BIT_PLATFORM 1
#endif /* __WORDSIZE, __SIZE_WIDTH__ */
#endif
#endif /* __GNUC__ */
#if TARGET_API_MAC_CARBON
#ifdef (__LP64__) || (__ppc64__)
#pragma options align=power
#else
#pragma options align=mac68k
#endif
#define VSTCALLBACK
#elif defined __BORLANDC__
#pragma -a8
#elif defined(__GNUC__)
#pragma pack(push, 8)
#define VSTCALLBACK __cdecl
#elif defined(WIN32) || defined(__FLAT__) || defined CBUILDER
#pragma pack(push)
#pragma pack(8)
#define VSTCALLBACK __cdecl
#else
#define VSTCALLBACK
#endif
#ifdef __cplusplus
#define VST_SYMBOL_EXTERN extern "C"
#else
#define VST_SYMBOL_EXTERN
#endif
#if defined(__WINDOWS__) || defined(__WIN32__) || defined(__WIN64__) || defined(_WIN64) || defined(_WIN32) || defined(__WINNT) || defined(__WINNT__)
#define VST_SYMBOL_EXPORT VST_SYMBOL_EXTERN __declspec(dllexport)
#elif defined (__GNUC__) && ((__GNUC__ >= 4) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 1)))
#define VST_SYMBOL_EXPORT VST_SYMBOL_EXTERN __attribute__((visibility("default")))
#elif defined(__clang__)
#define VST_SYMBOL_EXPORT VST_SYMBOL_EXTERN __attribute__((visibility("default")))
#else
#define VST_SYMBOL_EXPORT VST_SYMBOL_EXTERN
#endif
#define VST_EXPORT VST_SYMBOL_EXPORT
#define VST_2_1_EXTENSIONS 1
#define VST_2_2_EXTENSIONS 1
#define VST_2_3_EXTENSIONS 1
#define VST_2_4_EXTENSIONS 1
#define DECLARE_VST_DEPRECATED(x) x
#define VST_VERSION_MICRO_MAX 99
#define VST_VERSION_MINOR_MAX 9
//-------------------------------------------------------------------------------------------------------
// Simple type definitions
//-------------------------------------------------------------------------------------------------------
/**
* Integral data types
*/
typedef int16_t VstInt16;
typedef int32_t VstInt32;
typedef int64_t VstInt64;
#if VST_64BIT_PLATFORM
typedef VstInt64 VstIntPtr;
#else
typedef VstInt32 VstIntPtr;
#endif
/**
* Magic number encoding macro
*/
#ifdef CCONST
#undef CCONST
#endif /* CCONST */
#define CCONST(a, b, c, d) \
((((VstInt32)a) << 24) | (((VstInt32)b) << 16) | (((VstInt32)c) << 8) | (((VstInt32)d) << 0))
//-------------------------------------------------------------------------------------------------------
// Constants definition
//-------------------------------------------------------------------------------------------------------
/**
* The VST interface version, current is 2.4.0
*/
#define kVstVersion 2400
/**
* Magic numbers
*/
#define kEffectMagic CCONST('V', 's', 't', 'P') /* AEffect magic number */
#define kEffectIdentify CCONST('N', 'v', 'E', 'f') /* Audio effect identification */
#define cMagic CCONST('C', 'c', 'n', 'K') /* Root chunk magic number for programs (FXP) and banks (FXB) */
#define fMagic CCONST('F', 'x', 'C', 'k') /* Regular program chunk magic number (FXP) */
#define bankMagic CCONST('F', 'x', 'B', 'k') /* Regular program bank magic number (FXB) */
#define chunkPresetMagic CCONST('F', 'P', 'C', 'h') /* Opaque chunk (preset) magic number for program chunk (FXP) */
#define chunkBankMagic CCONST('F', 'B', 'C', 'h') /* Opaque chunk (preset) magic number for bank chunk (FXB) */
/**
* Host can do the following
*/
#define canDoSendVstEvents "sendVstEvents" /* Host supports send of Vst events to plug-in */
#define canDoSendVstMidiEvent "sendVstMidiEvent" /* Host supports send of Vst events to plug-in */
#define canDoSendVstTimeInfo "sendVstTimeInfo" /* Host supports send of VstTimeInfo to plug-in */
#define canDoReceiveVstEvents "receiveVstEvents" /* Host can receive Vst events from plug-in */
#define canDoReceiveVstMidiEvent "receiveVstMidiEvent" /* Host can receive MIDI events from plug-in */
#define canDoReportConnectionChanges "reportConnectionChanges" /* Host will indicates the plug-in when something change in plug-in´s routing/connections with suspend/resume/setSpeakerArrangement */
#define canDoAcceptIOChanges "acceptIOChanges" /* Host supports ioChanged () */
#define canDoSizeWindow "sizeWindow" /* used by VSTGUI */
#define canDoOffline "offline" /* Host supports offline feature */
#define canDoOpenFileSelector "openFileSelector" /* Host supports function openFileSelector () */
#define canDoCloseFileSelector "closeFileSelector" /* Host supports function closeFileSelector () */
#define canDoStartStopProcess "startStopProcess" /* Host supports functions startProcess () and stopProcess () */
#define canDoShellCategory "shellCategory" /* 'shell' handling via uniqueID. If supported by the Host and the Plug-in has the category kPlugCategShell */
#define canDoSendVstMidiEventFlagIsRealtime "sendVstMidiEventFlagIsRealtime" /* Host supports flags for VstMidiEvent */
/**
* Plugin can do the following
*/
#define canDoSendVstEvents "sendVstEvents" /* plug-in will send Vst events to Host */
#define canDoSendVstMidiEvent "sendVstMidiEvent" /* plug-in will send MIDI events to Host */
#define canDoReceiveVstEvents "receiveVstEvents" /* plug-in can receive MIDI events from Host */
#define canDoReceiveVstMidiEvent "receiveVstMidiEvent" /* plug-in can receive MIDI events from Host */
#define canDoReceiveVstTimeInfo "receiveVstTimeInfo" /* plug-in can receive Time info from Host */
#define canDoOffline "offline" /* plug-in supports offline functions (offlineNotify, offlinePrepare, offlineRun) */
#define canDoMidiProgramNames "midiProgramNames" /* plug-in supports function getMidiProgramName () */
#define canDoBypass "bypass" /* plug-in supports function setBypass () */
enum VstAEffectFlags
{
/** Plugin provides custom user interface/editor
*
*/
effFlagsHasEditor = 1 << 0, //!< effFlagsHasEditor
/** This flag is deprecated
* @deprecated since VST 2.4
*/
effFlagsHasClip = 1 << 1, //!< effFlagsHasClip
/** This flag is deprecated
* @deprecated since VST 2.4
*/
effFlagsHasVu = 1 << 2, //!< effFlagsHasVu
/** This flag is deprecated
* @deprecated since VST 2.4
*/
effFlagsCanMono = 1 << 3, //!< effFlagsCanMono
/** Supports replacing process mode, default mode for VST 2.4
*
*/
effFlagsCanReplacing = 1 << 4, //!< effFlagsCanReplacing
/** Program data is handled in formatless chunks
*
*/
effFlagsProgramChunks = 1 << 5, //!< effFlagsProgramChunks
/** Plug-in is a synthesizer/instrument (VSTi),
* host may assign mixer channels for its outputs
*
*/
effFlagsIsSynth = 1 << 8, //!< effFlagsIsSynth
/** Plug-in does not produce sound when there is zero data on all inputs
*
*/
effFlagsNoSoundInStop = 1 << 9, //!< effFlagsNoSoundInStop
/** This flag is deprecated
* @deprecated since VST 2.4
*/
effFlagsExtIsAsync = 1 << 10,//!< effFlagsExtIsAsync
/** This flag is deprecated
* @deprecated since VST 2.4
*/
effFlagsExtHasBuffer = 1 << 11,//!< effFlagsExtHasBuffer
/** Plug-in supports double precision processing
* @since VST 2.4
*/
effFlagsCanDoubleReplacing = 1 << 12 //!< effFlagsCanDoubleReplacing
};
/** Host to plugin communication codes
* @see AEffectDispatcherProc
*
*/
enum AEffectOpcodes
{
/** The plugin initialization call
*
*/
effOpen = 0,
/** The plugin destruction call
*
*/
effClose,
/** Set the current program
* @param value - new program number
*/
effSetProgram,
/** Get the current program
* @return current program number
*/
effGetProgram,
/** Set current program name, maximum string length is kVstMaxProgNameLen
* Please be aware that the string lengths supported by the default VST interface
* are normally limited to kVstMaxProgNameLen characters. If you copy too much data
* into the buffers provided, you will break the Host application.
*
* @param ptr pointer to string with new program name
* @see kVstMaxProgNameLen
*/
effSetProgramName,
/** Get current program name, maximum string length is kVstMaxProgNameLen characters
* Please be aware that the string lengths supported by the default VST interface
* are normally limited to kVstMaxProgNameLen characters. If you copy too much data
* into the buffers provided, you will break the Host application.
*
* @param ptr pointer to buffer to store string with current program name
* @see kVstMaxProgNameLen
*/
effGetProgramName,
/** Get the label for the parameter displayed by host in the interface
* The length of the label is limited to kVstMaxParamStrLen characters
* @param ptr pointer to buffer to store label
* @see kVstMaxParamStrLen
*/
effGetParamLabel,
/** Get the parameter display string
* The length of the passed buffer is limited to kVstMaxParamStrLen characters
* @param ptr pointer to buffer to store parameter string
* @see kVstMaxParamStrLen
*/
effGetParamDisplay,
/** Get the parameter name used/displayed by host
* The length of parameter name is limited to kVstMaxParamStrLen characters
* @param ptr pointer to buffer to store parameter name string
* @see kVstMaxParamStrLen
*/
effGetParamName,
/** This is deprecated command
* @deprecated since VST 2.4
*
*/
effGetVu,
/** Change the audio processing sample rate
* @param opt new sample rate value
*
*/
effSetSampleRate,
/** Set the maximum block size that host can pass to plugin while
* performing audio processing.
* @param value new maximum block size for audio processing
*/
effSetBlockSize,
/** The plugin is suspended/resumed
* @param value suspend/resume flag: 0 means "turn off", 1 means "turn on"
*
*/
effMainsChanged,
/** Get custom editor area size
* @param ptr double pointer to ERect structure (ERect **) that contains editor area parameters
*/
effEditGetRect,
/** Activate (show) the custom editor provided by the plugin
* @param ptr platform-specific Window handle (HWND for Windows, XID for X11, etc.)
*
*/
effEditOpen,
/** Deactivate (hide) the custom editor provided by the plugin
*
*/
effEditClose,
/** This is deprecated command
* @deprecated since VST 2.4
*
*/
effEditDraw,
/** This is deprecated command
* @deprecated since VST 2.4
*
*/
effEditMouse,
/** This is deprecated command
* @deprecated since VST 2.4
*
*/
effEditKey,
/** Called by the host for the custom UI editor
* to process events from windowing subsystem
*/
effEditIdle,
/** This is deprecated command
* @deprecated since VST 2.4
*
*/
effEditTop,
/** This is deprecated command
* @deprecated since VST 2.4
*
*/
effEditSleep,
/** This is deprecated command, should return kEffectIdentify ('NvEf')
* @see kEffectIdentify
* @deprecated since VST 2.4
*
*/
effIdentify,
/** Get program chunk
* If your plug-in is configured to use chunks (see effFlagsProgramChunks),
* the Host will ask for a block of memory describing the current plug-in state for saving.
* To restore the state at a later stage, the same data is passed back by effSetChunk.
* Alternatively, when not using chunk, the Host will simply save all parameter values.
*
* @param ptr double pointer to void (void **) for obtaining chunk data address
* @param index type of the chunk: 0 for bank, 1 for program
*/
effGetChunk,
/** Set program chunk
* @param ptr pointer to chunk data
* @param value the size in bytes
* @param index type of the chunk: 0 for bank, 1 for program
*/
effSetChunk,
/** Process events passed to the host
* @param ptr pointer to VstEvents structure
* @see VstEvents
*/
effProcessEvents,
/** Check whether parameter can be automated
* @param index parameter index
* @return 1 if parameter can be automated, 0 otherwise
*/
effCanBeAutomated,
/** Convert a string representation to a parameter value
* @param index parameter index
* @param ptr parameter string
* @return 1 if success, 0 otherwise
*/
effString2Parameter,
/**
* @deprecated since VST 2.4
*/
effGetNumProgramCategories,
/** Fill text with name of program index (category deprecated in VST 2.4)
*
* @param index program index
* @param ptr buffer for program name limited to kVstMaxProgNameLen
* @return true for success
* @see kVstMaxProgNameLen
*/
effGetProgramNameIndexed,
/**
* @deprecated since VST 2.4
*/
effCopyProgram,
/**
* @deprecated since VST 2.4
*/
effConnectInput,
/**
* @deprecated since VST 2.4
*/
effConnectOutput,
/** Return the properties of input index
* @param index input index
* @param ptr pointer to VstPinProperties structure
* @return 1 if supported
*/
effGetInputProperties,
/** Return the properties of output index
* @param index input index
* @param ptr pointer to VstPinProperties structure
* @return 1 if supported
*/
effGetOutputProperties,
/** Get plugin category
* @return plugin category (one of VstPlugCategory enum constants)
* @see VstPlugCategory
*/
effGetPlugCategory,
/**
* @deprecated since VST 2.4
*/
effGetCurrentPosition,
/**
* @deprecated since VST 2.4
*/
effGetDestinationBuffer,
/**
* @param ptr pointer to array of VstAudioFile structures
* @param value count of elements in array
* @param index start flag
*/
effOfflineNotify,
/**
* @param ptr pointer to array of VstOfflineTask structures
* @param value count of elements in array
* @see VstOfflineTask
*/
effOfflinePrepare,
/**
* @param ptr pointer to array of VstOfflineTask structures
* @param value count of elements in array
* @see VstOfflineTask
*/
effOfflineRun,
/** Used for variable I/O processing (offline processing like timestreching)
* @param ptr pointer to VstVariableIo structure
*/
effProcessVarIo,
/** Set the plug-in's speaker arrangements
* @param value pointer to VstSpeakerArrangements
* @param ptr output pointer to VstSpeakerArrangement
*/
effSetSpeakerArrangement,
/**
* @deprecated since VST 2.4
*/
effSetBlockSizeAndSampleRate,
/** For 'soft-bypass' (this could be automated (in Audio Thread)
* that why you could NOT call iochanged (if needed) in this function,
* do it in fxidle).
*
* @param value 1 = bypass, 0 = no bypass
*/
effSetBypass,
/** Get effect name
* @param ptr buffer to store effect name, maximum length is kVstMaxEffectNameLen characters
* @see kVstMaxEffectNameLen
*/
effGetEffectName,
/**
* @deprecated since VST 2.4
*/
effGetErrorText,
/** Get plugin vendor string
* @param ptr pointer to buffer to store vendor string, maximum length is kVstMaxVendorStrLen characters
* @see kVstMaxVendorStrLen
*/
effGetVendorString,
/** Get plugin product string
* @param ptr pointer to buffer to store product string, maximum length is kVstMaxProductStrLen characters
* @see kVstMaxVendorStrLen
*/
effGetProductString,
/** Get plugin vendor-specific version
* @return vendor-specific version
*/
effGetVendorVersion,
/** No special definition, vendor specific handling
*
*/
effVendorSpecific,
/** Check whether plugin supports a feature
* @param ptr the pointer to string with supported feature identifier
* @return 0: "don't know" -1: "no" 1: "yes"
*/
effCanDo,
/** Get post-processing tail size of plugin (for example the reverb time of a reverb plug-in)
* @return tail size, 0 is default, 1 if there is no tail
*/
effGetTailSize,
/**
* @deprecated since VST 2.4
*/
effIdle,
/**
* @deprecated since VST 2.4
*/
effGetIcon,
/**
* @deprecated since VST 2.4
*/
effSetViewPosition,
/** Get plugin parameter properties
* @param index parameter index
* @param ptr pointer to VstParameterProperties structure
* @return 1 if supported
*/
effGetParameterProperties,
/**
* @deprecated since VST 2.4
*/
effKeysRequired,
/** Return the VST interface version used by plugin
* @return VST interface version
* @see kVstVersion
*/
effGetVstVersion,
/** Receive key down event. Return true only if key was really used!
* @param index ASCII character
* @param value virtual key
* @param opt key modifiers
* @return 1 if key was used, 0 otherwise
* @since VST 2.1
*/
effEditKeyDown,
/** Receive key up event. Return true only if key was really used!
* @param index ASCII character
* @param value virtual key
* @param opt key modifiers
* @return 1 if key was used, 0 otherwise
* @since VST 2.1
*/
effEditKeyUp,
/** Set knob mode (if supported by Host)
* @param value knob mode: 0 = circular, 1 = circular relative, 2 = linear
* @return 1 if key was used, 0 otherwise
* @since VST 2.1
*/
effSetEditKnobMode,
/** Fill midiProgramName with information for 'thisProgramIndex'.
* @param index MIDI channel
* @param ptr pointer to MidiProgramName structure
* @return number of used programs, 0 if unsupported
* @since VST 2.1
*/
effGetMidiProgramName,
/** Fill currentProgram with information for the current MIDI program.
* @param index MIDI channel
* @param ptr pointer to MidiProgramName structure
* @return index of current program
* @since VST 2.1
*/
effGetCurrentMidiProgram,
/** Fill category with information for 'thisCategoryIndex'.
* @param index MIDI channel
* @param ptr pointer to MidiProgramCategory structure
* @return number of used categories, 0 if unsupported
* @since VST 2.1
*/
effGetMidiProgramCategory,
/** Return true if the MidiProgramNames, MidiKeyNames or MidiControllerNames had changed on this MIDI channel.
* @param index MIDI channel
* @return 1 if the at least one program name or key name has been changed
* @see MidiProgramNames
* @see MidiKeyNames
* @see MidiControllerNames
* @since VST 2.1
*/
effHasMidiProgramsChanged,
/** Fill keyName with information for 'thisProgramIndex' and 'thisKeyNumber'
* @param index MIDI channel
* @param ptr pointer to MidiKeyName structure
* @return 1 if supported, 0 if not
* @see MidiKeyName
* @since VST 2.1
*/
effGetMidiKeyName,
/** Called before a program is loaded. No arguments
* @since VST 2.1
*/
effBeginSetProgram,
/** Called after a program was loaded. No arguments
* @since VST 2.1
*/
effEndSetProgram,
/** Set the plug-in's speaker arrangements
* @param value pointer to VstSpeakerArrangement structure
* @param ptr pointer to output VstSpeakerArrangement structure
* @since VST 2.3
*/
effGetSpeakerArrangement,
/** This opcode is only called, if the plug-in is of type
* kPlugCategShell, in order to extract all included sub-plugin's names.
* @param ptr buffer for plug-in name, limited to kVstMaxProductStrLen
* @return next plugin's uniqueID
* @see kPlugCategShell
* @see kVstMaxProductStrLen
* @since VST 2.3
*/
effShellGetNextPlugin,
/** Called one time before the start of process call. This indicates that
* the process call will be interrupted (due to Host reconfiguration or
* bypass state when the plug-in doesn't support softBypass)
* No arguments
* @since VST 2.3
*/
effStartProcess,
/** Called after the stop of process call
* No arguments
* @since VST 2.3
*/
effStopProcess,
/** Called in offline mode before process() or processVariableIo ()
* @param value number of samples to process, offline mode only!
* @since VST 2.3
*/
effSetTotalSampleToProcess,
/** Set the Panning Law used by the Host.
* @param value pan law (one of the VstPanLawType enumeration constants)
* @param opt gain
* @see VstPanLawType
* @since VST 2.3
*/
effSetPanLaw,
/** Called before a Bank is loaded.
* @param ptr pointer to VstPatchChunkInfo structure
* @return -1 if ban can not be loaded, 1 if bank can be loaded, 0 if function is not supported
* @see VstPatchChunkInfo
* @since VST 2.3
*/
effBeginLoadBank,
/** Called before a Program is loaded, called before beginSetProgram.
* @param ptr pointer to VstPatchChunkInfo structure
* @return -1 if program can not be loaded, 1 if program can be loaded, 0 if not supported
* @see effBeginSetProgram
* @see VstPatchChunkInfo
* @since VST 2.3
*/
effBeginLoadProgram,
/** Set floating-point precision used for processing (32 or 64 bit)
* @value constant defined in VstProcessPrecision enumeration
* @see VstProcessPrecision
* @since VST 2.4
*/
effSetProcessPrecision,
/** Returns number of MIDI input channels used [0, 16]
* @return number of used MIDI input channels
* @since VST 2.4
*/
effGetNumMidiInputChannels,
/** Returns number of MIDI output channels used [0, 16]
* @return number of used MIDI input channels
* @since VST 2.4
*/
effGetNumMidiOutputChannels
};
/** Plugin to host communication codes
*
*/
enum AudioMasterOpcodes
{
/**
* An important thing to notice is that if the user changes a parameter in your editor, which is
* out of the Host's control if you are not using the default string based interface, you should
* issue audioMasterAutomate callback. This ensures that the Host is notified of the parameter
* change, which allows it to record these changes for automation.
* @param index parameter index
* @param opt parameter value
*
*/
audioMasterAutomate = 0,
/** Get host VST version
* @return Host VST version (for example 2400 for VST 2.4)
*/
audioMasterVersion,
/** Get unique identifier for shell plugin
* @return current uinque identifier on shell plugin
*/
audioMasterCurrentId,
/**
*
*/
audioMasterIdle,
/** Pin connection flag
* @deprecated since VST 2.4 r2
*
*/
audioMasterPinConnected,
/** Just padding
*
*/
__audioMasterPad,
/** Want MIDI flag
* @deprecated since VST 2.4
*/
audioMasterWantMidi,
/** Get time
* @param value request mask
* @return the pointer to VstTimeInfo or NULL if not supported
* @see VstTimeInfo
* @see VstTimeInfoFlags
*
*/
audioMasterGetTime,
/** Process events delivered to plugin
* @param ptr pointer to events structure
* @see VstEvents
*
*/
audioMasterProcessEvents,
/**
* @deprecated since VST 2.4
*/
audioMasterSetTime,
/**
* @deprecated since VST 2.4
*/
audioMasterTempoAt,
/**
* @deprecated since VST 2.4
*/
audioMasterGetNumAutomatableParameters,
/**
* @deprecated since VST 2.4
*/
audioMasterGetParameterQuantization,
/** Called when the IO of plugin has changed or a latency value has been updated
* @return 1 if supported
*
*/
audioMasterIOChanged,
/**
* @deprecated since VST 2.4
*/
audioMasterNeedIdle,
/** Called by plugin when it's custom UI editor window should be resized
*
* @param index new window width
* @param value new window height
* @return 1 if supported
*/
audioMasterSizeWindow,
/** Get current sample rate
* @return current sample rate
*/
audioMasterGetSampleRate,
/** Get current processing block size passed by host
* @return current block size
*/
audioMasterGetBlockSize,
/** Get input latency in audio samples
* @return input latency value
*/
audioMasterGetInputLatency,
/** Get output latency in audio samples
* @return output latency value
*/
audioMasterGetOutputLatency,
/**
* @deprecated since VST 2.4
*/
audioMasterGetPreviousPlug,
/**
* @deprecated since VST 2.4
*/
audioMasterGetNextPlug,
/**
* @deprecated since VST 2.4
*/
audioMasterWillReplaceOrAccumulate,
/** Get current process level
* @return current process level
* @see VstProcessLevels
*/
audioMasterGetCurrentProcessLevel,
/** Get current automation state
* @return current automation state
* @see VstAutomationStates
*/
audioMasterGetAutomationState,
/** Start offline processing
* @param index numBewAudioFiles
* @param value numAduioFiles
* @param ptr pointer to VstAudioFile
* @see VstAudioFile
*/
audioMasterOfflineStart,
/** Read offline
* @param index readSource (boolean)
* @param value pointer to VstOfflineOption
* @param ptr pointer to VstOfflineTask
* @see VstOfflineOption
* @see VstOfflineTask
*/
audioMasterOfflineRead,
/** Write offline
* @param index readSource (boolean)
* @param value pointer to VstOfflineOption
* @param ptr pointer to VstOfflineTask
* @see VstOfflineOption
* @see VstOfflineTask
*/
audioMasterOfflineWrite,
/** Get current pass
*
*/
audioMasterOfflineGetCurrentPass,
/** Get current meta pass
*
*/
audioMasterOfflineGetCurrentMetaPass,
/**
* @deprecated since VST 2.4
*/
audioMasterSetOutputSampleRate,
/**
* @deprecated since VST 2.4
*/
audioMasterGetOutputSpeakerArrangement,
/** Get host vendor string
* @param ptr buffer to store vendor string, maximum kVstMaxVendorStrLen characters
* @see kVstMaxVendorStrLen
*/
audioMasterGetVendorString,
/** Get host product string
* @param ptr buffer to store product string, maximum kVstMaxProductStrLen characters
* @see kVstMaxProductStrLen
*/
audioMasterGetProductString,
/** Get vendor-specific version
* @return vendor-specific version
*
*/
audioMasterGetVendorVersion,
/** No special definition, vendor-specific handling
*
*/
audioMasterVendorSpecific,
/**
* @deprecated since VST 2.4
*/
audioMasterSetIcon,
/** Check whether host supports some features
* @param ptr the pointer to string containing the feature name
* @return 1 if feature is supported, 0 otherwise
*/
audioMasterCanDo,
/** Get language code
* @see VstHostLanguage
*/
audioMasterGetLanguage,
/**
* @deprecated since VST 2.4
*/
audioMasterOpenWindow,
/**
* @deprecated since VST 2.4
*/
audioMasterCloseWindow,
/** Get directory
* @return pointer to FSSpec on MAC or pointer to character string otherwise
*
*/
audioMasterGetDirectory,
/** No arguments
*
*/
audioMasterUpdateDisplay,
/** Start editing
* @param index parameter index
*/
audioMasterBeginEdit,
/** Finish editing
* @param index parameter index
*/
audioMasterEndEdit,
/** Open the file selector
* @param ptr pointer to VstFileSelect
* @return 1 if feature is supported
*/
audioMasterOpenFileSelector,
/** Close the file selector
* @param ptr pointer to VstFileSelect
*/
audioMasterCloseFileSelector,
/**
* @deprecated since VST 2.4
*/
audioMasterEditFile,
/**
* @param ptr: char[2048] or sizeof (FSSpec)
* @return 1 if supported
* @deprecated since VST 2.4
*/
audioMasterGetChunkFile,
/**
* @deprecated since VST 2.4
*/
audioMasterGetInputSpeakerArrangement
};
/** VST event types
*
*/
enum VstEventTypes
{
/** MIDI event
* @see VstMidiEvent
*/
kVstMidiType = 1,
/** Audio event (unused)
* @deprecated
*/
kVstAudioType,
/** Video event (unused)
* @deprecated
*/
kVstVideoType,
/** Parameter event (unused)
* @deprecated
*/
kVstParameterType,
/** Trigger event (unused)
* @deprecated
*/
kVstTriggerType,
/** System exclusive MIDI event
* @see VstMidiSysexEvent
*/
kVstSysExType
};
/** MIDI event types
*
*/
enum VstMidiEventFlags
{
/** This event is played at life performance, not from sequencer's MIDI track
* his allows the Plug-In to handle these flagged events with higher priority,
* especially when the Plug-In has a big latency
*/
kVstMidiEventIsRealtime = 1 << 0
};
/** Different limitations of string constants
*
*/
enum VstLimits
{
/** Maximum program name length
* @see effGetProgramName
* @see effSetProgramName
* @see effGetProgramNameIndexed
*
*/
kVstMaxProgNameLen = 24,
/** Maximum parameter name length
* @see effGetParamLabel
* @see effGetParamDisplay
* @see effGetParamName
*
*/
kVstMaxParamStrLen = 8,
/** Maximum vendor string length
* @see effGetVendorString
* @see audioMasterGetVendorString
*
*/
kVstMaxVendorStrLen = 64,
/** Maximum product string length
* @see effGetProductString
* @see audioMasterGetProductString
*/
kVstMaxProductStrLen = 64,
/** Maximum plugin name length
* @see effGetEffectName
*
*/
kVstMaxEffectNameLen = 32,
/** Maximum name length
* @see MidiProgramName
* @see MidiProgramCategory
* @see MidiKeyName
* @see VstSpeakerProperties
* @see VstPinProperties
*
*/
kVstMaxNameLen = 64,
/** Maximum label length
* @see VstParameterProperties.label
* @see VstPinProperties.label
*
*/
kVstMaxLabelLen = 64,
/** Maximum length of short label
* @see VstParameterProperties.shortLabel
* @see VstPinProperties.shortLabel
*
*/
kVstMaxShortLabelLen = 8,
/** Maximum category label length
* @see VstParameterProperties.label
*/
kVstMaxCategLabelLen = 24,
/** Maximum file name length
* @see VstAudioFile.name
*/
kVstMaxFileNameLen = 100
};
/** Available host languages
*
*/
enum VstHostLanguage
{
/** English
*
*/
kVstLangEnglish = 1,
/** German
*
*/
kVstLangGerman,
/** French
*
*/
kVstLangFrench,
/** Italian
*
*/
kVstLangItalian,
/** Spanish
*
*/
kVstLangSpanish,
/** Japanese
*
*/
kVstLangJapanese
};
/** VST processing precision constants
*
*/
enum VstProcessPrecision
{
/** Single-precision floating point (32 bits per sample)
*
*/
kVstProcessPrecision32 = 0,
/** Double-precision floating point (64 bits per sample)
*
*/
kVstProcessPrecision64
};
/** Flags for VstTimeInfo structure
* @see VstTimeInfo
*/
enum VstTimeInfoFlags
{
/** Play, cycle or record state has been changed
*
*/
kVstTransportChanged = 1 << 0,
/** Host sequencer is currently playing
*
*/
kVstTransportPlaying = 1 << 1,
/** Host sequencer plays in cycle/loop mode
*
*/
kVstTransportCycleActive = 1 << 2,
/** Host sequencer is recording/is in record mode
*
*/
kVstTransportRecording = 1 << 3,
/** Automation write mode is active (record parameter changes)
*
*/
kVstAutomationWriting = 1 << 6,
/** Automation read mode is active (play parameter changes)
*
*/
kVstAutomationReading = 1 << 7,
/** nanoSeconds field value is valid
*
*/
kVstNanosValid = 1 << 8,
/** ppqPos field value is valid
*
*/
kVstPpqPosValid = 1 << 9,
/** tempo field value is valid
*
*/
kVstTempoValid = 1 << 10,
/** barStartPos field value is valid
*
*/
kVstBarsValid = 1 << 11,
/** cycleStartPos field value is valid
*
*/
kVstCyclePosValid = 1 << 12,
/** timeSigNumerator field value is valid
*
*/
kVstTimeSigValid = 1 << 13,
/** smpteOffset field value is valid
*
*/
kVstSmpteValid = 1 << 14,
/** samplesToNextClock field value is valid
*
*/
kVstClockValid = 1 << 15
};
/**
* SMPTE (Society of Motion Picture and Television Engineers) frame rates
* SMPTE timecode is a set of cooperating standards to label individual
* frames of video or film with a time code
*/
enum VstSmpteFrameRate
{
/** 24 FPS frame rate
*
*/
kVstSmpte24fps = 0,
/** 25 FPS frame rate
*
*/
kVstSmpte25fps = 1,
/** 29.97 FPS frame rate
*
*/
kVstSmpte2997fps = 2,
/** 30 FPS frame rate
*
*/
kVstSmpte30fps = 3,
/** 29.97 FPS drop frame rate
*
*/
kVstSmpte2997dfps = 4,
/** 30 FPS drop frame rate
*
*/
kVstSmpte30dfps = 5,
/** 16mm film
*
*/
kVstSmpteFilm16mm = 6,
/** 35 mm film
*
*/
kVstSmpteFilm35mm = 7,
/** 23.976 FPS HDTV frame rate
*
*/
kVstSmpte239fps = 10,
/** 24.976 FPS HDTV frame rate
*
*/
kVstSmpte249fps = 11,
/** 59.94 FPS HDTV frame rate
*
*/
kVstSmpte599fps = 12,
/** 60 FPS HDTV frame rate
*
*/
kVstSmpte60fps = 13
};
/** Constants used in VstFileSelect structure
* @see VstFileSelect
*/
enum VstFileSelectCommand
{
/** For loading a file
*
*/
kVstFileLoad = 0,
/** For saving a file
*
*/
kVstFileSave,
/** For loading multiple files
*
*/
kVstMultipleFilesLoad,
/** For selecting a directory/folder
*
*/
kVstDirectorySelect
};
/** Types used in VstFileSelect structure
* @see VstFileSelect
*/
enum VstFileSelectType
{
/** Regular file selector
*
*/
kVstFileType = 0
};
/** Pan law rule constants
*
*/
enum VstPanLawType
{
/** Linear pan law:
* L = pan * M; R = (1 - pan) * M;
*/
kLinearPanLaw = 0,
/** Equal power pan law:
* L = sqrt(pan) * M; R = sqrt(1 - pan) * M;
*/
kEqualPowerPanLaw
};
/** Process levels returned by audioMasterGetCurrentProcessLevel
* @see audioMasterGetCurrentProcessLevel
*/
enum VstProcessLevels
{
/** Unknown process level, unsupported by host
*
*/
kVstProcessLevelUnknown = 0,
/** Currently in user thread (GUI)
*
*/
kVstProcessLevelUser,
/** Currently in audio thread (where process method is called)
*
*/
kVstProcessLevelRealtime,
/** Currently in 'sequencer' thread (MIDI, timer etc.)
*
*/
kVstProcessLevelPrefetch,
/** Currently offline processing and thus in the user thread
*
*/
kVstProcessLevelOffline
};
/** Automation states returned by audioMasterGetAutomationState
* @see audioMasterGetAutomationState
*/
enum VstAutomationStates
{
/** Not supported by Host
*
*/
kVstAutomationUnsupported = 0,
/** Automation is turned off
*
*/
kVstAutomationOff,
/** Automation is in read state
*
*/
kVstAutomationRead,
/** Automation is in write state
*
*/
kVstAutomationWrite,
/** Automation is in read and write state
*
*/
kVstAutomationReadWrite
};
/**
* Flags used in VstParameterProperties structure
* @see VstParameterProperties
*/
enum VstParameterFlags
{
/** Parameter is a binary-state switch
* that can be toggled into on/off state
*
*/
kVstParameterIsSwitch = 1 << 0,
/** The minimum and maximum integer values (minInteger, maxInteger) are valid
*
*/
kVstParameterUsesIntegerMinMax = 1 << 1,
/** Parameters stepFloat, smallStepFloat, largeStepFloat are valid
*
*/
kVstParameterUsesFloatStep = 1 << 2,
/** Fields stepInteger and largeStepInteger are valid
*
*/
kVstParameterUsesIntStep = 1 << 3,
/** The displayIndex field is valid
*
*/
kVstParameterSupportsDisplayIndex = 1 << 4,
/** Parameter supports category feature and fields
* related to category are valid
*
*/
kVstParameterSupportsDisplayCategory = 1 << 5,
/** This flag indicates that parameter value can ramp up/down
*
*/
kVstParameterCanRamp = 1 << 6
};
/**
* Flags used in VstPinProperties structure
* @see VstPinProperties
*/
enum VstPinPropertiesFlags
{
/** Pin is active, ignored by host
*
*/
kVstPinIsActive = 1 << 0,
/** Pin is first of a stereo pair
*
*/
kVstPinIsStereo = 1 << 1,
/** arrangementType field is valid and can be used
* to get wanted arrangement
*/
kVstPinUseSpeaker = 1 << 2
};
/**
* Available plugin categories
*/
enum VstPlugCategory
{
/** Unknown category or category not implemented
*
*/
kPlugCategUnknown = 0,
/** Simple effect
*
*/
kPlugCategEffect,
/** VST instrument: synthesizer, sampler, etc.
*
*/
kPlugCategSynth,
/** Analysis: scope, tuner, etc.
*
*/
kPlugCategAnalysis,
/** Maternig category: dynamics, etc.
*
*/
kPlugCategMastering,
/** Spatial processing: panners, etc.
*
*/
kPlugCategSpacializer,
/** Spacial effects: delays, reverberations, etc.
*
*/
kPlugCategRoomFx,
/** Dedicated surround processor
*
*/
kPlugSurroundFx,
/** Restoration effect: denoiser, declipper, etc.
*
*/
kPlugCategRestoration,
/** Offline processor
*
*/
kPlugCategOfflineProcess,
/** Shell plugin, it's a container for other plugins
* @see effShellGetNextPlugin
*/
kPlugCategShell,
/** Different generators: tone generator, etc.
*
*/
kPlugCategGenerator,
/** The maximum category number marker
*
*/
kPlugCategMaxCount
};
/**
* Flags used in MidiProgramName
* @see MidiProgramName
*/
enum VstMidiProgramNameFlags
{
/** Omni flag (default is Multi)
* For omni mode, channel 0 is used for inquiries and program changes
*/
kMidiIsOmni = 1
};
/**
* Speaker Types
*/
enum VstSpeakerType
{
/**
* Undefined
*/
kSpeakerUndefined = 0x7fffffff,
/**
* Mono (M)
*/
kSpeakerM = 0,
/**
* Left (L)
*/
kSpeakerL,
/**
* Right (R)
*/
kSpeakerR,
/**
* Center (C)
*/
kSpeakerC,
/**
* Subbass (Lfe)
*/
kSpeakerLfe,
/**
* Left Surround (Ls)
*/
kSpeakerLs,
/**
* Right Surround (Rs)
*/
kSpeakerRs,
/**
* Left of Center (Lc)
*/
kSpeakerLc,
/**
* Right of Center (Rc)
*/
kSpeakerRc,
/**
* Surround (S)
*/
kSpeakerS,
/**
* Center of Surround (Cs) = Surround (S)
*/
kSpeakerCs = kSpeakerS,
/**
* Side Left (Sl)
*/
kSpeakerSl,
/**
* Side Right (Sr)
*/
kSpeakerSr,
/**
* Top Middle (Tm)
*/
kSpeakerTm,
/**
* Top Front Left (Tfl)
*/
kSpeakerTfl,
/**
* Top Front Center (Tfc)
*/
kSpeakerTfc,
/**
* Top Front Right (Tfr)
*/
kSpeakerTfr,
/**
* Top Rear Left (Trl)
*/
kSpeakerTrl,
/**
* Top Rear Center (Trc)
*/
kSpeakerTrc,
/**
* Top Rear Right (Trr)
*/
kSpeakerTrr,
/**
* Subbass 2 (Lfe2)
*/
kSpeakerLfe2
};
/**
* User-defined speaker types, to be extended in the negative range.
* Will be handled as their corresponding speaker types with abs values:
* e.g abs(kSpeakerU1) == kSpeakerL, abs(kSpeakerU2) == kSpeakerR)
*/
enum VstUserSpeakerType
{
kSpeakerU32 = -32,
kSpeakerU31,
kSpeakerU30,
kSpeakerU29,
kSpeakerU28,
kSpeakerU27,
kSpeakerU26,
kSpeakerU25,
kSpeakerU24,
kSpeakerU23,
kSpeakerU22,
kSpeakerU21,
kSpeakerU20 = -kSpeakerLfe2,
kSpeakerU19 = -kSpeakerTrr,
kSpeakerU18 = -kSpeakerTrc,
kSpeakerU17 = -kSpeakerTrl,
kSpeakerU16 = -kSpeakerTfr,
kSpeakerU15 = -kSpeakerTfc,
kSpeakerU14 = -kSpeakerTfl,
kSpeakerU13 = -kSpeakerTm,
kSpeakerU12 = -kSpeakerSr,
kSpeakerU11 = -kSpeakerSl,
kSpeakerU10 = -kSpeakerCs,
kSpeakerU9 = -kSpeakerS,
kSpeakerU8 = -kSpeakerRc,
kSpeakerU7 = -kSpeakerLc,
kSpeakerU6 = -kSpeakerRs,
kSpeakerU5 = -kSpeakerLs,
kSpeakerU4 = -kSpeakerLfe,
kSpeakerU3 = -kSpeakerC,
kSpeakerU2 = -kSpeakerR,
kSpeakerU1 = -kSpeakerL
};
/**
* Speaker Arrangement Types
*/
enum VstSpeakerArrangementType
{
/** User-defined
*
*/
kSpeakerArrUserDefined = -2,///< user defined
/** Empty arrangement (no arrangement)
*
*/
kSpeakerArrEmpty = -1,
/** M
*
*/
kSpeakerArrMono = 0,
/** L R
*
*/
kSpeakerArrStereo,
/** Ls Rs
*
*/
kSpeakerArrStereoSurround,
/** Lc Rc
*
*/
kSpeakerArrStereoCenter,
/** Sl Sr
*
*/
kSpeakerArrStereoSide,
/** C Lfe
*
*/
kSpeakerArrStereoCLfe,
/** L R C
*
*/
kSpeakerArr30Cine,
/** L R S
*
*/
kSpeakerArr30Music,
/** L R C Lfe
*
*/
kSpeakerArr31Cine,
/** L R Lfe S
*
*/
kSpeakerArr31Music,
/** L R C S (LCRS)
*
*/
kSpeakerArr40Cine,
/** L R Ls Rs (Quadro)
*
*/
kSpeakerArr40Music,
/** L R C Lfe S (LCRS+Lfe)
*
*/
kSpeakerArr41Cine,
/** L R Lfe Ls Rs (Quadro+Lfe)
*
*/
kSpeakerArr41Music,
/** L R C Ls Rs
*
*/
kSpeakerArr50,
/** L R C Lfe Ls Rs
*
*/
kSpeakerArr51,
/** L R C Ls Rs Cs
*
*/
kSpeakerArr60Cine,
/** L R Ls Rs Sl Sr
*
*/
kSpeakerArr60Music,
/** L R C Lfe Ls Rs Cs
*
*/
kSpeakerArr61Cine,
/** L R Lfe Ls Rs Sl Sr
*
*/
kSpeakerArr61Music,
/** L R C Ls Rs Lc Rc
*
*/
kSpeakerArr70Cine,
/** L R C Ls Rs Sl Sr
*
*/
kSpeakerArr70Music,
/** L R C Lfe Ls Rs Lc Rc
*
*/
kSpeakerArr71Cine,
/** L R C Lfe Ls Rs Sl Sr
*
*/
kSpeakerArr71Music,
/** L R C Ls Rs Lc Rc Cs
*
*/
kSpeakerArr80Cine,
/** L R C Ls Rs Cs Sl Sr
*
*/
kSpeakerArr80Music,
/** L R C Lfe Ls Rs Lc Rc Cs
*
*/
kSpeakerArr81Cine,
/** L R C Lfe Ls Rs Cs Sl Sr
*
*/
kSpeakerArr81Music,
/** L R C Lfe Ls Rs Tfl Tfc Tfr Trl Trr Lfe2
*
*/
kSpeakerArr102,
/** The overall number of arrangements
*
*/
kNumSpeakerArr
};
/**
* Flags used in VstOfflineTask structure
* @see VstOfflineTask
*/
enum VstOfflineTaskFlags
{
/** Unalid parameter, set by host
*
*/
kVstOfflineUnvalidParameter = 1 << 0,
/** New file, set by host
*
*/
kVstOfflineNewFile = 1 << 1,
/** Plug error, set by plugin
*
*/
kVstOfflinePlugError = 1 << 10,
/** Interleaved Audio, set by plugin
*
*/
kVstOfflineInterleavedAudio = 1 << 11,
/** Temporary output file, set by plugin
*
*/
kVstOfflineTempOutputFile = 1 << 12,
/** Float output file, set by plugin
*
*/
kVstOfflineFloatOutputFile = 1 << 13,
/** Random write, set by plugin
*
*/
kVstOfflineRandomWrite = 1 << 14,
/** Offline stretch, set by plugin
*
*/
kVstOfflineStretch = 1 << 15,
/** Offline no thread, set by plugin
*
*/
kVstOfflineNoThread = 1 << 16
};
/**
* Option passed to audioMasterOfflineRead/audioMasterOfflineWrite
* @see audioMasterOfflineRead
* @see audioMasterOfflineWrite
*/
enum VstOfflineOption
{
/** Reading/writing audio samples
*
*/
kVstOfflineAudio,
/** Reading graphic representation
*
*/
kVstOfflinePeaks,
/** Reading/writing parameters
*
*/
kVstOfflineParameter,
/** Reading/writing marker
*
*/
kVstOfflineMarker,
/** Reading/moving edit cursor
*
*/
kVstOfflineCursor,
/** Reading/changing selection
*
*/
kVstOfflineSelection,
/** To request the host to call asynchronously effOfflineNotify
* @see effOfflineNotify
*/
kVstOfflineQueryFiles
};
/**
* Flags used in VstAudioFile
* @see VstAudioFile
*/
enum VstAudioFileFlags
{
/** Offline read-only, set by host in call effOfflineNotify
* @see effOfflineNotify
*/
kVstOfflineReadOnly = 1 << 0,
/** Offline no rate conversion, set by host in call effOfflineNotify
* @see effOfflineNotify
*/
kVstOfflineNoRateConversion = 1 << 1,
/** Offline no channel change, set by host in call effOfflineNotify
* @see effOfflineNotify
*/
kVstOfflineNoChannelChange = 1 << 2,
/** Offline can process selection, set by plugin in call audioMasterOfflineStart
* @see audioMasterOfflineStart
*/
kVstOfflineCanProcessSelection = 1 << 10,
/** Offline no crossfade, set by plugin in call audioMasterOfflineStart
* @see audioMasterOfflineStart
*/
kVstOfflineNoCrossfade = 1 << 11,
/** Offline want read, set by plugin in call audioMasterOfflineStart
* @see audioMasterOfflineStart
*/
kVstOfflineWantRead = 1 << 12,
/** Offline want write, set by plugin in call audioMasterOfflineStart
* @see audioMasterOfflineStart
*/
kVstOfflineWantWrite = 1 << 13,
/** Offline want write marker, set by plugin in call audioMasterOfflineStart
* @see audioMasterOfflineStart
*/
kVstOfflineWantWriteMarker = 1 << 14,
/** Offline want move cursor, set by plugin in call audioMasterOfflineStart
* @see audioMasterOfflineStart
*/
kVstOfflineWantMoveCursor = 1 << 15,
/** Offline want select, set by plugin in call audioMasterOfflineStart
* @see audioMasterOfflineStart
*/
kVstOfflineWantSelect = 1 << 16
};
/**
* Platform-independent definition of Virtual Keys used in VstKeyCode.
* @see VstKeyCode
*/
enum VstVirtualKey
{
VKEY_BACK = 1,
VKEY_TAB,
VKEY_CLEAR,
VKEY_RETURN,
VKEY_PAUSE,
VKEY_ESCAPE,
VKEY_SPACE,
VKEY_NEXT,
VKEY_END,
VKEY_HOME,
VKEY_LEFT,
VKEY_UP,
VKEY_RIGHT,
VKEY_DOWN,
VKEY_PAGEUP,
VKEY_PAGEDOWN,
VKEY_SELECT,
VKEY_PRINT,
VKEY_ENTER,
VKEY_SNAPSHOT,
VKEY_INSERT,
VKEY_DELETE,
VKEY_HELP,
VKEY_NUMPAD0,
VKEY_NUMPAD1,
VKEY_NUMPAD2,
VKEY_NUMPAD3,
VKEY_NUMPAD4,
VKEY_NUMPAD5,
VKEY_NUMPAD6,
VKEY_NUMPAD7,
VKEY_NUMPAD8,
VKEY_NUMPAD9,
VKEY_MULTIPLY,
VKEY_ADD,
VKEY_SEPARATOR,
VKEY_SUBTRACT,
VKEY_DECIMAL,
VKEY_DIVIDE,
VKEY_F1,
VKEY_F2,
VKEY_F3,
VKEY_F4,
VKEY_F5,
VKEY_F6,
VKEY_F7,
VKEY_F8,
VKEY_F9,
VKEY_F10,
VKEY_F11,
VKEY_F12,
VKEY_NUMLOCK,
VKEY_SCROLL,
VKEY_SHIFT,
VKEY_CONTROL,
VKEY_ALT,
VKEY_EQUALS
};
/**
* Modifier flags used in VstKeyCode.
* @see VstKeyCode
*/
enum VstModifierKey
{
/** Shift modifier
*
*/
MODIFIER_SHIFT = 1<<0,
/** Alt modifier
*
*/
MODIFIER_ALTERNATE = 1<<1,
/** Ctrl on Mac modifier
*
*/
MODIFIER_COMMAND = 1<<2,
/** Ctrl on PC, Apple on Mac modifier
*
*/
MODIFIER_CONTROL = 1<<3
};
//-------------------------------------------------------------------------------------------------------
// Data structures definition
//-------------------------------------------------------------------------------------------------------
struct AEffect;
/**
* VST processor routine prototypes
*/
typedef VstIntPtr (VSTCALLBACK *audioMasterCallback) (AEffect* effect, VstInt32 opcode, VstInt32 index, VstIntPtr value, void* ptr, float opt);
typedef VstIntPtr (VSTCALLBACK *AEffectDispatcherProc) (AEffect* effect, VstInt32 opcode, VstInt32 index, VstIntPtr value, void* ptr, float opt);
typedef void (VSTCALLBACK *AEffectProcessProc) (AEffect* effect, float** inputs, float** outputs, VstInt32 sampleFrames);
typedef void (VSTCALLBACK *AEffectProcessDoubleProc) (AEffect* effect, double** inputs, double** outputs, VstInt32 sampleFrames);
typedef void (VSTCALLBACK *AEffectSetParameterProc) (AEffect* effect, VstInt32 index, float parameter);
typedef float (VSTCALLBACK *AEffectGetParameterProc) (AEffect* effect, VstInt32 index);
/** Basic VST Effect interface structure
*
*/
typedef struct AEffect
{
/** The magic number that allows to identify VST 2.x effect, should be kEffectMagic ('VstP')
*
*/
VstInt32 magic;
/** Host to Plug-in event dispatcher
*
*/
AEffectDispatcherProc dispatcher;
/** Accumulating process mode method
* @deprecated since VST 2.4
*
*/
AEffectProcessProc process;
/** Assign new value to automatable parameter
* Parameters are the individual parameter settings the user can adjust.
* A VST Host can automate these parameters.
*
* Parameter values, like all VST parameters, are declared as floats with an inclusive range of
* 0.0 to 1.0. How data is presented to the user is merely in the user-interface handling. This is a
* convention, but still worth regarding. Maybe the VST-Host's automation system depends on this range.
*
* @param index parameter index
* @param parameter parameter value between 0.0 and 1.0 inclusive
*
*/
AEffectSetParameterProc setParameter;
/** Return current value of automatable parameter
* @param index parameter index
* @return parameter value in range between 0.0 and 1.0 inclusive
*
*/
AEffectGetParameterProc getParameter;
/** Number of programs
*
*/
VstInt32 numPrograms;
/** The number of parameters for program.
* All programs are assumed to have equal number of parameters
*
*/
VstInt32 numParams;
/** Number of audio inputs
*
*/
VstInt32 numInputs;
/** Number of audio outputs
*
*/
VstInt32 numOutputs;
/** Additional processor flags
* @see VstAEffectFlags
*/
VstInt32 flags;
/** Parameters reserved for a host, should be zeroed
*
*/
VstIntPtr __pad1;
VstIntPtr __pad2;
/** The latency value applied to the signal by plugin.
* This value should be initialized in a resume state.
* If this value is changed, the plugin needs to issue
* audioMasterIOChanged signal to the host
*
*/
VstInt32 initialDelay;
/** Unused member
* @deprecated
*/
VstInt32 realQualities;
/** Unused member
* @deprecated
*/
VstInt32 offQualities;
/** Unused member
* @deprecated
*/
float ioRatio;
/** Pointer to the wrapper object
*
*/
void *object;
/** The user-defined pointer
*
*/
void *user;
/** Unique plugin identifier, should be registered on this form:
* http://service.steinberg.de/databases/plugin.nsf/plugIn?openForm
* This is used to identify a plug-in during save+load of preset and project.
*
* The Host uses this to identify the plug-in, for instance when it is loading
* effect programs and banks. On Steinberg Web Page you can find an UniqueID Database
* where you can record your UniqueID, it will check if the ID is already used by an
* another vendor. You can use CCONST('a','b','c','d') (defined in VST 2.0) to be
* platform independent to initialize an UniqueID.
*/
VstInt32 uniqueID;
/** Plugin version: 1.1.0.0 should be encoded as 1100
*
*/
VstInt32 version;
/** Process audio samples in replacing mode, the main processing method
*
* @warning Never call any Mac OS 9 functions (or other functions which call into the OS) inside your
* audio process function! This will crash the system when your plug-in is run in MP (multiprocessor) mode.
* If you must call into the OS, you must use MPRemoteCall () (see Apples' documentation), or
* explicitly use functions which are documented by Apple to be MP safe. On Mac OS X read the system
* header files to be sure that you only call thread safe functions.
*/
AEffectProcessProc processReplacing;
/** The same as processReplacing but operates with double-precision floating point samples
* @since VST 2.4
*/
AEffectProcessDoubleProc processDoubleReplacing;
/** Reserved for future use, should be zeroed
*
*/
char reserved[56];
} AEffect;
/** Plugin parameter properties used in effGetParameterProperties
* @see effGetParameterProperties
*
*/
typedef struct VstParameterProperties
{
/** Float step
*
*/
float stepFloat;
/** Small float step
*
*/
float smallStepFloat;
/** Large float step
*
*/
float largeStepFloat;
/** Parameter label
*
*/
char label[kVstMaxLabelLen];
/** Parameter flags
* @see VstParameterFlags
*/
VstInt32 flags;
/** minimum integer value
*
*/
VstInt32 minInteger;
/** Maximum integer value
*
*/
VstInt32 maxInteger;
/** Step of the integer value
*
*/
VstInt32 stepInteger;
/** Large step of the integer value
*
*/
VstInt32 largeStepInteger;
/** Short label of the parameter,
* SDK recommends 6 characters + delimiter
*/
char shortLabel[kVstMaxShortLabelLen];
/** The following are for remote controller display purposes.
* Index where this parameter should be displayed (starting with 0)
* @note the kVstParameterSupportsDisplayIndex flag must be set.
* Host can scan all parameters, and find out in what order to display them.
*/
int16_t displayIndex;
/** Parameter category: 0 means no category, else it should be group index + 1
* Host can also display the parameter group (category) if supports this feature
* For example:
* +-------------------------+
* | Osc1: |
* | Wave Detune Octave Mod |
* +-------------------------+
* The support of this feature is indicated by kVstParameterSupportsDisplayCategory flag
* @see kVstParameterSupportsDisplayCategory
*/
int16_t category;
/** Number of parameters in category
*
*/
int16_t numParametersInCategory;
/** Reserved, should be zero
*
*/
int16_t reserved;
/** Category label, for example "Osc 1"
*
*/
char categoryLabel[kVstMaxCategLabelLen];
/** Reserved for future use
*
*/
char future[16];
} VstParameterProperties;
/**
* Program (fxp) structure.
* Stored in big-endian format. You have to swap integer
* and floating-point values on Little Endian platforms (Windows, MacIntel)!
*/
typedef struct fxProgram
{
/** The root chunk identifier for program magic number cMagic ('CcnK')
* @see cMagic
*/
VstInt32 chunkMagic;
/** Size of the chunk excluding chunkMagic and byteSize fields
*
*/
VstInt32 byteSize;
/** Type of chunk:
* fMagic ('FxCk') - regular chunk
* chunkPresetMagic ('FPCh') - opaque chunk
* @see fMagic
* @see chunkPresetMagic
*/
VstInt32 fxMagic;
/** Format version, currently 1
*
*/
VstInt32 version;
/** fx unique identifier
*
*/
VstInt32 fxID;
/** fx version
*
*/
VstInt32 fxVersion;
/** Number of parameters
*
*/
VstInt32 numParams;
/** Program name (null-terminated ASCII string)
*
*/
char prgName[28];
/** Program content depending on the fxMagic field
*
*/
union
{
/** Variable sized array with parameter values
*
*/
float params[1];
/** Program chunk data
*
*/
struct
{
/** Size of program data
*
*/
VstInt32 size;
/** Variable sized array with opaque program data
*
*/
char chunk[1];
} data;
} content;
} fxProgram;
/**
* Bank (fxb) structure.
* Stored in big-endian format. You have to swap integer
* and floating-point values on Little Endian platforms (Windows, MacIntel)!
*/
typedef struct fxBank
{
/** Chunk magic number cMagic ('CcnK')
* @see cMagic
*/
VstInt32 chunkMagic;
/** Size of the chunk excluding chunkMagic and byteSize fields
*
*/
VstInt32 byteSize;
/** Magic number of the chunk:
* bankMagic ('FxBk') - regular chunk
* chunkBankMagic ('FBCh') - opaque chunk
* @see bankMagic
* @see chunkBankMagic
*/
VstInt32 fxMagic;
/** Format version (1 or 2)
*
*/
VstInt32 version;
/** FX unique identifier
*
*/
VstInt32 fxID;
/** FX version
*
*/
VstInt32 fxVersion;
/** Number of programs
*
*/
VstInt32 numPrograms;
/** Current program for fxVersion = 2
*
*/
VstInt32 currentProgram;
/** Reserved, should be zero
*
*/
char reserved[124];
/** Bank content depending on fxMagic field
*
*/
union
{
/** Variable number of programs
*
*/
fxProgram programs[1];
/** Bank chunk data
*
*/
struct
{
/** Size of bank data
*
*/
VstInt32 size;
/** Variable sized array with opaque bank data
*
*/
char chunk[1];
} data;
} content;
} fxBank;
/** Generic timestamped VST event
*
*/
typedef struct VstEvent
{
/** Type of event
* @see VstEventTypes
*
*/
VstInt32 type;
/** Size of event excluding type and byteSize
*
*/
VstInt32 byteSize;
/** The offset of the event from the start of the current block
* in samples
*/
VstInt32 deltaFrames;
/** Generic flags, none defined yet
*
*/
VstInt32 flags;
/** Padding bytes, used by various event types
*
*/
char data[16];
} VstEvent;
/** MIDI event
*
*/
typedef struct VstMidiEvent
{
/** Type of event, should be kVstMidiType
* @see kVstMidiType
*/
VstInt32 type;
/** Size of this structure - sizeof (VstMidiEvent)
*
*/
VstInt32 byteSize;
/** The offset of the event from the start of the current block
* in samples
*/
VstInt32 deltaFrames;
/** Flags of the MIDI event
* @see VstMidiEventFlags
*/
VstInt32 flags;
/** The length of the entire note in samples, if available, 0 otherwise.
*
*/
VstInt32 noteLength;
/** Offset (in samples) into note from note start if available, else 0
*
*/
VstInt32 noteOffset;
/** 1-3 MIDI packet bytes.
* midiData[3] is reserved and should be zero
*
*/
char midiData[4];
/** Detune
* -64 to +63 cents; for scales other than 'well-tempered' ('microtuning')
*/
char detune;
/** The velocity of the Note Off event [0, 127]
*
*/
char noteOffVelocity;
/** Reserved for future use
* should be zero
*/
char reserved1;
/** Reserved for future use
* should be zero
*/
char reserved2;
} VstMidiEvent;
/** MIDI Sysex Event
*
*/
typedef struct VstMidiSysexEvent
{
/** Type of event, should be kVstSysexType
* @see kVstSysexType
*/
VstInt32 type;
/** Size of this structure - sizeof (VstMidiSysexEvent)
*
*/
VstInt32 byteSize;
/** sample frames related to the current block start sample position
*
*/
VstInt32 deltaFrames;
/** No flags defined, shluld be zero
*
*/
VstInt32 flags;
/** The size of sysexDump data in bytes
*
*/
VstInt32 dumpBytes;
/** Reserved for future use
* should be zero
*/
VstIntPtr resvd1;
/** The dump of sysex
*
*/
char* sysexDump;
/** Reserved for future use
* should be zero
*/
VstIntPtr resvd2;
} VstMidiSysexEvent;
/** The array of VST events
*
*/
typedef struct VstEvents
{
/** Number of events in array
*
*/
VstInt32 numEvents;
/** Reserved, should be zero
*
*/
VstIntPtr reserved;
/** The variable-size array of pointers to VstEvent
* @see VstEvent
*/
VstEvent* events[2];
} VstEvents;
/** MIDI program description
*
*/
typedef struct MidiProgramName
{
/** 0 or greater: fill struct for this program index
*
*/
VstInt32 thisProgramIndex;
/** Program name
*
*/
char name[kVstMaxNameLen];
/** MIDI program: 0-127, -1 = off
*
*/
char midiProgram;
/** Most-significant byte of MIDI bank: 0-127, -1 = off
*
*/
char midiBankMsb;
/** Least-significant byte of MIDI bank: 0-127, -1 = off
*
*/
char midiBankLsb;
/** Reserved, should be zero
*
*/
char reserved;
/** Index of the parent category, -1 means that there is no parent category
*
*/
VstInt32 parentCategoryIndex;
/** Different flags
* @see VstMidiProgramNameFlags
*/
VstInt32 flags;
} MidiProgramName;
/**
* MIDI Program Category.
*/
typedef struct MidiProgramCategory
{
/** 0 or greater: fill struct for this category index
*
*/
VstInt32 thisCategoryIndex;
/** Name of program category
*
*/
char name[kVstMaxNameLen];
/** Index of parent category, -1 means that there is no parent category
*
*/
VstInt32 parentCategoryIndex;
/** Different flags, currently there are none, should be zero
*
*/
VstInt32 flags;
} MidiProgramCategory;
/**
* MIDI Key Description.
*/
typedef struct MidiKeyName
{
/** 0 or greater: fill struct for this program index.
*
*/
VstInt32 thisProgramIndex;
/** Key number: 0-127. Fill struct for this key number
*
*/
VstInt32 thisKeyNumber;
/** Key name, empty value means regular key names
*
*/
char keyName[kVstMaxNameLen];
/** Reserved, should be zero
*
*/
VstInt32 reserved;
/** Different flags, currently there are none, should be zero
*
*/
VstInt32 flags;
} MidiKeyName;
/** Speaker Properties.
* The origin for azimuth is right (as by math conventions dealing with radians).
* The elevation origin is also right, visualizing a rotation of a circle across the
* -PI..PI axis of the horizontal circle. Thus, an elevation of -PI/2 corresponds
* to bottom, and a speaker standing on the left, and 'beaming' upwards would have
* an azimuth of -PI, and an elevation of PI/2.
* For user interface representation, grads are more likely to be used, and the
* origins will obviously 'shift' accordingly.
*/
typedef struct VstSpeakerProperties
{
/** Azimuth in radians, range: -PI...PI, exception: 10.f for LFE channel
*
*/
float azimuth;
/** Elevation in radians, range: -PI/2...PI/2, exception: 10.f for LFE channel
*
*/
float elevation;
/** Radius in meters, exception: 0.0f for LFE channel
*
*/
float radius;
/** Reserved for future use, should be zero
*
*/
float reserved;
/** For new setups new names should be given (L/R/C... won't do)
*
*/
char name[kVstMaxNameLen];
/** Speaker type
* @see VstSpeakerType
*/
VstInt32 type;
/** Reserved for future use
*
*/
char future[28];
} VstSpeakerProperties;
/**
* Speaker Arrangement
*/
typedef struct VstSpeakerArrangement
{
/** Speaker arrangement type
* @see VstSpeakerArrangementType
*/
VstInt32 type;
/** Number of channels in this speaker arrangement
*
*/
VstInt32 numChannels;
/** Variable sized speaker array
*
*/
VstSpeakerProperties speakers[8];
} VstSpeakerArrangement;
/**
* Pin Properties used in effGetInputProperties and effGetOutputProperties.
* @see effGetInputProperties
* @see effGetOutputProperties
*/
typedef struct VstPinProperties
{
/** Pin name
*
*/
char label[kVstMaxLabelLen];
/** Pin flags
* @see VstPinPropertiesFlags
*/
VstInt32 flags;
/** Pin arrangement type
* @see VstSpeakerArrangementType
*/
VstInt32 arrangementType;
/** Short name for pin properties
* SDK recommended: 6 characters + delimiter
*/
char shortLabel[kVstMaxShortLabelLen];
/** Reserved data for future use, should be zero
*
*/
char future[48];
} VstPinProperties;
/**
* Variable IO for Offline Processing.
*/
typedef struct VstVariableIo
{
/** Array of audio buffers for input data
*
*/
float** inputs;
/** Array of audio buffers for output data
*
*/
float** outputs;
/** Number of input samples for processing
*
*/
VstInt32 numSamplesInput;
/** Number of output samples for processing
*
*/
VstInt32 numSamplesOutput;
/** Pointer to store number of samples actually processed on input
*
*/
VstInt32 *numSamplesInputProcessed;
/** Pointer to store number of samples actually processed on output
*
*/
VstInt32 *numSamplesOutputProcessed;
} VstVariableIo;
/**
* Offline Task Description.
*/
typedef struct VstOfflineTask
{
/** Process name, set by plugin
*
*/
char processName[96];
/** Audio access: read position, set by plugin or host
*
*/
double readPosition;
/** Audio access: write position, set by plugin or host
*
*/
double writePosition;
/** Audio access: read count, set by plugin or host
*
*/
VstInt32 readCount;
/** Audio access: write count, set by plugin or host
*
*/
VstInt32 writeCount;
/** Audio access: input buffer size, set by host
*
*/
VstInt32 sizeInputBuffer;
/** Audio access: output buffer size, set by host
*
*/
VstInt32 sizeOutputBuffer;
/** Audio access: pointer to input buffer, set by host
*
*/
void* inputBuffer;
/** Audio access: pointer to output buffer, set by host
*
*/
void* outputBuffer;
/** Audio access: position to start processing from, set by host
*
*/
double positionToProcessFrom;
/** Audio access: number of frames to process, set by host
*
*/
double numFramesToProcess;
/** Audio access: maximum number of frames to write, set by plugin
*
*/
double maxFramesToWrite;
/** Other data access: extra buffer, set by plugin
*
*/
void* extraBuffer;
/** Audio access: some value, set by plugin or host
*
*/
VstInt32 value;
/** Audio access: some index, set by plugin or host
*
*/
VstInt32 index;
/** File attributes: number of frames in source file, set by host
*
*/
double numFramesInSourceFile;
/** File attributes: sample rate of source file, set by plugin or host
*
*/
double sourceSampleRate;
/** File attributes: sample rate of destination file, set by plugin or host
*
*/
double destinationSampleRate;
/** File attributes: number of channels in source file, set by plugin or host
*
*/
VstInt32 numSourceChannels;
/** File attributes: number of channels in destinatio file, set by plugin or host
*
*/
VstInt32 numDestinationChannels;
/** File attributes: source file format, set by host
*
*/
VstInt32 sourceFormat;
/** File attributes: destination file format, set by plugin
*
*/
VstInt32 destinationFormat;
/** File attributes: output text, set by plugin or host
*
*/
char outputText[512];
/** Progress notification: progress value, set by plugin
*
*/
double progress;
/** File attributes: progress mode, reserved for future use
*
*/
VstInt32 progressMode;
/** File attributes: the corresponding progress text, set by plugin
*
*/
char progressText[100];
/** Offline task flags, set by host and plugin
* @see VstOfflineTaskFlags
*/
VstInt32 flags;
/** Return value, reserved for future use
*
*/
VstInt32 returnValue;
/** Some custom data set and used by host
*
*/
void* hostOwned;
/** Some custom data set and used by plugin
*
*/
void* plugOwned;
/** Reserved for future use, should be zero
*
*/
char future[1024];
} VstOfflineTask;
/**
* Structure passed to effOfflineNotify and effOfflineStart
* @see effOfflineNotify
* @see effOfflineStart
*/
typedef struct VstAudioFile
{
/** Audio file flags
* @see VstAudioFileFlags
*/
VstInt32 flags;
/** Some custom data set and used by host
*
*/
void* hostOwned;
/** Some custom data set and used by plugin
*
*/
void* plugOwned;
/** File title
* @see kVstMaxFileNameLen
*/
char name[kVstMaxFileNameLen];
/** Unique file identifier during a session
*
*/
VstInt32 uniqueId;
/** Sample rate of the file
*
*/
double sampleRate;
/** Number of audio channels in the file (1 = mono, 2 = stereo, etc.)
*
*/
VstInt32 numChannels;
/** Number of frames in the audio file
*
*/
double numFrames;
/** Audio file format, reserved for future use
*
*/
VstInt32 format;
/** Editor curstor position, -1 if there is no such cursor
*
*/
double editCursorPosition;
/** The frame index of first selected frame, -1 if no selection
*
*/
double selectionStart;
/** Number of frame in selection, 0 if no selection
*
*/
double selectionSize;
/** Mask of selected channels, 1 bit per each channel
*
*/
VstInt32 selectedChannelsMask;
/** Number of markers in the file
*
*/
VstInt32 numMarkers;
/** Time ruler unit
*
*/
VstInt32 timeRulerUnit;
/** Offset in time ruler
*
*/
double timeRulerOffset;
/** Tempo (BPM, Beats Per Minute)
*
*/
double tempo;
/** Time signature numerator, for 3/4 it's 3
*
*/
VstInt32 timeSigNumerator;
/** Time signature denominator, for 3/4 it's 4
*
*/
VstInt32 timeSigDenominator;
/** Resolution
*
*/
VstInt32 ticksPerBlackNote;
/** SMPTE frame rate
* @see VstTimeInfo
*/
VstInt32 smpteFrameRate;
/** Reserved for future use, should be zero
*
*/
char future[64];
} VstAudioFile;
/**
* File filter used in VstFileSelect
* @see VstFileSelect
*/
struct VstFileType
{
/** Display name
*
*/
char name[128];
/** Type for MacOS
*
*/
char macType[8];
/** Windows file extension
*
*/
char dosType[8];
/** Unix file extension
*
*/
char unixType[8];
/** MIME type
*
*/
char mimeType1[128];
/** Additional MIME type
*
*/
char mimeType2[128];
#ifdef __cplusplus
inline VstFileType (const char* _name = 0, const char* _macType = 0, const char* _dosType = 0,
const char* _unixType = 0, const char* _mimeType1 = 0, const char* _mimeType2 = 0);
#endif /* __cplusplus */
};
/**
* File Selector Description used in audioMasterOpenFileSelector.
* @see audioMasterOpenFileSelector
*/
struct VstFileSelect
{
/** File selection command
* @see VstFileSelectCommand
*/
VstInt32 command;
/** File selection type
* @see VstFileSelectType
*/
VstInt32 type;
/** Optional: 0 means no creator
*
*/
VstInt32 macCreator;
/** Number of file types
*
*/
VstInt32 nbFileTypes;
/** List of file types
* @see VstFileType
*/
VstFileType* fileTypes;
/** Text to display in file selector's title
*
*/
char title[1024];
/** Initial path
*
*/
char* initialPath;
/** Used with kVstFileLoad and kVstDirectorySelect
* Should be NULL. Host allocates memory, plugin should call closeOpenFileSelector
* @see kVstFileLoad
* @see kVstDirectorySelect
* @see closeOpenFileSelector
*/
char* returnPath;
/** Size of allocated memory for return paths
*
*/
VstInt32 sizeReturnPath;
/** Used with kVstMultipleFilesLoad
* Should be NULL. Host allocates memory, plugin should call closeOpenFileSelector
* @see kVstMultipleFilesLoad
*/
char** returnMultiplePaths;
/** Number of selected paths
*
*/
VstInt32 nbReturnPath;
/** Reserved for usage by the host
*
*/
VstIntPtr reserved;
/** Reserved for future use
*
*/
char future[116];
};
/** Structure used to pass for audioMasterOpenWindow and audioMasterCloseWindow
* @see audioMasterOpenWindow
* @see audioMasterCloseWindow
* @deprecated since VST 2.4
*/
typedef struct VstWindow
{
/** Window title
*
*/
char title[128];
/** The leftmost coordinate of the window
*
*/
int16_t xPos;
/** The topmost coordinate of the window
*
*/
int16_t yPos;
/** The width of the window
*
*/
int16_t width;
/** The height of the window
*
*/
int16_t height;
/** The style of the window
*
*/
VstInt32 style;
/** Parent window handle
*
*/
void* parent;
/** User window handle
*
*/
void* userHandle;
/** Window handle
*
*/
void* winHandle;
/** Reserved for future use
*
*/
char future[104];
} VstWindow;
/** Structure used for effEditKeyUp/effEditKeyDown
* @see effEditKeyUp
* @see effEditKeyDown
*/
typedef struct VstKeyCode
{
/** ASCII character code
*
*/
VstInt32 character;
/** Virtual key
* @see VstVirtualKey
*/
unsigned char virt;
/** Key modifier
* @see VstModifierKey
*/
unsigned char modifier;
} VstKeyCode;
/**
* Audio file marker structure
*/
typedef struct VstAudioFileMarker
{
/** Maker position
*
*/
double position;
/** Maker name
*
*/
char name[32];
/** Maker type
*
*/
VstInt32 type;
/** Maker identifier
*
*/
VstInt32 id;
/** Reserved for future use
*
*/
VstInt32 reserved;
} VstAudioFileMarker;
/** This structure describes bounds of the custom plugin UI editor
*
* @see effEditGetRect
*/
typedef struct ERect
{
/** The top coordinate
*
*/
int16_t top;
/** The left coordinate
*
*/
int16_t left;
/** The bottom coordinate
*
*/
int16_t bottom;
/** The right coordinate
*
*/
int16_t right;
} ERect;
/** Time info structure
*
* @note samplePos: must always be valid, and should not cost a lot to ask for.
* The sample position is ahead of the time displayed to the user. In sequencer
* stop mode, its value does not change. A 32 bit integer is too small for sample
* positions, and it's a double to make it easier to convert between ppq and samples.
*
* @note ppqPos: at tempo 120, 1 quarter makes 1/2 second, so 2.0 ppq translates to 48000
* samples at 48kHz sample rate. 0.25 ppq is one sixteenth note then. if you need something
* like 480ppq, you simply multiply ppq by that scaler.
*
* @note barStartPos: Say we're at bars/beats readout 3.3.3. That's 2 bars + 2 q + 2 sixteenth,
* makes 2 * 4 + 2 + 0.25 = 10.25 ppq. at tempo 120, that's 10.25 * 0.5 = 5.125 seconds,
* times 48000 = 246000 samples.
*
* @note samplesToNextClock: MIDI Clock Resolution (24 per Quarter Note), can be negative the
* distance to the next midi clock (24 ppq, pulses per quarter) in samples. unless samplePos
* falls precicely on a midi clock, this will either be negative such that the previous MIDI
* clock is addressed, or positive when referencing the following (future) MIDI clock.
*
* @see audioMasterGetTime
*/
typedef struct VstTimeInfo
{
//-------------------------------------------------------------------------------------------------------
/** Current position in audio samples (always valid)
*
*/
double samplePos;
/** Current sample rate in Hz (always valid)
*
*/
double sampleRate;
/** System time in nanoseconds (10^-9 seconds)
*
*/
double nanoSeconds;
/** Musical Position, in Quarter Note (1.0 equals 1 Quarter Note)
*
*/
double ppqPos;
/** current Tempo in BPM (Beats Per Minute)
*
*/
double tempo;
/** last Bar Start Position, in Quarter Note
*
*/
double barStartPos;
/** Cycle Start (left locator), in Quarter Note
*
*/
double cycleStartPos;
/** Cycle End (right locator), in Quarter Note
*
*/
double cycleEndPos;
/** Time Signature Numerator (e.g. 3 for 3/4)
*
*/
VstInt32 timeSigNumerator;
/** Time Signature Denominator (e.g. 4 for 3/4)
*
*/
VstInt32 timeSigDenominator;
/** SMPTE offset (in SMPTE subframes (bits; 1/80 of a frame)).
* The current SMPTE position can be calculated using
* samplePos, sampleRate, and smpteFrameRate.
*/
VstInt32 smpteOffset;
/** Frame rate
* @see VstSmpteFrameRate
*/
VstInt32 smpteFrameRate;
/** MIDI Clock Resolution (24 Per Quarter Note),
* can be negative (nearest clock)
*
*/
VstInt32 samplesToNextClock;
/** Time information flags
* @see VstTimeInfoFlags
*/
VstInt32 flags;
} VstTimeInfo;
/** Structure for effBeginLoadBand/effBeginLoadProgram
* @see effBeginLoadBand
* @see effBeginLoadProgram
*/
typedef struct VstPatchChunkInfo
{
/** Format Version, should be 1
*
*/
VstInt32 version;
/** Unique identifier of the plugin
*
*/
VstInt32 pluginUniqueID;
/** Version of the plugin
*
*/
VstInt32 pluginVersion;
/** Number of programs (Bank) or parameters (program)
*
*/
VstInt32 numElements;
/** Reserved for future use
*
*/
char reserved[48];
} VstPatchChunkInfo;
//-------------------------------------------------------------------------------------------------------
// Miscellaneous functions' definition
//-------------------------------------------------------------------------------------------------------
/** Copy character sting to destination location and complete with null-terminating byte
*
* @param dst destination string
* @param src source string
* @param max_len maximum destination string length
* @return pointer to destination string
*/
inline char* vst_strncpy (char* dst, const char* src, size_t max_len)
{
if (max_len <= 0)
return dst;
char* result = strncpy (dst, src, max_len-1);
dst[max_len-1] = '\0';
return result;
}
/** Append character sting to destination location and complete with null-terminating byte
*
* @param dst destination string
* @param src source string
* @param max_len maximum destination string length
* @return pointer to destination string
*/
inline char* vst_strncat (char* dst, const char* src, size_t max_len)
{
if (max_len <= 0)
return dst;
char* result = strncat (dst, src, max_len-1);
dst[max_len-1] = '\0';
return result;
}
/** Initialize file type structure
*
* @param dst structure to initialize
* @param _name file name
* @param _macType extension for MacOS
* @param _dosType extension for Windows
* @param _unixType extension for Unix
* @param _mimeType1 MIME type
* @param _mimeType2 Additional MIME type
*/
inline void vst_init_file_type(
struct VstFileType *dst,
const char* _name, const char* _macType, const char* _dosType,
const char* _unixType, const char* _mimeType1, const char* _mimeType2
)
{
if (_name)
vst_strncpy (dst->name, _name, 127);
else
dst->name[0] = '\0';
if (_macType)
vst_strncpy (dst->macType, _macType, 7);
else
dst->macType[0] = '\0';
if (_dosType)
vst_strncpy (dst->dosType, _dosType, 7);
else
dst->dosType[0] = '\0';
if (_unixType)
vst_strncpy (dst->unixType, _unixType, 7);
else
dst->unixType[0] = '\0';
if (_mimeType1)
vst_strncpy (dst->mimeType1, _mimeType1, 127);
else
dst->mimeType1[0] = '\0';
if (_mimeType2)
vst_strncpy (dst->mimeType2, _mimeType2, 127);
else
dst->mimeType2[0] = '\0';
}
// Only C++ specific functions
#ifdef __cplusplus
/** Cast the integer argument to pointer type
*
* @param arg the integer argument
* @return the casted address
*/
template <class T> inline T* FromVstPtr (const VstIntPtr& arg)
{
union
{
VstIntPtr src;
T *dst;
} conv;
conv.src = arg;
return conv.dst;
}
/** Cast pointer type to the integer argument type
*
* @param ptr pointer to cast
* @return
*/
template <class T> inline VstIntPtr ToVstPtr (const T* ptr)
{
union
{
const T *src;
VstIntPtr dst;
} conv;
conv.src = ptr;
return conv.dst;
}
inline VstFileType::VstFileType(
const char* _name, const char* _macType, const char* _dosType,
const char* _unixType, const char* _mimeType1, const char* _mimeType2
)
{
vst_init_file_type(this, _name, _macType, _dosType, _unixType, _mimeType1, _mimeType2);
}
#endif /** __cplusplus **/
//-------------------------------------------------------------------------------------------------------
// Main function definition
//-------------------------------------------------------------------------------------------------------
/** Main routine prototype
*
* @param audioMaster audio master callback interface
* @return plugin instance
*/
VST_C_EXTERN typedef AEffect* (*VstPluginMainProc)(audioMasterCallback audioMaster);
/** Main routine macro alias
*
* @param audioMaster audio master callback parameter
* @return
*/
#define VST_MAIN(audioMaster) VST_EXPORT AEffect* VSTPluginMain(audioMasterCallback audioMaster)
//-------------------------------------------------------------------------------------------------------
// Restore compilation options
//-------------------------------------------------------------------------------------------------------
#if TARGET_API_MAC_CARBON
#pragma options align=reset
#elif defined(WIN32) || defined(__FLAT__) || defined(__GNUC__)
#pragma pack(pop)
#elif defined __BORLANDC__
#pragma -a-
#endif
#endif /* _3RDPARTY_STEINBERG_VST2_H_ */
|