AAX SDK  2.1.1
Avid Audio Extensions Development Kit
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AAX.h
Go to the documentation of this file.
1 /*================================================================================================*/
2 /*
3 
4  * Copyright 2013 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 Technolgy, INC.
13  *
14  */
15 
28 /*================================================================================================*/
29 
30 
31 #pragma once
32 
33 #ifndef _AAX_H_
34 #define _AAX_H_
35 
36 #include <stdint.h>
37 #include <stddef.h>
38 
39 #include "AAX_Version.h"
40 #include "AAX_Enums.h"
41 #include "AAX_Errors.h"
42 #include "AAX_Properties.h"
43 
44 
57 
59 #if ( defined(_WIN64) || defined(__LP64__) )
60  #define AAX_ALIGN_FILE_HOST "AAX_Push8ByteStructAlignment.h"
61 #else
62  #define AAX_ALIGN_FILE_HOST "AAX_Push2ByteStructAlignment.h"
63 #endif
64 #define AAX_ALIGN_FILE_ALG "AAX_Push8ByteStructAlignment.h"
66 #define AAX_ALIGN_FILE_RESET "AAX_PopStructAlignment.h"
68 
69 
70 #ifndef AAX_CALLBACK
71 # ifdef _MSC_VER
72 # define AAX_CALLBACK __cdecl
73 # else
74 # define AAX_CALLBACK
75 # endif
76 #endif // AAX_CALLBACK
77 
78 
79 #ifdef _MSC_VER
80 # define AAX_RESTRICT
81 #elif defined(_TMS320C6X) // TI
82 # define AAX_RESTRICT restrict
83 #elif defined (__GNUC__)// Mac
84 # define AAX_RESTRICT __restrict__
85 #endif // _MSC_VER
86 
87 #ifdef _MSC_VER
88 // Disable unknown pragma warning for TI pragmas under VC++
89 #pragma warning( disable : 4068 )
90 #endif
91 
104 #define AAX_FIELD_INDEX( aContextType, aMember ) \
105  ((AAX_CFieldIndex) (offsetof (aContextType, aMember) / sizeof (void *)))
106 
107 
108 typedef int32_t AAX_CIndex;
110 typedef uint8_t AAX_CBoolean;
111 typedef uint32_t AAX_CSelector;
112 typedef int64_t AAX_CTimestamp;
113 typedef int64_t AAX_CTimeOfDay;
114 typedef int64_t AAX_CTransportCounter;
115 typedef float AAX_CSampleRate;
116 
117 typedef uint32_t AAX_CTypeID;
118 typedef int32_t AAX_Result;
119 typedef int32_t AAX_CPropertyValue;
120 
121 
122 static const AAX_CTimestamp kAAX_Never = (AAX_CTimestamp) ~0ULL;
123 
124 
128 typedef const char * AAX_CParamID;
129 typedef const char * AAX_CEffectID;
130 
131 
133 #ifdef _TMS320C6X
134  // TI's C compiler defaults to 8 byte alignment of doubles
135  #define AAX_ALIGNED(v)
136 #elif defined(__GNUC__)
137  #define AAX_ALIGNED(v) __attribute__((aligned(v)))
138 #elif defined(_MSC_VER)
139  #define AAX_ALIGNED(v) __declspec(align(v))
140 #else
141  #error Teach me to align data types with this compiler.
142 #endif
143 
149 typedef AAX_ALIGNED(8) double AAX_AlignedDouble;
150 
151 
157 static
158 inline
159 int32_t
160 AAX_GetStemFormatChannelCount (
161  AAX_EStemFormat inStemFormat)
162 {
163  return AAX_STEM_FORMAT_CHANNEL_COUNT (inStemFormat);
164 }
165 
166 
176 typedef const float * const * AAX_CAudioInPort;
177 
178 
188 typedef float * const * AAX_CAudioOutPort;
189 
190 
201 typedef float * const AAX_CMeterPort;
202 
203 
210 inline AAX_CBoolean sampleRateInMask(AAX_CSampleRate inSR, uint32_t iMask)
211 {
212  return static_cast<AAX_CBoolean>(
213  (44100.0 == inSR) ? ((iMask & AAX_eSampleRateMask_44100) != 0) :
214  (48000.0 == inSR) ? ((iMask & AAX_eSampleRateMask_48000) != 0) :
215  (88200.0 == inSR) ? ((iMask & AAX_eSampleRateMask_88200) != 0) :
216  (96000.0 == inSR) ? ((iMask & AAX_eSampleRateMask_96000) != 0) :
217  (176400.0 == inSR) ? ((iMask & AAX_eSampleRateMask_176400) != 0) :
218  (192000.0 == inSR) ? ((iMask & AAX_eSampleRateMask_192000) != 0) : false
219  );
220 }
221 
222 
223 #ifndef _TMS320C6X
224 #include AAX_ALIGN_FILE_HOST
225 
251  int32_t fSize;
252  int32_t fVersion;
257  unsigned char fName[32];
258  char fData[1];
259 };
261 
271 };
273 #include AAX_ALIGN_FILE_RESET
274 #endif
275 
276 
277 //<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.
278 #if ( defined(_WIN64) || defined(__LP64__) || defined(_TMS320C6X) )
279  #include AAX_ALIGN_FILE_ALG
280 #else
281  #if defined (__GNUC__)
282  #pragma options align=power // To maintain backwards-compatibility with pre-10 versions of Pro Tools
283  #else // Windows, other
284  #include AAX_ALIGN_FILE_HOST
285  #endif
286 #endif
287 
296 {
297  uint32_t mTimestamp;
298  uint32_t mLength;
299  unsigned char mData[4];
301 };
302 
321 {
322  uint32_t mBufferSize;
324 };
325 
326 #if ( defined(_WIN64) || defined(__LP64__) || defined(_TMS320C6X) )
327  #include AAX_ALIGN_FILE_RESET
328 #else
329  #if defined (__GNUC__)
330  #pragma pack() // To maintian backwards-compatibility with pre-10 versions of Pro Tools
331  #else
332  #include AAX_ALIGN_FILE_RESET
333  #endif
334 #endif
335 
336 #endif // #ifndef _AAX_H_
Packet structure for MIDI data.
Definition: AAX.h:295
AAX_CSelector AAX_CMeterID
Definition: AAX.h:127
AAX_CTypeID fProductID
The Plug-In file&#39;s product ID.
Definition: AAX.h:254
Contains IDs for properties that can be added to an AAX_IPropertyMap.
int32_t AAX_CPropertyValue
Definition: AAX.h:119
Version stamp header for the AAX SDK.
uint32_t mLength
The length of MIDI message, in terms of bytes.
Definition: AAX.h:298
Definition: AAX_Enums.h:474
Definitions of error codes used by AAX plug-ins.
int64_t AAX_CTransportCounter
Offset of samples from transport start. Same as TimeOfDay, but added for new interfaces as TimeOfDay ...
Definition: AAX.h:114
AAX_CTypeID fManufacturerID
The Plug-In&#39;s manufacturer ID.
Definition: AAX.h:253
MIDI stream data structure used by AAX_IMIDINode.
Definition: AAX.h:320
AAX_CTypeID mPlugInID
The ID of a specific type in the product (Effect)
Definition: AAX.h:270
AAX_CIndex AAX_CCount
Definition: AAX.h:109
uint8_t AAX_CBoolean
Cross-compiler boolean type used by AAX interfaces.
Definition: AAX.h:110
int64_t AAX_CTimestamp
Time stamp value. Measured against the DAE clock (see AAX_IComponentDescriptor::AddClock() ) ...
Definition: AAX.h:112
AAX_CTypeID fPlugInID
The ID of a particular Plug-In within the file.
Definition: AAX.h:255
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:299
const char * AAX_CEffectID
URL-style Effect identifier. Must be unique among all registered effects in the collection.
Definition: AAX.h:129
Definition: AAX_Enums.h:471
typedef AAX_ALIGNED(8) double AAX_AlignedDouble
A cross-platform alignment macro to ensure a data type is aligned properly.
uint32_t AAX_CTypeID
Matches type of OSType used in classic plugins.
Definition: AAX.h:117
struct AAX_SPlugInChunk * AAX_SPlugInChunkPtr
Definition: AAX.h:260
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:297
float *const AAX_CMeterPort
AAX algorithm meter port data type.
Definition: AAX.h:201
Plug-in Identifier Triad.
Definition: AAX.h:267
uint32_t mBufferSize
The number of AAX_CMidiPacket objects contained in the node&#39;s buffer.
Definition: AAX.h:322
Utility functions for byte-swapping. Used by AAX_CChunkDataParser.
int32_t AAX_Result
Definition: AAX.h:118
Definition: AAX_Enums.h:472
const float *const * AAX_CAudioInPort
AAX algorithm audio input port data type.
Definition: AAX.h:176
Definition: AAX_Enums.h:473
float AAX_CSampleRate
Literal sample rate value used by the sample rate field. For AAX_eProperty_SampleRate, use a mask of AAX_ESampleRateMask.
Definition: AAX.h:115
uint32_t AAX_CSelector
Definition: AAX.h:111
unsigned char fName[32]
A user defined name for this chunk.
Definition: AAX.h:257
int32_t fVersion
The chunk&#39;s version.
Definition: AAX.h:252
Definition: AAX_Enums.h:470
float *const * AAX_CAudioOutPort
AAX algorithm audio output port data type.
Definition: AAX.h:188
AAX_CMidiPacket * mBuffer
Pointer to the first element of the node&#39;s buffer.
Definition: AAX.h:323
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:210
struct AAX_SPlugInIdentifierTriad * AAX_SPlugInIdentifierTriadPtr
Definition: AAX.h:272
AAX_CTypeID mManufacturerID
The Plug-In&#39;s manufacturer ID.
Definition: AAX.h:268
AAX_CSelector AAX_CComponentID
Definition: AAX.h:126
AAX_CIndex AAX_CFieldIndex
Not used by AAX plug-ins (except in AAX_FIELD_INDEX macro)
Definition: AAX.h:125
AAX_EStemFormat
Definition: AAX_Enums.h:216
Plug-in chunk header.
Definition: AAX.h:250
#define AAX_STEM_FORMAT_CHANNEL_COUNT(aStemFormat)
Definition: AAX_Enums.h:213
const char * AAX_CParamID
Parameter identifier.
Definition: AAX.h:128
AAX_CTypeID mProductID
The Plug-In&#39;s product (Effect) ID.
Definition: AAX.h:269
int32_t fSize
The size of the chunk&#39;s fData member.
Definition: AAX.h:251
AAX_CTypeID fChunkID
The ID of a particular Plug-In chunk.
Definition: AAX.h:256
int32_t AAX_CIndex
Definition: AAX.h:108
int64_t AAX_CTimeOfDay
Hardware running clock value. MIDI packet time stamps are measured against this clock. This is actually the same as TransportCounter, but kept for compatibility.
Definition: AAX.h:113
Definition: AAX_Enums.h:469
char fData[1]
The chunk&#39;s data.
Definition: AAX.h:258
AAX_CBoolean mIsImmediate
Indicates that the message is to be sent as soon as possible.
Definition: AAX.h:300