| AAX SDK 2.6.1 Avid Audio Extensions Development Kit

- Welcome
- Manual
- Classes
- Files
- Lists
- Support

- File List
- File Members

Loading...
Searching...
No Matches
AAX_StringUtilities.hpp
Go to the documentation of this file.
1/*================================================================================================*/
2/*
3 * Copyright 2014-2017, 2019-2021, 2023 Avid Technology, Inc.
4 * All rights reserved.
5 *
6 * CONFIDENTIAL: this document contains confidential information of Avid. Do
7 * not disclose to any third party. Use of the information contained in this
8 * document is subject to an Avid SDK license.
9 */
10/*================================================================================================*/
11
12#ifndef AAXLibrary_AAX_StringUtilities_hpp
13#define AAXLibrary_AAX_StringUtilities_hpp
14
15#include "AAX_IString.h"
16#include "AAX_Errors.h"
17#include "AAX_Assert.h"
18
19#include <cstdlib>
20#include <cstring>
21
22#include <algorithm>
23#include <sstream>
24#include <string>
25#include <vector>
26
27//===========================================================================
28//
29// FloatToString: Convert the given floating point number to a pascal string.
30//
31//===========================================================================
32/*
33 void FloatToString(float aNumber, StringPtr aString)
34{
35 Str255 MantissaStr;
36 double aDouble;
37 StringPtr tempStr;
38 int32_t mantissa,tens,hundreds;
39 int16_t count;
40
41 aDouble = (double) aNumber;
42 if (aNumber < 0.0) // take abs value
43 aDouble = -aDouble;
44
45 aDouble += 0.005; // perform rounding by adding 1/2 of the hundreths digit
46
47 mantissa = aDouble;
48 tens = (aDouble * 10.0) - (mantissa * 10.0);
49 hundreds = (aDouble * 100.0) - (mantissa * 100.0) - (tens * 10.0);
50
51 NumToString(mantissa, MantissaStr);
52
53 // set up string length
54 if (aNumber < 0.0)
55 *aString++ = (char) (1 + 3 + *MantissaStr);
56 else
57 *aString++ = (char) (3 + *MantissaStr);
58
59 tempStr = MantissaStr;
60
61 // copy mantissa first
62 count = *tempStr++;
63
64 if (aNumber < 0.0)
65 *aString++ = '-';
66
67 while (count--)
68 *aString++ = *tempStr++;
69
70 *aString++ = '.';
71 *aString++ = (char) (tens + '0');
72 *aString++ = (char) (hundreds + '0');
73}
74*/
75
77//
78// GetCStringOfLength
79//
80// A routine for selecting a string based on the size passed in
81// by the client. If none of the strings are short enough then
82// the shortest string is truncated to fit.
83//
84// stringIn="A Very Nice String\nA String\nAStrng\nStr\n";
85//
86// Submitted from Erik Gavriluk of BombFactory (Free of Charge)
87// Debugged and separator character changed by Frederick Umminger
88//===============================================================
89
90 void AAX::GetCStringOfLength(char *s_out, const char* s_in, int32_t aMaxChars)
91{
92 AAX_ASSERT(0 < aMaxChars);
93
94 const char kSeparator = '\n';
95
96 if(s_in)
97 {
98 const char* s_begin = s_in;
99 const char* s_end = s_begin;
100 while(s_begin)
101 {
102 // Count characters in current substring
103 while((*s_end != kSeparator) && (*s_end != '\0'))
104 {
105 s_end++;
106 };
107
108 // If substring is less than or equal to aMaxChars then use it.
109 if((s_end-s_begin <= aMaxChars) || (*s_end=='\0'))
110 {
111 break;
112 }
113
114 s_begin = ++s_end;
115 }
116 // We don't use strncpy in order to make sure a '\0' gets put on the end of s_out
117 *s_out = '\0';
118 const int32_t length = int32_t(s_end-s_begin);
119 if (0 < length && 0 < aMaxChars)
120 {
121 std::strncat(s_out, s_begin, static_cast<std::size_t>(std::max<int32_t>(0, std::min<int32_t>(aMaxChars,length))));
122 }
123 }
124 else if (0 < aMaxChars)
125 {
126 strncpy(s_out, "", static_cast<size_t>(aMaxChars));
127 };
128}
129
130int32_t AAX::Caseless_strcmp(const char* cs, const char* ct)
131{
132 if(cs)
133 {
134 if(ct)
135 {
136 while(*cs && *ct)
137 {
138 int32_t cmp = toupper(*ct++) - toupper(*cs++);
139 if(cmp) return cmp;
140 };
141 if(*cs)
142 {
143 return -1;
144 }
145 else
146 {
147 if(*ct)
148 {
149 return 1;
150 }
151 else
152 {
153 return 0;
154 };
155 };
156 }
157 else
158 {
159 return -1;
160 };
161 }
162 else
163 {
164 if(ct)
165 return 1;
166 else
167 return 0;
168 }
169
170}
171
172
173std::string AAX::Binary2String(uint32_t value, int32_t numBits)
174{
175 std::string s;
176
177 uint32_t currentBitMask = (static_cast<uint32_t>(0x1) << (numBits-1));
178
179 while (currentBitMask != 0)
180 {
181 if (currentBitMask & value)
182 {
183 s += "1";
184 }
185 else
186 {
187 s += "0";
188 };
189 currentBitMask >>= 1;
190 }
191 return s;
192}
193
194uint32_t AAX::String2Binary(const AAX_IString& s)
195{
196 uint32_t value = 0;
197
198 const char* const cS = s.Get();
199 int32_t length = int32_t(s.Length());
200 for(int32_t i = 0; i < length ; i++)
201 {
202 switch(cS[i])
203 {
204 case '0':
205 break;
206 case '1':
207 value |= (0x1 << (length-1-i));
208 break;
209 default:
210 AAX_ASSERT('0' == cS[i] || '1' == cS[i]);
211 };
212 };
213
214 return value;
215}
216
217 bool AAX::IsASCII(char inChar)
218{
219 return (0x20 <= inChar) && (0x7E >= inChar);
220}
221
222 bool AAX::IsFourCharASCII(uint32_t inFourChar)
223{
224 const uint32_t oneCharMask = 0x000000FF;
225 const size_t oneCharNumBits = 8;
226
227 bool result = true;
228 for (uint16_t i = 3; true == result /* i value checked within loop */; --i)
229 {
230 const char curChar = static_cast<const char>((inFourChar >> (i*oneCharNumBits)) & oneCharMask);
231 result = result && IsASCII(curChar);
232 if (0 == i) { break; }
233 }
234 return result;
235}
236
237std::string AAX::AsStringFourChar(uint32_t inFourChar)
238{
239 AAX_CONSTEXPR uint32_t oneCharMask = 0x000000FF;
240 AAX_CONSTEXPR int16_t oneCharNumBits = 8;
241 AAX_CONSTEXPR auto unknownChar = "(?)"; // for current usage, a raw string here is slightly more efficient than a std::string
242
243 std::string resultStr;
244 for (int16_t i = 3; i >= 0; --i)
245 {
246 const char curChar = static_cast<char>((inFourChar >> (i*oneCharNumBits)) & oneCharMask);
247
248 // Prefer an explicit 'if' statement instead of a ternary operator to allow using the most
249 // efficient 'append' operator in each case
250 if (IsASCII(curChar))
251 {
252 resultStr += curChar;
253 }
254 else
255 {
256 resultStr += unknownChar;
257 }
258 }
259 return resultStr;
260}
261
262 namespace AAX { namespace internal {
263 template <typename T>
264std::string ToHexadecimal(T inValue, bool inLeadingZeros = false)
265{
266 AAX_CONSTEXPR char hexChars[] = "0123456789abcdef";
267 AAX_CONSTEXPR size_t size = sizeof(T) * 2;
268
269 std::string buffer{"0"};
270
271 // This conditional is to respect the expected output on 'inValud=0': "0" (instead of "0x0")
272 if (inValue)
273 {
274 buffer += 'x';
275 bool first_non_zero = inLeadingZeros;
276
277 // Largest integers will have 16 hex characters, just below the short-string
278 // optimization of std::string, so no dynamic allocation is required
279 for (size_t i = 0; i < size; ++i)
280 {
281 const auto c = hexChars[(inValue >> 4 * (size - 1 - i)) & 0xf];
282 if (first_non_zero || c != '0')
283 {
284 first_non_zero = true;
285 buffer += c;
286 }
287 }
288 }
289
290 return buffer;
291}
292}}
293
294std::string AAX::AsStringPropertyValue(AAX_EProperty inProperty, AAX_CPropertyValue inPropertyValue)
295{
296 // Attempt to infer a sensible way to print the property
297 if (AAX_eProperty_SampleRate == inProperty ||
298 AAX_eProperty_Constraint_Location == inProperty)
299 {
300 // Print specific properties' values as bitfield
301
302 // We want the exact bits, so we memcpy to avoid any potential issues
303 // with casting from signed to unsigned
304 uint32_t bitfield;
305 memcpy(&bitfield, &inPropertyValue, sizeof(uint32_t));
306
307 AAX_CONSTEXPR int32_t maxNumBitsToShow = 8; // Currently there are no bitfield properties with more than 8 possible flags
308 return AAX::Binary2String(bitfield, maxNumBitsToShow);
309 }
310
311 if (AAX::IsFourCharASCII(static_cast<uint32_t>(inPropertyValue)))
312 {
313 // Print values in ASCII range as four-char
314 return '\'' + AAX::AsStringFourChar(static_cast<uint32_t>(inPropertyValue)) + '\'';
315 }
316
317 if (0x00FFFFFF < abs(inPropertyValue))
318 {
319 // Print values with most bits used as hex
320 return internal::ToHexadecimal(inPropertyValue);
321 }
322
323 // Otherwise, print as simple decimal
324 return std::to_string(static_cast<long int>(inPropertyValue));
325}
326
327std::string AAX::AsStringInt32(int32_t inInt32)
328{
329 return std::to_string((long int)inInt32);
330}
331
332std::string AAX::AsStringUInt32(uint32_t inUInt32)
333{
334 return std::to_string((unsigned long)inUInt32);
335}
336
337std::string AAX::AsStringIDTriad(const AAX_SPlugInIdentifierTriad& inIDTriad)
338{
339 std::string result = "(";
340
341 result += "man: '" + AAX::AsStringFourChar(inIDTriad.mManufacturerID) + "', ";
342 result += "prod: '" + AAX::AsStringFourChar(inIDTriad.mProductID) + "', ";
343 result += "type: '" + AAX::AsStringFourChar(inIDTriad.mPlugInID) + "'";
344
345 result += ")";
346 return result;
347}
348
349std::string AAX::AsStringStemFormat(AAX_EStemFormat inStemFormat, bool inAbbreviate)
350{
351 switch (inStemFormat)
352 {
353 case AAX_eStemFormat_Mono: { return std::string("Mono"); break; }
354 case AAX_eStemFormat_Stereo: { return std::string(inAbbreviate ? "St" : "Stereo"); break; }
355 case AAX_eStemFormat_LCR: { return std::string("LCR"); break; }
356 case AAX_eStemFormat_LCRS: { return std::string("LCRS"); break; }
357 case AAX_eStemFormat_Quad: { return std::string("Quad"); break; }
358 case AAX_eStemFormat_5_0: { return std::string("5.0"); break; }
359 case AAX_eStemFormat_5_1: { return std::string("5.1"); break; }
360 case AAX_eStemFormat_6_0: { return std::string("6.0"); break; }
361 case AAX_eStemFormat_6_1: { return std::string("6.1"); break; }
362 case AAX_eStemFormat_7_0_SDDS: { return std::string(inAbbreviate ? "7.0 S" : "7.0 SDDS"); break; }
363 case AAX_eStemFormat_7_1_SDDS: { return std::string(inAbbreviate ? "7.1 S" : "7.1 SDDS"); break; }
364 case AAX_eStemFormat_7_0_DTS: { return std::string("7.0"); break; }
365 case AAX_eStemFormat_7_1_DTS: { return std::string("7.1"); break; }
366 case AAX_eStemFormat_7_0_2: {return std::string("7.0.2"); break; }
367 case AAX_eStemFormat_7_1_2: { return std::string("7.1.2"); break; }
368 case AAX_eStemFormat_Ambi_1_ACN: { return std::string(inAbbreviate ? "Amb1" : "Ambisonics (1st Order)"); break; }
369 case AAX_eStemFormat_Ambi_2_ACN: { return std::string(inAbbreviate ? "Amb2" : "Ambisonics (2nd Order)"); break; }
370 case AAX_eStemFormat_Ambi_3_ACN: { return std::string(inAbbreviate ? "Amb3" : "Ambisonics (3rd Order)"); break; }
371 case AAX_eStemFormat_Ambi_4_ACN: { return std::string(inAbbreviate ? "Amb4" : "Ambisonics (4th Order)"); break; }
372 case AAX_eStemFormat_Ambi_5_ACN: { return std::string(inAbbreviate ? "Amb5" : "Ambisonics (5th Order)"); break; }
373 case AAX_eStemFormat_Ambi_6_ACN: { return std::string(inAbbreviate ? "Amb6" : "Ambisonics (6th Order)"); break; }
374 case AAX_eStemFormat_Ambi_7_ACN: { return std::string(inAbbreviate ? "Amb7" : "Ambisonics (7th Order)"); break; }
375 case AAX_eStemFormat_5_0_2: { return std::string("5.0.2"); break; }
376 case AAX_eStemFormat_5_1_2: { return std::string("5.1.2"); break; }
377 case AAX_eStemFormat_5_0_4: { return std::string("5.0.4"); break; }
378 case AAX_eStemFormat_5_1_4: { return std::string("5.1.4"); break; }
379 case AAX_eStemFormat_7_0_4: { return std::string("7.0.4"); break; }
380 case AAX_eStemFormat_7_1_4: { return std::string("7.1.4"); break; }
381 case AAX_eStemFormat_7_0_6: { return std::string("7.0.6"); break; }
382 case AAX_eStemFormat_7_1_6: { return std::string("7.1.6"); break; }
383 case AAX_eStemFormat_9_0_4: { return std::string("9.0.4"); break; }
384 case AAX_eStemFormat_9_1_4: { return std::string("9.1.4"); break; }
385 case AAX_eStemFormat_9_0_6: { return std::string("9.0.6"); break; }
386 case AAX_eStemFormat_9_1_6: { return std::string("9.1.6"); break; }
387
388
389 case AAX_eStemFormat_None: { return std::string("None"); break; }
390 case AAX_eStemFormat_Any: { return std::string("Any"); break; }
391
392 case AAX_eStemFormat_INT32_MAX:
393 case AAX_eStemFormatNum:
394 default: { return std::string(inAbbreviate ? "unk" : "unknown stem format"); break; }
395 }
396}
397
398std::string AAX::AsStringStemChannel(AAX_EStemFormat inStemFormat, uint32_t inChannelIndex, bool inAbbreviate)
399{
400 switch (inStemFormat)
401 {
402 case AAX_eStemFormat_Mono:
403 if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "M" : "Audio"); }
404 break;
405 case AAX_eStemFormat_Stereo:
406 if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "L" : "Left"); }
407 if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "R" : "Right"); }
408 break;
409 case AAX_eStemFormat_LCR:
410 if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "L" : "Left"); }
411 if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "C" : "Center"); }
412 if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "R" : "Right"); }
413 break;
414 case AAX_eStemFormat_LCRS:
415 if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "L" : "Left"); }
416 if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "C" : "Center"); }
417 if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "R" : "Right"); }
418 if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "S" : "Surround"); }
419 break;
420 case AAX_eStemFormat_Quad:
421 if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "L" : "Left"); }
422 if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "R" : "Right"); }
423 if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Ls" : "Left Surround"); }
424 if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Rs" : "Right Surround"); }
425 break;
426 case AAX_eStemFormat_5_0:
427 if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "L" : "Left"); }
428 if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "C" : "Center"); }
429 if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "R" : "Right"); }
430 if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Ls" : "Left Surround"); }
431 if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Rs" : "Right Surround"); }
432 break;
433 case AAX_eStemFormat_5_1:
434 if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "L" : "Left"); }
435 if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "C" : "Center"); }
436 if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "R" : "Right"); }
437 if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Ls" : "Left Surround"); }
438 if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Rs" : "Right Surround"); }
439 if (0 == inChannelIndex--) { return std::string("LFE"); }
440 break;
441 case AAX_eStemFormat_6_0:
442 if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "L" : "Left"); }
443 if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "C" : "Center"); }
444 if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "R" : "Right"); }
445 if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Ls" : "Left Surround"); }
446 if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Cs" : "Center Surround"); }
447 if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Rs" : "Right Surround"); }
448 break;
449 case AAX_eStemFormat_6_1:
450 if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "L" : "Left"); }
451 if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "C" : "Center"); }
452 if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "R" : "Right"); }
453 if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Ls" : "Left Surround"); }
454 if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Cs" : "Center Surround"); }
455 if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Rs" : "Right Surround"); }
456 if (0 == inChannelIndex--) { return std::string("LFE"); }
457 break;
458 case AAX_eStemFormat_7_0_SDDS:
459 if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "L" : "Left"); }
460 if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Lc" : "Left Center"); }
461 if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "C" : "Center"); }
462 if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Rc" : "Right Center"); }
463 if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "R" : "Right"); }
464 if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Ls" : "Left Surround"); }
465 if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Rs" : "Right Surround"); }
466 break;
467 case AAX_eStemFormat_7_1_SDDS:
468 if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "L" : "Left"); }
469 if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Lc" : "Left Center"); }
470 if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "C" : "Center"); }
471 if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Rc" : "Right Center"); }
472 if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "R" : "Right"); }
473 if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Ls" : "Left Surround"); }
474 if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Rs" : "Right Surround"); }
475 if (0 == inChannelIndex--) { return std::string("LFE"); }
476 break;
477 case AAX_eStemFormat_7_0_DTS:
478 if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "L" : "Left"); }
479 if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "C" : "Center"); }
480 if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "R" : "Right"); }
481 if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Lss" : "Left Surround Side"); }
482 if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Rss" : "Right Surround Side"); }
483 if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Lsr" : "Left Surround Rear"); }
484 if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Rsr" : "Right Surround Rear"); }
485 break;
486 case AAX_eStemFormat_7_1_DTS:
487 if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "L" : "Left"); }
488 if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "C" : "Center"); }
489 if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "R" : "Right"); }
490 if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Lss" : "Left Surround Side"); }
491 if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Rss" : "Right Surround Side"); }
492 if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Lsr" : "Left Surround Rear"); }
493 if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Rsr" : "Right Surround Rear"); }
494 if (0 == inChannelIndex--) { return std::string("LFE"); }
495 break;
496 case AAX_eStemFormat_7_0_2:
497 if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "L" : "Left"); }
498 if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "C" : "Center"); }
499 if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "R" : "Right"); }
500 if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Lss" : "Left Surround Side"); }
501 if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Rss" : "Right Surround Side"); }
502 if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Lsr" : "Left Surround Rear"); }
503 if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Rsr" : "Right Surround Rear"); }
504 if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "LTS" : "Left Top Surround"); }
505 if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "RTS" : "Right Top Surround"); }
506 break;
507 case AAX_eStemFormat_7_1_2:
508 if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "L" : "Left"); }
509 if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "C" : "Center"); }
510 if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "R" : "Right"); }
511 if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Lss" : "Left Surround Side"); }
512 if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Rss" : "Right Surround Side"); }
513 if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Lsr" : "Left Surround Rear"); }
514 if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Rsr" : "Right Surround Rear"); }
515 if (0 == inChannelIndex--) { return std::string("LFE"); }
516 if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "LTS" : "Left Top Surround"); }
517 if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "RTS" : "Right Top Surround"); }
518 break;
519 case AAX_eStemFormat_Ambi_1_ACN:
520 case AAX_eStemFormat_Ambi_2_ACN:
521 case AAX_eStemFormat_Ambi_3_ACN:
522 case AAX_eStemFormat_Ambi_4_ACN:
523 case AAX_eStemFormat_Ambi_5_ACN:
524 case AAX_eStemFormat_Ambi_6_ACN:
525 case AAX_eStemFormat_Ambi_7_ACN:
526 if (0 == inChannelIndex--) { return std::string("1"); }
527 if (0 == inChannelIndex--) { return std::string("2"); }
528 if (0 == inChannelIndex--) { return std::string("3"); }
529 if (0 == inChannelIndex--) { return std::string("4"); }
530 if (0 == inChannelIndex--) { return std::string("5"); }
531 if (0 == inChannelIndex--) { return std::string("6"); }
532 if (0 == inChannelIndex--) { return std::string("7"); }
533 if (0 == inChannelIndex--) { return std::string("8"); }
534 if (0 == inChannelIndex--) { return std::string("9"); }
535 if (0 == inChannelIndex--) { return std::string("10"); }
536 if (0 == inChannelIndex--) { return std::string("11"); }
537 if (0 == inChannelIndex--) { return std::string("12"); }
538 if (0 == inChannelIndex--) { return std::string("13"); }
539 if (0 == inChannelIndex--) { return std::string("14"); }
540 if (0 == inChannelIndex--) { return std::string("15"); }
541 if (0 == inChannelIndex--) { return std::string("16"); }
542 if (0 == inChannelIndex--) { return std::string("17"); }
543 if (0 == inChannelIndex--) { return std::string("18"); }
544 if (0 == inChannelIndex--) { return std::string("19"); }
545 if (0 == inChannelIndex--) { return std::string("20"); }
546 if (0 == inChannelIndex--) { return std::string("21"); }
547 if (0 == inChannelIndex--) { return std::string("22"); }
548 if (0 == inChannelIndex--) { return std::string("23"); }
549 if (0 == inChannelIndex--) { return std::string("24"); }
550 if (0 == inChannelIndex--) { return std::string("25"); }
551 if (0 == inChannelIndex--) { return std::string("26"); }
552 if (0 == inChannelIndex--) { return std::string("27"); }
553 if (0 == inChannelIndex--) { return std::string("28"); }
554 if (0 == inChannelIndex--) { return std::string("29"); }
555 if (0 == inChannelIndex--) { return std::string("30"); }
556 if (0 == inChannelIndex--) { return std::string("31"); }
557 if (0 == inChannelIndex--) { return std::string("32"); }
558 if (0 == inChannelIndex--) { return std::string("33"); }
559 if (0 == inChannelIndex--) { return std::string("34"); }
560 if (0 == inChannelIndex--) { return std::string("35"); }
561 if (0 == inChannelIndex--) { return std::string("36"); }
562 if (0 == inChannelIndex--) { return std::string("37"); }
563 if (0 == inChannelIndex--) { return std::string("38"); }
564 if (0 == inChannelIndex--) { return std::string("39"); }
565 if (0 == inChannelIndex--) { return std::string("40"); }
566 if (0 == inChannelIndex--) { return std::string("41"); }
567 if (0 == inChannelIndex--) { return std::string("42"); }
568 if (0 == inChannelIndex--) { return std::string("43"); }
569 if (0 == inChannelIndex--) { return std::string("44"); }
570 if (0 == inChannelIndex--) { return std::string("45"); }
571 if (0 == inChannelIndex--) { return std::string("46"); }
572 if (0 == inChannelIndex--) { return std::string("47"); }
573 if (0 == inChannelIndex--) { return std::string("48"); }
574 if (0 == inChannelIndex--) { return std::string("49"); }
575 if (0 == inChannelIndex--) { return std::string("50"); }
576 if (0 == inChannelIndex--) { return std::string("51"); }
577 if (0 == inChannelIndex--) { return std::string("52"); }
578 if (0 == inChannelIndex--) { return std::string("53"); }
579 if (0 == inChannelIndex--) { return std::string("54"); }
580 if (0 == inChannelIndex--) { return std::string("55"); }
581 if (0 == inChannelIndex--) { return std::string("56"); }
582 if (0 == inChannelIndex--) { return std::string("57"); }
583 if (0 == inChannelIndex--) { return std::string("58"); }
584 if (0 == inChannelIndex--) { return std::string("59"); }
585 if (0 == inChannelIndex--) { return std::string("60"); }
586 if (0 == inChannelIndex--) { return std::string("61"); }
587 if (0 == inChannelIndex--) { return std::string("62"); }
588 if (0 == inChannelIndex--) { return std::string("63"); }
589 if (0 == inChannelIndex--) { return std::string("64"); }
590 break;
591 case AAX_eStemFormat_5_0_2:
592 if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "L" : "Left"); }
593 if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "C" : "Center"); }
594 if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "R" : "Right"); }
595 if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Ls" : "Left Surround"); }
596 if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Rs" : "Right Surround"); }
597 if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Ltm" : "Left Top Middle"); }
598 if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Rtm" : "Right Top Middle"); }
599 break;
600 case AAX_eStemFormat_5_1_2:
601 if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "L" : "Left"); }
602 if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "C" : "Center"); }
603 if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "R" : "Right"); }
604 if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Ls" : "Left Surround"); }
605 if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Rs" : "Right Surround"); }
606 if (0 == inChannelIndex--) { return std::string("LFE"); }
607 if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Ltm" : "Left Top Middle"); }
608 if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Rtm" : "Right Top Middle"); }
609 break;
610 case AAX_eStemFormat_5_0_4:
611 if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "L" : "Left"); }
612 if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "C" : "Center"); }
613 if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "R" : "Right"); }
614 if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Ls" : "Left Surround"); }
615 if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Rs" : "Right Surround"); }
616 if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Ltf" : "Left Top Front"); }
617 if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Rtf" : "Right Top Front"); }
618 if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Ltr" : "Left Top Rear"); }
619 if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Rtr" : "Right Top Rear"); }
620 break;
621 case AAX_eStemFormat_5_1_4:
622 if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "L" : "Left"); }
623 if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "C" : "Center"); }
624 if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "R" : "Right"); }
625 if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Ls" : "Left Surround"); }
626 if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Rs" : "Right Surround"); }
627 if (0 == inChannelIndex--) { return std::string("LFE"); }
628 if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Ltf" : "Left Top Front"); }
629 if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Rtf" : "Right Top Front"); }
630 if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Ltr" : "Left Top Rear"); }
631 if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Rtr" : "Right Top Rear"); }
632 break;
633 case AAX_eStemFormat_7_0_4:
634 if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "L" : "Left"); }
635 if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "C" : "Center"); }
636 if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "R" : "Right"); }
637 if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Lss" : "Left Surround Side"); }
638 if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Rss" : "Right Surround Side"); }
639 if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Lsr" : "Left Surround Rear"); }
640 if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Rsr" : "Right Surround Rear"); }
641 if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Ltf" : "Left Top Front"); }
642 if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Rtf" : "Right Top Front"); }
643 if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Ltr" : "Left Top Rear"); }
644 if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Rtr" : "Right Top Rear"); }
645 break;
646 case AAX_eStemFormat_7_1_4:
647 if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "L" : "Left"); }
648 if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "C" : "Center"); }
649 if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "R" : "Right"); }
650 if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Lss" : "Left Surround Side"); }
651 if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Rss" : "Right Surround Side"); }
652 if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Lsr" : "Left Surround Rear"); }
653 if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Rsr" : "Right Surround Rear"); }
654 if (0 == inChannelIndex--) { return std::string("LFE"); }
655 if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Ltf" : "Left Top Front"); }
656 if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Rtf" : "Right Top Front"); }
657 if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Ltr" : "Left Top Rear"); }
658 if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Rtr" : "Right Top Rear"); }
659 break;
660 case AAX_eStemFormat_7_0_6:
661 if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "L" : "Left"); }
662 if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "C" : "Center"); }
663 if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "R" : "Right"); }
664 if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Lss" : "Left Surround Side"); }
665 if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Rss" : "Right Surround Side"); }
666 if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Lsr" : "Left Surround Rear"); }
667 if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Rsr" : "Right Surround Rear"); }
668 if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Ltf" : "Left Top Front"); }
669 if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Rtf" : "Right Top Front"); }
670 if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Ltm" : "Left Top Middle"); }
671 if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Rtm" : "Right Top Middle"); }
672 if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Ltr" : "Left Top Rear"); }
673 if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Rtr" : "Right Top Rear"); }
674 break;
675 case AAX_eStemFormat_7_1_6:
676 if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "L" : "Left"); }
677 if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "C" : "Center"); }
678 if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "R" : "Right"); }
679 if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Lss" : "Left Surround Side"); }
680 if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Rss" : "Right Surround Side"); }
681 if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Lsr" : "Left Surround Rear"); }
682 if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Rsr" : "Right Surround Rear"); }
683 if (0 == inChannelIndex--) { return std::string("LFE"); }
684 if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Ltf" : "Left Top Front"); }
685 if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Rtf" : "Right Top Front"); }
686 if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Ltm" : "Left Top Middle"); }
687 if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Rtm" : "Right Top Middle"); }
688 if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Ltr" : "Left Top Rear"); }
689 if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Rtr" : "Right Top Rear"); }
690 break;
691 case AAX_eStemFormat_9_0_4:
692 if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "L" : "Left"); }
693 if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "C" : "Center"); }
694 if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "R" : "Right"); }
695 if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Lw" : "Left Wide"); }
696 if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Rw" : "Right Wide"); }
697 if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Lss" : "Left Surround Side"); }
698 if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Rss" : "Right Surround Side"); }
699 if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Lsr" : "Left Surround Rear"); }
700 if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Rsr" : "Right Surround Rear"); }
701 if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Ltf" : "Left Top Front"); }
702 if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Rtf" : "Right Top Front"); }
703 if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Ltr" : "Left Top Rear"); }
704 if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Rtr" : "Right Top Rear"); }
705 break;
706 case AAX_eStemFormat_9_1_4:
707 if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "L" : "Left"); }
708 if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "C" : "Center"); }
709 if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "R" : "Right"); }
710 if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Lw" : "Left Wide"); }
711 if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Rw" : "Right Wide"); }
712 if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Lss" : "Left Surround Side"); }
713 if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Rss" : "Right Surround Side"); }
714 if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Lsr" : "Left Surround Rear"); }
715 if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Rsr" : "Right Surround Rear"); }
716 if (0 == inChannelIndex--) { return std::string("LFE"); }
717 if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Ltf" : "Left Top Front"); }
718 if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Rtf" : "Right Top Front"); }
719 if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Ltr" : "Left Top Rear"); }
720 if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Rtr" : "Right Top Rear"); }
721 break;
722 case AAX_eStemFormat_9_0_6:
723 if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "L" : "Left"); }
724 if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "C" : "Center"); }
725 if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "R" : "Right"); }
726 if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Lw" : "Left Wide"); }
727 if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Rw" : "Right Wide"); }
728 if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Lss" : "Left Surround Side"); }
729 if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Rss" : "Right Surround Side"); }
730 if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Lsr" : "Left Surround Rear"); }
731 if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Rsr" : "Right Surround Rear"); }
732 if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Ltf" : "Left Top Front"); }
733 if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Rtf" : "Right Top Front"); }
734 if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Ltm" : "Left Top Middle"); }
735 if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Rtm" : "Right Top Middle"); }
736 if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Ltr" : "Left Top Rear"); }
737 if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Rtr" : "Right Top Rear"); }
738 break;
739 case AAX_eStemFormat_9_1_6:
740 if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "L" : "Left"); }
741 if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "C" : "Center"); }
742 if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "R" : "Right"); }
743 if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Lw" : "Left Wide"); }
744 if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Rw" : "Right Wide"); }
745 if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Lss" : "Left Surround Side"); }
746 if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Rss" : "Right Surround Side"); }
747 if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Lsr" : "Left Surround Rear"); }
748 if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Rsr" : "Right Surround Rear"); }
749 if (0 == inChannelIndex--) { return std::string("LFE"); }
750 if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Ltf" : "Left Top Front"); }
751 if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Rtf" : "Right Top Front"); }
752 if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Ltm" : "Left Top Middle"); }
753 if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Rtm" : "Right Top Middle"); }
754 if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Ltr" : "Left Top Rear"); }
755 if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Rtr" : "Right Top Rear"); }
756 break;
757
758
759 case AAX_eStemFormat_None:
760 break;
761 case AAX_eStemFormat_Any:
762 break;
763
764 case AAX_eStemFormat_INT32_MAX:
765 case AAX_eStemFormatNum:
766 default:
767 break;
768 }
769
770 return std::string(inAbbreviate ? "?" : "unknown");
771}
772
773std::string AAX::AsStringResult(AAX_Result inResult)
774{
775#ifdef DEFINE_AAX_ERROR_STRING
776#undef DEFINE_AAX_ERROR_STRING
777#endif
778#define DEFINE_AAX_ERROR_STRING(X) if (X == inResult) { return std::string(#X); }
779
780 DEFINE_AAX_ERROR_STRING(AAX_SUCCESS);
781 DEFINE_AAX_ERROR_STRING(AAX_ERROR_INVALID_PARAMETER_ID);
782 DEFINE_AAX_ERROR_STRING(AAX_ERROR_INVALID_STRING_CONVERSION);
783 DEFINE_AAX_ERROR_STRING(AAX_ERROR_INVALID_METER_INDEX);
784 DEFINE_AAX_ERROR_STRING(AAX_ERROR_NULL_OBJECT);
785 DEFINE_AAX_ERROR_STRING(AAX_ERROR_OLDER_VERSION);
786 DEFINE_AAX_ERROR_STRING(AAX_ERROR_INVALID_CHUNK_INDEX);
787 DEFINE_AAX_ERROR_STRING(AAX_ERROR_INVALID_CHUNK_ID);
788 DEFINE_AAX_ERROR_STRING(AAX_ERROR_INCORRECT_CHUNK_SIZE);
789 DEFINE_AAX_ERROR_STRING(AAX_ERROR_UNIMPLEMENTED);
790 DEFINE_AAX_ERROR_STRING(AAX_ERROR_INVALID_PARAMETER_INDEX);
791 DEFINE_AAX_ERROR_STRING(AAX_ERROR_NOT_INITIALIZED);
792 DEFINE_AAX_ERROR_STRING(AAX_ERROR_ACF_ERROR);
793 DEFINE_AAX_ERROR_STRING(AAX_ERROR_INVALID_METER_TYPE);
794 DEFINE_AAX_ERROR_STRING(AAX_ERROR_CONTEXT_ALREADY_HAS_METERS);
795 DEFINE_AAX_ERROR_STRING(AAX_ERROR_NULL_COMPONENT);
796 DEFINE_AAX_ERROR_STRING(AAX_ERROR_PORT_ID_OUT_OF_RANGE);
797 DEFINE_AAX_ERROR_STRING(AAX_ERROR_FIELD_TYPE_DOES_NOT_SUPPORT_DIRECT_ACCESS);
798 DEFINE_AAX_ERROR_STRING(AAX_ERROR_DIRECT_ACCESS_OUT_OF_BOUNDS);
799 DEFINE_AAX_ERROR_STRING(AAX_ERROR_FIFO_FULL);
800 DEFINE_AAX_ERROR_STRING(AAX_ERROR_INITIALIZING_PACKET_STREAM_THREAD);
801 DEFINE_AAX_ERROR_STRING(AAX_ERROR_POST_PACKET_FAILED);
802 DEFINE_AAX_ERROR_STRING(AAX_RESULT_PACKET_STREAM_NOT_EMPTY);
803 DEFINE_AAX_ERROR_STRING(AAX_RESULT_ADD_FIELD_UNSUPPORTED_FIELD_TYPE);
804 DEFINE_AAX_ERROR_STRING(AAX_ERROR_MIXER_THREAD_FALLING_BEHIND);
805 DEFINE_AAX_ERROR_STRING(AAX_ERROR_INVALID_FIELD_INDEX);
806 DEFINE_AAX_ERROR_STRING(AAX_ERROR_MALFORMED_CHUNK);
807 DEFINE_AAX_ERROR_STRING(AAX_ERROR_TOD_BEHIND);
808 DEFINE_AAX_ERROR_STRING(AAX_RESULT_NEW_PACKET_POSTED);
809 DEFINE_AAX_ERROR_STRING(AAX_ERROR_PLUGIN_NOT_AUTHORIZED);
810 DEFINE_AAX_ERROR_STRING(AAX_ERROR_PLUGIN_NULL_PARAMETER);
811 DEFINE_AAX_ERROR_STRING(AAX_ERROR_NOTIFICATION_FAILED);
812 DEFINE_AAX_ERROR_STRING(AAX_ERROR_INVALID_VIEW_SIZE);
813 DEFINE_AAX_ERROR_STRING(AAX_ERROR_SIGNED_INT_OVERFLOW);
814 DEFINE_AAX_ERROR_STRING(AAX_ERROR_NO_COMPONENTS);
815 DEFINE_AAX_ERROR_STRING(AAX_ERROR_DUPLICATE_EFFECT_ID);
816 DEFINE_AAX_ERROR_STRING(AAX_ERROR_DUPLICATE_TYPE_ID);
817 DEFINE_AAX_ERROR_STRING(AAX_ERROR_EMPTY_EFFECT_NAME);
818 DEFINE_AAX_ERROR_STRING(AAX_ERROR_UNKNOWN_PLUGIN);
819 DEFINE_AAX_ERROR_STRING(AAX_ERROR_PROPERTY_UNDEFINED);
820 DEFINE_AAX_ERROR_STRING(AAX_ERROR_INVALID_PATH);
821 DEFINE_AAX_ERROR_STRING(AAX_ERROR_UNKNOWN_ID);
822 DEFINE_AAX_ERROR_STRING(AAX_ERROR_UNKNOWN_EXCEPTION);
823 DEFINE_AAX_ERROR_STRING(AAX_ERROR_INVALID_ARGUMENT);
824 DEFINE_AAX_ERROR_STRING(AAX_ERROR_NULL_ARGUMENT);
825 DEFINE_AAX_ERROR_STRING(AAX_ERROR_INVALID_INTERNAL_DATA);
826 DEFINE_AAX_ERROR_STRING(AAX_ERROR_ARGUMENT_BUFFER_OVERFLOW);
827
828 if (AAX_ERROR_PLUGIN_BEGIN >= inResult && AAX_ERROR_PLUGIN_END <= inResult)
829 return std::string("plug-in defined error");
830
831 return std::string("<unknown error code>");
832}
833
834#endif
AAX_EStemFormat
AAX_EStemFormat
Stem format definitions.
Definition: AAX_Enums.h:230
AAX_eStemFormat_9_1_6
@ AAX_eStemFormat_9_1_6
L C R Lw Rw Lss Rss Lsr Rsr LFE Ltf Rtf Ltm Rtm Ltr Rtr.
Definition: AAX_Enums.h:258
AAX_eStemFormat_Mono
@ AAX_eStemFormat_Mono
M.
Definition: AAX_Enums.h:232
AAX_eStemFormat_Ambi_3_ACN
@ AAX_eStemFormat_Ambi_3_ACN
Ambisonics: third-order with ACN channel order and SN3D (AmbiX) normalization.
Definition: AAX_Enums.h:263
AAX_eStemFormat_9_1_4
@ AAX_eStemFormat_9_1_4
L C R Lw Rw Lss Rss Lsr Rsr LFE Ltf Rtf Ltr Rtr.
Definition: AAX_Enums.h:256
AAX_eStemFormat_INT32_MAX
@ AAX_eStemFormat_INT32_MAX
Definition: AAX_Enums.h:277
AAX_eStemFormat_9_0_4
@ AAX_eStemFormat_9_0_4
L C R Lw Rw Lss Rss Lsr Rsr Ltf Rtf Ltr Rtr.
Definition: AAX_Enums.h:255
AAX_eStemFormat_5_0_4
@ AAX_eStemFormat_5_0_4
L C R Ls Rs Ltf Rtf Ltr Rtr.
Definition: AAX_Enums.h:249
AAX_eStemFormat_Ambi_1_ACN
@ AAX_eStemFormat_Ambi_1_ACN
Ambisonics: first-order with ACN channel order and SN3D (AmbiX) normalization.
Definition: AAX_Enums.h:261
AAX_eStemFormat_7_0_DTS
@ AAX_eStemFormat_7_0_DTS
L C R Lss Rss Lsr Rsr.
Definition: AAX_Enums.h:243
AAX_eStemFormat_7_0_SDDS
@ AAX_eStemFormat_7_0_SDDS
L Lc C Rc R Ls Rs.
Definition: AAX_Enums.h:241
AAX_eStemFormat_7_1_2
@ AAX_eStemFormat_7_1_2
L C R Lss Rss Lsr Rsr LFE Lts Rts.
Definition: AAX_Enums.h:246
AAX_eStemFormat_5_1_2
@ AAX_eStemFormat_5_1_2
L C R Ls Rs LFE Ltm Rtm.
Definition: AAX_Enums.h:248
AAX_eStemFormat_Quad
@ AAX_eStemFormat_Quad
L R Ls Rs.
Definition: AAX_Enums.h:236
AAX_eStemFormatNum
@ AAX_eStemFormatNum
Definition: AAX_Enums.h:272
AAX_eStemFormat_None
@ AAX_eStemFormat_None
Definition: AAX_Enums.h:274
AAX_eStemFormat_5_0_2
@ AAX_eStemFormat_5_0_2
L C R Ls Rs Ltm Rtm.
Definition: AAX_Enums.h:247
AAX_eStemFormat_7_1_4
@ AAX_eStemFormat_7_1_4
L C R Lss Rss Lsr Rsr LFE Ltf Rtf Ltr Rtr.
Definition: AAX_Enums.h:252
AAX_eStemFormat_7_0_6
@ AAX_eStemFormat_7_0_6
L C R Lss Rss Lsr Rsr Ltf Rtf Ltm Rtm Ltr Rtr.
Definition: AAX_Enums.h:253
AAX_eStemFormat_9_0_6
@ AAX_eStemFormat_9_0_6
L C R Lw Rw Lss Rss Lsr Rsr Ltf Rtf Ltm Rtm Ltr Rtr.
Definition: AAX_Enums.h:257
AAX_eStemFormat_7_1_SDDS
@ AAX_eStemFormat_7_1_SDDS
L Lc C Rc R Ls Rs LFE.
Definition: AAX_Enums.h:242
AAX_eStemFormat_Stereo
@ AAX_eStemFormat_Stereo
L R.
Definition: AAX_Enums.h:233
AAX_eStemFormat_7_1_DTS
@ AAX_eStemFormat_7_1_DTS
L C R Lss Rss Lsr Rsr LFE.
Definition: AAX_Enums.h:244
AAX_eStemFormat_7_1_6
@ AAX_eStemFormat_7_1_6
L C R Lss Rss Lsr Rsr LFE Ltf Rtf Ltm Rtm Ltr Rtr.
Definition: AAX_Enums.h:254
AAX_eStemFormat_LCR
@ AAX_eStemFormat_LCR
L C R.
Definition: AAX_Enums.h:234
AAX_eStemFormat_5_1
@ AAX_eStemFormat_5_1
L C R Ls Rs LFE.
Definition: AAX_Enums.h:238
AAX_eStemFormat_LCRS
@ AAX_eStemFormat_LCRS
L C R S.
Definition: AAX_Enums.h:235
AAX_eStemFormat_5_1_4
@ AAX_eStemFormat_5_1_4
L C R Ls Rs LFE Ltf Rtf Ltr Rtr.
Definition: AAX_Enums.h:250
AAX_eStemFormat_7_0_4
@ AAX_eStemFormat_7_0_4
L C R Lss Rss Lsr Rsr Ltf Rtf Ltr Rtr.
Definition: AAX_Enums.h:251
AAX_eStemFormat_Ambi_4_ACN
@ AAX_eStemFormat_Ambi_4_ACN
Ambisonics: fourth-order with ACN channel order and SN3D (AmbiX) normalization.
Definition: AAX_Enums.h:264
AAX_eStemFormat_Ambi_5_ACN
@ AAX_eStemFormat_Ambi_5_ACN
Ambisonics: fifth-order with ACN channel order and SN3D (AmbiX) normalization.
Definition: AAX_Enums.h:265
AAX_eStemFormat_7_0_2
@ AAX_eStemFormat_7_0_2
L C R Lss Rss Lsr Rsr Lts Rts.
Definition: AAX_Enums.h:245
AAX_eStemFormat_6_1
@ AAX_eStemFormat_6_1
L C R Ls Cs Rs LFE.
Definition: AAX_Enums.h:240
AAX_eStemFormat_5_0
@ AAX_eStemFormat_5_0
L C R Ls Rs.
Definition: AAX_Enums.h:237
AAX_eStemFormat_Ambi_6_ACN
@ AAX_eStemFormat_Ambi_6_ACN
Ambisonics: sixth-order with ACN channel order and SN3D (AmbiX) normalization.
Definition: AAX_Enums.h:266
AAX_eStemFormat_6_0
@ AAX_eStemFormat_6_0
L C R Ls Cs Rs.
Definition: AAX_Enums.h:239
AAX_eStemFormat_Ambi_7_ACN
@ AAX_eStemFormat_Ambi_7_ACN
Ambisonics: seventh-order with ACN channel order and SN3D (AmbiX) normalization.
Definition: AAX_Enums.h:267
AAX_eStemFormat_Any
@ AAX_eStemFormat_Any
Definition: AAX_Enums.h:275
AAX_eStemFormat_Ambi_2_ACN
@ AAX_eStemFormat_Ambi_2_ACN
Ambisonics: second-order with ACN channel order and SN3D (AmbiX) normalization.
Definition: AAX_Enums.h:262
AAX_Errors.h
Definitions of error codes used by AAX plug-ins.
AAX_RESULT_NEW_PACKET_POSTED
@ AAX_RESULT_NEW_PACKET_POSTED
Definition: AAX_Errors.h:65
AAX_ERROR_CONTEXT_ALREADY_HAS_METERS
@ AAX_ERROR_CONTEXT_ALREADY_HAS_METERS
Definition: AAX_Errors.h:51
AAX_ERROR_INVALID_PARAMETER_ID
@ AAX_ERROR_INVALID_PARAMETER_ID
Definition: AAX_Errors.h:38
AAX_ERROR_NOTIFICATION_FAILED
@ AAX_ERROR_NOTIFICATION_FAILED
Definition: AAX_Errors.h:68
AAX_ERROR_PORT_ID_OUT_OF_RANGE
@ AAX_ERROR_PORT_ID_OUT_OF_RANGE
Definition: AAX_Errors.h:53
AAX_ERROR_INVALID_CHUNK_ID
@ AAX_ERROR_INVALID_CHUNK_ID
Definition: AAX_Errors.h:44
AAX_ERROR_PLUGIN_END
@ AAX_ERROR_PLUGIN_END
Custom plug-in error codes may be placed in the range ( AAX_ERROR_PLUGIN_END, AAX_ERROR_PLUGIN_BEGIN ...
Definition: AAX_Errors.h:92
AAX_RESULT_ADD_FIELD_UNSUPPORTED_FIELD_TYPE
@ AAX_RESULT_ADD_FIELD_UNSUPPORTED_FIELD_TYPE
Definition: AAX_Errors.h:60
AAX_ERROR_UNIMPLEMENTED
@ AAX_ERROR_UNIMPLEMENTED
Definition: AAX_Errors.h:46
AAX_ERROR_PLUGIN_NULL_PARAMETER
@ AAX_ERROR_PLUGIN_NULL_PARAMETER
Definition: AAX_Errors.h:67
AAX_RESULT_PACKET_STREAM_NOT_EMPTY
@ AAX_RESULT_PACKET_STREAM_NOT_EMPTY
Definition: AAX_Errors.h:59
AAX_ERROR_UNKNOWN_EXCEPTION
@ AAX_ERROR_UNKNOWN_EXCEPTION
An AAX plug-in should return this to the host if an unknown exception is caught. Exceptions should ne...
Definition: AAX_Errors.h:79
AAX_ERROR_MALFORMED_CHUNK
@ AAX_ERROR_MALFORMED_CHUNK
Definition: AAX_Errors.h:63
AAX_ERROR_EMPTY_EFFECT_NAME
@ AAX_ERROR_EMPTY_EFFECT_NAME
Definition: AAX_Errors.h:74
AAX_ERROR_MIXER_THREAD_FALLING_BEHIND
@ AAX_ERROR_MIXER_THREAD_FALLING_BEHIND
Definition: AAX_Errors.h:61
AAX_ERROR_DIRECT_ACCESS_OUT_OF_BOUNDS
@ AAX_ERROR_DIRECT_ACCESS_OUT_OF_BOUNDS
Definition: AAX_Errors.h:55
AAX_ERROR_INVALID_PATH
@ AAX_ERROR_INVALID_PATH
Definition: AAX_Errors.h:77
AAX_ERROR_SIGNED_INT_OVERFLOW
@ AAX_ERROR_SIGNED_INT_OVERFLOW
Definition: AAX_Errors.h:70
AAX_ERROR_FIFO_FULL
@ AAX_ERROR_FIFO_FULL
Definition: AAX_Errors.h:56
AAX_ERROR_NULL_OBJECT
@ AAX_ERROR_NULL_OBJECT
Definition: AAX_Errors.h:41
AAX_ERROR_NULL_COMPONENT
@ AAX_ERROR_NULL_COMPONENT
Definition: AAX_Errors.h:52
AAX_ERROR_PLUGIN_BEGIN
@ AAX_ERROR_PLUGIN_BEGIN
Custom plug-in error codes may be placed in the range ( AAX_ERROR_PLUGIN_END, AAX_ERROR_PLUGIN_BEGIN ...
Definition: AAX_Errors.h:91
AAX_ERROR_INVALID_ARGUMENT
@ AAX_ERROR_INVALID_ARGUMENT
One or more input parameters are invalid; all output parameters are left unchanged.
Definition: AAX_Errors.h:80
AAX_ERROR_INVALID_METER_INDEX
@ AAX_ERROR_INVALID_METER_INDEX
Definition: AAX_Errors.h:40
AAX_ERROR_PLUGIN_NOT_AUTHORIZED
@ AAX_ERROR_PLUGIN_NOT_AUTHORIZED
Definition: AAX_Errors.h:66
AAX_ERROR_UNKNOWN_PLUGIN
@ AAX_ERROR_UNKNOWN_PLUGIN
Definition: AAX_Errors.h:75
AAX_ERROR_INVALID_STRING_CONVERSION
@ AAX_ERROR_INVALID_STRING_CONVERSION
Definition: AAX_Errors.h:39
AAX_ERROR_ACF_ERROR
@ AAX_ERROR_ACF_ERROR
Definition: AAX_Errors.h:49
AAX_ERROR_OLDER_VERSION
@ AAX_ERROR_OLDER_VERSION
Definition: AAX_Errors.h:42
AAX_ERROR_INVALID_FIELD_INDEX
@ AAX_ERROR_INVALID_FIELD_INDEX
Definition: AAX_Errors.h:62
AAX_ERROR_NO_COMPONENTS
@ AAX_ERROR_NO_COMPONENTS
Definition: AAX_Errors.h:71
AAX_ERROR_POST_PACKET_FAILED
@ AAX_ERROR_POST_PACKET_FAILED
Definition: AAX_Errors.h:58
AAX_ERROR_INCORRECT_CHUNK_SIZE
@ AAX_ERROR_INCORRECT_CHUNK_SIZE
Definition: AAX_Errors.h:45
AAX_ERROR_FIELD_TYPE_DOES_NOT_SUPPORT_DIRECT_ACCESS
@ AAX_ERROR_FIELD_TYPE_DOES_NOT_SUPPORT_DIRECT_ACCESS
Definition: AAX_Errors.h:54
AAX_ERROR_NULL_ARGUMENT
@ AAX_ERROR_NULL_ARGUMENT
One or more required pointer arguments are null.
Definition: AAX_Errors.h:81
AAX_ERROR_PROPERTY_UNDEFINED
@ AAX_ERROR_PROPERTY_UNDEFINED
Definition: AAX_Errors.h:76
AAX_ERROR_DUPLICATE_TYPE_ID
@ AAX_ERROR_DUPLICATE_TYPE_ID
Definition: AAX_Errors.h:73
AAX_ERROR_INVALID_VIEW_SIZE
@ AAX_ERROR_INVALID_VIEW_SIZE
Definition: AAX_Errors.h:69
AAX_ERROR_INVALID_PARAMETER_INDEX
@ AAX_ERROR_INVALID_PARAMETER_INDEX
Definition: AAX_Errors.h:47
AAX_ERROR_INITIALIZING_PACKET_STREAM_THREAD
@ AAX_ERROR_INITIALIZING_PACKET_STREAM_THREAD
Definition: AAX_Errors.h:57
AAX_ERROR_INVALID_METER_TYPE
@ AAX_ERROR_INVALID_METER_TYPE
Definition: AAX_Errors.h:50
AAX_ERROR_INVALID_CHUNK_INDEX
@ AAX_ERROR_INVALID_CHUNK_INDEX
Definition: AAX_Errors.h:43
AAX_ERROR_UNKNOWN_ID
@ AAX_ERROR_UNKNOWN_ID
Definition: AAX_Errors.h:78
AAX_SUCCESS
@ AAX_SUCCESS
Definition: AAX_Errors.h:36
AAX_ERROR_INVALID_INTERNAL_DATA
@ AAX_ERROR_INVALID_INTERNAL_DATA
Some part of the internal data required by the method is invalid.
Definition: AAX_Errors.h:82
AAX_ERROR_NOT_INITIALIZED
@ AAX_ERROR_NOT_INITIALIZED
Definition: AAX_Errors.h:48
AAX_ERROR_TOD_BEHIND
@ AAX_ERROR_TOD_BEHIND
Definition: AAX_Errors.h:64
AAX_ERROR_ARGUMENT_BUFFER_OVERFLOW
@ AAX_ERROR_ARGUMENT_BUFFER_OVERFLOW
A buffer argument was not large enough to hold the data which must be placed within it.
Definition: AAX_Errors.h:83
AAX_ERROR_DUPLICATE_EFFECT_ID
@ AAX_ERROR_DUPLICATE_EFFECT_ID
Definition: AAX_Errors.h:72
AAX_Result
int32_t AAX_Result
Definition: AAX.h:334
AAX_CONSTEXPR
#define AAX_CONSTEXPR
constexpr keyword macro
Definition: AAX.h:162
AAX_CPropertyValue
int32_t AAX_CPropertyValue
32-bit property values
Definition: AAX.h:335
AAX_IString.h
An AAX string interface.
DEFINE_AAX_ERROR_STRING
#define DEFINE_AAX_ERROR_STRING(X)
AAX_EProperty
AAX_EProperty
The list of properties that can be added to an AAX_IPropertyMap.
Definition: AAX_Properties.h:69
AAX_eProperty_Constraint_Location
@ AAX_eProperty_Constraint_Location
Constraint on the algorithm's location, as a mask of AAX_EConstraintLocationMask.
Definition: AAX_Properties.h:725
AAX_eProperty_SampleRate
@ AAX_eProperty_SampleRate
Specifies which sample rates the Effect supports. A mask of AAX_ESampleRateMask.
Definition: AAX_Properties.h:372
AAX_Assert.h
Declarations for cross-platform AAX_ASSERT, AAX_TRACE and related facilities.
AAX_ASSERT
#define AAX_ASSERT(condition)
Asserts that a condition is true and logs an error if the condition is false.
Definition: AAX_Assert.h:268
AAX
Definition: AAX_EnvironmentUtilities.h:59
AAX::IsFourCharASCII
bool IsFourCharASCII(uint32_t inFourChar)
Definition: AAX_StringUtilities.hpp:222
AAX::AsStringPropertyValue
std::string AsStringPropertyValue(AAX_EProperty inProperty, AAX_CPropertyValue inPropertyValue)
Definition: AAX_StringUtilities.hpp:294
AAX::AsStringFourChar
std::string AsStringFourChar(uint32_t inFourChar)
Definition: AAX_StringUtilities.hpp:237
AAX::AsStringStemFormat
std::string AsStringStemFormat(AAX_EStemFormat inStemFormat, bool inAbbreviate=false)
Definition: AAX_StringUtilities.hpp:349
AAX::AsStringResult
std::string AsStringResult(AAX_Result inResult)
Definition: AAX_StringUtilities.hpp:773
AAX::Caseless_strcmp
int32_t Caseless_strcmp(const char *cs, const char *ct)
Definition: AAX_StringUtilities.hpp:130
AAX::Binary2String
std::string Binary2String(uint32_t binaryValue, int32_t numBits)
Definition: AAX_StringUtilities.hpp:173
AAX::String2Binary
uint32_t String2Binary(const AAX_IString &s)
Definition: AAX_StringUtilities.hpp:194
AAX::AsStringIDTriad
std::string AsStringIDTriad(const AAX_SPlugInIdentifierTriad &inIDTriad)
Definition: AAX_StringUtilities.hpp:337
AAX::GetCStringOfLength
void GetCStringOfLength(char *stringOut, const char *stringIn, int32_t aMaxChars)
==============================================================
Definition: AAX_StringUtilities.hpp:90
AAX::IsASCII
bool IsASCII(char inChar)
Definition: AAX_StringUtilities.hpp:217
AAX::AsStringInt32
std::string AsStringInt32(int32_t inInt32)
Definition: AAX_StringUtilities.hpp:327
AAX::AsStringUInt32
std::string AsStringUInt32(uint32_t inUInt32)
Definition: AAX_StringUtilities.hpp:332
AAX::AsStringStemChannel
std::string AsStringStemChannel(AAX_EStemFormat inStemFormat, uint32_t inChannelIndex, bool inAbbreviate)
Definition: AAX_StringUtilities.hpp:398
AAX::internal::ToHexadecimal
std::string ToHexadecimal(T inValue, bool inLeadingZeros=false)
Definition: AAX_StringUtilities.hpp:264
AAX_SPlugInIdentifierTriad
Plug-in Identifier Triad.
Definition: AAX.h:553
AAX_SPlugInIdentifierTriad::mProductID
AAX_CTypeID mProductID
The Plug-In's product (Effect) ID.
Definition: AAX.h:555
AAX_SPlugInIdentifierTriad::mPlugInID
AAX_CTypeID mPlugInID
The ID of a specific type in the product (Effect)
Definition: AAX.h:556
AAX_SPlugInIdentifierTriad::mManufacturerID
AAX_CTypeID mManufacturerID
The Plug-In's manufacturer ID.
Definition: AAX.h:554
AAX_IString
A simple string container that can be passed across a binary boundary. This class,...
Definition: AAX_IString.h:38
AAX_IString::Get
virtual const char * Get() const =0
AAX_IString::Length
virtual uint32_t Length() const =0