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