AAX SDK  2.4.1
Avid Audio Extensions Development Kit
AAX.h
Go to the documentation of this file.
1 /*================================================================================================*/
2 /*
3 
4  * Copyright 2013-2017, 2019 by Avid Technology, Inc.
5  * All rights reserved.
6  *
7  * CONFIDENTIAL: This document contains confidential information. Do not
8  * read or examine this document unless you are an Avid Technology employee
9  * or have signed a non-disclosure agreement with Avid Technology which protects
10  * the confidentiality of this document. DO NOT DISCLOSE ANY INFORMATION
11  * CONTAINED IN THIS DOCUMENT TO ANY THIRD-PARTY WITHOUT THE PRIOR WRITTEN CONSENT
12  * OF Avid Technology, INC.
13  *
14  */
15 
28 /*================================================================================================*/
29 
30 
31 #pragma once
32 
34 #ifndef _AAX_H_
35 #define _AAX_H_
37 
38 #include <stdint.h>
39 #include <stddef.h>
40 
41 #include "AAX_Version.h"
42 #include "AAX_Enums.h"
43 #include "AAX_Errors.h"
44 #include "AAX_Properties.h"
45 
46 
47 
58 
59 #ifndef TI_VERSION
60  #if defined _TMS320C6X
61  #define TI_VERSION 1
62  #elif defined DOXYGEN_PREPROCESSOR
63  #define TI_VERSION 0
64  #endif
65 #endif
66 
67 
68 #ifndef AAX_CPP11_SUPPORT
69  #if (defined __cplusplus) && (__cplusplus >= 201103L)
70  #define AAX_CPP11_SUPPORT 1
71  // VS2015 supports all features except expression SFINAE
72  #elif ((defined _MSVC_LANG) && (_MSVC_LANG >= 201402))
73  #define AAX_CPP11_SUPPORT 1
74  // Let Doxygen see the C++11 version of all code
75  #elif defined DOXYGEN_PREPROCESSOR
76  #define AAX_CPP11_SUPPORT 1
77  #endif
78 #endif
79 
80 
139 
140 #if AAX_CPP11_SUPPORT
141 # define AAX_OVERRIDE override
142 # define AAX_FINAL final
143 # define AAX_DEFAULT_DTOR(X) ~X() = default
144 # define AAX_DEFAULT_DTOR_OVERRIDE(X) ~X() override = default
145 # define AAX_DEFAULT_CTOR(X) X() = default
146 # define AAX_DEFAULT_COPY_CTOR(X) X(const X&) = default
147 # define AAX_DEFAULT_ASGN_OPER(X) X& operator=(const X&) = default
148 # define AAX_DELETE(X) X = delete
149 # define AAX_DEFAULT_MOVE_CTOR(X) X(X&&) = default
150 # define AAX_DEFAULT_MOVE_OPER(X) X& operator=(X&&) = default
151 # define AAX_CONSTEXPR constexpr
152 # define AAX_UNIQUE_PTR(X) std::unique_ptr<X>
153 #else
154 # define AAX_OVERRIDE
155 # define AAX_FINAL
156 # define AAX_DEFAULT_DTOR(X) ~X() {}
157 # define AAX_DEFAULT_DTOR_OVERRIDE(X) ~X() {}
158 # define AAX_DEFAULT_CTOR(X) X() {}
159 # define AAX_DEFAULT_COPY_CTOR(X)
160 # define AAX_DEFAULT_MOVE_CTOR(X)
161 # define AAX_DEFAULT_ASGN_OPER(X)
162 # define AAX_DEFAULT_MOVE_OPER(X)
163 // Assumes public access in the declaration scope where AAX_DELETE is used
164 # define AAX_DELETE(X) private: X; public:
165 # define AAX_CONSTEXPR
166 # define AAX_UNIQUE_PTR(X) std::auto_ptr<X>
167 #endif
168 
169 
186 #define AAXPointer_32bit 1
187 #define AAXPointer_64bit 2
188 
189 #if !defined(AAX_PointerSize)
190  #if defined(_M_X64) || defined (__LP64__)
191  #define AAX_PointerSize AAXPointer_64bit
192  #else
193  #define AAX_PointerSize AAXPointer_32bit
194  #endif
195 #endif
196 
197 // ensure that preprocessor comparison logic gives the correct result
198 #if ((AAX_PointerSize == AAXPointer_32bit) && (defined(_M_X64) || defined (__LP64__)))
199  #error incorrect result of AAX_PointerSize check!
200 #elif ((AAX_PointerSize == AAXPointer_64bit) && !(defined(_M_X64) || defined (__LP64__)))
201  #error incorrect result of AAX_PointerSize check!
202 #endif
203 
204 
266 
267 #if ( defined(_WIN64) || defined(__LP64__) )
268  #define AAX_ALIGN_FILE_HOST "AAX_Push8ByteStructAlignment.h"
269 #elif ( defined(_TMS320C6X) )
270  // AAX_ALIGN_FILE_HOST is not compatible with this compiler
271  // We don't use an #error here b/c that causes Doxygen to get confused
272 #else
273  #define AAX_ALIGN_FILE_HOST "AAX_Push2ByteStructAlignment.h"
274 #endif
275 #define AAX_ALIGN_FILE_ALG "AAX_Push8ByteStructAlignment.h"
276 #define AAX_ALIGN_FILE_RESET "AAX_PopStructAlignment.h"
277 #define AAX_ALIGN_FILE_BEGIN "AAX_PreStructAlignmentHelper.h"
278 #define AAX_ALIGN_FILE_END "AAX_PostStructAlignmentHelper.h"
279 
280 
281 #ifndef AAX_CALLBACK
282 # ifdef _MSC_VER
283 # define AAX_CALLBACK __cdecl
284 # else
285 # define AAX_CALLBACK
286 # endif
287 #endif // AAX_CALLBACK
288 
289 
290 #ifdef _MSC_VER
291 # define AAX_RESTRICT
292 #elif defined(_TMS320C6X) // TI
293 # define AAX_RESTRICT restrict
294 #elif defined (__GNUC__)// Mac
295 # define AAX_RESTRICT __restrict__
296 #endif // _MSC_VER
297 
298 
299 // preprocessor helper macros
300 #define AAX_PREPROCESSOR_CONCAT_HELPER(X,Y) X ## Y
301 #define AAX_PREPROCESSOR_CONCAT(X,Y) AAX_PREPROCESSOR_CONCAT_HELPER(X,Y)
302 
303 
304 
305 #ifdef _MSC_VER
306 // Disable unknown pragma warning for TI pragmas under VC++
307 #pragma warning( disable : 4068 )
308 #endif
309 
310 
323 #define AAX_FIELD_INDEX( aContextType, aMember ) \
324  ((AAX_CFieldIndex) (offsetof (aContextType, aMember) / sizeof (void *)))
325 
326 
327 typedef int32_t AAX_CIndex;
329 typedef uint8_t AAX_CBoolean;
330 typedef uint32_t AAX_CSelector;
331 typedef int64_t AAX_CTimestamp;
332 typedef int64_t AAX_CTimeOfDay;
333 typedef int64_t AAX_CTransportCounter;
334 typedef float AAX_CSampleRate;
335 
336 typedef uint32_t AAX_CTypeID;
337 typedef int32_t AAX_Result;
338 typedef int32_t AAX_CPropertyValue;
339 typedef int64_t AAX_CPropertyValue64;
340 #if AAX_PointerSize == AAXPointer_32bit
342 #elif AAX_PointerSize == AAXPointer_64bit
344 #else
345  #error unexpected pointer size
346 #endif
347 typedef int32_t AAX_CTargetPlatform;
348 
352 typedef const char * AAX_CParamID;
354 typedef const char * AAX_CEffectID;
355 
356 // Forward declarations required for AAX_Feature_UID typedef (the "real" typedef is in AAX_UIDs.h)
357 struct _acfUID;
358 typedef _acfUID acfUID;
359 
365 
366 
367 static const AAX_CTimestamp kAAX_Never = (AAX_CTimestamp) ~0ULL;
368 
369 
371 #ifdef _TMS320C6X
372  // TI's C compiler defaults to 8 byte alignment of doubles
373  #define AAX_ALIGNED(v)
374 #elif defined(__GNUC__)
375  #define AAX_ALIGNED(v) __attribute__((aligned(v)))
376 #elif defined(_MSC_VER)
377  #define AAX_ALIGNED(v) __declspec(align(v))
378 #else
379  #error Teach me to align data types with this compiler.
380 #endif
381 
382 
388 static
389 inline
390 int32_t
391 AAX_GetStemFormatChannelCount (
392  AAX_EStemFormat inStemFormat)
393 {
394  return AAX_STEM_FORMAT_CHANNEL_COUNT (inStemFormat);
395 }
396 
397 
407 typedef const float * const * AAX_CAudioInPort;
408 
409 
419 typedef float * const * AAX_CAudioOutPort;
420 
421 
432 typedef float * const AAX_CMeterPort;
433 
434 
441 inline AAX_CBoolean sampleRateInMask(AAX_CSampleRate inSR, uint32_t iMask)
442 {
443  return static_cast<AAX_CBoolean>(
444  (44100.0 == inSR) ? ((iMask & AAX_eSampleRateMask_44100) != 0) :
445  (48000.0 == inSR) ? ((iMask & AAX_eSampleRateMask_48000) != 0) :
446  (88200.0 == inSR) ? ((iMask & AAX_eSampleRateMask_88200) != 0) :
447  (96000.0 == inSR) ? ((iMask & AAX_eSampleRateMask_96000) != 0) :
448  (176400.0 == inSR) ? ((iMask & AAX_eSampleRateMask_176400) != 0) :
449  (192000.0 == inSR) ? ((iMask & AAX_eSampleRateMask_192000) != 0) : false
450  );
451 }
452 
458 {
459  return (
460  ((iMask & AAX_eSampleRateMask_44100) != 0) ? 44100.0f : // AAX_eSamplRateMask_All returns 44100
461  ((iMask & AAX_eSampleRateMask_48000) != 0) ? 48000.0f :
462  ((iMask & AAX_eSampleRateMask_88200) != 0) ? 88200.0f :
463  ((iMask & AAX_eSampleRateMask_96000) != 0) ? 96000.0f :
464  ((iMask & AAX_eSampleRateMask_176400) != 0) ? 176400.0f :
465  ((iMask & AAX_eSampleRateMask_192000) != 0) ? 192000.0f : 0.0f
466  );
467 }
468 
476 inline uint32_t getMaskForSampleRate(float inSR)
477 {
478  return (
479  (44100.0 == inSR) ? AAX_eSampleRateMask_44100 :
480  (48000.0 == inSR) ? AAX_eSampleRateMask_48000 :
481  (88200.0 == inSR) ? AAX_eSampleRateMask_88200 :
482  (96000.0 == inSR) ? AAX_eSampleRateMask_96000 :
483  (176400.0 == inSR) ? AAX_eSampleRateMask_176400 :
485  );
486 }
487 
488 
489 #ifndef _TMS320C6X
490 
491 #include AAX_ALIGN_FILE_BEGIN
492 #include AAX_ALIGN_FILE_HOST
493 #include AAX_ALIGN_FILE_END
494 
495 #endif
496 
523  int32_t fSize;
524  int32_t fVersion;
529  unsigned char fName[32];
530 };
532 
538  int32_t fSize;
539  int32_t fVersion;
544  unsigned char fName[32];
545  char fData[1];
546 };
548 
558 };
560 
561 #ifndef _TMS320C6X
562 #include AAX_ALIGN_FILE_BEGIN
563 #include AAX_ALIGN_FILE_RESET
564 #include AAX_ALIGN_FILE_END
565 #endif
566 
567 #ifndef TI_VERSION
568 static inline bool operator==(const AAX_SPlugInIdentifierTriad& v1, const AAX_SPlugInIdentifierTriad& v2)
569 {
570  return ((v1.mManufacturerID == v2.mManufacturerID) &&
571  (v1.mProductID == v2.mProductID) &&
572  (v1.mPlugInID == v2.mPlugInID));
573 }
574 
575 static inline bool operator!=(const AAX_SPlugInIdentifierTriad& v1, const AAX_SPlugInIdentifierTriad& v2)
576 {
577  return false == operator==(v1, v2);
578 }
579 
580 static inline bool operator<(const AAX_SPlugInIdentifierTriad & lhs, const AAX_SPlugInIdentifierTriad & rhs)
581 {
582  if (lhs.mManufacturerID < rhs.mManufacturerID)
583  return true;
584 
585  if (lhs.mManufacturerID == rhs.mManufacturerID)
586  {
587  if (lhs.mProductID < rhs.mProductID)
588  return true;
589 
590  if (lhs.mProductID == rhs.mProductID)
591  if (lhs.mPlugInID < rhs.mPlugInID)
592  return true;
593  }
594  return false;
595 }
596 
597 static inline bool operator>=(const AAX_SPlugInIdentifierTriad & lhs, const AAX_SPlugInIdentifierTriad & rhs)
598 {
599  return false == operator<(lhs, rhs);
600 }
601 
602 static inline bool operator>(const AAX_SPlugInIdentifierTriad & lhs, const AAX_SPlugInIdentifierTriad & rhs)
603 {
604  return operator>=(lhs, rhs) && operator!=(lhs, rhs);
605 }
606 
607 static inline bool operator<=(const AAX_SPlugInIdentifierTriad & lhs, const AAX_SPlugInIdentifierTriad & rhs)
608 {
609  return false == operator>(lhs, rhs);
610 }
611 #endif //TI_VERSION
612 
613 
614 //<DMT> For historical compatibility with PT10, we have to make the MIDI structures DEFAULT aligned instead of ALG aligned. With PT11 and 64 bit, these will now be ALG aligned.
615 #if ( defined(_WIN64) || defined(__LP64__) || defined(_TMS320C6X) )
616  #include AAX_ALIGN_FILE_BEGIN
617  #include AAX_ALIGN_FILE_ALG
618  #include AAX_ALIGN_FILE_END
619 #else
620  #if defined (__GNUC__)
621  #pragma options align=power // To maintain backwards-compatibility with pre-10 versions of Pro Tools
622  #else // Windows, other
623  #include AAX_ALIGN_FILE_BEGIN
624  #include AAX_ALIGN_FILE_HOST
625  #include AAX_ALIGN_FILE_END
626  #endif
627 #endif
628 
637 {
638  uint32_t mTimestamp;
639  uint32_t mLength;
640  unsigned char mData[4];
642 };
643 
662 {
663  uint32_t mBufferSize;
665 };
666 
667 #if ( defined(_WIN64) || defined(__LP64__) || defined(_TMS320C6X) )
668  #include AAX_ALIGN_FILE_BEGIN
669  #include AAX_ALIGN_FILE_RESET
670  #include AAX_ALIGN_FILE_END
671 #else
672  #if defined (__GNUC__)
673  #pragma pack() // To maintian backwards-compatibility with pre-10 versions of Pro Tools
674  #else
675  #include AAX_ALIGN_FILE_BEGIN
676  #include AAX_ALIGN_FILE_RESET
677  #include AAX_ALIGN_FILE_END
678  #endif
679 #endif
680 
682 #endif // #ifndef _AAX_H_
const char * AAX_CParamID
Parameter identifier.
Definition: AAX.h:352
int32_t AAX_CIndex
Definition: AAX.h:327
uint32_t getMaskForSampleRate(float inSR)
Returns the AAX_ESampleRateMask selector for a literal sample rate.
Definition: AAX.h:476
float AAX_CSampleRate
Literal sample rate value used by the sample rate field. For AAX_eProperty_SampleRate,...
Definition: AAX.h:334
int64_t AAX_CTimeOfDay
Hardware running clock value. MIDI packet time stamps are measured against this clock....
Definition: AAX.h:332
int64_t AAX_CPropertyValue64
64-bit property values
Definition: AAX.h:339
const char * AAX_CEffectID
URL-style Effect identifier. Must be unique among all registered effects in the collection.
Definition: AAX.h:354
int32_t AAX_Result
Definition: AAX.h:337
acfUID AAX_Feature_UID
Definition: AAX.h:364
float *const * AAX_CAudioOutPort
AAX algorithm audio output port data type
Definition: AAX.h:419
_acfUID acfUID
Definition: AAX.h:357
AAX_CSelector AAX_CMeterID
Definition: AAX.h:351
AAX_CPropertyValue AAX_CPointerPropertyValue
Pointer-sized property values.
Definition: AAX.h:341
AAX_CSelector AAX_CComponentID
Definition: AAX.h:350
AAX_CSampleRate getLowestSampleRateInMask(uint32_t iMask)
Converts from a mask of AAX_ESampleRateMask to the lowest supported AAX_CSampleRate value in Hz.
Definition: AAX.h:457
int32_t AAX_CTargetPlatform
Matches type of target platform.
Definition: AAX.h:347
const float *const * AAX_CAudioInPort
AAX algorithm audio input port data type
Definition: AAX.h:407
AAX_CIndex AAX_CCount
Definition: AAX.h:328
uint8_t AAX_CBoolean
Cross-compiler boolean type used by AAX interfaces.
Definition: AAX.h:329
float *const AAX_CMeterPort
AAX algorithm meter port data type
Definition: AAX.h:432
int64_t AAX_CTimestamp
Time stamp value. Measured against the DAE clock (see AAX_IComponentDescriptor::AddClock() )
Definition: AAX.h:331
struct AAX_SPlugInChunk * AAX_SPlugInChunkPtr
Definition: AAX.h:547
int32_t AAX_CPropertyValue
32-bit property values
Definition: AAX.h:338
AAX_CParamID AAX_CPageTableParamID
Parameter identifier used in a page table.
Definition: AAX.h:353
int64_t AAX_CTransportCounter
Offset of samples from transport start. Same as TimeOfDay, but added for new interfaces as TimeOfDay ...
Definition: AAX.h:333
uint32_t AAX_CTypeID
Matches type of OSType used in classic plugins.
Definition: AAX.h:336
AAX_CBoolean sampleRateInMask(AAX_CSampleRate inSR, uint32_t iMask)
Determines whether a particular AAX_CSampleRate is present in a given mask of AAX_ESampleRateMask.
Definition: AAX.h:441
AAX_CIndex AAX_CFieldIndex
Not used by AAX plug-ins (except in AAX_FIELD_INDEX macro)
Definition: AAX.h:349
uint32_t AAX_CSelector
Definition: AAX.h:330
struct AAX_SPlugInIdentifierTriad * AAX_SPlugInIdentifierTriadPtr
Definition: AAX.h:559
Utility functions for byte-swapping. Used by AAX_CChunkDataParser.
#define AAX_STEM_FORMAT_CHANNEL_COUNT(aStemFormat)
Definition: AAX_Enums.h:205
@ AAX_eSampleRateMask_No
Definition: AAX_Enums.h:812
@ AAX_eSampleRateMask_176400
Definition: AAX_Enums.h:818
@ AAX_eSampleRateMask_44100
Definition: AAX_Enums.h:814
@ AAX_eSampleRateMask_48000
Definition: AAX_Enums.h:815
@ AAX_eSampleRateMask_88200
Definition: AAX_Enums.h:816
@ AAX_eSampleRateMask_192000
Definition: AAX_Enums.h:819
@ AAX_eSampleRateMask_96000
Definition: AAX_Enums.h:817
AAX_EStemFormat
Stem format definitions.
Definition: AAX_Enums.h:232
Definitions of error codes used by AAX plug-ins.
bool operator!=(const AAX_Point &p1, const AAX_Point &p2)
Definition: AAX_GUITypes.h:68
bool operator<=(const AAX_Point &p1, const AAX_Point &p2)
Definition: AAX_GUITypes.h:78
bool operator==(const AAX_Point &p1, const AAX_Point &p2)
Definition: AAX_GUITypes.h:63
bool operator>=(const AAX_Point &p1, const AAX_Point &p2)
Definition: AAX_GUITypes.h:88
bool operator<(const AAX_Point &p1, const AAX_Point &p2)
Definition: AAX_GUITypes.h:73
bool operator>(const AAX_Point &p1, const AAX_Point &p2)
Definition: AAX_GUITypes.h:83
Contains IDs for properties that can be added to an AAX_IPropertyMap.
Version stamp header for the AAX SDK.
Definition: AAX_ACFInterface.doxygen:212
Plug-in chunk header.
Definition: AAX.h:522
AAX_CTypeID fChunkID
The ID of a particular Plug-In chunk.
Definition: AAX.h:528
AAX_CTypeID fPlugInID
The ID of a particular Plug-In within the file.
Definition: AAX.h:527
int32_t fVersion
The chunk's version.
Definition: AAX.h:524
AAX_CTypeID fManufacturerID
The Plug-In's manufacturer ID.
Definition: AAX.h:525
unsigned char fName[32]
A user defined name for this chunk.
Definition: AAX.h:529
int32_t fSize
The size of the chunk's fData member.
Definition: AAX.h:523
AAX_CTypeID fProductID
The Plug-In file's product ID.
Definition: AAX.h:526
Plug-in chunk header + data.
Definition: AAX.h:537
AAX_CTypeID fChunkID
The ID of a particular Plug-In chunk.
Definition: AAX.h:543
unsigned char fName[32]
A user defined name for this chunk.
Definition: AAX.h:544
AAX_CTypeID fManufacturerID
The Plug-In's manufacturer ID.
Definition: AAX.h:540
char fData[1]
The chunk's data.
Definition: AAX.h:545
AAX_CTypeID fProductID
The Plug-In file's product ID.
Definition: AAX.h:541
int32_t fSize
The size of the chunk's fData member.
Definition: AAX.h:538
int32_t fVersion
The chunk's version.
Definition: AAX.h:539
AAX_CTypeID fPlugInID
The ID of a particular Plug-In within the file.
Definition: AAX.h:542
Plug-in Identifier Triad.
Definition: AAX.h:554
AAX_CTypeID mProductID
The Plug-In's product (Effect) ID.
Definition: AAX.h:556
AAX_CTypeID mPlugInID
The ID of a specific type in the product (Effect)
Definition: AAX.h:557
AAX_CTypeID mManufacturerID
The Plug-In's manufacturer ID.
Definition: AAX.h:555
Packet structure for MIDI data.
Definition: AAX.h:637
uint32_t mTimestamp
This is the playback time at which the MIDI event should occur, relative to the beginning of the curr...
Definition: AAX.h:638
uint32_t mLength
The length of MIDI message, in terms of bytes.
Definition: AAX.h:639
unsigned char mData[4]
The MIDI message itself. Each array element is one byte of the message, with the 0th element being th...
Definition: AAX.h:640
AAX_CBoolean mIsImmediate
Indicates that the message is to be sent as soon as possible.
Definition: AAX.h:641
MIDI stream data structure used by AAX_IMIDINode.
Definition: AAX.h:662
AAX_CMidiPacket * mBuffer
Pointer to the first element of the node's buffer.
Definition: AAX.h:664
uint32_t mBufferSize
The number of AAX_CMidiPacket objects contained in the node's buffer.
Definition: AAX.h:663