AAX SDK 2.8.0
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-2024 Avid Technology, Inc.
5 * All rights reserved.
6 *
7 * This file is part of the Avid AAX SDK.
8 *
9 * The AAX SDK is subject to commercial or open-source licensing.
10 *
11 * By using the AAX SDK, you agree to the terms of both the Avid AAX SDK License
12 * Agreement and Avid Privacy Policy.
13 *
14 * AAX SDK License: https://developer.avid.com/aax
15 * Privacy Policy: https://www.avid.com/legal/privacy-policy-statement
16 *
17 * Or: You may also use this code under the terms of the GPL v3 (see
18 * www.gnu.org/licenses).
19 *
20 * THE AAX SDK IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
21 * EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
22 * DISCLAIMED.
23 *
24 */
25
38/*================================================================================================*/
39
40
41#pragma once
42
44#ifndef _AAX_H_
45#define _AAX_H_
47
48#include <stdint.h>
49#include <stddef.h>
50
51#include "AAX_Version.h"
52#include "AAX_Enums.h"
53#include "AAX_Errors.h"
54#include "AAX_Properties.h"
55
56
57
68
69#ifndef TI_VERSION
70 #if defined _TMS320C6X
71 #define TI_VERSION 1
72 #elif defined DOXYGEN_PREPROCESSOR
73 #define TI_VERSION 0
74 #endif
75#endif
76
77
78#ifndef AAX_CPP11_SUPPORT
79 #if (defined __cplusplus) && (__cplusplus >= 201103L)
80 #define AAX_CPP11_SUPPORT 1
81 // VS2015 supports all features except expression SFINAE
82 #elif ((defined _MSVC_LANG) && (_MSVC_LANG >= 201402))
83 #define AAX_CPP11_SUPPORT 1
84 // Let Doxygen see the C++11 version of all code
85 #elif defined DOXYGEN_PREPROCESSOR
86 #define AAX_CPP11_SUPPORT 1
87 #endif
88#endif
89
90
149
150#if AAX_CPP11_SUPPORT
151# define AAX_OVERRIDE override
152# define AAX_FINAL final
153# define AAX_DEFAULT_DTOR(X) ~X() = default
154# define AAX_DEFAULT_DTOR_OVERRIDE(X) ~X() override = default
155# define AAX_DEFAULT_CTOR(X) X() = default
156# define AAX_DEFAULT_COPY_CTOR(X) X(const X&) = default
157# define AAX_DEFAULT_ASGN_OPER(X) X& operator=(const X&) = default
158# define AAX_DELETE(X) X = delete
159# define AAX_DEFAULT_MOVE_CTOR(X) X(X&&) = default
160# define AAX_DEFAULT_MOVE_OPER(X) X& operator=(X&&) = default
161# define AAX_CONSTEXPR constexpr
162# define AAX_UNIQUE_PTR(X) std::unique_ptr<X>
163#else
164# define AAX_OVERRIDE
165# define AAX_FINAL
166# define AAX_DEFAULT_DTOR(X) ~X() {}
167# define AAX_DEFAULT_DTOR_OVERRIDE(X) ~X() {}
168# define AAX_DEFAULT_CTOR(X) X() {}
169# define AAX_DEFAULT_COPY_CTOR(X)
170# define AAX_DEFAULT_MOVE_CTOR(X)
171# define AAX_DEFAULT_ASGN_OPER(X)
172# define AAX_DEFAULT_MOVE_OPER(X)
173// Assumes public access in the declaration scope where AAX_DELETE is used
174# define AAX_DELETE(X) private: X; public:
175# define AAX_CONSTEXPR const
176# define AAX_UNIQUE_PTR(X) std::auto_ptr<X>
177#endif
178
179
196#define AAXPointer_32bit 1
197#define AAXPointer_64bit 2
198
199#if !defined(AAX_PointerSize)
200 #if defined(_M_X64) || defined (__LP64__)
201 #define AAX_PointerSize AAXPointer_64bit
202 #else
203 #define AAX_PointerSize AAXPointer_32bit
204 #endif
205#endif
206
207// ensure that preprocessor comparison logic gives the correct result
208#if ((AAX_PointerSize == AAXPointer_32bit) && (defined(_M_X64) || defined (__LP64__)))
209 #error incorrect result of AAX_PointerSize check!
210#elif ((AAX_PointerSize == AAXPointer_64bit) && !(defined(_M_X64) || defined (__LP64__)))
211 #error incorrect result of AAX_PointerSize check!
212#endif
213
214
276
277#if ( defined(_WIN64) || defined(__LP64__) )
278 #define AAX_ALIGN_FILE_HOST "AAX_Push8ByteStructAlignment.h"
279#elif ( defined(_TMS320C6X) )
280 // AAX_ALIGN_FILE_HOST is not compatible with this compiler
281 // We don't use an #error here b/c that causes Doxygen to get confused
282#else
283 #define AAX_ALIGN_FILE_HOST "AAX_Push2ByteStructAlignment.h"
284#endif
285#define AAX_ALIGN_FILE_ALG "AAX_Push8ByteStructAlignment.h"
286#define AAX_ALIGN_FILE_RESET "AAX_PopStructAlignment.h"
287#define AAX_ALIGN_FILE_BEGIN "AAX_PreStructAlignmentHelper.h"
288#define AAX_ALIGN_FILE_END "AAX_PostStructAlignmentHelper.h"
289
290
291#ifndef AAX_CALLBACK
292# ifdef _MSC_VER
293# define AAX_CALLBACK __cdecl
294# else
295# define AAX_CALLBACK
296# endif
297#endif // AAX_CALLBACK
298
299
300#ifdef _MSC_VER
301# define AAX_RESTRICT
302#elif defined(_TMS320C6X) // TI
303# define AAX_RESTRICT restrict
304#elif defined (__GNUC__)// Mac
305# define AAX_RESTRICT __restrict__
306#endif // _MSC_VER
307
308
309// preprocessor helper macros
310#define AAX_PREPROCESSOR_CONCAT_HELPER(X,Y) X ## Y
311#define AAX_PREPROCESSOR_CONCAT(X,Y) AAX_PREPROCESSOR_CONCAT_HELPER(X,Y)
312
313
314
315#ifdef _MSC_VER
316// Disable unknown pragma warning for TI pragmas under VC++
317#pragma warning( disable : 4068 )
318#endif
319
320
333#define AAX_FIELD_INDEX( aContextType, aMember ) \
334 ((AAX_CFieldIndex) (offsetof (aContextType, aMember) / sizeof (void *)))
335
336
337typedef int32_t AAX_CIndex;
339typedef uint8_t AAX_CBoolean;
340typedef uint32_t AAX_CSelector;
341typedef int64_t AAX_CTimestamp;
342typedef int64_t AAX_CTimeOfDay;
343typedef int64_t AAX_CTransportCounter;
344typedef float AAX_CSampleRate;
345
346typedef uint32_t AAX_CTypeID;
347typedef int32_t AAX_Result;
348typedef int32_t AAX_CPropertyValue;
349typedef int64_t AAX_CPropertyValue64;
350#if AAX_PointerSize == AAXPointer_32bit
352#elif AAX_PointerSize == AAXPointer_64bit
354#else
355 #error unexpected pointer size
356#endif
357typedef int32_t AAX_CTargetPlatform;
358
362typedef const char * AAX_CParamID;
364typedef const char * AAX_CEffectID;
365
366// Forward declarations required for AAX_Feature_UID typedef (the "real" typedef is in AAX_UIDs.h)
367struct _acfUID;
369
375
378
379static const AAX_CTimestamp kAAX_Never = (AAX_CTimestamp) ~0ULL;
380
381
383#ifdef _TMS320C6X
384 // TI's C compiler defaults to 8 byte alignment of doubles
385 #define AAX_ALIGNED(v)
386#elif defined(__GNUC__)
387 #define AAX_ALIGNED(v) __attribute__((aligned(v)))
388#elif defined(_MSC_VER)
389 #define AAX_ALIGNED(v) __declspec(align(v))
390#else
391 #error Teach me to align data types with this compiler.
392#endif
393
394
400static
401inline
402int32_t
403AAX_GetStemFormatChannelCount (
404 AAX_EStemFormat inStemFormat)
405{
406 return AAX_STEM_FORMAT_CHANNEL_COUNT (inStemFormat);
407}
408
409
419typedef const float * const * AAX_CAudioInPort;
420
421
431typedef float * const * AAX_CAudioOutPort;
432
433
444typedef float * const AAX_CMeterPort;
445
446
454{
455 return static_cast<AAX_CBoolean>(
456 (44100.0 == inSR) ? ((iMask & AAX_eSampleRateMask_44100) != 0) :
457 (48000.0 == inSR) ? ((iMask & AAX_eSampleRateMask_48000) != 0) :
458 (88200.0 == inSR) ? ((iMask & AAX_eSampleRateMask_88200) != 0) :
459 (96000.0 == inSR) ? ((iMask & AAX_eSampleRateMask_96000) != 0) :
460 (176400.0 == inSR) ? ((iMask & AAX_eSampleRateMask_176400) != 0) :
461 (192000.0 == inSR) ? ((iMask & AAX_eSampleRateMask_192000) != 0) : false
462 );
463}
464
470{
471 return (
472 ((iMask & AAX_eSampleRateMask_44100) != 0) ? 44100.0f : // AAX_eSamplRateMask_All returns 44100
473 ((iMask & AAX_eSampleRateMask_48000) != 0) ? 48000.0f :
474 ((iMask & AAX_eSampleRateMask_88200) != 0) ? 88200.0f :
475 ((iMask & AAX_eSampleRateMask_96000) != 0) ? 96000.0f :
476 ((iMask & AAX_eSampleRateMask_176400) != 0) ? 176400.0f :
477 ((iMask & AAX_eSampleRateMask_192000) != 0) ? 192000.0f : 0.0f
478 );
479}
480
488inline uint32_t getMaskForSampleRate(float inSR)
489{
490 return (
491 (44100.0 == inSR) ? AAX_eSampleRateMask_44100 :
492 (48000.0 == inSR) ? AAX_eSampleRateMask_48000 :
493 (88200.0 == inSR) ? AAX_eSampleRateMask_88200 :
494 (96000.0 == inSR) ? AAX_eSampleRateMask_96000 :
495 (176400.0 == inSR) ? AAX_eSampleRateMask_176400 :
497 );
498}
499
500
501#ifndef _TMS320C6X
502
503#include AAX_ALIGN_FILE_BEGIN
504#include AAX_ALIGN_FILE_HOST
505#include AAX_ALIGN_FILE_END
506
507#endif
508
535 int32_t fSize;
536 int32_t fVersion;
541 unsigned char fName[32];
542};
544
550 int32_t fSize;
551 int32_t fVersion;
556 unsigned char fName[32];
557 char fData[1];
558};
560
570};
572
573#ifndef _TMS320C6X
574#include AAX_ALIGN_FILE_BEGIN
575#include AAX_ALIGN_FILE_RESET
576#include AAX_ALIGN_FILE_END
577#endif
578
579#ifndef TI_VERSION
580static inline bool operator==(const AAX_SPlugInIdentifierTriad& v1, const AAX_SPlugInIdentifierTriad& v2)
581{
582 return ((v1.mManufacturerID == v2.mManufacturerID) &&
583 (v1.mProductID == v2.mProductID) &&
584 (v1.mPlugInID == v2.mPlugInID));
585}
586
587static inline bool operator!=(const AAX_SPlugInIdentifierTriad& v1, const AAX_SPlugInIdentifierTriad& v2)
588{
589 return false == operator==(v1, v2);
590}
591
592static inline bool operator<(const AAX_SPlugInIdentifierTriad & lhs, const AAX_SPlugInIdentifierTriad & rhs)
593{
594 if (lhs.mManufacturerID < rhs.mManufacturerID)
595 return true;
596
597 if (lhs.mManufacturerID == rhs.mManufacturerID)
598 {
599 if (lhs.mProductID < rhs.mProductID)
600 return true;
601
602 if (lhs.mProductID == rhs.mProductID)
603 if (lhs.mPlugInID < rhs.mPlugInID)
604 return true;
605 }
606 return false;
607}
608
609static inline bool operator>=(const AAX_SPlugInIdentifierTriad & lhs, const AAX_SPlugInIdentifierTriad & rhs)
610{
611 return false == operator<(lhs, rhs);
612}
613
614static inline bool operator>(const AAX_SPlugInIdentifierTriad & lhs, const AAX_SPlugInIdentifierTriad & rhs)
615{
616 return operator>=(lhs, rhs) && operator!=(lhs, rhs);
617}
618
619static inline bool operator<=(const AAX_SPlugInIdentifierTriad & lhs, const AAX_SPlugInIdentifierTriad & rhs)
620{
621 return false == operator>(lhs, rhs);
622}
623#endif //TI_VERSION
624
625
626//<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.
627#if ( defined(_WIN64) || defined(__LP64__) || defined(_TMS320C6X) )
628 #include AAX_ALIGN_FILE_BEGIN
629 #include AAX_ALIGN_FILE_ALG
630 #include AAX_ALIGN_FILE_END
631#else
632 #if defined (__GNUC__)
633 #pragma options align=power // To maintain backwards-compatibility with pre-10 versions of Pro Tools
634 #else // Windows, other
635 #include AAX_ALIGN_FILE_BEGIN
636 #include AAX_ALIGN_FILE_HOST
637 #include AAX_ALIGN_FILE_END
638 #endif
639#endif
640
649{
650 uint32_t mTimestamp;
651 uint32_t mLength;
652 unsigned char mData[4];
654};
655
674{
675 uint32_t mBufferSize;
677};
678
679#if ( defined(_WIN64) || defined(__LP64__) || defined(_TMS320C6X) )
680 #include AAX_ALIGN_FILE_BEGIN
681 #include AAX_ALIGN_FILE_RESET
682 #include AAX_ALIGN_FILE_END
683#else
684 #if defined (__GNUC__)
685 #pragma pack() // To maintian backwards-compatibility with pre-10 versions of Pro Tools
686 #else
687 #include AAX_ALIGN_FILE_BEGIN
688 #include AAX_ALIGN_FILE_RESET
689 #include AAX_ALIGN_FILE_END
690 #endif
691#endif
692
694#endif // #ifndef _AAX_H_
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: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:98
bool operator<(const AAX_Point &p1, const AAX_Point &p2)
Definition: AAX_GUITypes.h:83
bool operator>(const AAX_Point &p1, const AAX_Point &p2)
Definition: AAX_GUITypes.h:93
Utility functions for byte-swapping. Used by AAX_CChunkDataParser.
#define AAX_STEM_FORMAT_CHANNEL_COUNT(aStemFormat)
Definition: AAX_Enums.h:216
@ AAX_eSampleRateMask_No
Definition: AAX_Enums.h:877
@ AAX_eSampleRateMask_176400
Definition: AAX_Enums.h:883
@ AAX_eSampleRateMask_44100
Definition: AAX_Enums.h:879
@ AAX_eSampleRateMask_48000
Definition: AAX_Enums.h:880
@ AAX_eSampleRateMask_88200
Definition: AAX_Enums.h:881
@ AAX_eSampleRateMask_192000
Definition: AAX_Enums.h:884
@ AAX_eSampleRateMask_96000
Definition: AAX_Enums.h:882
AAX_EStemFormat
Stem format definitions.
Definition: AAX_Enums.h:243
Definitions of error codes used by AAX plug-ins.
const char * AAX_CParamID
Parameter identifier.
Definition: AAX.h:362
AAX_CONSTEXPR size_t kAAX_ParameterIdentifierMaxSize
Definition: AAX.h:377
int32_t AAX_CIndex
Definition: AAX.h:337
uint32_t getMaskForSampleRate(float inSR)
Returns the AAX_ESampleRateMask selector for a literal sample rate.
Definition: AAX.h:488
float AAX_CSampleRate
Literal sample rate value used by the sample rate field. For AAX_eProperty_SampleRate,...
Definition: AAX.h:344
int64_t AAX_CTimeOfDay
Hardware running clock value. MIDI packet time stamps are measured against this clock....
Definition: AAX.h:342
int64_t AAX_CPropertyValue64
64-bit property values
Definition: AAX.h:349
const char * AAX_CEffectID
URL-style Effect identifier. Must be unique among all registered effects in the collection.
Definition: AAX.h:364
int32_t AAX_Result
Definition: AAX.h:347
acfUID AAX_Feature_UID
Definition: AAX.h:374
float *const * AAX_CAudioOutPort
AAX algorithm audio output port data type
Definition: AAX.h:431
_acfUID acfUID
Definition: AAX.h:368
AAX_CSelector AAX_CMeterID
Definition: AAX.h:361
AAX_CPropertyValue AAX_CPointerPropertyValue
Pointer-sized property values.
Definition: AAX.h:351
AAX_CSelector AAX_CComponentID
Definition: AAX.h:360
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:469
int32_t AAX_CTargetPlatform
Matches type of target platform.
Definition: AAX.h:357
const float *const * AAX_CAudioInPort
AAX algorithm audio input port data type
Definition: AAX.h:419
AAX_CIndex AAX_CCount
Definition: AAX.h:338
uint8_t AAX_CBoolean
Cross-compiler boolean type used by AAX interfaces.
Definition: AAX.h:339
float *const AAX_CMeterPort
AAX algorithm meter port data type
Definition: AAX.h:444
#define AAX_CONSTEXPR
constexpr keyword macro
Definition: AAX.h:175
int64_t AAX_CTimestamp
Time stamp value. Measured against the DAE clock (see AAX_IComponentDescriptor::AddClock() )
Definition: AAX.h:341
struct AAX_SPlugInChunk * AAX_SPlugInChunkPtr
Definition: AAX.h:559
int32_t AAX_CPropertyValue
32-bit property values
Definition: AAX.h:348
AAX_CParamID AAX_CPageTableParamID
Parameter identifier used in a page table.
Definition: AAX.h:363
int64_t AAX_CTransportCounter
Offset of samples from transport start. Same as TimeOfDay, but added for new interfaces as TimeOfDay ...
Definition: AAX.h:343
uint32_t AAX_CTypeID
Matches type of OSType used in classic plugins.
Definition: AAX.h:346
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:453
AAX_CIndex AAX_CFieldIndex
Not used by AAX plug-ins (except in AAX_FIELD_INDEX macro)
Definition: AAX.h:359
uint32_t AAX_CSelector
Definition: AAX.h:340
struct AAX_SPlugInIdentifierTriad * AAX_SPlugInIdentifierTriadPtr
Definition: AAX.h:571
Version stamp header for the AAX SDK.
Contains IDs for properties that can be added to an AAX_IPropertyMap.
Definition: AAX_ACFInterface.doxygen:229
Plug-in chunk header.
Definition: AAX.h:534
AAX_CTypeID fChunkID
The ID of a particular Plug-In chunk.
Definition: AAX.h:540
AAX_CTypeID fPlugInID
The ID of a particular Plug-In within the file.
Definition: AAX.h:539
int32_t fVersion
The chunk's version.
Definition: AAX.h:536
AAX_CTypeID fManufacturerID
The Plug-In's manufacturer ID.
Definition: AAX.h:537
unsigned char fName[32]
A user defined name for this chunk.
Definition: AAX.h:541
int32_t fSize
The size of the chunk's fData member.
Definition: AAX.h:535
AAX_CTypeID fProductID
The Plug-In file's product ID.
Definition: AAX.h:538
Plug-in chunk header + data.
Definition: AAX.h:549
AAX_CTypeID fChunkID
The ID of a particular Plug-In chunk.
Definition: AAX.h:555
unsigned char fName[32]
A user defined name for this chunk.
Definition: AAX.h:556
AAX_CTypeID fManufacturerID
The Plug-In's manufacturer ID.
Definition: AAX.h:552
char fData[1]
The chunk's data.
Definition: AAX.h:557
AAX_CTypeID fProductID
The Plug-In file's product ID.
Definition: AAX.h:553
int32_t fSize
The size of the chunk's fData member.
Definition: AAX.h:550
int32_t fVersion
The chunk's version.
Definition: AAX.h:551
AAX_CTypeID fPlugInID
The ID of a particular Plug-In within the file.
Definition: AAX.h:554
Plug-in Identifier Triad.
Definition: AAX.h:566
AAX_CTypeID mProductID
The Plug-In's product (Effect) ID.
Definition: AAX.h:568
AAX_CTypeID mPlugInID
The ID of a specific type in the product (Effect)
Definition: AAX.h:569
AAX_CTypeID mManufacturerID
The Plug-In's manufacturer ID.
Definition: AAX.h:567
Packet structure for MIDI data.
Definition: AAX.h:649
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:650
uint32_t mLength
The length of MIDI message, in terms of bytes.
Definition: AAX.h:651
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:652
AAX_CBoolean mIsImmediate
Indicates that the message is to be sent as soon as possible.
Definition: AAX.h:653
MIDI stream data structure used by AAX_IMIDINode.
Definition: AAX.h:674
AAX_CMidiPacket * mBuffer
Pointer to the first element of the node's buffer.
Definition: AAX.h:676
uint32_t mBufferSize
The number of AAX_CMidiPacket objects contained in the node's buffer.
Definition: AAX.h:675