iPlug2 - C++ Audio Plug-in Framework
Loading...
Searching...
No Matches
IPlugAU_ioconfig.h
1/*
2 ==============================================================================
3
4 This file is part of the iPlug 2 library. Copyright (C) the iPlug 2 developers.
5
6 See LICENSE.txt for more info.
7
8 ==============================================================================
9*/
10
11#ifndef CUSTOM_BUSTYPE_FUNC
12
13BEGIN_IPLUG_NAMESPACE
14
15static uint64_t GetAPIBusTypeForChannelIOConfig(int configIdx, ERoute dir, int busIdx, const IOConfig* pConfig, WDL_TypedBuf<uint64_t>* APIBusTypes)
16{
17 assert(pConfig != nullptr);
18 assert(busIdx >= 0 && busIdx < pConfig->NBuses(dir));
19
20 int numChans = pConfig->GetBusInfo(dir, busIdx)->NChans();
21
22 switch (numChans)
23 {
24 case 0:
25 APIBusTypes->Add(kAudioChannelLayoutTag_UseChannelDescriptions | 0);
26 break;
27 case 1:
28 APIBusTypes->Add(kAudioChannelLayoutTag_Mono);
29 break;
30 case 2:
31// APIBusTypes->Add(kAudioChannelLayoutTag_Binaural);
32 APIBusTypes->Add(kAudioChannelLayoutTag_Stereo);
33 break;
34 case 3:
35 APIBusTypes->Add(kAudioChannelLayoutTag_ITU_3_0 | 3);
36 break;
37 case 4:
38 // by default support any 4 channel layout
39 APIBusTypes->Add(kAudioChannelLayoutTag_AudioUnit_4);
40 APIBusTypes->Add(kAudioChannelLayoutTag_Ambisonic_B_Format);
41 APIBusTypes->Add(kAudioChannelLayoutTag_HOA_ACN_SN3D | 4);
42 break;
43 case 5:
44 APIBusTypes->Add(kAudioChannelLayoutTag_AudioUnit_5_0);
45 break;
46 case 6:
47 // by default support any 6 channel layout
48 APIBusTypes->Add(kAudioChannelLayoutTag_AudioUnit_5_1);
49 APIBusTypes->Add(kAudioChannelLayoutTag_AudioUnit_6_0);
50 break;
51 case 7:
52 // by default support any 7 channel layout
53 APIBusTypes->Add(kAudioChannelLayoutTag_AudioUnit_6_1);
54 APIBusTypes->Add(kAudioChannelLayoutTag_AudioUnit_7_0);
55 APIBusTypes->Add(kAudioChannelLayoutTag_AudioUnit_7_1_Front);
56 break;
57 case 8:
58 // by default support any 8 channel layout
59 APIBusTypes->Add(kAudioChannelLayoutTag_AudioUnit_7_1);
60 APIBusTypes->Add(kAudioChannelLayoutTag_AudioUnit_7_1_Front);
61 break;
62#if defined (MAC_OS_VERSION_11_0)
63 case 10:
64 // Atmos 7.1.2
65 APIBusTypes->Add(kAudioChannelLayoutTag_Atmos_7_1_2);
66 break;
67 case 12:
68 // Atmos 7.1.4
69 APIBusTypes->Add(kAudioChannelLayoutTag_Atmos_7_1_4);
70 break;
71#endif //MAC_OS_VERSION_11_0
72 case 9:
73 case 16: // 2nd and 3rd order ambisonics
74 APIBusTypes->Add(kAudioChannelLayoutTag_HOA_ACN_SN3D | numChans);
75 break;
76 default:
77 APIBusTypes->Add(kAudioChannelLayoutTag_DiscreteInOrder | numChans);
78 break;
79 }
80 return 0; // AU can return multiple types
81}
82
83END_IPLUG_NAMESPACE
84
85#else
86extern uint64_t GetAPIBusTypeForChannelIOConfig(int configIdx, iplug::ERoute dir, int busIdx, const iplug::IOConfig* pConfig, WDL_TypedBuf<uint64_t>* APIBusTypes);
87#endif //CUSTOM_BUSTYPE_FUNC
88
ERoute
Used to identify whether a bus/channel connection is an input or an output.
An IOConfig is used to store bus info for each input/output configuration defined in the channel io s...
Definition: IPlugStructs.h:504
const IBusInfo * GetBusInfo(ERoute direction, int index) const
Definition: IPlugStructs.h:526