36 for (
size_t i = 0; i < letters.
size(); ++i)
38 if (
const auto index = findIndexOfChar (letters[i]))
49 if (indices.
size() <= index)
53 copy.indices[index] += increment;
55 if ((
size_t)
std::size (validChars) <= copy.indices[index])
61 int32 getPluginId()
const
65 for (
size_t i = 0; i < indices.
size(); ++i)
66 result |=
static_cast<int32> (validChars[indices[i]]) << (8 * (indices.
size() - 1 - i));
79 static inline constexpr char validChars[] =
"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
82 : indices (std::move (indicesIn))
126 bool idForAudioSuite)
const
130 auto opt = idForAudioSuite ? AAXPluginId::create ({
'j',
'y',
'a',
'a' })
131 : AAXPluginId::create ({
'j',
'c',
'a',
'a' });
136 for (
const auto& [channelSet, indexToModify] : {
std::tuple (&mainInputLayout, (
size_t) 2),
144 if (
auto modifiedPluginIdOpt = pluginId.withIncrementedLetter (indexToModify, increment);
145 increment < (
size_t)
std::size (channelSets) && modifiedPluginIdOpt.has_value())
147 pluginId = *modifiedPluginIdOpt;
155 return pluginId.getPluginId();
160 #ifdef JucePlugin_AAXPageTableFile
161 JUCE_COMPILER_WARNING (
"JucePlugin_AAXPageTableFile is deprecated, instead implement AAXClientExtensions::getPageFileName()")
162 return JucePlugin_AAXPageTableFile;
176 for (
size_t i = 0; i < result.
size(); ++i)
177 result[i] =
static_cast<char> ((identifier >> (i * 8)) & 0xff);
182static bool isValidAAXPluginId (
int32 pluginId)
184 const auto chars = toCharArray (pluginId);
190 return AAXPluginId::findIndexOfChar (c).has_value();
194static int32 getPluginIDForMainBusConfigJuce705 (
const AudioChannelSet& mainInputLayout,
195 const AudioChannelSet& mainOutputLayout,
196 bool idForAudioSuite)
198 int uniqueFormatId = 0;
200 for (
int dir = 0; dir < 2; ++dir)
202 const bool isInput = (dir == 0);
203 auto& set = (isInput ? mainInputLayout : mainOutputLayout);
204 int aaxFormatIndex = 0;
206 const AudioChannelSet sets[]
248 aaxFormatIndex = index;
252 uniqueFormatId = (uniqueFormatId << 8) | aaxFormatIndex;
255 return (idForAudioSuite ? 0x6a796161 : 0x6a636161 ) + uniqueFormatId;
258class AAXClientExtensionsTests final :
public UnitTest
261 AAXClientExtensionsTests()
262 : UnitTest (
"AAXClientExtensionsTests", UnitTestCategories::audioProcessors)
265 void runTest()
override
267 AAXClientExtensions extensions;
269 beginTest (
"Previously valid PluginIds should be unchanged");
271 for (
const auto& input : channelSets)
272 for (const auto& output : channelSets)
273 for (const auto idForAudioSuite : {
false,
true })
274 if (
const auto oldId = getPluginIDForMainBusConfigJuce705 (input, output, idForAudioSuite); isValidAAXPluginId (oldId))
275 expect (extensions.getPluginIDForMainBusConfig (input, output, idForAudioSuite) == oldId);
278 beginTest (
"Valid, unique PluginIds should be generated for all configurations");
282 for (
const auto& input : channelSets)
283 for (const auto& output : channelSets)
284 for (const auto idForAudioSuite : {
false,
true })
285 pluginIds.
insert (extensions.getPluginIDForMainBusConfig (input, output, idForAudioSuite));
287 for (
auto identifier : pluginIds)
288 expect (isValidAAXPluginId (identifier));
295static AAXClientExtensionsTests aaxClientExtensionsTests;
Represents a set of audio channel types.
static AudioChannelSet JUCE_CALLTYPE create7point1()
Creates a set for a DTS 7.1 surround setup (left, right, centre, leftSurroundSide,...
static AudioChannelSet JUCE_CALLTYPE quadraphonic()
Creates a set for quadraphonic surround setup (left, right, leftSurround, rightSurround)
static AudioChannelSet JUCE_CALLTYPE create5point0point2()
Creates a set for a 5.0.2 surround setup (left, right, centre, leftSurround, rightSurround,...
static AudioChannelSet JUCE_CALLTYPE create5point0()
Creates a set for a 5.0 surround setup (left, right, centre, leftSurround, rightSurround).
static AudioChannelSet JUCE_CALLTYPE create9point0point4()
Creates a set for a 9.0.4 surround setup (left, right, centre, leftSurroundSide, rightSurroundSide,...
static AudioChannelSet JUCE_CALLTYPE create6point0()
Creates a set for a 6.0 Cine surround setup (left, right, centre, leftSurround, rightSurround,...
static AudioChannelSet JUCE_CALLTYPE create5point0point4()
Creates a set for a 5.0.4 surround setup (left, right, centre, leftSurround, rightSurround,...
static AudioChannelSet JUCE_CALLTYPE create5point1point4()
Creates a set for a 5.1.4 surround setup (left, right, centre, LFE, leftSurround, rightSurround,...
static AudioChannelSet JUCE_CALLTYPE disabled()
Creates a zero-channel set which can be used to indicate that a bus is disabled.
static AudioChannelSet JUCE_CALLTYPE mono()
Creates a one-channel mono set (centre).
static AudioChannelSet JUCE_CALLTYPE create7point0point4()
Creates a set for Dolby Atmos 7.0.4 surround setup (left, right, centre, leftSurroundSide,...
static AudioChannelSet JUCE_CALLTYPE stereo()
Creates a set containing a stereo set (left, right).
static AudioChannelSet JUCE_CALLTYPE create6point1()
Creates a set for a 6.1 Cine surround setup (left, right, centre, leftSurround, rightSurround,...
static AudioChannelSet JUCE_CALLTYPE create9point1point4()
Creates a set for a 9.1.4 surround setup (left, right, centre, LFE, leftSurroundSide,...
static AudioChannelSet JUCE_CALLTYPE create9point0point6()
Creates a set for a 9.0.6 surround setup (left, right, centre, LFE, leftSurroundSide,...
static AudioChannelSet JUCE_CALLTYPE create5point1()
Creates a set for a 5.1 surround setup (left, right, centre, leftSurround, rightSurround,...
static AudioChannelSet JUCE_CALLTYPE create7point0SDDS()
Creates a set for a SDDS 7.0 surround setup (left, right, centre, leftSurround, rightSurround,...
static AudioChannelSet JUCE_CALLTYPE create5point1point2()
Creates a set for a 5.1.2 surround setup (left, right, centre, LFE, leftSurround, rightSurround,...
static AudioChannelSet JUCE_CALLTYPE create9point1point6()
Creates a set for a 9.1.6 surround setup (left, right, centre, LFE, leftSurroundSide,...
static AudioChannelSet JUCE_CALLTYPE create7point0point2()
Creates a set for Dolby Atmos 7.0.2 surround setup (left, right, centre, leftSurroundSide,...
static AudioChannelSet JUCE_CALLTYPE create7point1SDDS()
Creates a set for a 7.1 surround setup (left, right, centre, leftSurround, rightSurround,...
static AudioChannelSet JUCE_CALLTYPE create7point0()
Creates a set for a DTS 7.0 surround setup (left, right, centre, leftSurroundSide,...
static AudioChannelSet JUCE_CALLTYPE ambisonic(int order=1)
Creates a set for ACN, SN3D normalised ambisonic surround setups with a given order.
static AudioChannelSet JUCE_CALLTYPE createLCRS()
Creates a set containing an LCRS set (left, right, centre, surround).
static AudioChannelSet JUCE_CALLTYPE create7point1point2()
Creates a set for Dolby Atmos 7.1.2 surround setup (left, right, centre, leftSurroundSide,...
static AudioChannelSet JUCE_CALLTYPE create7point0point6()
Creates a set for 7.0.6 surround setup (left, right, centre, leftSurroundSide, rightSurroundSide,...
static AudioChannelSet JUCE_CALLTYPE create7point1point6()
Creates a set for Dolby Atmos 7.1.6 surround setup (left, right, centre, leftSurroundSide,...
static AudioChannelSet JUCE_CALLTYPE createLCR()
Creates a set containing an LCR set (left, right, centre).
static AudioChannelSet JUCE_CALLTYPE create7point1point4()
Creates a set for Dolby Atmos 7.1.4 surround setup (left, right, centre, leftSurroundSide,...
T make_optional(T... args)
signed int int32
A platform-independent 32-bit signed integer type.
constexpr NumericType square(NumericType n) noexcept
Returns the square of its argument.
virtual int32 getPluginIDForMainBusConfig(const AudioChannelSet &mainInputLayout, const AudioChannelSet &mainOutputLayout, bool idForAudioSuite) const
AAX plug-ins need to report a unique "plug-in id" for every audio layout configuration that your Audi...
virtual String getPageFileName() const
Returns an optional filename (including extension) for a page file to be used.