diff --git a/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX.h b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX.h new file mode 100644 index 0000000000..f742e860a7 --- /dev/null +++ b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX.h @@ -0,0 +1,695 @@ +/*================================================================================================*/ +/* + + * Copyright 2013-2017, 2019, 2023-2024 Avid Technology, Inc. + * All rights reserved. + * + * This file is part of the Avid AAX SDK. + * + * The AAX SDK is subject to commercial or open-source licensing. + * + * By using the AAX SDK, you agree to the terms of both the Avid AAX SDK License + * Agreement and Avid Privacy Policy. + * + * AAX SDK License: https://developer.avid.com/aax + * Privacy Policy: https://www.avid.com/legal/privacy-policy-statement + * + * Or: You may also use this code under the terms of the GPL v3 (see + * www.gnu.org/licenses). + * + * THE AAX SDK IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER + * EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE + * DISCLAIMED. + * + */ + +/** + * \file AAX.h + * + * \brief Various utility definitions for %AAX + * + * \internal + * \todo Here and elsewhere: headers are included that include this header. Is this something that + * should be addressed? + * + * \todo Break up AAX.h into a series of targeted utility headers + * \endinternal + */ +/*================================================================================================*/ + + +#pragma once + +/// @cond ignore +#ifndef _AAX_H_ +#define _AAX_H_ +/// @endcond + +#include +#include + +#include "AAX_Version.h" +#include "AAX_Enums.h" +#include "AAX_Errors.h" +#include "AAX_Properties.h" + + + +/** @name C++ compiler macros + */ +//@{ +/** @def TI_VERSION + @brief Preprocessor flag indicating compilation for TI + */ +/** @def AAX_CPP11_SUPPORT + @brief Preprocessor toggle for code which requires C++11 compiler support + */ +//@} C++ compiler macros + +#ifndef TI_VERSION + #if defined _TMS320C6X + #define TI_VERSION 1 + #elif defined DOXYGEN_PREPROCESSOR + #define TI_VERSION 0 + #endif +#endif + + +#ifndef AAX_CPP11_SUPPORT + #if (defined __cplusplus) && (__cplusplus >= 201103L) + #define AAX_CPP11_SUPPORT 1 + // VS2015 supports all features except expression SFINAE + #elif ((defined _MSVC_LANG) && (_MSVC_LANG >= 201402)) + #define AAX_CPP11_SUPPORT 1 + // Let Doxygen see the C++11 version of all code + #elif defined DOXYGEN_PREPROCESSOR + #define AAX_CPP11_SUPPORT 1 + #endif +#endif + + +/** @name C++ keyword macros + + Use these macros for keywords which may not be supported on all compilers + + \warning Be careful when using these macros; they are a workaround and the + fallback versions of the macros are not guaranteed to provide identical + behavior to the fully-supported versions. Always consider the code which + will be generated in each case! + + \warning If your code is protected with PACE Fusion and you are using a PACE + SDK prior to v4 then you must explicitly define AAX_CPP11_SUPPORT 0 + in your project's preprocessor settings to avoid encountering source + failover caused by %AAX header includes with exotic syntax. + + \internal + \warning Never use keyword macros which could impact the binary + representation of an interface in any interface which will be + passed across the library boundary. This mostly applies to + macros which apply to implicitly-defined constructors: + - \ref AAX_DEFAULT_CTOR + - \ref AAX_DEFAULT_COPY_CTOR + - \ref AAX_DEFAULT_MOVE_CTOR + - \ref AAX_DEFAULT_ASGN_OPER + - \ref AAX_DEFAULT_MOVE_OPER + - \ref AAX_DELETE + \endinternal + */ +//@{ +/** @def AAX_OVERRIDE + @brief \c override keyword macro + */ +/** @def AAX_FINAL + @brief \c final keyword macro + */ +/** @def AAX_DEFAULT_CTOR + @brief \c default keyword macro for a class default constructor + */ +/** @def AAX_DEFAULT_COPY_CTOR + @brief \c default keyword macro for a class copy constructor + */ +/** @def AAX_DEFAULT_MOVE_CTOR + @brief \c default keyword macro for a class move constructor + */ +/** @def AAX_DEFAULT_ASGN_OPER + @brief \c default keyword macro for a class assignment operator + */ +/** @def AAX_DEFAULT_MOVE_OPER + @brief \c default keyword macro for a class move-assignment operator + */ +/** @def AAX_DELETE + @brief \c delete keyword macro + + \warning The non-C++11 version of this macro assumes \p public declaration access + */ +/** @def AAX_CONSTEXPR + @brief \c constexpr keyword macro + */ +//@} C++ keyword macros + +#if AAX_CPP11_SUPPORT +# define AAX_OVERRIDE override +# define AAX_FINAL final +# define AAX_DEFAULT_DTOR(X) ~X() = default +# define AAX_DEFAULT_DTOR_OVERRIDE(X) ~X() override = default +# define AAX_DEFAULT_CTOR(X) X() = default +# define AAX_DEFAULT_COPY_CTOR(X) X(const X&) = default +# define AAX_DEFAULT_ASGN_OPER(X) X& operator=(const X&) = default +# define AAX_DELETE(X) X = delete +# define AAX_DEFAULT_MOVE_CTOR(X) X(X&&) = default +# define AAX_DEFAULT_MOVE_OPER(X) X& operator=(X&&) = default +# define AAX_CONSTEXPR constexpr +# define AAX_UNIQUE_PTR(X) std::unique_ptr +#else +# define AAX_OVERRIDE +# define AAX_FINAL +# define AAX_DEFAULT_DTOR(X) ~X() {} +# define AAX_DEFAULT_DTOR_OVERRIDE(X) ~X() {} +# define AAX_DEFAULT_CTOR(X) X() {} +# define AAX_DEFAULT_COPY_CTOR(X) +# define AAX_DEFAULT_MOVE_CTOR(X) +# define AAX_DEFAULT_ASGN_OPER(X) +# define AAX_DEFAULT_MOVE_OPER(X) +// Assumes public access in the declaration scope where AAX_DELETE is used +# define AAX_DELETE(X) private: X; public: +# define AAX_CONSTEXPR const +# define AAX_UNIQUE_PTR(X) std::auto_ptr +#endif + + +/** @name Pointer definitions + */ +//@{ +/** @def AAXPointer_32bit + @brief When AAX_PointerSize == AAXPointer_32bit this is a 32-bit build + */ +/** @def AAXPointer_64bit + @brief When AAX_PointerSize == AAXPointer_64bit this is a 64-bit build + */ +/** @def AAX_PointerSize + @brief Use this definition to check the pointer size in the current build. + + @sa @ref AAXPointer_32bit + @sa @ref AAXPointer_64bit + */ +//@} Pointer definitions +#define AAXPointer_32bit 1 +#define AAXPointer_64bit 2 + +#if !defined(AAX_PointerSize) + #if defined(_M_X64) || defined (__LP64__) + #define AAX_PointerSize AAXPointer_64bit + #else + #define AAX_PointerSize AAXPointer_32bit + #endif +#endif + +// ensure that preprocessor comparison logic gives the correct result +#if ((AAX_PointerSize == AAXPointer_32bit) && (defined(_M_X64) || defined (__LP64__))) + #error incorrect result of AAX_PointerSize check! +#elif ((AAX_PointerSize == AAXPointer_64bit) && !(defined(_M_X64) || defined (__LP64__))) + #error incorrect result of AAX_PointerSize check! +#endif + + +/** @name Alignment macros + * + * Use these macros to define struct packing alignment for data structures that will be + * sent across binary or platform boundaries. + * +\code + #include AAX_ALIGN_FILE_BEGIN + #include AAX_ALIGN_FILE_HOST + #include AAX_ALIGN_FILE_END + // Structure definition + #include AAX_ALIGN_FILE_BEGIN + #include AAX_ALIGN_FILE_RESET + #include AAX_ALIGN_FILE_END +\endcode + * + * See the documentation for each macro for individual usage notes and warnings + */ +//@{ +/** @def AAX_ALIGN_FILE_HOST + @brief Macro to set alignment for data structures that are shared with the host + + @details + This macro is used to set alignment for data structures that are part of the %AAX ABI. + You should not need to use this macro for any custom data structures in your plug-in. + */ + +/** @def AAX_ALIGN_FILE_ALG + @brief Macro to set alignment for data structures that are used in the alg + + @details + IMPORTANT: Be very careful to maintain correct data alignment when sending data + structures between platforms. + + \warning + \li This macro does not guarantee data alignment compatibility for data structures + which include base classes/structs or virtual functions. The MSVC, GCC and LLVM/clang, + and CCS (TI) compilers do not support data structure cross-compatibility for these types + of structures. clang will now present a warning when these macros are used on any such + structures: \#pragma ms_struct can not be used with dynamic classes or structures + \li Struct Member Alignment (/Zp) on Microsoft compilers must be set to a minimum of + 8-byte packing in order for this macro to function properly. For more information, see + this MSDN article:
http://msdn.microsoft.com/en-us/library/ms253935.aspx + */ + +/** @def AAX_ALIGN_FILE_RESET + @brief Macro to reset alignment back to default + */ + +/** @def AAX_ALIGN_FILE_BEGIN + @brief Wrapper macro used for warning suppression + + @details This wrapper is required in llvm 10.0 and later due to the addition of the + @c -Wpragma-pack warning. This is a useful compiler warning but it is awkward to properly + suppress in cases where we are intentionally including only part of the push/pop + sequence in a single file, as with the @c AAX_ALIGN_FILE_XXX macros. + */ + + /** @def AAX_ALIGN_FILE_END + @copydoc AAX_ALIGN_FILE_BEGIN + */ +//@} Alignment macros + +#if ( defined(_WIN64) || defined(__LP64__) ) + #define AAX_ALIGN_FILE_HOST "AAX_Push8ByteStructAlignment.h" +#elif ( defined(_TMS320C6X) ) + // AAX_ALIGN_FILE_HOST is not compatible with this compiler + // We don't use an #error here b/c that causes Doxygen to get confused +#else + #define AAX_ALIGN_FILE_HOST "AAX_Push2ByteStructAlignment.h" +#endif +#define AAX_ALIGN_FILE_ALG "AAX_Push8ByteStructAlignment.h" +#define AAX_ALIGN_FILE_RESET "AAX_PopStructAlignment.h" +#define AAX_ALIGN_FILE_BEGIN "AAX_PreStructAlignmentHelper.h" +#define AAX_ALIGN_FILE_END "AAX_PostStructAlignmentHelper.h" + + +#ifndef AAX_CALLBACK +# ifdef _MSC_VER +# define AAX_CALLBACK __cdecl +# else +# define AAX_CALLBACK +# endif +#endif // AAX_CALLBACK + + +#ifdef _MSC_VER +# define AAX_RESTRICT +#elif defined(_TMS320C6X) // TI +# define AAX_RESTRICT restrict +#elif defined (__GNUC__)// Mac +# define AAX_RESTRICT __restrict__ +#endif // _MSC_VER + + +// preprocessor helper macros +#define AAX_PREPROCESSOR_CONCAT_HELPER(X,Y) X ## Y +#define AAX_PREPROCESSOR_CONCAT(X,Y) AAX_PREPROCESSOR_CONCAT_HELPER(X,Y) + + + +#ifdef _MSC_VER +// Disable unknown pragma warning for TI pragmas under VC++ +#pragma warning( disable : 4068 ) +#endif + + +/** @brief Compute the index used to address a context field. + + @details + This macro expands to a constant expression suitable for use in enumerator + definitions and case labels so int32_t as @p aMember is a constant specifier. + + @param[in] aContextType + The name of context type + + @param[in] aMember + The name or other specifier of a field of that context type +*/ +#define AAX_FIELD_INDEX( aContextType, aMember ) \ + ((AAX_CFieldIndex) (offsetof (aContextType, aMember) / sizeof (void *))) + + +typedef int32_t AAX_CIndex; //!< \todo Not used by %AAX plug-ins (except as \ref AAX_CFieldIndex) +typedef AAX_CIndex AAX_CCount; //!< \todo Not used by %AAX plug-ins +typedef uint8_t AAX_CBoolean; //!< Cross-compiler boolean type used by %AAX interfaces +typedef uint32_t AAX_CSelector; //!< \todo Clean up usage; currently used for a variety of ID-related values +typedef int64_t AAX_CTimestamp; //!< Time stamp value. Measured against the DAE clock (see \ref AAX_IComponentDescriptor::AddClock() ) +typedef 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. +typedef int64_t AAX_CTransportCounter; //!< Offset of samples from transport start. Same as TimeOfDay, but added for new interfaces as TimeOfDay is a confusing name. +typedef float AAX_CSampleRate; //!< Literal sample rate value used by the \ref AAX_IComponentDescriptor::AddSampleRate() "sample rate field". For \ref AAX_eProperty_SampleRate, use a mask of \ref AAX_ESampleRateMask. \sa sampleRateInMask + +typedef uint32_t AAX_CTypeID; //!< Matches type of OSType used in classic plugins. +typedef int32_t AAX_Result; +typedef int32_t AAX_CPropertyValue; //!< \brief 32-bit property values \details Use this property value type for all properties unless otherwise specified by the property documentation +typedef int64_t AAX_CPropertyValue64; //!< \brief 64-bit property values \details Do not use this value type unless specified explicitly in the property documentation +#if AAX_PointerSize == AAXPointer_32bit + typedef AAX_CPropertyValue AAX_CPointerPropertyValue; //!< \brief Pointer-sized property values \details Do not use this value type unless specified explicitly in the property documentation +#elif AAX_PointerSize == AAXPointer_64bit + typedef AAX_CPropertyValue64 AAX_CPointerPropertyValue; //!< \brief Pointer-sized property values \details Do not use this value type unless specified explicitly in the property documentation +#else + #error unexpected pointer size +#endif +typedef int32_t AAX_CTargetPlatform; //!< Matches type of \ref AAX_ETargetPlatform "target platform + +typedef AAX_CIndex AAX_CFieldIndex; //!< Not used by %AAX plug-ins (except in \ref AAX_FIELD_INDEX macro) +typedef AAX_CSelector AAX_CComponentID; //!< \todo Not used by %AAX plug-ins +typedef AAX_CSelector AAX_CMeterID; //!< \todo Not used by %AAX plug-ins +typedef const char * AAX_CParamID; //!< Parameter identifier \note While this is a string, it must be less than 32 characters in length. (strlen of 31 or less) \sa \ref kAAX_ParameterIdentifierMaxSize +typedef AAX_CParamID AAX_CPageTableParamID; //!< \brief Parameter identifier used in a page table \details May be a parameter ID or a parameter name string depending on the page table formatting. Must be less than 32 characters in length (strlen of 31 or less.) \sa \ref subsection_parameter_identifiers in the \ref AAX_Page_Table_Guide +typedef const char * AAX_CEffectID; //!< URL-style Effect identifier. Must be unique among all registered effects in the collection. + +// Forward declarations required for AAX_Feature_UID typedef (the "real" typedef is in AAX_UIDs.h) +struct _acfUID; +typedef _acfUID acfUID; + +/** Identifier for %AAX features + + See \ref AAX_IDescriptionHost::AcquireFeatureProperties() and \ref AAX_IFeatureInfo + */ +typedef acfUID AAX_Feature_UID; + +/** Maximum size for a \ref AAX_CParamID including the null-terminating character */ +AAX_CONSTEXPR size_t kAAX_ParameterIdentifierMaxSize = 32; + +static const AAX_CTimestamp kAAX_Never = (AAX_CTimestamp) ~0ULL; + + +/** @brief A cross-platform alignment macro to ensure a data type is aligned properly. */ +#ifdef _TMS320C6X + // TI's C compiler defaults to 8 byte alignment of doubles + #define AAX_ALIGNED(v) +#elif defined(__GNUC__) + #define AAX_ALIGNED(v) __attribute__((aligned(v))) +#elif defined(_MSC_VER) + #define AAX_ALIGNED(v) __declspec(align(v)) +#else + #error Teach me to align data types with this compiler. +#endif + + +/** + + \todo Not used by %AAX plug-ins - remove? + + */ +static +inline +int32_t +AAX_GetStemFormatChannelCount ( + AAX_EStemFormat inStemFormat) +{ + return AAX_STEM_FORMAT_CHANNEL_COUNT (inStemFormat); +} + + +/*! \brief %AAX algorithm audio input port data type + * + * \details + * Audio input ports are provided with a pointer to an array + * of const audio buffers, with one buffer provided per input or + * side chain channel. + * + * \todo Not used directly by %AAX plug-ins + */ +typedef const float * const * AAX_CAudioInPort; + + +/*! \brief %AAX algorithm audio output port data type + * + * \details + * Audio output ports are provided with a pointer to an array + * of audio buffers, with one buffer provided per output or + * auxiliary output channel. + * + * \todo Not used directly by %AAX plug-ins + */ +typedef float * const * AAX_CAudioOutPort; + + +/*! \brief %AAX algorithm meter port data type + * + * \details + * Meter output ports are provided with a pointer to an array + * of floats, with one float provided per meter tap. The + * algorithm is responsible for setting these to the + * corresponding per-buffer peak sample values. + * + * \todo Not used directly by %AAX plug-ins + */ +typedef float * const AAX_CMeterPort; + + +/*! \brief Determines whether a particular \ref AAX_CSampleRate is present + in a given mask of \ref AAX_ESampleRateMask. + + \details + \sa kAAX_Property_SampleRate + */ +inline AAX_CBoolean sampleRateInMask(AAX_CSampleRate inSR, uint32_t iMask) +{ + return static_cast( + (44100.0 == inSR) ? ((iMask & AAX_eSampleRateMask_44100) != 0) : + (48000.0 == inSR) ? ((iMask & AAX_eSampleRateMask_48000) != 0) : + (88200.0 == inSR) ? ((iMask & AAX_eSampleRateMask_88200) != 0) : + (96000.0 == inSR) ? ((iMask & AAX_eSampleRateMask_96000) != 0) : + (176400.0 == inSR) ? ((iMask & AAX_eSampleRateMask_176400) != 0) : + (192000.0 == inSR) ? ((iMask & AAX_eSampleRateMask_192000) != 0) : false + ); +} + +/*! \brief Converts from a mask of \ref AAX_ESampleRateMask to the lowest + supported \ref AAX_CSampleRate value in Hz + + */ +inline AAX_CSampleRate getLowestSampleRateInMask(uint32_t iMask) +{ + return ( + ((iMask & AAX_eSampleRateMask_44100) != 0) ? 44100.0f : // AAX_eSamplRateMask_All returns 44100 + ((iMask & AAX_eSampleRateMask_48000) != 0) ? 48000.0f : + ((iMask & AAX_eSampleRateMask_88200) != 0) ? 88200.0f : + ((iMask & AAX_eSampleRateMask_96000) != 0) ? 96000.0f : + ((iMask & AAX_eSampleRateMask_176400) != 0) ? 176400.0f : + ((iMask & AAX_eSampleRateMask_192000) != 0) ? 192000.0f : 0.0f + ); +} + +/*! \brief Returns the \ref AAX_ESampleRateMask selector for a literal + sample rate. + + The given rate must be an exact match with one of the available + selectors. If no exact match is found then + \ref AAX_eSampleRateMask_No is returned. + */ +inline uint32_t getMaskForSampleRate(float inSR) +{ + return ( + (44100.0 == inSR) ? AAX_eSampleRateMask_44100 : + (48000.0 == inSR) ? AAX_eSampleRateMask_48000 : + (88200.0 == inSR) ? AAX_eSampleRateMask_88200 : + (96000.0 == inSR) ? AAX_eSampleRateMask_96000 : + (176400.0 == inSR) ? AAX_eSampleRateMask_176400 : + (192000.0 == inSR) ? AAX_eSampleRateMask_192000 : AAX_eSampleRateMask_No + ); +} + + +#ifndef _TMS320C6X + +#include AAX_ALIGN_FILE_BEGIN +#include AAX_ALIGN_FILE_HOST +#include AAX_ALIGN_FILE_END + +#endif + +/** \brief Plug-in chunk header + * + * \legacy To ensure compatibility with TDM/RTAS plug-ins whose implementation requires \c fSize to be equal + * to the size of the chunk's header plus its data, AAE performs some behind-the-scenes record keeping. + *
+ *
+ * The following actions are only taken for %AAX plug-ins, so, e.g., if a chunk is stored by an RTAS or TDM + * plug-in that reports data+header size in \c fSize and this chunk is then loaded by the %AAX version of the + * plug-in, the header size will be cached as-is from the legacy plug-in and will be subtracted out before + * the chunk data is passed to the %AAX plug-in. If a chunk is stored by an %AAX plug-in and is then loaded + * by a legacy plug-in, the legacy plug-in will receive the cached plug-in header with \c fSize equal to the + * data+header size. + *
+ *
+ * These are the special actions that AAE takes to ensure backwards-compatibility when handling %AAX chunk data: + * - When AAE retrieves the size of a chunk from an %AAX plug-in using + * \ref AAX_IACFEffectParameters::GetChunkSize() "GetChunkSize()", it adds the chunk header size to the + * amount of memory that it allocates for the chunk
+ * - When AAE retrieves a chunk from an %AAX plug-in using \ref AAX_IACFEffectParameters::GetChunk() "GetChunk()", + * it adds the chunk header size to \c fChunkSize before caching the chunk
+ * - Before calling \ref AAX_IACFEffectParameters::SetChunk() "SetChunk()" or + * \ref AAX_IACFEffectParameters::CompareActiveChunk() "CompareActiveChunk()", AAE subtracts the chunk header + * size from the cached chunk's header's \c fChunkSize member + * + */ +struct AAX_SPlugInChunkHeader { + int32_t fSize; ///< The size of the chunk's \ref AAX_SPlugInChunk::fData "fData" member + int32_t fVersion; ///< The chunk's version. + AAX_CTypeID fManufacturerID; ///< The Plug-In's manufacturer ID + AAX_CTypeID fProductID; ///< The Plug-In file's product ID + AAX_CTypeID fPlugInID; ///< The ID of a particular Plug-In within the file + AAX_CTypeID fChunkID; ///< The ID of a particular Plug-In chunk. + unsigned char fName[32]; ///< A user defined name for this chunk. +}; +typedef struct AAX_SPlugInChunkHeader AAX_SPlugInChunkHeader; + +/** \brief Plug-in chunk header + data + * + * \sa \ref AAX_SPlugInChunkHeader + */ +struct AAX_SPlugInChunk { + int32_t fSize; ///< The size of the chunk's \ref AAX_SPlugInChunk::fData "fData" member + int32_t fVersion; ///< The chunk's version. + AAX_CTypeID fManufacturerID; ///< The Plug-In's manufacturer ID + AAX_CTypeID fProductID; ///< The Plug-In file's product ID + AAX_CTypeID fPlugInID; ///< The ID of a particular Plug-In within the file + AAX_CTypeID fChunkID; ///< The ID of a particular Plug-In chunk. + unsigned char fName[32]; ///< A user defined name for this chunk. + char fData[1]; ///< The chunk's data. \note The fixed-size array definition here is historical, but misleading. Plug-ins actually write off the end of this block and are allowed to as long as they don't exceed their reported size. +}; +typedef struct AAX_SPlugInChunk AAX_SPlugInChunk, *AAX_SPlugInChunkPtr; + +/** \brief Plug-in Identifier Triad + * + * \details + * This set of identifiers are what uniquely identify a particular plug-in type. + */ +struct AAX_SPlugInIdentifierTriad { + AAX_CTypeID mManufacturerID; ///< The Plug-In's manufacturer ID + AAX_CTypeID mProductID; ///< The Plug-In's product (Effect) ID + AAX_CTypeID mPlugInID; ///< The ID of a specific type in the product (Effect) +}; +typedef struct AAX_SPlugInIdentifierTriad AAX_SPlugInIdentifierTriad, *AAX_SPlugInIdentifierTriadPtr; + +#ifndef _TMS320C6X +#include AAX_ALIGN_FILE_BEGIN +#include AAX_ALIGN_FILE_RESET +#include AAX_ALIGN_FILE_END +#endif + +#ifndef TI_VERSION +static inline bool operator==(const AAX_SPlugInIdentifierTriad& v1, const AAX_SPlugInIdentifierTriad& v2) +{ + return ((v1.mManufacturerID == v2.mManufacturerID) && + (v1.mProductID == v2.mProductID) && + (v1.mPlugInID == v2.mPlugInID)); +} + +static inline bool operator!=(const AAX_SPlugInIdentifierTriad& v1, const AAX_SPlugInIdentifierTriad& v2) +{ + return false == operator==(v1, v2); +} + +static inline bool operator<(const AAX_SPlugInIdentifierTriad & lhs, const AAX_SPlugInIdentifierTriad & rhs) +{ + if (lhs.mManufacturerID < rhs.mManufacturerID) + return true; + + if (lhs.mManufacturerID == rhs.mManufacturerID) + { + if (lhs.mProductID < rhs.mProductID) + return true; + + if (lhs.mProductID == rhs.mProductID) + if (lhs.mPlugInID < rhs.mPlugInID) + return true; + } + return false; +} + +static inline bool operator>=(const AAX_SPlugInIdentifierTriad & lhs, const AAX_SPlugInIdentifierTriad & rhs) +{ + return false == operator<(lhs, rhs); +} + +static inline bool operator>(const AAX_SPlugInIdentifierTriad & lhs, const AAX_SPlugInIdentifierTriad & rhs) +{ + return operator>=(lhs, rhs) && operator!=(lhs, rhs); +} + +static inline bool operator<=(const AAX_SPlugInIdentifierTriad & lhs, const AAX_SPlugInIdentifierTriad & rhs) +{ + return false == operator>(lhs, rhs); +} +#endif //TI_VERSION + + +// 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. +#if ( defined(_WIN64) || defined(__LP64__) || defined(_TMS320C6X) ) + #include AAX_ALIGN_FILE_BEGIN + #include AAX_ALIGN_FILE_ALG + #include AAX_ALIGN_FILE_END +#else + #if defined (__GNUC__) + #pragma options align=power // To maintain backwards-compatibility with pre-10 versions of Pro Tools + #else // Windows, other + #include AAX_ALIGN_FILE_BEGIN + #include AAX_ALIGN_FILE_HOST + #include AAX_ALIGN_FILE_END + #endif +#endif + +/*! \brief Packet structure for MIDI data + + \details + \sa AAX_CMidiStream + + \legacy Corresponds to DirectMidiPacket in the legacy SDK + */ +struct AAX_CMidiPacket +{ + uint32_t mTimestamp; //!< This is the playback time at which the MIDI event should occur, relative to the beginning of the current audio buffer. + uint32_t mLength; //!< The length of MIDI message, in terms of bytes. + unsigned char mData[4]; //!< The MIDI message itself. Each array element is one byte of the message, with the 0th element being the first byte. + AAX_CBoolean mIsImmediate; //!< Indicates that the message is to be sent as soon as possible. \compatibility This value is not currently set. Use mTimestamp == 0 to detect immediate packets +}; + +/*! \brief MIDI stream data structure used by \ref AAX_IMIDINode + + \details + For \ref AAX_eMIDINodeType_LocalInput "MIDI input", mBufferSize is set by the %AAX host + when the buffer is filled. + + For \ref AAX_eMIDINodeType_LocalOutput "MIDI output", the plug-in sets mBufferSize with + the number of \ref AAX_CMidiPacket objects it has filled mBuffer with. The %AAX host + will reset mBufferSize to 0 after it has received the buffer of MIDI. + + System Exclusive (SysEx) messages that are greater than 4 bytes in length can be + transmitted via a series of concurrent \ref AAX_CMidiPacket objects in mBuffer. In + accordance with the MIDI Specification, \c 0xF0 indicates the beginning of a SysEx + message and \c 0xF7 indicates its end. + + \legacy Corresponds to DirectMidiNode in the legacy SDK + */ +struct AAX_CMidiStream +{ + uint32_t mBufferSize; //!< The number of \ref AAX_CMidiPacket objects contained in the node's buffer. + AAX_CMidiPacket* mBuffer; //!< Pointer to the first element of the node's buffer. +}; + +#if ( defined(_WIN64) || defined(__LP64__) || defined(_TMS320C6X) ) + #include AAX_ALIGN_FILE_BEGIN + #include AAX_ALIGN_FILE_RESET + #include AAX_ALIGN_FILE_END +#else + #if defined (__GNUC__) + #pragma pack() // To maintian backwards-compatibility with pre-10 versions of Pro Tools + #else + #include AAX_ALIGN_FILE_BEGIN + #include AAX_ALIGN_FILE_RESET + #include AAX_ALIGN_FILE_END + #endif +#endif + +/// @cond ignore +#endif // #ifndef _AAX_H_ +/// @endcond diff --git a/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_Assert.h b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_Assert.h new file mode 100644 index 0000000000..96ad27f80e --- /dev/null +++ b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_Assert.h @@ -0,0 +1,298 @@ +/*================================================================================================*/ +/* + * + * Copyright 2013-2015, 2018, 2023-2024 Avid Technology, Inc. + * All rights reserved. + * + * This file is part of the Avid AAX SDK. + * + * The AAX SDK is subject to commercial or open-source licensing. + * + * By using the AAX SDK, you agree to the terms of both the Avid AAX SDK License + * Agreement and Avid Privacy Policy. + * + * AAX SDK License: https://developer.avid.com/aax + * Privacy Policy: https://www.avid.com/legal/privacy-policy-statement + * + * Or: You may also use this code under the terms of the GPL v3 (see + * www.gnu.org/licenses). + * + * THE AAX SDK IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER + * EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE + * DISCLAIMED. + * + */ + +/** + \file AAX_Assert.h + + \brief Declarations for cross-platform AAX_ASSERT, AAX_TRACE and related facilities + + \details + + - \ref AAX_ASSERT( condition ) - If the condition is \c false triggers some manner of + warning, e.g. a dialog in a developer build or a DigiTrace log in a shipping + build. May be used on host or TI. + - \ref AAX_DEBUGASSERT( condition ) - Variant of \ref AAX_ASSERT which is only + active in debug builds of the plug-in. + - \ref AAX_TRACE_RELEASE( iPriority, iMessageStr [,params...] ) - Traces a printf- + style message to the DigiTrace log file. Enabled using the \c DTF_AAXPLUGINS + DigiTrace facility. + - \ref AAX_TRACE( iPriority, iMessageStr [, params...] ) - Variant of \ref AAX_TRACE_RELEASE + which only emits logs in debug builds of the plug-in. + - \ref AAX_STACKTRACE_RELEASE( iPriority, iMessageStr [,params...] ) - Similar to + \ref AAX_TRACE_RELEASE but prints a stack trace as well as a log message + - \ref AAX_STACKTRACE( iPriority, iMessageStr [,params...] ) - Variant of + \ref AAX_STACKTRACE_RELEASE which only emits logs in debug builds of the plug-in. + - \ref AAX_TRACEORSTACKTRACE_RELEASE( iTracePriority, iStackTracePriority, iMessageStr [,params...] ) - Combination + of \ref AAX_TRACE_RELEASE and \ref AAX_STACKTRACE_RELEASE; a stack trace is emitted if logging is enabled at + \p iStackTracePriority. Otherwise, if logging is enabled at \p iTracePriority then emits a log. + + For all trace macros: + + \p inPriority is one of + \li \ref kAAX_Trace_Priority_Low + \li \ref kAAX_Trace_Priority_Normal + \li \ref kAAX_Trace_Priority_High + \li \ref kAAX_Trace_Priority_Critical + + These correspond to how the trace messages are filtered using + \ref AAX_DigiTrace_Guide "DigiTrace". + + \note Disabling the DTF_AAXPLUGINS facility will slightly reduce the + overhead of trace statements and chip communication on HDX systems. + +==============================================================================*/ + + +#ifndef AAX_ASSERT_H +#define AAX_ASSERT_H + +#include "AAX_Enums.h" + + +/** \def AAX_TRACE + \brief Print a trace statement to the log (debug plug-in builds only) + + \details + Use this macro to print a trace statement to the log file from debug builds of a plug-in. + + Notes + - This macro will be compiled out of release builds + - This macro is compatible with bost host and embedded (AAX DSP) environments + - Subject to a total line limit of 256 chars + + Usage + Each invocation of this macro takes a trace priority and a printf-style logging string. For + example: + + \code + AAX_TRACE(kAAX_Trace_Priority_Normal, "My float: %f, My C-string: %s", myFloat, myCString); + \endcode + + \sa AAX_DigiTrace_Guide + */ + +/** \def AAX_TRACE_RELEASE + \brief Print a trace statement to the log + + \details + Use this macro to print a trace statement to the log file. This macro will be included in all builds + of the plug-in. + + Notes + - This macro is compatible with bost host and embedded (AAX DSP) environments + - Subject to a total line limit of 256 chars + + Usage + Each invocation of this macro takes a trace priority and a printf-style logging string. + + Because output from this macro will be enabled on end users' systems under certain tracing configurations, + logs should always be formatted with some standard information to avoid confusion between logs from + different plug-ins. This is the recommended formatting for AAX_TRACE_RELEASE logs: + +
[Manufacturer name] [Plug-in name] [Plug-in version][logging text (indented)]
+ + For example: + + \code + AAX_TRACE_RELEASE(kAAX_Trace_Priority_Normal, "%s %s %s;\tMy float: %f, My C-string: %s", + "MyCompany", "MyPlugIn", "1.0.2", myFloat, myCString); + \endcode + + \sa AAX_DigiTrace_Guide + */ + +/** \def AAX_ASSERT + \brief Asserts that a condition is true and logs an error if the condition is false. + + \details + Notes + - This macro will be compiled out of release builds. + - This macro is compatible with bost host and embedded (AAX DSP) environments. + + Usage + Each invocation of this macro takes a single argument, which is interpreted as a bool. + + \code + AAX_ASSERT(desiredValue == variableUnderTest); + \endcode + */ + +/** \def AAX_DEBUGASSERT + \brief Asserts that a condition is true and logs an error if the condition is false (debug plug-in builds only) + + \sa \ref AAX_ASSERT + */ + +/** \def AAX_STACKTRACE_RELEASE + \brief Print a stack trace statement to the log + + \sa \ref AAX_TRACE_RELEASE + */ + +/** \def AAX_STACKTRACE + \brief Print a stack trace statement to the log (debug builds only) + + \sa \ref AAX_TRACE + */ + +/** \def AAX_TRACEORSTACKTRACE_RELEASE + \brief Print a trace statement with an optional stack trace to the log + + \param[in] iTracePriority + The log priority at which the trace statement will be printed + \param[in] iStackTracePriority + The log priority at which the stack trace will be printed + + \sa \ref AAX_TRACE_RELEASE + */ + +/** \def AAX_TRACEORSTACKTRACE + \brief Print a trace statement with an optional stack trace to the log (debug builds only) + + \param[in] iTracePriority + The log priority at which the trace statement will be printed + \param[in] iStackTracePriority + The log priority at which the stack trace will be printed + + \sa \ref AAX_TRACE + */ + + +#ifdef _TMS320C6X // TI-only + + #ifndef TI_SHELL_TRACING_H + #include "TI_Shell_Tracing.h" + #endif + + typedef AAX_ETracePriorityDSP EAAX_Trace_Priority; + + #define kAAX_Trace_Priority_None AAX_eTracePriorityDSP_None + #define kAAX_Trace_Priority_Critical AAX_eTracePriorityDSP_High + #define kAAX_Trace_Priority_High AAX_eTracePriorityDSP_High + #define kAAX_Trace_Priority_Normal AAX_eTracePriorityDSP_Normal + #define kAAX_Trace_Priority_Low AAX_eTracePriorityDSP_Low + #define kAAX_Trace_Priority_Lowest AAX_eTracePriorityDSP_Low + + //Note that the Message provided to AAX_TRACE must be a cons string available for indefinite time + // because sending it to the host is done asynchronously. + #define AAX_TRACE_RELEASE( ... ) TISHELLTRACE( __VA_ARGS__ ) + + //Stack traces not supported on TI - just log + #define AAX_STACKTRACE_RELEASE( ... ) TISHELLTRACE( __VA_ARGS__ ) + #define AAX_TRACEORSTACKTRACE_RELEASE( iTracePriority, iStackTracePriority, ... ) TISHELLTRACE( iTracePriority, __VA_ARGS__ ) + + #define _STRINGIFY(x) #x + #define _TOSTRING(x) _STRINGIFY(x) + + #define AAX_ASSERT( condition ) \ + { \ + if( ! (condition) ) _DoTrace( AAX_eTracePriorityDSP_Assert, \ + CAT(CAT( CAT(__FILE__, ":"), _TOSTRING(__LINE__) ) , CAT(" failed: ", #condition) ) );\ + } + + #if defined(_DEBUG) + #define AAX_DEBUGASSERT( condition ) AAX_ASSERT( condition ) + #define AAX_TRACE( ... ) AAX_TRACE_RELEASE( __VA_ARGS__ ) + #define AAX_STACKTRACE( ... ) AAX_STACKTRACE_RELEASE( __VA_ARGS__ ) + #define AAX_TRACEORSTACKTRACE( iTracePriority, iStackTracePriority, ... ) AAX_TRACEORSTACKTRACE_RELEASE( iTracePriority, iStackTracePriority, __VA_ARGS__ ) + + #else + #define AAX_DEBUGASSERT( condition ) do { ; } while (0) + #define AAX_TRACE( ... ) do { ; } while (0) + #define AAX_STACKTRACE( ... ) do { ; } while (0) + #define AAX_TRACEORSTACKTRACE( ... ) do { ; } while (0) + #endif + +#else // Host: + + #ifndef AAX_CHOSTSERVICES_H + #include "AAX_CHostServices.h" + #endif + + typedef AAX_ETracePriorityHost AAX_ETracePriority; + + #define kAAX_Trace_Priority_None AAX_eTracePriorityHost_None + #define kAAX_Trace_Priority_Critical AAX_eTracePriorityHost_Critical + #define kAAX_Trace_Priority_High AAX_eTracePriorityHost_High + #define kAAX_Trace_Priority_Normal AAX_eTracePriorityHost_Normal + #define kAAX_Trace_Priority_Low AAX_eTracePriorityHost_Low + #define kAAX_Trace_Priority_Lowest AAX_eTracePriorityHost_Lowest + + //Note that the Message provided to AAX_TRACE must be a const string available for indefinite time + // because sending it to the host is done asynchronously on TI + #define AAX_TRACE_RELEASE( iPriority, ... ) \ + { \ + AAX_CHostServices::Trace ( iPriority, __VA_ARGS__ ); \ + }; + + #define AAX_STACKTRACE_RELEASE( iPriority, ... ) \ + { \ + AAX_CHostServices::StackTrace ( iPriority, iPriority, __VA_ARGS__ ); \ + }; + + #define AAX_TRACEORSTACKTRACE_RELEASE( iTracePriority, iStackTracePriority, ... ) \ + { \ + AAX_CHostServices::StackTrace ( iTracePriority, iStackTracePriority, __VA_ARGS__ ); \ + }; + + #if defined(_DEBUG) + + #define AAX_ASSERT( condition ) \ + { \ + if( ! ( condition ) ) { \ + AAX_CHostServices::HandleAssertFailure( __FILE__, __LINE__, #condition, (int32_t)AAX_eAssertFlags_Log | (int32_t)AAX_eAssertFlags_Dialog ); \ + } \ + }; + + #define AAX_DEBUGASSERT( condition ) \ + { \ + if( ! ( condition ) ) { \ + AAX_CHostServices::HandleAssertFailure( __FILE__, __LINE__, #condition, (int32_t)AAX_eAssertFlags_Log | (int32_t)AAX_eAssertFlags_Dialog ); \ + } \ + }; + + #define AAX_TRACE( iPriority, ... ) AAX_TRACE_RELEASE( iPriority, __VA_ARGS__ ) + #define AAX_STACKTRACE( iPriority, ... ) AAX_STACKTRACE_RELEASE( iPriority, __VA_ARGS__ ) + #define AAX_TRACEORSTACKTRACE( iTracePriority, iStackTracePriority, ... ) AAX_TRACEORSTACKTRACE_RELEASE( iTracePriority, iStackTracePriority, __VA_ARGS__ ) + + #else + #define AAX_ASSERT( condition ) \ + { \ + if( ! ( condition ) ) { \ + AAX_CHostServices::HandleAssertFailure( __FILE__, __LINE__, #condition, (int32_t)AAX_eAssertFlags_Log ); \ + } \ + }; + + #define AAX_DEBUGASSERT( condition ) do { ; } while (0) + #define AAX_TRACE( iPriority, ... ) do { ; } while (0) + #define AAX_STACKTRACE( iPriority, ... ) do { ; } while (0) + #define AAX_TRACEORSTACKTRACE( iTracePriority, iStackTracePriority, ... ) do { ; } while (0) + #endif + +#endif + + +#endif // include guard +// end of AAX_Assert.h diff --git a/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_Atomic.h b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_Atomic.h new file mode 100644 index 0000000000..be590525f9 --- /dev/null +++ b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_Atomic.h @@ -0,0 +1,294 @@ +/*================================================================================================*/ +/* + * Copyright 2013-2015, 2018, 2023-2024 Avid Technology, Inc. + * All rights reserved. + * + * This file is part of the Avid AAX SDK. + * + * The AAX SDK is subject to commercial or open-source licensing. + * + * By using the AAX SDK, you agree to the terms of both the Avid AAX SDK License + * Agreement and Avid Privacy Policy. + * + * AAX SDK License: https://developer.avid.com/aax + * Privacy Policy: https://www.avid.com/legal/privacy-policy-statement + * + * Or: You may also use this code under the terms of the GPL v3 (see + * www.gnu.org/licenses). + * + * THE AAX SDK IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER + * EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE + * DISCLAIMED. + * + */ + +/** + * \file AAX_Atomic.h + * + * \brief Atomic operation utilities + */ +/*================================================================================================*/ + + +#pragma once + +#ifndef AAX_ATOMIC_H_ +#define AAX_ATOMIC_H_ + +#include "AAX.h" +#include + +#if (!defined AAX_PointerSize) +#error Undefined pointer size +#endif + + +//! Increments a 32-bit value and returns the result +uint32_t AAX_CALLBACK AAX_Atomic_IncThenGet_32(uint32_t & ioData); + +//! Decrements a 32-bit value and returns the result +uint32_t AAX_CALLBACK AAX_Atomic_DecThenGet_32(uint32_t & ioData); + +//! Return the original value of ioValue and then set it to inExchangeValue +uint32_t AAX_CALLBACK AAX_Atomic_Exchange_32( + volatile uint32_t& ioValue, + uint32_t inExchangeValue); + +//! Return the original value of ioValue and then set it to inExchangeValue +uint64_t AAX_CALLBACK AAX_Atomic_Exchange_64( + volatile uint64_t& ioValue, + uint64_t inExchangeValue); + +//! Perform an exchange operation on a pointer value +template TPointer* AAX_CALLBACK AAX_Atomic_Exchange_Pointer(TPointer*& ioValue, TPointer* inExchangeValue) +{ +#if (AAX_PointerSize == AAXPointer_64bit) + return (TPointer*)AAX_Atomic_Exchange_64(*(uint64_t*)(void*)&ioValue, (uint64_t)inExchangeValue); +#elif (AAX_PointerSize == AAXPointer_32bit) + return (TPointer*)AAX_Atomic_Exchange_32(*(uint32_t*)(void*)&ioValue, (uint32_t)inExchangeValue); +#else +#error Unsupported pointer size +#endif +} + +//! Perform a compare and exchange operation on a 32-bit value +bool AAX_CALLBACK AAX_Atomic_CompareAndExchange_32( + volatile uint32_t & ioValue, + uint32_t inCompareValue, + uint32_t inExchangeValue); + +//! Perform a compare and exchange operation on a 64-bit value +bool AAX_CALLBACK AAX_Atomic_CompareAndExchange_64( + volatile uint64_t& ioValue, + uint64_t inCompareValue, + uint64_t inExchangeValue); + +//! Perform a compare and exchange operation on a pointer value +template bool AAX_CALLBACK AAX_Atomic_CompareAndExchange_Pointer(TPointer*& ioValue, TPointer* inCompareValue, TPointer* inExchangeValue) +{ +#if (AAX_PointerSize == AAXPointer_64bit) + return AAX_Atomic_CompareAndExchange_64(*(uint64_t*)(void*)&ioValue, (uint64_t)inCompareValue, (uint64_t)inExchangeValue); +#elif (AAX_PointerSize == AAXPointer_32bit) + return AAX_Atomic_CompareAndExchange_32(*(uint32_t*)(void*)&ioValue, (uint32_t)inCompareValue, (uint32_t)inExchangeValue); +#else +#error Unsupported pointer size +#endif +} + +//! Atomically loads a pointer value +template TPointer* AAX_CALLBACK AAX_Atomic_Load_Pointer(TPointer const * const volatile * inValue); + + + +//TODO: Update all atomic function implementatons with proper acquire/release semantics + + +// GCC/LLVM +#if defined(__GNUC__) + +// These intrinsics require GCC 4.2 or later +#if (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 2)) + +inline uint32_t AAX_CALLBACK +AAX_Atomic_IncThenGet_32(uint32_t& ioData) +{ + return __sync_add_and_fetch(&ioData, 1); +} + +inline uint32_t AAX_CALLBACK +AAX_Atomic_DecThenGet_32(uint32_t& ioData) +{ + return __sync_sub_and_fetch(&ioData, 1); +} + +inline uint32_t +AAX_Atomic_Exchange_32( + volatile uint32_t& ioValue, + uint32_t inExchangeValue) +{ + return __sync_lock_test_and_set(&ioValue, inExchangeValue); +} + +inline uint64_t +AAX_Atomic_Exchange_64( + volatile uint64_t& ioValue, + uint64_t inExchangeValue) +{ + return __sync_lock_test_and_set(&ioValue, inExchangeValue); +} + +inline bool +AAX_Atomic_CompareAndExchange_32( + volatile uint32_t & ioValue, + uint32_t inCompareValue, + uint32_t inExchangeValue) +{ + return __sync_bool_compare_and_swap(&ioValue, inCompareValue, inExchangeValue); +} + +inline bool +AAX_Atomic_CompareAndExchange_64( + volatile uint64_t& ioValue, + uint64_t inCompareValue, + uint64_t inExchangeValue) +{ + return __sync_bool_compare_and_swap(&ioValue, inCompareValue, inExchangeValue); +} + +//TODO: Add GCC version check and alternative implementations for GCC versions that do not support __atomic_load +template +inline TPointer* +AAX_Atomic_Load_Pointer(TPointer const * const volatile * inValue) +{ + TPointer* value; + __atomic_load(const_cast(inValue), &(value), __ATOMIC_ACQUIRE); + return value; +} + +#else // (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 2)) +#error This file requires GCC 4.2 or later +#endif // (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 2)) +// End GCC/LLVM + + + + + +// Visual C +#elif defined(_MSC_VER) + +#ifndef __INTRIN_H_ +#include +#endif + +#pragma intrinsic( _InterlockedIncrement, \ + _InterlockedDecrement, \ + _InterlockedExchange, \ + _InterlockedCompareExchange, \ + _InterlockedCompareExchange64) + +inline uint32_t AAX_CALLBACK +AAX_Atomic_IncThenGet_32(register uint32_t& ioData) +{ + return static_cast(_InterlockedIncrement((volatile long*)&ioData)); +} + +inline uint32_t AAX_CALLBACK +AAX_Atomic_DecThenGet_32(register uint32_t& ioData) +{ + return static_cast(_InterlockedDecrement((volatile long*)&ioData)); +} + +inline uint32_t +AAX_Atomic_Exchange_32( + volatile uint32_t& ioDestination, + uint32_t inExchangeValue) +{ + return static_cast(_InterlockedExchange((volatile long*)&ioDestination, (long)inExchangeValue)); +} + +#if (AAX_PointerSize == AAXPointer_64bit) + +#pragma intrinsic( _InterlockedExchange64, \ + _InterlockedOr64) + +inline uint64_t +AAX_Atomic_Exchange_64( + volatile uint64_t& ioValue, + uint64_t inExchangeValue) +{ + return static_cast(_InterlockedExchange64((volatile __int64*)&ioValue, (__int64)inExchangeValue)); +} + +template +inline TPointer* +AAX_Atomic_Load_Pointer(TPointer const * const volatile * inValue) +{ +// Itanium supports acquire semantics +#if (_M_IA64) + return reinterpret_cast(_InterlockedOr64_acq(const_cast<__int64 volatile *>(reinterpret_cast(inValue)), 0x0000000000000000)); +#else + return reinterpret_cast(_InterlockedOr64(const_cast<__int64 volatile *>(reinterpret_cast(inValue)), 0x0000000000000000)); +#endif +} + +#elif (AAX_PointerSize == AAXPointer_32bit) + +#pragma intrinsic( _InterlockedOr ) + +// _InterlockedExchange64 is not available on 32-bit Pentium in Visual C +inline uint64_t +AAX_Atomic_Exchange_64( + volatile uint64_t& ioValue, + uint64_t inExchangeValue) +{ + for(;;) + { + uint64_t result = ioValue; + if(AAX_Atomic_CompareAndExchange_64(ioValue, result, inExchangeValue)) + { + return result; + } + } + + return 0; // will never get here +} + +template +inline TPointer* +AAX_Atomic_Load_Pointer(TPointer const * const volatile * inValue) +{ + return reinterpret_cast(_InterlockedOr(const_cast(reinterpret_cast(inValue)), 0x00000000)); +} + +#endif + +inline bool +AAX_Atomic_CompareAndExchange_32( + uint32_t volatile & ioValue, + uint32_t inCompareValue, + uint32_t inExchangeValue) +{ + return static_cast(_InterlockedCompareExchange((volatile long*)&ioValue, (long)inExchangeValue, (long)inCompareValue)) == inCompareValue; +} + +inline bool +AAX_Atomic_CompareAndExchange_64( + volatile uint64_t& ioValue, + uint64_t inCompareValue, + uint64_t inExchangeValue) +{ + return static_cast(_InterlockedCompareExchange64((volatile __int64*)&ioValue, (__int64)inExchangeValue, (__int64)inCompareValue)) == inCompareValue; +} + +// End Visual C + + + + + +#else // Not Visual C or GCC/LLVM +#error Provide an atomic operation implementation for this compiler +#endif // Compiler version check + +#endif // #ifndef AAX_ATOMIC_H_ diff --git a/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_CArrayDataBuffer.h b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_CArrayDataBuffer.h new file mode 100644 index 0000000000..07482f769b --- /dev/null +++ b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_CArrayDataBuffer.h @@ -0,0 +1,133 @@ +/*================================================================================================*/ +/* + * + * Copyright 2023-2024 Avid Technology, Inc. + * All rights reserved. + * + * This file is part of the Avid AAX SDK. + * + * The AAX SDK is subject to commercial or open-source licensing. + * + * By using the AAX SDK, you agree to the terms of both the Avid AAX SDK License + * Agreement and Avid Privacy Policy. + * + * AAX SDK License: https://developer.avid.com/aax + * Privacy Policy: https://www.avid.com/legal/privacy-policy-statement + * + * Or: You may also use this code under the terms of the GPL v3 (see + * www.gnu.org/licenses). + * + * THE AAX SDK IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER + * EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE + * DISCLAIMED. + * + */ + +/** + * \file AAX_CArrayDataBuffer.h + */ +/*================================================================================================*/ + +#pragma once + +#ifndef AAX_CArrayDataBuffer_H +#define AAX_CArrayDataBuffer_H + +#include "AAX_IDataBuffer.h" +#include "AAX.h" + +#include +#include +#include + + +/** + * \brief A convenience class for array data buffers + * + * The data payload is an array of \c D + */ +template +class AAX_CArrayDataBufferOfType : public AAX_IDataBuffer +{ +public: + explicit AAX_CArrayDataBufferOfType (std::vector const & inData) : mData{inData} {} + explicit AAX_CArrayDataBufferOfType (std::vector && inData) : mData{inData} {} + + AAX_CArrayDataBufferOfType(AAX_CArrayDataBufferOfType const &) = default; + AAX_CArrayDataBufferOfType(AAX_CArrayDataBufferOfType &&) = default; + + ~AAX_CArrayDataBufferOfType (void) AAX_OVERRIDE = default; + + AAX_CArrayDataBufferOfType& operator= (AAX_CArrayDataBufferOfType const & other) = default; + AAX_CArrayDataBufferOfType& operator= (AAX_CArrayDataBufferOfType && other) = default; + + AAX_Result Type(AAX_CTypeID * oType) const AAX_OVERRIDE { + if (!oType) { return AAX_ERROR_NULL_ARGUMENT; } + *oType = T; + return AAX_SUCCESS; + } + AAX_Result Size(int32_t * oSize) const AAX_OVERRIDE { + if (!oSize) { return AAX_ERROR_NULL_ARGUMENT; } + auto const size = mData.size() * sizeof(D); + static_assert(std::numeric_limits::max() >= std::numeric_limits::type>::max(), + "size variable may not represent all positive values of oSize"); + if (size > std::numeric_limits::type>::max()) { + return AAX_ERROR_SIGNED_INT_OVERFLOW; + } + *oSize = static_cast::type>(size); + return AAX_SUCCESS; + } + AAX_Result Data(void const ** oBuffer) const AAX_OVERRIDE { + if (!oBuffer) { return AAX_ERROR_NULL_ARGUMENT; } + *oBuffer = mData.data(); + return AAX_SUCCESS; + } +private: + std::vector const mData; +}; + +/** + * \copydoc AAX_CArrayDataBufferOfType + */ +template +class AAX_CArrayDataBuffer : public AAX_IDataBuffer +{ +public: + AAX_CArrayDataBuffer (AAX_CTypeID inType, std::vector const & inData) : mType{inType}, mData{inData} {} + AAX_CArrayDataBuffer (AAX_CTypeID inType, std::vector && inData) : mType{inType}, mData{inData} {} + + AAX_CArrayDataBuffer(AAX_CArrayDataBuffer const &) = default; + AAX_CArrayDataBuffer(AAX_CArrayDataBuffer &&) = default; + + ~AAX_CArrayDataBuffer (void) AAX_OVERRIDE = default; + + AAX_CArrayDataBuffer& operator= (AAX_CArrayDataBuffer const & other) = default; + AAX_CArrayDataBuffer& operator= (AAX_CArrayDataBuffer && other) = default; + + AAX_Result Type(AAX_CTypeID * oType) const AAX_OVERRIDE { + if (!oType) { return AAX_ERROR_NULL_ARGUMENT; } + *oType = mType; + return AAX_SUCCESS; + } + AAX_Result Size(int32_t * oSize) const AAX_OVERRIDE { + if (!oSize) { return AAX_ERROR_NULL_ARGUMENT; } + auto const size = mData.size() * sizeof(D); + static_assert(std::numeric_limits::max() >= std::numeric_limits::type>::max(), + "size variable may not represent all positive values of oSize"); + if (size > std::numeric_limits::type>::max()) { + return AAX_ERROR_SIGNED_INT_OVERFLOW; + } + *oSize = static_cast::type>(size); + return AAX_SUCCESS; + } + AAX_Result Data(void const ** oBuffer) const AAX_OVERRIDE { + if (!oBuffer) { return AAX_ERROR_NULL_ARGUMENT; } + *oBuffer = mData.data(); + return AAX_SUCCESS; + } +private: + AAX_CTypeID const mType; + std::vector const mData; +}; + +#endif diff --git a/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_CAtomicQueue.h b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_CAtomicQueue.h new file mode 100644 index 0000000000..37d8fbe8a1 --- /dev/null +++ b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_CAtomicQueue.h @@ -0,0 +1,358 @@ +/*================================================================================================*/ +/* + * Copyright 2015, 2023-2024 Avid Technology, Inc. + * All rights reserved. + * + * This file is part of the Avid AAX SDK. + * + * The AAX SDK is subject to commercial or open-source licensing. + * + * By using the AAX SDK, you agree to the terms of both the Avid AAX SDK License + * Agreement and Avid Privacy Policy. + * + * AAX SDK License: https://developer.avid.com/aax + * Privacy Policy: https://www.avid.com/legal/privacy-policy-statement + * + * Or: You may also use this code under the terms of the GPL v3 (see + * www.gnu.org/licenses). + * + * THE AAX SDK IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER + * EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE + * DISCLAIMED. + * + */ + +/** + * \file AAX_CAtomicQueue.h + * + * \brief Atomic, non-blocking queue + * + */ +/*================================================================================================*/ +/// @cond ignore +#ifndef AAX_CATOMICQUEUE_H +#define AAX_CATOMICQUEUE_H +/// @endcond + + +// AAX Includes +#include "AAX_IPointerQueue.h" +#include "AAX_Atomic.h" +#include "AAX_CMutex.h" + +// Standard Includes +#include + + +/** Multi-writer, single-reader implementation of \ref AAX_IPointerQueue + + @details + Template parameters: + - \c T: Type of the objects pointed to by this queue + - \c S: Size of the queue's ring buffer. Should be a power of two less than \c UINT_32_MAX + + Properties: + - Read operations are non-blocking + - Write operations are synchronized, but very fast + - Supports only one read thread - do not call \ref Pop() or \ref Peek() concurrently + - Supports any number of write threads + - Does not support placing \c NULL values onto the queue. \ref AAX_CAtomicQueue<>::Push() "Push" + will return \ref eStatus_Unsupported if a \c NULL value is pushed onto the queue, and + the value will be ignored. + + */ +template +class AAX_CAtomicQueue : public AAX_IPointerQueue +{ +public: + virtual ~AAX_CAtomicQueue() {} + AAX_CAtomicQueue(); + +public: + static const size_t template_size = S; ///< The size used for this template instance + + typedef typename AAX_IPointerQueue::template_type template_type; ///< @copydoc AAX_IPointerQueue::template_type + typedef typename AAX_IPointerQueue::value_type value_type; ///< @copydoc AAX_IPointerQueue::value_type + +public: // AAX_IContainer + virtual void Clear(); ///< @copydoc AAX_IPointerQueue::Clear() + +public: // AAX_IPointerQueue + virtual AAX_IContainer::EStatus Push(value_type inElem); ///< @copydoc AAX_IPointerQueue::Push() + virtual value_type Pop(); ///< @copydoc AAX_IPointerQueue::Pop() + virtual value_type Peek() const; ///< @copydoc AAX_IPointerQueue::Peek() + +private: + AAX_CMutex mMutex; + uint32_t mReadIdx; + uint32_t mWriteIdx; + value_type mRingBuffer[S]; +}; + + +/// @cond ignore + +template +inline AAX_CAtomicQueue::AAX_CAtomicQueue() +: AAX_IPointerQueue() +, mMutex() +, mReadIdx(0) +, mWriteIdx(0) +{ + Clear(); +} + +template +inline void AAX_CAtomicQueue::Clear() +{ + std::memset((void*)mRingBuffer, 0x0, sizeof(mRingBuffer)); +} + +template +inline AAX_IContainer::EStatus AAX_CAtomicQueue::Push(typename AAX_CAtomicQueue::value_type inElem) +{ + if (NULL == inElem) + { + return AAX_IContainer::eStatus_Unsupported; + } + + AAX_IContainer::EStatus result = AAX_IContainer::eStatus_Unavailable; + + AAX_StLock_Guard guard(mMutex); + // + // Possible failure case without mutex is because of several write threads try to modify + // mWriteIdx concurrently + // + // Example: + // + // - + // Notation: + // First number - write thread number + // Second number - value number + // 1/15 - 1st thread that write number 15 + // + // - + // Queue may look like this: + // mReadIdx + // | + // |..... | 4/3 | 4/4 | 1/4 | 1/5 | 2/7 | 2/8 | 2/9 | .....| + // | + // mWriteIdx + // place# | 0 | 1 | 2 | 3 | 4 | 5 | 6 | .....| + // + // - + // Possible operation order (w stands for mWriteIdx, r - for mReadIdx): + //------------------------------------------------------- + // thread#| action | write index value | mWriteIdx | + // | | internal variable | | + //------------------------------------------------------- + // 5 | w++ | 2 | 2 | + //------------------------------------------------------- + // 6 | w++ | 3 | 3 | + //------------------------------------------------------- + // 5 | false | - | 2not=3 => 2--=1 | + //------------------------------------------------------- + // read | r++ | - | - | + //------------------------------------------------------- + // read | r++ | - | - | + //------------------------------------------------------- + // - + // Queue state: + // mReadIdx + // | + // |..... | 4/3 | 0 | 0 | 1/5 | 2/7 | 2/8 | 2/9 | .....| + // | + // mWriteIdx + // place# | 0 | 1 | 2 | 3 | 4 | 5 | 6 | .....| + // + // - + //------------------------------------------------------- + // 6 | false | - | 3not=1 => 3--=2 | // place 3 is still not empty to write + //------------------------------------------------------- + // + // - + // Now, some other thread (5, for example) can successfully write + // it's value to queue and move mWriteIdx forward: + // + // - + // Queue state: + // mReadIdx + // | + // |..... | 4/3 | 0 | 5/1 | 1/5 | 2/7 | 2/8 | 2/9 | .....| + // | + // mWriteIdx + // place# | 0 | 1 | 2 | 3 | 4 | 5 | 6 | .....| + // + // - + // Thus, we have one place with NULL value left. In the next round mReadIdx will + // stuck on place #1 (queue thinks that it's empty) until one of the write threads + // will write the value into place #1. It could be thread #5, so we have: + // + // - + // Queue state: + // mReadIdx + // | + // |..... | 9/1 | 5/9 | 5/1 | 1/5 | 2/7 | 2/8 | 2/9 | .....| + // | + // mWriteIdx + // place# | 0 | 1 | 2 | 3 | 4 | 5 | 6 | .....| + // + // - + // And we will read 5/9 before 5/1 + // + // + // Note that read/write both begin at index 1 + const uint32_t idx = AAX_Atomic_IncThenGet_32(mWriteIdx); + const uint32_t widx = idx % S; + + // Do the push. If the value at the current write index is non-NULL then we have filled the buffer. + const bool cxResult = AAX_Atomic_CompareAndExchange_Pointer(mRingBuffer[widx], (value_type)0x0, inElem); + + if (false == cxResult) + { + result = AAX_IContainer::eStatus_Overflow; + + const uint32_t ridx = (0 == idx) ? S : idx-1; + + // Note the write index has already been incremented, so in the event of an overflow we must + // return the write index to its previous location. + // + // Note: if multiple write threads encounter concurrent push overflows then the write pointer + // will not be fully decremented back to the overflow location, and the read index will need + // to increment multiple positions to clear the overflow state. +// const bool resetResult = AAX_Atomic_CompareAndExchange_32(mWriteIdx, idx, ridx); + AAX_Atomic_CompareAndExchange_32(mWriteIdx, idx, ridx); + +// printf("AAX_CAtomicQueue: overflow - reset: %s, idx: %lu, widx: %lu, inElem: %p\n", +// resetResult ? "yes" : " no", +// (unsigned long)idx, +// (unsigned long)widx, +// inElem); + } + else + { + result = AAX_IContainer::eStatus_Success; + + // Handle wraparound + // + // There may be multiple write threads pushing elements at the same time, so we use + // (wrapped index < raw index) instead of (raw index == boundary) + // + // This assumes overhead between S and UINT_32_MAX of at least as many elements as + // there are write threads. + +// bool exchResult = false; + if (widx < idx) + { +// exchResult = + AAX_Atomic_CompareAndExchange_32(mWriteIdx, idx, widx); + } + +// printf("AAX_CAtomicQueue: pushed - reset: %s, idx: %lu, widx: %lu, inElem: %p\n", +// (widx < idx) ? exchResult ? "yes" : " no" : "n/a", +// (unsigned long)idx, +// (unsigned long)widx, +// inElem); + } + + return result; +} + +template +inline typename AAX_CAtomicQueue::value_type AAX_CAtomicQueue::Pop() +{ + // Note that read/write both begin at index 1 + mReadIdx = (mReadIdx+1) % template_size; + value_type const val = AAX_Atomic_Exchange_Pointer(mRingBuffer[mReadIdx], (value_type)0x0); + +// printf("AAX_CAtomicQueue: popped - reset: %s, idx: %lu, val: %p\n", +// (0x0 == val) ? "yes" : " no", +// (unsigned long)mReadIdx, +// val); + + if (0x0 == val) + { + // If the value is NULL then no value has yet been written to this location. Decrement the read index + --mReadIdx; // No need to handle wraparound since the read index will be incremented before the next read + } + + return val; +} + +template +inline typename AAX_CAtomicQueue::value_type AAX_CAtomicQueue::Peek() const +{ + // I don't think that we need a memory barrier here because: + // a) mReadIdx will only be modified from the read thread, and therefore presumably + // using the same CPU (or at least I can't see any way for mReadIndex modification + // ordering to be a problem between Peek() and Pop() on a single thread.) + // b) We don't care if mRingBuffer modifications are run out of order between the read + // and write threads, as long as they are "close". + const uint32_t testIdx = (mReadIdx+1) % template_size; + return AAX_Atomic_Load_Pointer(&mRingBuffer[testIdx]); +} + +// Attempt to support multiple read threads +// +// This approach is broken in the following scenario: +// +// Thread | Operation +// A Pop v enter +// A Pop - increment/get read index (get 1) +// A Pop - exchange pointer (get 0x0) +// other Push ptr1 +// other Push ptr2 +// B Pop v enter +// B Pop - increment/get read index (get 2) +// B Pop - exchange pointer (get ptr2) +// ERROR: popped ptr2 before ptr1 +// B Pop ^ exit +// A Pop - decrement read index (set 1) +// A Pop ^ exit +// any Pop v enter +// any Pop - increment/get read index (get 2) +// any Pop - exchange pointer (get 0x0) +// ERROR: should be ptr2 +// This NULL state continues for further Pop calls until either Push wraps around +// or another pair of concurrent calls to Pop just happens to re-aligign the read +// index by incrementing twice before any reads occur +// any Pop - decrement read index (set 1) +// any Pop ^ exit +// +// This could be fixed by incrementing the read index until either a non-NULL value is found or +// the initial position is reached, but that would have terrible performance. +// +// In any case, assuming a single read thread is optimal when we want maximum performance for read +// operations, since this requires the fewest number of atomic operations in the read methods +/* +template +inline typename AAX_CAtomicQueue::value_type AAX_CAtomicQueue::Pop() +{ + const uint32_t idx = AAX_Atomic_IncThenGet_32(mReadIdx); + const uint32_t widx = idx % S; + + value_type const val = AAX_Atomic_Exchange_Pointer(mRingBuffer[widx], (value_type)0x0); + + if (0x0 == val) + { + // If the value is NULL then no value has yet been written to this location. Decrement the read index + AAX_Atomic_DecThenGet_32(mReadIdx); + } + else + { + // Handle wraparound (assumes some overhead between S and UINT_32_MAX) + if (widx < idx) + { + AAX_Atomic_CompareAndExchange_32(mReadIdx, idx, widx); + } + } + + return val; +} + */ + +/// @endcond + +/// @cond ignore +#endif /* defined(AAX_CATOMICQUEUE_H) */ +/// @endcond diff --git a/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_CAutoreleasePool.h b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_CAutoreleasePool.h new file mode 100644 index 0000000000..aff19e847e --- /dev/null +++ b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_CAutoreleasePool.h @@ -0,0 +1,73 @@ +/*================================================================================================*/ +/* + + * Copyright 2014-2015, 2023-2024 Avid Technology, Inc. + * All rights reserved. + * + * This file is part of the Avid AAX SDK. + * + * The AAX SDK is subject to commercial or open-source licensing. + * + * By using the AAX SDK, you agree to the terms of both the Avid AAX SDK License + * Agreement and Avid Privacy Policy. + * + * AAX SDK License: https://developer.avid.com/aax + * Privacy Policy: https://www.avid.com/legal/privacy-policy-statement + * + * Or: You may also use this code under the terms of the GPL v3 (see + * www.gnu.org/licenses). + * + * THE AAX SDK IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER + * EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE + * DISCLAIMED. + * + */ + +/** + * \file AAX_CAutoreleasePool.h + * + * \brief Autorelease pool helper utility + */ +/*================================================================================================*/ + + +#pragma once + +#ifndef _AAX_CAUTORELEASEPOOL_H_ +#define _AAX_CAUTORELEASEPOOL_H_ + + +/* \brief Creates an autorelease pool for the scope of the stack based class + to clearn up any autoreleased memory that was allocated in the lifetime of + the pool. + + \details + This may be used on either Mac or Windows platforms and will not pull in + any Cocoa dependencies. + + usage: +\code +{ + AAX_CAutoreleasePool myAutoReleasePool + delete myCocoaObject; + + // Pool is released when the AAX_CAutoreleasePool is destroyed +} +\endcode + */ +class AAX_CAutoreleasePool +{ + public: + AAX_CAutoreleasePool(); + ~AAX_CAutoreleasePool(); + + private: + AAX_CAutoreleasePool (const AAX_CAutoreleasePool&); + AAX_CAutoreleasePool& operator= (const AAX_CAutoreleasePool&); + + private: + void* mAutoreleasePool; //!< Opaque pool instance + }; + + +#endif // #ifndef _AAX_CAUTORELEASEPOOL_H_ diff --git a/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_CBinaryDisplayDelegate.h b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_CBinaryDisplayDelegate.h new file mode 100644 index 0000000000..8a41431224 --- /dev/null +++ b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_CBinaryDisplayDelegate.h @@ -0,0 +1,221 @@ +/*================================================================================================*/ +/* + * + * Copyright 2013-2017, 2019, 2023-2024 Avid Technology, Inc. + * All rights reserved. + * + * This file is part of the Avid AAX SDK. + * + * The AAX SDK is subject to commercial or open-source licensing. + * + * By using the AAX SDK, you agree to the terms of both the Avid AAX SDK License + * Agreement and Avid Privacy Policy. + * + * AAX SDK License: https://developer.avid.com/aax + * Privacy Policy: https://www.avid.com/legal/privacy-policy-statement + * + * Or: You may also use this code under the terms of the GPL v3 (see + * www.gnu.org/licenses). + * + * THE AAX SDK IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER + * EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE + * DISCLAIMED. + * + */ + +/** + * \file AAX_CBinaryDisplayDelegate.h + * + * \brief A binary display delegate. + * + */ +/*================================================================================================*/ + + +#ifndef AAX_CBINARYDISPLAYDELEGATE_H +#define AAX_CBINARYDISPLAYDELEGATE_H + +#include "AAX_IDisplayDelegate.h" +#include "AAX_CString.h" + + +#include +#ifdef WINDOWS_VERSION +#include +#endif + +#include + + +/** \brief A binary display format conforming to AAX_IDisplayDelegate + + \details + This display delegate converts a parameter value to one of two provided strings (e.g. + "True" and "False".) + + \ingroup DisplayDelegates + + */ +template +class AAX_CBinaryDisplayDelegate : public AAX_IDisplayDelegate +{ +public: + /** \brief Constructor + * + * \details + * \param[in] falseString + * The string that will be associated with false parameter values + * \param[in] trueString + * The string that will be associated with true parameter values + */ + AAX_CBinaryDisplayDelegate(const char* falseString, const char* trueString); + AAX_CBinaryDisplayDelegate(const AAX_CBinaryDisplayDelegate& other); + + //Virtual Overrides + AAX_IDisplayDelegate* Clone() const AAX_OVERRIDE; + bool ValueToString(T value, AAX_CString* valueString) const AAX_OVERRIDE; + bool ValueToString(T value, int32_t maxNumChars, AAX_CString* valueString) const AAX_OVERRIDE; + bool StringToValue(const AAX_CString& valueString, T* value) const AAX_OVERRIDE; + + // AAX_CBinaryDisplayDelegate + virtual void AddShortenedStrings(const char* falseString, const char* trueString, int iStrLength); + +private: + AAX_CBinaryDisplayDelegate(); //private contructor to prevent its use externally. + + const AAX_CString mFalseString; + const AAX_CString mTrueString; + uint32_t mMaxStrLength; + + struct StringTable + { + int mStrLength; + AAX_CString mFalseString; + AAX_CString mTrueString; + }; + static bool StringTableSortFunc(struct StringTable i, struct StringTable j) + { + return (i.mStrLength < j.mStrLength); + } + + std::vector mShortenedStrings; +}; + + +template +AAX_CBinaryDisplayDelegate::AAX_CBinaryDisplayDelegate(const char* falseString, const char* trueString) : + mFalseString(falseString), + mTrueString(trueString), + mMaxStrLength(0) +{ + mMaxStrLength = (std::max)(mMaxStrLength, mFalseString.Length()); + mMaxStrLength = (std::max)(mMaxStrLength, mTrueString.Length()); +} + +template +AAX_CBinaryDisplayDelegate::AAX_CBinaryDisplayDelegate(const AAX_CBinaryDisplayDelegate& other) : + mFalseString(other.mFalseString), + mTrueString(other.mTrueString), + mMaxStrLength(other.mMaxStrLength) +{ + if ( other.mShortenedStrings.size() > 0 ) + { + for ( size_t i = 0; i < other.mShortenedStrings.size(); i++ ) + mShortenedStrings.push_back( other.mShortenedStrings.at(i) ); + } +} + +template +void AAX_CBinaryDisplayDelegate::AddShortenedStrings(const char* falseString, const char* trueString, int iStrLength) +{ + struct StringTable shortendTable; + shortendTable.mStrLength = iStrLength; + shortendTable.mFalseString = AAX_CString(falseString); + shortendTable.mTrueString = AAX_CString(trueString); + mShortenedStrings.push_back(shortendTable); + + // keep structure sorted by str lengths + std::sort(mShortenedStrings.begin(), mShortenedStrings.end(), AAX_CBinaryDisplayDelegate::StringTableSortFunc ); +} + + +template +AAX_IDisplayDelegate* AAX_CBinaryDisplayDelegate::Clone() const +{ + return new AAX_CBinaryDisplayDelegate(*this); +} + +template +bool AAX_CBinaryDisplayDelegate::ValueToString(T value, AAX_CString* valueString) const +{ + if (value) + *valueString = mTrueString; + else + *valueString = mFalseString; + return true; +} + +template +bool AAX_CBinaryDisplayDelegate::ValueToString(T value, int32_t maxNumChars, AAX_CString* valueString) const +{ + // if we don't ahve any shortened strings, just return the full length version + if ( mShortenedStrings.size() == 0 ) + return this->ValueToString(value, valueString); + + // first see if requested length is longer than normal strings + const uint32_t maxNumCharsUnsigned = (0 <= maxNumChars) ? static_cast(maxNumChars) : 0; + if ( maxNumCharsUnsigned >= mMaxStrLength ) + { + if (value) + *valueString = mTrueString; + else + *valueString = mFalseString; + return true; + } + + // iterate through shortened strings from longest to shortest + // taking the first set that is short enough + for ( int i = static_cast(mShortenedStrings.size())-1; i >= 0; i-- ) + { + struct StringTable shortStrings = mShortenedStrings.at(static_cast(i)); + if ( shortStrings.mStrLength <= maxNumChars ) + { + if (value) + *valueString = shortStrings.mTrueString; + else + *valueString = shortStrings.mFalseString; + return true; + } + } + + // if we can't find one short enough, just use the shortest version we can find + struct StringTable shortestStrings = mShortenedStrings.at(0); + if (value) + *valueString = shortestStrings.mTrueString; + else + *valueString = shortestStrings.mFalseString; + + return true; +} + +template +bool AAX_CBinaryDisplayDelegate::StringToValue(const AAX_CString& valueString, T* value) const +{ + if (valueString == mTrueString) + { + *value = (T)(true); + return true; + } + if (valueString == mFalseString) + { + *value = (T)(false); + return true; + } + *value = (T)(false); + return false; +} + + + + +#endif //AAX_CBINARYDISPLAYDELEGATE_H diff --git a/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_CBinaryTaperDelegate.h b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_CBinaryTaperDelegate.h new file mode 100644 index 0000000000..4c116e3c59 --- /dev/null +++ b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_CBinaryTaperDelegate.h @@ -0,0 +1,128 @@ +/*================================================================================================*/ +/* + * + * Copyright 2014-2017, 2019, 2023-2024 Avid Technology, Inc. + * All rights reserved. + * + * This file is part of the Avid AAX SDK. + * + * The AAX SDK is subject to commercial or open-source licensing. + * + * By using the AAX SDK, you agree to the terms of both the Avid AAX SDK License + * Agreement and Avid Privacy Policy. + * + * AAX SDK License: https://developer.avid.com/aax + * Privacy Policy: https://www.avid.com/legal/privacy-policy-statement + * + * Or: You may also use this code under the terms of the GPL v3 (see + * www.gnu.org/licenses). + * + * THE AAX SDK IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER + * EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE + * DISCLAIMED. + * + */ + +/** + * \file AAX_CBinaryTaperDelegate.h + * + * \brief A binary taper delegate. + * + */ +/*================================================================================================*/ + + +#ifndef AAX_CBINARYTAPERDELEGATE_H +#define AAX_CBINARYTAPERDELEGATE_H + +#include "AAX_ITaperDelegate.h" + + +/** \brief A binary taper conforming to \ref AAX_ITaperDelegate + + \details + This taper maps positive real values to 1 and negative or zero real values to 0. This is + the standard taper used on all bool parameters. + + When this taper is constructed with a bool template type, its normalized values are + automatically typecast to the proper boolean value. + + \ingroup TaperDelegates + +*/ +template +class AAX_CBinaryTaperDelegate : public AAX_ITaperDelegate +{ +public: + + /** \brief Constructs a Binary Taper + * + */ + AAX_CBinaryTaperDelegate( ); + + //Virtual Overrides + AAX_ITaperDelegate* Clone() const AAX_OVERRIDE; + T GetMaximumValue() const AAX_OVERRIDE; + T GetMinimumValue() const AAX_OVERRIDE; + T ConstrainRealValue(T value) const AAX_OVERRIDE; + T NormalizedToReal(double normalizedValue) const AAX_OVERRIDE; + double RealToNormalized(T realValue) const AAX_OVERRIDE; +}; + + + + + + +template +AAX_CBinaryTaperDelegate::AAX_CBinaryTaperDelegate( ) : + AAX_ITaperDelegate() +{ +} + +template +AAX_ITaperDelegate* AAX_CBinaryTaperDelegate::Clone() const +{ + return new AAX_CBinaryTaperDelegate(*this); +} + +template +T AAX_CBinaryTaperDelegate::GetMinimumValue() const +{ + return false; +} + +template +T AAX_CBinaryTaperDelegate::GetMaximumValue() const +{ + return true; +} + +template +T AAX_CBinaryTaperDelegate::ConstrainRealValue(T value) const +{ + return value; +} + +template +T AAX_CBinaryTaperDelegate::NormalizedToReal(double normalizedValue) const +{ + if (normalizedValue > 0.0f) + return (T)(1); //should construct true for bool + return (T)(0); //should construct false for bool +} + +template +double AAX_CBinaryTaperDelegate::RealToNormalized(T realValue) const +{ + if (realValue > (T)(0)) + return 1.0f; + return 0.0f; +} + + + + +#endif //AAX_CBINARYTAPERDELEGATE_H + + diff --git a/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_CChunkDataParser.h b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_CChunkDataParser.h new file mode 100644 index 0000000000..8ae39e8ecb --- /dev/null +++ b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_CChunkDataParser.h @@ -0,0 +1,203 @@ +/*================================================================================================*/ +/* + * + * Copyright 2013-2015, 2023-2024 Avid Technology, Inc. + * All rights reserved. + * + * This file is part of the Avid AAX SDK. + * + * The AAX SDK is subject to commercial or open-source licensing. + * + * By using the AAX SDK, you agree to the terms of both the Avid AAX SDK License + * Agreement and Avid Privacy Policy. + * + * AAX SDK License: https://developer.avid.com/aax + * Privacy Policy: https://www.avid.com/legal/privacy-policy-statement + * + * Or: You may also use this code under the terms of the GPL v3 (see + * www.gnu.org/licenses). + * + * THE AAX SDK IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER + * EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE + * DISCLAIMED. + * + */ + +/** + * \file AAX_CChunkDataParser.h + * + * \brief Parser utility for plugin chunks + * + */ +/*================================================================================================*/ + + +#pragma once + +#ifndef AAX_CHUNKDATAPARSER_H +#define AAX_CHUNKDATAPARSER_H + +#include "AAX.h" +#include "AAX_CString.h" +#include + +//forward declarations +struct AAX_SPlugInChunk; + +/*! + * \brief Constants used by ChunkDataParser class + */ +namespace AAX_ChunkDataParserDefs { + const int32_t FLOAT_TYPE = 1; + const char FLOAT_STRING_IDENTIFIER[] = "f_"; + + const int32_t LONG_TYPE = 2; + const char LONG_STRING_IDENTIFIER[] = "l_"; + + const int32_t DOUBLE_TYPE = 3; + const char DOUBLE_STRING_IDENTIFIER[] = "d_"; + const size_t DOUBLE_TYPE_SIZE = 8; + const size_t DOUBLE_TYPE_INCR = 8; + + const int32_t SHORT_TYPE = 4; + const char SHORT_STRING_IDENTIFIER[] = "s_"; + const size_t SHORT_TYPE_SIZE = 2; + const size_t SHORT_TYPE_INCR = 4; // keep life word aligned + + const int32_t STRING_TYPE = 5; + const char STRING_STRING_IDENTIFIER[] = "r_"; + const size_t MAX_STRINGDATA_LENGTH = 255; + + const size_t DEFAULT32BIT_TYPE_SIZE = 4; + const size_t DEFAULT32BIT_TYPE_INCR = 4; + + const size_t STRING_IDENTIFIER_SIZE = 2; + + const int32_t NAME_NOT_FOUND = -1; + const size_t MAX_NAME_LENGTH = 255; + const int32_t BUILD_DATA_FAILED = -333; + const int32_t HEADER_SIZE = 4; + const int32_t VERSION_ID_1 = 0x01010101; +} + +/*! \brief Parser utility for plugin chunks + * + * \details + * \todo Update this documentation for AAX + * + * This class acts as generic repository for data that is stuffed into or extracted + * from a SFicPlugInChunk. It has an abstracted Add/Find interface to add or retrieve + * data values, each uniquely referenced by a c-string. In conjuction with the Effect + * Layer and the "ControlManager" aspects of the CProcess class, this provides a more + * transparent & resilent system for performing save-and-restore on settings that won't break + * so easily from endian issues or from the hard-coded structs that have typically been + * used to build chunk data. + * + * \par Format of the Chunk Data + * The first 4 bytes of the data are the version number (repeated 4 times to be + * immune to byte swapping). Data follows next.\n + * \n + * Example: "f_bypa %$#@d_gain #$!#@$%$s_omsi #$" + * \code + * type name value + * ---------------------------- + * float bypa %$#@ + * double gain #$!#@$%$ + * int16_t omsi #$ + * \endcode + * \n + * \li The first character denotes the data type: + * \code + * 'f' = float + * 'd' = double + * 'l' = int32 + * 's' = int16 + * \endcode + * \n + * \li "_" is an empty placekeeper that could be used to addition future information. Currently, it's + * ignored when a chunk is parsed. + * + * \li The string name identifier follows next, and can up to 255 characters int32_t. The Effect Layer + * builds chunks it always converts the AAX_FourCharCode of the control to a string. So, this will always be + * 4 characters int32_t. The string is null terminated to indicate the start of the data value. + * + * \li The data value follows next, but is possible shifted to aligned word aligned. The size of + * is determined, of course, by the data type. + */ +class AAX_CChunkDataParser +{ + public: + AAX_CChunkDataParser(); + virtual ~AAX_CChunkDataParser(); + + /*! \brief CALL: Adds some data of type float with \a name and \a value to the current chunk + * + * \details + * \sa \ref AddDouble(), \ref AddInt32(), and \ref AddInt16() are the same but with different data types. + */ + void AddFloat(const char *name, float value); + void AddDouble(const char *name, double value); //!< CALL: See AddFloat() + void AddInt32(const char *name, int32_t value); //!< CALL: See AddFloat() + void AddInt16(const char *name, int16_t value); //!< CALL: See AddFloat() + void AddString(const char *name, AAX_CString value); + + /*! \brief CALL: Finds some data of type float with \a name and \a value in the current chunk + * + * \details + * \sa \ref FindDouble(), \ref FindInt32(), and \ref FindInt16() are the same but with different data types. + */ + bool FindFloat(const char *name, float *value); + bool FindDouble(const char *name, double *value); //!< CALL: See FindFloat() + bool FindInt32(const char *name, int32_t *value); //!< CALL: See FindFloat() + bool FindInt16(const char *name, int16_t *value); //!< CALL: See FindFloat() + bool FindString(const char *name, AAX_CString *value); + + bool ReplaceDouble(const char *name, double value); //SW added for fela + int32_t GetChunkData(AAX_SPlugInChunk *chunk); //!< CALL: Fills passed in \a chunk with data from current chunk; returns 0 if successful + int32_t GetChunkDataSize(); //!< CALL: Returns size of current chunk + int32_t GetChunkVersion() {return mChunkVersion;} //!< CALL: Lists fVersion in chunk header for convenience. + bool IsEmpty(); //!< CALL: Returns true if no data is in the chunk + void Clear(); //!< Resets chunk + //@{ + /*! \name Internal Methods + * An Effect Layer plugin can ignore these methods. They are handled by or used internally by the Effect Layer. + */ + void LoadChunk(const AAX_SPlugInChunk *chunk); //!< Sets current chunk to data in \a chunk parameter + + protected: + void WordAlign(uint32_t &index); //!< sets \a index to 4-byte boundary + void WordAlign(int32_t &index); //!< sets \a index to 4-byte boundary + int32_t FindName(const AAX_CString &Name); //!< used by public Find methods + //@} END Internal Methods group + /*! \brief The last index found in the chunk + * + * \details + * Since control values in chunks should tend to stay in order and in sync with + * the way they're checked with controls within the plug-in, we'll keep track of + * the value index to speed up searching. + */ + int32_t mLastFoundIndex; + + char *mChunkData; + + int32_t mChunkVersion; //!< Equal to fVersion from the chunk header. Equal to -1 if no chunk is loaded. +public: + struct DataValue + { + int32_t mDataType; + AAX_CString mDataName; //!< name of the stored data + int64_t mIntValue; //!< used if this DataValue is not a string + AAX_CString mStringValue; //!< used if this DataValue is a string + + DataValue(): + mDataType(0), + mDataName(AAX_CString()), + mIntValue(0), + mStringValue(AAX_CString()) + {}; + }; + + std::vector mDataValues; +}; + +#endif //AAX_CHUNKDATAPARSER_H diff --git a/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_CDecibelDisplayDelegateDecorator.h b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_CDecibelDisplayDelegateDecorator.h new file mode 100644 index 0000000000..04217f140f --- /dev/null +++ b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_CDecibelDisplayDelegateDecorator.h @@ -0,0 +1,177 @@ +/*================================================================================================*/ +/* + * + * Copyright 2013-2017, 2019, 2023-2024 Avid Technology, Inc. + * All rights reserved. + * + * This file is part of the Avid AAX SDK. + * + * The AAX SDK is subject to commercial or open-source licensing. + * + * By using the AAX SDK, you agree to the terms of both the Avid AAX SDK License + * Agreement and Avid Privacy Policy. + * + * AAX SDK License: https://developer.avid.com/aax + * Privacy Policy: https://www.avid.com/legal/privacy-policy-statement + * + * Or: You may also use this code under the terms of the GPL v3 (see + * www.gnu.org/licenses). + * + * THE AAX SDK IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER + * EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE + * DISCLAIMED. + * + */ + +/** + * \file AAX_CDecibelDisplayDelegateDecorator.h + * + * \brief A decibel display delegate. + * + */ +/*================================================================================================*/ + + +#ifndef AAX_CDECIBELDISPLAYDELEGATEDECORATOR_H +#define AAX_CDECIBELDISPLAYDELEGATEDECORATOR_H + + +#include "AAX_IDisplayDelegateDecorator.h" +#include + + + +/** \brief A percent decorator conforming to AAX_IDisplayDelegateDecorator + + \details + This class is an \ref AAX_IDisplayDelegateDecorator, meaning that it acts as a wrapper for + other display delegates or concrete display types. For more information about display + delegate decorators in AAX, see \ref displaydelegates_decorators + + The behavior of this class it to provide conversion to and from dB values. It performs + a decibel conversion on the square of the provided value (i.e. 20 log) before passing the + value on to a concrete display delegate to get a value string. This class then appends + the "dB" suffix to signify that the value was converted. This allows something like a + gain value to remain internally linear at all times even though its display is converted + to decibels. + + The inverse is also supported; this class can convert a decibel-formatted string into its + associated real value. The string will first be converted to a number, then that number + will have the inverse dB calculation applied to it to retrieve the parameter's real value. + + \ingroup AAXLibraryFeatures_ParameterManager_DisplayDelegates_Decorators + +*/ +template +class AAX_CDecibelDisplayDelegateDecorator : public AAX_IDisplayDelegateDecorator +{ +public: + AAX_CDecibelDisplayDelegateDecorator(const AAX_IDisplayDelegate& displayDelegate); + + //Virtual Overrides + AAX_CDecibelDisplayDelegateDecorator* Clone() const AAX_OVERRIDE; + bool ValueToString(T value, AAX_CString* valueString) const AAX_OVERRIDE; + bool ValueToString(T value, int32_t maxNumChars, AAX_CString* valueString) const AAX_OVERRIDE; + bool StringToValue(const AAX_CString& valueString, T* value) const AAX_OVERRIDE; +}; + + + + + + +template +AAX_CDecibelDisplayDelegateDecorator::AAX_CDecibelDisplayDelegateDecorator(const AAX_IDisplayDelegate& displayDelegate) : + AAX_IDisplayDelegateDecorator(displayDelegate) +{ + +} + +template +AAX_CDecibelDisplayDelegateDecorator* AAX_CDecibelDisplayDelegateDecorator::Clone() const +{ + return new AAX_CDecibelDisplayDelegateDecorator(*this); +} + +template +bool AAX_CDecibelDisplayDelegateDecorator::ValueToString(T value, AAX_CString* valueString) const +{ + bool succeeded = false; + if (value <= 0) + { + //*valueString = AAX_CString("--- dB"); + *valueString = AAX_CString("-INF "); + succeeded = true; + } + else + { + value = (T)(20.0*log10(value)); + if ( value > -0.01f && value < 0.0f) //To prevent minus for 0.0 value in automation turned on + value = 0.0f; + + succeeded = AAX_IDisplayDelegateDecorator::ValueToString(value, valueString); + } + + *valueString += AAX_CString("dB"); + return succeeded; +} + +template +bool AAX_CDecibelDisplayDelegateDecorator::ValueToString(T value, int32_t maxNumChars, AAX_CString* valueString) const +{ + if (value <= 0) + { + *valueString = AAX_CString("-INF"); + if (maxNumChars >= 7) + valueString->Append(" dB"); // Add a space for longer strings and dB + return true; + } + + value = (T)(20.0*log10(value)); + if ( value > -0.01f && value < 0.0f) //To prevent minus for 0.0 value in automation turned on + value = 0.0f; + bool succeeded = AAX_IDisplayDelegateDecorator::ValueToString(value, maxNumChars, valueString); + + + // Check current string length and see if there is room to add units. I believe these units are usually less important than precision on control surfaces. + uint32_t strlen = valueString->Length(); + const uint32_t maxNumCharsUnsigned = (0 <= maxNumChars) ? static_cast(maxNumChars) : 0; + if (maxNumCharsUnsigned >= (strlen + 2)) //length of string plus 2 for the "dB" + *valueString += AAX_CString("dB"); + return succeeded; +} + + +template +bool AAX_CDecibelDisplayDelegateDecorator::StringToValue(const AAX_CString& valueString, T* value) const +{ + //Just call through if there is obviously no unit string. + if (valueString.Length() <= 2) + { + bool success = AAX_IDisplayDelegateDecorator::StringToValue(valueString, value); + *value = (T)pow((T)10.0, (*value / (T)20.0)); + return success; + } + + //Just call through if the end of this string does not match the unit string. + AAX_CString unitSubString; + valueString.SubString(valueString.Length() - 2, 2, &unitSubString); + if (unitSubString != AAX_CString("dB")) + { + bool success = AAX_IDisplayDelegateDecorator::StringToValue(valueString, value); + *value = (T)pow((T)10.0, *value / (T)20.0); + return success; + } + + //Call through with the stripped down value string. + AAX_CString valueSubString; + valueString.SubString(0, valueString.Length() - 2, &valueSubString); + bool success = AAX_IDisplayDelegateDecorator::StringToValue(valueSubString, value); + *value = (T)pow((T)10.0, *value / (T)20.0); + return success; +} + + + + +#endif //AAX_CDECIBELDISPLAYDELEGATEDECORATOR_H diff --git a/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_CEffectDirectData.h b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_CEffectDirectData.h new file mode 100644 index 0000000000..4e54d5dbc9 --- /dev/null +++ b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_CEffectDirectData.h @@ -0,0 +1,183 @@ +/*================================================================================================*/ +/* + * + * Copyright 2013-2017, 2019, 2023-2024 Avid Technology, Inc. + * All rights reserved. + * + * This file is part of the Avid AAX SDK. + * + * The AAX SDK is subject to commercial or open-source licensing. + * + * By using the AAX SDK, you agree to the terms of both the Avid AAX SDK License + * Agreement and Avid Privacy Policy. + * + * AAX SDK License: https://developer.avid.com/aax + * Privacy Policy: https://www.avid.com/legal/privacy-policy-statement + * + * Or: You may also use this code under the terms of the GPL v3 (see + * www.gnu.org/licenses). + * + * THE AAX SDK IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER + * EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE + * DISCLAIMED. + * + */ + +/** + * \file AAX_CEffectDirectData.h + * + * \brief A default implementation of the AAX_IEffectDirectData interface. + * + */ +/*================================================================================================*/ + +#pragma once +#ifndef AAX_CEFFECTDIRECTDATA_H +#define AAX_CEFFECTDIRECTDATA_H + +#include "AAX_IEffectDirectData.h" + + + +class AAX_IPrivateDataAccess; +class AAX_IEffectParameters; +class AAX_IController; + + + +/** @brief Default implementation of the AAX_IEffectDirectData interface. + + @details + This class provides a default implementation of the AAX_IEffectDirectData interface. + + \ingroup AuxInterface_DirectData +*/ +class AAX_CEffectDirectData : public AAX_IEffectDirectData +{ +public: ///////////////////////////////////////////////////////////////////////////// AAX_CEffectDirectData + + AAX_CEffectDirectData( + void); + + virtual + ~AAX_CEffectDirectData( + void); + +public: ///////////////////////////////////////////////////////////////////////////// AAX_IEffectDirectData + + /** @name Initialization and uninitialization + */ + //@{ + /*! \brief Non-virtual implementation of AAX_IEfectDirectData::Initialize() + * + * This implementation initializes all private AAX_CEffectDirectData + * members and calls Initialize_PrivateDataAccess(). For custom + * initialization, inherited classes should override + * Initialize_PrivateDataAccess(). + * + * \param[in] iController + * Unknown pointer that resolves to an AAX_IController. + * + */ + AAX_Result Initialize (IACFUnknown * iController ) AAX_OVERRIDE AAX_FINAL; + AAX_Result Uninitialize (void) AAX_OVERRIDE; + //@}end Initialization and uninitialization + + /** @name Data update callbacks + * + */ + //@{ + /*! \brief Non-virtual implementation of AAX_IEfectDirectData::TimerWakeup() + * + * This implementation interprets the IACFUnknown and forwards + * the resulting AAX_IPrivateDataAccess to \ref TimerWakeup_PrivateDataAccess() + * + * \param[in] iDataAccessInterface + * Unknown pointer that resolves to an AAX_IPrivateDataAccess. This + * interface is only valid for the duration of this method's execution + * and is discarded when the method returns. + * + */ + AAX_Result TimerWakeup (IACFUnknown * iDataAccessInterface ) AAX_OVERRIDE; + //@}end Data update callbacks + + /** @name %AAX host and plug-in event notification + */ + //@{ + /*! + * \brief Notification Hook + * + * Called from the host to deliver notifications to this object. + * + * Look at the \ref AAX_ENotificationEvent enumeration to see a description of events you can listen for and the + * data they come with. + * + * - \note some notifications are sent only to the plug-in GUI or plug-in data model while other notifications are sent only to the + * EffectDirectData. If you are not seeing an expected notification, try checking the other plug-in objects' + * \c NotificationReceived() methods. + * - \note the host may dispatch notifications synchronously or asynchronously, and calls to this method may + * occur concurrently on multiple threads. + * + * \param[in] inNotificationType + * Type of notification being received. Notifications form the host are one of \ref AAX_ENotificationEvent + * \param[in] inNotificationData + * Block of incoming notification data + * \param[in] inNotificationDataSize + * Size of \p inNotificationData, in bytes + */ + AAX_Result NotificationReceived( AAX_CTypeID inNotificationType, + const void * inNotificationData, + uint32_t inNotificationDataSize) AAX_OVERRIDE; + //@} end %AAX host and plug-in event notification + + +public: ///////////////////////////////////////////////////////////////////////////// AAX_CEffectDirectData + + /** @name Private member accessors + */ + //@{ + /*! + * \brief Returns a pointer to the plug-in's controller interface + * + * \todo Change to GetController to match other AAX_CEffect modules + */ + AAX_IController* Controller (void); + /*! + * \brief Returns a pointer to the plug-in's data model interface + * + * \todo Change to GetController to match other AAX_CEffect modules + */ + AAX_IEffectParameters* EffectParameters (void); + //@}end Private member accessors + +protected: ///////////////////////////////////////////////////////////////////////////// AAX_CEffectDirectData + + /** @name AAX_CEffectDirectData virtual interface + */ + //@{ + /*! + * \brief Initialization routine for classes that inherit from AAX_CEffectDirectData. + * This method is called by the default Initialize() implementation after all + * internal members have been initialized, and provides a safe location in which to + * perform any additional initialization tasks. + * + */ + virtual AAX_Result Initialize_PrivateDataAccess(); + /*! + * \brief Callback provided with an AAX_IPrivateDataAccess. Override this method + * to access the algorithm's private data using the AAX_IPrivateDataAccess interface. + * + * \param[in] iPrivateDataAccess + * Pointer to an AAX_IPrivateDataAccess interface. This interface is only + * valid for the duration of this method. + */ + virtual AAX_Result TimerWakeup_PrivateDataAccess(AAX_IPrivateDataAccess* iPrivateDataAccess); + //@}end AAX_CEffectDirectData virtual interface + +private: + AAX_IController* mController; + AAX_IEffectParameters* mEffectParameters; +}; + + +#endif // AAX_CEFFECTDIRECTDATA_H diff --git a/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_CEffectGUI.h b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_CEffectGUI.h new file mode 100644 index 0000000000..51e4cbb4ac --- /dev/null +++ b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_CEffectGUI.h @@ -0,0 +1,232 @@ +/*================================================================================================*/ +/* + * + * Copyright 2013-2017, 2019, 2023-2024 Avid Technology, Inc. + * All rights reserved. + * + * This file is part of the Avid AAX SDK. + * + * The AAX SDK is subject to commercial or open-source licensing. + * + * By using the AAX SDK, you agree to the terms of both the Avid AAX SDK License + * Agreement and Avid Privacy Policy. + * + * AAX SDK License: https://developer.avid.com/aax + * Privacy Policy: https://www.avid.com/legal/privacy-policy-statement + * + * Or: You may also use this code under the terms of the GPL v3 (see + * www.gnu.org/licenses). + * + * THE AAX SDK IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER + * EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE + * DISCLAIMED. + * + */ + +/** + * \file AAX_CEffectGUI.h + * + * \brief A default implementation of the AAX_IEffectGUI interface. + * + */ +/*================================================================================================*/ + + +#ifndef AAX_CEFFECTGUI_H +#define AAX_CEFFECTGUI_H + +#include "AAX_IEffectGUI.h" +#include "AAX_IACFEffectParameters.h" + +#include +#include +#include +#include + + +class AAX_IEffectParameters; +class AAX_IController; +class AAX_IViewContainer; +class AAX_ITransport; + + + +/** @brief Default implementation of the AAX_IEffectGUI interface. + + @details + This class provides a default implementation of the AAX_IEffectGUI interface. + + \legacy The default implementations in this class are mostly derived from their + equivalent implementations in CProcess and CEffectProcess. For additional + CProcess-derived implementations, see AAX_CEffectParameters. + + \note See AAX_IACFEffectGUI for further information. + + \ingroup CommonInterface_GUI +*/ +class AAX_CEffectGUI : public AAX_IEffectGUI +{ +public: ///////////////////////////////////////////////////////////////////////////// AAX_CEffectGUI + + AAX_CEffectGUI(void); + ~AAX_CEffectGUI(void) AAX_OVERRIDE; + +public: ///////////////////////////////////////////////////////////////////////////// AAX_IEffectGUI + + /** @name Initialization and uninitialization + */ + //@{ + AAX_Result Initialize (IACFUnknown * iController ) AAX_OVERRIDE; + AAX_Result Uninitialize (void) AAX_OVERRIDE; + //@}end Initialization and uninitialization + + /** @name %AAX host and plug-in event notification + */ + //@{ + /** \copydoc AAX_IACFEffectGUI::NotificationReceived() + + \note The default implementation doesn't do anything at this point, but it is probably still a good idea to + call into the base class \ref AAX_CEffectGUI::NotificationReceived() function in case we want to implement + some default behaviors in the future. + */ + AAX_Result NotificationReceived(AAX_CTypeID inNotificationType, const void * inNotificationData, uint32_t inNotificationDataSize) AAX_OVERRIDE; + //@}end %AAX host and plug-in event notification + + /** @name View accessors + */ + //@{ + AAX_Result SetViewContainer (IACFUnknown * iViewContainer ) AAX_OVERRIDE; + AAX_Result GetViewSize (AAX_Point * /* oViewSize */ ) const AAX_OVERRIDE + { + return AAX_SUCCESS; + } + //@}end View accessors + + /** @name GUI update methods + */ + //@{ + AAX_Result Draw (AAX_Rect * /* iDrawRect */ ) AAX_OVERRIDE + { + return AAX_SUCCESS; + } + AAX_Result TimerWakeup (void) AAX_OVERRIDE + { + return AAX_SUCCESS; + } + AAX_Result ParameterUpdated(AAX_CParamID paramID) AAX_OVERRIDE; + //@}end GUI update methods + + /** @name Host interface methods + * + * Miscellaneous methods to provide host-specific functionality + */ + //@{ + AAX_Result GetCustomLabel ( AAX_EPlugInStrings iSelector, AAX_IString * oString ) const AAX_OVERRIDE; + + AAX_Result SetControlHighlightInfo (AAX_CParamID /* iParameterID */, AAX_CBoolean /* iIsHighlighted */, AAX_EHighlightColor /* iColor */) AAX_OVERRIDE + { + return AAX_SUCCESS; + } + //@}end Direct host interface methods + +protected: ///////////////////////////////////////////////////////////////////////////// AAX_CEffectGUI + + /** @name AAX_CEffectGUI pure virtual interface + * + * The implementations of these methods will be specific to the particular GUI framework that + * is being incorporated with AAX_CEffectGUI. Classes that inherit from AAX_CEffectGUI must + * override these methods with their own framework-specific implementations. + * + */ + //@{ + /*! + * \brief Creates any required top-level GUI components + * + * This method is called by default from AAX_CEffectGUI::Initialize() + */ + virtual void CreateViewContents (void) = 0; + /*! + * \brief Initializes the plug-in window and creates the main GUI view or frame + * + * This method is called by default from AAX_CEffectGUI::SetViewContainer() when a valid + * window is present + */ + virtual void CreateViewContainer (void) = 0; + /*! + * \brief Uninitializes the plug-in window and deletes the main GUI view or frame + * + * This method is called by default from AAX_CEffectGUI::SetViewContainer() when no valid + * window is present. It may also be appropriate for inheriting classes to call this + * method from their destructors, depending on their own internal implementation. + */ + virtual void DeleteViewContainer (void) = 0; + //@}end AAX_CEffectGUI pure virtual interface + + /** @name Helper methods + */ + //@{ + /*! + * \brief Requests an update to the GUI for every parameter view + * + * By default, calls AAX_CEffectGUI::ParameterUpdated() on every registered parameter. + * + * By default, called from AAX_CEffectGUI::SetViewContainer() after a new view container + * has been created. + * + * \todo Rename to \c UpdateAllParameterViews() or another name that does not lead to + * confusion regarding what exactly this method should be doing. + */ + virtual void UpdateAllParameters (void); + //@}end Helper methods + +public: //These accessors are public here as they are often needed by contained views. + + /** @name Private member accessors + */ + //@{ + /*! + * \brief Retrieves a reference to the plug-in's controller interface + * + */ + AAX_IController* GetController (void); + const AAX_IController* GetController (void) const; + + /*! + * \brief Retrieves a reference to the plug-in's data model interface + * + */ + AAX_IEffectParameters* GetEffectParameters (void); + const AAX_IEffectParameters* GetEffectParameters (void) const; + + /*! + * \brief Retrieves a reference to the plug-in's view container interface + * + */ + AAX_IViewContainer* GetViewContainer (void); + const AAX_IViewContainer* GetViewContainer (void) const; + + /*! + * \brief Retrieves a reference to the plug-in's Transport interface + * + */ + AAX_ITransport* Transport(); + const AAX_ITransport* Transport() const; + + /*! + * \brief Retrieves the Container and it's type. + * + */ + AAX_EViewContainer_Type GetViewContainerType (); + void * GetViewContainerPtr (); + //@}end Private member accessors + +private: + //These are private, but they all have protected accessors. + AAX_IController * mController; + AAX_IEffectParameters * mEffectParameters; + AAX_UNIQUE_PTR(AAX_IViewContainer) mViewContainer; + AAX_ITransport* mTransport; +}; + + +#endif diff --git a/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_CEffectParameters.h b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_CEffectParameters.h new file mode 100644 index 0000000000..321eec6edf --- /dev/null +++ b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_CEffectParameters.h @@ -0,0 +1,369 @@ +/*================================================================================================*/ +/* + * + * Copyright 2013-2017, 2019, 2023-2024 Avid Technology, Inc. + * All rights reserved. + * + * This file is part of the Avid AAX SDK. + * + * The AAX SDK is subject to commercial or open-source licensing. + * + * By using the AAX SDK, you agree to the terms of both the Avid AAX SDK License + * Agreement and Avid Privacy Policy. + * + * AAX SDK License: https://developer.avid.com/aax + * Privacy Policy: https://www.avid.com/legal/privacy-policy-statement + * + * Or: You may also use this code under the terms of the GPL v3 (see + * www.gnu.org/licenses). + * + * THE AAX SDK IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER + * EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE + * DISCLAIMED. + * + */ + +/** + * \file AAX_CEffectParameters.h + * + * \brief A default implementation of the AAX_IeffectParameters interface. + * + */ +/*================================================================================================*/ + + +#ifndef AAX_CEFFECTPARAMETERS_H +#define AAX_CEFFECTPARAMETERS_H + +#include "AAX_IEffectParameters.h" +#include "AAX_IPageTable.h" +#include "AAX_CString.h" +#include "AAX_CChunkDataParser.h" +#include "AAX_CParameterManager.h" +#include "AAX_CPacketDispatcher.h" + +#include +#include +#include + +class AAX_IController; +class AAX_IAutomationDelegate; +class AAX_CParameterManager; +class AAX_CPacketDispatcher; +class AAX_ITransport; + +extern "C" AAX_CParamID cPreviewID; +extern "C" AAX_CParamID cDefaultMasterBypassID; + +/** @brief Default implementation of the \ref AAX_IEffectParameters interface. + + @details + This class provides a default implementation of the AAX_IEffectParameters interface. + In nearly all cases, your plug-in's data model should inherit from this class and + override only those functions that you wish to explicitly customize. + + \legacy The default implementations in this class are mostly derived from their + equivalent implementations in CProcess and CEffectProcess. For additional + CProcess-derived implementations, see \ref AAX_CEffectGUI. + + \section AAX_CEffectParameters_relclass Related classes + \dotfile aax_ieffectparams_related.dot "Classes related to AAX_IEffectParameters by inheritance or composition" + \dotfile aax_ieffectparams_contained.dot "Classes owned as member objects of AAX_CEffectParameters" + + \ingroup CommonInterface_DataModel +*/ +class AAX_CEffectParameters : public AAX_IEffectParameters +{ +public: ///////////////////////////////////////////////////////////////////////////// constructor/destructor + AAX_CEffectParameters (void); + ~AAX_CEffectParameters (void) AAX_OVERRIDE; + AAX_CEffectParameters& operator= (const AAX_CEffectParameters& other); + +public: ///////////////////////////////////////////////////////////////////////////// AAX_IEffectParameters + /** @name Initialization and uninitialization + */ + //@{ + /** \copydoc AAX_IACFEffectParameters::Initialize() + + This default implementation calls \ref AAX_CEffectParameters::EffectInit() "EffectInit()". + Only override \ref Initialize() when additional initialization steps must be performed + prior to \ref AAX_CEffectParameters::EffectInit() "EffectInit()". + */ + AAX_Result Initialize(IACFUnknown* iController) AAX_OVERRIDE; + AAX_Result Uninitialize (void) AAX_OVERRIDE; + //@}end Initialization and uninitialization + + /** @name %AAX host and plug-in event notification + */ + //@{ + AAX_Result NotificationReceived( /* AAX_ENotificationEvent */ AAX_CTypeID inNotificationType, const void * inNotificationData, uint32_t inNotificationDataSize) AAX_OVERRIDE; + //@}end %AAX host and plug-in event notification + + /** @name Parameter information + * + * These methods are used by the %AAX host to retrieve information about the plug-in's data + * model. For information about adding parameters to the plug-in and otherwise modifying + * the plug-in's data model, see AAX_CParameterManager. For information about parameters, + * see AAX_IParameter. + */ + //@{ + AAX_Result GetNumberOfParameters (int32_t * oNumControls) const AAX_OVERRIDE; + AAX_Result GetMasterBypassParameter (AAX_IString * oIDString) const AAX_OVERRIDE; + AAX_Result GetParameterIsAutomatable (AAX_CParamID iParameterID, AAX_CBoolean * oAutomatable) const AAX_OVERRIDE; + AAX_Result GetParameterNumberOfSteps (AAX_CParamID iParameterID, int32_t * oNumSteps ) const AAX_OVERRIDE; + AAX_Result GetParameterName (AAX_CParamID iParameterID, AAX_IString * oName ) const AAX_OVERRIDE; + AAX_Result GetParameterNameOfLength (AAX_CParamID iParameterID, AAX_IString * oName, int32_t iNameLength ) const AAX_OVERRIDE; + AAX_Result GetParameterDefaultNormalizedValue (AAX_CParamID iParameterID, double * oValue ) const AAX_OVERRIDE; + AAX_Result SetParameterDefaultNormalizedValue (AAX_CParamID iParameterID, double iValue ) AAX_OVERRIDE; + AAX_Result GetParameterType (AAX_CParamID iParameterID, AAX_EParameterType * oParameterType ) const AAX_OVERRIDE; + AAX_Result GetParameterOrientation (AAX_CParamID iParameterID, AAX_EParameterOrientation * oParameterOrientation ) const AAX_OVERRIDE; + AAX_Result GetParameter (AAX_CParamID iParameterID, AAX_IParameter ** oParameter ) AAX_OVERRIDE; + AAX_Result GetParameterIndex (AAX_CParamID iParameterID, int32_t * oControlIndex ) const AAX_OVERRIDE; + AAX_Result GetParameterIDFromIndex (int32_t iControlIndex, AAX_IString * oParameterIDString ) const AAX_OVERRIDE; + AAX_Result GetParameterValueInfo ( AAX_CParamID iParameterID, int32_t iSelector, int32_t* oValue) const AAX_OVERRIDE; + //@}end Parameter information + + /** @name Parameter setters and getters + * + * These methods are used by the %AAX host and by the plug-in's UI to retrieve and modify + * the values of the plug-in's parameters. + * + * \note The parameter setters in this section may generate asynchronous requests. + */ + //@{ + AAX_Result GetParameterValueFromString (AAX_CParamID iParameterID, double * oValue, const AAX_IString & iValueString ) const AAX_OVERRIDE; + AAX_Result GetParameterStringFromValue (AAX_CParamID iParameterID, double iValue, AAX_IString * oValueString, int32_t iMaxLength ) const AAX_OVERRIDE; + AAX_Result GetParameterValueString (AAX_CParamID iParameterID, AAX_IString * oValueString, int32_t iMaxLength) const AAX_OVERRIDE; + AAX_Result GetParameterNormalizedValue (AAX_CParamID iParameterID, double * oValuePtr ) const AAX_OVERRIDE; + AAX_Result SetParameterNormalizedValue (AAX_CParamID iParameterID, double iValue ) AAX_OVERRIDE; + AAX_Result SetParameterNormalizedRelative (AAX_CParamID iParameterID, double iValue ) AAX_OVERRIDE; + //@}end Parameter setters and getters + + /** @name Automated parameter helpers + * + * These methods are used to lock and unlock automation system 'resources' when + * updating automatable parameters. + * + * \note You should never need to override these methods to extend their + * behavior beyond what is provided in AAX_CEffectParameters and AAX_IParameter + * + */ + //@{ + AAX_Result TouchParameter ( AAX_CParamID iParameterID ) AAX_OVERRIDE; + AAX_Result ReleaseParameter ( AAX_CParamID iParameterID ) AAX_OVERRIDE; + AAX_Result UpdateParameterTouch ( AAX_CParamID iParameterID, AAX_CBoolean iTouchState ) AAX_OVERRIDE; + //@}end Automated parameter helpers + + /** @name Asynchronous parameter update methods + * + * These methods are called by the %AAX host when parameter values have been updated. They are + * called by the host and can be triggered by other plug-in modules via calls to + * \ref AAX_IParameter's \c SetValue methods, e.g. + * \ref AAX_IParameter::SetValueWithFloat() "SetValueWithFloat()" + * + * These methods are responsible for updating parameter values. + * + * Do not call these methods directly! To ensure proper + * synchronization and to avoid problematic dependency chains, other methods (e.g. + * \ref SetParameterNormalizedValue()) and components (e.g. \ref AAX_IEffectGUI) should always + * call a \c SetValue method on \ref AAX_IParameter to update parameter values. The \c SetValue + * method will properly manage automation locks and other system resources. + * + */ + //@{ + AAX_Result UpdateParameterNormalizedValue (AAX_CParamID iParameterID, double iValue, AAX_EUpdateSource iSource ) AAX_OVERRIDE; + AAX_Result UpdateParameterNormalizedRelative (AAX_CParamID iParameterID, double iValue ) AAX_OVERRIDE; + AAX_Result GenerateCoefficients(void) AAX_OVERRIDE; + //@}end Asynchronous parameter update methods + + /** @name State reset handlers + */ + //@{ + AAX_Result ResetFieldData (AAX_CFieldIndex inFieldIndex, void * oData, uint32_t inDataSize) const AAX_OVERRIDE; + //@}end State reset handlers + + /** @name Chunk methods + * + * These methods are used to save and restore collections of plug-in state information, known + * as chunks. Chunks are used by the host when saving or restoring presets and session + * settings and when providing "compare" functionality for plug-ins. + * + * The default implementation of these methods in \ref AAX_CEffectParameters supports a single + * chunk that includes state information for all of the plug-in's registered parameters. + * Override all of these methods to add support for additional chunks in your plug-in, for + * example if your plug-ni contains any persistent state that is not encapsulated by its set + * of registered parameters. + * + * For reference, see also: + * \li AAX_CChunkDataParser + * \li AAX_SPlugInChunk + * + */ + //@{ + AAX_Result GetNumberOfChunks (int32_t * oNumChunks ) const AAX_OVERRIDE; + AAX_Result GetChunkIDFromIndex (int32_t iIndex, AAX_CTypeID * oChunkID ) const AAX_OVERRIDE; + AAX_Result GetChunkSize (AAX_CTypeID iChunkID, uint32_t * oSize ) const AAX_OVERRIDE; + AAX_Result GetChunk (AAX_CTypeID iChunkID, AAX_SPlugInChunk * oChunk ) const AAX_OVERRIDE; + AAX_Result SetChunk (AAX_CTypeID iChunkID, const AAX_SPlugInChunk * iChunk ) AAX_OVERRIDE; + AAX_Result CompareActiveChunk (const AAX_SPlugInChunk * iChunkP, AAX_CBoolean * oIsEqual ) const AAX_OVERRIDE; + AAX_Result GetNumberOfChanges (int32_t * oNumChanges ) const AAX_OVERRIDE; + //@}end Chunk methods + + /** @name Threads + * Threading functions + */ + //@{ + AAX_Result TimerWakeup() AAX_OVERRIDE; + //@}end Threads + + /** @name Auxiliary UI methods + * Methods defining the presentation of the plug-in on auxiliary UIs such as control surfaces + */ + //@{ + AAX_Result GetCurveData( /* AAX_ECurveType */ AAX_CTypeID iCurveType, const float * iValues, uint32_t iNumValues, float * oValues ) const AAX_OVERRIDE; + AAX_Result GetCurveDataMeterIds( /* AAX_ECurveType */ AAX_CTypeID iCurveType, uint32_t *oXMeterId, uint32_t *oYMeterId) const AAX_OVERRIDE; + AAX_Result GetCurveDataDisplayRange( /* AAX_ECurveType */ AAX_CTypeID iCurveType, float *oXMin, float *oXMax, float *oYMin, float *oYMax ) const AAX_OVERRIDE; + + /** @copydoc AAX_IEffectParameters::UpdatePageTable() + + \note For convenience, do not override this method. Instead, override the + \ref AAX_CEffectParameters::UpdatePageTable(uint32_t, int32_t, AAX_IPageTable&) const "protected overload" + which provides a prepared copy of the relevant \ref AAX_IPageTable host interface. + */ + AAX_Result UpdatePageTable(uint32_t inTableType, int32_t inTablePageSize, IACFUnknown* iHostUnknown, IACFUnknown* ioPageTableUnknown) const AAX_OVERRIDE AAX_FINAL; + //@}end Auxiliary UI methods + + /** @name Custom Data Methods + * + * These functions exist as a proxiable way to move data between different modules (e.g. AAX_IEffectParameters and AAX_IEffectGUI.) + * Using these, the GUI can query any data through GetCustomData() with a plug-in defined \c typeID, \c void* and size. This has an advantage + * over just sharing memory in that this function can work as a remote proxy as we enable those sorts of features later in the platform. + * Likewise, the GUI can also set arbitrary data on the data model by using the SetCustomData() function with the same idea. + * + * \note These are plug-in internal only. They are not called from the host right now, or likely ever. + */ + //@{ + AAX_Result GetCustomData( AAX_CTypeID iDataBlockID, uint32_t inDataSize, void* oData, uint32_t* oDataWritten) const AAX_OVERRIDE; + AAX_Result SetCustomData( AAX_CTypeID iDataBlockID, uint32_t inDataSize, const void* iData ) AAX_OVERRIDE; + //@}end Custom Data Methods + + /** @name MIDI methods + * + */ + //@{ + AAX_Result DoMIDITransfers() AAX_OVERRIDE { return AAX_SUCCESS; } + AAX_Result UpdateMIDINodes ( AAX_CFieldIndex inFieldIndex, AAX_CMidiPacket& iPacket ) AAX_OVERRIDE; + AAX_Result UpdateControlMIDINodes ( AAX_CTypeID nodeID, AAX_CMidiPacket& iPacket ) AAX_OVERRIDE; + //@}end MIDI methods + + /** @name Hybrid audio methods + * + */ + //@{ + AAX_Result RenderAudio_Hybrid(AAX_SHybridRenderInfo* ioRenderInfo) AAX_OVERRIDE; + //@}end Hybrid audio methods + + + +public: ///////////////////////////////////////////////////////////////////////////// AAX_CEffectParameters + /** @name Private data accessors + * + */ + //@{ + AAX_IController* Controller(); //!< Access to the Effect controller + const AAX_IController* Controller() const; //!< \c const access to the Effect controller + AAX_ITransport* Transport(); //!< Access to the Transport object + const AAX_ITransport* Transport() const; //!< \c const access to the Transport object + AAX_IAutomationDelegate* AutomationDelegate(); //!< Access to the Effect's automation delegate + const AAX_IAutomationDelegate* AutomationDelegate() const; //!< \c const access to the Effect's automation delegate + //@}end Private data accessors + +protected: + /** @name Parameter management methods + * + */ + //@{ + AAX_Result SetTaperDelegate ( AAX_CParamID iParameterID, AAX_ITaperDelegateBase & iTaperDelegate, bool iPreserveValue ); + AAX_Result SetDisplayDelegate ( AAX_CParamID iParameterID, AAX_IDisplayDelegateBase & iDisplayDelegate ); + bool IsParameterTouched ( AAX_CParamID iParameterID ) const; + bool IsParameterLinkReady ( AAX_CParamID inParameterID, AAX_EUpdateSource inSource ) const; + //@}end Parameter management methods + + /** @name Convenience functions + * + * These convenience functions provide quick access to various aspects of the + * default AAX_CEffectParameters implementation. + */ + //@{ + /*! \brief Initialization helper routine. Called from AAX_CEffectParameters::Initialize. + * + * Override to add parameters, packets, meters, and to do any other custom initialization. + * + * Add custom parameters: + * \li Create an AAX_CParameter for each parameter in the plug-in + * \li Call AAX_CParameterManager::AddParameter() using mParameterManager to add parameters + * to the Parameter Manager + * + * \note See bug \ref AAXSDK-897 + * + * Register packets: + * \li Call AAX_CPacketDispatcher::RegisterPacket() using mPacketDispatcher to register a + * packet and handling callback. + */ + virtual AAX_Result EffectInit(void) { return AAX_SUCCESS; }; + + /*! Protected overload of \ref AAX_CEffectParameters::UpdatePageTable(uint32_t, int32_t, IACFUnknown*, IACFUnknown*) const "UpdatePageTable()" + + Override this version of the method for convenience. This allows the default + \ref AAX_CEffectParameters::UpdatePageTable(uint32_t, int32_t, IACFUnknown*, IACFUnknown*) const "UpdatePageTable()" + implementation to handle the interface conversion from \ref IACFUnknown to \ref AAX_IPageTable. + + \return This method should return \ref AAX_ERROR_UNIMPLEMENTED if the plug-in does + not implement it or when no change is made by the plug-in. This allows + optimizations to be used in the host when no UI update is required following this + call. + + */ + virtual AAX_Result UpdatePageTable(uint32_t /*inTableType*/, int32_t /*inTablePageSize*/, AAX_IPageTable& /*ioPageTable*/) const { return AAX_ERROR_UNIMPLEMENTED; } + + /*! \brief CALL: Indicates the indices of parameters that should not be saved in the default + * AAX_CEffectParameters chunk + * + * Allows specific parameters to filtered out of the default AAX_CEffectParameters "Save + * Settings" functionality. This call is automatically invoked on the Master Bypass + * control when specified by the DefineMasterBypassControlIndex() call. + * + * \param[in] controlID + * The ID of the parameter that should be removed from the default chunk + */ + void FilterParameterIDOnSave(AAX_CParamID controlID); + //@} Convenience functions + + /*! \brief Clears out the current chunk in Chunk Parser and adds all of the new values. Used by default implementations of GetChunk() and GetChunkSize(). + * + */ + void BuildChunkData (void) const; + +protected: + int32_t mNumPlugInChanges; + mutable int32_t mChunkSize; //this old behavior isn't const friendly yet. Consider this a temp variable. + mutable AAX_CChunkDataParser mChunkParser; //this old behavior isn't const friendly yet. Consider this a temp variable. + int32_t mNumChunkedParameters; + AAX_CPacketDispatcher mPacketDispatcher; + AAX_CParameterManager mParameterManager; + std::set mFilteredParameters; + +private: + // interfaces provided by the host via the IACFUnknown passed to Initialize() + AAX_IController* mController; ///< \sa AAX_CEffectParameters::Controller() + AAX_ITransport* mTransport; ///< \sa AAX_CEffectParameters::Transport() + AAX_IAutomationDelegate* mAutomationDelegate; ///< \sa AAX_CEffectParameters::AutomationDelegate() + +}; + +// Convenience functions since many legacy plug-ins had internal int32 value representations. +extern int32_t NormalizedToInt32 (double normalizedValue ); +extern double Int32ToNormalized (int32_t value ); +extern double BoolToNormalized (bool value ); + +#endif diff --git a/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_CHostProcessor.h b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_CHostProcessor.h new file mode 100644 index 0000000000..0400d11e55 --- /dev/null +++ b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_CHostProcessor.h @@ -0,0 +1,373 @@ +/*================================================================================================*/ +/* + * + * Copyright 2013-2017, 2019, 2023-2024 Avid Technology, Inc. + * All rights reserved. + * + * This file is part of the Avid AAX SDK. + * + * The AAX SDK is subject to commercial or open-source licensing. + * + * By using the AAX SDK, you agree to the terms of both the Avid AAX SDK License + * Agreement and Avid Privacy Policy. + * + * AAX SDK License: https://developer.avid.com/aax + * Privacy Policy: https://www.avid.com/legal/privacy-policy-statement + * + * Or: You may also use this code under the terms of the GPL v3 (see + * www.gnu.org/licenses). + * + * THE AAX SDK IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER + * EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE + * DISCLAIMED. + * + */ + +/** + * \file AAX_CHostProcessor.h + * + * \brief Concrete implementation of the AAX_IHostProcessor interface for non-real-time processing + * + */ +/*================================================================================================*/ + + +#ifndef AAX_CHOSTPROCESSOR_H +#define AAX_CHOSTPROCESSOR_H + +#include "AAX_IEffectParameters.h" +#include "AAX_IHostProcessor.h" +#include "ACFPtr.h" + + +class AAX_IHostProcessorDelegate; +class AAX_IController; +class AAX_IEffectParameters; +class IACFUnknown; + +/** + * \brief Concrete implementation of the AAX_IHostProcessor interface for + * non-real-time processing + * + * \details + * Host processor objects are used to process regions of audio data in a + * non-real-time context. + * - Host processors must generate output samples + * linearly and incrementally, but may randomly access samples from the + * processing region on the timeline for input. See + * \ref AAX_IHostProcessorDelegate::GetAudio() "GetAudio()" for more + * information. + * - Host processors may re-define the processing region using + * \ref AAX_CHostProcessor::TranslateOutputBounds(). + * + * \sa AAX_IHostProcessorDelegate + * + * \ingroup AuxInterface_HostProcessor + */ +class AAX_CHostProcessor : public AAX_IHostProcessor +{ +public: + /* default constructor */ AAX_CHostProcessor (void); + virtual /* destructor */ ~AAX_CHostProcessor (); + + /** @name Initialization and uninitialization + */ + //@{ + /** \brief Host Processor initialization + * + * \param[in] iController + * A versioned reference that can be resolved to both an + * AAX_IController interface and an AAX_IHostProcessorDelegate + */ + AAX_Result Initialize(IACFUnknown* iController) AAX_OVERRIDE; + /** \brief Host Processor teardown + */ + AAX_Result Uninitialize() AAX_OVERRIDE; + //@}end Initialization and uninitialization + + /** @name Host processor interface + */ + //@{ + /** \brief Sets the processing region + * + * This method allows offline processing plug-ins to vary the length + * and/or start/end points of the audio processing region. + * + * This method is called in a few different scenarios: + * - Before an analyze, process or preview of data begins. + * - At the end of every preview loop. + * - After the user makes a new data selection on the timeline. + * + * Plug-ins that inherit from \ref AAX_CHostProcessor should not override + * this method. Instead, use the following convenience functions: + * - To retrieve the length or boundaries of the processing region, + * use \ref AAX_CHostProcessor::GetInputRange() "GetInputRange()", + * \ref AAX_CHostProcessor::GetSrcStart() "GetSrcStart()", etc. + * - To change the boundaries of the processing region before processing + * begins, use \ref AAX_CHostProcessor::TranslateOutputBounds() + * + * \note Currently, a host processor may not randomly access samples + * outside of the boundary defined by \c oDstStart and \c oDstEnd + * + * \legacy DAE no longer makes use of the mStartBound and mEndBounds + * member variables that existed in the legacy RTAS/TDM SDK. Use + * \c oDstStart and \c oDstEnd instead (preferably by overriding + * \ref AAX_CHostProcessor::TranslateOutputBounds() "TranslateOutputBounds()".) + * + * \param[in] iSrcStart + * The selection start of the user selected region. This is will always + * return 0 for a given selection on the timeline. + * \param[in] iSrcEnd + * The selection end of the user selected region. This will always + * return the value of the selection length on the timeline. + * \param[in] oDstStart + * The starting sample location in the output audio region. By default, + * this is the same as \c iSrcStart. + * \param[in] oDstEnd + * The ending sample location in the output audio region. By default, + * this is the same as \c iSrcEnd. + */ + AAX_Result InitOutputBounds ( int64_t iSrcStart, int64_t iSrcEnd, int64_t * oDstStart, int64_t * oDstEnd ) AAX_OVERRIDE; + + /** \brief Updates the relative sample location of the current processing frame + * + * This method is called by the host to update the relative sample location of + * the current processing frame. + * + * \note Plug-ins should not override this method; instead, use + * \ref AAX_CHostProcessor::GetLocation() to retrieve the current relative + * sample location. + * + * \param[in] iSample + * The sample location of the first sample in the current processing frame + * relative to the beginning of the full processing buffer + */ + AAX_Result SetLocation ( int64_t iSample ) AAX_OVERRIDE; + + /** \brief Perform the signal processing + * + * This method is called by the host to invoke the plug-in's signal + * processing. + * + * \legacy This method is a replacement for the AudioSuite + * \c ProcessAudio method + * + * \param[in] inAudioIns + * Input audio buffer + * \param[in] inAudioInCount + * The number if input channels + * \param[in] iAudioOuts + * The number of output channels + * \param[in] iAudioOutCount + * A user defined destination end of the ingested audio + * \param[in] ioWindowSize + * Window buffer length of the received audio + */ + AAX_Result RenderAudio ( const float * const inAudioIns [], int32_t inAudioInCount, float * const iAudioOuts [], int32_t iAudioOutCount, int32_t * ioWindowSize ) AAX_OVERRIDE; + + /** \brief Invoked right before the start of a Preview or Render pass + * + * This method is called by the host to allow a plug-in to make any initializations before + * processing actually begins. Upon a Preview pass, PreRender will also be called at the + * beginning of every "loop". + * + * \see AAX_eProcessingState_StartPass, \ref AAX_eProcessingState_BeginPassGroup + * + * \param[in] inAudioInCount + * The number if input channels + * \param[in] iAudioOutCount + * The number of output channels + * \param[in] iWindowSize + * Window buffer length of the ingested audio + */ + AAX_Result PreRender ( int32_t inAudioInCount, int32_t iAudioOutCount, int32_t iWindowSize ) AAX_OVERRIDE; + + /** \brief Invoked at the end of a Render pass + * + * \note Upon a Preview pass, PostRender will not be called until Preview has stopped. + * + * \see AAX_eProcessingState_StopPass, \ref AAX_eProcessingState_EndPassGroup + * + */ + AAX_Result PostRender () AAX_OVERRIDE; + + /** \brief Override this method if the plug-in needs to analyze the audio prior to a Render pass + * + * Use this after declaring the appropriate properties in Describe. See + * \ref AAX_eProperty_RequiresAnalysis and \ref AAX_eProperty_OptionalAnalysis + * + * To request an analysis pass from within a plug-in, use + * \ref AAX_IHostProcessorDelegate::ForceAnalyze() + * + * \legacy Ported from AudioSuite's \c AnalyzeAudio(bool \c isMasterBypassed) method + * + * \param[in] inAudioIns + * Input audio buffer + * \param[in] inAudioInCount + * The number of input channels + * \param[in] ioWindowSize + * Window buffer length of the ingested audio + */ + AAX_Result AnalyzeAudio ( const float * const inAudioIns [], int32_t inAudioInCount, int32_t * ioWindowSize ) AAX_OVERRIDE; + + /** \brief Invoked right before the start of an Analysis pass + * + * This method is called by the host to allow a plug-in to make any initializations before + * an Analysis pass actually begins. + * + * \see AAX_eProcessingState_StartPass, \ref AAX_eProcessingState_BeginPassGroup + * + * \param[in] inAudioInCount + * The number if input channels + * \param[in] iWindowSize + * Window buffer length of the ingested audio + */ + AAX_Result PreAnalyze ( int32_t inAudioInCount, int32_t iWindowSize ) AAX_OVERRIDE; + + /** \brief Invoked at the end of an Analysis pass + * + * \note In Pro Tools, a long execution time for this method will hold off the main + * application thread and cause a visible hang. If the plug-in must perform any long + * running tasks before initiating processing then it is best to perform these tasks + * in \ref AAX_IHostProcessor::PreRender() + * + * \see \ref AAX_eProcessingState_StopPass, \ref AAX_eProcessingState_EndPassGroup + */ + AAX_Result PostAnalyze () AAX_OVERRIDE; + /*! + * \brief Called by host application to retrieve a custom string to be appended to the clip name. + * + * If no string is provided then the host's default will be used. + * + * \param[in] inMaxLength + * The maximum allowed string length, not including the NULL terminating char + * + * \param[out] outString + * Add a value to this string to provide a custom clip suffix + * + */ + AAX_Result GetClipNameSuffix ( int32_t inMaxLength, AAX_IString* outString ) const AAX_OVERRIDE; + //@}end Host processor interface + + + /** @name Convenience methods + */ + //@{ + AAX_IEffectParameters * GetEffectParameters () { return mEffectParameters; } + const AAX_IEffectParameters * GetEffectParameters () const { return mEffectParameters; } + AAX_IHostProcessorDelegate* GetHostProcessorDelegate () { return mHostProcessingDelegate; } + const AAX_IHostProcessorDelegate* GetHostProcessorDelegate () const { return mHostProcessingDelegate; } + + /** \brief The relative sample location of the current processing frame + * + * This method returns the relative sample location for the current \ref RenderAudio() + * processing frame. For example, if a value of 10 is provided for the + * \ref RenderAudio() \c ioWindow parameter, then calls to this method from within + * each execution of \ref RenderAudio() will return 0, 10, 20,... + * + */ + int64_t GetLocation() const { return mLocation; } + + /** \brief The length (in samples) of the current timeline selection + */ + int64_t GetInputRange() const { return (mSrcEnd - mSrcStart); } + /** \brief The length (in samples) of the clip that will be rendered to the timeline + */ + int64_t GetOutputRange() const { return (mDstEnd - mDstStart); } + /** \brief The sample position of the beginning of the current timeline selection relative + * to the beginning of the current input selection, i.e. 0 + */ + int64_t GetSrcStart() const { return mSrcStart; } + /** \brief The sample position of the end of the current timeline selection relative to the + * beginning of the current input selection + */ + int64_t GetSrcEnd() const { return mSrcEnd; } + /** \brief The sample position of the beginning of the of the clip that will be rendered to + * the timeline relative to the beginning of the current input selection + * + * This value will be equal to the value returned by \ref GetSrcStart() unless the selection + * boundaries have been modified by overriding \ref TranslateOutputBounds() + */ + int64_t GetDstStart() const { return mDstStart; } + /** \brief The sample position of the end of the of the clip that will be rendered to the + * timeline relative to the beginning of the current input selection + * + * This value will be equal to the value returned by \ref GetSrcStart() unless the selection + * boundaries have been modified by overriding \ref TranslateOutputBounds() + */ + int64_t GetDstEnd() const { return mDstEnd; } + //@}end Convenience methods + +protected: + /** @name Convenience methods + */ + //@{ + /** \brief Define the boundaries of the clip that will be rendered to the timeline + * + * This method is called from \ref AAX_CHostProcessor::InitOutputBounds(), providing + * a convenient hook for re-defining the processing region boundaries. See + * \ref AAX_CHostProcessor::InitOutputBounds() "InitOutputBounds()" for more information. + * + * \param[in] iSrcStart + * The selection start of the user selected region. This is will always + * return 0 for a given selection on the timeline. + * \param[in] iSrcEnd + * The selection end of the user selected region. This will always + * return the value of the selection length on the timeline. + * \param[in] oDstStart + * The starting sample location in the output audio region. By default, + * this is the same as \c iSrcStart. + * \param[in] oDstEnd + * The ending sample location in the output audio region. By default, + * this is the same as \c iSrcEnd. + */ + virtual AAX_Result TranslateOutputBounds ( int64_t iSrcStart, int64_t iSrcEnd, int64_t& oDstStart, int64_t& oDstEnd ); + + /** \brief Randomly access audio from the timeline + * + * This is a convenience wrapper around \ref AAX_IHostProcessorDelegate::GetAudio(). + * + * \param[in] inAudioIns + * Timeline audio buffer(s). This must be set to \c inAudioIns from \ref AAX_IHostProcessor::RenderAudio() + * \internal See PTSW-183848: AAX_IHostProcessor::GetAudio() ignores input audio buffer parameter \endinternal + * \param[in] inAudioInCount + * Number of buffers in \c inAudioIns. This must be set to \c inAudioInCount from \ref AAX_IHostProcessor::RenderAudio() + * \internal See PTSW-183848: AAX_IHostProcessor::GetAudio() ignores input audio buffer parameter \endinternal + * \param[in] inLocation + * A sample location relative to the beginning of the currently processed region, e.g. a value of 0 corresponds to the + * timeline location returned by \ref AAX_CHostProcessor::GetSrcStart() + * \param[in,out] ioNumSamples + * \li Input: The maximum number of samples to read. + * \li Output: The actual number of samples that were read from the timeline + */ + virtual AAX_Result GetAudio ( const float * const inAudioIns [], int32_t inAudioInCount, int64_t inLocation, int32_t * ioNumSamples ); + + /*! \brief CALL: Returns the index of the side chain input buffer + * + * This is a convenience wrapper around \ref AAX_IHostProcessorDelegate::GetSideChainInputNum() + */ + virtual int32_t GetSideChainInputNum (); + + // Exterior Object Access + AAX_IController* Controller() { return mController; } + const AAX_IController* Controller() const { return mController; } + AAX_IHostProcessorDelegate* HostProcessorDelegate() { return mHostProcessingDelegate; } + const AAX_IHostProcessorDelegate* HostProcessorDelegate() const { return mHostProcessingDelegate; } + AAX_IEffectParameters* EffectParameters() { return mEffectParameters; } + const AAX_IEffectParameters* EffectParameters() const { return mEffectParameters; } + //@}end Convenience methods + +private: + AAX_IController* mController; + AAX_IHostProcessorDelegate* mHostProcessingDelegate; + AAX_IEffectParameters* mEffectParameters; + int64_t mSrcStart; + int64_t mSrcEnd; + int64_t mDstStart; + int64_t mDstEnd; + int64_t mLocation; + +}; + + +#endif diff --git a/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_CHostServices.h b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_CHostServices.h new file mode 100644 index 0000000000..454e0a39fa --- /dev/null +++ b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_CHostServices.h @@ -0,0 +1,57 @@ +/*================================================================================================*/ +/* + * + * Copyright 2014-2015, 2018, 2023-2024 Avid Technology, Inc. + * All rights reserved. + * + * This file is part of the Avid AAX SDK. + * + * The AAX SDK is subject to commercial or open-source licensing. + * + * By using the AAX SDK, you agree to the terms of both the Avid AAX SDK License + * Agreement and Avid Privacy Policy. + * + * AAX SDK License: https://developer.avid.com/aax + * Privacy Policy: https://www.avid.com/legal/privacy-policy-statement + * + * Or: You may also use this code under the terms of the GPL v3 (see + * www.gnu.org/licenses). + * + * THE AAX SDK IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER + * EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE + * DISCLAIMED. + * + */ + +/** + * \file AAX_CHostServices.h + * + * \brief Concrete implementation of the AAX_IHostServices interface. + * + */ +/*================================================================================================*/ + + +#ifndef AAX_CHOSTSERVICES_H +#define AAX_CHOSTSERVICES_H + +#include "AAX.h" +#include "AAX_Enums.h" + + +class IACFUnknown; + +/** @brief Method access to a singleton implementation of the \ref AAX_IHostServices interface + */ +class AAX_CHostServices +{ +public: + static void Set ( IACFUnknown * pUnkHost ); + + static AAX_Result HandleAssertFailure ( const char * iFile, int32_t iLine, const char * iNote, /* AAX_EAssertFlags */ int32_t iFlags = AAX_eAssertFlags_Default ); ///< \copydoc AAX_IHostServices::HandleAssertFailure() + static AAX_Result Trace ( AAX_ETracePriorityHost iPriority, const char * iMessage, ... ); ///< \copydoc AAX_IHostServices::Trace() + static AAX_Result StackTrace ( AAX_ETracePriorityHost iTracePriority, AAX_ETracePriorityHost iStackTracePriority, const char * iMessage, ... ); ///< \copydoc AAX_IHostServices::StackTrace() +}; + + +#endif diff --git a/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_CLinearTaperDelegate.h b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_CLinearTaperDelegate.h new file mode 100644 index 0000000000..f15c6266e1 --- /dev/null +++ b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_CLinearTaperDelegate.h @@ -0,0 +1,163 @@ +/*================================================================================================*/ +/* + * + * Copyright 2013-2017, 2019, 2023-2024 Avid Technology, Inc. + * All rights reserved. + * + * This file is part of the Avid AAX SDK. + * + * The AAX SDK is subject to commercial or open-source licensing. + * + * By using the AAX SDK, you agree to the terms of both the Avid AAX SDK License + * Agreement and Avid Privacy Policy. + * + * AAX SDK License: https://developer.avid.com/aax + * Privacy Policy: https://www.avid.com/legal/privacy-policy-statement + * + * Or: You may also use this code under the terms of the GPL v3 (see + * www.gnu.org/licenses). + * + * THE AAX SDK IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER + * EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE + * DISCLAIMED. + * + */ + +/** + * \file AAX_CLinearTaperDelegate.h + * + * \brief A linear taper delegate. + * + */ +/*================================================================================================*/ + + +#ifndef AAX_CLINEARTAPERDELEGATE_H +#define AAX_CLINEARTAPERDELEGATE_H + +#include "AAX_ITaperDelegate.h" +#include "AAX.h" //for types + +#include //for floor() + + +/** \brief A linear taper conforming to AAX_ITaperDelegate + + \details + This taper spaces a parameter's real values evenly between its minimum and maximum, with a + linear mapping between the parameter's real and normalized values. + + \par RealPrecision + In addition to its type templatization, this taper includes a precision template parameter. + RealPrecision is a multiplier that works in conjunction with the round() + function to limit the precision of the real values provided by this taper. For example, if + RealPrecision is 1000, it will round to the closest 0.001 when doing any + sort of value conversion. If RealPrecision is 1, it will round to the nearest integer. + If RealPrecision is 1000000, it will round to the nearest 0.000001. This + is particularly useful for preventing things like 1.9999999 truncating down to 1 instead of + rounding up to 2. + + To accomplish this behavior, the taper multiplies its unrounded parameter values by + RealPrecision, rounds the result to the nearest valid value, then divides RealPrecision + back out. + + Rounding will be disabled if RealPrecision is set to a value less than 1. This is the default. + + \ingroup TaperDelegates + + */ +template +class AAX_CLinearTaperDelegate : public AAX_ITaperDelegate +{ +public: + /** \brief Constructs a Linear Taper with specified minimum and maximum values. + * + * \note The parameter's default value should lie within the min to max range. + * + * \param[in] minValue + * \param[in] maxValue + */ + AAX_CLinearTaperDelegate(T minValue=0, T maxValue=1); + + //Virtual AAX_ITaperDelegate Overrides + AAX_CLinearTaperDelegate* Clone() const AAX_OVERRIDE; + T GetMinimumValue() const AAX_OVERRIDE { return mMinValue; } + T GetMaximumValue() const AAX_OVERRIDE { return mMaxValue; } + T ConstrainRealValue(T value) const AAX_OVERRIDE; + T NormalizedToReal(double normalizedValue) const AAX_OVERRIDE; + double RealToNormalized(T realValue) const AAX_OVERRIDE; + +protected: + T Round(double iValue) const; + +private: + T mMinValue; + T mMaxValue; +}; + +template +T AAX_CLinearTaperDelegate::Round(double iValue) const +{ + double precision = RealPrecision; + if (precision > 0) + return static_cast(floor(iValue * precision + 0.5) / precision); + return static_cast(iValue); +} + +template +AAX_CLinearTaperDelegate::AAX_CLinearTaperDelegate(T minValue, T maxValue) : AAX_ITaperDelegate(), + mMinValue(minValue), + mMaxValue(maxValue) +{ + +} + +template +AAX_CLinearTaperDelegate* AAX_CLinearTaperDelegate::Clone() const +{ + return new AAX_CLinearTaperDelegate(*this); +} + +template +T AAX_CLinearTaperDelegate::ConstrainRealValue(T value) const +{ + if (mMinValue == mMaxValue) + return mMinValue; + + if (RealPrecision) + value = Round(value); //reduce the precision to get proper rounding behavior with integers. + + const T& highValue = mMaxValue > mMinValue ? mMaxValue : mMinValue; + const T& lowValue = mMaxValue > mMinValue ? mMinValue : mMaxValue; + + if (value > highValue) + return highValue; + if (value < lowValue) + return lowValue; + + return value; +} + +template +T AAX_CLinearTaperDelegate::NormalizedToReal(double normalizedValue) const +{ + double doubleRealValue = normalizedValue * (double(mMaxValue) - double(mMinValue)) + double(mMinValue); + + // If RealPrecision is set, reduce the precision to get proper rounding behavior with integers. + T realValue = (0 != RealPrecision) ? Round(doubleRealValue) : static_cast(doubleRealValue); + + return ConstrainRealValue(realValue); +} + +template +double AAX_CLinearTaperDelegate::RealToNormalized(T realValue) const +{ + realValue = ConstrainRealValue(realValue); + double normalizedValue = (mMaxValue == mMinValue) ? 0.5 : (double(realValue) - double(mMinValue)) / (double(mMaxValue) - double(mMinValue)); + return normalizedValue; +} + + + + +#endif //AAX_CLINEARTAPERDELEGATE_H diff --git a/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_CLogTaperDelegate.h b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_CLogTaperDelegate.h new file mode 100644 index 0000000000..f4091a6a51 --- /dev/null +++ b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_CLogTaperDelegate.h @@ -0,0 +1,165 @@ +/*================================================================================================*/ +/* + * + * Copyright 2013-2017, 2019, 2023-2024 Avid Technology, Inc. + * All rights reserved. + * + * This file is part of the Avid AAX SDK. + * + * The AAX SDK is subject to commercial or open-source licensing. + * + * By using the AAX SDK, you agree to the terms of both the Avid AAX SDK License + * Agreement and Avid Privacy Policy. + * + * AAX SDK License: https://developer.avid.com/aax + * Privacy Policy: https://www.avid.com/legal/privacy-policy-statement + * + * Or: You may also use this code under the terms of the GPL v3 (see + * www.gnu.org/licenses). + * + * THE AAX SDK IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER + * EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE + * DISCLAIMED. + * + */ + +/** + * \file AAX_CLogTaperDelegate.h + * + * \brief A log taper delegate. + */ +/*================================================================================================*/ + + +#ifndef AAX_CLOGTAPERDELEGATE_H +#define AAX_CLOGTAPERDELEGATE_H + +#include "AAX_ITaperDelegate.h" +#include "AAX_UtilsNative.h" +#include "AAX.h" //for types + +#include //for floor(), log() + + + +/** \brief A logarithmic taper conforming to AAX_ITaperDelegate + + \details + This taper spaces a parameter's real values between its minimum and maximum bounds, with a + natural logarithmic mapping between the parameter's real and normalized values. + + \par RealPrecision + In addition to its type templatization, this taper includes a precision template parameter. + RealPrecision is a multiplier that works in conjunction with the round() + function to limit the precision of the real values provided by this taper. For example, if + RealPrecision is 1000, it will round to the closest 0.001 when doing any + sort of value conversion. If RealPrecision is 1, it will round to the nearest integer. + If RealPrecision is 1000000, it will round to the nearest 0.000001. This + is particularly useful for preventing things like 1.9999999 truncating down to 1 instead of + rounding up to 2. + + To accomplish this behavior, the taper multiplies its unrounded parameter values by + RealPrecision, rounds the result to the nearest valid value, then divides RealPrecision + back out. + + Rounding will be disabled if RealPrecision is set to a value less than 1 + + \ingroup TaperDelegates + + */ +template +class AAX_CLogTaperDelegate : public AAX_ITaperDelegate +{ +public: + /** \brief Constructs a Log Taper with specified minimum and maximum values. + * + * \note The parameter's default value should lie within the min to max range. + * + * \param[in] minValue + * \param[in] maxValue + */ + AAX_CLogTaperDelegate(T minValue=0, T maxValue=1); + + //Virtual Overrides + AAX_CLogTaperDelegate* Clone() const AAX_OVERRIDE; + T GetMinimumValue() const AAX_OVERRIDE { return mMinValue; } + T GetMaximumValue() const AAX_OVERRIDE { return mMaxValue; } + T ConstrainRealValue(T value) const AAX_OVERRIDE; + T NormalizedToReal(double normalizedValue) const AAX_OVERRIDE; + double RealToNormalized(T realValue) const AAX_OVERRIDE; + +protected: + T Round(double iValue) const; + +private: + T mMinValue; + T mMaxValue; +}; + +template +T AAX_CLogTaperDelegate::Round(double iValue) const +{ + double precision = RealPrecision; + if (precision > 0) + return static_cast(floor(iValue * precision + 0.5) / precision); + return static_cast(iValue); +} + +template +AAX_CLogTaperDelegate::AAX_CLogTaperDelegate(T minValue, T maxValue) : AAX_ITaperDelegate(), + mMinValue(minValue), + mMaxValue(maxValue) +{ + +} + +template +AAX_CLogTaperDelegate* AAX_CLogTaperDelegate::Clone() const +{ + return new AAX_CLogTaperDelegate(*this); +} + +template +T AAX_CLogTaperDelegate::ConstrainRealValue(T value) const +{ + if (mMinValue == mMaxValue) + return mMinValue; + + if (RealPrecision) + value = Round(value); //reduce the precision to get proper rounding behavior with integers. + + const T& highValue = mMaxValue > mMinValue ? mMaxValue : mMinValue; + const T& lowValue = mMaxValue > mMinValue ? mMinValue : mMaxValue; + + if (value > highValue) + return highValue; + if (value < lowValue) + return lowValue; + + return value; +} + +template +T AAX_CLogTaperDelegate::NormalizedToReal(double normalizedValue) const +{ + double minLog = AAX::SafeLog(double(mMinValue)); + double maxLog = AAX::SafeLog(double(mMaxValue)); + + double doubleRealValue = exp(normalizedValue * (maxLog - minLog) + minLog); + T realValue = (T) doubleRealValue; + + return ConstrainRealValue(realValue); +} + +template +double AAX_CLogTaperDelegate::RealToNormalized(T realValue) const +{ + double minLog = AAX::SafeLog(double(mMinValue)); + double maxLog = AAX::SafeLog(double(mMaxValue)); + + realValue = ConstrainRealValue(realValue); + double normalizedValue = (maxLog == minLog) ? 0.5 : (AAX::SafeLog(double(realValue)) - minLog) / (maxLog - minLog); + return normalizedValue; +} + +#endif // AAX_CLOGTAPERDELEGATE_H diff --git a/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_CMutex.h b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_CMutex.h new file mode 100644 index 0000000000..28faaf3d61 --- /dev/null +++ b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_CMutex.h @@ -0,0 +1,74 @@ +/*================================================================================================*/ +/* + * + * Copyright 2014-2015, 2023-2024 Avid Technology, Inc. + * All rights reserved. + * + * This file is part of the Avid AAX SDK. + * + * The AAX SDK is subject to commercial or open-source licensing. + * + * By using the AAX SDK, you agree to the terms of both the Avid AAX SDK License + * Agreement and Avid Privacy Policy. + * + * AAX SDK License: https://developer.avid.com/aax + * Privacy Policy: https://www.avid.com/legal/privacy-policy-statement + * + * Or: You may also use this code under the terms of the GPL v3 (see + * www.gnu.org/licenses). + * + * THE AAX SDK IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER + * EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE + * DISCLAIMED. + * + */ + +#ifndef AAX_CMUTEX_H +#define AAX_CMUTEX_H + +/** + * \file AAX_CMutex.h + * + * \brief Mutex + * + */ +/*================================================================================================*/ + +/** \brief Mutex with try lock functionality + */ +class AAX_CMutex +{ +public: + AAX_CMutex(); + ~AAX_CMutex(); + + bool Lock(); + void Unlock(); + bool Try_Lock(); + +private: + AAX_CMutex(const AAX_CMutex&); + AAX_CMutex& operator=(const AAX_CMutex&); + + typedef struct opaque_aax_mutex_t * aax_mutex_t; + aax_mutex_t mMutex; +}; + +/** \brief Helper class for working with mutex + */ +class AAX_StLock_Guard +{ +public: + explicit AAX_StLock_Guard(AAX_CMutex& iMutex) : mMutex(iMutex) { mNeedsUnlock = mMutex.Lock(); } + ~AAX_StLock_Guard() { if (mNeedsUnlock) mMutex.Unlock(); } + +private: + AAX_StLock_Guard(AAX_StLock_Guard const&); + AAX_StLock_Guard& operator=(AAX_StLock_Guard const&); + + AAX_CMutex & mMutex; + bool mNeedsUnlock; +}; + +#endif // AAX_CMUTEX_H + diff --git a/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_CNumberDisplayDelegate.h b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_CNumberDisplayDelegate.h new file mode 100644 index 0000000000..6d5cf3bf68 --- /dev/null +++ b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_CNumberDisplayDelegate.h @@ -0,0 +1,121 @@ +/*================================================================================================*/ +/* + * + * Copyright 2013-2017, 2019, 2023-2024 Avid Technology, Inc. + * All rights reserved. + * + * This file is part of the Avid AAX SDK. + * + * The AAX SDK is subject to commercial or open-source licensing. + * + * By using the AAX SDK, you agree to the terms of both the Avid AAX SDK License + * Agreement and Avid Privacy Policy. + * + * AAX SDK License: https://developer.avid.com/aax + * Privacy Policy: https://www.avid.com/legal/privacy-policy-statement + * + * Or: You may also use this code under the terms of the GPL v3 (see + * www.gnu.org/licenses). + * + * THE AAX SDK IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER + * EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE + * DISCLAIMED. + * + */ + +/** + * \file AAX_CNumberDisplayDelegate.h + * + * \brief A number display delegate. + * + */ +/*================================================================================================*/ + + +#ifndef AAX_CNUMBERDISPLAYDELEGATE_H +#define AAX_CNUMBERDISPLAYDELEGATE_H + +#include "AAX_IDisplayDelegate.h" +#include "AAX_CString.h" + + +/** \brief A numeric display format conforming to AAX_IDisplayDelegate + + \details + This display delegate converts a parameter value to a numeric string using a specified + precision. + + \ingroup DisplayDelegates + + */ +template +class AAX_CNumberDisplayDelegate : public AAX_IDisplayDelegate +{ +public: + //Virtual Overrides + AAX_CNumberDisplayDelegate* Clone() const AAX_OVERRIDE; + bool ValueToString(T value, AAX_CString* valueString) const AAX_OVERRIDE; + bool ValueToString(T value, int32_t maxNumChars, AAX_CString* valueString) const AAX_OVERRIDE; + bool StringToValue(const AAX_CString& valueString, T* value) const AAX_OVERRIDE; +}; + + + + +template +AAX_CNumberDisplayDelegate* AAX_CNumberDisplayDelegate::Clone() const +{ + return new AAX_CNumberDisplayDelegate(*this); +} + +template +bool AAX_CNumberDisplayDelegate::ValueToString(T value, AAX_CString* valueString) const +{ + valueString->Clear(); + valueString->AppendNumber(value, Precision); + if (SpaceAfter != 0) + valueString->Append(" "); //Added a space after the number for easier display of units. + return true; +} + +template +bool AAX_CNumberDisplayDelegate::ValueToString(T value, int32_t maxNumChars, AAX_CString* valueString) const +{ + valueString->Clear(); + valueString->AppendNumber(value, Precision); + uint32_t strlen = valueString->Length(); + const uint32_t maxNumCharsUnsigned = (0 <= maxNumChars) ? static_cast(maxNumChars) : 0; + if (strlen > maxNumCharsUnsigned) + { + valueString->Erase(maxNumCharsUnsigned, strlen-maxNumCharsUnsigned); + strlen = valueString->Length(); + } + + if ( 0 < maxNumCharsUnsigned && strlen == maxNumCharsUnsigned && (*valueString)[maxNumCharsUnsigned-1] == '.') // Edge case when the decimal point is the last character, we probably shouldn't show it. + { + valueString->Erase(maxNumCharsUnsigned-1, 1); + strlen = valueString->Length(); + } + + if ((SpaceAfter != 0) && (maxNumCharsUnsigned > strlen) && (maxNumCharsUnsigned-strlen > 2)) // Kind of a random threshold for dropping the space after, but seems reasonable for our control surfaces. (allows dB and Unit prefixes) + valueString->Append(" "); //Added a space after the number for easier display of units. + return true; +} + +template +bool AAX_CNumberDisplayDelegate::StringToValue(const AAX_CString& valueString, T* value) const +{ + double dValue; + if (valueString.ToDouble(&dValue)) + { + *value = static_cast (dValue); + return true; + } + *value = 0; + return false; +} + + + + +#endif //AAX_CNUMBERDISPLAYDELEGATE_H diff --git a/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_CPacketDispatcher.h b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_CPacketDispatcher.h new file mode 100644 index 0000000000..a15207ce2c --- /dev/null +++ b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_CPacketDispatcher.h @@ -0,0 +1,205 @@ +/*================================================================================================*/ +/* + * + * Copyright 2013-2017, 2023-2024 Avid Technology, Inc. + * All rights reserved. + * + * This file is part of the Avid AAX SDK. + * + * The AAX SDK is subject to commercial or open-source licensing. + * + * By using the AAX SDK, you agree to the terms of both the Avid AAX SDK License + * Agreement and Avid Privacy Policy. + * + * AAX SDK License: https://developer.avid.com/aax + * Privacy Policy: https://www.avid.com/legal/privacy-policy-statement + * + * Or: You may also use this code under the terms of the GPL v3 (see + * www.gnu.org/licenses). + * + * THE AAX SDK IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER + * EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE + * DISCLAIMED. + * + */ + +/** + * \file AAX_CPacketDispatcher.h + * + * \brief Helper classes related to posting %AAX packets and handling parameter update events + * + */ +/*================================================================================================*/ + + +#ifndef AAX_CPACKETDISPATCHER_H +#define AAX_CPACKETDISPATCHER_H + +#include "AAX.h" +#include "AAX_IController.h" +#include "AAX_CMutex.h" + +#include +#include + + +/** \brief Container for packet-related data + + \details + This class collects a number of packet-related data into the same + object and provides a facility for tracking when the parameter + is "dirty", i.e. after its value has been updated and before an + associated packet has not been posted. +*/ +class AAX_CPacket +{ +public: + AAX_CPacket(AAX_CFieldIndex inFieldIndex) : mID(inFieldIndex), mDirty(true), mDataSize(0) {} + ~AAX_CPacket() {} + + template + DataType* GetPtr() + { + mDataSize = sizeof(DataType); + void * data = mPacketData.Get(mDataSize); + return reinterpret_cast (data); + } + + void SetDirty(bool iDirty) { mDirty = iDirty; }; + bool IsDirty() const { return mDirty; }; + + AAX_CFieldIndex GetID() const { return mID; }; + uint32_t GetSize() const { return mDataSize; } + +private: + AAX_CFieldIndex mID; + bool mDirty; + uint32_t mDataSize; + +private: + struct SPacketData + { + public: + SPacketData(); + ~SPacketData(); + const void* Get() const; + void* Get(size_t newSize) const; + private: + mutable void* mData; + } mPacketData; +}; + +// GetPtr() specialization for void* +template <> +inline const void* +AAX_CPacket::GetPtr() +{ + return mPacketData.Get(); +} + + +/** \brief Callback container used by \ref AAX_CPacketDispatcher +*/ +struct AAX_IPacketHandler +{ + virtual ~AAX_IPacketHandler() {}; + virtual AAX_IPacketHandler* Clone() const = 0; + virtual AAX_Result Call( AAX_CParamID inParamID, AAX_CPacket& ioPacket ) const = 0; +}; + +/** \brief Callback container used by \ref AAX_CPacketDispatcher + */ +template +class AAX_CPacketHandler : public AAX_IPacketHandler +{ + typedef AAX_Result(TWorker::*fPt2Fn)(AAX_CPacket&); + typedef AAX_Result(TWorker::*fPt2FnEx)(AAX_CParamID, AAX_CPacket&); + +public: + AAX_CPacketHandler( TWorker* iPt2Object, fPt2Fn infPt ) + : pt2Object(iPt2Object), fpt(infPt), fptEx(NULL) {} + + AAX_CPacketHandler( TWorker* iPt2Object, fPt2FnEx infPt ) + : pt2Object(iPt2Object), fpt(NULL), fptEx(infPt) {} + + AAX_IPacketHandler* Clone() const + { + return new AAX_CPacketHandler(*this); + } + + AAX_Result Call( AAX_CParamID inParamID, AAX_CPacket& ioPacket ) const + { + if (fptEx) + return (*pt2Object.*fptEx)( inParamID, ioPacket); + else if (fpt) + return (*pt2Object.*fpt)( ioPacket); + else + return AAX_ERROR_NULL_OBJECT; + } + +protected: + TWorker * pt2Object; // pointer to object + fPt2Fn fpt ; // pointer to member function + fPt2FnEx fptEx ; // pointer to member function +}; + + +class AAX_IEffectParameters; + +/** \brief Helper class for managing %AAX packet posting + + \details + This optional class can be used to associate individual parameters with custom update callbacks. + The update callbacks for all "dirty" parameters are triggered whenever + \ref AAX_CPacketDispatcher::Dispatch() is called. The resulting coefficient data is then posted + to the AAX_IController automatically by the packet dispatcher. + + The packet dispatcher supports many-to-one relationships between parameters and handler + callbacks, so a single callback may be registered for several related parameters. + + \sa \ref AAX_CEffectParameters::EffectInit() + */ +class AAX_CPacketDispatcher +{ + typedef std::map PacketsHolder; + typedef std::multimap > PacketsHandlersMap; + +public: + AAX_CPacketDispatcher(); + ~AAX_CPacketDispatcher(); + + void Initialize( AAX_IController* iPlugIn, AAX_IEffectParameters* iEffectParameters); + + AAX_Result RegisterPacket( AAX_CParamID paramID, AAX_CFieldIndex portID, const AAX_IPacketHandler* iHandler); + + template + AAX_Result RegisterPacket( AAX_CParamID paramID, AAX_CFieldIndex portID, + TWorker* iPt2Object, Func infPt) + { + AAX_CPacketHandler handler(iPt2Object, infPt); + return RegisterPacket(paramID, portID, &handler); + } + + AAX_Result RegisterPacket( AAX_CParamID paramID, AAX_CFieldIndex portID) + { + AAX_CPacketHandler handler(this, &AAX_CPacketDispatcher::GenerateSingleValuePacket); + return RegisterPacket(paramID, portID, &handler); + } + + AAX_Result SetDirty(AAX_CParamID paramID, bool iDirty = true); + + AAX_Result Dispatch(); + + AAX_Result GenerateSingleValuePacket( AAX_CParamID iParam, AAX_CPacket& ioPacket); + +private: + PacketsHolder mPacketsHolder; + PacketsHandlersMap mPacketsHandlers; + AAX_IController* mController; + AAX_IEffectParameters* mEffectParameters; + + AAX_CMutex mLockGuard; +}; + + +#endif // AAX_CPACKETDISPATCHER_H diff --git a/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_CParameter.h b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_CParameter.h new file mode 100644 index 0000000000..73d4012e2b --- /dev/null +++ b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_CParameter.h @@ -0,0 +1,1309 @@ +/*================================================================================================*/ +/* + * + * Copyright 2013-2017, 2019, 2021, 2023-2024 Avid Technology, Inc. + * All rights reserved. + * + * This file is part of the Avid AAX SDK. + * + * The AAX SDK is subject to commercial or open-source licensing. + * + * By using the AAX SDK, you agree to the terms of both the Avid AAX SDK License + * Agreement and Avid Privacy Policy. + * + * AAX SDK License: https://developer.avid.com/aax + * Privacy Policy: https://www.avid.com/legal/privacy-policy-statement + * + * Or: You may also use this code under the terms of the GPL v3 (see + * www.gnu.org/licenses). + * + * THE AAX SDK IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER + * EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE + * DISCLAIMED. + * + */ + +/** + * \file AAX_CParameter.h + * + * \brief Generic implementation of an AAX_IParameter + * + */ +/*================================================================================================*/ + + +#ifndef AAX_CPARAMETER_H +#define AAX_CPARAMETER_H + +#include "AAX_Assert.h" +#include "AAX_IParameter.h" +#include "AAX_ITaperDelegate.h" +#include "AAX_IDisplayDelegate.h" +#include "AAX_IAutomationDelegate.h" +#include "AAX_CString.h" //concrete class required for name. + +#include +#include +#include + + +/////////////////////////////////////////////////////////////// +#if 0 +#pragma mark - +#endif +/////////////////////////////////////////////////////////////// + +////// AAX_CParameterValue Class Template Declaration /////// + +/** \brief Concrete implementation of \ref AAX_IParameterValue + + Used by \ref AAX_CParameter + + */ +template +class AAX_CParameterValue : public AAX_IParameterValue +{ +public: + enum Defaults { + eParameterDefaultMaxIdentifierSize = kAAX_ParameterIdentifierMaxSize, + eParameterDefaultMaxIdentifierLength = eParameterDefaultMaxIdentifierSize - 1 // NULL terminated + }; + +public: + AAX_DEFAULT_DTOR_OVERRIDE(AAX_CParameterValue); + + AAX_DEFAULT_MOVE_CTOR(AAX_CParameterValue); + AAX_DEFAULT_MOVE_OPER(AAX_CParameterValue); + + AAX_DELETE(AAX_CParameterValue& operator=(const AAX_CParameterValue&)); + + /** \brief Constructs an \ref AAX_CParameterValue object + * + * \param[in] identifier + * Unique ID for the parameter value, these can only be 31 characters long at most. (the fixed length is a requirement for some optimizations in the host) + * + * \note The initial state of the parameter value is undefined + */ + explicit AAX_CParameterValue(AAX_CParamID identifier); + + /** \brief Constructs an \ref AAX_CParameterValue object with a defined initial state + * + * \param[in] identifier + * Unique ID for the parameter value, these can only be 31 characters long at most. (the fixed length is a requirement for some optimizations in the host) + * \param[in] value + * Initial state of the parameter value + */ + explicit AAX_CParameterValue(AAX_CParamID identifier, const T& value); + + /** \brief Copy constructor for \ref AAX_CParameterValue + */ + explicit AAX_CParameterValue(const AAX_CParameterValue& other); + +public: // AAX_CParameterValue implementation + /** \brief Direct access to the template instance's value + */ + const T& Get() const { return mValue; } + /** \brief Direct access to the template instance's value + */ + void Set(const T& inValue) { mValue = inValue; } + +public: // AAX_IParameterValue implementation + + AAX_IParameterValue* Clone() const AAX_OVERRIDE { return new AAX_CParameterValue(*this); } + AAX_CParamID Identifier() const AAX_OVERRIDE { return mIdentifier; } + + /** @name Typed accessors + * + */ + //@{ + bool GetValueAsBool(bool* value) const AAX_OVERRIDE; ///< \copydoc AAX_IParameterValue::GetValueAsBool() + bool GetValueAsInt32(int32_t* value) const AAX_OVERRIDE; ///< \copydoc AAX_IParameterValue::GetValueAsInt32() + bool GetValueAsFloat(float* value) const AAX_OVERRIDE; ///< \copydoc AAX_IParameterValue::GetValueAsFloat() + bool GetValueAsDouble(double* value) const AAX_OVERRIDE; ///< \copydoc AAX_IParameterValue::GetValueAsDouble() + bool GetValueAsString(AAX_IString* value) const AAX_OVERRIDE; ///< \copydoc AAX_IParameterValue::GetValueAsString() + //@} Typed accessors + +private: + void InitIdentifier(const char* inIdentifier); + +private: + char mIdentifier[eParameterDefaultMaxIdentifierSize]; + T mValue; +}; + + +////// AAX_CParameterValue Template Definition /////// + +template +AAX_CParameterValue::AAX_CParameterValue(AAX_CParamID identifier) +: mValue() +{ + InitIdentifier(identifier); +} + +template +AAX_CParameterValue::AAX_CParameterValue(AAX_CParamID identifier, const T& value) +: mValue(value) +{ + InitIdentifier(identifier); +} + +template +AAX_CParameterValue::AAX_CParameterValue(const AAX_CParameterValue& other) +: mValue(other.mValue) +{ + InitIdentifier(other.mIdentifier); +} + +template +bool AAX_CParameterValue::GetValueAsBool(bool* /*value*/) const +{ + return false; +} +template <> +bool AAX_CParameterValue::GetValueAsBool(bool* value) const; + + +template +bool AAX_CParameterValue::GetValueAsInt32(int32_t* /*value*/) const +{ + return false; +} +template<> +bool AAX_CParameterValue::GetValueAsInt32(int32_t* value) const; + +template +bool AAX_CParameterValue::GetValueAsFloat(float* /*value*/) const +{ + return false; +} +template<> +bool AAX_CParameterValue::GetValueAsFloat(float* value) const; + +template +bool AAX_CParameterValue::GetValueAsDouble(double* /*value*/) const +{ + return false; +} +template<> +bool AAX_CParameterValue::GetValueAsDouble(double* value) const; + +template +bool AAX_CParameterValue::GetValueAsString(AAX_IString* /*value*/) const +{ + return false; +} +template<> +bool AAX_CParameterValue::GetValueAsString(AAX_IString* value) const; + +template +void AAX_CParameterValue::InitIdentifier(const char *inIdentifier) +{ + + const size_t len = strlen(inIdentifier); + AAX_ASSERT(len < eParameterDefaultMaxIdentifierSize); + if (len < eParameterDefaultMaxIdentifierSize) + { + std::strncpy(mIdentifier, inIdentifier, 1+len); + mIdentifier[len] = 0; + } + else + { + std::strncpy(mIdentifier, inIdentifier, eParameterDefaultMaxIdentifierLength); + mIdentifier[eParameterDefaultMaxIdentifierLength] = 0; + } +} + + +/////////////////////////////////////////////////////////////// +#if 0 +#pragma mark - +#endif +/////////////////////////////////////////////////////////////// + +////// AAX_CParameter Class Template Declaration /////// + +/** \brief Generic implementation of an \ref AAX_IParameter + + \details + This is a concrete, templatized implementation of \ref AAX_IParameter for parameters with standard + types such as \c float, \c uint32, \c bool, etc. + + Many different behaviors can be composited into this class as delegates. \ref AAX_ITaperDelegate + and \ref AAX_IDisplayDelegate are two examples of delegates that this class uses in order to apply + custom behaviors to the \ref AAX_IParameter interface. + + Plug-in developers can subclass these delegates to create adaptable, reusable parameter + behaviors, which can then be "mixed in" to individual \ref AAX_CParameter objects without the need + to modify the objects themselves. + + \note Because \ref AAX_CParameter is a C++ template, each \ref AAX_CParameter template parameter that is + used creates a new subclass that adheres to the \ref AAX_IParameter interface. + + \ingroup AAXLibraryFeatures_ParameterManager + + */ +template +class AAX_CParameter : public AAX_IParameter +{ +public: + + enum Type { + eParameterTypeUndefined = 0, + eParameterTypeBool = 1, + eParameterTypeInt32 = 2, + eParameterTypeFloat = 3, + eParameterTypeCustom = 4 + }; + + enum Defaults { + eParameterDefaultNumStepsDiscrete = 2, + eParameterDefaultNumStepsContinuous = 128 + }; + + /*! + * \brief Constructs an \ref AAX_CParameter object using the specified taper and display delegates. + * + * The delegates are passed in by reference to prevent ambiguities of object ownership. For + * more information about \p identifer and \p name, please consult the base \ref AAX_IParameter + * interface. + * + * \param[in] identifier + * Unique ID for the parameter, these can only be 31 characters long at most. (the fixed length is a requirement for some optimizations in the host) + * \param[in] name + * The parameter's unabbreviated display name + * \param[in] defaultValue + * The parameter's default value + * \param[in] taperDelegate + * A delegate representing the parameter's taper behavior + * \param[in] displayDelegate + * A delegate representing the parameter's display conversion behavior + * \param[in] automatable + * A flag to set whether the parameter will be visible to the host's automation system + * + * \note Upon construction, the state (value) of the parameter will be the default value, as + * established by the provided \p taperDelegate. + * + * \compatibility As of Pro Tools 10.2, DAE will check for a matching parameter NAME and not an ID when + * reading in automation data from a session saved with an %AAX plug-ins RTAS/TDM counter part. + * \compatibility As of Pro Tools 11.1, AAE will first try to match ID. If that fails, AAE will fall + * back to matching by Name. + * + * + */ + AAX_CParameter(AAX_CParamID identifier, const AAX_IString& name, T defaultValue, const AAX_ITaperDelegate& taperDelegate, const AAX_IDisplayDelegate& displayDelegate, bool automatable=false); + + /*! + * \brief Constructs an \ref AAX_CParameter object using the specified taper and display delegates. + * + * This constructor uses an \ref AAX_IString for the parameter identifier, which can be a more + * flexible solution for some plug-ins. + */ + AAX_CParameter(const AAX_IString& identifier, const AAX_IString& name, T defaultValue, const AAX_ITaperDelegate& taperDelegate, const AAX_IDisplayDelegate& displayDelegate, bool automatable=false); + + /*! + * \brief Constructs an \ref AAX_CParameter object with no delegates + * + * Delegates may be set on this object after construction. Most parameter operations will not work + * until after delegages have been set. + * + * - \sa \ref AAX_CParameter::SetTaperDelegate() + * - \sa \ref AAX_CParameter::SetDisplayDelegate() + */ + AAX_CParameter(const AAX_IString& identifier, const AAX_IString& name, T defaultValue, bool automatable=false); + + /*! + * \brief Constructs an \ref AAX_CParameter object with no delegates or default value + * + * Delegates and default value may be set on this object after construction. Most parameter operations + * will not work until after delegages have been set. + * + * - \sa \ref AAX_CParameter::SetDefaultValue() + * - \sa \ref AAX_CParameter::SetTaperDelegate() + * - \sa \ref AAX_CParameter::SetDisplayDelegate() + */ + AAX_CParameter(const AAX_IString& identifier, const AAX_IString& name, bool automatable=false); + + /** Move constructor and move assignment operator are allowed */ + AAX_DEFAULT_MOVE_CTOR(AAX_CParameter); + AAX_DEFAULT_MOVE_OPER(AAX_CParameter); + + /** Default constructor not allowed, except by possible wrappering classes. */ + AAX_DELETE(AAX_CParameter()); + AAX_DELETE(AAX_CParameter(const AAX_CParameter& other)); + AAX_DELETE(AAX_CParameter& operator= (const AAX_CParameter& other)); + + /*! + * \brief Virtual destructor used to delete all locally allocated pointers. + * + */ + ~AAX_CParameter() AAX_OVERRIDE; + + AAX_IParameterValue* CloneValue() const AAX_OVERRIDE; ///< \copydoc AAX_IParameter::CloneValue() + + /** @name Identification methods + * + */ + //@{ + AAX_CParamID Identifier() const AAX_OVERRIDE; ///< \copydoc AAX_IParameter::Identifier() + void SetName(const AAX_CString& name) AAX_OVERRIDE; ///< \copydoc AAX_IParameter::SetName() + const AAX_CString& Name() const AAX_OVERRIDE; ///< \copydoc AAX_IParameter::Name() + void AddShortenedName(const AAX_CString& name) AAX_OVERRIDE; ///< \copydoc AAX_IParameter::AddShortenedName() + const AAX_CString& ShortenedName(int32_t iNumCharacters) const AAX_OVERRIDE; ///< \copydoc AAX_IParameter::ShortenedName() + void ClearShortenedNames() AAX_OVERRIDE; ///< \copydoc AAX_IParameter::ClearShortenedNames() + //@} Identification methods + + /** @name Taper methods + * + */ + //@{ + void SetNormalizedDefaultValue(double normalizedDefault) AAX_OVERRIDE; ///< \copydoc AAX_IParameter::SetNormalizedDefaultValue() + double GetNormalizedDefaultValue() const AAX_OVERRIDE; ///< \copydoc AAX_IParameter::GetNormalizedDefaultValue() + void SetToDefaultValue() AAX_OVERRIDE; ///< \copydoc AAX_IParameter::SetToDefaultValue() + void SetNormalizedValue(double newNormalizedValue) AAX_OVERRIDE; ///< \copydoc AAX_IParameter::SetNormalizedValue() + double GetNormalizedValue() const AAX_OVERRIDE; ///< \copydoc AAX_IParameter::GetNormalizedValue() + void SetNumberOfSteps(uint32_t numSteps) AAX_OVERRIDE; ///< \copydoc AAX_IParameter::SetNumberOfSteps() + uint32_t GetNumberOfSteps() const AAX_OVERRIDE; ///< \copydoc AAX_IParameter::GetNumberOfSteps() + uint32_t GetStepValue() const AAX_OVERRIDE; ///< \copydoc AAX_IParameter::GetStepValue() + double GetNormalizedValueFromStep(uint32_t iStep) const AAX_OVERRIDE; ///< \copydoc AAX_IParameter::GetNormalizedValueFromStep() + uint32_t GetStepValueFromNormalizedValue(double normalizedValue) const AAX_OVERRIDE; ///< \copydoc AAX_IParameter::GetStepValueFromNormalizedValue() + void SetStepValue(uint32_t iStep) AAX_OVERRIDE; ///< \copydoc AAX_IParameter::SetStepValue() + void SetType(AAX_EParameterType iControlType) AAX_OVERRIDE; ///< \copydoc AAX_IParameter::SetType() + AAX_EParameterType GetType() const AAX_OVERRIDE; ///< \copydoc AAX_IParameter::GetType() + void SetOrientation( AAX_EParameterOrientation iOrientation ) AAX_OVERRIDE; ///< \copydoc AAX_IParameter::SetOrientation() + AAX_EParameterOrientation GetOrientation() const AAX_OVERRIDE; ///< \copydoc AAX_IParameter::GetOrientation() + void SetTaperDelegate(AAX_ITaperDelegateBase& inTaperDelegate,bool inPreserveValue=true) AAX_OVERRIDE; ///< \copydoc AAX_IParameter::SetTaperDelegate() + //@} Taper methods + + /** @name Display methods + * + */ + //@{ + void SetDisplayDelegate(AAX_IDisplayDelegateBase& inDisplayDelegate) AAX_OVERRIDE; ///< \copydoc AAX_IParameter::SetDisplayDelegate() + bool GetValueString( AAX_CString* valueString) const AAX_OVERRIDE; ///< \copydoc AAX_IParameter::GetValueString(AAX_CString*) const + bool GetValueString(int32_t iMaxNumChars, AAX_CString* valueString) const AAX_OVERRIDE; ///< \copydoc AAX_IParameter::GetValueString(int32_t, AAX_CString*) const + bool GetNormalizedValueFromBool(bool value, double *normalizedValue) const AAX_OVERRIDE; ///< \copydoc AAX_IParameter::GetNormalizedValueFromBool() + bool GetNormalizedValueFromInt32(int32_t value, double *normalizedValue) const AAX_OVERRIDE; ///< \copydoc AAX_IParameter::GetNormalizedValueFromInt32() + bool GetNormalizedValueFromFloat(float value, double *normalizedValue) const AAX_OVERRIDE; ///< \copydoc AAX_IParameter::GetNormalizedValueFromFloat() + bool GetNormalizedValueFromDouble(double value, double *normalizedValue) const AAX_OVERRIDE; ///< \copydoc AAX_IParameter::GetNormalizedValueFromDouble() + bool GetNormalizedValueFromString(const AAX_CString& valueString, double *normalizedValue) const AAX_OVERRIDE; ///< \copydoc AAX_IParameter::GetNormalizedValueFromString() + bool GetBoolFromNormalizedValue(double normalizedValue, bool* value) const AAX_OVERRIDE; ///< \copydoc AAX_IParameter::GetBoolFromNormalizedValue() + bool GetInt32FromNormalizedValue(double normalizedValue, int32_t* value) const AAX_OVERRIDE; ///< \copydoc AAX_IParameter::GetInt32FromNormalizedValue() + bool GetFloatFromNormalizedValue(double normalizedValue, float* value) const AAX_OVERRIDE; ///< \copydoc AAX_IParameter::GetFloatFromNormalizedValue() + bool GetDoubleFromNormalizedValue(double normalizedValue, double* value) const AAX_OVERRIDE; ///< \copydoc AAX_IParameter::GetDoubleFromNormalizedValue() + bool GetStringFromNormalizedValue(double normalizedValue, AAX_CString& valueString) const AAX_OVERRIDE; ///< \copydoc AAX_IParameter::GetStringFromNormalizedValue(double, AAX_CString&) const + bool GetStringFromNormalizedValue(double normalizedValue, int32_t iMaxNumChars, AAX_CString& valueString) const AAX_OVERRIDE; ///< \copydoc AAX_IParameter::GetStringFromNormalizedValue(double, int32_t, AAX_CString&) const + bool SetValueFromString(const AAX_CString& newValueString) AAX_OVERRIDE; ///< \copydoc AAX_IParameter::SetValueFromString() + //@} Display methods + + /** @name Automation methods + * + */ + //@{ + void SetAutomationDelegate ( AAX_IAutomationDelegate * iAutomationDelegate ) AAX_OVERRIDE; ///< \copydoc AAX_IParameter::SetAutomationDelegate() + bool Automatable() const AAX_OVERRIDE; ///< \copydoc AAX_IParameter::Automatable() + void Touch() AAX_OVERRIDE; ///< \copydoc AAX_IParameter::Touch() + void Release() AAX_OVERRIDE; ///< \copydoc AAX_IParameter::Release() + //@} Automation methods + + /** @name Typed accessors + * + */ + //@{ + bool GetValueAsBool(bool* value) const AAX_OVERRIDE; ///< \copydoc AAX_IParameter::GetValueAsBool() + bool GetValueAsInt32(int32_t* value) const AAX_OVERRIDE; ///< \copydoc AAX_IParameter::GetValueAsInt32() + bool GetValueAsFloat(float* value) const AAX_OVERRIDE; ///< \copydoc AAX_IParameter::GetValueAsFloat() + bool GetValueAsDouble(double* value) const AAX_OVERRIDE; ///< \copydoc AAX_IParameter::GetValueAsDouble() + bool GetValueAsString(AAX_IString* value) const AAX_OVERRIDE; ///< \copydoc AAX_IParameter::GetValueAsString() + bool SetValueWithBool(bool value) AAX_OVERRIDE; ///< \copydoc AAX_IParameter::SetValueWithBool() + bool SetValueWithInt32(int32_t value) AAX_OVERRIDE; ///< \copydoc AAX_IParameter::SetValueWithInt32() + bool SetValueWithFloat(float value) AAX_OVERRIDE; ///< \copydoc AAX_IParameter::SetValueWithFloat() + bool SetValueWithDouble(double value) AAX_OVERRIDE; ///< \copydoc AAX_IParameter::SetValueWithDouble() + bool SetValueWithString(const AAX_IString& value) AAX_OVERRIDE; ///< \copydoc AAX_IParameter::SetValueWithString() + //@} Typed accessors + + /** @name Host interface methods + * + */ + //@{ + void UpdateNormalizedValue(double newNormalizedValue) AAX_OVERRIDE; ///< \copydoc AAX_IParameter::UpdateNormalizedValue() + //@} Host interface methods + + /** @name Direct methods on AAX_CParameter + * + * These methods can be used to access the parameter's state and properties. These methods + * are specific to the concrete AAX_CParameter class and are not part of the AAX_IParameter + * interface. + */ + //@{ + /*! + * \brief Initiates a host request to set the parameter's value + * + * This method normalizes the provided value and sends a request for the value change to the + * %AAX host. The host responds with a call to AAX_IParameter::UpdateNormalizedValue() to + * complete the set operation. + * + * \param[in] newValue + * The parameter's new value + */ + void SetValue(T newValue ); + /*! + * \brief Returns the parameter's value + * + * This is the parameter's real, logical value and should not be normalized + * + */ + T GetValue() const; + /*! + * \brief Set the parameter's default value + * + * This is the parameter's real, logical value and should not be normalized + * + * \param[in] newDefaultValue + * The parameter's new default value + */ + void SetDefaultValue(T newDefaultValue); + /*! + * \brief Returns the parameter's default value + * + * This is the parameter's real, logical value and should not be normalized + * + */ + T GetDefaultValue() const; + /*! + * \brief Returns a reference to the parameter's taper delegate + * + */ + const AAX_ITaperDelegate* TaperDelegate() const; + /*! + * \brief Returns a reference to the parameter's display delegate + * + */ + const AAX_IDisplayDelegate* DisplayDelegate() const; + //@} Direct methods on AAX_CParameter + +protected: + AAX_CStringAbbreviations mNames; + bool mAutomatable; + uint32_t mNumSteps; + AAX_EParameterType mControlType; + AAX_EParameterOrientation mOrientation; + AAX_ITaperDelegate * mTaperDelegate; + AAX_IDisplayDelegate * mDisplayDelegate; + AAX_IAutomationDelegate * mAutomationDelegate; + bool mNeedNotify; + + AAX_CParameterValue mValue; + T mDefaultValue; + +private: + void InitializeNumberOfSteps(); +}; + + +////// AAX_CParameter Template Definition /////// + +template +AAX_CParameter::AAX_CParameter(AAX_CParamID identifier, const AAX_IString& name, T defaultValue, const AAX_ITaperDelegate& taperDelegate, const AAX_IDisplayDelegate& displayDelegate, bool automatable) +: mNames(name) +, mAutomatable(automatable) +, mNumSteps(0) // Default set below for discrete/continuous +, mControlType( AAX_eParameterType_Continuous ) +, mOrientation( AAX_eParameterOrientation_Default ) +, mTaperDelegate(taperDelegate.Clone()) +, mDisplayDelegate(displayDelegate.Clone()) +, mAutomationDelegate(0) +, mNeedNotify(true) +, mValue(identifier) +, mDefaultValue(defaultValue) +{ + this->InitializeNumberOfSteps(); + this->SetToDefaultValue(); +} + +template +AAX_CParameter::AAX_CParameter(const AAX_IString& identifier, const AAX_IString& name, T defaultValue, const AAX_ITaperDelegate& taperDelegate, const AAX_IDisplayDelegate& displayDelegate, bool automatable) +: mNames(name) +, mAutomatable(automatable) +, mNumSteps(0) // Default set below for discrete/continuous +, mControlType( AAX_eParameterType_Continuous ) +, mOrientation( AAX_eParameterOrientation_Default ) +, mTaperDelegate(taperDelegate.Clone()) +, mDisplayDelegate(displayDelegate.Clone()) +, mAutomationDelegate(0) +, mNeedNotify(true) +, mValue(identifier.Get()) +, mDefaultValue(defaultValue) +{ + this->InitializeNumberOfSteps(); + this->SetToDefaultValue(); +} + +template +AAX_CParameter::AAX_CParameter(const AAX_IString& identifier, const AAX_IString& name, T defaultValue, bool automatable) +: mNames(name) +, mAutomatable(automatable) +, mNumSteps(0) +, mControlType( AAX_eParameterType_Continuous ) +, mOrientation( AAX_eParameterOrientation_Default ) +, mTaperDelegate(NULL) +, mDisplayDelegate(NULL) +, mAutomationDelegate(NULL) +, mNeedNotify(true) +, mValue(identifier.Get()) +, mDefaultValue(defaultValue) +{ + this->InitializeNumberOfSteps(); + this->SetToDefaultValue(); +} + +template +AAX_CParameter::AAX_CParameter(const AAX_IString& identifier, const AAX_IString& name, bool automatable) +: mNames(name) +, mAutomatable(automatable) +, mNumSteps(0) +, mControlType( AAX_eParameterType_Continuous ) +, mOrientation( AAX_eParameterOrientation_Default ) +, mTaperDelegate(NULL) +, mDisplayDelegate(NULL) +, mAutomationDelegate(NULL) +, mNeedNotify(true) +, mValue(identifier.Get()) +, mDefaultValue() +{ + this->InitializeNumberOfSteps(); + this->SetToDefaultValue(); // WARNING: uninitialized default value +} + +template +AAX_CParameter::~AAX_CParameter() +{ + //Make sure to remove any registration with the token system. + SetAutomationDelegate(0); + + delete mTaperDelegate; + mTaperDelegate = 0; + delete mDisplayDelegate; + mDisplayDelegate = 0; +} + +template +AAX_IParameterValue* AAX_CParameter::CloneValue() const +{ + return new AAX_CParameterValue(mValue); +} + +template +AAX_CParamID AAX_CParameter::Identifier() const +{ + return mValue.Identifier(); +} + +template +void AAX_CParameter::SetName(const AAX_CString& name) +{ + mNames.SetPrimary(name); + if (mAutomationDelegate) { + mAutomationDelegate->ParameterNameChanged(this->Identifier()); + } +} + +template +const AAX_CString& AAX_CParameter::Name() const +{ + return mNames.Primary(); +} + +template +void AAX_CParameter::AddShortenedName(const AAX_CString& name) +{ + mNames.Add(name); +} + +template +const AAX_CString& AAX_CParameter::ShortenedName(int32_t iNumCharacters) const +{ + return mNames.Get(iNumCharacters); +} + +template +void AAX_CParameter::ClearShortenedNames() +{ + mNames.Clear(); +} + + + +template +void AAX_CParameter::SetValue( T newValue ) +{ + double newNormalizedValue = mTaperDelegate->RealToNormalized(newValue); + + // Always go through the automation delegate even if the control isn't automatable to prevent fighting with other GUIs. + // Somewhere back in the automation delegate, or elsewhere in the system, it will determine the differences in behavior surrounding + // automation. The only reason that there wouldn't be an automation delegate is if this parameter has yet to be added to a + // ParameterManager. Let's put the null value guards in place, just in case, and also for unit tests. + if ( mAutomationDelegate ) + { + //TODO: Create RAII utility class for touch/release + + //Touch the control + Touch(); + + //Send that token. + mAutomationDelegate->PostSetValueRequest(Identifier(), newNormalizedValue ); + + //Release the control + Release(); + } + else + { + mNeedNotify = true; + + // In the rare case that an automation delegate doesn't exist, lets still set the value. It's possible that someone is trying to + // set the new value before adding the parameter to a parametermanager. + UpdateNormalizedValue(newNormalizedValue); + } +} + +template +void AAX_CParameter::UpdateNormalizedValue(double newNormalizedValue) +{ + T newValue = mTaperDelegate->NormalizedToReal(newNormalizedValue); + if (mNeedNotify || (mValue.Get() != newValue)) + { + //Set the new value + mValue.Set(newValue); + + // Always notify that the value has changed through the automation delegate to guarantee that all control surfaces and other + // GUIs get their values updated. + if (mAutomationDelegate) + mAutomationDelegate->PostCurrentValue(Identifier(), newNormalizedValue); + + // clear flag + mNeedNotify = false; + } +} + +template +void AAX_CParameter::InitializeNumberOfSteps() +{ + if (mNumSteps == 0) // If no explicit number of steps has been set... + { + switch (mControlType) + { + case AAX_eParameterType_Discrete: + { + // Discrete parameters default to binary unless + // otherwise specified + this->SetNumberOfSteps (eParameterDefaultNumStepsDiscrete); + break; + } + case AAX_eParameterType_Continuous: + { + // Defaulting to 128 steps to match one full rotation of + // Command|8 and similar surfaces, which query the num + // steps to determine tick values for rotary encoders + this->SetNumberOfSteps (eParameterDefaultNumStepsContinuous); + break; + } + default: + { + AAX_ASSERT (0); // Invalid type + break; + } + } + } +} + +template +T AAX_CParameter::GetValue() const +{ + return mValue.Get(); +} + + +template +bool AAX_CParameter::GetValueAsBool(bool* value) const +{ + return mValue.GetValueAsBool(value); +} + +template +bool AAX_CParameter::GetValueAsInt32(int32_t* value) const +{ + return mValue.GetValueAsInt32(value); +} + +template +bool AAX_CParameter::GetValueAsFloat(float* value) const +{ + return mValue.GetValueAsFloat(value); +} + +template +bool AAX_CParameter::GetValueAsDouble(double* value) const +{ + return mValue.GetValueAsDouble(value); +} + +template +bool AAX_CParameter::GetValueAsString(AAX_IString* value) const +{ + bool result = false; + if (value) + { + AAX_CString valueString; + result = this->GetValueString(&valueString); + if (true == result) + { + *value = valueString; + } + } + return result; +} + +template<> +bool AAX_CParameter::GetValueAsString(AAX_IString* /*value*/) const; + + +template +bool AAX_CParameter::SetValueWithBool(bool /*value*/) +{ + return false; +} +template<> +bool AAX_CParameter::SetValueWithBool(bool value); + +template +bool AAX_CParameter::SetValueWithInt32(int32_t /*value*/) +{ + return false; +} +template<> +bool AAX_CParameter::SetValueWithInt32(int32_t value); + +template +bool AAX_CParameter::SetValueWithFloat(float /*value*/) +{ + return false; +} +template<> +bool AAX_CParameter::SetValueWithFloat(float value); + +template +bool AAX_CParameter::SetValueWithDouble(double /*value*/) +{ + return false; +} +template<> +bool AAX_CParameter::SetValueWithDouble(double value); + +template +bool AAX_CParameter::SetValueWithString(const AAX_IString& value) +{ + const AAX_CString valueString(value); + return this->SetValueFromString(valueString); +} +template<> +bool AAX_CParameter::SetValueWithString(const AAX_IString& value); + +template +void AAX_CParameter::SetNormalizedDefaultValue(double newNormalizedDefault) +{ + T newDefaultValue = mTaperDelegate->NormalizedToReal(newNormalizedDefault); + SetDefaultValue(newDefaultValue); +} + +template +double AAX_CParameter::GetNormalizedDefaultValue() const +{ + double normalizedDefault = mTaperDelegate->RealToNormalized(mDefaultValue); + return normalizedDefault; +} + +template +void AAX_CParameter::SetDefaultValue(T newDefaultValue) +{ + newDefaultValue = mTaperDelegate->ConstrainRealValue(newDefaultValue); + mDefaultValue = newDefaultValue; +} + +template +T AAX_CParameter::GetDefaultValue() const +{ + return mDefaultValue; +} + +template +void AAX_CParameter::SetToDefaultValue() +{ + SetValue(mDefaultValue); +} + +template +void AAX_CParameter::SetNumberOfSteps(uint32_t numSteps) +{ + AAX_ASSERT(0 < numSteps); + if (0 < numSteps) + { + mNumSteps = numSteps; + } +} + +template +uint32_t AAX_CParameter::GetNumberOfSteps() const +{ + return mNumSteps; +} + +template +uint32_t AAX_CParameter::GetStepValue() const +{ + return GetStepValueFromNormalizedValue(this->GetNormalizedValue()); +} + +template +double AAX_CParameter::GetNormalizedValueFromStep(uint32_t iStep) const +{ + double numSteps = (double) this->GetNumberOfSteps (); + if ( numSteps < 2.0 ) + return 0.0; + + double valuePerStep = 1.0 / ( numSteps - 1.0 ); + double value = valuePerStep * (double) iStep; + if ( value < 0.0 ) + value = 0.0; + else if ( value > 1.0 ) + value = 1.0; + + return value; +} + +template +uint32_t AAX_CParameter::GetStepValueFromNormalizedValue(double normalizedValue) const +{ + double numSteps = (double) this->GetNumberOfSteps (); + if ( numSteps < 2.0 ) + return 0; + + double valuePerStep = 1.0 / ( numSteps - 1.0 ); + double curStep = ( normalizedValue / valuePerStep ) + 0.5; + if ( curStep < 0.0 ) + curStep = 0.0; + else if ( curStep > (double) ( numSteps - 1.0 ) ) + curStep = (double) ( numSteps - 1.0 ); + + return (uint32_t) curStep; +} + +template +void AAX_CParameter::SetStepValue(uint32_t iStep) +{ + double numSteps = (double) this->GetNumberOfSteps (); + if ( numSteps < 2.0 ) + return; + + this->SetNormalizedValue ( GetNormalizedValueFromStep(iStep) ); +} + +template +void AAX_CParameter::SetType(AAX_EParameterType iControlType) +{ + mControlType = iControlType; +} + +template +AAX_EParameterType AAX_CParameter::GetType() const +{ + return mControlType; +} + +template +void AAX_CParameter::SetOrientation(AAX_EParameterOrientation iOrientation) +{ + mOrientation = iOrientation; +} + +template +AAX_EParameterOrientation AAX_CParameter::GetOrientation() const +{ + return mOrientation; +} + +template +void AAX_CParameter::SetNormalizedValue(double normalizedNewValue) +{ + T newValue = mTaperDelegate->NormalizedToReal(normalizedNewValue); + this->SetValue(newValue); +} + +template +double AAX_CParameter::GetNormalizedValue() const +{ + T val = GetValue(); + return mTaperDelegate->RealToNormalized(val); +} + + +template +bool AAX_CParameter::GetValueString(AAX_CString* valueString) const +{ + return mDisplayDelegate->ValueToString(this->GetValue(), valueString); +} + +template +bool AAX_CParameter::GetValueString(int32_t /*iMaxNumChars*/, AAX_CString* valueString) const +{ + return mDisplayDelegate->ValueToString(this->GetValue(), valueString); +} + +template +bool AAX_CParameter::GetNormalizedValueFromBool(bool /*value*/, double * /*normalizedValue*/) const +{ + return false; +} +template <> +bool AAX_CParameter::GetNormalizedValueFromBool(bool value, double *normalizedValue) const; + +template +bool AAX_CParameter::GetNormalizedValueFromInt32(int32_t /*value*/, double * /*normalizedValue*/) const +{ + return false; +} +template <> +bool AAX_CParameter::GetNormalizedValueFromInt32(int32_t value, double *normalizedValue) const; + +template +bool AAX_CParameter::GetNormalizedValueFromFloat(float /*value*/, double * /*normalizedValue*/) const +{ + return false; +} +template <> +bool AAX_CParameter::GetNormalizedValueFromFloat(float value, double *normalizedValue) const; + +template +bool AAX_CParameter::GetNormalizedValueFromDouble(double /*value*/, double * /*normalizedValue*/) const +{ + return false; +} +template <> +bool AAX_CParameter::GetNormalizedValueFromDouble(double value, double *normalizedValue) const; + +template +bool AAX_CParameter::GetNormalizedValueFromString(const AAX_CString& valueString, double *normalizedValue) const +{ + //First, convert the string to a value using the wrapped parameter's display delegate. + T value; + if (!mDisplayDelegate->StringToValue(valueString, &value)) + return false; + + //Then use the wrapped parameter's taper delegate to convert to a normalized representation. + //If the parameter is out of range, the normalizedValue will be clamped just to be safe. + *normalizedValue = mTaperDelegate->RealToNormalized(value); + return true; +} + +template +bool AAX_CParameter::GetBoolFromNormalizedValue(double /*inNormalizedValue*/, bool* /*value*/) const +{ + return false; +} +template <> +bool AAX_CParameter::GetBoolFromNormalizedValue(double inNormalizedValue, bool* value) const; + + +template +bool AAX_CParameter::GetInt32FromNormalizedValue(double /*inNormalizedValue*/, int32_t* /*value*/) const +{ + return false; +} +template<> +bool AAX_CParameter::GetInt32FromNormalizedValue(double inNormalizedValue, int32_t* value) const; + +template +bool AAX_CParameter::GetFloatFromNormalizedValue(double /*inNormalizedValue*/, float* /*value*/) const +{ + return false; +} +template<> +bool AAX_CParameter::GetFloatFromNormalizedValue(double inNormalizedValue, float* value) const; + +template +bool AAX_CParameter::GetDoubleFromNormalizedValue(double /*inNormalizedValue*/, double* /*value*/) const +{ + return false; +} +template<> +bool AAX_CParameter::GetDoubleFromNormalizedValue(double inNormalizedValue, double* value) const; + +template +bool AAX_CParameter::GetStringFromNormalizedValue(double normalizedValue, AAX_CString& valueString) const +{ + T value = mTaperDelegate->NormalizedToReal(normalizedValue); + if (!mDisplayDelegate->ValueToString(value, &valueString)) + return false; + + //If the parameter is out of range, we should probably return false, even though we clamped the normalizedValue already just to be safe. + if ((value > mTaperDelegate->GetMaximumValue()) || (value < mTaperDelegate->GetMinimumValue())) + return false; + return true; +} + +template +bool AAX_CParameter::GetStringFromNormalizedValue(double normalizedValue, int32_t iMaxNumChars, AAX_CString& valueString) const +{ + T value = mTaperDelegate->NormalizedToReal(normalizedValue); + if (!mDisplayDelegate->ValueToString(value, iMaxNumChars, &valueString)) + return false; + + //If the parameter is out of range, we should probably return false, even though we clamped the normalizedValue already just to be safe. + if ((value > mTaperDelegate->GetMaximumValue()) || (value < mTaperDelegate->GetMinimumValue())) + return false; + return true; +} + +template +bool AAX_CParameter::SetValueFromString(const AAX_CString& newValueString) +{ + T newValue; + if (!mDisplayDelegate->StringToValue(newValueString, &newValue)) + return false; + SetValue(newValue); + return true; +} + +template +void AAX_CParameter::SetTaperDelegate(AAX_ITaperDelegateBase& inTaperDelegate,bool inPreserveValue) +{ + double normalizeValue = this->GetNormalizedValue (); + + AAX_ITaperDelegate* oldDelegate = mTaperDelegate; + mTaperDelegate = ((AAX_ITaperDelegate &) inTaperDelegate).Clone(); + delete oldDelegate; + + mNeedNotify = true; + if ( inPreserveValue ) + this->SetValue ( mValue.Get() ); + else this->UpdateNormalizedValue ( normalizeValue ); +} + +template +void AAX_CParameter::SetDisplayDelegate(AAX_IDisplayDelegateBase& inDisplayDelegate) +{ + AAX_IDisplayDelegate* oldDelegate = mDisplayDelegate; + mDisplayDelegate = ((AAX_IDisplayDelegate &)inDisplayDelegate).Clone(); + delete oldDelegate; + + if (mAutomationDelegate != 0) + mAutomationDelegate->PostCurrentValue(this->Identifier(), this->GetNormalizedValue()); // Make sure GUIs are all notified of the change. +} + +template +const AAX_ITaperDelegate* AAX_CParameter::TaperDelegate() const +{ + return mTaperDelegate; +} + +template +const AAX_IDisplayDelegate* AAX_CParameter::DisplayDelegate() const +{ + return mDisplayDelegate; +} + +template +bool AAX_CParameter::Automatable() const +{ + return mAutomatable; +} + +template +void AAX_CParameter::SetAutomationDelegate ( AAX_IAutomationDelegate * iAutomationDelegate ) +{ + //Remove the old automation delegate + if ( mAutomationDelegate ) + { + mAutomationDelegate->UnregisterParameter ( this->Identifier() ); + } + + //Add the new automation delegate, wrapped by the versioning layer. + mAutomationDelegate = iAutomationDelegate; + if ( mAutomationDelegate ) + mAutomationDelegate->RegisterParameter ( this->Identifier() ); +} + +template +void AAX_CParameter::Touch() +{ + //
Always send the touch command, even if the control isn't automatable. + if (mAutomationDelegate) + mAutomationDelegate->PostTouchRequest( this->Identifier() ); +} + +template +void AAX_CParameter::Release() +{ + //
Always send the release command, even if the control isn't automatable. + if (mAutomationDelegate) + mAutomationDelegate->PostReleaseRequest( this->Identifier() ); +} + + +/////////////////////////////////////////////////////////////// +#if 0 +#pragma mark - +#pragma mark AAX_CStatelessParameter +#endif +/////////////////////////////////////////////////////////////// + +/** + * \brief A stateless parameter implementation + * + * This can be useful for mapping event triggers to control surface buttons + * or to GUI switches. + */ +class AAX_CStatelessParameter : public AAX_IParameter +{ +public: + AAX_CStatelessParameter(AAX_CParamID identifier, const AAX_IString& name, const AAX_IString& inValueString) + : mNames(name) + , mID(identifier) + , mAutomationDelegate(NULL) + , mValueString(inValueString) + { + } + + AAX_CStatelessParameter(const AAX_IString& identifier, const AAX_IString& name, const AAX_IString& inValueString) + : mNames(name) + , mID(identifier) + , mAutomationDelegate(NULL) + , mValueString(inValueString) + { + } + + AAX_DEFAULT_DTOR_OVERRIDE(AAX_CStatelessParameter); + + AAX_IParameterValue* CloneValue() const AAX_OVERRIDE { return NULL; } + + /** @name Identification methods + * + */ + //@{ + AAX_CParamID Identifier() const AAX_OVERRIDE { return mID.CString(); } + void SetName(const AAX_CString& name) AAX_OVERRIDE + { + mNames.SetPrimary(name); + if (mAutomationDelegate) { + mAutomationDelegate->ParameterNameChanged(this->Identifier()); + } + } + const AAX_CString& Name() const AAX_OVERRIDE { return mNames.Primary(); } + void AddShortenedName(const AAX_CString& name) AAX_OVERRIDE { mNames.Add(name); } + const AAX_CString& ShortenedName(int32_t iNumCharacters) const AAX_OVERRIDE { return mNames.Get(iNumCharacters); } + void ClearShortenedNames() AAX_OVERRIDE { mNames.Clear(); } + //@} Identification methods + + /** @name Automation methods + * + */ + //@{ + bool Automatable() const AAX_OVERRIDE { return false; } + void SetAutomationDelegate( AAX_IAutomationDelegate * iAutomationDelegate ) AAX_OVERRIDE + { + //Remove the old automation delegate + if ( mAutomationDelegate ) + { + mAutomationDelegate->UnregisterParameter ( this->Identifier() ); + } + + //Add the new automation delegate, wrapped by the versioning layer. + mAutomationDelegate = iAutomationDelegate; + if ( mAutomationDelegate ) + mAutomationDelegate->RegisterParameter ( this->Identifier() ); + } + void Touch() AAX_OVERRIDE { if (mAutomationDelegate) mAutomationDelegate->PostTouchRequest( this->Identifier() ); } + void Release() AAX_OVERRIDE { if (mAutomationDelegate) mAutomationDelegate->PostReleaseRequest( this->Identifier() ); } + //@} Automation methods + + /** @name Taper methods + * + */ + //@{ + void SetNormalizedValue(double /*newNormalizedValue*/) AAX_OVERRIDE {} + double GetNormalizedValue() const AAX_OVERRIDE { return 0.; } + void SetNormalizedDefaultValue(double /*normalizedDefault*/) AAX_OVERRIDE {} + double GetNormalizedDefaultValue() const AAX_OVERRIDE { return 0.; } + void SetToDefaultValue() AAX_OVERRIDE {} + void SetNumberOfSteps(uint32_t /*numSteps*/) AAX_OVERRIDE {} + uint32_t GetNumberOfSteps() const AAX_OVERRIDE { return 1; } + uint32_t GetStepValue() const AAX_OVERRIDE { return 0; } + double GetNormalizedValueFromStep(uint32_t /*iStep*/) const AAX_OVERRIDE { return 0.; } + uint32_t GetStepValueFromNormalizedValue(double /*normalizedValue*/) const AAX_OVERRIDE { return 0; } + void SetStepValue(uint32_t /*iStep*/) AAX_OVERRIDE {} + //@} Taper methods + + /** @name Display methods + * + * This functionality is most often used by GUIs, but can also be useful for state + * serialization. + */ + //@{ + bool GetValueString(AAX_CString* valueString) const AAX_OVERRIDE { if (valueString) *valueString = mValueString; return true; } + bool GetValueString(int32_t /*iMaxNumChars*/, AAX_CString* valueString) const AAX_OVERRIDE { return this->GetValueString(valueString); } + bool GetNormalizedValueFromBool(bool /*value*/, double* normalizedValue) const AAX_OVERRIDE { if (normalizedValue) { *normalizedValue = 0.; } return true; } + bool GetNormalizedValueFromInt32(int32_t /*value*/, double* normalizedValue) const AAX_OVERRIDE { if (normalizedValue) { *normalizedValue = 0.; } return true; } + bool GetNormalizedValueFromFloat(float /*value*/, double* normalizedValue) const AAX_OVERRIDE { if (normalizedValue) { *normalizedValue = 0.; } return true; } + bool GetNormalizedValueFromDouble(double /*value*/, double* normalizedValue) const AAX_OVERRIDE { if (normalizedValue) { *normalizedValue = 0.; } return true; } + bool GetNormalizedValueFromString(const AAX_CString& /*valueString*/, double* normalizedValue) const AAX_OVERRIDE { if (normalizedValue) { *normalizedValue = 0.; } return true; } + bool GetBoolFromNormalizedValue(double /*normalizedValue*/, bool* value) const AAX_OVERRIDE { if (value) { *value = false; } return true; } + bool GetInt32FromNormalizedValue(double /*normalizedValue*/, int32_t* /*value*/) const AAX_OVERRIDE { return false; } + bool GetFloatFromNormalizedValue(double /*normalizedValue*/, float* /*value*/) const AAX_OVERRIDE { return false; } + bool GetDoubleFromNormalizedValue(double /*normalizedValue*/, double* /*value*/) const AAX_OVERRIDE { return false; } + bool GetStringFromNormalizedValue(double /*normalizedValue*/, AAX_CString& valueString) const AAX_OVERRIDE { valueString = mValueString; return true; } + bool GetStringFromNormalizedValue(double normalizedValue, int32_t /*iMaxNumChars*/, AAX_CString& valueString) const AAX_OVERRIDE { return this->GetStringFromNormalizedValue(normalizedValue, valueString); } + bool SetValueFromString(const AAX_CString& newValueString) AAX_OVERRIDE { mValueString = newValueString; return true; } + //@} Display methods + + /** @name Typed accessors + * + */ + //@{ + bool GetValueAsBool(bool* value) const AAX_OVERRIDE { if (value) { *value = false; } return true; } + bool GetValueAsInt32(int32_t* /*value*/) const AAX_OVERRIDE { return false; } + bool GetValueAsFloat(float* /*value*/) const AAX_OVERRIDE { return false; } + bool GetValueAsDouble(double* /*value*/) const AAX_OVERRIDE { return false; } + bool GetValueAsString(AAX_IString* /*value*/) const AAX_OVERRIDE { return false; } + bool SetValueWithBool(bool /*value*/) AAX_OVERRIDE { return true; } + bool SetValueWithInt32(int32_t /*value*/) AAX_OVERRIDE { return false; } + bool SetValueWithFloat(float /*value*/) AAX_OVERRIDE { return false; } + bool SetValueWithDouble(double /*value*/) AAX_OVERRIDE { return false; } + bool SetValueWithString(const AAX_IString& value) AAX_OVERRIDE { mValueString = value; return true; } + //@} Typed accessors + + void SetType( AAX_EParameterType /*iControlType*/ ) AAX_OVERRIDE {}; + AAX_EParameterType GetType() const AAX_OVERRIDE { return AAX_eParameterType_Discrete; } + + void SetOrientation( AAX_EParameterOrientation /*iOrientation*/ ) AAX_OVERRIDE {} + AAX_EParameterOrientation GetOrientation() const AAX_OVERRIDE { return AAX_eParameterOrientation_Default; } + + void SetTaperDelegate ( AAX_ITaperDelegateBase & /*inTaperDelegate*/, bool /*inPreserveValue*/ ) AAX_OVERRIDE {}; + void SetDisplayDelegate ( AAX_IDisplayDelegateBase & /*inDisplayDelegate*/ ) AAX_OVERRIDE {}; + + /** @name Host interface methods + * + */ + //@{ + void UpdateNormalizedValue(double /*newNormalizedValue*/) AAX_OVERRIDE {}; + //@} Host interface methods + +protected: + AAX_CStringAbbreviations mNames; + AAX_CString mID; + AAX_IAutomationDelegate * mAutomationDelegate; + AAX_CString mValueString; +}; + + + + +#endif //AAX_CParameter_H diff --git a/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_CParameterManager.h b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_CParameterManager.h new file mode 100644 index 0000000000..ae1e378612 --- /dev/null +++ b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_CParameterManager.h @@ -0,0 +1,194 @@ +/*================================================================================================*/ +/* + * + * Copyright 2014-2015, 2018, 2023-2024 Avid Technology, Inc. + * All rights reserved. + * + * This file is part of the Avid AAX SDK. + * + * The AAX SDK is subject to commercial or open-source licensing. + * + * By using the AAX SDK, you agree to the terms of both the Avid AAX SDK License + * Agreement and Avid Privacy Policy. + * + * AAX SDK License: https://developer.avid.com/aax + * Privacy Policy: https://www.avid.com/legal/privacy-policy-statement + * + * Or: You may also use this code under the terms of the GPL v3 (see + * www.gnu.org/licenses). + * + * THE AAX SDK IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER + * EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE + * DISCLAIMED. + * + */ + +/** + * \file AAX_CParameterManager.h + * + * \brief A container object for plug-in parameters + * + */ +/*================================================================================================*/ + + +#ifndef AAX_CPARAMETERMANAGER_H +#define AAX_CPARAMETERMANAGER_H + +#include "AAX_CParameter.h" +#include "AAX.h" + +#include +#include + + + + +class AAX_IAutomationDelegate; + +/** \brief A container object for plug-in parameters + + \details + This implementation uses a STL vector to store a plug-in's set of parameters. This class + contains a real implementation of the \ref AAXLibraryFeatures_ParameterManager (as opposed to a proxy.) + + For more information, see \ref AAXLibraryFeatures_ParameterManager. + + \todo Should the Parameter Manager return error codes? + + \ingroup AAXLibraryFeatures_ParameterManager + */ +class AAX_CParameterManager +{ +public: + AAX_CParameterManager(); + ~AAX_CParameterManager(); + + /*! + * \brief Initialize the parameter manager + * + * Called when plug-in instance is first instantiated. This method will initialize the + * plug-in's automation delegate, among other set-up tasks. + * + * \param[in] iAutomationDelegateUnknown + * A reference to the plug-in's AAX_IAutomationDelegate interface + */ + void Initialize(AAX_IAutomationDelegate* iAutomationDelegateUnknown); + + /*! + * \brief Returns the number of parameters in this instance of the parameter manager + * + */ + int32_t NumParameters() const; + + /*! + * \brief Removes a parameter from the manager + * + * \todo Should this method return success/failure code? + * + * \param[in] identifier + * ID of the parameter that will be removed + */ + void RemoveParameterByID(AAX_CParamID identifier); + + /*! + * \brief Removes all parameters from the manager + * + * \todo Should this method return success/failure code? + */ + void RemoveAllParameters(); + + /*! + * \brief Given a parameter ID, retrieves a reference to the requested parameter + * + * \param[in] identifier + * ID of the parameter that will be retrieved + */ + AAX_IParameter* GetParameterByID(AAX_CParamID identifier); + + /*! + * \brief Given a parameter ID, retrieves a const reference to the requested parameter + * + * \param[in] identifier + * ID of the parameter that will be retrieved + */ + const AAX_IParameter* GetParameterByID(AAX_CParamID identifier) const; + + /*! + * \brief Given a parameter name, retrieves a reference to the requested parameter + * + * \note Parameter names may be ambiguous + * + * \param[in] name + * Name of the parameter that will be retrieved + */ + AAX_IParameter* GetParameterByName(const char* name); + + /*! + * \brief Given a parameter name, retrieves a const reference to the requested parameter + * + * \note Parameter names may be ambiguous + * + * \param[in] name + * ID of the parameter that will be retrieved + */ + const AAX_IParameter* GetParameterByName(const char* name) const; + + /*! + * \brief Given a parameter index, retrieves a reference to the requested parameter + * + * Parameter indices are incremented in the order that parameters are added to the manager. + * See AddParameter(). + * + * \param[in] index + * Index of the parameter that will be retrieved + */ + AAX_IParameter* GetParameter(int32_t index); + + /*! + * \brief Given a parameter index, retrieves a const reference to the requested parameter + * + * Parameter indices are incremented in the order that parameters are added to the manager. + * See AddParameter(). + * + * \param[in] index + * Index of the parameter that will be retrieved + */ + const AAX_IParameter* GetParameter(int32_t index) const; + + /** Given a parameter ID, retrieves the index for the specified parameter + * + * \param[in] identifier + * ID of the parameter that will be retrieved + */ + int32_t GetParameterIndex(AAX_CParamID identifier) const; + + /** Adds a parameter to the manager + * + * \todo Should this method return success/failure code? + * + * \param[in] param + * Reference to the parameter that will be added + */ + void AddParameter(AAX_IParameter* param); + + /** Removes a parameter to the manager + * + * \todo Should this method return success/failure code? + * + * \param[in] param + * Reference to the parameter that will be removed + */ + void RemoveParameter(AAX_IParameter* param); + +protected: + + AAX_IAutomationDelegate* mAutomationDelegate; //This object is not ref-counted here. Do not delete it. It is ref counted by this object's parent. + std::vector mParameters; + std::map mParametersMap; +}; + + + + +#endif // AAX_CPARAMETERMANAGER_H diff --git a/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_CPercentDisplayDelegateDecorator.h b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_CPercentDisplayDelegateDecorator.h new file mode 100644 index 0000000000..aff1fd0c1c --- /dev/null +++ b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_CPercentDisplayDelegateDecorator.h @@ -0,0 +1,142 @@ +/*================================================================================================*/ +/* + * + * Copyright 2014-2017, 2019, 2023-2024 Avid Technology, Inc. + * All rights reserved. + * + * This file is part of the Avid AAX SDK. + * + * The AAX SDK is subject to commercial or open-source licensing. + * + * By using the AAX SDK, you agree to the terms of both the Avid AAX SDK License + * Agreement and Avid Privacy Policy. + * + * AAX SDK License: https://developer.avid.com/aax + * Privacy Policy: https://www.avid.com/legal/privacy-policy-statement + * + * Or: You may also use this code under the terms of the GPL v3 (see + * www.gnu.org/licenses). + * + * THE AAX SDK IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER + * EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE + * DISCLAIMED. + * + */ + +/** + * \file AAX_CPercentDisplayDelegateDecorator.h + * + * \brief A percent display delegate decorator. + * + */ +/*================================================================================================*/ + + +#pragma once + +#ifndef AAX_CPERCENTDISPLAYDELEGATEDECORATOR_H +#define AAX_CPERCENTDISPLAYDELEGATEDECORATOR_H + +#include "AAX_IDisplayDelegateDecorator.h" + +#include + + +/** \brief A percent decorator conforming to AAX_IDisplayDelegateDecorator + + \details + This class is an \ref AAX_IDisplayDelegateDecorator, meaning that it acts as a wrapper for + other display delegates or concrete display types. For more information about display + delegate decorators in AAX, see \ref displaydelegates_decorators + + The behavior of this class it to provide string conversion to and from percentage (%) + values. When converting a parameter value to a string, it takes the real value and + performs a % conversion before passing the value on to a concrete implementation to get + a value string. It then adds on the "%" string at the end to signify that the value was + converted. This allows something like a gain value to remain internally linear at all + times even though its display is converted to a percentage. + + The inverse operation is also supported; this class can convert a percentage-formatted + string into its associated real value. The string will first be converted to a number, + then that number will have the inverse % calculation applied to it to retrieve the + parameter's actual value. + + \ingroup AAXLibraryFeatures_ParameterManager_DisplayDelegates_Decorators + +*/ +template +class AAX_CPercentDisplayDelegateDecorator : public AAX_IDisplayDelegateDecorator +{ +public: + AAX_CPercentDisplayDelegateDecorator(const AAX_IDisplayDelegate& displayDelegate); + + //Virtual Overrides + AAX_CPercentDisplayDelegateDecorator* Clone() const AAX_OVERRIDE; + bool ValueToString(T value, AAX_CString* valueString) const AAX_OVERRIDE; + bool ValueToString(T value, int32_t maxNumChars, AAX_CString* valueString) const AAX_OVERRIDE; + bool StringToValue(const AAX_CString& valueString, T* value) const AAX_OVERRIDE; +}; + +template +AAX_CPercentDisplayDelegateDecorator::AAX_CPercentDisplayDelegateDecorator(const AAX_IDisplayDelegate& displayDelegate) : + AAX_IDisplayDelegateDecorator(displayDelegate) +{ +} + +template +AAX_CPercentDisplayDelegateDecorator* AAX_CPercentDisplayDelegateDecorator::Clone() const +{ + return new AAX_CPercentDisplayDelegateDecorator(*this); +} + +template +bool AAX_CPercentDisplayDelegateDecorator::ValueToString(T value, AAX_CString* valueString) const +{ + value *= 100; + bool succeeded = AAX_IDisplayDelegateDecorator::ValueToString(value, valueString); + *valueString += AAX_CString("%"); + return succeeded; +} + +template +bool AAX_CPercentDisplayDelegateDecorator::ValueToString(T value, int32_t maxNumChars, AAX_CString* valueString) const +{ + value *= 100; + bool succeeded = AAX_IDisplayDelegateDecorator::ValueToString(value, maxNumChars-1, valueString); // Make room for percentage symbol. + *valueString += AAX_CString("%"); + return succeeded; +} + + +template +bool AAX_CPercentDisplayDelegateDecorator::StringToValue(const AAX_CString& valueString, T* value) const +{ + //Just call through if there is obviously no unit string. + if (valueString.Length() <= 2) + { + bool success = AAX_IDisplayDelegateDecorator::StringToValue(valueString, value); + *value /= 100.0f; + return success; + } + + //Just call through if the end of this string does not match the unit string. + AAX_CString unitSubString; + valueString.SubString(valueString.Length() - 1, 1, &unitSubString); + if (unitSubString != AAX_CString("%")) + { + bool success = AAX_IDisplayDelegateDecorator::StringToValue(valueString, value); + *value /= 100.0f; + return success; + } + + //Call through with the stripped down value string. + AAX_CString valueSubString; + valueString.SubString(0, valueString.Length() - 1, &valueSubString); + bool success = AAX_IDisplayDelegateDecorator::StringToValue(valueSubString, value); + *value /= 100.0f; + return success; +} + + +#endif + diff --git a/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_CPieceWiseLinearTaperDelegate.h b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_CPieceWiseLinearTaperDelegate.h new file mode 100644 index 0000000000..90cd353741 --- /dev/null +++ b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_CPieceWiseLinearTaperDelegate.h @@ -0,0 +1,264 @@ +/*================================================================================================*/ +/* + * + * Copyright 2014-2017, 2019, 2023-2024 Avid Technology, Inc. + * All rights reserved. + * + * This file is part of the Avid AAX SDK. + * + * The AAX SDK is subject to commercial or open-source licensing. + * + * By using the AAX SDK, you agree to the terms of both the Avid AAX SDK License + * Agreement and Avid Privacy Policy. + * + * AAX SDK License: https://developer.avid.com/aax + * Privacy Policy: https://www.avid.com/legal/privacy-policy-statement + * + * Or: You may also use this code under the terms of the GPL v3 (see + * www.gnu.org/licenses). + * + * THE AAX SDK IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER + * EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE + * DISCLAIMED. + * + */ + +/** + * \file AAX_CPieceWiseLinearTaperDelegate.h + * + * \brief A piece-wise linear taper delegate. + * + */ +/*================================================================================================*/ + + +#ifndef AAX_CPIECEWISELINEARTAPERDELEGATE_H +#define AAX_CPIECEWISELINEARTAPERDELEGATE_H + +#include "AAX_ITaperDelegate.h" +#include "AAX.h" //for types + +#include //for floor() + + +/** \brief A piece-wise linear taper conforming to AAX_ITaperDelegate + + \details + This taper spaces a parameter's real values in a piecewise linear fashion. + + \par RealPrecision + In addition to its type templatization, this taper includes a precision template parameter. + RealPrecision is a multiplier that works in conjunction with the round() + function to limit the precision of the real values provided by this taper. For example, if + RealPrecision is 1000, it will round to the closest 0.001 when doing any + sort of value conversion. If RealPrecision is 1, it will round to the nearest integer. + If RealPrecision is 1000000, it will round to the nearest 0.000001. This + is particularly useful for preventing things like 1.9999999 truncating down to 1 instead of + rounding up to 2. + + To accomplish this behavior, the taper multiplies its unrounded parameter values by + RealPrecision, rounds the result to the nearest valid value, then divides RealPrecision + back out. + + Rounding will be disabled if RealPrecision is set to a value less than 1 + + \ingroup TaperDelegates + */ +template +class AAX_CPieceWiseLinearTaperDelegate : public AAX_ITaperDelegate +{ +public: + /** \brief Constructs a Piece-wise Linear Taper with paired normalized and real values. + * + * \note The parameter's default value should lie within the min to max range. + * + * \param[in] normalizedValues is an array of the normalized values in sorted order. (make sure to include the full normalized range, 0.0-1.0 inclusive) + * \param[in] realValues is an array of the corresponding real values to the normalized values passed in. + * \param[in] numValues is the number of values that have been passed in (i.e. the element length of the other input arrays) + */ + AAX_CPieceWiseLinearTaperDelegate(const double* normalizedValues, const T* realValues, int32_t numValues); + + AAX_CPieceWiseLinearTaperDelegate(const AAX_CPieceWiseLinearTaperDelegate& other); //Explicit copy constructor because there are internal arrays. + ~AAX_CPieceWiseLinearTaperDelegate(); + + //Virtual AAX_ITaperDelegate Overrides + AAX_CPieceWiseLinearTaperDelegate* Clone() const AAX_OVERRIDE; + T GetMinimumValue() const AAX_OVERRIDE { return mMinValue; } + T GetMaximumValue() const AAX_OVERRIDE { return mMaxValue; } + T ConstrainRealValue(T value) const AAX_OVERRIDE; + T NormalizedToReal(double normalizedValue) const AAX_OVERRIDE; + double RealToNormalized(T realValue) const AAX_OVERRIDE; + +protected: + T Round(double iValue) const; + +private: + double* mNormalizedValues; + T* mRealValues; + int32_t mNumValues; + T mMinValue; //Really just an optimization + T mMaxValue; //Really just an optimization +}; + +template +T AAX_CPieceWiseLinearTaperDelegate::Round(double iValue) const +{ + if (RealPrecision > 0) + return static_cast(floor(iValue * RealPrecision + 0.5) / RealPrecision); + else + return static_cast(iValue); +} + +template +AAX_CPieceWiseLinearTaperDelegate::AAX_CPieceWiseLinearTaperDelegate(const double* normalizedValues, const T* realValues, int32_t numValues) : AAX_ITaperDelegate(), + mNormalizedValues(0), + mRealValues(0), + mNumValues(0), + mMinValue(0), + mMaxValue(0) +{ + mNormalizedValues = new double[numValues]; + mRealValues = new T[numValues]; + mNumValues = numValues; + + if (numValues > 0) + { + mMaxValue = realValues[0]; + mMinValue = realValues[0]; + } + for (int32_t i=0; i< numValues; i++) + { + mNormalizedValues[i] = normalizedValues[i]; + mRealValues[i] = realValues[i]; + if (mRealValues[i] > mMaxValue) + mMaxValue = mRealValues[i]; + if (mRealValues[i] < mMinValue) + mMinValue = mRealValues[i]; + } +} + +template +AAX_CPieceWiseLinearTaperDelegate::AAX_CPieceWiseLinearTaperDelegate(const AAX_CPieceWiseLinearTaperDelegate& other) : AAX_ITaperDelegate(), + mNormalizedValues(0), + mRealValues(0), + mNumValues(0), + mMinValue(0), + mMaxValue(0) +{ + mNormalizedValues = new double[other.mNumValues]; + mRealValues = new T[other.mNumValues]; + mNumValues = other.mNumValues; + mMaxValue = other.mMaxValue; + mMinValue = other.mMinValue; + for (int32_t i=0; i< mNumValues; i++) + { + mNormalizedValues[i] = other.mNormalizedValues[i]; + mRealValues[i] = other.mRealValues[i]; + } +} + +template +AAX_CPieceWiseLinearTaperDelegate::~AAX_CPieceWiseLinearTaperDelegate() +{ + mNumValues = 0; + delete [] mNormalizedValues; + delete [] mRealValues; +} + + +template +AAX_CPieceWiseLinearTaperDelegate* AAX_CPieceWiseLinearTaperDelegate::Clone() const +{ + return new AAX_CPieceWiseLinearTaperDelegate(*this); +} + +template +T AAX_CPieceWiseLinearTaperDelegate::ConstrainRealValue(T value) const +{ + if (mMinValue == mMaxValue) + return mMinValue; + + if (RealPrecision) + value = Round(value); //reduce the precision to get proper rounding behavior with integers. + + const T& highValue = mMaxValue > mMinValue ? mMaxValue : mMinValue; + const T& lowValue = mMaxValue > mMinValue ? mMinValue : mMaxValue; + + if (value > highValue) + return highValue; + if (value < lowValue) + return lowValue; + + return value; +} + +template +T AAX_CPieceWiseLinearTaperDelegate::NormalizedToReal(double normalizedValue) const +{ + + // Clip to normalized range. + if (normalizedValue > 1.0) + normalizedValue = 1.0; + if (normalizedValue < 0.0) + normalizedValue = 0.0; + + // This is basically linear interpolation so let's first find the bounding normalized points from our specified array. + int32_t mLowerIndex = 0; + int32_t mUpperIndex = 0; + for (int32_t i=1;i= normalizedValue) + break; + mLowerIndex++; + } + + // Do the interpolation. + double delta = normalizedValue - mNormalizedValues[mLowerIndex]; + double slope = double(mRealValues[mUpperIndex] - mRealValues[mLowerIndex]) / (mNormalizedValues[mUpperIndex] - mNormalizedValues[mLowerIndex]); + double interpolatedValue = mRealValues[mLowerIndex] + (delta * slope); + return ConstrainRealValue(static_cast(interpolatedValue)); +} + +template +double AAX_CPieceWiseLinearTaperDelegate::RealToNormalized(T realValue) const +{ + realValue = ConstrainRealValue(realValue); + + // This is basically linear interpolation so let's first find the bounding normalized points from our specified array. + int32_t mLowerIndex = 0; + int32_t mUpperIndex = 0; + if (mRealValues[0] < mRealValues[mNumValues-1]) + { + //Increasing real values (positive slope) + for (int32_t i=1;i= realValue) + break; + mLowerIndex++; + } + } + else + { + //Decreasing real values (negative slope) + for (int32_t i=1;i(interpolatedValue); +} + + + + +#endif //AAX_CPIECEWISELINEARTAPERDELEGATE_H diff --git a/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_CRangeTaperDelegate.h b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_CRangeTaperDelegate.h new file mode 100644 index 0000000000..97f18defed --- /dev/null +++ b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_CRangeTaperDelegate.h @@ -0,0 +1,303 @@ +/*================================================================================================*/ +/* + * + * Copyright 2013-2017, 2019, 2023-2024 Avid Technology, Inc. + * All rights reserved. + * + * This file is part of the Avid AAX SDK. + * + * The AAX SDK is subject to commercial or open-source licensing. + * + * By using the AAX SDK, you agree to the terms of both the Avid AAX SDK License + * Agreement and Avid Privacy Policy. + * + * AAX SDK License: https://developer.avid.com/aax + * Privacy Policy: https://www.avid.com/legal/privacy-policy-statement + * + * Or: You may also use this code under the terms of the GPL v3 (see + * www.gnu.org/licenses). + * + * THE AAX SDK IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER + * EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE + * DISCLAIMED. + * + */ + +/** + * \file AAX_CRangeTaperDelegate.h + * + * \brief A range taper delegate decorator. + * + */ +/*================================================================================================*/ + + +#ifndef AAX_CRANGETAPERDELEGATE_H +#define AAX_CRANGETAPERDELEGATE_H + +#include "AAX_ITaperDelegate.h" +#include "AAX.h" //for types + +#include //for floor() +#include + + +/** \brief A piecewise-linear taper conforming to AAX_ITaperDelegate + + \details + This taper spaces a parameter's real values between its minimum and maximum using a series + of linear regions to create the full mapping between the parameter's real and + normalized values. + + Here is an example of how this taper can be used: + + \code + float rangePoints[] = { 0.0, 1.0, 100.0, 1000.0, 2000.0 }; + double rangeSteps[] = { 0.1, 1.0, 10.0, 25.0 }; // number of steps per range: 10, 99, 90, 40 + const long cNumRanges = sizeof(rangeSteps)/sizeof(rangeSteps[0]); + + long numSteps = 0; + for (int i = 0; i < cNumRanges; i++) + { + numSteps += (rangePoints[i+1] - rangePoints[i]) / rangeSteps[i]; + } + + AAX_CRangeTaperDelegate nonLinearTaper(rangePoints, rangeSteps, cNumRanges); + + float controlValue = 1.5; + + double normalized = nonLinearTaper.RealToNormalized(controlValue); + float real = nonLinearTaper.NormalizedToReal(normalized); + \endcode + + \par RealPrecision + In addition to its type templatization, this taper includes a precision template parameter. + RealPrecision is a multiplier that works in conjunction with the round() + function to limit the precision of the real values provided by this taper. For example, if + RealPrecision is 1000, it will round to the closest 0.001 when doing any + sort of value conversion. If RealPrecision is 1, it will round to the nearest integer. + If RealPrecision is 1000000, it will round to the nearest 0.000001. This + is particularly useful for preventing things like 1.9999999 truncating down to 1 instead of + rounding up to 2. + + To accomplish this behavior, the taper multiplies its unrounded parameter values by + RealPrecision, rounds the result to the nearest valid value, then divides RealPrecision + back out. + + Rounding will be disabled if RealPrecision is set to a value less than 1 + + \ingroup TaperDelegates + +*/ +template +class AAX_CRangeTaperDelegate : public AAX_ITaperDelegate +{ +public: + /** \brief Constructs a Range Taper with specified minimum and maximum values. + * + * \note The parameter's default value should lie within the min to max range. + * + * \param[in] range + * An array of range endpoints along the taper's mapping range + * \param[in] rangesSteps + * Step values for each region in the taper's stepwise-linear map. No values in this array may be zero. + * \param[in] numRanges + * The total number of linear regions in the taper's map + * \param[in] useSmartRounding + * \todo Document useSmartRounding parameter + */ + AAX_CRangeTaperDelegate(T* range, double* rangesSteps, unsigned long numRanges, bool useSmartRounding = true); + AAX_CRangeTaperDelegate( const AAX_CRangeTaperDelegate& rhs); + AAX_CRangeTaperDelegate& operator=( AAX_CRangeTaperDelegate& rhs ); + + //Virtual Overrides + AAX_CRangeTaperDelegate* Clone() const AAX_OVERRIDE; + T GetMinimumValue() const AAX_OVERRIDE { return mMinValue; } + T GetMaximumValue() const AAX_OVERRIDE { return mMaxValue; } + T ConstrainRealValue(T value) const AAX_OVERRIDE; + T NormalizedToReal(double normalizedValue) const AAX_OVERRIDE; + double RealToNormalized(T realValue) const AAX_OVERRIDE; + +protected: + T Round(double iValue) const; + T SmartRound(double value) const; ///< \todo Document + +private: + T mMinValue; + T mMaxValue; + unsigned long mNumRanges; + std::vector mRanges; + std::vector mRangesSteps; ///< \todo Document + std::vector mRangesPercents; ///< \todo Document + std::vector mRangesStepsCount; ///< \todo Document + bool mUseSmartRounding; +}; + +template +AAX_CRangeTaperDelegate::AAX_CRangeTaperDelegate(T* ranges, double* rangesSteps, unsigned long numRanges, bool useSmartRounding) : + AAX_ITaperDelegate(), + mMinValue(*ranges), + mMaxValue(*(ranges + numRanges)), + mNumRanges(numRanges), + mRanges( ranges, ranges + numRanges + 1), + mRangesSteps( rangesSteps, rangesSteps + numRanges), + mUseSmartRounding( useSmartRounding ) +{ + mRangesStepsCount.reserve(mNumRanges); + mRangesPercents.reserve(mNumRanges); + unsigned int i = 0; + for (; i < mNumRanges; i++) + { + mRangesStepsCount.push_back( (mRanges.at(i + 1) - mRanges.at(i)) / mRangesSteps.at(i)); + } + double numSteps = 0; + for (i = 0; i < mNumRanges; i++) + { + numSteps += mRangesStepsCount.at(i); + } + for (i = 0; i < mNumRanges; i++) + { + mRangesPercents.push_back( mRangesStepsCount.at(i) / numSteps ); + } +} + +template +AAX_CRangeTaperDelegate::AAX_CRangeTaperDelegate( const AAX_CRangeTaperDelegate& rhs) : + mMinValue(rhs.mMinValue), + mMaxValue(rhs.mMaxValue), + mNumRanges(rhs.mNumRanges), + mRanges( rhs.mRanges.begin(), rhs.mRanges.end()), + mRangesSteps( rhs.mRangesSteps.begin(), rhs.mRangesSteps.end()), + mRangesPercents( rhs.mRangesPercents.begin(), rhs.mRangesPercents.end()), + mRangesStepsCount( rhs.mRangesStepsCount.begin(), rhs.mRangesStepsCount.end()), + mUseSmartRounding( rhs.mUseSmartRounding ) +{ +} + +template +AAX_CRangeTaperDelegate& AAX_CRangeTaperDelegate::operator=( AAX_CRangeTaperDelegate& rhs) +{ + if (this == &rhs) + return *this; + + this->mMinValue = rhs.mMinValue; + this->mMaxValue = rhs.mMaxValue; + this->mNumRanges = rhs.mNumRanges; + this->mRanges.assign( rhs.mRanges.begin(), rhs.mRanges.end()); + this->mRangesSteps.assign( rhs.mRangesSteps.begin(), rhs.mRangesSteps.end()); + this->mRangesPercents.assign( rhs.mRangesPercents.begin(), rhs.mRangesPercents.end()); + this->mRangesStepsCount.assign( rhs.mRangesStepsCount.begin(), rhs.mRangesStepsCount.end()); + + return *this; +} + +template +T AAX_CRangeTaperDelegate::Round(double iValue) const +{ + return ((0 >= RealPrecision) ? static_cast(iValue) : + (0 <= iValue) ? static_cast(floor( iValue*RealPrecision + 0.5f ) / RealPrecision) : + static_cast(ceil( iValue*RealPrecision - 0.5f ) / RealPrecision) + ); +} + +template +AAX_CRangeTaperDelegate* AAX_CRangeTaperDelegate::Clone() const +{ + return new AAX_CRangeTaperDelegate(*this); +} + +template +T AAX_CRangeTaperDelegate::ConstrainRealValue(T value) const +{ + if (mMinValue == mMaxValue) + return mMinValue; + + if (RealPrecision) + value = Round(value); //reduce the precision to get proper rounding behavior with integers. + + const T& highValue = mMaxValue > mMinValue ? mMaxValue : mMinValue; + const T& lowValue = mMaxValue > mMinValue ? mMinValue : mMaxValue; + + if (value > highValue) + return highValue; + if (value < lowValue) + return lowValue; + + return value; +} + +template +T AAX_CRangeTaperDelegate::NormalizedToReal(double normalizedValue) const +{ + double percentTotal = normalizedValue; + + double percent = 0.0; + unsigned long i = 0; + for (; i < mNumRanges; i++) + { + if ((percentTotal >= percent) && (percentTotal < (percent + mRangesPercents.at( i ) ))) + break; + percent += mRangesPercents.at( i ); + } + + double extValue; + if (i == mNumRanges) + extValue = mMaxValue; // our control is 100% of maximum + else + extValue = mRanges.at(i) + ((mRanges.at(i+1) - mRanges.at(i))*(percentTotal - percent)) / (mRangesPercents.at(i)); + + T realValue = T(extValue); + if ( mUseSmartRounding ) + realValue = SmartRound(extValue); //reduce the precision to get proper rounding behavior with integers. + + return ConstrainRealValue(realValue); +} + +template +double AAX_CRangeTaperDelegate::RealToNormalized(T realValue) const +{ + realValue = ConstrainRealValue(realValue); + + double percentTotal = 0.0; + unsigned long i = 0; + for (; i < mNumRanges; i++) + { + if ((realValue >= mRanges[i]) && (realValue < mRanges[i+1])) + break; + percentTotal += mRangesPercents[i]; + } + + if (i == mNumRanges) + percentTotal = 1.0; // our control is 100% of maximum + else if (mRanges.at(i + 1) == mRanges.at(i)) + ; // no action; total percent does not change + else + percentTotal += (realValue - mRanges.at(i))/static_cast(mRanges.at(i + 1) - mRanges.at(i)) * mRangesPercents.at(i); + + double normalizedValue = percentTotal; + return normalizedValue; +} + +template +T AAX_CRangeTaperDelegate::SmartRound(double value) const +{ + unsigned long i = 0; + for (; i < mNumRanges; i++) + { + if ((value >= mRanges.at(i)) && (value < mRanges.at(i + 1) )) + break; + if ( i == mNumRanges - 1 ) + break; + } + + int32_t longVal = 0; + if (value >= 0) + longVal = int32_t(floor(value / mRangesSteps.at(i) + 0.5)); + else + longVal = int32_t(ceil(value / mRangesSteps.at(i) - 0.5)); + + return static_cast(static_cast(longVal) * mRangesSteps.at(i)); +} + + +#endif diff --git a/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_CSessionDocumentClient.h b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_CSessionDocumentClient.h new file mode 100644 index 0000000000..9a376dc727 --- /dev/null +++ b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_CSessionDocumentClient.h @@ -0,0 +1,154 @@ +/*================================================================================================*/ +/* + * + * Copyright 2023-2024 Avid Technology, Inc. + * All rights reserved. + * + * This file is part of the Avid AAX SDK. + * + * The AAX SDK is subject to commercial or open-source licensing. + * + * By using the AAX SDK, you agree to the terms of both the Avid AAX SDK License + * Agreement and Avid Privacy Policy. + * + * AAX SDK License: https://developer.avid.com/aax + * Privacy Policy: https://www.avid.com/legal/privacy-policy-statement + * + * Or: You may also use this code under the terms of the GPL v3 (see + * www.gnu.org/licenses). + * + * THE AAX SDK IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER + * EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE + * DISCLAIMED. + * + */ + +/** + * \file AAX_CSessionDocumentClient.h + */ +/*================================================================================================*/ + +#pragma once +#ifndef AAX_CSessionDocumentClient_H +#define AAX_CSessionDocumentClient_H + +#include "AAX_ISessionDocumentClient.h" +#include + +#ifdef __clang__ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wunused-parameter" +#endif + +class AAX_IController; +class AAX_IEffectParameters; +class AAX_ISessionDocument; +class AAX_VSessionDocument; + + +/** @brief Default implementation of the \ref AAX_ISessionDocumentClient interface. +*/ +class AAX_CSessionDocumentClient : public AAX_ISessionDocumentClient +{ +public: ///////////////////////////////////////////////////////////////////////////// AAX_CSessionDocumentClient + + AAX_CSessionDocumentClient(void); + ~AAX_CSessionDocumentClient(void) AAX_OVERRIDE; + +public: ///////////////////////////////////////////////////////////////////////////// AAX_ISessionDocumentClient + + /** @name Initialization and uninitialization + */ + //@{ + /** + * \copydoc AAX_IACFSessionDocumentClient::Initialize() + */ + AAX_Result Initialize (IACFUnknown * iUnknown) AAX_OVERRIDE; + /** + * \copydoc AAX_IACFSessionDocumentClient::Uninitialize() + */ + AAX_Result Uninitialize (void) AAX_OVERRIDE; + //@}end Initialization and uninitialization + + /** @name Session document access + */ + //@{ + /** + * \copydoc AAX_IACFSessionDocumentClient::SetSessionDocument() + */ + AAX_Result SetSessionDocument(IACFUnknown * iSessionDocument) AAX_OVERRIDE; + //@}end Session document access + + /** @name %AAX host and plug-in event notification + */ + //@{ + /** + * \copydoc AAX_IACFSessionDocumentClient::NotificationReceived() + */ + AAX_Result NotificationReceived(/* AAX_ENotificationEvent */ AAX_CTypeID /*inNotificationType*/, const void * /*inNotificationData*/, uint32_t /*inNotificationDataSize*/) AAX_OVERRIDE { return AAX_SUCCESS; } + //@}end %AAX host and plug-in event notification + +protected: ///////////////////////////////////////////////////////////////////////////// AAX_CSessionDocumentClient + + /** @name Session document change notifications + */ + //@{ + /** + * \brief The session document interface is about to be added, replaced, + * or removed. + * + * \details + * Custom implementations should stop using the current session document + * interface, which is about to become invalid. + */ + virtual AAX_Result SessionDocumentWillChange() { return AAX_SUCCESS; } + /** + * \brief The session document interface has been added, replaced, or + * removed. + * + * \details + * Custom implementations should update local references to the + * session document interface. + */ + virtual AAX_Result SessionDocumentChanged() { return AAX_SUCCESS; } + //@}end Session document change notifications + + /** @name Private member accessors + */ + //@{ + /*! + * \brief Retrieves a reference to the plug-in's controller interface + * + */ + AAX_IController* GetController (void); + const AAX_IController* GetController (void) const; ///< \copydoc AAX_CSessionDocumentClient::GetController() + + /*! + * \brief Retrieves a reference to the plug-in's data model interface + * + */ + AAX_IEffectParameters* GetEffectParameters (void); + const AAX_IEffectParameters* GetEffectParameters (void) const; ///< \copydoc AAX_CSessionDocumentClient::GetEffectParameters() + + /*! + * \brief Retrieves a reference to the session document interface + * + */ + std::shared_ptr GetSessionDocument (void); + std::shared_ptr GetSessionDocument (void) const; ///< \copydoc AAX_CSessionDocumentClient::GetSessionDocument() + //@}end Private member accessors + +private: + void ClearInternalState(); + + //These are private, but they all have protected accessors. + AAX_UNIQUE_PTR(AAX_IController) mController; + AAX_IEffectParameters * mEffectParameters; + std::shared_ptr mSessionDocument; +}; + +#ifdef __clang__ +#pragma clang diagnostic pop +#endif + +#endif // AAX_CSessionDocumentClient diff --git a/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_CStateDisplayDelegate.h b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_CStateDisplayDelegate.h new file mode 100644 index 0000000000..8f9ab75051 --- /dev/null +++ b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_CStateDisplayDelegate.h @@ -0,0 +1,267 @@ +/*================================================================================================*/ +/* + * + * Copyright 2014-2017, 2019, 2023-2024 Avid Technology, Inc. + * All rights reserved. + * + * This file is part of the Avid AAX SDK. + * + * The AAX SDK is subject to commercial or open-source licensing. + * + * By using the AAX SDK, you agree to the terms of both the Avid AAX SDK License + * Agreement and Avid Privacy Policy. + * + * AAX SDK License: https://developer.avid.com/aax + * Privacy Policy: https://www.avid.com/legal/privacy-policy-statement + * + * Or: You may also use this code under the terms of the GPL v3 (see + * www.gnu.org/licenses). + * + * THE AAX SDK IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER + * EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE + * DISCLAIMED. + * + */ + +/** + * \file AAX_CStateDisplayDelegate.h + * + * \brief A state display delegate. + * + */ +/*================================================================================================*/ + + +#ifndef AAX_CSTATEDISPLAYDELEGATE_H +#define AAX_CSTATEDISPLAYDELEGATE_H + +#include "AAX_IDisplayDelegate.h" +#include "AAX_CString.h" + +#include +#if defined(WINDOWS_VERSION) || defined(LINUX_VERSION) +#include +#endif + + + +/** \brief A generic display format conforming to AAX_IDisplayDelegate + + \details + This display delegate is similar to AAX_CNumberDisplayDelegate, but does not include + precision or spacing templatizations. + + \ingroup DisplayDelegates + + */ +template +class AAX_CStateDisplayDelegate : public AAX_IDisplayDelegate +{ +public: + /** \brief Constructor taking a vector of C strings + + Each state name will be copied into the display delegate; the C strings + may be disposed after construction. + + \note \c iStateStrings must be NULL-terminated + */ + explicit AAX_CStateDisplayDelegate( const char * iStateStrings[], T iMinState = 0 ); + + /** \brief Constructor taking a vector of C strings + + Each state name will be copied into the display delegate; the C strings + may be disposed after construction. + + State strings will be copied into the display delegate until either a + NULL pointer is encountered or \c inNumStates strings have been copied + */ + explicit AAX_CStateDisplayDelegate( int32_t inNumStates, const char * iStateStrings[], T iMinState = 0 ); + + /** \brief Constructor taking a vector of \ref AAX_IString objects. + + Each \ref AAX_IString will be copied into the display delegate and may be + disposed after construction. The \ref AAX_IString will not be mutated. + */ + explicit AAX_CStateDisplayDelegate( const std::vector& iStateStrings, T iMinState = 0 ); + + AAX_CStateDisplayDelegate(const AAX_CStateDisplayDelegate& other); + + //Virtual Overrides + AAX_IDisplayDelegate* Clone() const AAX_OVERRIDE; + bool ValueToString(T value, AAX_CString* valueString) const AAX_OVERRIDE; + bool ValueToString(T value, int32_t maxNumChars, AAX_CString* valueString) const AAX_OVERRIDE; + bool StringToValue(const AAX_CString& valueString, T* value) const AAX_OVERRIDE; + + //AAX_CStateDisplayDelegate + void AddShortenedStrings( const char * iStateStrings[], int iLength ); + bool Compare( const AAX_CString& valueString, const AAX_CString& stateString ) const; + +private: + AAX_CStateDisplayDelegate(); //private contructor to prevent its use externally. + + T mMinState; + std::vector mStateStrings; + + struct StringTable + { + int mStrLength; + std::vector mStateStrings; + }; + static bool StringTableSortFunc(struct StringTable i, struct StringTable j) + { + return (i.mStrLength < j.mStrLength); + } + + std::vector mShortenedStrings; +}; + +template +AAX_CStateDisplayDelegate::AAX_CStateDisplayDelegate( const char * iStateStrings[], T iMinState /* = 0 */ ) +{ + mMinState = iMinState; + for ( int index = 0; iStateStrings[ index ] != 0; ++index ) + mStateStrings.push_back( AAX_CString( iStateStrings[ index ] ) ); +} + +template +AAX_CStateDisplayDelegate::AAX_CStateDisplayDelegate( int32_t inNumStates, const char * iStateStrings[], T iMinState /* = 0 */ ) +{ + mMinState = iMinState; + for ( int index = 0; (index < inNumStates) && (iStateStrings[ index ] != 0); ++index ) + mStateStrings.push_back( AAX_CString( iStateStrings[ index ] ) ); +} + +template +AAX_CStateDisplayDelegate::AAX_CStateDisplayDelegate( const std::vector& iStateStrings, T iMinState /* = 0 */ ) +{ + mMinState = iMinState; + for ( std::vector::const_iterator iter = iStateStrings.begin(); iter != iStateStrings.end(); ++iter ) + { + if (*iter) + { + mStateStrings.push_back( *(*iter) ); + } + } +} + +template +AAX_CStateDisplayDelegate::AAX_CStateDisplayDelegate( const AAX_CStateDisplayDelegate & iOther ) +{ + mMinState = iOther.mMinState; + + std::vector::const_iterator iter = iOther.mStateStrings.begin(); + for ( ; iter != iOther.mStateStrings.end(); ++iter ) + mStateStrings.push_back( AAX_CString( *iter ) ); + + if ( iOther.mShortenedStrings.size() > 0 ) + { + for ( int i = 0; i < (int)iOther.mShortenedStrings.size(); i++ ) + mShortenedStrings.push_back( iOther.mShortenedStrings.at(i) ); + } +} + +template +void AAX_CStateDisplayDelegate::AddShortenedStrings( const char * iStateStrings[], int iStrLength ) +{ + struct StringTable shortendTable; + shortendTable.mStrLength = iStrLength; + for ( int index = 0; iStateStrings[ index ] != 0; ++index ) + shortendTable.mStateStrings.push_back( AAX_CString( iStateStrings[ index ] ) ); + mShortenedStrings.push_back(shortendTable); + + // keep structure sorted by str lengths + std::sort(mShortenedStrings.begin(), mShortenedStrings.end(), AAX_CStateDisplayDelegate::StringTableSortFunc ); +} + +template +AAX_IDisplayDelegate* AAX_CStateDisplayDelegate::Clone() const +{ + return new AAX_CStateDisplayDelegate(*this); +} + +template +bool AAX_CStateDisplayDelegate::ValueToString(T value, AAX_CString* valueString) const +{ + T index = value - mMinState; + if ( index >= (T) 0 && index < (T) mStateStrings.size() ) + { + *valueString = mStateStrings[ index ]; + return true; + } + + return false; +} + +template +bool AAX_CStateDisplayDelegate::ValueToString(T value, int32_t maxNumChars, AAX_CString* valueString) const +{ + // if we don't ahve any shortened strings, just return the full length version + if ( mShortenedStrings.size() == 0 ) + return this->ValueToString(value, valueString); + + // iterate through shortened strings from longest to shortest + // taking the first set that is short enough + T index = value - mMinState; + + if ( index < (T) 0 || index >= (T) mStateStrings.size() ) + return true; + + // first see if the normal string is short enough + if ( mStateStrings[ index ].Length() < uint32_t(maxNumChars) ) + { + *valueString = mStateStrings[ index ]; + return true; + } + + for ( int i = (int)mShortenedStrings.size()-1; i >= 0; i-- ) + { + struct StringTable shortStrings = mShortenedStrings.at(i); + if ( shortStrings.mStrLength <= maxNumChars ) + { + if ( index >= (T) 0 && index < (T) shortStrings.mStateStrings.size() ) + { + *valueString = shortStrings.mStateStrings[ index ]; + return true; + } + } + } + + // if we can't find one short enough, just use the shortest version we can find + struct StringTable shortestStrings = mShortenedStrings.at(0); + if ( index >= (T) 0 && index < (T) shortestStrings.mStateStrings.size() ) + { + *valueString = shortestStrings.mStateStrings[ index ]; + return true; + } + + return false; +} + +template +bool AAX_CStateDisplayDelegate::StringToValue(const AAX_CString& valueString, T* value) const +{ + std::vector::const_iterator iter = mStateStrings.begin(); + for ( T index = 0; iter != mStateStrings.end(); ++index, ++iter ) + { + if (Compare(valueString,*iter)) + { + *value = index + mMinState; + return true; + } + } + + *value = mMinState; + return false; +} + +template +bool AAX_CStateDisplayDelegate::Compare( const AAX_CString& valueString, const AAX_CString& stateString ) const +{ + return valueString==stateString; +} + + + + + +#endif //AAX_CSTATEDISPLAYDELEGATE_H diff --git a/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_CStateTaperDelegate.h b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_CStateTaperDelegate.h new file mode 100644 index 0000000000..65746559f2 --- /dev/null +++ b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_CStateTaperDelegate.h @@ -0,0 +1,133 @@ +/*================================================================================================*/ +/* + * + * Copyright 2014-2017, 2019, 2023-2024 Avid Technology, Inc. + * All rights reserved. + * + * This file is part of the Avid AAX SDK. + * + * The AAX SDK is subject to commercial or open-source licensing. + * + * By using the AAX SDK, you agree to the terms of both the Avid AAX SDK License + * Agreement and Avid Privacy Policy. + * + * AAX SDK License: https://developer.avid.com/aax + * Privacy Policy: https://www.avid.com/legal/privacy-policy-statement + * + * Or: You may also use this code under the terms of the GPL v3 (see + * www.gnu.org/licenses). + * + * THE AAX SDK IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER + * EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE + * DISCLAIMED. + * + */ + +/** + * \file AAX_CStateTaperDelegate.h + * + * \brief A state taper delegate (similar to a linear taper delegate.) + * + */ +/*================================================================================================*/ + + +#ifndef AAX_CSTATETAPERDELEGATE_H +#define AAX_CSTATETAPERDELEGATE_H + +#include "AAX_ITaperDelegate.h" +#include "AAX.h" //for types + +#include //for floor() + + +/** \brief A linear taper conforming to AAX_ITaperDelegate + + \details + This taper spaces a parameter's real values evenly between its minimum and maximum, with a + linear mapping between the parameter's real and normalized values. It is essentially a + version of AAX_CLinearTaperDelegate without that class' additional RealPrecision + templatization. + + \ingroup TaperDelegates + + */ +template +class AAX_CStateTaperDelegate : public AAX_ITaperDelegate +{ +public: + /** \brief Constructs a State Taper with specified minimum and maximum values. + * + * \note The parameter's default value should lie within the min to max range. + * + * \param[in] minValue + * \param[in] maxValue + */ + AAX_CStateTaperDelegate(T minValue=0, T maxValue=1); + + //Virtual Overrides + AAX_CStateTaperDelegate* Clone() const AAX_OVERRIDE; + T GetMinimumValue() const AAX_OVERRIDE { return mMinValue; } + T GetMaximumValue() const AAX_OVERRIDE { return mMaxValue; } + T ConstrainRealValue(T value) const AAX_OVERRIDE; + T NormalizedToReal(double normalizedValue) const AAX_OVERRIDE; + double RealToNormalized(T realValue) const AAX_OVERRIDE; + +private: + T mMinValue; + T mMaxValue; +}; + +template +AAX_CStateTaperDelegate::AAX_CStateTaperDelegate(T minValue, T maxValue) : AAX_ITaperDelegate(), + mMinValue(minValue), + mMaxValue(maxValue) +{ + +} + +template +AAX_CStateTaperDelegate* AAX_CStateTaperDelegate::Clone() const +{ + return new AAX_CStateTaperDelegate(*this); +} + +template +T AAX_CStateTaperDelegate::ConstrainRealValue(T value) const +{ + if (mMinValue == mMaxValue) + return mMinValue; + + const T& highValue = mMaxValue > mMinValue ? mMaxValue : mMinValue; + const T& lowValue = mMaxValue > mMinValue ? mMinValue : mMaxValue; + + if (value > highValue) + return highValue; + if (value < lowValue) + return lowValue; + + return value; +} + +template +T AAX_CStateTaperDelegate::NormalizedToReal(double normalizedValue) const +{ + double doubleRealValue = normalizedValue * (double(mMaxValue) - double(mMinValue)) + double(mMinValue); + if ( doubleRealValue >= 0 ) + doubleRealValue += 0.5; + else doubleRealValue -= 0.5; + return ConstrainRealValue(static_cast(doubleRealValue)); +} + +template +double AAX_CStateTaperDelegate::RealToNormalized(T realValue) const +{ + realValue = ConstrainRealValue(realValue); + double normalizedValue = (mMaxValue == mMinValue) ? 0.5 : (double(realValue) - double(mMinValue)) / (double(mMaxValue) - double(mMinValue)); + return normalizedValue; +} + + + + +#endif //AAX_CSTATETAPERDELEGATE_H diff --git a/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_CString.h b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_CString.h new file mode 100644 index 0000000000..8cd19fa91d --- /dev/null +++ b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_CString.h @@ -0,0 +1,227 @@ +/*================================================================================================*/ +/* + * + * Copyright 2013-2015, 2017, 2021, 2023-2024 Avid Technology, Inc. + * All rights reserved. + * + * This file is part of the Avid AAX SDK. + * + * The AAX SDK is subject to commercial or open-source licensing. + * + * By using the AAX SDK, you agree to the terms of both the Avid AAX SDK License + * Agreement and Avid Privacy Policy. + * + * AAX SDK License: https://developer.avid.com/aax + * Privacy Policy: https://www.avid.com/legal/privacy-policy-statement + * + * Or: You may also use this code under the terms of the GPL v3 (see + * www.gnu.org/licenses). + * + * THE AAX SDK IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER + * EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE + * DISCLAIMED. + * + */ + +/** + * \file AAX_CString.h + * + * \brief A generic %AAX string class with similar functionality to std::string + * + */ +/*================================================================================================*/ + +#pragma once + +#ifndef AAX_CSTRING_H +#define AAX_CSTRING_H + + +#include "AAX_IString.h" +#include "AAX.h" + +#include +#include + + +/////////////////////////////////////////////////////////////// +#if 0 +#pragma mark - +#endif +/////////////////////////////////////////////////////////////// + +/** + * \brief A generic %AAX string class with similar functionality to std::string + */ +class AAX_CString : public AAX_IString +{ +public: + static const uint32_t kInvalidIndex = static_cast(-1); + static const uint32_t kMaxStringLength = static_cast(-2); + + // AAX_IString Virtual Overrides + uint32_t Length() const AAX_OVERRIDE; + uint32_t MaxLength() const AAX_OVERRIDE; + const char * Get () const AAX_OVERRIDE; + void Set ( const char * iString ) AAX_OVERRIDE; + AAX_IString & operator=(const AAX_IString & iOther) AAX_OVERRIDE; + AAX_IString & operator=(const char * iString) AAX_OVERRIDE; + + /** Constructs an empty string. */ + AAX_CString(); + + /** Implicit conversion constructor: Constructs a string with a const char* pointer to copy. */ + AAX_CString(const char* str); + + /** Copy constructor: Constructs a string from a std::string. Beware of STL variations across various binaries. */ + explicit AAX_CString(const std::string& str); + + /** Copy constructor: Constructs a string with another concrete AAX_CString. */ + AAX_CString(const AAX_CString& other); + + /** Copy constructor: Constructs a string from another string that meets the AAX_IString interface. */ + AAX_CString(const AAX_IString& other); + + /** Default move constructor */ + AAX_DEFAULT_MOVE_CTOR(AAX_CString); + + + /** Direct access to a std::string. */ + std::string& StdString(); + + /** Direct access to a const std::string. */ + const std::string& StdString() const; + + /** Assignment operator from another AAX_CString */ + AAX_CString& operator=(const AAX_CString& other); + + /** Assignment operator from a std::string. Beware of STL variations across various binaries. */ + AAX_CString & operator=(const std::string& other); + + /** Move operator */ + AAX_CString & operator=(AAX_CString&& other); + + /** output stream operator for concrete AAX_CString */ + friend std::ostream& operator<< (std::ostream& os, const AAX_CString& str); + + /** input stream operator for concrete AAX_CString */ + friend std::istream& operator>> (std::istream& os, AAX_CString& str); + + + // String Formatting Functions + void Clear(); + bool Empty() const; + AAX_CString& Erase(uint32_t pos, uint32_t n); + AAX_CString& Append(const AAX_CString& str); + AAX_CString& Append(const char* str); + AAX_CString& AppendNumber(double number, int32_t precision); + AAX_CString& AppendNumber(int32_t number); + AAX_CString& AppendHex(int32_t number, int32_t width); + AAX_CString& Insert(uint32_t pos, const AAX_CString& str); + AAX_CString& Insert(uint32_t pos, const char* str); + AAX_CString& InsertNumber(uint32_t pos, double number, int32_t precision); + AAX_CString& InsertNumber(uint32_t pos, int32_t number); + AAX_CString& InsertHex(uint32_t pos, int32_t number, int32_t width); + AAX_CString& Replace(uint32_t pos, uint32_t n, const AAX_CString& str); + AAX_CString& Replace(uint32_t pos, uint32_t n, const char* str); + uint32_t FindFirst(const AAX_CString& findStr) const; + uint32_t FindFirst(const char* findStr) const; + uint32_t FindFirst(char findChar) const; + uint32_t FindLast(const AAX_CString& findStr) const; + uint32_t FindLast(const char* findStr) const; + uint32_t FindLast(char findChar) const; + const char* CString() const; + bool ToDouble(double* oValue) const; + bool ToInteger(int32_t* oValue) const; + void SubString(uint32_t pos, uint32_t n, AAX_IString* outputStr) const; + bool Equals(const AAX_CString& other) const { return operator==(other); } + bool Equals(const char* other) const { return operator==(other); } + bool Equals(const std::string& other) const { return operator==(other); } //beware of STL variations between binaries. + + // Operator Overrides + bool operator==(const AAX_CString& other) const; + bool operator==(const char* otherStr) const; + bool operator==(const std::string& otherStr) const; //beware of STL variations between binaries. + bool operator!=(const AAX_CString& other) const; + bool operator!=(const char* otherStr) const; + bool operator!=(const std::string& otherStr) const; //beware of STL variations between binaries. + bool operator<(const AAX_CString& other) const; + bool operator>(const AAX_CString& other) const; + const char& operator[](uint32_t index) const; + char& operator[](uint32_t index); + AAX_CString& operator+=(const AAX_CString& str); + AAX_CString& operator+=(const std::string& str); + AAX_CString& operator+=(const char* str); + +protected: + std::string mString; +}; + +// Non-member operators +inline AAX_CString operator+(AAX_CString lhs, const AAX_CString& rhs) +{ + lhs += rhs; + return lhs; +} +inline AAX_CString operator+(AAX_CString lhs, const char* rhs) +{ + lhs += rhs; + return lhs; +} +inline AAX_CString operator+(const char* lhs, const AAX_CString& rhs) +{ + return AAX_CString(lhs) + rhs; +} + + +/////////////////////////////////////////////////////////////// +#if 0 +#pragma mark - +#endif +/////////////////////////////////////////////////////////////// + +/** \brief Helper class to store a collection of name abbreviations + */ +class AAX_CStringAbbreviations +{ +public: + explicit AAX_CStringAbbreviations(const AAX_CString& inPrimary) + : mPrimary(inPrimary) + , mAbbreviations() + { + } + + void SetPrimary(const AAX_CString& inPrimary) { mPrimary = inPrimary; } + const AAX_CString& Primary() const { return mPrimary; } + + void Add(const AAX_CString& inAbbreviation) + { + uint32_t stringLength = inAbbreviation.Length(); + mAbbreviations[stringLength] = inAbbreviation; //Does a string copy into the map. + } + + const AAX_CString& Get(int32_t inNumCharacters) const + { + //More characters than the primary string or no specific shortened names. + if ((inNumCharacters >= int32_t(mPrimary.Length())) || (mAbbreviations.empty()) || (0 > inNumCharacters)) + return mPrimary; + + std::map::const_iterator iter = mAbbreviations.upper_bound(static_cast(inNumCharacters)); + + //If the iterator is already pointing to shortest string, return that. + if (iter == mAbbreviations.begin()) + return iter->second; + + //lower_bound() will return the iterator that is larger than the desired value, so decrement the iterator. + --iter; + return iter->second; + } + + void Clear() { mAbbreviations.clear(); } + +private: + AAX_CString mPrimary; + std::map mAbbreviations; +}; + +#endif //AAX_CSTRING_H diff --git a/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_CStringDataBuffer.h b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_CStringDataBuffer.h new file mode 100644 index 0000000000..4745c7db28 --- /dev/null +++ b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_CStringDataBuffer.h @@ -0,0 +1,134 @@ +/*================================================================================================*/ +/* + * + * Copyright 2023-2024 Avid Technology, Inc. + * All rights reserved. + * + * This file is part of the Avid AAX SDK. + * + * The AAX SDK is subject to commercial or open-source licensing. + * + * By using the AAX SDK, you agree to the terms of both the Avid AAX SDK License + * Agreement and Avid Privacy Policy. + * + * AAX SDK License: https://developer.avid.com/aax + * Privacy Policy: https://www.avid.com/legal/privacy-policy-statement + * + * Or: You may also use this code under the terms of the GPL v3 (see + * www.gnu.org/licenses). + * + * THE AAX SDK IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER + * EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE + * DISCLAIMED. + * + */ + +/** + * \file AAX_CStringDataBuffer.h + */ +/*================================================================================================*/ + +#pragma once + +#ifndef AAX_CStringDataBuffer_H +#define AAX_CStringDataBuffer_H + +#include "AAX_IDataBuffer.h" +#include "AAX.h" + +#include +#include +#include + + +/** + * \brief A convenience class for string data buffers + * + * The data payload is a \c char* C string + */ +template +class AAX_CStringDataBufferOfType : public AAX_IDataBuffer +{ +public: + explicit AAX_CStringDataBufferOfType (std::string const & inData) : mData{inData} {} + explicit AAX_CStringDataBufferOfType (std::string && inData) : mData{inData} {} + explicit AAX_CStringDataBufferOfType (const char * inData) : mData{inData ? std::string{inData} : std::string{}} {} + + AAX_CStringDataBufferOfType(AAX_CStringDataBufferOfType const &) = delete; + AAX_CStringDataBufferOfType(AAX_CStringDataBufferOfType &&) = delete; + + ~AAX_CStringDataBufferOfType (void) AAX_OVERRIDE = default; + + AAX_CStringDataBufferOfType& operator= (AAX_CStringDataBufferOfType const & other) = delete; + AAX_CStringDataBufferOfType& operator= (AAX_CStringDataBufferOfType && other) = delete; + + AAX_Result Type(AAX_CTypeID * oType) const AAX_OVERRIDE { + if (!oType) { return AAX_ERROR_NULL_ARGUMENT; } + *oType = T; + return AAX_SUCCESS; + } + AAX_Result Size(int32_t * oSize) const AAX_OVERRIDE { + if (!oSize) { return AAX_ERROR_NULL_ARGUMENT; } + auto const size = mData.size() + 1; // null termination + static_assert(std::numeric_limits::max() >= std::numeric_limits::type>::max(), + "size variable may not represent all positive values of oSize"); + if (size > std::numeric_limits::type>::max()) { + return AAX_ERROR_SIGNED_INT_OVERFLOW; + } + *oSize = static_cast::type>(size); + return AAX_SUCCESS; + } + AAX_Result Data(void const ** oBuffer) const AAX_OVERRIDE { + if (!oBuffer) { return AAX_ERROR_NULL_ARGUMENT; } + *oBuffer = mData.c_str(); + return AAX_SUCCESS; + } +private: + std::string mData; +}; + +/** + * \copydoc AAX_CStringDataBufferOfType + */ +class AAX_CStringDataBuffer : public AAX_IDataBuffer +{ +public: + AAX_CStringDataBuffer (AAX_CTypeID inType, std::string const & inData) : mType{inType}, mData{inData} {} + AAX_CStringDataBuffer (AAX_CTypeID inType, std::string && inData) : mType{inType}, mData{inData} {} + AAX_CStringDataBuffer (AAX_CTypeID inType, const char * inData) : mType{inType}, mData{inData ? std::string{inData} : std::string{}} {} + + AAX_CStringDataBuffer(AAX_CStringDataBuffer const &) = delete; + AAX_CStringDataBuffer(AAX_CStringDataBuffer &&) = delete; + + ~AAX_CStringDataBuffer (void) AAX_OVERRIDE = default; + + AAX_CStringDataBuffer& operator= (AAX_CStringDataBuffer const & other) = delete; + AAX_CStringDataBuffer& operator= (AAX_CStringDataBuffer && other) = delete; + + AAX_Result Type(AAX_CTypeID * oType) const AAX_OVERRIDE { + if (!oType) { return AAX_ERROR_NULL_ARGUMENT; } + *oType = mType; + return AAX_SUCCESS; + } + AAX_Result Size(int32_t * oSize) const AAX_OVERRIDE { + if (!oSize) { return AAX_ERROR_NULL_ARGUMENT; } + auto const size = mData.size() + 1; // null termination + static_assert(std::numeric_limits::max() >= std::numeric_limits::type>::max(), + "size variable may not represent all positive values of oSize"); + if (size > std::numeric_limits::type>::max()) { + return AAX_ERROR_SIGNED_INT_OVERFLOW; + } + *oSize = static_cast::type>(size); + return AAX_SUCCESS; + } + AAX_Result Data(void const ** oBuffer) const AAX_OVERRIDE { + if (!oBuffer) { return AAX_ERROR_NULL_ARGUMENT; } + *oBuffer = mData.c_str(); + return AAX_SUCCESS; + } +private: + AAX_CTypeID const mType; + std::string mData; +}; + +#endif diff --git a/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_CStringDisplayDelegate.h b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_CStringDisplayDelegate.h new file mode 100644 index 0000000000..484114ba6e --- /dev/null +++ b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_CStringDisplayDelegate.h @@ -0,0 +1,147 @@ +/*================================================================================================*/ +/* + * + * Copyright 2014-2017, 2019, 2023-2024 Avid Technology, Inc. + * All rights reserved. + * + * This file is part of the Avid AAX SDK. + * + * The AAX SDK is subject to commercial or open-source licensing. + * + * By using the AAX SDK, you agree to the terms of both the Avid AAX SDK License + * Agreement and Avid Privacy Policy. + * + * AAX SDK License: https://developer.avid.com/aax + * Privacy Policy: https://www.avid.com/legal/privacy-policy-statement + * + * Or: You may also use this code under the terms of the GPL v3 (see + * www.gnu.org/licenses). + * + * THE AAX SDK IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER + * EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE + * DISCLAIMED. + * + */ + +/** + * \file AAX_CStringDisplayDelegate.h + * + * \brief A string display delegate. + * + */ +/*================================================================================================*/ + + +#ifndef AAX_CSTRINGDISPLAYDELEGATE_H +#define AAX_CSTRINGDISPLAYDELEGATE_H + +#include "AAX_IDisplayDelegate.h" +#include +#include + + +/** \brief A string, or list, display format conforming to AAX_IDisplayDelegate + + \details + This display delegate uses a string map to associate parameter values with specific + strings. This kind of display delegate is most often used for control string or + list parameters, which would internally use an integer parameter type. The int value + would then be used as a lookup into this delegate, which would return a string for each + valid int value. + + \ingroup DisplayDelegates + + */ +template +class AAX_CStringDisplayDelegate : public AAX_IDisplayDelegate +{ +public: + /** \brief Constructor + * + * Constructs a String Display Delegate with a provided string map. + * + * \note The string map should + * already be populated with value-string pairs, as this constructor will copy the provided + * map into the delegate object's own memory. + * + * \param[in] stringMap + * A populated map of value-string pairs + */ + AAX_CStringDisplayDelegate(const std::map& stringMap); + + //Virtual Overrides + AAX_CStringDisplayDelegate* Clone() const AAX_OVERRIDE; + bool ValueToString(T value, AAX_CString* valueString) const AAX_OVERRIDE; + bool ValueToString(T value, int32_t maxNumChars, AAX_CString* valueString) const AAX_OVERRIDE; + bool StringToValue(const AAX_CString& valueString, T* value) const AAX_OVERRIDE; + +protected: + std::map mStringMap; + std::map mInverseStringMap; +}; + + + +template +AAX_CStringDisplayDelegate::AAX_CStringDisplayDelegate(const std::map& stringMap) : + AAX_IDisplayDelegate(), + mStringMap(stringMap), + mInverseStringMap() +{ + //Construct an inverse string map from our already copied internal copy of the string map. + //This inverse map is used for stringToValue conversion. + typename std::map::iterator valueStringIterator = mStringMap.begin(); + while ( valueStringIterator != mStringMap.end() ) + { + mInverseStringMap.insert(std::pair(valueStringIterator->second, valueStringIterator->first)); + valueStringIterator++; + } +} + +template +AAX_CStringDisplayDelegate* AAX_CStringDisplayDelegate::Clone() const +{ + return new AAX_CStringDisplayDelegate(*this); +} + +template +bool AAX_CStringDisplayDelegate::ValueToString(T value, AAX_CString* valueString) const +{ + typename std::map::const_iterator mapPairIterator = mStringMap.find(value); + if( mapPairIterator != mStringMap.end() ) + { + *valueString = mapPairIterator->second; + return true; + } + *valueString = AAX_CString("String Not Found"); + return false; +} + +template +bool AAX_CStringDisplayDelegate::ValueToString(T value, int32_t /*maxNumChars*/, AAX_CString* valueString) const +{ + // First, get the full length string. + bool result = this->ValueToString(value, valueString); + + // TODO: Shorten the string based on the number of characters... + + return result; +} + +template +bool AAX_CStringDisplayDelegate::StringToValue(const AAX_CString& valueString, T* value) const +{ + typename std::map::const_iterator mapPairIterator = mInverseStringMap.find(valueString); + if( mapPairIterator != mInverseStringMap.end() ) + { + *value = mapPairIterator->second; + return true; + } + *value = 0; + return false; +} + + + + +#endif //AAX_CSTRINGDISPLAYDELEGATE_H diff --git a/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_CTaskAgent.h b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_CTaskAgent.h new file mode 100644 index 0000000000..aa7f176b2e --- /dev/null +++ b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_CTaskAgent.h @@ -0,0 +1,121 @@ +/*================================================================================================*/ +/* + * + * Copyright 2023-2024 Avid Technology, Inc. + * All rights reserved. + * + * This file is part of the Avid AAX SDK. + * + * The AAX SDK is subject to commercial or open-source licensing. + * + * By using the AAX SDK, you agree to the terms of both the Avid AAX SDK License + * Agreement and Avid Privacy Policy. + * + * AAX SDK License: https://developer.avid.com/aax + * Privacy Policy: https://www.avid.com/legal/privacy-policy-statement + * + * Or: You may also use this code under the terms of the GPL v3 (see + * www.gnu.org/licenses). + * + * THE AAX SDK IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER + * EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE + * DISCLAIMED. + * + */ + +/** + * \file AAX_CTaskAgent.h + * + * \brief A default implementation of the \ref AAX_ITaskAgent interface. + * + */ +/*================================================================================================*/ + + +#ifndef AAX_CTaskAgent_H +#define AAX_CTaskAgent_H + +#include "AAX_ITaskAgent.h" +#include + +class AAX_IController; +class AAX_IEffectParameters; +class AAX_ITask; + +/** @brief Default implementation of the \ref AAX_ITaskAgent interface. + + @details + This class provides a default implementation of the \ref AAX_ITaskAgent interface. + Your plug-in's task agent implementation should inherit from this class and + override the remaining interface functions. + + \ingroup AuxInterface_TaskAgent +*/ +class AAX_CTaskAgent : public AAX_ITaskAgent +{ +public: ///////////////////////////////////////////////////////////////////////////// constructor/destructor + AAX_CTaskAgent (void) = default; + ~AAX_CTaskAgent (void) AAX_OVERRIDE; + +public: ///////////////////////////////////////////////////////////////////////////// AAX_IACFTaskAgent + + /** @name Initialization and uninitialization + */ + //@{ + AAX_Result Initialize (IACFUnknown * iController ) AAX_OVERRIDE; ///< \copydoc AAX_IACFTaskAgent::Initialize() + AAX_Result Uninitialize (void) AAX_OVERRIDE; ///< \copydoc AAX_IACFTaskAgent::Uninitialize() + //@}end Initialization and uninitialization + + /** @name Task management + */ + //@{ + /** + * \brief Default implemenation of AddTask() + * + * \details + * Convenience implementation that converts the \ref IACFUnknown + * into an \ref AAX_ITask . Implementations should override the + * version that provides an \ref AAX_ITask object. + */ + AAX_Result AddTask(IACFUnknown * iTask) AAX_OVERRIDE; + AAX_Result CancelAllTasks() AAX_OVERRIDE; + //@} Task management + +protected: + + /** + * \brief Convenience method for adding versioned tasks + * + * \deprecated Use \ref ReceiveTask() instead + */ + virtual AAX_Result AddTask(std::unique_ptr iTask); + + /** + * \brief Convenience method for adding versioned tasks + */ + virtual AAX_Result ReceiveTask(std::unique_ptr iTask); + +public: ///////////////////////////////////////////////////////////////////////////// AAX_CTaskAgent + + /** @name Private member accessors + */ + //@{ + /*! + * \brief Returns a pointer to the plug-in's controller interface + */ + AAX_IController* GetController (void) { return mController; }; + /*! + * \brief Returns a pointer to the plug-in's data model interface + */ + AAX_IEffectParameters* GetEffectParameters (void) { return mEffectParameters; } + //@}end Private member accessors + +private: + void ReleaseObjects(); + + AAX_IController* mController = nullptr; + AAX_IEffectParameters* mEffectParameters = nullptr; +}; + + +#endif diff --git a/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_CUnitDisplayDelegateDecorator.h b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_CUnitDisplayDelegateDecorator.h new file mode 100644 index 0000000000..b99dea5eb3 --- /dev/null +++ b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_CUnitDisplayDelegateDecorator.h @@ -0,0 +1,139 @@ +/*================================================================================================*/ +/* + * + * Copyright 2013-2017, 2019, 2023-2024 Avid Technology, Inc. + * All rights reserved. + * + * This file is part of the Avid AAX SDK. + * + * The AAX SDK is subject to commercial or open-source licensing. + * + * By using the AAX SDK, you agree to the terms of both the Avid AAX SDK License + * Agreement and Avid Privacy Policy. + * + * AAX SDK License: https://developer.avid.com/aax + * Privacy Policy: https://www.avid.com/legal/privacy-policy-statement + * + * Or: You may also use this code under the terms of the GPL v3 (see + * www.gnu.org/licenses). + * + * THE AAX SDK IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER + * EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE + * DISCLAIMED. + * + */ + +/** + * \file AAX_CUnitDisplayDelegateDecorator.h + * + * \brief A unit display delgate decorator. + * + */ +/*================================================================================================*/ + + +#ifndef AAX_CUNITDISPLAYDELEGATEDECORATOR_H +#define AAX_CUNITDISPLAYDELEGATEDECORATOR_H + +#include "AAX_IDisplayDelegateDecorator.h" + + +/** \brief A unit type decorator conforming to AAX_IDisplayDelegateDecorator + + \details + This class is an \ref AAX_IDisplayDelegateDecorator, meaning that it acts as a wrapper for + other display delegates or concrete display types. For more information about display + delegate decorators in AAX, see \ref displaydelegates_decorators + + The behavior of this class it to decorate parameter value strings with arbitrary units, + such as "Hz" or "V". The inverse is also supported, so the unit string is pulled off of + value strings when they are converted to real parameter values. + + \ingroup AAXLibraryFeatures_ParameterManager_DisplayDelegates_Decorators + +*/ +template +class AAX_CUnitDisplayDelegateDecorator : public AAX_IDisplayDelegateDecorator +{ +public: + /** \brief Constructor + * + * Along with the standard decorator pattern argument, this class also takes a unit string. + * This is the string that will be added to the end of valueString. + * + * \param[in] displayDelegate + * \param[in] unitString + */ + AAX_CUnitDisplayDelegateDecorator(const AAX_IDisplayDelegate& displayDelegate, const AAX_CString& unitString); + + //Virtual Overrides + AAX_CUnitDisplayDelegateDecorator* Clone() const AAX_OVERRIDE; + bool ValueToString(T value, AAX_CString* valueString) const AAX_OVERRIDE; + bool ValueToString(T value, int32_t maxNumChars, AAX_CString* valueString) const AAX_OVERRIDE; + bool StringToValue(const AAX_CString& valueString, T* value) const AAX_OVERRIDE; + +protected: + const AAX_CString mUnitString; +}; + + + + +template +AAX_CUnitDisplayDelegateDecorator::AAX_CUnitDisplayDelegateDecorator(const AAX_IDisplayDelegate& displayDelegate, const AAX_CString& unitString) : + AAX_IDisplayDelegateDecorator(displayDelegate), + mUnitString(unitString) +{ + +} + +template +AAX_CUnitDisplayDelegateDecorator* AAX_CUnitDisplayDelegateDecorator::Clone() const +{ + return new AAX_CUnitDisplayDelegateDecorator(*this); +} + +template +bool AAX_CUnitDisplayDelegateDecorator::ValueToString(T value, AAX_CString* valueString) const +{ + bool succeeded = AAX_IDisplayDelegateDecorator::ValueToString(value, valueString); + *valueString += mUnitString; + return succeeded; +} + +template +bool AAX_CUnitDisplayDelegateDecorator::ValueToString(T value, int32_t maxNumChars, AAX_CString* valueString) const +{ + bool succeeded = AAX_IDisplayDelegateDecorator::ValueToString(value, maxNumChars, valueString); + uint32_t strlen = valueString->Length(); + const uint32_t maxNumCharsUnsigned = (0 <= maxNumChars) ? static_cast(maxNumChars) : 0; + if (maxNumCharsUnsigned > strlen && (maxNumCharsUnsigned-strlen >= mUnitString.Length())) + *valueString += mUnitString; + return succeeded; +} + + +template +bool AAX_CUnitDisplayDelegateDecorator::StringToValue(const AAX_CString& valueString, T* value) const +{ + //Just call through if there is obviously no unit string. + if (valueString.Length() <= mUnitString.Length()) + return AAX_IDisplayDelegateDecorator::StringToValue(valueString, value); + + //Just call through if the end of this string does not match the unit string. + AAX_CString unitSubString; + valueString.SubString(valueString.Length() - mUnitString.Length(), mUnitString.Length(), &unitSubString); + if (unitSubString != mUnitString) + return AAX_IDisplayDelegateDecorator::StringToValue(valueString, value); + + //Call through with the stripped down value string. + AAX_CString valueSubString; + valueString.SubString(0, valueString.Length() - mUnitString.Length(), &valueSubString); + return AAX_IDisplayDelegateDecorator::StringToValue(valueSubString, value); +} + + + + + +#endif //AAX_CUNITDISPLAYDELEGATEDECORATOR_H diff --git a/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_CUnitPrefixDisplayDelegateDecorator.h b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_CUnitPrefixDisplayDelegateDecorator.h new file mode 100644 index 0000000000..349986d647 --- /dev/null +++ b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_CUnitPrefixDisplayDelegateDecorator.h @@ -0,0 +1,224 @@ +/*================================================================================================*/ +/* + * + * Copyright 2014-2017, 2019, 2023-2024 Avid Technology, Inc. + * All rights reserved. + * + * This file is part of the Avid AAX SDK. + * + * The AAX SDK is subject to commercial or open-source licensing. + * + * By using the AAX SDK, you agree to the terms of both the Avid AAX SDK License + * Agreement and Avid Privacy Policy. + * + * AAX SDK License: https://developer.avid.com/aax + * Privacy Policy: https://www.avid.com/legal/privacy-policy-statement + * + * Or: You may also use this code under the terms of the GPL v3 (see + * www.gnu.org/licenses). + * + * THE AAX SDK IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER + * EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE + * DISCLAIMED. + * + */ + +/** + * \file AAX_CUnitPrefixDisplayDelegateDecorator.h + * + * \brief A unit prefix display delegate decorator. + * + */ +/*================================================================================================*/ + + +#ifndef AAX_CUNITPREFIXDISPLAYDELEGATEDECORATOR_H +#define AAX_CUNITPREFIXDISPLAYDELEGATEDECORATOR_H + +#include "AAX_IDisplayDelegateDecorator.h" + + +/** \brief A unit prefix decorator conforming to AAX_IDisplayDelegateDecorator + + \details + This class is an \ref AAX_IDisplayDelegateDecorator, meaning that it acts as a wrapper for + other display delegates or concrete display types. For more information about display + delegate decorators in AAX, see \ref displaydelegates_decorators + + The behavior of this class it to provide unit prefixes such as the k in kHz or the m in + mm. It takes the value passed in and determines if the value is large or small enough to + benefit from a unit modifier. If so, it adds that unit prefix character to the display + string after scaling the number and calling deeper into the decorator pattern to get the + concrete ValueToString() result. + + The inverse is also supported, so if you type 1.5k in a text box and this decorator is in + place, it should find the k and multiply the value by 1000 before converting it to a real + value. + + This decorator supports the following unit prefixes: + \li M (mega-) + \li k (kilo-) + \li m (milli-) + \li u (micro-) + + \note This class is not implemented for integer values as the conversions result in + fractional numbers. Those would get truncated through the system and be pretty much + useless. + + \ingroup AAXLibraryFeatures_ParameterManager_DisplayDelegates_Decorators + +*/ +template +class AAX_CUnitPrefixDisplayDelegateDecorator : public AAX_IDisplayDelegateDecorator +{ +public: + AAX_CUnitPrefixDisplayDelegateDecorator(const AAX_IDisplayDelegate& displayDelegate); + + //Virtual overrides + AAX_CUnitPrefixDisplayDelegateDecorator* Clone() const AAX_OVERRIDE; + bool ValueToString(T value, AAX_CString* valueString) const AAX_OVERRIDE; + bool ValueToString(T value, int32_t maxNumChars, AAX_CString* valueString) const AAX_OVERRIDE; + bool StringToValue(const AAX_CString& valueString, T* value) const AAX_OVERRIDE; +}; + + + +template +AAX_CUnitPrefixDisplayDelegateDecorator::AAX_CUnitPrefixDisplayDelegateDecorator(const AAX_IDisplayDelegate& displayDelegate) : + AAX_IDisplayDelegateDecorator(displayDelegate) +{ + +} + + +template +AAX_CUnitPrefixDisplayDelegateDecorator* AAX_CUnitPrefixDisplayDelegateDecorator::Clone() const +{ + return new AAX_CUnitPrefixDisplayDelegateDecorator(*this); +} + +template +bool AAX_CUnitPrefixDisplayDelegateDecorator::ValueToString(T value, AAX_CString* valueString) const +{ + //Find the proper unit prefix. + T absValue = fabsf(float(value)); //If you fail to compile on this line, you're trying to use this class with an integer type, which is not supported. + if (absValue >= 1000000.0) + { + value = value / ((T) 1000000.0); + bool succeeded = AAX_IDisplayDelegateDecorator::ValueToString(value, valueString); + *valueString += AAX_CString("M"); + return succeeded; + } + if (absValue >= ((T) 1000.0)) + { + value = value / ((T) 1000.0); + bool succeeded = AAX_IDisplayDelegateDecorator::ValueToString(value, valueString); + *valueString += AAX_CString("k"); + return succeeded; + } + if (absValue >= ((T) 1.0)) + { + return AAX_IDisplayDelegateDecorator::ValueToString(value, valueString); + } + if (absValue >= ((T) 0.001)) + { + value = value / ((T) 0.001); + bool succeeded = AAX_IDisplayDelegateDecorator::ValueToString(value, valueString); + *valueString += AAX_CString("m"); + return succeeded; + } + if (absValue >= ((T) 0.000001)) + { + value = value / ((T) 0.000001); + bool succeeded = AAX_IDisplayDelegateDecorator::ValueToString(value, valueString); + *valueString += AAX_CString("u"); + return succeeded; + } + return AAX_IDisplayDelegateDecorator::ValueToString(value, valueString); +} + +template +bool AAX_CUnitPrefixDisplayDelegateDecorator::ValueToString(T value, int32_t maxNumChars, AAX_CString* valueString) const +{ + //Find the proper unit prefix. + // The maxNumChars is decremented by 1 in case of the unit modifier being required as this is more important than precision. + + T absValue = fabsf(float(value)); //If you fail to compile on this line, you're trying to use this class with an integer type, which is not supported. + if (absValue >= 1000000.0) + { + value = value / ((T) 1000000.0); + bool succeeded = AAX_IDisplayDelegateDecorator::ValueToString(value, maxNumChars-1, valueString); + *valueString += AAX_CString("M"); + return succeeded; + } + if (absValue >= ((T) 1000.0)) + { + value = value / ((T) 1000.0); + bool succeeded = AAX_IDisplayDelegateDecorator::ValueToString(value, maxNumChars-1, valueString); + *valueString += AAX_CString("k"); + return succeeded; + } + if (absValue >= ((T) 1.0)) + { + return AAX_IDisplayDelegateDecorator::ValueToString(value, maxNumChars, valueString); + } + if (absValue >= ((T) 0.001)) + { + value = value / ((T) 0.001); + bool succeeded = AAX_IDisplayDelegateDecorator::ValueToString(value, maxNumChars-1, valueString); + *valueString += AAX_CString("m"); + return succeeded; + } + if (absValue >= ((T) 0.000001)) + { + value = value / ((T) 0.000001); + bool succeeded = AAX_IDisplayDelegateDecorator::ValueToString(value, maxNumChars-1, valueString); + *valueString += AAX_CString("u"); + return succeeded; + } + return AAX_IDisplayDelegateDecorator::ValueToString(value, maxNumChars, valueString); +} + + +template +bool AAX_CUnitPrefixDisplayDelegateDecorator::StringToValue(const AAX_CString& valueString, T* value) const +{ + //Just call through if there is obviously no unit string. + if (valueString.Length() <= 1) + return AAX_IDisplayDelegateDecorator::StringToValue(valueString, value); + + //Just call through if the end of this string does not match the unit string. + AAX_CString valueStringCopy(valueString); + T valueScalar = 1; + T valueDivScalar = 1; + switch(valueString[valueString.Length()-1]) + { + case 'M': + valueScalar = ((T) 1000000.0); + valueStringCopy.Erase(valueString.Length()-1, 1); + break; + case 'k': + valueScalar = ((T) 1000.0); + valueStringCopy.Erase(valueString.Length()-1, 1); + break; + case 'm': + valueScalar = ((T) 0.001); + valueStringCopy.Erase(valueString.Length()-1, 1); + break; + case 'u': + // Rounding errors occur when trying to use 0.000001 so went to a div scalar instead. + // See bug https://audio-jira.avid.com/browse/PTSW-149426. + valueDivScalar = ((T) 1000000.0); + valueStringCopy.Erase(valueString.Length()-1, 1); + break; + } + + bool success = AAX_IDisplayDelegateDecorator::StringToValue(valueStringCopy, value); + *value = valueScalar * (*value); + *value = (*value) / valueDivScalar; + return success; +} + + + +#endif //AAX_CUNITPREFIXDISPLAYDELEGATEDECORATOR diff --git a/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_Callbacks.h b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_Callbacks.h new file mode 100644 index 0000000000..06adf250ac --- /dev/null +++ b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_Callbacks.h @@ -0,0 +1,208 @@ +/*================================================================================================*/ +/* + * + * Copyright 2014-2017, 2023-2024 Avid Technology, Inc. + * All rights reserved. + * + * This file is part of the Avid AAX SDK. + * + * The AAX SDK is subject to commercial or open-source licensing. + * + * By using the AAX SDK, you agree to the terms of both the Avid AAX SDK License + * Agreement and Avid Privacy Policy. + * + * AAX SDK License: https://developer.avid.com/aax + * Privacy Policy: https://www.avid.com/legal/privacy-policy-statement + * + * Or: You may also use this code under the terms of the GPL v3 (see + * www.gnu.org/licenses). + * + * THE AAX SDK IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER + * EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE + * DISCLAIMED. + * + */ + +/** + * \file AAX_Callbacks.h + * + * \brief %AAX callback prototypes and ProcPtr definitions + * + */ +/*================================================================================================*/ + + +/// @cond ignore +#ifndef AAX_CALLBACKS_H_ +#define AAX_CALLBACKS_H_ +/// @endcond + +#include "AAX.h" + +// Callback IDs +enum AAX_CProcPtrID +{ + kAAX_ProcPtrID_Create_EffectParameters = 0, ///< \ref AAX_IEffectParameters creation procedure + kAAX_ProcPtrID_Create_EffectGUI = 1, ///< \ref AAX_IEffectGUI creation procedure + kAAX_ProcPtrID_Create_HostProcessor = 3, ///< \ref AAX_IHostProcessor creation procedure + kAAX_ProcPtrID_Create_EffectDirectData = 5, ///< \ref AAX_IEffectDirectData creation procedure, used by plug-ins that want direct access to their alg memory + kAAX_ProcPtrID_Create_TaskAgent = 6, ///< \ref AAX_ITaskAgent creation procedure, used by plug-ins that want to process task requests made by the host. + kAAX_ProcPtrID_Create_SessionDocumentClient = 7 ///< \ref AAX_ISessionDocumentClient creation procedure +}; + +class IACFUnknown; + +typedef IACFUnknown* (AAX_CALLBACK *AAXCreateObjectProc)(void); + + +/** \brief Empty class containing type declarations for the %AAX algorithm and + associated callbacks + */ +template +class AAX_Component +{ + public: + + typedef void + (AAX_CALLBACK *CProcessProc) ( + aContextType * const inContextPtrsBegin [], + const void * inContextPtrsEnd); + + typedef void * + (AAX_CALLBACK *CPacketAllocator) ( + const aContextType * inContextPtr, + AAX_CFieldIndex inOutputPort, + AAX_CTimestamp inTimestamp); + + typedef int32_t + (AAX_CALLBACK *CInstanceInitProc) ( + const aContextType * inInstanceContextPtr, + AAX_EComponentInstanceInitAction iAction ); + + typedef int32_t + (AAX_CALLBACK *CBackgroundProc) ( void ); + + typedef void + (AAX_CALLBACK *CInitPrivateDataProc) ( + AAX_CFieldIndex inFieldIndex, + void * inNewBlock, + int32_t inSize, + IACFUnknown * const inController); + +}; + +/** @brief A user-defined callback that %AAX calls to process data packets and/or + audio. + + @details + \par iContextPtrsBegin + A vector of context pointers. Each element points to the + context for one instance of this component. @p iContextPtrsEnd + gives the upper bound of the vector and (inContextPtrsEnd - + inContextPtrsBegin) gives the count. + + \par iContextPtrsEnd + The upper bound of the vector at @p iContextPtrsBegin. + (inContextPtrsEnd - iContextPtrsBegin) gives the count + of this vector. + + The instance vector was originally NULL-terminated in + earlier versions of this API. However, the STL-style begin/end + pattern was suggested as a more general representation that could, + for instance, allow a vector to be split for parallel processing. + */ +typedef AAX_Component ::CProcessProc AAX_CProcessProc; + +/** @brief Used by AAX_SchedulePacket() + + @details + \deprecated + + A AAX_CProcessProc that calls AAX_SchedulePacket() must include a + AAX_CPacketAllocator field in its context and register that field + with AAX. %AAX will then populate that field with a + AAX_CPacketAllocator to pass to AAX_SchedulePacket(). + + @see AAX_SchedulePacket() + */ +typedef AAX_Component ::CPacketAllocator AAX_CPacketAllocator; + +/** @brief A user-defined callback that %AAX calls to notify the component that + an instance is being added or removed. + + @details + This optional callback allows the component to keep per-instance + data. It's called before the instance appears in the list + supplied to CProcessProc, and then after the instance is removed + from the list. + + \par iInstanceContextPtr + A pointer to the context data structure of the instance being + added or removed from the processing list. + + \par iAction + Indicates the action that triggered the init callback, e.g. + whether the instance is being added or removed. + + @retval Should return 0 on success, anything else on failure. Failure will + prevent the instance from being created. + */ +typedef AAX_Component ::CInstanceInitProc AAX_CInstanceInitProc; + +/** @brief A user-defined callback that %AAX calls in the %AAX Idle time + + @details + This optional callback allows the component to do background processing + in whatever manner the plug-in developer desires + + @retval Should return 0 on success, anything else on failure. Failure will + cause the %AAX host to signal an error up the callchain. + */ +typedef AAX_Component ::CBackgroundProc AAX_CBackgroundProc; + +/** @brief A user-defined callback to initialize a private data block + + @details + \deprecated + + A component that requires private data supplies \ref AAX_CInitPrivateDataProc + callbacks to set its private data to the state it should be in at the start + of audio. The component first declares one or more pointers to private data + in its context. It then registers each such field with %AAX along with its + data size, various other attributes, and a \ref AAX_CInitPrivateDataProc. The + AAX_CInitPrivateDataProc always runs on the host system, not the DSP. + %AAX allocates storage for each private data block and calls its associated + \ref AAX_CInitPrivateDataProc to initialize it. If the component's + \ref AAX_CProcessProc runs on external hardware, %AAX initializes private data + blocks on the host system and copies them to the remote system. + + \sa alg_pd_init + + \par inFieldIndex + The port ID of the block to be initialized, as generated by + AAX_FIELD_INDEX(). A component can register a separate + AAX_CInitPrivateDataProc for each of its private data blocks, or it + can use fewer functions that switch on @p inFieldIndex. + + \par inNewBlock + A pointer to the block to be initialized. If the component runs + externally, %AAX will copy this block to the remote system after it is + initialized. + + \par inSize + The size of the block to be initialized. If a component has multiple + private blocks that only need to be zeroed out, say, it can use a single + AAX_CInitPrivateDataProc for all of these blocks that zeroes them out + according to @p inSize. + + \par inController + A pointer to the current Effect instance's \ref AAX_IController. + \note Do not directly reference data from this interface when populating + @p iNewBlock. The data in this block must be fully self-contained to + ensure portability to a new device or memory space. + */ +typedef AAX_Component ::CInitPrivateDataProc AAX_CInitPrivateDataProc; ///< \deprecated + +/// @cond ignore +#endif // AAX_CALLBACKS_H_ +/// @endcond diff --git a/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_CommonConversions.h b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_CommonConversions.h new file mode 100644 index 0000000000..ae3240e430 --- /dev/null +++ b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_CommonConversions.h @@ -0,0 +1,149 @@ +/*================================================================================================*/ +/* + * + * Copyright 2014-2015, 2023-2024 Avid Technology, Inc. + * All rights reserved. + * + * This file is part of the Avid AAX SDK. + * + * The AAX SDK is subject to commercial or open-source licensing. + * + * By using the AAX SDK, you agree to the terms of both the Avid AAX SDK License + * Agreement and Avid Privacy Policy. + * + * AAX SDK License: https://developer.avid.com/aax + * Privacy Policy: https://www.avid.com/legal/privacy-policy-statement + * + * Or: You may also use this code under the terms of the GPL v3 (see + * www.gnu.org/licenses). + * + * THE AAX SDK IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER + * EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE + * DISCLAIMED. + * + */ + +/** + * \file AAX_CommonConversions.h + * + */ +/*================================================================================================*/ + + +#ifndef AAX_COMMONCONVERIONS_H +#define AAX_COMMONCONVERIONS_H + +#include +#include "AAX.h" + + +const int32_t k32BitPosMax = 0x7FFFFFFF; +const int32_t k32BitAbsMax = 0x80000000; +const int32_t k32BitNegMax = 0x80000000; + +const int32_t k56kFracPosMax = 0x007FFFFF; // Positive Max Value +const int32_t k56kFracAbsMax = 0x00800000; // Absolute Max Value. Essentially negative one without the sign extension. +const int32_t k56kFracHalf = 0x00400000; +const int32_t k56kFracNegOne = 0xFF800000; //Note sign extension!!! +const int32_t k56kFracNegMax = k56kFracNegOne; //Note sign extension!!! +const int32_t k56kFracZero = 0x00000000; + +const double kOneOver56kFracAbsMax = 1.0/double(k56kFracAbsMax); +const double k56kFloatPosMax = double(k56kFracPosMax)/double(k56kFracAbsMax); //56k Max value represented in floating point format. +const double k56kFloatNegMax = -1.0; //56k Min value represented in floating point format. +const double kNeg144DB = -144.0; +const double kNeg144Gain = 6.3095734448019324943436013662234e-8; //pow(10.0, kNeg144DB / 20.0); + +/** \brief Convert Gain to dB + * + * \details + * \todo This should be incorporated into parameters' tapers and not called separately + */ +inline double GainToDB(double aGain) +{ + if (aGain == 0.0) + return kNeg144DB; + else + { + double dB; + + dB = log10(aGain) * 20.0; + + if (dB < kNeg144DB) + dB = kNeg144DB; + return (dB); // convert factor to dB + } +} + +/** \brief Convert dB to Gain + * + * \details + * \todo This should be incorporated into parameters' tapers and not called separately + */ +inline double DBToGain(double dB) +{ + return pow(10.0, dB / 20.0); +} + +/** \brief Convert Long to Double + * + * \details + * LongToDouble: convert 24 bit fixed point in a int32_t to floating point equivalent + */ +inline double LongToDouble (int32_t aLong) +{ + if (aLong > k56kFracPosMax) + aLong = k56kFracPosMax; + else if (aLong < k56kFracNegMax) + aLong = k56kFracNegMax; + return (double(aLong) * kOneOver56kFracAbsMax); +} + +/** \brief convert floating point equivalent back to int32_t + */ +int32_t DoubleToLong (double aDouble); + +/** \brief Convert Double to DSPCoef + */ +inline int32_t DoubleToDSPCoef(double d, double max = k56kFloatPosMax, double min = k56kFloatNegMax) +{ + if(d >= max) // k56kFloatPosMax unless specified by the caller + { + return k56kFracPosMax; + }; + if(d < min) // k56kFloatNegMax unless specified by the caller + { + return k56kFracNegMax; + } + return static_cast(d*k56kFracAbsMax); +} + +/** \brief Convert DSPCoef to Double + */ +inline double DSPCoefToDouble(int32_t c, int32_t max = k56kFracPosMax, int32_t min = k56kFracNegMax) +{ + if (c > max) // k56kFracPosMax unless specified by the caller + c = k56kFracPosMax; + else if (c < min) // k56kFracNegMax unless specified by the caller + c = k56kFracNegMax; + return (double(c) * kOneOver56kFracAbsMax); +} + +/** \brief ThirtyTwoBitDSPCoefToDouble + */ +inline double ThirtyTwoBitDSPCoefToDouble(int32_t c) +{ + return DSPCoefToDouble(c, k32BitPosMax, k32BitNegMax); +} + +/** \brief DoubleTo32BitDSPCoefRnd + */ +inline int32_t DoubleTo32BitDSPCoefRnd(double d) +{ + return DoubleToDSPCoef(d, k32BitPosMax, k32BitNegMax); +} + +int32_t DoubleTo32BitDSPCoef(double d); +int32_t DoubleToDSPCoefRnd(double d, double max, double min); + +#endif // AAX_COMMONCONVERIONS_H diff --git a/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_EndianSwap.h b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_EndianSwap.h new file mode 100644 index 0000000000..5881d29ff5 --- /dev/null +++ b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_EndianSwap.h @@ -0,0 +1,170 @@ +/*================================================================================================*/ +/* + * + * Copyright 2013-2015, 2023-2024 Avid Technology, Inc. + * All rights reserved. + * + * This file is part of the Avid AAX SDK. + * + * The AAX SDK is subject to commercial or open-source licensing. + * + * By using the AAX SDK, you agree to the terms of both the Avid AAX SDK License + * Agreement and Avid Privacy Policy. + * + * AAX SDK License: https://developer.avid.com/aax + * Privacy Policy: https://www.avid.com/legal/privacy-policy-statement + * + * Or: You may also use this code under the terms of the GPL v3 (see + * www.gnu.org/licenses). + * + * THE AAX SDK IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER + * EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE + * DISCLAIMED. + * + */ + +/** + * \file AAX_EndianSwap.h + * + * \brief Utility functions for byte-swapping. Used by AAX_CChunkDataParser. + * + */ +/*================================================================================================*/ + + +#pragma once + +#ifndef ENDIANSWAP_H +#define ENDIANSWAP_H + +// Standard headers +#include + +//! \brief Byte swap data in-place. +template void AAX_EndianSwapInPlace(T* theDataP); + +//! \brief Make a byte-swapped copy of data. +template T AAX_EndianSwap(T theData); + + +//! \brief Convert data in-place between Big Endian and native byte ordering. +template void AAX_BigEndianNativeSwapInPlace(T* theDataP); + +//! \brief Copy and convert data between Big Endian and native byte ordering. +template T AAX_BigEndianNativeSwap(T theData); + +//! \brief Convert data in-place from the native byte ordering to Little Endian byte ordering. +template void AAX_LittleEndianNativeSwapInPlace(T* theDataP); + +//! \brief Copy and convert data from the native byte ordering to Little Endian byte ordering. +template T AAX_LittleEndianNativeSwap(T theData); + + + +//! \brief Byte swap a sequence of data in-place. +template void AAX_EndianSwapSequenceInPlace(Iter beginI, Iter endI); + + +//! \brief Convert an sequence of data in-place between Big Endian and native byte ordering. +template void AAX_BigEndianNativeSwapSequenceInPlace(Iter beginI, Iter endI); + +//! \brief Convert an sequence of data in-place from the native byte ordering to Little Endian byte ordering. +template void AAX_LittleEndianNativeSwapSequenceInPlace(Iter beginI, Iter endI); + + +// +// Implementations +// + +template +inline +void +AAX_EndianSwapInPlace(T* theDataP) +{ + char *begin, *end; + + begin = reinterpret_cast(theDataP); + end = begin + sizeof( T ); + std::reverse( begin, end ); +} + + +template +inline +T AAX_EndianSwap(T theData) +{ + AAX_EndianSwapInPlace(&theData); + return theData; +} + + +template +inline +void AAX_BigEndianNativeSwapInPlace(T* theDataP) +{ +#if (!defined __BIG_ENDIAN__) || (0 == __BIG_ENDIAN__) + AAX_EndianSwapInPlace(theDataP); +#endif +} + + +template +inline +T AAX_BigEndianNativeSwap(T theData) +{ + AAX_BigEndianNativeSwapInPlace(&theData); + return theData; +} + + +template +inline +void AAX_LittleEndianNativeSwapInPlace(T* theDataP) +{ +#if (defined __BIG_ENDIAN__) && (0 != __BIG_ENDIAN__) + AAX_EndianSwapInPlace(theDataP); +#endif +} + + +template +inline +T AAX_LittleEndianNativeSwap(T theData) +{ + AAX_LittleEndianNativeSwapInPlace(&theData); + return theData; +} + + +template +inline +void AAX_EndianSwapSequenceInPlace(Iter beginI, Iter endI) +{ + for(Iter i = beginI; i != endI; ++i) + { + // WARNING : Will this give a compile error if a use mistakenly uses it on a const sequence? + AAX_EndianSwapInPlace(&(*i)); + }; +} + + +template +inline +void AAX_BigEndianNativeSwapSequenceInPlace(Iter beginI, Iter endI) +{ +#if (!defined __BIG_ENDIAN__) || (0 == __BIG_ENDIAN__) + AAX_EndianSwapSequenceInPlace(beginI, endI); +#endif +} + + +template +inline +void AAX_LittleEndianNativeSwapSequenceInPlace(Iter beginI, Iter endI) +{ +#if (defined __BIG_ENDIAN__) && (0 != __BIG_ENDIAN__) + AAX_EndianSwapSequenceInPlace(beginI, endI); +#endif +} + +#endif diff --git a/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_Enums.h b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_Enums.h new file mode 100644 index 0000000000..27184e9a55 --- /dev/null +++ b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_Enums.h @@ -0,0 +1,1430 @@ +/*================================================================================================*/ +/* + * + * Copyright 2013-2017, 2019-2024 Avid Technology, Inc. + * All rights reserved. + * + * This file is part of the Avid AAX SDK. + * + * The AAX SDK is subject to commercial or open-source licensing. + * + * By using the AAX SDK, you agree to the terms of both the Avid AAX SDK License + * Agreement and Avid Privacy Policy. + * + * AAX SDK License: https://developer.avid.com/aax + * Privacy Policy: https://www.avid.com/legal/privacy-policy-statement + * + * Or: You may also use this code under the terms of the GPL v3 (see + * www.gnu.org/licenses). + * + * THE AAX SDK IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER + * EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE + * DISCLAIMED. + * + */ + +/** + * \file AAX_Enums.h + * + * \brief Utility functions for byte-swapping. Used by AAX_CChunkDataParser. + * + */ +/*================================================================================================*/ + + +/// @cond ignore +#ifndef AAX_ENUMS_H +#define AAX_ENUMS_H +/// @endcond + +#include + +#define AAX_INT32_MIN (-2147483647 - 1) /** minimum signed 32 bit value */ +#define AAX_INT32_MAX 2147483647 /** maximum signed 32 bit value */ +#define AAX_UINT32_MIN 0U /** minimum unsigned 32 bit value */ +#define AAX_UINT32_MAX 4294967295U /** maximum unsigned 32 bit value */ +#define AAX_INT16_MIN (-32767 - 1) /** minimum signed 16 bit value */ +#define AAX_INT16_MAX 32767 /** maximum signed 16 bit value */ +#define AAX_UINT16_MIN 0U /** minimum unsigned 16 bit value */ +#define AAX_UINT16_MAX 65535U /** maximum unsigned 16 bit value */ + +/** \brief Macro to ensure enum type consistency across binaries + */ +#ifndef _TMS320C6X +#define AAX_ENUM_SIZE_CHECK(x) extern int __enumSizeCheck[ 2*(sizeof(uint32_t)==sizeof(x)) - 1] +#else +#define AAX_ENUM_SIZE_CHECK(x) +#endif + + +//****************************************************************** +// ENUM: AAX_EHighlightColor +//****************************************************************** +/** \brief Highlight color selector + + \details + \sa AAX_IEffectGUI::SetControlHighlightInfo() + */ +enum AAX_EHighlightColor +{ + AAX_eHighlightColor_Red = 0, + AAX_eHighlightColor_Blue = 1, + AAX_eHighlightColor_Green = 2, + AAX_eHighlightColor_Yellow = 3, + + AAX_eHighlightColor_Num +}; AAX_ENUM_SIZE_CHECK( AAX_EHighlightColor ); + + +/** \brief Platform-specific tracing priorities + + \details + Use the generic \c EAAX_Trace_Priority in plug-ins for + cross-platform tracing (see AAX_Assert.h) + */ +enum AAX_ETracePriorityHost +{ + AAX_eTracePriorityHost_None = 0, + AAX_eTracePriorityHost_Critical = 0x10000000, + AAX_eTracePriorityHost_High = 0x08000000, + AAX_eTracePriorityHost_Normal = 0x04000000, + AAX_eTracePriorityHost_Low = 0x02000000, + AAX_eTracePriorityHost_Lowest = 0x01000000 +}; AAX_ENUM_SIZE_CHECK( AAX_ETracePriorityHost ); + +/** \brief Platform-specific tracing priorities + + \details + Use the generic EAAX_Trace_Priority in plug-ins for + cross-platform tracing (see AAX_Assert.h) + */ +enum AAX_ETracePriorityDSP +{ + AAX_eTracePriorityDSP_None = 0, + AAX_eTracePriorityDSP_Assert = 1, + AAX_eTracePriorityDSP_High = 2, + AAX_eTracePriorityDSP_Normal = 3, + AAX_eTracePriorityDSP_Low = 4 +}; AAX_ENUM_SIZE_CHECK( AAX_ETracePriorityDSP ); + +/** \brief Modifier key definitions used by %AAX API + */ +enum AAX_EModifiers +{ + AAX_eModifiers_None = 0, + + AAX_eModifiers_Shift = ( 1 << 0 ), ///< Shift + AAX_eModifiers_Control = ( 1 << 1 ), ///< Control on Mac, Winkey/Start on PC + AAX_eModifiers_Option = ( 1 << 2 ), ///< Option on Mac, Alt on PC + AAX_eModifiers_Command = ( 1 << 3 ), ///< Command on Mac, Ctrl on PC + AAX_eModifiers_SecondaryButton = ( 1 << 4 ), ///< Secondary mouse button + + AAX_eModifiers_Alt = AAX_eModifiers_Option, ///< Option on Mac, Alt on PC + AAX_eModifiers_Cntl = AAX_eModifiers_Command, ///< Command on Mac, Cntl on PC + AAX_eModifiers_WINKEY = AAX_eModifiers_Control ///< Control on Mac, WINKEY on PC +}; AAX_ENUM_SIZE_CHECK( AAX_EModifiers ); + +/** \brief Generic buffer length definitions + + \details + These enum values can be used to calculate literal + values as powers of two: + + \code + (1 << AAX_eAudioBufferLength_16) == 16; + \endcode + + \sa \ref AAX_EAudioBufferLengthDSP + \sa \ref AAE_EAudioBufferLengthNative + */ +enum AAX_EAudioBufferLength +{ + AAX_eAudioBufferLength_Undefined = -1, + AAX_eAudioBufferLength_1 = 0, + AAX_eAudioBufferLength_2 = 1, + AAX_eAudioBufferLength_4 = 2, + AAX_eAudioBufferLength_8 = 3, + AAX_eAudioBufferLength_16 = 4, + AAX_eAudioBufferLength_32 = 5, + AAX_eAudioBufferLength_64 = 6, + AAX_eAudioBufferLength_128 = 7, + AAX_eAudioBufferLength_256 = 8, + AAX_eAudioBufferLength_512 = 9, + AAX_eAudioBufferLength_1024 = 10, + + /** \brief Maximum buffer length for ProcessProc processing buffers + + \details + Audio buffers for other methods, such as the high-latency render + callback for \ref additionalFeatures_Hybrid "AAX Hybrid" or the + offline render callback for + \ref AuxInterface_HostProcessor "Host Processor" effects, may + contain more samples than AAX_eAudioBufferLength_Max. + */ + AAX_eAudioBufferLength_Max = AAX_eAudioBufferLength_1024 +}; AAX_ENUM_SIZE_CHECK( AAX_EAudioBufferLength ); + +/** \brief Currently supported processing buffer length definitions for %AAX DSP hosts + + \details + %AAX DSP decks must support at least these buffer lengths. All %AAX DSP + algorithm ProcessProcs must support exactly one of these buffer lengths. + + \sa AAX_eProperty_DSP_AudioBufferLength + */ +enum AAX_EAudioBufferLengthDSP +{ + AAX_eAudioBufferLengthDSP_Default = AAX_eAudioBufferLength_4, + AAX_eAudioBufferLengthDSP_4 = AAX_eAudioBufferLength_4, + AAX_eAudioBufferLengthDSP_16 = AAX_eAudioBufferLength_16, + AAX_eAudioBufferLengthDSP_32 = AAX_eAudioBufferLength_32, + AAX_eAudioBufferLengthDSP_64 = AAX_eAudioBufferLength_64, + + AAX_eAudioBufferLengthDSP_Max = AAX_eAudioBufferLengthDSP_64 +}; AAX_ENUM_SIZE_CHECK( AAX_EAudioBufferLengthDSP ); + +/** \brief Processing buffer length definitions for Native %AAX hosts + + \details + All %AAX Native plug-ins must support variable buffer lengths. The + buffer lengths that a host will use are constrained by the values + in this enum. All Native buffer lengths will be powers of two, as + per \ref AAX_EAudioBufferLength + + \sa AAX_eProperty_DSP_AudioBufferLength + */ +enum AAE_EAudioBufferLengthNative +{ + AAX_eAudioBufferLengthNative_Min = AAX_eAudioBufferLength_32, ///< Minimum Native buffer length + AAX_eAudioBufferLengthNative_Max = AAX_eAudioBufferLength_Max ///< Maximum Native buffer length +}; AAX_ENUM_SIZE_CHECK( AAE_EAudioBufferLengthNative ); + +/** @brief The maximum number of tracks that an %AAX host will + process in a non-real-time context + + \sa \ref AAX_eProperty_NumberOfInputs and \ref AAX_eProperty_NumberOfOutputs + */ +enum AAX_EMaxAudioSuiteTracks +{ + AAX_eMaxAudioSuiteTracks = 48 +}; AAX_ENUM_SIZE_CHECK( AAX_EMaxAudioSuiteTracks ); + +// The channel count ternary here will issue a warning due to a +// signed/unsigned mismatch if anyone tries to create an +// AAX_STEM_FORMAT definition with a negative channel count. +#define AAX_STEM_FORMAT( aIndex, aChannelCount ) ( static_cast( ( static_cast(aIndex) << 16 ) | ( (aChannelCount >= AAX_UINT16_MIN) && (aChannelCount <= 0xFFFF) ? aChannelCount & 0xFFFF : 0x0000 ) ) ) +#define AAX_STEM_FORMAT_CHANNEL_COUNT( aStemFormat ) ( static_cast( aStemFormat & 0xFFFF ) ) +#define AAX_STEM_FORMAT_INDEX( aStemFormat ) ( static_cast( ( aStemFormat >> 16 ) & 0xFFFF ) ) + +/** @brief Stem format definitions + + @details + A stem format combines a channel count with a semantic meaning for each + channel. Usually this is the speaker or speaker position associated with + the data in the channel. The meanings of each channel in each stem format + (i.e. channel orders) are listed below. + + Not all stem formats are supported by all %AAX plug-in hosts. An effect + may describe support for any stem format combination which it supports + and the host will ignore any configurations which it cannot support. + + \note When defining stem format support in \ref AAX_IHostProcessor + effects do not use stem format properties or values. Instead, use + \ref AAX_eProperty_NumberOfInputs and \ref AAX_eProperty_NumberOfOutputs + with integer channel count values. + + \sa - \ref AAX_eProperty_InputStemFormat + \sa - \ref AAX_eProperty_OutputStemFormat + \sa - \ref AAX_eProperty_HybridInputStemFormat + \sa - \ref AAX_eProperty_HybridOutputStemFormat + \sa - \ref AAX_eProperty_SideChainStemFormat + */ +enum AAX_EStemFormat +{ + // Point source stem formats + AAX_eStemFormat_Mono = AAX_STEM_FORMAT ( 0, 1 ), ///< M + AAX_eStemFormat_Stereo = AAX_STEM_FORMAT ( 1, 2 ), ///< L R + AAX_eStemFormat_LCR = AAX_STEM_FORMAT ( 2, 3 ), ///< L C R + AAX_eStemFormat_LCRS = AAX_STEM_FORMAT ( 3, 4 ), ///< L C R S + AAX_eStemFormat_Quad = AAX_STEM_FORMAT ( 4, 4 ), ///< L R Ls Rs + AAX_eStemFormat_5_0 = AAX_STEM_FORMAT ( 5, 5 ), ///< L C R Ls Rs + AAX_eStemFormat_5_1 = AAX_STEM_FORMAT ( 6, 6 ), ///< L C R Ls Rs LFE + AAX_eStemFormat_6_0 = AAX_STEM_FORMAT ( 7, 6 ), ///< L C R Ls Cs Rs + AAX_eStemFormat_6_1 = AAX_STEM_FORMAT ( 8, 7 ), ///< L C R Ls Cs Rs LFE + AAX_eStemFormat_7_0_SDDS = AAX_STEM_FORMAT ( 9, 7 ), ///< L Lc C Rc R Ls Rs + AAX_eStemFormat_7_1_SDDS = AAX_STEM_FORMAT ( 10, 8 ), ///< L Lc C Rc R Ls Rs LFE + AAX_eStemFormat_7_0_DTS = AAX_STEM_FORMAT ( 11, 7 ), ///< L C R Lss Rss Lsr Rsr + AAX_eStemFormat_7_1_DTS = AAX_STEM_FORMAT ( 12, 8 ), ///< L C R Lss Rss Lsr Rsr LFE + AAX_eStemFormat_7_0_2 = AAX_STEM_FORMAT ( 20, 9 ), ///< L C R Lss Rss Lsr Rsr Lts Rts + AAX_eStemFormat_7_1_2 = AAX_STEM_FORMAT ( 13, 10 ), ///< L C R Lss Rss Lsr Rsr LFE Lts Rts + AAX_eStemFormat_5_0_2 = AAX_STEM_FORMAT ( 21, 7 ), ///< L C R Ls Rs Ltm Rtm + AAX_eStemFormat_5_1_2 = AAX_STEM_FORMAT ( 22, 8 ), ///< L C R Ls Rs LFE Ltm Rtm + AAX_eStemFormat_5_0_4 = AAX_STEM_FORMAT ( 23, 9 ), ///< L C R Ls Rs Ltf Rtf Ltr Rtr + AAX_eStemFormat_5_1_4 = AAX_STEM_FORMAT ( 24, 10 ), ///< L C R Ls Rs LFE Ltf Rtf Ltr Rtr + AAX_eStemFormat_7_0_4 = AAX_STEM_FORMAT ( 25, 11 ), ///< L C R Lss Rss Lsr Rsr Ltf Rtf Ltr Rtr + AAX_eStemFormat_7_1_4 = AAX_STEM_FORMAT ( 26, 12 ), ///< L C R Lss Rss Lsr Rsr LFE Ltf Rtf Ltr Rtr + AAX_eStemFormat_7_0_6 = AAX_STEM_FORMAT ( 35, 13 ), ///< L C R Lss Rss Lsr Rsr Ltf Rtf Ltm Rtm Ltr Rtr + AAX_eStemFormat_7_1_6 = AAX_STEM_FORMAT ( 36, 14 ), ///< L C R Lss Rss Lsr Rsr LFE Ltf Rtf Ltm Rtm Ltr Rtr + AAX_eStemFormat_9_0_4 = AAX_STEM_FORMAT ( 27, 13 ), ///< L C R Lw Rw Lss Rss Lsr Rsr Ltf Rtf Ltr Rtr + AAX_eStemFormat_9_1_4 = AAX_STEM_FORMAT ( 28, 14 ), ///< L C R Lw Rw Lss Rss Lsr Rsr LFE Ltf Rtf Ltr Rtr + AAX_eStemFormat_9_0_6 = AAX_STEM_FORMAT ( 29, 15 ), ///< L C R Lw Rw Lss Rss Lsr Rsr Ltf Rtf Ltm Rtm Ltr Rtr + AAX_eStemFormat_9_1_6 = AAX_STEM_FORMAT ( 30, 16 ), ///< L C R Lw Rw Lss Rss Lsr Rsr LFE Ltf Rtf Ltm Rtm Ltr Rtr + + // Ambisonics stem formats + AAX_eStemFormat_Ambi_1_ACN = AAX_STEM_FORMAT ( 14, 4 ), ///< Ambisonics: first-order with ACN channel order and SN3D (AmbiX) normalization + AAX_eStemFormat_Ambi_2_ACN = AAX_STEM_FORMAT ( 18, 9 ), ///< Ambisonics: second-order with ACN channel order and SN3D (AmbiX) normalization + AAX_eStemFormat_Ambi_3_ACN = AAX_STEM_FORMAT ( 19, 16 ), ///< Ambisonics: third-order with ACN channel order and SN3D (AmbiX) normalization + AAX_eStemFormat_Ambi_4_ACN = AAX_STEM_FORMAT ( 31, 25 ), ///< Ambisonics: fourth-order with ACN channel order and SN3D (AmbiX) normalization + AAX_eStemFormat_Ambi_5_ACN = AAX_STEM_FORMAT ( 32, 36 ), ///< Ambisonics: fifth-order with ACN channel order and SN3D (AmbiX) normalization + AAX_eStemFormat_Ambi_6_ACN = AAX_STEM_FORMAT ( 33, 49 ), ///< Ambisonics: sixth-order with ACN channel order and SN3D (AmbiX) normalization + AAX_eStemFormat_Ambi_7_ACN = AAX_STEM_FORMAT ( 34, 64 ), ///< Ambisonics: seventh-order with ACN channel order and SN3D (AmbiX) normalization + + + + + AAX_eStemFormatNum = 37, // One greater than the highest available AAX_STEM_FORMAT_INDEX value. This needs to increase as stem types are added. + + AAX_eStemFormat_None = AAX_STEM_FORMAT ( -100, 0 ), + AAX_eStemFormat_Any = AAX_STEM_FORMAT ( -1, 0 ), + + AAX_eStemFormat_INT32_MAX = AAX_INT32_MAX +}; AAX_ENUM_SIZE_CHECK( AAX_EStemFormat ); + +/** @brief Effect category definitions + + @details + Used with \ref AAX_IEffectDescriptor::AddCategory() to categorize an Effect. + + These values are bitwise-exclusive and may be used in a bitmask to define multiple categories: + + \code + myCategory = AAX_ePlugInCategory_EQ | AAX_ePlugInCategory_Dynamics; + \endcode + + \note The host may handle plug-ins with different categories in different manners, e.g. + replacing "analyze" with "reverse" for offline processing of delays and reverbs. + + */ +enum AAX_EPlugInCategory +{ + AAX_ePlugInCategory_None = 0x00000000, + AAX_ePlugInCategory_EQ = 0x00000001, ///< Equalization + AAX_ePlugInCategory_Dynamics = 0x00000002, ///< Compressor, expander, limiter, etc. + AAX_ePlugInCategory_PitchShift = 0x00000004, ///< Pitch processing + AAX_ePlugInCategory_Reverb = 0x00000008, ///< Reverberation and room/space simulation + AAX_ePlugInCategory_Delay = 0x00000010, ///< Delay and echo + AAX_ePlugInCategory_Modulation = 0x00000020, ///< Phasing, flanging, chorus, etc. + AAX_ePlugInCategory_Harmonic = 0x00000040, ///< Distortion, saturation, and harmonic enhancement + AAX_ePlugInCategory_NoiseReduction = 0x00000080, ///< Noise reduction + AAX_ePlugInCategory_Dither = 0x00000100, ///< Dither, noise shaping, etc. + AAX_ePlugInCategory_SoundField = 0x00000200, ///< Pan, auto-pan, upmix and downmix, and surround handling + AAX_ePlugInCategory_HWGenerators = 0x00000400, ///< Fixed hardware audio sources such as SampleCell + AAX_ePlugInCategory_SWGenerators = 0x00000800, ///< Virtual instruments, metronomes, and other software audio sources + AAX_ePlugInCategory_WrappedPlugin = 0x00001000, ///< All plug-ins wrapped by a thrid party wrapper (i.e. VST to RTAS wrapper), except for VI plug-ins which should be mapped to AAX_PlugInCategory_SWGenerators + AAX_EPlugInCategory_Effect = 0x00002000, ///< Special effects + +// HACK: 32-bit hosts do not have support for AAX_ePlugInCategory_Example +#if ( defined(_WIN64) || defined(__LP64__) ) + AAX_ePlugInCategory_Example = 0x00004000, ///< SDK example plug-ins \compatibility \ref AAX_ePlugInCategory_Example is compatible with Pro Tools 11 and higher. Effects with this category will not appear in Pro Tools 10. +#else + AAX_ePlugInCategory_Example = AAX_EPlugInCategory_Effect, +#endif + + AAX_EPlugInCategory_MIDIEffect = 0x00010000, ///< MIDI effects + + AAX_ePlugInCategory_INT32_MAX = AAX_INT32_MAX +}; AAX_ENUM_SIZE_CHECK( AAX_EPlugInCategory ); + +/** @brief Effect string identifiers + + @details + The %AAX host may associate certain plug-in display strings + with these identifiers. + + \sa \ref AAX_IEffectGUI::GetCustomLabel() + + */ +enum AAX_EPlugInStrings +{ + AAX_ePlugInStrings_Analysis = 0, ///< "Analyze" button label (AudioSuite) \legacy Was pluginStrings_Analysis in the RTAS/TDM SDK + AAX_ePlugInStrings_MonoMode = 1, ///< "Mono Mode" selector label (AudioSuite) \legacy Was pluginStrings_MonoMode in the RTAS/TDM SDK + AAX_ePlugInStrings_MultiInputMode = 2, ///< "Multi-Input Mode" selector label (AudioSuite) \legacy Was pluginStrings_MultiInputMode in the RTAS/TDM SDK + AAX_ePlugInStrings_RegionByRegionAnalysis = 3, ///< "Clip-by-Clip Analysis" selector label (AudioSuite) \legacy Was pluginStrings_RegionByRegionAnalysis in the RTAS/TDM SDK + AAX_ePlugInStrings_AllSelectedRegionsAnalysis = 4, ///< "Whole File Analysis" selector label (AudioSuite) \legacy Was pluginStrings_AllSelectedRegionsAnalysis in the RTAS/TDM SDK + AAX_ePlugInStrings_RegionName = 5, ///< \deprecated + AAX_ePlugInStrings_ClipName = 5, ///< Clip name label (AudioSuite). This value will replace the clip's name. \sa AAX_ePlugInStrings_ClipNameSuffix \legacy Was pluginStrings_RegionName in the RTAS/TDM SDK + AAX_ePlugInStrings_Progress = 6, ///< Progress bar label (AudioSuite) \compatibility Not currently supported by Pro Tools \legacy Was pluginStrings_Progress in the RTAS/TDM SDK + AAX_ePlugInStrings_PlugInFileName = 7, ///< \deprecated + AAX_ePlugInStrings_Preview = 8, ///< \deprecated + AAX_ePlugInStrings_Process = 9, ///< "Render" button label (AudioSuite) \legacy Was pluginStrings_Process in the RTAS/TDM SDK + AAX_ePlugInStrings_Bypass = 10, ///< "Bypass" button label (AudioSuite) \legacy Was pluginStrings_Bypass in the RTAS/TDM SDK + AAX_ePlugInStrings_ClipNameSuffix = 11, ///< Clip name label suffix (AudioSuite). This value will be appended to the clip's name, vs \ref AAX_ePlugInStrings_ClipName which will replace the clip's name completely. + + AAX_ePlugInStrings_INT32_MAX = AAX_INT32_MAX +}; AAX_ENUM_SIZE_CHECK( AAX_EPlugInStrings ); + +/** @brief Meter orientation + * + * @details + * Use this enum in conjunction with the \ref AAX_eProperty_Meter_Orientation property + * + * For more information about meters in AAX, see \ref AdditionalFeatures_Meters + */ +enum AAX_EMeterOrientation +{ + AAX_eMeterOrientation_Default = 0, + AAX_eMeterOrientation_BottomLeft = AAX_eMeterOrientation_Default, ///< the default orientation + AAX_eMeterOrientation_TopRight = 1, ///< Some dynamics plug-in orient their gain reduction like so + AAX_eMeterOrientation_Center = 2, ///< A plug-in that does gain increase and decrease may want this. meter values less than 0x40000000 would display downward from the mid-point. meter values greater than 0x40000000 would display upward from the mid-point + AAX_eMeterOrientation_PhaseDot = 3 ///< linear scale, displays 2 dots around the value ( currently D-Control only ) +}; AAX_ENUM_SIZE_CHECK( AAX_EMeterOrientation ); + + +/** @brief Meter ballistics type + * + * @details + * Use this enum in conjunction with the \ref AAX_eProperty_Meter_Ballistics property + * + * For more information about meters in AAX, see \ref AdditionalFeatures_Meters + */ +enum AAX_EMeterBallisticType +{ + AAX_eMeterBallisticType_Host = 0, ///< The ballistics follow the host settings. + AAX_eMeterBallisticType_NoDecay = 1 ///< No decay ballistics. +}; AAX_ENUM_SIZE_CHECK( AAX_EMeterBallisticType ); + +/** @brief Meter type + * + * @details + * Use this enum in conjunction with the \ref AAX_eProperty_Meter_Type property + * + * For more information about meters in AAX, see \ref AdditionalFeatures_Meters + */ +enum AAX_EMeterType +{ + AAX_eMeterType_Input = 0, ///< e.g. Your typical input meter (possibly after an input gain stage) + AAX_eMeterType_Output = 1, ///< e.g. Your typical output meter (possibly after an output gain stage) + AAX_eMeterType_CLGain = 2, ///< e.g. Compressor/Limiter gain reduction + AAX_eMeterType_EGGain = 3, ///< e.g. Expander/Gate gain reduction + AAX_eMeterType_Analysis = 4, ///< e.g. multi-band amplitude from a Spectrum analyzer + AAX_eMeterType_Other = 5, ///< e.g. a meter that does not fit in any of the above categories + AAX_eMeterType_None = 31 ///< For internal host use only +}; AAX_ENUM_SIZE_CHECK( AAX_EMeterType ); + +/*! @brief Different Curve Types that can be queried from the Host. + + @details + \note All 'AX__' IDs are reserved for host messages + + \sa \ref AAX_IEffectParameters::GetCurveData() + \sa \ref AAX_IEffectParameters::GetCurveDataMeterIds() + \sa \ref AAX_IEffectParameters::GetCurveDataDisplayRange() + + @ingroup AdditionalFeatures_CurveDisplays + */ +enum AAX_ECurveType +{ + AAX_eCurveType_None = 0, + + /** \brief EQ Curve, input values are in Hz, output values are in dB + + \compatibility Pro Tools requests this curve type for + \ref AAX_ePlugInCategory_EQ "EQ" plug-ins only + */ + AAX_eCurveType_EQ = 'AXeq', + /** \brief Dynamics Curve showing input vs. output, input and output values are in dB + + \compatibility Pro Tools requests this curve type for + \ref AAX_ePlugInCategory_Dynamics "Dynamics" plug-ins only + */ + AAX_eCurveType_Dynamics = 'AXdy', + /** \brief Gain-reduction curve showing input vs. gain reduction, input and output values are in dB + + \compatibility Pro Tools requests this curve type for + \ref AAX_ePlugInCategory_Dynamics "Dynamics" plug-ins only + */ + AAX_eCurveType_Reduction = 'AXdr' +}; AAX_ENUM_SIZE_CHECK( AAX_ECurveType ); + +/*! @brief Types of resources that can be added to an Effect's description + + @details + \sa AAX_IEffectDescriptor::AddResourceInfo() + */ +enum AAX_EResourceType +{ + AAX_eResourceType_None = 0, + /** The file name of the page table xml file + */ + AAX_eResourceType_PageTable, + /** The absolute path to the directory containing the plug-in's page table xml file(s) + + Defaults to *.aaxplugin/Contents/Resources + */ + AAX_eResourceType_PageTableDir +}; AAX_ENUM_SIZE_CHECK( AAX_EResourceType ); + +/*! @brief Events IDs for %AAX notifications + + @details + - Notifications listed with Sent by: Host are dispatched by the + %AAX host and may be received in one or more of + + \li \ref AAX_IEffectParameters::NotificationReceived() + \li \ref AAX_IEffectGUI::NotificationReceived() + \li \ref AAX_IEffectDirectData::NotificationReceived() + + The host will choose which components are registered to receive each event type. + See the documentation for each event type for more information. + + \note All 'AX__' four-char IDs are reserved for the %AAX specification + */ +enum AAX_ENotificationEvent +{ + /** \brief (not currently sent) The zero-indexed insert position + of this plug-in instance within its track + + Data: \c int32_t
+ Sent by: Host + */ + AAX_eNotificationEvent_InsertPositionChanged = 'AXip', + /** \brief (const AAX_IString) The current name of + this plug-in instance's track + + \compatibility Supported in Pro Tools 11.2 and higher + \compatibility Not supported by Media Composer + + Data: \c const \ref AAX_IString
+ Sent by: Host + */ + AAX_eNotificationEvent_TrackNameChanged = 'AXtn', + /** \brief (not currently sent) The current UID of + this plug-in instance's track + + Data: const uint8_t[16]
+ Sent by: Host + */ + AAX_eNotificationEvent_TrackUIDChanged = 'AXtu', + /** \brief (not currently sent) The current position index of + this plug-in instance's track + + Data: \c int32_t
+ Sent by: Host + */ + AAX_eNotificationEvent_TrackPositionChanged = 'AXtp', + /** \brief Not currently sent + + Data: none
+ Sent by: Host + */ + AAX_eNotificationEvent_AlgorithmMoved = 'AXam', + /** \brief Not currently sent + + Data: none
+ Sent by: Host + */ + AAX_eNotificationEvent_GUIOpened = 'AXgo', + /** \brief Not currently sent + + Data: none
+ Sent by: Host + */ + AAX_eNotificationEvent_GUIClosed = 'AXgc', + /** \brief AudioSuite processing state change notification. One + of \ref AAX_EProcessingState. + + \compatibility Supported in Pro Tools 11 and higher + \compatibility Not supported by Media Composer + + Data: \c int32_t
+ Sent by: Host + */ + AAX_eNotificationEvent_ASProcessingState = 'AXPr', + /** \brief AudioSuite preview state change notification. One of + \ref AAX_EPreviewState. \legacy Replacement for \c SetPreviewState() + + \compatibility Supported in Pro Tools 11 and higher + \compatibility Not supported by Media Composer + + Data: \c int32_t
+ Sent by: Host + */ + AAX_eNotificationEvent_ASPreviewState = 'ASPv', + /** \brief Tell the plug-in that chunk data is coming from a PTX + + \compatibility Supported in Pro Tools 11 and higher + \compatibility Not supported by Media Composer + + Data: none
+ Sent by: Host + */ + AAX_eNotificationEvent_SessionBeingOpened = 'AXso', + /** \brief Tell the plug-in that chunk data is coming from a TFX + + \compatibility Supported in Pro Tools 11 and higher + + Data: none
+ Sent by: Host + */ + AAX_eNotificationEvent_PresetOpened = 'AXpo', + /** \brief Entering offline processing mode (i.e. offline bounce) + + \compatibility Supported in Pro Tools 11 and higher + + Data: none
+ Sent by: Host + */ + AAX_eNotificationEvent_EnteringOfflineMode = 'AXof', + /** \brief Exiting offline processing mode (i.e. offline bounce) + + \compatibility Supported in Pro Tools 11 and higher + + Data: none
+ Sent by: Host + */ + AAX_eNotificationEvent_ExitingOfflineMode = 'AXox', + /** \brief A string representing the path of the + current session + + \compatibility Supported in Pro Tools 11.1 and higher + + Data: \c const \ref AAX_IString
+ Sent by: Host + */ + AAX_eNotificationEvent_SessionPathChanged = 'AXsp', + /** \brief The host has changed its latency compensation for this + plug-in instance. + + \note This notification may be sent redundantly just after plug-in + instantiation when the \ref AAX_eProperty_LatencyContribution property is + described. + + \compatibility Supported in Pro Tools 11.1 and higher + + Data: none
+ Sent by: Host + */ + AAX_eNotificationEvent_SignalLatencyChanged = 'AXsl', + /** \brief The host's delay compensation state has changed + + This notification refers to the host's delay compensation feature as a + whole, rather than the specific delay compensation state for the plug-in. + + Possible values: 0 (disabled), 1 (enabled) + + Plug-ins may need to monitor the host's delay compensation state because, + while delay compensation is disabled, the host will never change the + plug-in's accounted latency and, therefore, will never dispatch + \ref AAX_eNotificationEvent_SignalLatencyChanged to the plug-in following + a call to \ref AAX_IController::SetSignalLatency(). + + \compatibility Supported in Pro Tools 12.6 and higher + + Data: \c int32_t
+ Sent by: Host + */ + AAX_eNotificationEvent_DelayCompensationState = 'AXdc', + /** \brief (not currently sent) The host has changed its DSP cycle + allocation for this plug-in instance + + Data: none
+ Sent by: Host + */ + AAX_eNotificationEvent_CycleCountChanged = 'AXcc', + /** \brief Tell the plug-in the maximum allowed GUI dimensions + + Delivered to the plugin's \ref AAX_IEffectGUI::NotificationReceived() + + \compatibility Supported in Pro Tools 11.1 and higher + + Data: \c const \ref AAX_Point
+ Sent by: Host + */ + AAX_eNotificationEvent_MaxViewSizeChanged = 'AXws', + /** \brief Tell the plug-in about connection of the sidechain input + + \compatibility Supported in Pro Tools 11.1 and higher + + Data: none
+ Sent by: Host + */ + AAX_eNotificationEvent_SideChainBeingConnected = 'AXsc', + /** \brief Tell the plug-in about disconnection of the sidechain + input + + \compatibility Supported in Pro Tools 11.1 and higher + + Data: none
+ Sent by: Host + */ + AAX_eNotificationEvent_SideChainBeingDisconnected = 'AXsd', + /** \brief The plug-in's noise floor level + + The notification data is the new absolute noise floor level generated by the + plug-in, as amplitude. For example, a plug-in generating a noise floor at -80 + dB (amplitude) would provide 0.0001 in the notification data. + + Signal below the level of the plug-in's noise floor may be ignored by host + features such as Dynamic Plug-In Processing, which detect whether or not + there is any signal being generated by the plug-in + + Data: \c double
+ Sent by: Plug-in + */ + AAX_eNotificationEvent_NoiseFloorChanged = 'AXnf', + /** \brief Notify the host that some aspect of the parameters' mapping has changed + + To respond to this notification, the host will call + \ref AAX_IEffectParameters::UpdatePageTable() to update its cached page tables. + + Data: none
+ Sent by: Plug-in + */ + AAX_eNotificationEvent_ParameterMappingChanged = 'AXpm', + /** \brief Notify the host that one or more parameters' display names have changed + + The payload is the parameter's ID. The payload size must be at least as large as + the ID string, including the null termination character, and no larger than the + size of the buffer containing the \ref AAX_CParamID . + + \compatibility Supported in Pro Tools 2023.3 and higher + + Data: \c const \ref AAX_CParamID
+ Sent by: Plug-in + */ + AAX_eNotificationEvent_ParameterNameChanged = 'AXpn', + /** \brief Notify the plug-in about Host mode changing + + \compatibility Supported in Venue 5.6 and higher + + Data: AAX_EHostModeBits
+ Sent by: Host + */ + AAX_eNotificationEvent_HostModeChanged = 'AXHm', + /** \brief Previously-saved settings may no longer restore the captured state + + Use this notification when a change occurs which may cause a different state to + be restored by saved settings, and in particular by a saved setting representing + the plug-in's state just prior to the change. + + For example, a plug-in which restricts certain types of state changes when the + host is in \ref AAX_eHostModeBits_Live mode should post an + \ref AAX_eNotificationEvent_PriorSettingsInvalid notification when this part of + the plug-in state is changed manually by the user; if plug-in settings captured + prior to this manual change are later set on the plug-in while the host is in + live mode then some part of the settings change will be blocked and the captured + state will not be perfectly restored. + + \compatibility Supported in Venue 5.6 and higher + + Data: none
+ Sent by: Plug-in + */ + AAX_eNotificationEvent_PriorSettingsInvalid = 'AXps', + /** \brief Notify plug-in to log current state + + Plug-in implementation specific + + \compatibility Pro Tools currently only sends this notification to the Direct + Data object in the plug-in + + Data: none
+ Sent by: Host + */ + AAX_eNotificationEvent_LogState = 'AXls', + /** \brief Notify plug-in that the TransportState was changed. + + \compatibility Supported in Pro Tools 2021.10 and higher + + Data: \ref AAX_TransportStateInfo_V1
+ Sent by: Host + */ + AAX_eNotificationEvent_TransportStateChanged = 'AXts', + /** \brief Tell the plug-in the current host language setting + + Data is sent as a string. The format is a two-part code based on RFC 4646. The values + follow Microsoft's formatting for CultureInfo culture names as described in + http://msdn.microsoft.com/en-us/library/system.globalization.cultureinfo%28VS.80%29.aspx + + Examples: + - en-US: English (US) + - ja-JP: Japanese + - ko-KR: Korean + - fr-FR: French + - it-IT: Italian + - de-DE: German + - es-ES: Spanish + + These exceptions to the specification are used by Pro Tools: + - zh-CHS: Simplified Chinese + - zh-CN: Traditional Chinese + + \note Currently in Pro Tools the language setting will remain consistent throughout + the lifetime of the plugin instance. + + Delivered to the plugin's \ref AAX_IEffectGUI::NotificationReceived() and \ref AAX_IEffectParameters::NotificationReceived() + + \compatibility Supported in Pro Tools 2024.3 and higher + + Data: \c const \ref AAX_IString
+ Sent by: Host + + */ + AAX_eNotificationEvent_HostLocale = 'AXLc', +}; AAX_ENUM_SIZE_CHECK( AAX_ENotificationEvent ); + + +/** @brief Host mode + \compatibility Supported in Venue 5.6 and higher + */ +enum AAX_EHostModeBits +{ + AAX_eHostModeBits_None = 0, ///< No special host mode, e.g. Pro Tools normal operation, Venue Config mode + AAX_eHostModeBits_Live = (1 << 0) ///< The host is in a live playback mode, e.g. Venue Show mode - inserts are live and must not allow state changes which interrupt audio processing + +}; AAX_ENUM_SIZE_CHECK(AAX_EHostModeBits); + +/** @brief DEPRECATED + + Use \ref AAX_EHostModeBits + + \warning The values of these modes have changed as of %AAX SDK 2.3.1 from the definitions originally published in %AAX SDK 2.3.0 + + \deprecated This enum is deprecated and will be removed in a future release. +*/ +enum AAX_EHostMode +{ + AAX_eHostMode_Show = AAX_eHostModeBits_Live, ///< \deprecated Use \ref AAX_eHostModeBits_Live + AAX_eHostMode_Config = AAX_eHostModeBits_None ///< \deprecated Use \ref AAX_eHostModeBits_None + +}; AAX_ENUM_SIZE_CHECK(AAX_EHostMode); + +/** @brief Options for algorithm private data fields + */ +enum AAX_EPrivateDataOptions +{ + AAX_ePrivateDataOptions_DefaultOptions = 0, + AAX_ePrivateDataOptions_KeepOnReset = (1 << 0), ///< Retain data upon plug-in reset \warning Not currently implemented. If this functionality is desired, the recommended workaround is to cache the desired private data to be set during \ref AAX_IEffectParameters::ResetFieldData(). + AAX_ePrivateDataOptions_External = (1 << 1), ///< Place the block in external memory (internal by default) + AAX_ePrivateDataOptions_Align8 = (1 << 2), ///< Place the block in mem aligned by 64 bits + + AAX_ePrivateDataOptions_INT32_MAX = AAX_INT32_MAX +}; AAX_ENUM_SIZE_CHECK( AAX_EPrivateDataOptions ); + + +/*! \brief Property values to describe location constraints placed on + the plug-in's algorithm component (\c ProcessProc) + + \details + \sa AAX_eProperty_Constraint_Location + */ +enum AAX_EConstraintLocationMask +{ + /** \brief No constraint placed on component's location + */ + AAX_eConstraintLocationMask_None = 0, + /** \brief This \c ProcessProc must be co-located with the plug-in's data model object + */ + AAX_eConstraintLocationMask_DataModel = (1 << 0), + /** \brief This \c ProcessProc should be instantiated on the same chip as other effects that use the same DLL. + * + * \li This constraint is only applicable to DSP algorithms + * + * This property should only be used when absolutely required, as it will constrain the DSP manager and reduce + * overall DSP plug-in instance counts on the system. + * + * \compatibility This constraint is supported in Pro Tools 10.2 and higher + */ + AAX_eConstraintLocationMask_DLLChipAffinity = (1 << 1), +}; AAX_ENUM_SIZE_CHECK( AAX_EConstraintLocationMask ); + +/*! \brief Property values to describe the topology of the plug-in's + modules (e.g. data model, GUI.) + + \details + \sa AAX_eProperty_Constraint_Topology + */ +enum AAX_EConstraintTopology +{ + AAX_eConstraintTopology_None = 0, ///< No constraint placed on plug-in's topology + AAX_eConstraintTopology_Monolithic = 1 ///< All plug-in modules (e.g. data model, GUI) must be co-located and non-relocatable +}; AAX_ENUM_SIZE_CHECK( AAX_EConstraintTopology ); + + +/*! \brief Selector indicating the action that occurred to prompt a component initialization callback + + \details + \sa \ref AAX_CInstanceInitProc + */ +enum AAX_EComponentInstanceInitAction +{ + AAX_eComponentInstanceInitAction_AddingNewInstance = 0, + AAX_eComponentInstanceInitAction_RemovingInstance = 1, + AAX_eComponentInstanceInitAction_ResetInstance = 2 +}; AAX_ENUM_SIZE_CHECK( AAX_EComponentInstanceInitAction ); + +/*! \brief Property values to describe various sample rates. + + \details + These values may be used as a bitmask, so e.g. a particular Effect + may declare compatibility with + AAX_eSampleRateMask_44100 | AAX_eSampleRateMask_48000 + + \sa \ref AAX_eProperty_SampleRate + */ +enum AAX_ESampleRateMask +{ + AAX_eSampleRateMask_No = 0, + + AAX_eSampleRateMask_44100 = (1 << 0), + AAX_eSampleRateMask_48000 = (1 << 1), + AAX_eSampleRateMask_88200 = (1 << 2), + AAX_eSampleRateMask_96000 = (1 << 3), + AAX_eSampleRateMask_176400 = (1 << 4), + AAX_eSampleRateMask_192000 = (1 << 5), + + AAX_eSampleRateMask_All = AAX_INT32_MAX +}; AAX_ENUM_SIZE_CHECK( AAX_ESampleRateMask ); + +/** @brief FIC stuff that I can't include without DAE library dependence + + @details + \legacy Values must match unnamed type enum in FicTDMControl.h + + \todo FLAGGED FOR REMOVAL + + */ +typedef enum AAX_EParameterType +{ + AAX_eParameterType_Discrete, ///< \legacy Matches \c kDAE_DiscreteValues + AAX_eParameterType_Continuous ///< \legacy Matches \c kDAE_ContinuousValues +} AAX_EParameterType; AAX_ENUM_SIZE_CHECK( AAX_EParameterType ); + +/** @brief Visual Orientation of a parameter + + @details + \todo FLAGGED FOR REVISION + + */ +enum AAX_EParameterOrientationBits { + AAX_eParameterOrientation_Default = 0, + + AAX_eParameterOrientation_BottomMinTopMax = 0, // Choose this... + AAX_eParameterOrientation_TopMinBottomMax = 1, // or this. + + AAX_eParameterOrientation_LeftMinRightMax = 0, // AND this... + AAX_eParameterOrientation_RightMinLeftMax = 2, // or this. + + // Rotary multi-Segment Display Choices + AAX_eParameterOrientation_RotarySingleDotMode = 0, // AND this... + AAX_eParameterOrientation_RotaryBoostCutMode = 4, // or this. + AAX_eParameterOrientation_RotaryWrapMode = 8, // or this. + AAX_eParameterOrientation_RotarySpreadMode = 12, // or this. + + // Rotary multi-Segment Display Polarity + AAX_eParameterOrientation_RotaryLeftMinRightMax = 0, // AND this... + AAX_eParameterOrientation_RotaryRightMinLeftMax = 16 // or this. +}; AAX_ENUM_SIZE_CHECK( AAX_EParameterOrientationBits ); + +/** @brief Typedef for a bitfield of \ref AAX_EParameterOrientationBits values + */ +typedef int32_t AAX_EParameterOrientation; + +/** @brief Query type selectors for use with \ref AAX_IEffectParameters::GetParameterValueInfo() + * + * @details + * \sa \ref AAX_EEQBandTypes + * \sa \ref AAX_EEQInCircuitPolarity + * \sa \ref AAX_EUseAlternateControl + * + * \legacy converted from \c EControlValueInfo in the legacy SDK + */ +enum AAX_EParameterValueInfoSelector +{ + /** \brief EQ filter band type + * + * \details + * Possible response values are listed in \ref AAX_EEQBandTypes + * + * \legacy converted from \c eDigi_PageTable_EQ_Band_Type in the legacy SDK + * + */ + AAX_ePageTable_EQ_Band_Type = 0, + /** \brief Description of whether a particular EQ band is active + * + * \details + * Possible response values are listed in \ref AAX_EEQInCircuitPolarity + * + * \legacy converted from \c eDigi_PageTable_EQ_InCircuitPolarity in the legacy SDK + * + */ + AAX_ePageTable_EQ_InCircuitPolarity = 1, + /** \brief Description of whether an alternate parameter should be used for a + * given slot + * + * \details + * For example, some control surfaces support Q/Slope encoders. Using an + * alternate control mechanism, plug-ins mapped to these devices can + * assign a different slope control to the alternate slot and have + * it coexist with a Q control for each band. This is only applicable + * when mapping separate parameters to the same encoder; if the Q and + * Slope controls are implemented as the same parameter object in the + * plug-in then customization is not needed. + * + * Possible response values are listed in \ref AAX_EUseAlternateControl + * + * \legacy converted from \c eDigi_PageTable_UseAlternateControl in the legacy SDK + * + */ + AAX_ePageTable_UseAlternateControl = 2 +}; AAX_ENUM_SIZE_CHECK( AAX_EParameterValueInfoSelector ); + +/** @brief Definitions of band types for EQ page table + * + * @details + * For the \ref AAX_ePageTable_EQ_Band_Type parameter value info selector + */ +enum AAX_EEQBandTypes +{ + AAX_eEQBandType_HighPass = 0, /*!< Freq, Slope */ + AAX_eEQBandType_LowShelf = 1, /*!< Freq, Gain, Slope */ + AAX_eEQBandType_Parametric = 2, /*!< Freq, Gain, Q */ + AAX_eEQBandType_HighShelf = 3, /*!< Freq, Gain, Slope */ + AAX_eEQBandType_LowPass = 4, /*!< Freq, Slope */ + AAX_eEQBandType_Notch = 5 /*!< Freq, Q */ +}; AAX_ENUM_SIZE_CHECK( AAX_EEQBandTypes ); + +/** @brief Definitions for band in/out for EQ page table. + * + * @details + * For the AAX_ePageTable_EQ_InCircuitPolarity parameter value selector + */ +enum AAX_EEQInCircuitPolarity +{ + AAX_eEQInCircuitPolarity_Enabled = 0, /*!< EQ band is in the signal path and enabled */ + AAX_eEQInCircuitPolarity_Bypassed = 1, /*!< EQ band is in the signal path but bypassed/off */ + AAX_eEQInCircuitPolarity_Disabled = 2 /*!< EQ band is completely removed from signal path */ +}; AAX_ENUM_SIZE_CHECK( AAX_EEQInCircuitPolarity ); + +/** @brief Definitions for Use Alternate Control parameter + * + * @details + * For the AAX_ePageTable_UseAlternateControl parameter value info selector + */ +enum AAX_EUseAlternateControl +{ + AAX_eUseAlternateControl_No = 0, + AAX_eUseAlternateControl_Yes = 1 +}; AAX_ENUM_SIZE_CHECK( AAX_EUseAlternateControl ); + +/*! \brief MIDI node types + + \details + \sa \ref AAX_IComponentDescriptor::AddMIDINode() + */ +enum AAX_EMIDINodeType +{ + /** \brief Local MIDI input + * + * \details + * Local MIDI input nodes receive MIDI by accessing \ref AAX_CMidiStream buffers filled with MIDI + * messages. These buffers of MIDI data are available within the algorithm context with data + * corresponding to the current audio buffer being computed. The Effect can step through this + * buffer like a "script" to respond to MIDI events within the audio callback. + * + * \legacy Corresponds to RTAS Buffered MIDI input nodes in the legacy SDK + */ + AAX_eMIDINodeType_LocalInput = 0, + /** \brief Local MIDI output + * + * \details + * Local MIDI output nodes send MIDI by filling buffers with MIDI messages. Messages posted to + * MIDI output nodes will be available in the host as MIDI streams, routable to MIDI track inputs + * and elsewhere. + * + * Data posted to a MIDI output buffer will be timed to correspond with the current audio buffer + * being processed. MIDI outputs support custom timestamping relative to the first sample of the + * audio buffer. + * + * The delivery of variable length SysEx messages is also supported. There are no buffer size + * limitations for output of SysEx messages. + * + * To post a MIDI output buffer, an Effect must construct a series of \ref AAX_CMidiPacket objects + * and place them in the output buffer provided in the port's \ref AAX_CMidiStream + * + * \legacy Corresponds to RTAS Buffered MIDI output nodes in the legacy SDK + */ + AAX_eMIDINodeType_LocalOutput = 1, + /** \brief Global MIDI node + * + * \details + * Global MIDI nodes allow an Effect to receive streaming global MIDI data like MIDI Time Code, + * MIDI Beat Clock, and host-specific message formats such as the Click messages used in Pro Tools. + * + * The specific kind of data that will be received by a Global MIDI node is specified using a mask + * of \ref AAX_EMidiGlobalNodeSelectors values. + * + * Global MIDI nodes are like local MIDI nodes, except they do not show up as assignable outputs in + * the host. Instead the MIDI data is automatically routed to the plug-in, without the user making + * any connections. + * + * The buffer of data provided via a Global MIDI node may be shared between all currently active + * Effect instances, and this node may include both explicitly requested data and data not requested + * by the current Effect. For example, if one plug-in requests MTC and another plug-in requests + * Click, all plug-ins connected to this global node will get both MTC and Click messages in the + * shared buffer. + * + * \legacy Corresponds to RTAS Shared Buffer global nodes in the legacy SDK + */ + AAX_eMIDINodeType_Global = 2, + /** \brief Transport node + * + * \details + * Call \ref AAX_IMIDINode::GetTransport() on this node to access the \ref AAX_ITransport interface. + * + * \warning See warning at \ref AAX_IMIDINode::GetTransport() regarding use of this interface + */ + AAX_eMIDINodeType_Transport = 3 +}; AAX_ENUM_SIZE_CHECK( AAX_EMIDINodeType ); + + +/** @brief Source for values passed into + \ref AAX_IACFEffectParameters::UpdateParameterNormalizedValue() "UpdateParameterNormalizedValue()". + */ +enum AAX_EUpdateSource +{ + AAX_eUpdateSource_Unspecified = 0, ///< Parameter updates of unknown / unspecified origin, currently including all updates from control surfaces, GUI edit events, and edits originating in the plug-in outside of the context of \ref AAX_IACFEffectParameters::UpdateParameterNormalizedValue() "UpdateParameterNormalizedValue()" or \ref AAX_IACFEffectParameters::SetChunk() "SetChunk()" + AAX_eUpdateSource_Parameter = 1, ///< Parameter updates originating (via \ref AAX_IAutomationDelegate::PostSetValueRequest() ) within the scope of \ref AAX_IACFEffectParameters::UpdateParameterNormalizedValue() "UpdateParameterNormalizedValue()" + AAX_eUpdateSource_Chunk = 2, ///< Parameter updates originating (via \ref AAX_IAutomationDelegate::PostSetValueRequest() ) within the scope of \ref AAX_IACFEffectParameters::SetChunk() "SetChunk()" + AAX_eUpdateSource_Delay = 3 ///< @notusedbyaax +}; AAX_ENUM_SIZE_CHECK( AAX_EUpdateSource ); + +/*! \brief Property value for whether a data in port should be + buffered or not. + + \details + \sa AAX_IComponentDescriptor::AddDataInPort() + */ +enum AAX_EDataInPortType +{ + /** Data port is unbuffered; the most recently posted packet is always delivered to the alg proc + */ + AAX_eDataInPortType_Unbuffered = 0, + /** Data port is buffered both on the host and DSP and packets are updated to the current timestamp + * with every alg proc call + * + * Data delivered to alg proc always reflects the latest posted packet that has a timestamp at or + * before the current processing buffer + */ + AAX_eDataInPortType_Buffered = 1, + /** Data port is buffered both on the host and DSP and packets are updated only once per alg proc call + * + * Since only one packet is delivered at a time, all packets will be delivered to the alg proc unless + * an internal buffer overflow occurs + * + * @note If multiple packets are posted to this port \em before the initial call to the alg proc, only + * the latest packet will be delivered to the first call to the alg proc. Thereafter, all packets will + * be delivered incrementally. + * + * @compatibility Supported in Pro Tools 12.5 and higher; when \ref AAX_eDataInPortType_Incremental is + * not supported the port will be treated as \ref AAX_eDataInPortType_Unbuffered + */ + AAX_eDataInPortType_Incremental = 2 +}; AAX_ENUM_SIZE_CHECK( AAX_EDataInPortType ); + +/*! \brief FrameRate types + + \details + \sa AAX_ITransport::GetTimeCodeInfo() + \sa AAX_ITransport::GetHDTimeCodeInfo() + */ +enum AAX_EFrameRate +{ + AAX_eFrameRate_Undeclared = 0, + AAX_eFrameRate_24Frame = 1, + AAX_eFrameRate_25Frame = 2, + AAX_eFrameRate_2997NonDrop = 3, + AAX_eFrameRate_2997DropFrame = 4, + AAX_eFrameRate_30NonDrop = 5, + AAX_eFrameRate_30DropFrame = 6, + AAX_eFrameRate_23976 = 7, + AAX_eFrameRate_47952 = 8, + AAX_eFrameRate_48Frame = 9, + AAX_eFrameRate_50Frame = 10, + AAX_eFrameRate_5994NonDrop = 11, + AAX_eFrameRate_5994DropFrame = 12, + AAX_eFrameRate_60NonDrop = 13, + AAX_eFrameRate_60DropFrame = 14, + AAX_eFrameRate_100Frame = 15, + AAX_eFrameRate_11988NonDrop = 16, + AAX_eFrameRate_11988DropFrame = 17, + AAX_eFrameRate_120NonDrop = 18, + AAX_eFrameRate_120DropFrame = 19 +}; AAX_ENUM_SIZE_CHECK( AAX_EFrameRate ); + +/*! \brief FeetFramesRate types + + \details + \sa AAX_ITransport::GetFeetFramesInfo() + */ +enum AAX_EFeetFramesRate +{ + AAX_eFeetFramesRate_23976 = 0, + AAX_eFeetFramesRate_24 = 1, + AAX_eFeetFramesRate_25 = 2 +}; AAX_ENUM_SIZE_CHECK( AAX_EFeetFramesRate ); + + +/*! \brief The Global MIDI Node Selectors + * + * \details + * These selectors are used in the \a channelMask argument of + * \ref AAX_IComponentDescriptor::AddMIDINode() and \ref AAX_IEffectDescriptor::AddControlMIDINode() + * to request one or more kinds of global data. + */ +enum AAX_EMidiGlobalNodeSelectors +{ + /*! + * \brief Selector to request click messages + * + * \details + * The click messages are special 2-byte messages encoded as follows: + * \li Accented click: Note on pitch 0 (0x90 0x00) + * \li Unaccented click: Note on pitch 1 (0x90 0x01) + * \note No Note Off messages are ever sent. This isn't up-to-spec MIDI data, just a way of encoding click events. + */ + AAX_eMIDIClick = 1 << 0, + /*! + * \brief Selector to request MIDI Time Code (MTC) data. + * + * \details + * The Standard MIDI Time Code format. + */ + AAX_eMIDIMtc = 1 << 1, + /*! + * \brief Selector to request MIDI Beat Clock (MBC) messages. + * + * \details + * This includes Song Position Pointer, Start/Stop/Continue, and Midi Clock (F8). + */ + AAX_eMIDIBeatClock = 1 << 2 + +}; AAX_ENUM_SIZE_CHECK( AAX_EMidiGlobalNodeSelectors ); + +/** @brief Offline preview states for use with \ref AAX_eNotificationEvent_ASPreviewState + + @details + \note Do not perform any non-trivial processing within the notification handler. Instead, + use the processing state notification to inform the processing that is performed in + methods such as \ref AAX_CHostProcessor::PreRender() "PreRender()". + */ +enum AAX_EPreviewState +{ + /** \brief Offline preview has ended + + \details + For \ref AuxInterface_HostProcessor "Host Processor" plug-ins, this notification is + sent just before the final call to \ref AAX_IHostProcessor::PostRender() "PostRender()", + or after analysis is complete for plug-ins with analysis-only preview. + */ + AAX_ePreviewState_Stop = 0, + /** \brief Offline preview is beginning + + \details + For \ref AuxInterface_HostProcessor "Host Processor" plug-ins, this notification is + sent before any calls to \ref AAX_IHostProcessor::PreAnalyze() "PreAnalyze()" or to + \ref AAX_IHostProcessor::PreRender() "PreRender()". + */ + AAX_ePreviewState_Start = 1 +}; AAX_ENUM_SIZE_CHECK( AAX_EPreviewState ); + +/** @brief Offline preview states for use with \ref AAX_eNotificationEvent_ASProcessingState + + @details + \note Do not perform any non-trivial processing within the notification handler. Instead, + use the processing state notification to inform the processing that is performed in + methods such as \ref AAX_CHostProcessor::PreRender() "PreRender()". + */ +enum AAX_EProcessingState +{ + /** \brief A single offline processing pass has ended + + \details + A single offline processing pass is an analysis and/or render applied to a set of + channels in parallel. + + For \ref AuxInterface_HostProcessor "Host Processor" plug-ins, this notification is + sent just before the final call to \ref AAX_IHostProcessor::PostRender() "PostRender()", + or after analysis is complete for analysis-only offline plug-ins. + */ + AAX_eProcessingState_StopPass = 2, + /** \brief A single offline processing pass is beginning + + \details + A single offline processing pass is an analysis and/or render applied to a set of + channels in parallel. + + For \ref AuxInterface_HostProcessor "Host Processor" plug-ins, this notification is + sent before any calls to \ref AAX_IHostProcessor::PreAnalyze() "PreAnalyze()", + \ref AAX_IHostProcessor::PreRender() "PreRender()", or + \ref AAX_IHostProcessor::InitOutputBounds() "InitOutputBounds()" for each processing + pass. + */ + AAX_eProcessingState_StartPass = 3, + /** \brief An offline processing pass group has completed + + \details + An offline processing pass group is a full set of analysis and/or render passes + applied to the complete set of input channels. + + \compatibility AudioSuite pass group notifications are supported starting in + Pro Tools 12.0 + */ + AAX_eProcessingState_EndPassGroup = 4, + /** \brief An offline processing pass group is beginning + + \details + An offline processing pass group is a full set of analysis and/or render passes + applied to the complete set of input channels. + + \compatibility AudioSuite pass group notifications are supported starting in + Pro Tools 12.0 + */ + AAX_eProcessingState_BeginPassGroup = 5, + + AAX_eProcessingState_Stop = AAX_eProcessingState_StopPass, ///< \deprecated + AAX_eProcessingState_Start = AAX_eProcessingState_StartPass ///< \deprecated +}; AAX_ENUM_SIZE_CHECK( AAX_EProcessingState ); + +/// @brief Describes what platform the component runs on. +enum AAX_ETargetPlatform +{ + kAAX_eTargetPlatform_None = 0, + kAAX_eTargetPlatform_Native = 1, // For host-based components + kAAX_eTargetPlatform_TI = 2, // For TI components + kAAX_eTargetPlatform_External = 3, // For components running on external hardware + kAAX_eTargetPlatform_Count = 5 +}; AAX_ENUM_SIZE_CHECK( AAX_ETargetPlatform ); + +/** Feature support indicators + + \sa \ref AAX_IDescriptionHost::AcquireFeatureProperties() + + \note: There is no value defined for unknown features. Intead, unknown features are + indicated by + \ref AAX_IDescriptionHost::AcquireFeatureProperties() "AcquireFeatureProperties()" + providing a null \ref AAX_IFeatureInfo in response to a request using the unknown + feature UID + */ +enum AAX_ESupportLevel +{ + /** An uninitialized \ref AAX_ESupportLevel + */ + AAX_eSupportLevel_Uninitialized = 0, + + /** The feature is known but explicitly not supported + */ + AAX_eSupportLevel_Unsupported = 1 + + /** The feature is at least partially supported + */ + ,AAX_eSupportLevel_Supported = 2 + + /** The feature is supported but disabled due to current settings + + For example, the feature may be supported by the software but not allowed due to + a lack of user entitlements. + + A host is not required to provide information about disabled features. The host + may simply provide \ref AAX_eSupportLevel_Supported even for features which are + disabled. + */ + ,AAX_eSupportLevel_Disabled = 3 + + /** This feature's support level depends on values in the property map + + For example, to get information about stem format support the property map must + be queried for individual stem formats + */ + ,AAX_eSupportLevel_ByProperty = 4 +}; AAX_ENUM_SIZE_CHECK( AAX_ESupportLevel ); + +/** @brief Host levels + + Some %AAX software hosts support different levels which are sold as separate products. + For example, there may be an entry-level version of a product as well as a full + version. + + The level of a host may impact the user experience, workflows, or the availability of + certain plug-ins. For example, some entry-level hosts are restricted to loading only + specific plug-ins. + + Typically an %AAX plug-in should not need to query this information or change its + behavior based on the level of the host. + + @sa \ref AAXATTR_Client_Level + */ +enum AAX_EHostLevel +{ + AAX_eHostLevel_Unknown = 0 + ,AAX_eHostLevel_Standard = 1 ///< Standard host level + ,AAX_eHostLevel_Entry = 2 ///< Entry-level host + ,AAX_eHostLevel_Intermediate = 3 ///< Intermediate-level host +}; AAX_ENUM_SIZE_CHECK( AAX_EHostLevel ); + +/// @brief Describes possible string encodings. +enum AAX_ETextEncoding +{ + AAX_eTextEncoding_Undefined = -1 + ,AAX_eTextEncoding_UTF8 = 0 ///< UTF-8 string encoding + + ,AAX_eTextEncoding_Num +}; AAX_ENUM_SIZE_CHECK( AAX_ETextEncoding ); + +/** @brief Flags for use with \ref AAX_IHostServices::HandleAssertFailure() + */ +enum AAX_EAssertFlags +{ + AAX_eAssertFlags_Default = 0, ///< No special handler requested + AAX_eAssertFlags_Log = 1 << 0, ///< Logging requested + AAX_eAssertFlags_Dialog = 1 << 1, ///< User-visible modal alert dialog requested +}; AAX_ENUM_SIZE_CHECK( AAX_EAssertFlags ); + +// ENUM: AAX_ETransportState +/** \brief Used to indicate the current transport state of the host. + This is the global transport state; it does not indicate a track-specific state + */ +enum AAX_ETransportState +{ + AAX_eTransportState_Unknown = 0, + AAX_eTransportState_Stopping = 1, + AAX_eTransportState_Stop = 2, + AAX_eTransportState_Paused = 3, + AAX_eTransportState_Play = 4, + AAX_eTransportState_FastForward = 5, + AAX_eTransportState_Rewind = 6, + AAX_eTransportState_Scrub = 11, + AAX_eTransportState_Shuttle = 12, + + AAX_eTransportState_Num +}; AAX_ENUM_SIZE_CHECK(AAX_ETransportState); + +// ENUM: AAX_ERecordMode +/** \brief Used to indicate the current record mode of the host. + This is the global record mode; it does not indicate a track-specific state + */ +enum AAX_ERecordMode +{ + AAX_eRecordMode_Unknown = 0, + AAX_eRecordMode_None = 1, + AAX_eRecordMode_Normal = 2, + AAX_eRecordMode_Destructive = 3, + AAX_eRecordMode_QuickPunch = 4, + AAX_eRecordMode_TrackPunch = 5, + + AAX_eRecordMode_Num +}; AAX_ENUM_SIZE_CHECK(AAX_ERecordMode); + +/// @cond ignore +#endif // include guard +/// @endcond diff --git a/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_EnvironmentUtilities.h b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_EnvironmentUtilities.h new file mode 100644 index 0000000000..532ad1c1a5 --- /dev/null +++ b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_EnvironmentUtilities.h @@ -0,0 +1,87 @@ +/*================================================================================================*/ +/* + + AAX_EnvironmentUtilities.h + + Copyright 2018-2019, 2023-2024 Avid Technology, Inc. + All rights reserved. + + This file is part of the Avid AAX SDK. + + The AAX SDK is subject to commercial or open-source licensing. + + By using the AAX SDK, you agree to the terms of both the Avid AAX SDK License + Agreement and Avid Privacy Policy. + + AAX SDK License: https://developer.avid.com/aax + Privacy Policy: https://www.avid.com/legal/privacy-policy-statement + + Or: You may also use this code under the terms of the GPL v3 (see + www.gnu.org/licenses). + + THE AAX SDK IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER + EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE + DISCLAIMED. +*/ + +/** + * \file AAX_EnvironmentUtilities.h + * + * \brief Useful environment definitions for %AAX + * + */ +/*================================================================================================*/ + +#ifndef _AAX_ENVIRONMENTUTILITIES_H_ +#define _AAX_ENVIRONMENTUTILITIES_H_ + +#include + +#if (!defined (WINDOWS_VERSION)) +# if (defined (_WIN32)) +# define WINDOWS_VERSION 1 +# endif +#elif (defined (MAC_VERSION) || defined (LINUX_VERSION)) +# error "AAX SDK: Cannot declare more than one OS environment" +#endif + +#if (!defined (MAC_VERSION)) +# if (defined (__APPLE__) && defined (__MACH__)) +# include "TargetConditionals.h" +# if (TARGET_OS_MAC) +# define MAC_VERSION 1 +# endif +# endif +#elif (defined (WINDOWS_VERSION) || defined (LINUX_VERSION)) +# error "AAX SDK: Cannot declare more than one OS environment" +#endif + +#if (!defined (LINUX_VERSION)) +# if (defined (__linux__)) +# define LINUX_VERSION 1 +# endif +#elif (defined (WINDOWS_VERSION) || defined (MAC_VERSION)) +# error "AAX SDK: Cannot declare more than one OS environment" +#endif + +#if (!defined (WINDOWS_VERSION) && !defined (MAC_VERSION) && !defined (LINUX_VERSION)) +# warning "AAX SDK: Unknown OS environment" +#endif + +namespace AAX +{ + static bool IsVenueSystem(void) + { +#if WINDOWS_VERSION + static const char * const environmentVariableName = "JEX_HOST_TYPE"; + static const char * const venueEnvironment = "venue"; + static const char * const environment = std::getenv ( environmentVariableName ); + static const bool isVenue = ( NULL != environment) && (0 == strcmp ( environment, venueEnvironment ) ); + return isVenue; +#else + return false; +#endif + } +} + +#endif // _AAX_ENVIRONMENTUTILITIES_H_ diff --git a/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_Errors.h b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_Errors.h new file mode 100644 index 0000000000..8c19e819d7 --- /dev/null +++ b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_Errors.h @@ -0,0 +1,695 @@ +/*================================================================================================*/ +/* + * + * Copyright 2010-2017, 2019-2021, 2023-2024 Avid Technology, Inc. + * All rights reserved. + * + * This file is part of the Avid AAX SDK. + * + * The AAX SDK is subject to commercial or open-source licensing. + * + * By using the AAX SDK, you agree to the terms of both the Avid AAX SDK License + * Agreement and Avid Privacy Policy. + * + * AAX SDK License: https://developer.avid.com/aax + * Privacy Policy: https://www.avid.com/legal/privacy-policy-statement + * + * Or: You may also use this code under the terms of the GPL v3 (see + * www.gnu.org/licenses). + * + * THE AAX SDK IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER + * EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE + * DISCLAIMED. + * + */ + +/** + * \file AAX_Errors.h + * + * \brief Definitions of error codes used by %AAX plug-ins + * + */ +/*================================================================================================*/ + + +/// @cond ignore +#ifndef AAX_ERRORS_H +#define AAX_ERRORS_H +/// @endcond + +#include "AAX_Enums.h" + +/** AAX result codes + + \internal Any new codes added here must also be added to AAX::AsStringResult + \endinternal + */ +enum AAX_EError +{ + AAX_SUCCESS = 0, + + AAX_ERROR_INVALID_PARAMETER_ID = -20001, + AAX_ERROR_INVALID_STRING_CONVERSION = -20002, + AAX_ERROR_INVALID_METER_INDEX = -20003, + AAX_ERROR_NULL_OBJECT = -20004, + AAX_ERROR_OLDER_VERSION = -20005, + AAX_ERROR_INVALID_CHUNK_INDEX = -20006, + AAX_ERROR_INVALID_CHUNK_ID = -20007, + AAX_ERROR_INCORRECT_CHUNK_SIZE = -20008, + AAX_ERROR_UNIMPLEMENTED = -20009, + AAX_ERROR_INVALID_PARAMETER_INDEX = -20010, + AAX_ERROR_NOT_INITIALIZED = -20011, + AAX_ERROR_ACF_ERROR = -20012, + AAX_ERROR_INVALID_METER_TYPE = -20013, + AAX_ERROR_CONTEXT_ALREADY_HAS_METERS = -20014, + AAX_ERROR_NULL_COMPONENT = -20015, + AAX_ERROR_PORT_ID_OUT_OF_RANGE = -20016, + AAX_ERROR_FIELD_TYPE_DOES_NOT_SUPPORT_DIRECT_ACCESS = -20017, + AAX_ERROR_DIRECT_ACCESS_OUT_OF_BOUNDS = -20018, + AAX_ERROR_FIFO_FULL = -20019, + AAX_ERROR_INITIALIZING_PACKET_STREAM_THREAD = -20020, + AAX_ERROR_POST_PACKET_FAILED = -20021, + AAX_RESULT_PACKET_STREAM_NOT_EMPTY = -20022, + AAX_RESULT_ADD_FIELD_UNSUPPORTED_FIELD_TYPE = -20023, + AAX_ERROR_MIXER_THREAD_FALLING_BEHIND = -20024, + AAX_ERROR_INVALID_FIELD_INDEX = -20025, + AAX_ERROR_MALFORMED_CHUNK = -20026, + AAX_ERROR_TOD_BEHIND = -20027, + AAX_RESULT_NEW_PACKET_POSTED = -20028, + AAX_ERROR_PLUGIN_NOT_AUTHORIZED = -20029, //return this from EffectInit() if the plug-in doesn't have proper license. + AAX_ERROR_PLUGIN_NULL_PARAMETER = -20030, + AAX_ERROR_NOTIFICATION_FAILED = -20031, + AAX_ERROR_INVALID_VIEW_SIZE = -20032, + AAX_ERROR_SIGNED_INT_OVERFLOW = -20033, + AAX_ERROR_NO_COMPONENTS = -20034, + AAX_ERROR_DUPLICATE_EFFECT_ID = -20035, + AAX_ERROR_DUPLICATE_TYPE_ID = -20036, + AAX_ERROR_EMPTY_EFFECT_NAME = -20037, + AAX_ERROR_UNKNOWN_PLUGIN = -20038, + AAX_ERROR_PROPERTY_UNDEFINED = -20039, + AAX_ERROR_INVALID_PATH = -20040, + AAX_ERROR_UNKNOWN_ID = -20041, + AAX_ERROR_UNKNOWN_EXCEPTION = -20042, ///< An AAX plug-in should return this to the host if an unknown exception is caught. Exceptions should never be passed to the host. + AAX_ERROR_INVALID_ARGUMENT = -20043, ///< One or more input parameters are invalid; all output parameters are left unchanged. + AAX_ERROR_NULL_ARGUMENT = -20044, ///< One or more required pointer arguments are null + AAX_ERROR_INVALID_INTERNAL_DATA = -20045, ///< Some part of the internal data required by the method is invalid. \sa AAX_ERROR_NOT_INITIALIZED + AAX_ERROR_ARGUMENT_BUFFER_OVERFLOW = -20046, ///< A buffer argument was not large enough to hold the data which must be placed within it + AAX_ERROR_UNSUPPORTED_ENCODING = -20047, ///< Unsupported input argument text encoding + AAX_ERROR_UNEXPECTED_EFFECT_ID = -20048, ///< Encountered an effect ID with a different value from what was expected + AAX_ERROR_NO_ABBREVIATED_PARAMETER_NAME = -20049, ///< No parameter name abbreviation with the requested properties has been defined + AAX_ERROR_ARGUMENT_OUT_OF_RANGE = -20050, ///< One or more input parameters are out of the expected range, e.g. an index argument that is negative or exceeds the number of elements + AAX_ERROR_PRINT_FAILURE = -20051, ///< A failure occurred in a "print" library call such as @c printf + + + AAX_ERROR_PLUGIN_BEGIN = -20600, ///< Custom plug-in error codes may be placed in the range ( \ref AAX_ERROR_PLUGIN_END, \ref AAX_ERROR_PLUGIN_BEGIN ] + AAX_ERROR_PLUGIN_END = -21000 ///< Custom plug-in error codes may be placed in the range ( \ref AAX_ERROR_PLUGIN_END, \ref AAX_ERROR_PLUGIN_BEGIN ] +}; AAX_ENUM_SIZE_CHECK( AAX_EError ); + + + + + + + + + +///////////////////////////////////////////////////////////////////////////// +///////////////////////////////////////////////////////////////////////////// +// AAE and other known AAX host error codes // +// Listed here as a reference // +///////////////////////////////////////////////////////////////////////////// +///////////////////////////////////////////////////////////////////////////// + +// FicErrors.h +/* + +// +// NOTE: (Undefined) comments for an error code mean that it's +// either no longer supported or returned from another source +// other than DAE. +// + +//---------------------------------------------------------------------------- +// Error codes for all of Fic +//---------------------------------------------------------------------------- + +enum { + kFicHostTimeoutErr = -9003, // Host Timeout Error. DSP is not responding. + kFicHostBusyErr = -9004, // (Undefined) + kFicLowMemoryErr = -9006, // DAE was unable to allocate memory. Memory is low. + kFicUnimplementedErr = -9007, // An unimplemented method was called. + kFicAllocatedErr = -9008, // (Undefined) + kFicNILObjectErr = -9013, // Standard error return when an object is NULL. + kFicNoDriverDSPErr = -9014, // Missing DSPPtr from the SADriver. + kFicBadIndexErr = -9015, // Index to an array or list is invalid. + kFicAlreadyDeferredErr = -9017, // Tried to install a deferred task when the task was already deferred. + kFicFileSystemBusyErr = -9019, // PB chain for an audio file returned an error for a disk task. + kFicRunningErr = -9020, // Tried to execute code when the deck was started. + kFicTooManyItemsErr = -9022, // Number of needed items goes beyond a lists max size. + kFicItemNotFoundErr = -9023, // Unable to find an object in a list of objects. + kFicWrongTypeErr = -9024, // Type value not found or not supported. + kFicNoDeckErr = -9025, // Standard error returned from other objects that require a deck object. + kFicNoDSPErr = -9028, // Required DSP object is NULL. + kFicNoFeederErr = -9029, // (Undefined) + kFicNoOwnerErr = -9030, // Play or record track not owned by a channel. + kFicPrimedErr = -9031, // Tried to execute code when the deck was primed. + kFicAlreadyAttached = -9032, // DAE object already attached to another DAE object. + kFicTooManyDSPTracksErr = -9033, // The user has run out of virtual tracks for a given card or dsp. + kFicParseErr = -9035, // While trying to parse a data structure ran into an error. + kFicNotAcquiredErr = -9041, // Tried to execute code when an object needs to be acquired first. + kFicNoSSIClockErr = -9045, // DSP does not recieve peripheral clock interrupts. + kFicNotFound = -9048, // Missing DAE resource or timeout occured while waiting for DAE to launch. + kFicCantRecordErr = -9050, // Error returned when CanRecord() returns false. Exp: Recording on scrub channel. + kFicWrongObjectErr = -9054, // Object size or pointers do not match. + kFicLowVersionErr = -9055, // Errors with version number too low. + kFicNotStartedErr = -9057, // Tried to execute code when the deck was not started yet. + kFicOnly1PunchInErr = -9059, // Error when deck can only support a single punch in. + kFicAssertErr = -9060, // Generic error when a format does not match. + kFicScrubOnlyErr = -9061, // Tried to scrub in a non-scrub mode or on a sys axe channel. + kFicNoSADriverErr = -9062, // InitSADriver failed. Possible missing DigiSystem INIT. + kFicCantFindDAEFolder = -9064, // Unable to find "DAE Folder" in the system folder. + kFicCantFindDAEApp = -9065, // Unable to find DAE app in the DAE Folder. + kFicNeeds32BitModeErr = -9066, // DAE runs only in 32 bit mode. + kFicHatesVirtualMemErr = -9068, // DAE will not run if virtual memory is turned on. + kFicSCIConnectErr = -9070, // Unable to get SCI ports between two dsp's to communicate. + kFicSADriverVersionErr = -9071, // Unable to get DigiSystem INIT version or it's version is too low. + kFicUserCancelledErr = -9072, // User chose to cancel or quit operation from DAE dialog. + kFicDiskTooSlowErr = -9073, // Disk action did not complete in time for next command. + kFicAudioTrackTooDense1 = -9074, // Audio playlist is too dense. + kFicAudioTrackTooDense2 = -9075, // Audio playlist is too dense for silience play list. + kFicCantDescribeZone = -9076, // Zone description is NULL. + kFicCantApplyPlayLimits = -9077, // Ran out of time regions for a zone. + kFicCantApplySkipMode = -9078, // Ran out of time regions for a zone in skip mode. + kFicCantApplyLoop = -9079, // Ran out of time regions for a zone in loop mode. + kFicAutoSortErr = -9084, // DSP event elements are not sorted in relation to time. + kFicNoAutoEvent = -9085, // No event list for an auto parser. + kFicAutoTrackTooDense1 = -9086, // Automation event scripts are too dense. + kFicAutoTrackTooDense2 = -9087, // Ran out of free events for the automation parser. + kFicNothingAllowedErr = -9088, // Missing allowed decks for the hw setup dialog. + kFicHardwareNotFreeErr = -9089, // Unable to select a deck because the hardware is allocated or not available. + kFicUnderrunErr9093 = -9093, // Under run error from the DSP. + kFicBadVRefNumErr = -9095, // Audio file is not on the propper disk SCSI chain. + kFicNoPeripheralSelected = -9096, // Deck can not be aquired without a peripheral being selected. + kFicLaunchMemoryErr = -9097, // Unable to launch DAE because of a memory error. DAE does NOT launch. + kFicGestaltBadSelector = -9099, // Gestalt selector not supported. + kDuplicateWriteFiles = -9118, // Writing to the same file multiple times during processing. + kFicCantGetTempBuffer = -9121, // Disk scheduler ran out of temporary buffers. Playlist is too complex. + kFicPendingRequestsFull = -9122, // (Undefined) + kFicRequestHandlesFull = -9123, // (Undefined) + kFicAnonymousDrive = -9124, // (Win32) Disk scheduler can't use a drive that doesn't have a drive signature. + kFicComputerNeedsRestart = -9127, // DAE state has changed such that the computer needs to restart + kFicCPUOverload = -9128, // Host processing has exceeded its CPU allocation. + kFicHostInterruptTooLong = -9129, // Host processing held off other system interrupts for too long. + kFicBounceHandlerTooSlow = -9132, + kFicBounceHandlerTooSlowToConvertWhileBouncing = -9133, + kFicMBoxLostConnection = -9134, // MBox was disconnected during playback + kFicMBoxNotConnected = -9135, // MBox is not connected + kFicUSBIsochronousUnderrun = -9136, // USB audio streaming underrun + kFicAlreadyAcquired = -9137, // tried to change coarse sample rate on already acquired deck + kFicTDM2BusTopologyErr = -9138, // eDsiTDM2BusTopologyErr was returned from DSI. + kFicDirectIODHSAlreadyOpen = -9142, // can't run if a DirectIO client is running DHS right now + kFicAcquiredButChangedBuffers = -9143, // DAE was able to acquire the device but had to change the disk buffers size to do it. + kFicStreamManagerUnderrun = -9144, // received error from StreamManager + kDirectMidiError = -9145, // an error occurred in the DirectMidi subsytem + kFicResourceForkNotFound = -9146, // Could not find the DAE resource fork (i.e. fnfErr) + kFicInputDelayNotSupported = -9147, + kFicInsufficientBounceStreams = -9148, + kFicAutoTotalTooDenseForDSP = -9155, // (Undefined) + kBadPlugInSpec = -9156, // Default error returned when there's no component object attatched to a spec. + kFicFarmRequiredErr = -9157, // Error returned by objects that require a DSP farm in the system. + kFicPlugInDidSetCursor = -9163, // When returned by FicPlugInEvent, the plug-in DID change the cursor. + kFicMaxFileCountReached = -9168, // Max number of files open has been reached + kFicCantIncreaseAIOLimits = -9169, // Can't increase the AIO kernel limits on OSX. DigiShoeTool is probably not installed correctly. + kFicGreenOverrunWhileVSOIsOn = -9170, // A PIO underrun/overrun occurred while varispeed is on; should probably warn the user this can happen. + kFicBerlinGreenStreamingError = -9171, + kFicHardwareDeadlineMissedErr = -9172, + kFicStatePacketUnderrun = -9173, // Low-latency engine ran out of state packets sent from high-latency engine + kFicCannotCompleteRequestError = -9174, + kFicNILParameterError = -9175, // Method called with one or more required parameters set to NULL + kFicMissingOrInvalidAllowedPlugInsListFile = -9176, // PT First-specific: could not parse the "Allowed" plug-ins file + kFicBufferNotLargeEnoughError = -9177, // Method called with a data buffer that is too small for the requested data + kFicInitializationFailed = -9178, // Error caught during FicInit + kFicPostPacketFailed = -9179, // Error triggered by AAXH_CPlugIn::PostPacket + +}; + +// Weird errors preserved here for backwards compatibility (i.e., older DAE's returned these errors, so we should also): + +enum { + kFicBeyondPlayableRange = -9735 // Session playback passed the signed 32 bit sample number limit ( = kFicParseErr - 700). +}; + + +//---------------------------------------------------------------------------- +// Error codes returned from the SADriver/DigiSystem INIT via DAE +//---------------------------------------------------------------------------- + +enum { + kFicSADriverErrOffset = -9200, // Offset only, should never be returned as a result. + kSADUnsupported = -9201, // Unsupported feature being set from a piece of hardware. + kSADNoStandardShell = -9202, // Unable to load standard shell code resource. + kSADTooManyPeripherals = -9203, // Went beyond the max number of peripherals allowed in the code. + kSADHostTimeoutErr = -9204, // Timeout occured while trying to communicate with the DSP's host port. + kSADInvalidValue = -9205, // Invalid value being set to a hardware feature. + kSADInvalidObject = -9206, // NULL object found when a valid object is required. + + kSADNILClient = -9210, // Trying to opperate on a NULL client. + kSADClientRegistered = -9211, // Client already registered. + kSADClientUnregistered = -9212, // Trying to remove a client when it's not registered. + kSADNoListener = -9213, // No client to respond to a message from another client. + + kSADCardOwned = -9220, // A card is owned by a client. + kSADDSPOwned = -9230, // A DSP is owned by a client. + + kSADNILShell = -9240, // Trying to opperate on a NULL shell. + kSADShellRegistered = -9241, // Shell already registered. + kSADShellUnregistered = -9242, // Trying to remove a shell when it's not registered. + kSADShellTooSmall = -9243, // (Undefined) + kSADShellTooLarge = -9244, // DSP code runs into standard shell or runs out of P memory. + kSADStandardShell = -9245, // Trying to unregister the standard shell. + + kSADNoDriverFile = -9250, // Unable to open or create the DigiSetup file. + kSADDriverFileUnused = -9251, // Trying to free the DigiSetup file when it hasn't been openned. + kSADNILResource = -9252, // Resource not found in the DigiSetup file. + kSADBadSize = -9253, // Resource size does not match pointer size requested. + kSADBadSlot = -9254, // NuBus slot value is out of range for the system. + kSADBadIndex = -9255 // DSP index is out of range for the system. +}; + + +//---------------------------------------------------------------------------- +// Error codes for Elastic audio +//---------------------------------------------------------------------------- +enum { + kFicElasticGeneralErr = -9400, // don't know what else to do + kFicElasticUnsupported = -9401, // requested op unsupported + kFicElasticCPUOverload = -9403, // Like kFicCPUOverload but for Fela + kFicElasticOutOfMemory = -9404, // you're not going to last long... + kFicElasticTrackTooDense = -9405, // like kFicAudioTrackTooDense1; feeder list too big + kFicElasticInadequateBuffering = -9406, // reserved buffers for Fela data too small + kFicElasticConnectionErr = -9408, // Problem with a plugin connection + kFicElasticDriftBackwardsErr = -9411, // disconnect between DAE (app?) and plugin data consumption rates + kFicElasticDriftForwardsErr = -9412, // disconnect between DAE (app?) and plugin data consumption rates + kFicElasticPlugInLimitsErr = -9413, // problem with plugin drift/lookAhead; too much requested? + kFicElasticInvalidParameter = -9415, // Elastic function was passed a bad parameter + kFicElasticInvalidState = -9416, // Elastic track's internal state is in error. + kFicElasticPlugInConnected = -9417, // Can't change stem format once an elastic plugin is already connected to a track + kFicElasticEphemeralAllocErr = -9419, // ephemeral buffer alloc failure + kFicElasticDiskTooSlowErr = -9473, // Like -9073, but caught in a new way (Elastic needs disk data sooner) +}; + +//---------------------------------------------------------------------------- +// Error codes for Clip Gain RT Fades +//---------------------------------------------------------------------------- +enum { + kFicClipGainRTFadesFadeOutofBounds = 9480, +}; + +//---------------------------------------------------------------------------- +// Error codes for Disk Cache +//---------------------------------------------------------------------------- +enum { + kFicDiskCachePageOverflow = -9500, // not enough pages in the cache to fulfill page request. + kFicDiskCacheWriteErr = -9502, // problem writing to the disk cache. + kFicDiskCacheDiskWriteErr = -9503, // problem writing to disk from the cache. + kFicDiskCacheInvalidNull = -9504, // invalid NULL variable. NULL and 0 have special meaning in the cache. + kFicDiskCacheMissingDataErr = -9506, // data that's supposed to be in the cache is not. + kFicDiskCacheGeneralErr = -9507, // general error. + kFicDiskCacheDoubleLRUPageErr = -9508, // duplicate page in the LRU. + kFicDiskCacheDoubleOwnerPageErr = -9509, // two pages with the same owner. + kFicDiskCachePageLeakErr = -9510, // page leak in the allocator. + kFicDiskCacheMappingErr = -9511, // corruption in mapping of disk cache objects to the page allocator + kFicDiskCacheUnityFileErr = -9513, // Unity and ISIS are incompatible with the disk cache's temporary buffers + kFicDiskCacheOutOfMemory = -9514, // Couldn't allocate the disk cache! 32bits will suffocate us all. + kFicNativeDiskCacheOutOfMemory = -9515, // Couldn't allocate the disk cache on a Native system! +}; + +//---------------------------------------------------------------------------- +// Error codes for FPGA DMA Device(Green and Berlin cards) +//---------------------------------------------------------------------------- +enum { + kFicFpgaDmaDevicePIOOverflow = -9600, // PIO ring buffer overflowed + kFicFpgaDmaDevicePIOUnderflow = -9601, // PIO ring buffer underflow + kFicFpgaDmaDevicePIOSyncErr = -9602, // PIO sync error + kFicFpgaDmaDevicePIOClockChange = -9603, // PIO clock change error + kFicFpgaDmaDevicePIOUnknownErr = -9604, // PIO unknown error + kFicFpgaDmaDeviceTDMRcvOverflow = -9605, // TDM receive overflow + kFicFpgaDmaDeviceTDMXmtUnderflow = -9606, // TDM transmit underflow + kFicFpgaDmaDeviceTDMSyncErr = -9607, // TDM sync error + kFicFpgaDmaDeviceTDMCRCErr = -9608, // TDM CRC error + kFicFpgaDmaDeviceTDM_NO_Xbar_Txdata_error = -9609, // TDM NO_Xbar_Txdata_error + kFicFpgaDmaDeviceTDMUnknownErr = -9610, // TDM unknown error + kFicFpgaDmaDeviceRegRdTimeoutErr = -9611, // RegRdTimeoutErr + kFicFpgaDmaDeviceTemperatureErr = -9612, // Temperature error +}; + +//---------------------------------------------------------------------------- +// Various Widget Error Codes +//---------------------------------------------------------------------------- + +enum { + + // External Callback Proc Errors -7000..-7024 + kSelectorNotSupported = -7000, // This selector ID is unknown currently. + kWidgetNotFound = -7001, // Refnum did not specify a known widget. + + // Plug-In Manager Errors -7025..-7049 + kPlugInNotInstantiated = -7026, // A non-instantiated plug-in was asked to do something. + kNilComponentObject = -7027, // A component-referencing object was NIL. + kWidgetNotOpen = -7028, // A non-instantiated widget was asked to do something. + //TIMILEONE ADD + kDspMgrError = -7030, // An error originating in DspMgr returned + kEffectInstantiateError = -7032, // Problem occurred attempting to instantiate a plug-in. + + // Plug-In Manager Errors -7050..-7075 + kNotEnoughHardware = -7050, // Not enough hardware available to instantiate a plug-in. + kNotEnoughTDMSlots = -7052, // Not enough TDM slots available to instantiate a plug-in. + kCantInstantiatePlugIn = -7054, // Unable to instantiate a plug-in (generic error). + kCantFindPlugIn = -7055, // Unable to find the specified plug-in. + kNoPlugInsExist = -7056, // No plug-ins at all exist. + kPlugInUnauthorized = -7058, // To catch uncopyprotected plugins + kInvalidHostSignalNet = -7062, // The signalNet ptr does not correspond to a CHostSignalNet instance + // The RTAS/TDM plug-in would be disabled because the corresponding AAX plug-in exists. + // + // The following lower-level errors can also be converted to kPlugInDisabled: + // kAAXH_Result_FailedToRegisterEffectPackageWrongArchitecture + // kAAXH_Result_PluginBuiltAgainstIncompatibleSDKVersion + kPlugInDisabled = -7063, + kPlugInNotAllowed = -7064, // The plug-in not allowed to load + + // Widget errors (returned by calls to widget functions): -7075..-7099. + kWidgetUnsupportedSampleRate = -7081, // Widget cannot instantiate at the current sample rate + + // Connection errors: -7100..-7124 + kInputPortInUse = -7100, // Tried to connect to an input that is already connected. + kOutputPortCannotConnect = -7101, // Specified output port has reached its limit of output connections. + kInvalidConnection = -7103, // Invalid or freed connection reference passed. + kBadConnectionInfo = -7104, // TDM talker & listener data not consistent on disconnect. + kFreeConnectionErr = -7105, // Could not delete connection info. + kInvalidPortNum = -7106, // Out-of-range or nonexistent port number specified. + kPortIsDisconnected = -7107, // Tried to disconnect a disconnected port. + + kBadStemFormat = -7110, + kBadInputStemFormat = -7111, + kBadOutputStemFormat = -7112, + kBadSideChainStemFormat = -7113, + kBadGenericStemFormat = -7114, + kBadUnknownStemFormat = -7115, + + kNoFirstRTASDuringPlayback = -7117, // can't instantiate the first RTAS plug-in on the fly (TDM decks) + kNoBridgeConnectionDuringPlayback = -7118, // can't create or free a bridge connection during playback + + // Subwidget errs: -7125..-7149 + kInstanceIndexRangeErr = -7126, // Specified instance index doesn't correspond with an instance. + kEmptySubWidgetList = -7129, // List isn't NULL, but has no elements. + + // Instance errs: -7150..-7174 + kNumInstancesWentNegative = -7150, // Somehow a count of instances (in widget or DSP) went < 0. + kCantChangeNumInputs = -7152, // Plugin does not have variable number of inputs. + kCantChangeNumOutputs = -7153, // Plugin does not have variable number of outputs. + kSetNumInputsOutOfRange = -7154, // Number of inputs being set is out of range. + kSetNumOutputsOutOfRange = -7155, // Number of outputs being set is out of range. + kChunkRangeErr = -7157, // Handle of plugin settings will not work on a plugin. + + // driver call errs: -7200..-7249 + kBadDriverRefNum = -7200, // Plugin does not have a valid driver object. + kBadHardwareRefNum = -7201, // Plugin does not have a valid pointer to a hardware object. DSPPtr = NULL. + kBadWidgetRef = -7202, // Widget object is NULL. + kLoggedExceptionInConnMgr = -7224, // Logged exception caught in Connection Manager + kUnknownExceptionInConnMgr = -7225, // Unknown exception caught in Connection Manager + + // Widget control errors: -7300..-7324 + kControlIndexRangeErr = -7300, // Passed control index was out of range (couldn't find control). + kNotOurControl = -7301, // Passed in control that didn't belong to widget. + kNullControl = -7302, // Passed in control ref was NULL. + kControlNumStepsErr = -7303, // Control provided an invalid number of steps + + // Builtin plugin errors: -7350..-7374 + kUnsupportedBuiltinPlugin = -7350, // Invalid built-in plugin spec. + kAssertErr = -7400, + + // ASP Processing errors: - 7450..-7499 + kFicProcessStuckInLoop = -7450, // Plugin is stuck in a loop for an process pass. + kFicOutputBoundsNotInited = -7452, // Plugin needs to set output connections to valid range within InitOutputBounds. + kFicConnectionBufferOverwrite = -7453, // Plugin overwrote the end of the connection buffer. + kFicNoASPBounds = -7454, // Start and end bounds for an ASP process or analysis were equal. + kFicASPDoneProcessing = -7456, // The ASP terminated processing with no errors. + kFicASPErrorWritingToDisk = -7457, // ASP encountered error while writing audio data to disk. + kFicASPOutputFileTooLarge = -7458, // ASP tried to write a file larger than the 2^31 bytes in size. + kFicASPOverwriteOnUnity = -7459, // ASP tried to write destructively to Unity + + // Errors called from Failure Handler routines. + kUnknownErr = -7401 // Plugin caught an unknown exception +}; + +//---------------------------------------------------------------------------- +// Digi Serial Port Errors +//---------------------------------------------------------------------------- + +enum { + kFicSerBadParameterPointer = -7500, + kFicSerBadRoutineSelector = -7501, + kFicSerPortDoesNotExist = -7502, + kFicSerPortAlreadyInUse = -7503, + kFicSerPortNotOpen = -7504, + kFicSerBadPortRefereceNumber = -7505 +}; + +// Play nice with emacs +// Local variables: +// mode:c++ +// End: + +*/ + + +// AAXH.h +/* +enum +{ + kAAXH_Result_NoErr = 0, + kAAXH_Result_Error_Base = -14000, // ePSError_Base_AAXHost + // kAAXH_Result_Error = kAAXH_Result_Error_Base - 0, + kAAXH_Result_Warning = kAAXH_Result_Error_Base - 1, + kAAXH_Result_UnsupportedPlatform = kAAXH_Result_Error_Base - 3, + kAAXH_Result_EffectNotRegistered = kAAXH_Result_Error_Base - 4, + kAAXH_Result_IncompleteInstantiationRequest = kAAXH_Result_Error_Base - 5, + kAAXH_Result_NoShellMgrLoaded = kAAXH_Result_Error_Base - 6, + kAAXH_Result_UnknownExceptionLoadingTIPlugIn = kAAXH_Result_Error_Base - 7, + kAAXH_Result_EffectComponentsMissing = kAAXH_Result_Error_Base - 8, + kAAXH_Result_BadLegacyPlugInIDIndex = kAAXH_Result_Error_Base - 9, + kAAXH_Result_EffectFactoryInitedTooManyTimes = kAAXH_Result_Error_Base - 10, + kAAXH_Result_InstanceNotFoundWhenDeinstantiating = kAAXH_Result_Error_Base - 11, + kAAXH_Result_FailedToRegisterEffectPackage = kAAXH_Result_Error_Base - 12, + kAAXH_Result_PlugInSignatureNotValid = kAAXH_Result_Error_Base - 13, + kAAXH_Result_ExceptionDuringInstantiation = kAAXH_Result_Error_Base - 14, + kAAXH_Result_ShuffleCancelled = kAAXH_Result_Error_Base - 15, + kAAXH_Result_NoPacketTargetRegistered = kAAXH_Result_Error_Base - 16, + kAAXH_Result_ExceptionReconnectingAfterShuffle = kAAXH_Result_Error_Base - 17, + kAAXH_Result_EffectModuleCreationFailed = kAAXH_Result_Error_Base - 18, + kAAXH_Result_AccessingUninitializedComponent = kAAXH_Result_Error_Base - 19, + kAAXH_Result_TIComponentInstantiationPostponed = kAAXH_Result_Error_Base - 20, + kAAXH_Result_FailedToRegisterEffectPackageNotAuthorized = kAAXH_Result_Error_Base - 21, + kAAXH_Result_FailedToRegisterEffectPackageWrongArchitecture = kAAXH_Result_Error_Base - 22, + kAAXH_Result_PluginBuiltAgainstIncompatibleSDKVersion = kAAXH_Result_Error_Base - 23, + kAAXH_Result_RequiredProperyMissing = kAAXH_Result_Error_Base - 24, + kAAXH_Result_ObjectCopyFailed = kAAXH_Result_Error_Base - 25, + kAAXH_Result_CouldNotGetPlugInBundleLoc = kAAXH_Result_Error_Base - 26, + kAAXH_Result_CouldNotFindExecutableInBundle = kAAXH_Result_Error_Base - 27, + kAAXH_Result_CouldNotGetExecutableLoc = kAAXH_Result_Error_Base - 28, + + kAAXH_Result_InvalidArgumentValue = kAAXH_Result_Error_Base - 100, // WARNING: Overlaps with eTISysErrorBase + kAAXH_Result_NameNotFoundInPageTable = kAAXH_Result_Error_Base - 101 // WARNING: Overlaps with eTISysErrorNotImpl +}; + +*/ + + +// PlatformSupport_Error.h +/* +enum +{ + ePSError_None = 0, + ePSError_Base_DSI = -1000, // DaeStatus.h + ePSError_Base_DirectIO = -6000, // DirectIODefs.h + ePSError_Base_DirectMIDI = -6500, // DirectIODefs.h + + ePSError_Base_DAE_Plugins = -7000, // FicErrors.h + ePSError_Base_DAE_Disk = -8000, // FicErrors.h + ePSError_Base_DAE_General = -9000, // FicErrors.h + ePSError_Base_DAE_DCM = -11000, // FicErrors.h + ePSError_General_PLEASESTOPUSINGTHIS = -12000, + ePSError_Generic_PLEASESTOPUSINGTHIS = -12001, + ePSError_OutOfMemory = -12002, + ePSError_OutOfHardwareMemory = -12003, + ePSError_FixedListTooSmall = -12004, + ePSError_FileNotFound = -12005, + ePSError_Timeout = -12006, + ePSError_FileReadError = -12007, + ePSError_InvalidArgs = -12008, + + ePSError_DEXBase_Interrupts = -12100, + ePSError_DEXBase_PCI = -12200, + ePSError_DEXBase_Task = -12300, + ePSError_DEXBase_Console = -12400, + ePSError_Base_PalmerEngine = -12500, + ePSError_Base_IP = -12600, + ePSError_Base_DEXLoader = -12700, + ePSError_Base_DEXDebugger = -12800, + ePSError_Base_DEXDLLLoader = -12900, + ePSError_Base_Thread = -13000, + ePSError_Base_Hardware = -13100, + ePSError_Base_TMS = -13400, // TMSErrors.h + ePSError_Base_Harpo = -13500, // Dhm_HarpoInterface.h + ePSError_Base_FlashProgram = -13600, // Hampton_HostFPGAProgramming.h + ePSError_Base_Balance = -13700, // Dhm_Balance.h + ePSError_Base_CTIDSP = -13800, // Dhm_Core_TIDSP.h + ePSError_Base_ONFPGASerial = -13900, // Dhm_COnFPGASerialController.h + ePSError_Base_AAXHost = -14000, // AAXH.h + ePSError_Base_TISys = -14100, // TISysError.h + ePSError_Base_DIDL = -14200, // DIDL.h + ePSError_Base_TIDSPMgr = -14300, // TIDspMgrAllocationReturnCodes.h + ePSError_Base_Berlin = -14400, // Dhm_Berlin.h + ePSError_Base_Isoch = -14500, // Dhm_IsochEngine.h + ePSError_SuppHW_NotSupported = -14600, // Dhm_SuppHW.h + + // Add new ranges here... + + ePSError_Base_AAXPlugIns = -20000, // AAX_Errors.h + + ePSError_Base_DynamicErrors = -30000, // Dynamically Generated error tokens + + + + ePSError_Base_GenericErrorTranslations = -21000, // these errors used to be ePSError_Generic_PLEASESTOPUSINGTHIS - splitting into unique error codes + // putting this out in space in case anyone's using other numbers on another branch + ePSError_CEthDCMDeviceInterface_CreatePort_UncaughtException = -21001, + ePSError_CEthDCMDeviceInterface_DestroyPort_UncaughtException = -21002, + ePSError_CEEPro1000Imp_InitializeAndAllocateBuffers_NullE1000State = -21003, + ePSError_CIODeviceOverviewsManager_OvwDataThreadNull = -21004, + ePSError_CIODeviceOverviewsManager_ThreadAlreadyRunning = -21005, + ePSError_CPalmerEngineKernelImp_CreateIsochronousStream_PalmerEngineIsCurrentlyShuttingDown = -21006, + ePSError_CPalmerEngineKernelImp_SetStreamEnabledState_PalmerEngineIsCurrentlyShuttingDown = -21007, + ePSError_CPalmerEngineImplementation_StartOperating_DidNotFindPartnerInTime = -21008, + ePSError_CPalmerEngineImplementation_TransmitAsyncMessage_PalmerEngineIsCurrentlyShuttingDown = -21009, + ePSError_CPalmerEngineImplementation_TransmitAsyncMessageAndWaitForReply_PalmerEngineIsCurrentlyShuttingDown = -21010, + ePSError_CPalmerEngineImplementation_TransmitAsyncMessageAndWaitForReply_PalmerEngineIsShuttingDownAfterReply = -21011, + ePSError_CPalmerEngineImplementation_TransmitGeneralAsyncPacket_PalmerEngineIsShuttingDown = -21012, + ePSError_CEthernetDeviceSimpleImp_InitializeAndAllocateBuffers_FailedToGetBufferInfo = -21013, + ePSError_CPEInterface_Imp_GetFeatureSetList_FailedWinGetResourceOfModuleByName = -21014, + ePSError_CPEInterface_Imp_GetFourPartVersion_FailedWinGetVersionOfModuleByName = -21015, + ePSError_CHamptonHostDEXLifeLine_Common_TransmitMessageAndGetReply_TransmitAndWaitForReplyFailed = -21016, + ePSError_CHamptonHostDEXLifeLine_Common_TransmitMessageAndGetReply_ConnectionClosedOrNotEstablished = -21017, + ePSError_CHamptonHostDEXLifeLine_Common_TransmitMessageAndGetReply_GotUnexpectedReply = -21018, + ePSError_PerformLoadNotSupportedOnMac = -21019, + ePSError_PerformLoad_FailedGetUnusedUDPPort = -21020, + ePSError_PerformLoad_FailedCreateLocalUDPEndPoint = -21021, + ePSError_PerformLoad_FailedCreateRemoteUDPEndPoint = -21022, + ePSError_PerformLoad_FailedToGetPacketFromEndpoint = -21023, + ePSError_PerformLoad_FirstPacketContainsUnexpectedData = -21024, + ePSError_PerformLoad_SecondPacketContainsUnexpectedData = -21025, + ePSError_PerformLoad_FailedToGetCorrectPacketFromEndpoint = -21026, + ePSError_HamptonDEXLoader_LoadOverUDP_UpdateImageBootInterfaceHeaderFailed = -21027, + ePSError_HamptonDEXLoader_ResetOverUDP_FailedGetUnusedUDPPort = -21028, + ePSError_HamptonDEXLoader_ResetOverUDP_FailedCreateLocalUDPEndPoint = -21029, + ePSError_CTask_Imp_SetSchedulingParameters_FailedThreadSpecificDataInit = -21030, + ePSError_CTask_Imp_SetSchedulingParameters_FailedToSetFirstThreadPriority = -21031, + ePSError_CTask_Imp_SetSchedulingParameters_FailedToSetSecondThreadPriority = -21032, + ePSError_CTask_Imp_SetSchedulingParameters_FailedToVerifyNewPolicy = -21033, + ePSError_CTask_Imp_SetSchedulingParameters_FailedToSetTimeshareToFalse = -21034, + ePSError_CTask_Imp_SetSchedulingParameters_FailedToGetThreadPolicy = -21035, + ePSError_CTask_Imp_SetSchedulingParameters_FailedToSetThirdThreadPriority = -21036, + ePSError_CTask_Imp_SetSchedulingParameters_FailedToGetThreadPolicyAgain = -21037, + ePSError_CModule_Hardware_Imp_GetHardwareMemoryAvailable_WinError = -21038, + ePSError_CModule_Hardware_Imp_SetHardwareMemoryRequired_WinError = -21039, + ePSError_Win_CModule_Hardware_Imp_MapAndGetDALDevices_MapIOCTLFailed = -21040, + ePSError_CModule_Hardware_Imp_ThreadMethod_CreateDALHandleFailed = -21041, + ePSError_CSyncPrim_Semaphore_Imp_CSyncPrim_Semaphore_Imp_CreateSemaphoreFailed = -21042, + ePSError_CSyncPrim_Event_Imp_CSyncPrim_Event_Imp_CreateEventFailed = -21043, + ePSError_CTask_Imp_SetSchedulingParameters_gSetInfoThreadProcNotSet = -21044, + ePSError_CTask_Imp_SetSchedulingParameters_SetThreadPriorityFailed = -21045, + ePSError_CTask_Imp_SetProcessorAffinityMask_SetThreadAffinityMaskFailed = -21046, + ePSError_PSThreadTable_VerifyTableEntryExists_NotFound = -21047, + ePSError_PSM_SimpleThread_ThreadMethod_RunThrewException = -21048, + ePSError_Hampton_DEXImage_MakeROM_BadFilename = -21049, + ePSError_MakeDllIntoHex_BadFilename = -21050, + ePSError_MakeDllIntoHex_BadPayloadObject = -21051, + ePSError_MakeDllIntoHex_FailedCreatePEInterface = -21052, + ePSError_MakeDllIntoHex_FailedResolvedAllSymbols = -21053, + ePSError_MakeDllIntoHexWithStdCLib_BadFilename = -21054, + ePSError_MakeDllIntoHexWithStdCLib_NULLDEXImages = -21055, + ePSError_CDEXWin32Kernel_ExceptionsModule_Initialize_FailedToCreateTLSContext = -21056, + ePSError_CDEXIP_ARP_Imp_GetMACForGivenIP_IPAddressMaskBad = -21057, + ePSError_CDEXIP_ARP_Imp_GetMACForGivenIP_IPAddressInvalid = -21058, + ePSError_DEXIntegrityCheck_VerifySection_FailureCheckingSectionCookies = -21059, + ePSError_DEXIntegrityCheck_VerifySection_FailureCheckingSectionBufferCookie = -21060, + ePSError_DEXIntegrityCheck_VerifyTextSection_FailedChecksum = -21061, + ePSError_Mac_CModule_Hardware_Imp_MapAndGetDALDevices_MapIOCTLFailed = -21062, + ePSError_CModule_Hardware_Imp_ThreadMethod_mach_port_allocate_failed = -21063, + ePSError_DEXTool_main_ExceptionThrown = -21064, + ePSError_Hampton_DEXImage_MakeHexIntoBin_HEXFileNameVersion_StandardExceptionThrown = -21065, + ePSError_Hampton_DEXImage_MakeHexIntoBin_HEXFileNameVersion_UnknownExceptionThrown = -21066, + ePSError_Hampton_DEXImage_MakeHexIntoBin_HEXDataVersion_StandardExceptionThrown = -21067, + ePSError_Hampton_DEXImage_MakeHexIntoBin_HEXDataVersion_UnknownExceptionThrown = -21068 +}; +*/ + +// TISysError.h +/* +/// +/// TISysError contains shared error codes used by TIShell and TIDspMgr. +/// Be sure to add default text below when adding new codes +/// +enum +{ + eTISysErrorSuccess = 0, ///< success code + eTISysErrorBase = ePSError_Base_TISys, ///< -14100 see PlatformSupport_Error.h + eTISysErrorNotImpl = eTISysErrorBase - 1, ///< not implemented + eTISysErrorMemory = eTISysErrorBase - 2, ///< out of memory + eTISysErrorParam = eTISysErrorBase - 3, ///< invalid parameter + eTISysErrorNull = eTISysErrorBase - 4, ///< NULL value + eTISysErrorCommunication = eTISysErrorBase - 5, ///< Communication problem with Shell + eTISysErrorIllegalAccess = eTISysErrorBase - 6, + eTISysErrorDirectAccessOfFifoBlocksUnsupported = eTISysErrorBase - 7, + eTISysErrorPortIdOutOfBounds = eTISysErrorBase - 8, + eTISysErrorPortTypeDoesNotSupportDirectAccess = eTISysErrorBase - 9, + eTISysErrorFIFOFull = eTISysErrorBase - 10, ///< FIFO doesn't have capacity + eTISysErrorRPCTimeOutOnDSP = eTISysErrorBase - 11, + eTISysErrorShellMgrChip_SegsDontMatchAddrs = eTISysErrorBase - 12, + eTISysErrorOnChipRPCNotRegistered = eTISysErrorBase - 13, + eTISysErrorUnexpectedBufferLength = eTISysErrorBase - 14, + eTISysErrorUnexpectedEntryPointName = eTISysErrorBase - 15, + eTISysErrorPortIDTooLargeForContextBlock = eTISysErrorBase - 16, + eTISysErrorMixerDelayNotSupportedForPlugIns = eTISysErrorBase - 17, + eTISysErrorShellFailedToStartUp = eTISysErrorBase - 18, + eTISysErrorUnexpectedCondition = eTISysErrorBase - 19, + eTISysErrorShellNotRunningWhenExpected = eTISysErrorBase - 20, + eTISysErrorFailedToCreateNewPIInstance = eTISysErrorBase - 21, + eTISysErrorUnknownPIInstance = eTISysErrorBase - 22, + eTISysErrorTooManyInstancesForSingleBufferProcessing = eTISysErrorBase - 23, + eTISysErrorNoDSPs = eTISysErrorBase - 24, + eTISysBadDSPID = eTISysErrorBase - 25, + eTISysBadPIContextWriteBlockSize = eTISysErrorBase - 26, + eTISysInstanceInitFailed = eTISysErrorBase - 28, + eTISysSameModuleLoadedTwiceOnSameChip = eTISysErrorBase - 29, + eTISysCouldNotOpenPlugInModule = eTISysErrorBase - 30, + eTISysPlugInModuleMissingDependcies = eTISysErrorBase - 31, + eTISysPlugInModuleLoadableSegmentCountMismatch = eTISysErrorBase - 32, + eTISysPlugInModuleLoadFailure = eTISysErrorBase - 33, + eTISysOutOfOnChipDebuggingSpace = eTISysErrorBase - 34, + eTISysMissingAlgEntryPoint = eTISysErrorBase - 35, + eTISysInvalidRunningStatus = eTISysErrorBase - 36, + eTISysExceptionRunningInstantiation = eTISysErrorBase - 37, + eTISysTIShellBinaryNotFound = eTISysErrorBase - 38, + eTISysTimeoutWaitingForTIShell = eTISysErrorBase - 39, + eTISysSwapScriptTimeout = eTISysErrorBase - 40, + eTISysTIDSPModuleNotFound = eTISysErrorBase - 41, + eTISysTIDSPReadError = eTISysErrorBase - 42, + +}; + +*/ + +/// @cond ignore +#endif // AAX_ERRORS_H +/// @endcond diff --git a/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_Exception.h b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_Exception.h new file mode 100644 index 0000000000..f0f4980806 --- /dev/null +++ b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_Exception.h @@ -0,0 +1,662 @@ +/*================================================================================================*/ +/* + * Copyright 2016-2017, 2023-2024 Avid Technology, Inc. + * All rights reserved. + * + * This file is part of the Avid AAX SDK. + * + * The AAX SDK is subject to commercial or open-source licensing. + * + * By using the AAX SDK, you agree to the terms of both the Avid AAX SDK License + * Agreement and Avid Privacy Policy. + * + * AAX SDK License: https://developer.avid.com/aax + * Privacy Policy: https://www.avid.com/legal/privacy-policy-statement + * + * Or: You may also use this code under the terms of the GPL v3 (see + * www.gnu.org/licenses). + * + * THE AAX SDK IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER + * EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE + * DISCLAIMED. + */ + +/** + * @file AAX_Exception.h + * + * @brief %AAX SDK exception classes and utilities + */ +/*================================================================================================*/ + + +#ifndef AAXLibrary_AAX_Exception_h +#define AAXLibrary_AAX_Exception_h + +#include "AAX_Assert.h" +#include "AAX_StringUtilities.h" +#include "AAX.h" + +#include +#include +#include + + +/////////////////////////////////////////////////////////////// +#if 0 +#pragma mark - +#pragma mark AAX::Exception +#endif +/////////////////////////////////////////////////////////////// + +namespace AAX +{ + namespace Exception { + class Any; + } + + /** Generic conversion of a string-like object to a std::string + */ + inline std::string AsString(const char* inStr); + inline const std::string& AsString(const std::string& inStr); ///< \copydoc AAX::AsString(const char*) + inline const std::string& AsString(const Exception::Any& inStr); ///< \copydoc AAX::AsString(const char*) + + + /** \namespace AAX::Exception + + \brief %AAX exception classes + + \details + All %AAX exception classes inherit from \ref AAX::Exception::Any + */ + namespace Exception + { + /** Base class for %AAX exceptions + + This class is defined within the %AAX Library and is always handled within the %AAX plug-in. + Objects of this class are never passed between the plug-in and the %AAX host. + + The definition of this class may change between versions of the %AAX SDK. This class does not + include any form of version safety for cross-version compatibility. + + \warning Do not use multiple inheritance in any sub-classes within the + \ref AAX::Exception::Any inheritance tree + + \warning Never pass exceptions across the library boundary to the %AAX host + */ + class Any + { + public: + virtual ~Any() {} + + /** Explicit conversion from a string-like object + */ + template + explicit Any(const C& inWhat) + : mDesc(AAX::AsString(inWhat)) + , mFunction() + , mLine() + , mWhat(AAX::Exception::Any::CreateWhat(mDesc, mFunction, mLine)) + { + } + + /** Explicit conversion from a string-like object with function name and line number + */ + template + explicit Any(const C1& inWhat, const C2& inFunction, const C3& inLine) + : mDesc(AAX::AsString(inWhat)) + , mFunction(AAX::AsString(inFunction)) + , mLine(AAX::AsString(inLine)) + , mWhat(AAX::Exception::Any::CreateWhat(mDesc, mFunction, mLine)) + { + } + + // assignment operator + Any& operator=(const Any& inOther) + { + mDesc = inOther.mDesc; + mFunction = inOther.mFunction; + mLine = inOther.mLine; + mWhat = inOther.mWhat; + return *this; + } + + AAX_DEFAULT_MOVE_CTOR(Any); + AAX_DEFAULT_MOVE_OPER(Any); + + public: // AAX::Exception::Any + +#ifndef AAX_CPP11_SUPPORT + // implicit conversion to std::string (mostly for AsString()) + operator const std::string&(void) const { return mWhat; } +#endif + + const std::string& What() const { return mWhat; } + const std::string& Desc() const { return mDesc; } + const std::string& Function() const { return mFunction; } + const std::string& Line() const { return mLine; } + + private: + static std::string CreateWhat(const std::string& inDesc, const std::string& inFunc, const std::string& inLine) + { + std::string whatStr(inDesc); + if (false == inFunc.empty()) { whatStr += (" func:" + inFunc); } + if (false == inLine.empty()) { whatStr += (" line:" + inLine); } + return whatStr; + } + + private: + std::string mDesc; + std::string mFunction; + std::string mLine; + std::string mWhat; + }; + + /** Exception class for \ref AAX_EError results + */ + class ResultError : public Any + { + public: + explicit ResultError(AAX_Result inWhatResult) + : Any(ResultError::FormatResult(inWhatResult)) + , mResult(inWhatResult) + { + } + + template + explicit ResultError(AAX_Result inWhatResult, const C& inFunction) + : Any(ResultError::FormatResult(inWhatResult), inFunction, (const char*)NULL) + , mResult(inWhatResult) + { + } + + template + explicit ResultError(AAX_Result inWhatResult, const C1& inFunction, const C2& inLine) + : Any(ResultError::FormatResult(inWhatResult), inFunction, inLine) + , mResult(inWhatResult) + { + } + + static std::string FormatResult(AAX_Result inResult) + { + return std::string(AAX::AsStringResult(inResult) + " (" + AAX::AsStringInt32((int32_t)inResult) + ")"); + } + + AAX_Result Result() const { return mResult; } + + private: + AAX_Result mResult; + }; + } + + std::string AsString(const char* inStr) + { + return inStr ? std::string(inStr) : std::string(); + } + + const std::string& AsString(const std::string& inStr) + { + return inStr; + } + + const std::string& AsString(const Exception::Any& inStr) + { + return inStr.What(); + } +} + + +/////////////////////////////////////////////////////////////// +#if 0 +#pragma mark - +#endif +/////////////////////////////////////////////////////////////// + +/** Error checker convenience class for \ref AAX_Result + + Implicitly convertable to an \ref AAX_Result. + + Provides an overloaded \c operator=() which will throw an \ref AAX::Exception::ResultError if assigned + a non-success result. + + \warning Never use this class outside of an exception catch scope + + If the host supports \ref AAX_TRACE tracing, a log is emitted when the exception is thrown. A stacktrace + is added if the host's trace priority filter level is set to \ref kAAX_Trace_Priority_Lowest + + When an error is encountered, \ref AAX_CheckedResult throws an \ref AAX_CheckedResult::Exception + exception and clears its internal result value. + + \code + #include "AAX_Exception.h" + AAX_Result SomeCheckedMethod() + { + AAX_Result result = AAX_SUCCESS; + try { + AAX_CheckedResult cr; + cr = ResultFunc1(); + cr = ResultFunc2(); + } + catch (const AAX_CheckedResult::Exception& ex) + { + // handle exception; do not rethrow + result = ex.Result(); + } + catch (...) + { + result = AAX_ERROR_UNKNOWN_EXCEPTION; + } + + return result; + } + \endcode + + \note The AAX Library method which calls \c GetEffectDescriptions() on the plug-in includes an + appropriate exception handler, so \ref AAX_CheckedResult objects may be used within a plug-in's + describe code without additional catch scopes. + + \code + #include "AAX_Exception.h" + AAX_Result GetEffectDescriptions( AAX_ICollection * outCollection ) + { + AAX_CheckedResult cr; + cr = MyDescriptionSubroutine1(); + cr = outCollection->AddEffect(...); + // etc. + return cr; + } + \endcode + + It is assumed that the exception handler will resolve any error state and that the + \ref AAX_CheckedResult may therefore continue to be used from a clean state following the + exception catch block. + + If the previous error value is required then it can be retrieved using + \ref AAX_CheckedResult::LastError(). + + \code + // in this example, the exception is handled and + // success is returned from MyFunc1() + AAX_Result MyFunc1() + { + AAX_CheckedResult cr; + + try { + cr = MethodThatReturnsError(); + } catch (const AAX::Exception::ResultError& ex) { + // exception is fully handled here + } + + // cr now holds a success value + return cr; + } + + // in this example, MyFunc2() returns the first + // non-successful value which was encountered + AAX_Result MyFunc2() + { + AAX_CheckedResult cr; + + try { + AAX_SWALLOW(cr = MethodThatMayReturnError1()); + AAX_SWALLOW(cr = MethodThatMayReturnError2()); + cr = MethodThatMayReturnError3(); + } catch (const AAX::Exception::ResultError& ex) { + // exception might not be fully handled + } + + // pass the last error on to the caller + return cr.LastError(); + } + \endcode + + It is possible to add one or more accepted non-success values to an \ref AAX_CheckedResult + so that these values will not trigger exceptions: + + \code + AAX_CheckedResult cr; + try { + cr.AddAcceptedResult(AcceptableErrCode); + cr = MethodThatReturnsAcceptedError(); + cr = MethodThatReturnsAnotherError(); + } catch (const AAX::Exception::ResultError& ex) { + // handle the exception + } + \endcode + */ +class AAX_CheckedResult +{ +public: + typedef AAX::Exception::ResultError Exception; + + /* non-virtual destructor */ ~AAX_CheckedResult() {} + + /// \brief Construct an \ref AAX_CheckedResult in a success state + AAX_CheckedResult() + : mCurResult(AAX_SUCCESS) + , mLastError(AAX_SUCCESS) + , mAcceptedResults() + { + Initialize(); + } + + /// \brief Implicit conversion constructor from \ref AAX_Result + /// \details Implicit conversion is OK in order to support AAX_CheckedResult cr = SomeFunc() + AAX_CheckedResult(AAX_Result inResult) + : mCurResult(inResult) + , mLastError(AAX_SUCCESS) + , mAcceptedResults() + { + Initialize(); + Check(); + } + + /** \brief Add an expected result which will not result in a throw + + It is acceptable for some methods to return certain non-success values such as + \ref AAX_RESULT_PACKET_STREAM_NOT_EMPTY or \ref AAX_RESULT_NEW_PACKET_POSTED + */ + void AddAcceptedResult(AAX_Result inResult) + { + mAcceptedResults.insert(inResult); + } + + void ResetAcceptedResults() + { + mAcceptedResults.clear(); + mAcceptedResults.insert(AAX_SUCCESS); + } + + /// \brief Assignment to \ref AAX_Result + AAX_CheckedResult& operator=(AAX_Result inResult) + { + mCurResult = inResult; + Check(); + return *this; + } + + /// \brief bitwise-or assignment to \ref AAX_Result + /// \details Sometimes used in legacy code to aggregate results into a single AAX_Result value + AAX_CheckedResult& operator|=(AAX_Result inResult) + { + return this->operator=(inResult); + } + + /// \brief Conversion to \ref AAX_Result + operator AAX_Result() const + { + return mCurResult; + } + + /// \brief Clears the current result state + /// \details Does not affect the set of accepted results + void Clear() + { + mCurResult = AAX_SUCCESS; + mLastError = AAX_SUCCESS; + } + + /// \brief Get the last non-success result which was stored in this object, or AAX_SUCCESS + /// if no non-success result was ever stored in this object + AAX_Result LastError() const + { + return mLastError; + } + +private: + void Initialize() + { + ResetAcceptedResults(); + } + + void Check() + { + const AAX_Result err = mCurResult; + if (0 == mAcceptedResults.count(err)) + { + AAX_CheckedResult::Exception ex(err); + + // error state is now captured in ex + mCurResult = AAX_SUCCESS; + mLastError = err; + + AAX_TRACE_RELEASE(kAAX_Trace_Priority_Normal, "AAX_CheckedResult - throwing %s", ex.What().c_str()); + AAX_STACKTRACE(kAAX_Trace_Priority_Lowest, ""); // stacktrace is only printed for debug plug-in builds + throw ex; + } + } + +private: + AAX_Result mCurResult; + AAX_Result mLastError; + std::set mAcceptedResults; +}; + + +/////////////////////////////////////////////////////////////// +#if 0 +#pragma mark - +#pragma mark AAX exception macros +#endif +/////////////////////////////////////////////////////////////// + +/*! + \def AAX_SWALLOW(X) + + \brief Executes \a X in a try/catch block that catches \ref AAX_CheckedResult exceptions + + \details + Catches exceptions thrown from \ref AAX_CheckedResult only - other exceptions require an explicit catch. + + \code + AAX_CheckedResult cr; + cr = NecessaryFunc1(); + AAX_SWALLOW(cr = FailableFunc()); + cr = NecessaryFunc2(); + \endcode + */ +#define AAX_SWALLOW(...) \ + try { if(true) { ( __VA_ARGS__ ); } } \ + catch (const AAX_CheckedResult::Exception& AAX_PREPROCESSOR_CONCAT(ex,__LINE__)) { \ + AAX_TRACE_RELEASE(kAAX_Trace_Priority_High, "%s line %d (%s) exception caught: %s (swallowed)", __FILE__, __LINE__, __FUNCTION__, AAX_PREPROCESSOR_CONCAT(ex,__LINE__).What().c_str()); \ + } do {} while (false) + +/*! + \def AAX_SWALLOW_MULT(X) + + \brief Executes \a X in a try/catch block that catches \ref AAX_CheckedResult exceptions + + \details + Version of \ref AAX_SWALLOW for multi-line input. + + Catches exceptions thrown from \ref AAX_CheckedResult only - other exceptions require an + explicit catch. + + \code + AAX_CheckedResult cr; + cr = NecessaryFunc(); + AAX_SWALLOW_MULT( + cr = FailableFunc1(); + cr = FailableFunc2(); // may not execute + cr = FailableFunc3(); // may not execute + ); + cr = NecessaryFunc2(); + \endcode + */ +#define AAX_SWALLOW_MULT(...) \ +try { if(true) { __VA_ARGS__ } } \ +catch (const AAX_CheckedResult::Exception& AAX_PREPROCESSOR_CONCAT(ex,__LINE__)) { \ +AAX_TRACE_RELEASE(kAAX_Trace_Priority_High, "%s line %d (%s) exception caught: %s (swallowed)", __FILE__, __LINE__, __FUNCTION__, AAX_PREPROCESSOR_CONCAT(ex,__LINE__).What().c_str()); \ +} do {} while (false) + +/*! + \def AAX_CAPTURE(X,Y) + + \brief Executes \a Y in a try/catch block that catches + \ref AAX::Exception::ResultError exceptions and captures the result + + \details + Catches exceptions thrown from \ref AAX_CheckedResult and other + \ref AAX::Exception::ResultError exceptions. + + \a X must be an \ref AAX_Result + + \code + AAX_Result result = AAX_SUCCESS; + AAX_CAPTURE(result, ResultErrorThrowingFunc()); + // result now holds the error code thrown by ThrowingFunc() + + AAX_CheckedResult cr; + AAX_CAPTURE(result, cr = FailableFunc()); + \endcode + */ +#define AAX_CAPTURE(X, ...) \ +try { if(true) { ( __VA_ARGS__ ); } } \ +catch (const AAX::Exception::ResultError& AAX_PREPROCESSOR_CONCAT(ex,__LINE__)) { \ +AAX_TRACE_RELEASE(kAAX_Trace_Priority_High, "%s line %d (%s) exception caught: %s (captured)", __FILE__, __LINE__, __FUNCTION__, AAX_PREPROCESSOR_CONCAT(ex,__LINE__).What().c_str()); \ +(X) = AAX_PREPROCESSOR_CONCAT(ex,__LINE__).Result(); \ +} do {} while (false) + +/*! + \def AAX_CAPTURE_MULT(X,Y) + + \brief Executes \a Y in a try/catch block that catches + \ref AAX::Exception::ResultError exceptions and captures the result + + \details + Version of \ref AAX_CAPTURE for multi-line input. + + Catches exceptions thrown from \ref AAX_CheckedResult and other + \ref AAX::Exception::ResultError exceptions. + + \a X must be an \ref AAX_Result or an implicitly convertable type + + \code + AAX_Result result = AAX_SUCCESS; + AAX_CAPTURE_MULT(result, + MaybeThrowingFunc1(); + MaybeThrowingFunc2(); + + // can use AAX_CheckedResult within AAX_CAPTURE_MULT + AAX_CheckedResult cr; + cr = FailableFunc1(); + cr = FailableFunc2(); + cr = FailableFunc3(); + ); + + // result now holds the value of the last thrown error + return result; + \endcode + */ +#define AAX_CAPTURE_MULT(X, ...) \ +try { if(true) { __VA_ARGS__ } } \ +catch (const AAX_CheckedResult::Exception& AAX_PREPROCESSOR_CONCAT(ex,__LINE__)) { \ +AAX_TRACE_RELEASE(kAAX_Trace_Priority_High, "%s line %d (%s) exception caught: %s (captured)", __FILE__, __LINE__, __FUNCTION__, AAX_PREPROCESSOR_CONCAT(ex,__LINE__).What().c_str()); \ +(X) = AAX_PREPROCESSOR_CONCAT(ex,__LINE__).Result(); \ +} do {} while (false) + + +/////////////////////////////////////////////////////////////// +#if 0 +#pragma mark - +#endif +/////////////////////////////////////////////////////////////// + +/** RAII failure count convenience class for use with \ref AAX_CAPTURE() or + \ref AAX_CAPTURE_MULT() + + Pass this object as the first argument in a series of \ref AAX_CAPTURE() calls to + count the number of failures that occur and to re-throw the last error if zero of + the attempted calls succeed. + + \code + // example A: throw if all operations fail + AAX_AggregateResult agg; + AAX_CAPTURE( agg, RegisterThingA(); ); + AAX_CAPTURE( agg, RegisterThingB(); ); + AAX_CAPTURE( agg, RegisterThingC(); ); + \endcode + + In this example, when agg goes out of scope it checks whether any of A, + B, or C succeeded. If none succeeded then the last error that was encountered is + raised via an \ref AAX_CheckedResult::Exception. If at least one of the calls + succeeded then any failures are swallowed and execution continues as normal. + This approach can be useful in cases where you want to run every operation in a + group and you only want a failure to be returned if all of the operations failed. + + \code + // example B: throw if any operation fails + AAX_AggregateResult agg; + AAX_CAPTURE( agg, ImportantOperationW(); ); + AAX_CAPTURE( agg, ImportantOperationX(); ); + AAX_CAPTURE( agg, ImportantOperationY(); ); + AAX_CheckedResult err = agg; + \endcode + + In this example, the last error encountered by agg is converted to an + \ref AAX_CheckedResult. This will result in an \ref AAX_CheckedResult::Exception + even if at least one of the attempted operations succeeded. This approach can be + useful in cases where you want all operations in a group to be executed before + an error is raised for any failure within the group. + */ +class AAX_AggregateResult +{ +public: + AAX_AggregateResult() = default; + + ~AAX_AggregateResult() + { + if (0 == mNumSucceeded && 0 < mNumFailed) { + try { + // do normal logging + this->Check(); + } + catch(...) + { + // can't throw from a destructor + } + } + } + + /// Overloaded operator=() for conversion from \ref AAX_Result + AAX_AggregateResult& operator=(AAX_Result inResult) + { + if (AAX_SUCCESS == inResult) + { + ++mNumSucceeded; + } + else + { + mLastFailure = inResult; + ++mNumFailed; + } + + return *this; + } + + /// Implicit conversion to AAX_Result clears the state + operator AAX_Result() + { + AAX_Result const err = this->LastFailure(); + this->Clear(); + return err; + } + + void Check() const { AAX_CheckedResult tempErr(mLastFailure); } + void Clear() { + mLastFailure = AAX_SUCCESS; + mNumFailed = 0; + mNumSucceeded = 0; + } + + AAX_Result LastFailure() const { return mLastFailure; } + int NumFailed() const { return mNumFailed; } + int NumSucceeded() const { return mNumSucceeded; } + int NumAttempted() const { return mNumFailed+mNumSucceeded; } + +private: + AAX_Result mLastFailure{AAX_SUCCESS}; + int mNumFailed{0}; + int mNumSucceeded{0}; +}; + +#endif diff --git a/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_Exports.cpp b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_Exports.cpp new file mode 100644 index 0000000000..e433fcab2c --- /dev/null +++ b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_Exports.cpp @@ -0,0 +1,213 @@ +/*================================================================================================*/ +/* + * + * Copyright 2013-2015, 2023-2024 Avid Technology, Inc. + * All rights reserved. + * + * This file is part of the Avid AAX SDK. + * + * The AAX SDK is subject to commercial or open-source licensing. + * + * By using the AAX SDK, you agree to the terms of both the Avid AAX SDK License + * Agreement and Avid Privacy Policy. + * + * AAX SDK License: https://developer.avid.com/aax + * Privacy Policy: https://www.avid.com/legal/privacy-policy-statement + * + * Or: You may also use this code under the terms of the GPL v3 (see + * www.gnu.org/licenses). + * + * THE AAX SDK IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER + * EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE + * DISCLAIMED. + * + */ + +/** + * \file AAX_Exports.cpp + * + */ +/*================================================================================================*/ + +#include "AAX_Init.h" +#include "AAX.h" +#include "acfunknown.h" +#include "acfresult.h" + +#if defined (__GNUC__) +#define AAX_EXPORT extern "C" __attribute__((visibility("default"))) ACFRESULT + +// AH 1/18/13 - temp workaround for Eden signing bug in DP5. Need to provide this term routine to +// avoid crashes in wrapped plugins. This will be fixed by pace in Eden FC1, when we can remove this code. + +static void module_term_routine(void) __attribute__((destructor)) __attribute__((used)); +void module_term_routine(void) +{ + // Might want to implement something simple here + int* x = new int; + *x = 1; +} + +#else +#define AAX_EXPORT extern "C" __declspec(dllexport) ACFRESULT __stdcall +#endif + + +AAX_EXPORT ACFRegisterPlugin ( + IACFUnknown * pUnkHost, + IACFPluginDefinition **ppPluginDefinition + ); + + +AAX_EXPORT ACFRegisterComponent ( + IACFUnknown * pUnkHost, + acfUInt32 index, + IACFComponentDefinition **ppComponentDefinition + ); + +AAX_EXPORT ACFGetClassFactory ( + IACFUnknown * pUnkHost, + const acfCLSID& clsid, + const acfIID& iid, + void** ppOut + ); + +AAX_EXPORT ACFCanUnloadNow (IACFUnknown * pUnkHost); + +AAX_EXPORT ACFStartup (IACFUnknown * pUnkHost); + +AAX_EXPORT ACFShutdown (IACFUnknown * pUnkHost); + +AAX_EXPORT ACFGetSDKVersion ( acfUInt64 * oSDKVersion ); + +/** \brief The main plug-in registration method +*/ +ACFAPI ACFRegisterPlugin(IACFUnknown * pUnkHostVoid, IACFPluginDefinition **ppPluginDefinitionVoid) +{ + ACFRESULT result = ACF_OK; + + try + { + result = AAXRegisterPlugin(pUnkHostVoid, ppPluginDefinitionVoid); + } + catch(...) + { + result = ACF_E_UNEXPECTED; + } + + return result; +} + +/** \brief Registers a specific component in the DLL +*/ +ACFAPI ACFRegisterComponent (IACFUnknown * pUnkHost, + acfUInt32 index, + IACFComponentDefinition **ppComponentDefinition) +{ + ACFRESULT result = ACF_OK; + + try + { + result = AAXRegisterComponent(pUnkHost, index, ppComponentDefinition); + } + catch(...) + { + result = ACF_E_UNEXPECTED; + } + + return result; +} + +/** \brief Gets the factory for a given class ID +*/ +ACFAPI ACFGetClassFactory (IACFUnknown * pUnkHost, + const acfCLSID& clsid, + const acfIID& iid, + void** ppOut) +{ + ACFRESULT result = ACF_OK; + + try + { + result = AAXGetClassFactory(pUnkHost, clsid, iid, ppOut); + } + catch(...) + { + result = ACF_E_UNEXPECTED; + } + + return result; +} + +/** \brief Determines whether or not the host may unload the DLL +*/ +ACFAPI ACFCanUnloadNow (IACFUnknown * pUnkHost) +{ + ACFRESULT result = ACF_OK; + + try + { + result = AAXCanUnloadNow(pUnkHost); + } + catch(...) + { + result = ACF_E_UNEXPECTED; + } + + return result; +} + +/** \brief DLL initialization routine +*/ +ACFAPI ACFStartup (IACFUnknown * pUnkHost) +{ + ACFRESULT result = ACF_OK; + + try + { + result = AAXStartup(pUnkHost); + } + catch(...) + { + result = ACF_E_UNEXPECTED; + } + + return result; +} + +/** \brief DLL shutdown routine +*/ +ACFAPI ACFShutdown (IACFUnknown * pUnkHost) +{ + ACFRESULT result = ACF_OK; + + try + { + result = AAXShutdown(pUnkHost); + } + catch(...) + { + result = ACF_E_UNEXPECTED; + } + + return result; +} + +/** \brief Returns the DLL's SDK version +*/ +ACFAPI ACFGetSDKVersion ( acfUInt64 * oSDKVersion ) +{ + ACFRESULT result = ACF_OK; + + try + { + result = AAXGetSDKVersion(oSDKVersion); + } + catch(...) + { + result = ACF_E_UNEXPECTED; + } + + return result; +} + diff --git a/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_GUITypes.h b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_GUITypes.h new file mode 100644 index 0000000000..7804efa9dc --- /dev/null +++ b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_GUITypes.h @@ -0,0 +1,166 @@ +/*================================================================================================*/ +/* + * + * Copyright 2013-2015, 2019, 2023-2024 Avid Technology, Inc. + * All rights reserved. + * + * This file is part of the Avid AAX SDK. + * + * The AAX SDK is subject to commercial or open-source licensing. + * + * By using the AAX SDK, you agree to the terms of both the Avid AAX SDK License + * Agreement and Avid Privacy Policy. + * + * AAX SDK License: https://developer.avid.com/aax + * Privacy Policy: https://www.avid.com/legal/privacy-policy-statement + * + * Or: You may also use this code under the terms of the GPL v3 (see + * www.gnu.org/licenses). + * + * THE AAX SDK IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER + * EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE + * DISCLAIMED. + * + */ + +/** + * \file AAX_GUITypes.h + * + * \brief Constants and other definitions used by %AAX plug-in GUIs + * + */ +/*================================================================================================*/ + + +/// @cond ignore +#ifndef AAX_GUITYPES_H +#define AAX_GUITYPES_H +/// @endcond + +#ifndef _TMS320C6X + +#include "AAX.h" + +#include AAX_ALIGN_FILE_BEGIN +#include AAX_ALIGN_FILE_HOST +#include AAX_ALIGN_FILE_END + /** \brief Data structure representing a two-dimensional coordinate point + + Comparison operators give preference to \c vert + */ + typedef struct AAX_Point + { + AAX_Point ( + float v, + float h) : + vert(v), + horz(h) + {} + + AAX_Point ( + void) : + vert(0.0f), + horz(0.0f) + {} + + float vert; + float horz; + } AAX_Point; +#include AAX_ALIGN_FILE_BEGIN +#include AAX_ALIGN_FILE_RESET +#include AAX_ALIGN_FILE_END + +inline bool operator==(const AAX_Point& p1, const AAX_Point& p2) +{ + return ((p1.vert == p2.vert) && (p1.horz == p2.horz)); +} + +inline bool operator!=(const AAX_Point& p1, const AAX_Point& p2) +{ + return !(p1 == p2); +} + +inline bool operator<(const AAX_Point& p1, const AAX_Point& p2) +{ + return (p1.vert == p2.vert) ? (p1.horz < p2.horz) : (p1.vert < p2.vert); +} + +inline bool operator<=(const AAX_Point& p1, const AAX_Point& p2) +{ + return (p1.vert == p2.vert) ? (p1.horz <= p2.horz) : (p1.vert < p2.vert); +} + +inline bool operator>(const AAX_Point& p1, const AAX_Point& p2) +{ + return !(p1 <= p2); +} + +inline bool operator>=(const AAX_Point& p1, const AAX_Point& p2) +{ + return !(p1 < p2); +} + +#include AAX_ALIGN_FILE_BEGIN +#include AAX_ALIGN_FILE_HOST +#include AAX_ALIGN_FILE_END + /** \brief Data structure representing a rectangle in a two-dimensional coordinate plane + */ + typedef struct AAX_Rect + { + AAX_Rect ( + float t, + float l, + float w, + float h) : + top(t), + left(l), + width(w), + height(h) + {} + + AAX_Rect ( + void) : + top(0.0f), + left(0.0f), + width(0.0f), + height(0.0f) + {} + + float top; + float left; + float width; + float height; + } AAX_Rect; +#include AAX_ALIGN_FILE_BEGIN +#include AAX_ALIGN_FILE_RESET +#include AAX_ALIGN_FILE_END + +inline bool operator==(const AAX_Rect& r1, const AAX_Rect& r2) +{ + return ((r1.top == r2.top) && (r1.left == r2.left) && (r1.width == r2.width) && (r1.height == r2.height)); +} + +inline bool operator!=(const AAX_Rect& r1, const AAX_Rect& r2) +{ + return !(r1 == r2); +} + +/** \brief Type of \ref AAX_IViewContainer "view container" + * + * \details + * \sa AAX_IViewContainer::GetType() + */ +typedef enum AAX_EViewContainer_Type +{ + AAX_eViewContainer_Type_NULL = 0, + AAX_eViewContainer_Type_NSView = 1, + AAX_eViewContainer_Type_UIView = 2, + AAX_eViewContainer_Type_HWND = 3 +} AAX_EViewContainer_Type; +AAX_ENUM_SIZE_CHECK( AAX_EViewContainer_Type ); + +#endif //_TMS320C6X + +/// @cond ignore +#endif //AAX_GUITYPES_H +/// @endcond diff --git a/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_IACFAutomationDelegate.h b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_IACFAutomationDelegate.h new file mode 100644 index 0000000000..c5cf75bcb7 --- /dev/null +++ b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_IACFAutomationDelegate.h @@ -0,0 +1,90 @@ +/*================================================================================================*/ +/* + * + * Copyright 2013-2017, 2023-2024 Avid Technology, Inc. + * All rights reserved. + * + * This file is part of the Avid AAX SDK. + * + * The AAX SDK is subject to commercial or open-source licensing. + * + * By using the AAX SDK, you agree to the terms of both the Avid AAX SDK License + * Agreement and Avid Privacy Policy. + * + * AAX SDK License: https://developer.avid.com/aax + * Privacy Policy: https://www.avid.com/legal/privacy-policy-statement + * + * Or: You may also use this code under the terms of the GPL v3 (see + * www.gnu.org/licenses). + * + * THE AAX SDK IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER + * EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE + * DISCLAIMED. + * + */ + +/** + * \file AAX_IACFAutomationDelegate.h + * + * \brief Versioned interface allowing an %AAX plug-in to interact with the host's automation system + * + */ +/*================================================================================================*/ + + +#ifndef AAX_IACFAUTOMATIONDELEGATE_H +#define AAX_IACFAUTOMATIONDELEGATE_H + +#include "AAX.h" + +#ifdef __clang__ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wnon-virtual-dtor" +#endif + +#include "acfunknown.h" + +/** \brief Versioned interface allowing an %AAX plug-in to interact with the host's automation system + + \details + \sa \ref advancedTopics_ParameterUpdates + \sa \ref AAX_IAutomationDelegate + */ +class AAX_IACFAutomationDelegate : public IACFUnknown +{ +public: + + /** \copydoc AAX_IAutomationDelegate::RegisterParameter() + */ + virtual AAX_Result RegisterParameter ( AAX_CParamID iParameterID ) = 0; + + /** \copydoc AAX_IAutomationDelegate::UnregisterParameter() + */ + virtual AAX_Result UnregisterParameter ( AAX_CParamID iParameterID ) = 0; + + /** \copydoc AAX_IAutomationDelegate::PostSetValueRequest() + */ + virtual AAX_Result PostSetValueRequest ( AAX_CParamID iParameterID, double normalizedValue ) const = 0; + + /** \copydoc AAX_IAutomationDelegate::PostCurrentValue() + */ + virtual AAX_Result PostCurrentValue( AAX_CParamID iParameterID, double normalizedValue ) const = 0; + + /** \copydoc AAX_IAutomationDelegate::PostTouchRequest() + */ + virtual AAX_Result PostTouchRequest( AAX_CParamID iParameterID ) = 0; + + /** \copydoc AAX_IAutomationDelegate::PostReleaseRequest() + */ + virtual AAX_Result PostReleaseRequest( AAX_CParamID iParameterID ) = 0; + + /** \copydoc AAX_IAutomationDelegate::GetTouchState() + */ + virtual AAX_Result GetTouchState ( AAX_CParamID iParameterID, AAX_CBoolean * oTouched )= 0; +}; + +#ifdef __clang__ +#pragma clang diagnostic pop +#endif + +#endif // AAX_IACFAUTOMATIONDELEGATE_H diff --git a/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_IACFCollection.h b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_IACFCollection.h new file mode 100644 index 0000000000..f11b22baa7 --- /dev/null +++ b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_IACFCollection.h @@ -0,0 +1,64 @@ +/*================================================================================================*/ +/* + * + * Copyright 2013-2017, 2023-2024 Avid Technology, Inc. + * All rights reserved. + * + * This file is part of the Avid AAX SDK. + * + * The AAX SDK is subject to commercial or open-source licensing. + * + * By using the AAX SDK, you agree to the terms of both the Avid AAX SDK License + * Agreement and Avid Privacy Policy. + * + * AAX SDK License: https://developer.avid.com/aax + * Privacy Policy: https://www.avid.com/legal/privacy-policy-statement + * + * Or: You may also use this code under the terms of the GPL v3 (see + * www.gnu.org/licenses). + * + * THE AAX SDK IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER + * EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE + * DISCLAIMED. + * + */ + +/** + * \file AAX_IACFCollection.h + * + * \brief Versioned interface to represent a plug-in binary's static description + * + */ +/*================================================================================================*/ + + +#ifndef AAX_IACFCOLLECTION_H +#define AAX_IACFCOLLECTION_H + +#ifdef __clang__ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wnon-virtual-dtor" +#endif + +#include "acfbaseapi.h" + +class AAX_IEffectDescriptor; + +/** \brief Versioned interface to represent a plug-in binary's static description + */ +class AAX_IACFCollection : public IACFPluginDefinition +{ +public: + + virtual AAX_Result AddEffect ( const char * inEffectID, IACFUnknown * inEffectDescriptor ) = 0; ///< \copydoc AAX_ICollection::AddEffect + virtual AAX_Result SetManufacturerName( const char* inPackageName ) = 0; ///< \copydoc AAX_ICollection::SetManufacturerName() + virtual AAX_Result AddPackageName( const char *inPackageName ) = 0; ///< \copydoc AAX_ICollection::AddPackageName() + virtual AAX_Result SetPackageVersion( uint32_t inVersion ) = 0; ///< \copydoc AAX_ICollection::SetPackageVersion() + virtual AAX_Result SetProperties ( IACFUnknown * inProperties ) = 0; ///< \copydoc AAX_ICollection::SetProperties() +}; + +#ifdef __clang__ +#pragma clang diagnostic pop +#endif + +#endif diff --git a/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_IACFComponentDescriptor.h b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_IACFComponentDescriptor.h new file mode 100644 index 0000000000..a55f1886ac --- /dev/null +++ b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_IACFComponentDescriptor.h @@ -0,0 +1,109 @@ +/*================================================================================================*/ +/* + * + * Copyright 2013-2017, 2023-2024 Avid Technology, Inc. + * All rights reserved. + * + * This file is part of the Avid AAX SDK. + * + * The AAX SDK is subject to commercial or open-source licensing. + * + * By using the AAX SDK, you agree to the terms of both the Avid AAX SDK License + * Agreement and Avid Privacy Policy. + * + * AAX SDK License: https://developer.avid.com/aax + * Privacy Policy: https://www.avid.com/legal/privacy-policy-statement + * + * Or: You may also use this code under the terms of the GPL v3 (see + * www.gnu.org/licenses). + * + * THE AAX SDK IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER + * EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE + * DISCLAIMED. + * + */ + +/** + * \file AAX_IACFComponentDescriptor.h + * + * \brief Versioned description interface for an %AAX plug-in algorithm callback + * + */ +/*================================================================================================*/ + + +#ifndef _AAX_IACFCOMPONENTDESCRIPTOR_H_ +#define _AAX_IACFCOMPONENTDESCRIPTOR_H_ + +#include "AAX.h" +#include "AAX_Callbacks.h" +#include "AAX_IDma.h" + +#ifdef __clang__ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wnon-virtual-dtor" +#endif + +#include "acfunknown.h" + + +/** \brief Versioned description interface for an %AAX plug-in algorithm callback + */ +class AAX_IACFComponentDescriptor : public IACFUnknown +{ +public: + virtual AAX_Result Clear () = 0; ///< \copydoc AAX_IComponentDescriptor::Clear() + virtual AAX_Result AddReservedField ( AAX_CFieldIndex inFieldIndex, uint32_t inFieldType ) = 0; ///< \copydoc AAX_IComponentDescriptor::AddReservedField() + virtual AAX_Result AddAudioIn ( AAX_CFieldIndex inFieldIndex ) = 0; ///< \copydoc AAX_IComponentDescriptor::AddAudioIn() + virtual AAX_Result AddAudioOut ( AAX_CFieldIndex inFieldIndex ) = 0; ///< \copydoc AAX_IComponentDescriptor::AddAudioOut() + virtual AAX_Result AddAudioBufferLength ( AAX_CFieldIndex inFieldIndex ) = 0; ///< \copydoc AAX_IComponentDescriptor::AddAudioBufferLength() + virtual AAX_Result AddSampleRate ( AAX_CFieldIndex inFieldIndex ) = 0; ///< \copydoc AAX_IComponentDescriptor::AddSampleRate() + virtual AAX_Result AddClock ( AAX_CFieldIndex inFieldIndex ) = 0; ///< \copydoc AAX_IComponentDescriptor::AddClock() + virtual AAX_Result AddSideChainIn ( AAX_CFieldIndex inFieldIndex ) = 0; ///< \copydoc AAX_IComponentDescriptor::AddSideChainIn() + virtual AAX_Result AddDataInPort ( AAX_CFieldIndex inFieldIndex, uint32_t inPacketSize, AAX_EDataInPortType inPortType) = 0; ///< \copydoc AAX_IComponentDescriptor::AddDataInPort() + virtual AAX_Result AddAuxOutputStem ( AAX_CFieldIndex inFieldIndex, int32_t inStemFormat, const char inNameUTF8[]) = 0; ///< \copydoc AAX_IComponentDescriptor::AddAuxOutputStem() + virtual AAX_Result AddPrivateData ( AAX_CFieldIndex inFieldIndex, int32_t inDataSize, uint32_t inOptions = AAX_ePrivateDataOptions_DefaultOptions ) = 0; ///< \copydoc AAX_IComponentDescriptor::AddPrivateData() + virtual AAX_Result AddDmaInstance ( AAX_CFieldIndex inFieldIndex, AAX_IDma::EMode inDmaMode ) = 0; ///< \copydoc AAX_IComponentDescriptor::AddDmaInstance() + virtual AAX_Result AddMIDINode ( AAX_CFieldIndex inFieldIndex, AAX_EMIDINodeType inNodeType, const char inNodeName[], uint32_t channelMask ) = 0; ///< \copydoc AAX_IComponentDescriptor::AddMIDINode() + + virtual AAX_Result AddProcessProc_Native ( + AAX_CProcessProc inProcessProc, + IACFUnknown * inProperties, + AAX_CInstanceInitProc inInstanceInitProc, + AAX_CBackgroundProc inBackgroundProc, + AAX_CSelector * outProcID) = 0; ///< \copydoc AAX_IComponentDescriptor::AddProcessProc_Native() + virtual AAX_Result AddProcessProc_TI ( + const char inDLLFileNameUTF8 [], + const char inProcessProcSymbol [], + IACFUnknown * inProperties, + const char inInstanceInitProcSymbol [], + const char inBackgroundProcSymbol [], + AAX_CSelector * outProcID) = 0; ///< \copydoc AAX_IComponentDescriptor::AddProcessProc_TI() + + virtual AAX_Result AddMeters ( AAX_CFieldIndex inFieldIndex, const AAX_CTypeID* inMeterIDs, const uint32_t inMeterCount ) = 0; ///< \copydoc AAX_IComponentDescriptor::AddMeters() +}; + +/** \brief Versioned description interface for an %AAX plug-in algorithm callback + */ +class AAX_IACFComponentDescriptor_V2 : public AAX_IACFComponentDescriptor +{ +public: + virtual AAX_Result AddTemporaryData( AAX_CFieldIndex inFieldIndex, uint32_t inDataElementSize) = 0; ///< \copydoc AAX_IComponentDescriptor::AddTemporaryData() +}; + +/** \brief Versioned description interface for an %AAX plug-in algorithm callback + */ +class AAX_IACFComponentDescriptor_V3 : public AAX_IACFComponentDescriptor_V2 +{ +public: + virtual AAX_Result AddProcessProc ( + IACFUnknown * inProperties, + AAX_CSelector* outProcIDs, + int32_t inProcIDsSize) = 0; ///< \copydoc AAX_IComponentDescriptor::AddProcessProc() +}; + +#ifdef __clang__ +#pragma clang diagnostic pop +#endif + +#endif // #ifndef _AAX_IACFCOMPONENTDESCRIPTOR_H_ diff --git a/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_IACFController.h b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_IACFController.h new file mode 100644 index 0000000000..28e8da794f --- /dev/null +++ b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_IACFController.h @@ -0,0 +1,231 @@ +/*================================================================================================*/ +/* + * + * Copyright 2013-2017, 2023-2024 Avid Technology, Inc. + * All rights reserved. + * + * This file is part of the Avid AAX SDK. + * + * The AAX SDK is subject to commercial or open-source licensing. + * + * By using the AAX SDK, you agree to the terms of both the Avid AAX SDK License + * Agreement and Avid Privacy Policy. + * + * AAX SDK License: https://developer.avid.com/aax + * Privacy Policy: https://www.avid.com/legal/privacy-policy-statement + * + * Or: You may also use this code under the terms of the GPL v3 (see + * www.gnu.org/licenses). + * + * THE AAX SDK IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER + * EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE + * DISCLAIMED. + * + */ + +/** + * \file AAX_IACFController.h + * + * \brief Interface for the %AAX host's view of a single instance of an + * effect. Used by both clients of the AAXHost and by effect components. + * + */ +/*================================================================================================*/ + + +#ifndef _AAX_IACFCONTROLLER_H_ +#define _AAX_IACFCONTROLLER_H_ + +#include "AAX.h" + +#ifdef __clang__ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wnon-virtual-dtor" +#endif + +#include "acfunknown.h" + +// Forward declarations +class AAX_IPageTable; +class AAX_IString; + +/** \brief Interface for the %AAX host's view of a single instance of an + * effect. Used by both clients of the AAXHost and by effect components. + */ +class AAX_IACFController : public IACFUnknown +{ +public: + + // Host information getters + /** \copydoc AAX_IController::GetEffectID() */ + virtual + AAX_Result + GetEffectID ( + AAX_IString * outEffectID) const = 0; + + /** \copydoc AAX_IController::GetSampleRate() */ + virtual + AAX_Result + GetSampleRate ( + AAX_CSampleRate *outSampleRate ) const = 0; + + /** \copydoc AAX_IController::GetInputStemFormat() */ + virtual + AAX_Result + GetInputStemFormat ( + AAX_EStemFormat *outStemFormat ) const = 0; + + /** \copydoc AAX_IController::GetOutputStemFormat() */ + virtual + AAX_Result + GetOutputStemFormat ( + AAX_EStemFormat *outStemFormat) const = 0; + + /** \copydoc AAX_IController::GetSignalLatency() */ + virtual + AAX_Result + GetSignalLatency( + int32_t* outSamples) const = 0; + + /** \copydoc AAX_IController::GetCycleCount() */ + virtual + AAX_Result + GetCycleCount( + AAX_EProperty inWhichCycleCount, + AAX_CPropertyValue* outNumCycles) const = 0; + + /** \copydoc AAX_IController::GetTODLocation() */ + virtual + AAX_Result + GetTODLocation ( + AAX_CTimeOfDay* outTODLocation ) const = 0; + + //Host Information Setters (Dynamic info) + /** \copydoc AAX_IController::SetSignalLatency() */ + virtual + AAX_Result + SetSignalLatency( + int32_t inNumSamples) = 0; + + /** \copydoc AAX_IController::SetCycleCount() */ + virtual + AAX_Result + SetCycleCount( + AAX_EProperty* inWhichCycleCounts, + AAX_CPropertyValue* iValues, + int32_t numValues) = 0; + + // Posting functions + /** \copydoc AAX_IController::PostPacket() */ + virtual + AAX_Result + PostPacket ( + AAX_CFieldIndex inFieldIndex, + const void * inPayloadP, + uint32_t inPayloadSize) = 0; + + //Metering functions + /** \copydoc AAX_IController::GetCurrentMeterValue() */ + virtual + AAX_Result + GetCurrentMeterValue ( + AAX_CTypeID inMeterID, + float * outMeterValue ) const = 0; + + /** \copydoc AAX_IController::GetMeterPeakValue() */ + virtual + AAX_Result + GetMeterPeakValue ( + AAX_CTypeID inMeterID, + float * outMeterPeakValue ) const = 0; + + /** \copydoc AAX_IController::ClearMeterPeakValue() */ + virtual + AAX_Result + ClearMeterPeakValue ( + AAX_CTypeID inMeterID ) const = 0; + + /** \copydoc AAX_IController::GetMeterClipped() */ + virtual + AAX_Result + GetMeterClipped ( + AAX_CTypeID inMeterID, + AAX_CBoolean * outClipped ) const = 0; + + /** \copydoc AAX_IController::ClearMeterClipped() */ + virtual + AAX_Result + ClearMeterClipped ( + AAX_CTypeID inMeterID ) const = 0; + + /** \copydoc AAX_IController::GetMeterCount() */ + virtual + AAX_Result + GetMeterCount ( + uint32_t * outMeterCount ) const = 0; + + // MIDI methods + /** \copydoc AAX_IController::GetNextMIDIPacket() */ + virtual + AAX_Result + GetNextMIDIPacket ( + AAX_CFieldIndex* outPort, + AAX_CMidiPacket* outPacket ) = 0; + + }; + +/** @copydoc AAX_IACFController + */ +class AAX_IACFController_V2 : public AAX_IACFController +{ +public: + // Notification method + /** \copydoc AAX_IController::SendNotification() */ + virtual + AAX_Result + SendNotification ( + AAX_CTypeID inNotificationType, + const void* inNotificationData, + uint32_t inNotificationDataSize) = 0; + + /** \copydoc AAX_IController::GetHybridSignalLatency() */ + virtual + AAX_Result + GetHybridSignalLatency( + int32_t* outSamples) const = 0; + + /** \copydoc AAX_IController::GetCurrentAutomationTimestamp() */ + virtual + AAX_Result + GetCurrentAutomationTimestamp( + AAX_CTransportCounter* outTimestamp) const = 0; + + /** \copydoc AAX_IController::GetHostName() */ + virtual + AAX_Result + GetHostName( + AAX_IString* outHostNameString) const = 0; +}; + +/** @copydoc AAX_IACFController + */ +class AAX_IACFController_V3 : public AAX_IACFController_V2 +{ +public: + /** \copydoc AAX_IController::GetPlugInTargetPlatform() */ + virtual + AAX_Result + GetPlugInTargetPlatform( + AAX_CTargetPlatform* outTargetPlatform) const = 0; + + /** \copydoc AAX_IController::GetIsAudioSuite() */ + virtual + AAX_Result + GetIsAudioSuite(AAX_CBoolean* outIsAudioSuite) const = 0; +}; + +#ifdef __clang__ +#pragma clang diagnostic pop +#endif + +#endif // #ifndef _AAX_IACFCONTROLLER_H_ diff --git a/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_IACFDataBuffer.h b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_IACFDataBuffer.h new file mode 100644 index 0000000000..7e873010e4 --- /dev/null +++ b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_IACFDataBuffer.h @@ -0,0 +1,77 @@ +/*================================================================================================*/ +/* + * + * Copyright 2023-2024 Avid Technology, Inc. + * All rights reserved. + * + * This file is part of the Avid AAX SDK. + * + * The AAX SDK is subject to commercial or open-source licensing. + * + * By using the AAX SDK, you agree to the terms of both the Avid AAX SDK License + * Agreement and Avid Privacy Policy. + * + * AAX SDK License: https://developer.avid.com/aax + * Privacy Policy: https://www.avid.com/legal/privacy-policy-statement + * + * Or: You may also use this code under the terms of the GPL v3 (see + * www.gnu.org/licenses). + * + * THE AAX SDK IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER + * EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE + * DISCLAIMED. + * + */ + +/** + * \file AAX_IACFDataBuffer.h + */ +/*================================================================================================*/ + +#pragma once + +#ifndef AAX_IACFDataBuffer_H +#define AAX_IACFDataBuffer_H + +#include "AAX.h" + +#ifdef __clang__ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wnon-virtual-dtor" +#endif + +#include "acfunknown.h" + +/** + * \brief Versioned interface for reference counted data buffers + * + * \details + * This interface is intended to be used for passing arbitrary blocks + * of data across the binary boundary and allowing the receiver to + * take ownership of the allocated memory. + */ +class AAX_IACFDataBuffer : public IACFUnknown +{ +public: + /** + * The type of data contained in this buffer + * + * This identifier must be sufficient for a client that + * knows the type to correctly interpret and use the data. + */ + virtual AAX_Result Type(AAX_CTypeID * oType) const = 0; + /** + * The number of bytes of data in this buffer + */ + virtual AAX_Result Size(int32_t * oSize) const = 0; + /** + * The buffer of data + */ + virtual AAX_Result Data(void const ** oBuffer) const = 0; +}; + +#ifdef __clang__ +#pragma clang diagnostic pop +#endif + +#endif diff --git a/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_IACFDescriptionHost.h b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_IACFDescriptionHost.h new file mode 100644 index 0000000000..2e2bda664e --- /dev/null +++ b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_IACFDescriptionHost.h @@ -0,0 +1,60 @@ +/*================================================================================================*/ +/* + * Copyright 2016-2017, 2023-2024 Avid Technology, Inc. + * All rights reserved. + * + * This file is part of the Avid AAX SDK. + * + * The AAX SDK is subject to commercial or open-source licensing. + * + * By using the AAX SDK, you agree to the terms of both the Avid AAX SDK License + * Agreement and Avid Privacy Policy. + * + * AAX SDK License: https://developer.avid.com/aax + * Privacy Policy: https://www.avid.com/legal/privacy-policy-statement + * + * Or: You may also use this code under the terms of the GPL v3 (see + * www.gnu.org/licenses). + * + * THE AAX SDK IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER + * EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE + * DISCLAIMED. + */ + +#ifndef AAXLibrary_AAX_IACFDescriptionHost_h +#define AAXLibrary_AAX_IACFDescriptionHost_h + + +#include "AAX.h" + +class AAX_IACFFeatureInfo; + +#ifdef __clang__ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wnon-virtual-dtor" +#endif + +#include "acfbaseapi.h" +#include "acfunknown.h" + +/** Interface to host services provided during plug-in description + */ +class AAX_IACFDescriptionHost : public IACFUnknown +{ +public: + // NOTE: Documentation is not copied directly from AAX_IDescriptionHost due to an adaptation of parameter types (IACFUnknown to AAX_IFeatureInfo) + /** + * \copybrief AAX_IDescriptionHost::AcquireFeatureProperties() + * + * \p outFeatureProperties must support \ref AAX_IACFFeatureInfo const methods + * + * \sa AAX_IDescriptionHost::AcquireFeatureProperties() + */ + virtual AAX_Result AcquireFeatureProperties(const AAX_Feature_UID& inFeatureID, IACFUnknown** outFeatureProperties) = 0; +}; + +#ifdef __clang__ +#pragma clang diagnostic pop +#endif + +#endif diff --git a/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_IACFEffectDescriptor.h b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_IACFEffectDescriptor.h new file mode 100644 index 0000000000..a695cc8afa --- /dev/null +++ b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_IACFEffectDescriptor.h @@ -0,0 +1,79 @@ +/*================================================================================================*/ +/* + * + * Copyright 2013-2017, 2023-2024 Avid Technology, Inc. + * All rights reserved. + * + * This file is part of the Avid AAX SDK. + * + * The AAX SDK is subject to commercial or open-source licensing. + * + * By using the AAX SDK, you agree to the terms of both the Avid AAX SDK License + * Agreement and Avid Privacy Policy. + * + * AAX SDK License: https://developer.avid.com/aax + * Privacy Policy: https://www.avid.com/legal/privacy-policy-statement + * + * Or: You may also use this code under the terms of the GPL v3 (see + * www.gnu.org/licenses). + * + * THE AAX SDK IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER + * EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE + * DISCLAIMED. + * + */ + +/** + * \file AAX_IACFEffectDescriptor.h + * + * \brief Versioned interface for an AAX_IEffectDescriptor + * + */ +/*================================================================================================*/ + + +#ifndef AAX_IACFEFFECTDESCRIPTOR_H +#define AAX_IACFEFFECTDESCRIPTOR_H + +#include "AAX.h" +#include "AAX_Callbacks.h" + +#ifdef __clang__ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wnon-virtual-dtor" +#endif + +#include "acfunknown.h" + + +/** \brief Versioned interface for an AAX_IEffectDescriptor + */ +class AAX_IACFEffectDescriptor : public IACFUnknown +{ +public: + + virtual AAX_Result AddComponent ( IACFUnknown* inComponentDescriptor ) = 0; ///< \copydoc AAX_IEffectDescriptor::AddComponent() + virtual AAX_Result AddName ( const char *inPlugInName ) = 0; ///< \copydoc AAX_IEffectDescriptor::AddName() + virtual AAX_Result AddCategory ( uint32_t inCategory ) = 0; ///< \copydoc AAX_IEffectDescriptor::AddCategory() + virtual AAX_Result AddCategoryBypassParameter ( uint32_t inCategory, AAX_CParamID inParamID ) = 0; ///< \copydoc AAX_IEffectDescriptor::AddCategoryBypassParameter() + virtual AAX_Result AddProcPtr ( void * inProcPtr, AAX_CProcPtrID inProcID ) = 0; ///< \copydoc AAX_IEffectDescriptor::AddProcPtr() + virtual AAX_Result SetProperties ( IACFUnknown * inProperties ) = 0; ///< \copydoc AAX_IEffectDescriptor::SetProperties() + virtual AAX_Result AddResourceInfo ( AAX_EResourceType inResourceType, const char * inInfo ) = 0; ///< \copydoc AAX_IEffectDescriptor::AddResourceInfo() + virtual AAX_Result AddMeterDescription( AAX_CTypeID inMeterID, const char * inMeterName, IACFUnknown * inProperties ) = 0; ///< \copydoc AAX_IEffectDescriptor::AddMeterDescription() +}; + +/** + * \brief Versioned interface for an AAX_IEffectDescriptor + * + */ +class AAX_IACFEffectDescriptor_V2 : public AAX_IACFEffectDescriptor +{ +public: + virtual AAX_Result AddControlMIDINode ( AAX_CTypeID inNodeID, AAX_EMIDINodeType inNodeType, const char inNodeName[], uint32_t inChannelMask ) = 0; ///< \copydoc AAX_IEffectDescriptor::AddControlMIDINode() +}; + +#ifdef __clang__ +#pragma clang diagnostic pop +#endif + +#endif // AAX_IACFEFFECTDESCRIPTOR_H diff --git a/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_IACFEffectDirectData.h b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_IACFEffectDirectData.h new file mode 100644 index 0000000000..e3c6e0450d --- /dev/null +++ b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_IACFEffectDirectData.h @@ -0,0 +1,159 @@ +/*================================================================================================*/ +/* + * + * Copyright 2013-2015, 2023-2024 Avid Technology, Inc. + * All rights reserved. + * + * This file is part of the Avid AAX SDK. + * + * The AAX SDK is subject to commercial or open-source licensing. + * + * By using the AAX SDK, you agree to the terms of both the Avid AAX SDK License + * Agreement and Avid Privacy Policy. + * + * AAX SDK License: https://developer.avid.com/aax + * Privacy Policy: https://www.avid.com/legal/privacy-policy-statement + * + * Or: You may also use this code under the terms of the GPL v3 (see + * www.gnu.org/licenses). + * + * THE AAX SDK IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER + * EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE + * DISCLAIMED. + * + */ + +/** + * \file AAX_IACFEffectDirectData.h + * + * \brief The direct data access interface that gets exposed to the host application + * + */ +/*================================================================================================*/ + + +#ifndef AAX_IACFEFFECTDIRECTDATA_H +#define AAX_IACFEFFECTDIRECTDATA_H + +#include "AAX.h" + +#ifdef __clang__ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wnon-virtual-dtor" +#endif + +#include "acfunknown.h" + + +/** @brief Optional interface for direct access to a plug-in's alg memory. + + @details + Direct data access allows a plug-in to directly manipulate the data in its algorithm's + private data blocks. The callback methods in this interface provide a safe context + from which this kind of access may be attempted. + + \ingroup AuxInterface_DirectData +*/ +class AAX_IACFEffectDirectData : public IACFUnknown +{ +public: + + /** @name Initialization and uninitialization + */ + //@{ + /*! + * \brief Main initialization + * + * Called when the interface is created + * + * \param[in] iController + * A versioned reference that resolves to an AAX_IController interface + */ + virtual AAX_Result Initialize ( IACFUnknown * iController ) = 0; + /*! + * \brief Main uninitialization + * + * Called when the interface is destroyed. + * + */ + virtual AAX_Result Uninitialize () = 0; + //@}end Initialization and uninitialization + + + /** @name Safe data update callbacks + * + * These callbacks provide a safe context from which to directly access the + * algorithm's private data blocks. Each callback is called regularly with + * roughly the schedule of its corresponding AAX_IEffectParameters counterpart. + * + * \note Do not attempt to directly access the algorithm's data from outside + * these callbacks. Instead, use the packet system to route data to the + * algorithm using the %AAX host's buffered data transfer facilities. + * + */ + //@{ + /*! + * \brief Periodic wakeup callback for idle-time operations + * + * Direct alg data updates must be triggered from this method. + * + * This method is called from the host using a non-main thread. In general, it should + * be driven at approximately one call per 30 ms. However, the wakeup is not guaranteed to + * be called at any regular interval - for example, it could be held off by a high real-time + * processing load - and there is no host contract regarding maximum latency between wakeup + * calls. + * + * This wakeup thread runs continuously and cannot be armed/disarmed or by the plug-in. + * + * \param[in] iDataAccessInterface + * Reference to the direct access interface. + * + * \note It is not safe to save this address or call + * the methods in this interface from other threads. + */ + virtual AAX_Result TimerWakeup ( + IACFUnknown * iDataAccessInterface ) = 0; + //@} end +}; + + +class AAX_IACFEffectDirectData_V2 : public AAX_IACFEffectDirectData{ +public: + /** @name %AAX host and plug-in event notification + */ + //@{ + /*! + * \brief Notification Hook + * + * Called from the host to deliver notifications to this object. + * + * Look at the \ref AAX_ENotificationEvent enumeration to see a description of events you can listen for and the + * data they come with. + * + * - \note some notifications are sent only to the plug-in GUI while other notifications are sent only to the + * plug-in data model. If you are not seeing an expected notification, try checking the other plug-in objects' + * \c NotificationReceived() methods. + * - \note the host may dispatch notifications synchronously or asynchronously, and calls to this method may + * occur concurrently on multiple threads. + * + * A plug-in may also dispatch custom notifications using \ref AAX_IController::SendNotification(). Custom + * notifications will be posted back to the plug-in's other objects which support a \c NotificationReceived() + * method (e.g. the GUI). + * + * \param[in] inNotificationType + * Type of notification being received. Notifications form the host are one of \ref AAX_ENotificationEvent + * \param[in] inNotificationData + * Block of incoming notification data + * \param[in] inNotificationDataSize + * Size of \p inNotificationData, in bytes + */ + virtual AAX_Result NotificationReceived( /* AAX_ENotificationEvent */ AAX_CTypeID inNotificationType, const void * inNotificationData, uint32_t inNotificationDataSize) = 0; + //@}end %AAX host and plug-in event notification + +}; + +#ifdef __clang__ +#pragma clang diagnostic pop +#endif + +#endif //AAX_IACFEFFECTDIRECTDATA_H diff --git a/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_IACFEffectGUI.h b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_IACFEffectGUI.h new file mode 100644 index 0000000000..1e611d5fcd --- /dev/null +++ b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_IACFEffectGUI.h @@ -0,0 +1,254 @@ +/*================================================================================================*/ +/* + * + * Copyright 2013-2017, 2023-2024 Avid Technology, Inc. + * All rights reserved. + * + * This file is part of the Avid AAX SDK. + * + * The AAX SDK is subject to commercial or open-source licensing. + * + * By using the AAX SDK, you agree to the terms of both the Avid AAX SDK License + * Agreement and Avid Privacy Policy. + * + * AAX SDK License: https://developer.avid.com/aax + * Privacy Policy: https://www.avid.com/legal/privacy-policy-statement + * + * Or: You may also use this code under the terms of the GPL v3 (see + * www.gnu.org/licenses). + * + * THE AAX SDK IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER + * EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE + * DISCLAIMED. + * + */ + +/** + * \file AAX_IACFEffectGUI.h + * + * \brief The GUI interface that gets exposed to the host application + * + */ +/*================================================================================================*/ + + +#ifndef AAX_IACFEFFECTGUI_H +#define AAX_IACFEFFECTGUI_H + +#include "AAX.h" +#include "AAX_GUITypes.h" +#include "AAX_IString.h" + +#ifdef __clang__ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wnon-virtual-dtor" +#endif + +#include "acfunknown.h" + + +/** @brief The interface for a %AAX Plug-in's GUI (graphical user interface). + + @details + This is the interface for an instance of a plug-in's GUI that gets + exposed to the host application. The %AAX host interacts with your + plug-in's GUI via this interface. See \ref CommonInterface_GUI. + + The plug-in's implementation of this interface is responsible for + managing the plug-in's window and graphics objects and for defining the + interactions between GUI views and the plug-in's data model. + + At \ref Initialize() "initialization", the host provides this interface + with a reference to AAX_IController. The GUI may use this controller to + retrieve a pointer to the plug-in's AAX_IEffectParameters interface, + allowing the GUI to request changes to the plug-in's data model in + response to view events. In addition, the controller provides a means of + querying information from the host such as stem format or sample rate + + When managing a plug-in's GUI it is important to remember that this is + just one of many possible sets of views for the plug-in's parameters. + Other views and editors, such as automation lanes or control surfaces, + also have the ability to synchronously interact with the plug-in's + abstract data model interface. Therefore, the GUI should not take + asymmetric control over the data model, act as a + secondary data model, or otherwise assume exclusive ownership of the + plug-in's state. In general, the data model's abstraction to a pure + virtual interface will protect against such aberrations, but this remains + an important consideration when managing sophisiticated GUI interactions. + + You will most likely inherit your implementation of this interface from + AAX_CEffectGUI, a default implementation that provides basic GUI + functionality and which you can override and customize as needed. + + The SDK includes several examples of how the GUI interface may be + extended and implemented in order to provide support for third-party + frameworks. These examples can be found in the /Extensions/GUI directory + in the SDK. + + \note Your implementation of this interface must inherit from AAX_IEffectGUI. + + \legacy In the legacy plug-in SDK, these methods were found in CProcess and + CEffectProcess. For additional CProcess methods, see AAX_IEffectParameters. + + \ingroup CommonInterface_GUI +*/ +class AAX_IACFEffectGUI : public IACFUnknown +{ +public: + + /** @name Initialization and uninitialization + */ + //@{ + /*! + * \brief Main GUI initialization + * + * Called when the GUI is created + * + * \param[in] iController + * A versioned reference that resolves to an AAX_IController interface + */ + virtual AAX_Result Initialize ( IACFUnknown * iController ) = 0; + /*! + * \brief Main GUI uninitialization + * + * Called when the GUI is destroyed. Frees the GUI. + * + */ + virtual AAX_Result Uninitialize () = 0; + //@}end Initialization and uninitialization + + /** @name %AAX host and plug-in event notification + */ + //@{ + /*! + * \brief Notification Hook + * + * Called from the host to deliver notifications to this object. + * + * Look at the \ref AAX_ENotificationEvent enumeration to see a description of events you can listen for and the + * data they come with. + * + * - \note some notifications are sent only to the plug-in GUI while other notifications are sent only to the + * plug-in data model. If you are not seeing an expected notification, try checking the other plug-in objects' + * \c NotificationReceived() methods. + * - \note the host may dispatch notifications synchronously or asynchronously, and calls to this method may + * occur concurrently on multiple threads. + * + * A plug-in may also dispatch custom notifications using \ref AAX_IController::SendNotification(). Custom + * notifications will be posted back to the plug-in's other objects which support a \c NotificationReceived() + * method (e.g. the data model). + * + * \param[in] inNotificationType + * Type of notification being received. Notifications form the host are one of \ref AAX_ENotificationEvent + * \param[in] inNotificationData + * Block of incoming notification data + * \param[in] inNotificationDataSize + * Size of \p inNotificationData, in bytes + */ + virtual AAX_Result NotificationReceived(/* AAX_ENotificationEvent */ AAX_CTypeID inNotificationType, const void * inNotificationData, uint32_t inNotificationDataSize) = 0; + //@}end %AAX host and plug-in event notification + + /** @name View accessors + */ + //@{ + /*! + * \brief Provides a handle to the main plug-in window + * + * \param[in] iViewContainer + * An \ref AAX_IViewContainer providing a native handle to the plug-in's window + */ + virtual AAX_Result SetViewContainer ( IACFUnknown * iViewContainer ) = 0; + /*! + * \brief Retrieves the size of the plug-in window + * + * \sa \ref AAX_IViewContainer::SetViewSize() + * + * \param[out] oViewSize + * The size of the plug-in window as a point (width, height) + */ + virtual AAX_Result GetViewSize ( AAX_Point * oViewSize ) const = 0; + //@}end View accessors + + /** @name GUI update methods + */ + //@{ + /*! \brief DEPRECATED, Not called from host any longer. + * Your chosen graphics framework should be directly handling draw events from the OS. + */ + virtual AAX_Result Draw ( AAX_Rect * iDrawRect ) = 0; + /*! + * \brief Periodic wakeup callback for idle-time operations + * + * GUI animation events such as meter updates should be triggered from this method. + * + * This method is called from the host's main thread. In general, it should + * be driven at approximately one call per 30 ms. However, the wakeup is not guaranteed to + * be called at any regular interval - for example, it could be held off by a high real-time + * processing load - and there is no host contract regarding maximum latency between wakeup + * calls. + * + * This wakeup runs continuously and cannot be armed/disarmed by the plug-in. + * + */ + virtual AAX_Result TimerWakeup () = 0; + /*! + * \brief Notifies the GUI that a parameter value has changed + * + * This method is called by the host whenever a parameter value has been modified + * + * This method may be called on a non-main thread + * + * \internal + * \todo Create a "batch" version of this method, or convert this API to accept multiple + * updates in a single call a la \ref AAX_IACFEffectParameters::GenerateCoefficients(). + * \endinternal + * + */ + virtual AAX_Result ParameterUpdated( AAX_CParamID inParamID) = 0; + //@}end GUI update methods + + + /** @name Host interface methods + * + * Miscellaneous methods to provide host-specific functionality + */ + //@{ + /*! + * \brief Called by host application to retrieve a custom plug-in string + * + * If no string is provided then the host's default will be used. + * + * \param[in] iSelector + * The requested strong. One of \ref AAX_EPlugInStrings + * \param[out] oString + * The plug-in's custom value for the requested string + * + */ + virtual AAX_Result GetCustomLabel ( AAX_EPlugInStrings iSelector, AAX_IString * oString ) const = 0; + /*! + * \brief Called by host application. Indicates that a control widget should be + * updated with a highlight color + * + * \todo Document this method + * + * \legacy This method was re-named from \c SetControlHighliteInfo(), its + * name in the legacy plug-in SDK. + * + * \param[in] iParameterID + * ID of parameter whose widget(s) must be highlighted + * \param[in] iIsHighlighted + * True if turning highlight on, false if turning it off + * \param[in] iColor + * Desired highlight color. One of \ref AAX_EHighlightColor + * + */ + virtual AAX_Result SetControlHighlightInfo ( AAX_CParamID iParameterID, AAX_CBoolean iIsHighlighted, AAX_EHighlightColor iColor ) = 0; + //@}end Host interface methods + +}; + +#ifdef __clang__ +#pragma clang diagnostic pop +#endif + +#endif //AAX_IACFEFFECTGUI_H diff --git a/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_IACFEffectParameters.h b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_IACFEffectParameters.h new file mode 100644 index 0000000000..985d03edfd --- /dev/null +++ b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_IACFEffectParameters.h @@ -0,0 +1,1108 @@ +/*================================================================================================*/ +/* + * + * Copyright 2013-2017, 2019, 2023-2024 Avid Technology, Inc. + * All rights reserved. + * + * This file is part of the Avid AAX SDK. + * + * The AAX SDK is subject to commercial or open-source licensing. + * + * By using the AAX SDK, you agree to the terms of both the Avid AAX SDK License + * Agreement and Avid Privacy Policy. + * + * AAX SDK License: https://developer.avid.com/aax + * Privacy Policy: https://www.avid.com/legal/privacy-policy-statement + * + * Or: You may also use this code under the terms of the GPL v3 (see + * www.gnu.org/licenses). + * + * THE AAX SDK IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER + * EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE + * DISCLAIMED. + * + */ + +/** + * \file AAX_IACFEffectParameters.h + * + * \brief The data model interface that is exposed to the host application + * + */ +/*================================================================================================*/ + + +#ifndef AAX_IACFEFFECTPARAMETERS_H +#define AAX_IACFEFFECTPARAMETERS_H + +#include "AAX.h" + +class AAX_IString; +class AAX_IParameter; + + +#ifdef __clang__ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wnon-virtual-dtor" +#endif + +#include "acfunknown.h" + +/** @brief The interface for an %AAX Plug-in's data model + + @details + This is the interface for an instance of a plug-in's data model that gets exposed + to the host application. The %AAX host interacts with your plug-in's data model + via this interface, which includes methods that store and update of your plug-in's + internal data. See \ref CommonInterface_DataModel. + + \note Your implementation of this interface must inherit from + \ref AAX_IEffectParameters. + + \todo Add documentation for expected error state return values + + \ingroup CommonInterface_DataModel +*/ +class AAX_IACFEffectParameters : public IACFUnknown +{ +public: + + /** @name Initialization and uninitialization + */ + //@{ + /*! + * \brief Main data model initialization. Called when plug-in instance is first instantiated. + * + * \note Most plug-ins should override \ref AAX_CEffectParameters::EffectInit() rather than directly overriding this method + * + * \param[in] iController + * A versioned reference that resolves to an AAX_IController interface + */ + virtual AAX_Result Initialize(IACFUnknown * iController) = 0; + /*! + * \brief Main data model uninitialization + * + * \todo Docs: When exactly is AAX_IACFEffectParameters::Uninitialize() called, and under what conditions? + * + */ + virtual AAX_Result Uninitialize () = 0; + //@}end Initialization and uninitialization + + + /** @name %AAX host and plug-in event notification + */ + //@{ + /*! + * \brief Notification Hook + * + * Called from the host to deliver notifications to this object. + * + * Look at the \ref AAX_ENotificationEvent enumeration to see a description of events you can listen for and the + * data they come with. + * + * - \note some notifications are sent only to the plug-in GUI while other notifications are sent only to the + * plug-in data model. If you are not seeing an expected notification, try checking the other plug-in objects' + * \c NotificationReceived() methods. + * - \note the host may dispatch notifications synchronously or asynchronously, and calls to this method may + * occur concurrently on multiple threads. + * + * A plug-in may also dispatch custom notifications using \ref AAX_IController::SendNotification(). Custom + * notifications will be posted back to the plug-in's other objects which support a \c NotificationReceived() + * method (e.g. the GUI). + * + * \param[in] inNotificationType + * Type of notification being received. Notifications form the host are one of \ref AAX_ENotificationEvent + * \param[in] inNotificationData + * Block of incoming notification data + * \param[in] inNotificationDataSize + * Size of \p inNotificationData, in bytes + */ + virtual AAX_Result NotificationReceived( /* AAX_ENotificationEvent */ AAX_CTypeID inNotificationType, const void * inNotificationData, uint32_t inNotificationDataSize) = 0; + //@}end %AAX host and plug-in event notification + + + /** @name Parameter information + * + * These methods are used by the %AAX host to retrieve information about the plug-in's data + * model. + * + * \n \n + * + * For information about adding parameters to the plug-in and otherwise modifying + * the plug-in's data model, see AAX_CParameterManager. For information about parameters, + * see AAX_IParameter. + */ + //@{ + /*! + * \brief CALL: Retrieves the total number of plug-in parameters + * + * \param[out] oNumControls + * The number of parameters in the plug-in's Parameter Manager + */ + virtual AAX_Result GetNumberOfParameters ( int32_t * oNumControls ) const = 0; + /*! + * \brief CALL: Retrieves the ID of the plug-in's Master Bypass parameter. + * + * This is required if you want our master bypass functionality in the host to hook up to your bypass parameters. + * + * \param[out] oIDString + * The ID of the plug-in's Master Bypass control + */ + virtual AAX_Result GetMasterBypassParameter ( AAX_IString * oIDString ) const = 0; + /*! + * \brief CALL: Retrieves information about a parameter's automatable status + * + * \param[in] iParameterID + * The ID of the parameter that is being queried + * \param[out] oAutomatable + * True if the queried parameter is automatable, false if it is not + * + */ + virtual AAX_Result GetParameterIsAutomatable ( AAX_CParamID iParameterID, AAX_CBoolean * oAutomatable ) const = 0; + /*! + * \brief CALL: Retrieves the number of discrete steps for a parameter + * + * \note The value returned for \p oNumSteps MUST be greater than zero. All other values + * will be considered an error by the host. + * + * \param[in] iParameterID + * The ID of the parameter that is being queried + * \param[out] oNumSteps + * The number of steps for this parameter + * + */ + virtual AAX_Result GetParameterNumberOfSteps ( AAX_CParamID iParameterID, int32_t * oNumSteps ) const = 0; + /*! + * \brief CALL: Retrieves the full name for a parameter + * + * \param[in] iParameterID + * The ID of the parameter that is being queried + * \param[out] oName + * Reference to an \ref AAX_IString owned by the host. The plug-in must set this string equal to + * the parameter's full name. + * + */ + virtual AAX_Result GetParameterName ( AAX_CParamID iParameterID, AAX_IString * oName ) const = 0; + /*! + * \brief CALL: Retrieves an abbreviated name for a parameter + * + * In general, lengths of 3 through 8 and 31 should be specifically addressed. + * + * \compatibility In most cases, the %AAX host will call + * \ref AAX_IACFEffectParameters::GetParameterName() "GetParameterName()" or + * \ref AAX_IACFEffectParameters::GetParameterNameOfLength() "GetParameterNameOfLength()" to retrieve + * parameter names for display. However, when Pro Tools is retrieving a plug-in name for display on + * a control surface the XML data stored in the plug-in's page tables will be used in preference to + * values retrieved from these methods. + * + * \param[in] iParameterID + * The ID of the parameter that is being queried + * \param[out] oName + * Reference to an \ref AAX_IString owned by the host. The plug-in must set this string equal to + * an abbreviated name for the parameter, using \c iNameLength characters or fewer. + * \param[in] iNameLength + * The maximum number of characters in \c oName + * + */ + virtual AAX_Result GetParameterNameOfLength ( AAX_CParamID iParameterID, AAX_IString * oName, int32_t iNameLength ) const = 0; + /*! + * \brief CALL: Retrieves default value of a parameter + * + * \param[in] iParameterID + * The ID of the parameter that is being queried + * \param[out] oValue + * The parameter's default value + * + */ + virtual AAX_Result GetParameterDefaultNormalizedValue ( AAX_CParamID iParameterID, double * oValue ) const = 0; + /*! + * \brief CALL: Sets the default value of a parameter + * + * \param[in] iParameterID + * The ID of the parameter that is being updated + * \param[out] iValue + * The parameter's new default value + * + * \todo THIS IS NOT CALLED FROM HOST. USEFUL FOR INTERNAL USE ONLY? + * + */ + virtual AAX_Result SetParameterDefaultNormalizedValue ( AAX_CParamID iParameterID, double iValue ) = 0; + /*! + * \brief CALL: Retrieves the type of a parameter + * + * \todo The concept of parameter type needs more documentation + * + * \param[in] iParameterID + * The ID of the parameter that is being queried + * \param[out] oParameterType + * The parameter's type + * + */ + virtual AAX_Result GetParameterType ( AAX_CParamID iParameterID, AAX_EParameterType * oParameterType ) const = 0; + /*! + * \brief CALL: Retrieves the orientation that should be applied to a parameter's controls + * + * \todo update this documentation + * + * This method allows you to specify the orientation of knob controls that are managed + * by the host (e.g. knobs on an attached control surface.) + * + * Here is an example override of this method that reverses the orientation of a + * control for a parameter: + + \code + // AAX_IParameter* myBackwardsParameter + if (iParameterID == myBackwardsParameter->Identifier()) + { + *oParameterType = + AAX_eParameterOrientation_BottomMinTopMax | + AAX_eParameterOrientation_LeftMinRightMax | + AAX_eParameterOrientation_RotaryWrapMode | + AAX_eParameterOrientation_RotaryLeftMinRightMax; + } + \endcode + + * The orientation options are set according to \ref AAX_EParameterOrientationBits + * + * \legacy \ref AAX_IEffectParameters::GetParameterOrientation() corresponds to the + * GetControlOrientation() method in the legacy RTAS/TDM SDK. + * + * \param[in] iParameterID + * The ID of the parameter that is being queried + * \param[out] oParameterOrientation + * The orientation of the parameter + * + */ + virtual AAX_Result GetParameterOrientation ( AAX_CParamID iParameterID, AAX_EParameterOrientation * oParameterOrientation ) const = 0; + /*! + * \brief CALL: Retrieves an arbitrary setting within a parameter. + * + * This is a convenience function for accessing the richer parameter interface + * from the plug-in's other modules. + * + * \note This function must not be called by the host; \ref AAX_IParameter is not + * safe for passing across the binary boundary with the host! + * + * \param[in] iParameterID + * The ID of the parameter that is being queried + * \param[out] oParameter + * A pointer to the returned parameter + * + */ + virtual AAX_Result GetParameter ( AAX_CParamID iParameterID, AAX_IParameter ** oParameter ) = 0; + /*! + * \brief CALL: Retrieves the index of a parameter + * + * Although parameters are normally referenced by their AAX_CParamID, each parameter + * is also associated with a unique numeric index. + * + * \param[in] iParameterID + * The ID of the parameter that is being queried + * \param[out] oControlIndex + * The parameter's numeric index + * + */ + virtual AAX_Result GetParameterIndex ( AAX_CParamID iParameterID, int32_t * oControlIndex ) const = 0; + /*! + * \brief CALL: Retrieves the ID of a parameter + * + * This method can be used to convert a parameter's unique numeric index to its AAX_CParamID + * + * \param[in] iControlIndex + * The numeric index of the parameter that is being queried + * \param[out] oParameterIDString + * Reference to an \ref AAX_IString owned by the host. The plug-in must set this string equal to + * the parameter's ID. + * + */ + virtual AAX_Result GetParameterIDFromIndex ( int32_t iControlIndex, AAX_IString * oParameterIDString ) const = 0; + /*! + * \brief CALL: Retrieves a property of a parameter + * + * This is a general purpose query that is specialized based on the value of \p iSelector. + * The currently supported selector values are described by + * \ref AAX_EParameterValueInfoSelector . The meaning of \p oValue is dependent upon + * \p iSelector . + * + * \param[in] iParameterID + * The ID of the parameter that is being queried + * \param[in] iSelector + * The selector of the parameter value to retrieve. See \ref AAX_EParameterValueInfoSelector + * \param[out] oValue + * The value of the specified parameter + */ + virtual AAX_Result GetParameterValueInfo ( AAX_CParamID iParameterID, int32_t iSelector, int32_t* oValue) const = 0; + //@}end Parameter information + + + + /** @name Parameter setters and getters + * + * These methods are used by the %AAX host and by the plug-in's UI to retrieve and modify + * the values of the plug-in's parameters. + * + * \note The parameter setters in this section may generate asynchronous requests. + */ + //@{ + /*! + * \brief CALL: Converts a value string to a value + * + * This method uses the queried parameter's display delegate and taper to convert a \c char* + * string into its corresponding value. The formatting of valueString must be + * supported by the parameter's display delegate in order for this call to succeed. + * + * \legacy This method corresponds to CProcess::MapControlStringToVal() in the RTAS/TDM SDK + * + * \param[in] iParameterID + * The ID of the parameter that is being queried + * \param[out] oValue + * The value associated with valueString + * \param[in] iValueString + * The formatted value string that will be converted into a value + * + */ + virtual AAX_Result GetParameterValueFromString ( AAX_CParamID iParameterID, double * oValue, const AAX_IString & iValueString ) const = 0; + /*! + * \brief CALL: Converts a normalized parameter value into a string representing its + * corresponding real value + * + * This method uses the queried parameter's display delegate and taper to convert a + * normalized value into the corresponding \c char* value string for its real value. + * + * \legacy This method corresponds to CProcess::MapControlValToString() in the RTAS/TDM SDK + * + * \param[in] iParameterID + * The ID of the parameter that is being queried + * \param[in] iValue + * The normalized value that will be converted to a formatted valueString + * \param[out] oValueString + * The formatted value string associated with value + * \param[in] iMaxLength + * The maximum length of valueString + * + */ + virtual AAX_Result GetParameterStringFromValue ( AAX_CParamID iParameterID, double iValue, AAX_IString * oValueString, int32_t iMaxLength ) const = 0; + /*! + * \brief CALL: Retrieves the value string associated with a parameter's current value + * + * This method uses the queried parameter's display delegate and taper to convert + * its current value into a corresponding \c char* value string. + * + * \param[in] iParameterID + * The ID of the parameter that is being queried + * \param[out] oValueString + * The formatted value string associated with the parameter's current value + * \param[in] iMaxLength + * The maximum length of valueString + * + */ + virtual AAX_Result GetParameterValueString ( AAX_CParamID iParameterID, AAX_IString* oValueString, int32_t iMaxLength ) const = 0; + /*! + * \brief CALL: Retrieves a parameter's current value + * + * \param[in] iParameterID + * The ID of the parameter that is being queried + * \param[out] oValuePtr + * The parameter's current value + * + */ + virtual AAX_Result GetParameterNormalizedValue ( AAX_CParamID iParameterID, double * oValuePtr ) const = 0; + /*! + * \brief CALL: Sets the specified parameter to a new value + * + * SetParameterNormalizedValue() is responsible for initiating any process that is required in order to update + * all of the parameter's controls (e.g. in the plug-in's GUI, on control surfaces, in + * automation lanes, etc.) In most cases, the parameter manager will handle this initiation + * step. + * + * \param[in] iParameterID + * The ID of the parameter that is being set + * \param[in] iValue + * The value to which the parameter should be set + * + */ + virtual AAX_Result SetParameterNormalizedValue ( AAX_CParamID iParameterID, double iValue ) = 0; + /*! + * \brief CALL: Sets the specified parameter to a new value relative to its current value + * + * This method is used in cases when a relative control value is more convenient, for example + * when updating a GUI control using a mouse wheel or the arrow keys. Note that the host may + * apply the parameter's step size prior to calling SetParameterNormalizedRelative() in order to + * determine the correct value for aValue. + * + * SetParameterNormalizedRelative() can be used to incorporate "wrapping" behavior in a parameter's controls, if + * desired. If this behavior is not desired, then this method must properly account for + * overflow of the parameter's normalized value. + * + * SetParameterNormalizedRelative() is responsible for initiating any process that is required in order to update + * all of the parameter's controls (e.g. in the plug-in's GUI, on control surfaces, in + * automation lanes, etc.) In most cases, the parameter manager will handle this initiation + * step. + * + * See also UpdateParameterNormalizedRelative(). + * + * \todo REMOVE THIS METHOD (?) + * + * \param[in] iParameterID + * The ID of the parameter that is being queried + * \param[in] iValue + * The change in value that should be applied to the parameter + * + * \todo NOT CURRENTLY CALLED FROM THE HOST. USEFUL FOR INTERNAL USE ONLY? + * + */ + virtual AAX_Result SetParameterNormalizedRelative ( AAX_CParamID iParameterID, double iValue ) = 0; + //@}end Parameter setters and getters + + + + /** @name Automated parameter helpers + * + * These methods are used to lock and unlock automation system 'resources' when + * updating automatable parameters. + * + * \note You should never need to override these methods to extend their + * behavior beyond what is provided in AAX_CEffectParameters and AAX_IParameter + * + */ + //@{ + /*! + * \brief "Touches" (locks) a parameter in the automation system to a particular + * control in preparation for updates + * + * This method is called by the Parameter Manager to prime a parameter for receiving + * new automation data. When an automatable parameter is touched by a control, + * it will reject input from other controls until it is released. + * + * \note You should never need to override this method when using + * AAX_CEffectParameters. + * + * \param[in] iParameterID + * The parameter that is being touched + * + */ + virtual AAX_Result TouchParameter ( AAX_CParamID iParameterID ) = 0; + /*! + * \brief Releases a parameter from a "touched" state + * + * This method is called by the Parameter Manager to release a parameter so that + * any control may send updates to the parameter. + * + * \note You should never need to override this method when using + * \ref AAX_CEffectParameters. + * + * \param[in] iParameterID + * The parameter that is being released + * + */ + virtual AAX_Result ReleaseParameter ( AAX_CParamID iParameterID ) = 0; + /*! + * \brief Sets a "touched" state on a parameter + * + * \note This method should be overriden when dealing with linked parameters. Do NOT use this + * method to keep track of touch states. Use the + * \ref AAX_IACFAutomationDelegate "automation delegate" for that. + * + * \param[in] iParameterID + * The parameter that is changing touch states. + * \param[in] iTouchState + * The touch state of the parameter. + * + */ + virtual AAX_Result UpdateParameterTouch ( AAX_CParamID iParameterID, AAX_CBoolean iTouchState ) = 0; + //@}end Automated parameter helpers + + + /** @name Asynchronous parameter update methods + * + * These methods are called by the %AAX host when parameter values have been updated. They are + * called by the host and can be triggered by other plug-in modules via calls to + * \ref AAX_IParameter's \c SetValue methods, e.g. + * \ref AAX_IParameter::SetValueWithFloat() "SetValueWithFloat()" + * + * These methods are responsible for updating parameter values. + * + * Do not call these methods directly! To ensure proper + * synchronization and to avoid problematic dependency chains, other methods (e.g. + * \ref SetParameterNormalizedValue()) and components (e.g. \ref AAX_IEffectGUI) should always + * call a \c SetValue method on \ref AAX_IParameter to update parameter values. The \c SetValue + * method will properly manage automation locks and other system resources. + * + */ + //@{ + /*! + * \brief Updates a single parameter's state to its current value + * + * \note Do \em not call this method from the plug-in. This method should be called by the + * host only. To set parameter values from within the plug-in, use the \ref AAX_IParameter interface. + * + * \todo FLAGGED FOR CONSIDERATION OF REVISION + * + * \param[in] iParameterID + * The ID of the parameter that is being updated + * \param[in] iValue + * The parameter's current value, to which its internal state must be updated + * \param[in] iSource + * The source of the update + * + */ + virtual AAX_Result UpdateParameterNormalizedValue ( AAX_CParamID iParameterID, double iValue, AAX_EUpdateSource iSource ) = 0; + /*! + * \brief Updates a single parameter's state to its current value, as a difference + * with the parameter's previous value + * + * \deprecated This is not called from the host. It may still be useful for internal + * calls within the plug-in, though it should only ever be used to update non-automatable parameters. + * Automatable parameters should always be updated through the \ref AAX_IParameter interface, which + * will ensure proper coordination with other automation clients. + * + * UpdateParameterNormalizedRelative() can be used to incorporate "wraparound" behavior in a parameter's + * controls, if desired. If this behavior is not desired, then this method must properly + * account for overflow of the parameter's normalized value. + * + * \sa \ref SetParameterNormalizedRelative() + * + * \param[in] iParameterID + * The ID of the parameter that is being updated + * \param[in] iValue + * The difference between the parameter's current value and its previous + * value (normalized). The parameter's state must be updated to reflect this + * difference. + */ + virtual AAX_Result UpdateParameterNormalizedRelative ( AAX_CParamID iParameterID, double iValue ) = 0; + /*! + * \brief Generates and dispatches new coefficient packets. + * + * This method is responsible for updating the coefficient packets associated with all + * parameters whose states have changed since the last call to + * \ref AAX_IACFEffectParameters::GenerateCoefficients() "GenerateCoefficients()". The + * host may call this method once for every parameter update, or it may "batch" parameter + * updates such that changes for several parameters are all handled by a single call to + * \ref AAX_IACFEffectParameters::GenerateCoefficients() "GenerateCoefficients()". + * + * For more information on tracking parameters' statuses using the \ref AAX_CPacketDispatcher, + * helper class, see \ref AAX_CPacketDispatcher::SetDirty(). + * + * \note Do \em not call this method from the plug-in. This method should be called by the + * host only. To set parameter values from within the plug-in, use the \ref AAX_IParameter interface. + * + */ + virtual AAX_Result GenerateCoefficients() = 0; + //@}end Asynchronous parameter update methods + + + /** @name State reset handlers + */ + //@{ + /*! + * \brief Called by the host to reset a private data field in the plug-in's algorithm + * + * This method is called sequentially for all private data fields on Effect initialization + * and during any "reset" event, such as priming for a non-real-time render. This method is + * called before the algorithm's optional initialization callback, and the initialized + * private data will be available within that callback via its context block. + * + * \sa \ref alg_initialization. + * + * \warning Any data structures that will be passed between platforms (for example, sent to + * a TI DSP in an %AAX DSP plug-in) must be properly data-aligned for compatibility across + * both platforms. See \ref AAX_ALIGN_FILE_ALG for more information about guaranteeing + * cross-platform compatibility of data structures used for algorithm processing. + * + * \param[in] inFieldIndex + * The index of the field that is being initialized + * \param[out] oData + * The pre-allocated block of data that should be initialized + * \param[in] inDataSize + * The size of the data block, in bytes + * + */ + virtual AAX_Result ResetFieldData (AAX_CFieldIndex inFieldIndex, void * oData, uint32_t inDataSize) const = 0; + //@}end State reset handlers + + + /** @name Chunk methods + * + * These methods are used to save and restore collections of plug-in state information, known + * as chunks. Chunks are used by the host when saving or restoring presets and session + * settings and when providing "compare" functionality for plug-ins. + * + * The default implementation of these methods in \ref AAX_CEffectParameters supports a single + * chunk that includes state information for all of the plug-in's registered parameters. + * Override all of these methods to add support for additional chunks in your plug-in, for + * example if your plug-in contains any persistent state that is not encapsulated by its set + * of registered parameters. + * + * \warning Remember that plug-in chunk data may be loaded on a different platform from the + * one where it is saved. All data structures in the chunk must be properly data-aligned for + * compatibility across all platforms that the plug-in supports. See \ref AAX_ALIGN_FILE_ALG + * for notes about common cross-platform pitfalls for data structure alignment. + * + * For reference, see also: + * \li AAX_CChunkDataParser + * \li AAX_SPlugInChunk + * + */ + //@{ + /*! + * \brief Retrieves the number of chunks used by this plug-in + * + * \param[out] oNumChunks + * The number of distinct chunks used by this plug-in + * + */ + virtual AAX_Result GetNumberOfChunks ( int32_t * oNumChunks ) const = 0; + /*! + * \brief Retrieves the ID associated with a chunk index. + * + * \param[in] iIndex + * Index of the queried chunk + * \param[out] oChunkID + * ID of the queried chunk + * + */ + virtual AAX_Result GetChunkIDFromIndex ( int32_t iIndex, AAX_CTypeID * oChunkID ) const = 0; + /*! + * \brief Get the size of the data structure that can hold all of a chunk's information. + * + * If \a chunkID is one of the plug-in's custom chunks, initialize \a *size to the size + * of the chunk's data in bytes. + * + * This method is invoked every time a chunk is saved, therefore it is possible to have + * dynamically sized chunks. However, note that each call to GetChunkSize() will correspond + * to a following call to GetChunk(). The chunk provided in GetChunk() \e must have the same + * size as the \a size provided by GetChunkSize(). + * + * \legacy In AAX, the value provided by GetChunkSize() should \e NOT include the size of the + * chunk header. The value should \e ONLY reflect the size of the chunk's data. + * + * \param[in] iChunkID + * ID of the queried chunk + * \param[out] oSize + * The chunk's size in bytes + * + */ + virtual AAX_Result GetChunkSize ( AAX_CTypeID iChunkID, uint32_t * oSize ) const = 0; + /*! + * \brief Fills a block of data with chunk information representing the plug-in's current state + * + * By calling this method, the host is requesting information about the current state of + * the plug-in. The following chunk fields should be explicitly populated in this method. + * Other fields will be populated by the host. + * + * \li AAX_SPlugInChunk::fData + * \li AAX_SPlugInChunk::fVersion + * \li AAX_SPlugInChunk::fName (Optional) + * \li AAX_SPlugInChunk::fSize (Data size only) + * + * \warning Remember that this chunk data may be loaded on a different platform from the one + * where it is saved. All data structures in the chunk must be properly data-aligned for + * compatibility across all platforms that the plug-in supports. See \ref AAX_ALIGN_FILE_ALG + * for notes about common cross-platform pitfalls for data structure alignment. + * + * \param[in] iChunkID + * ID of the chunk that should be provided + * \param[out] oChunk + * A preallocated block of memory that should be populated with the chunk's data. + * + */ + virtual AAX_Result GetChunk ( AAX_CTypeID iChunkID, AAX_SPlugInChunk * oChunk ) const = 0; + /*! + * \brief Restores a set of plug-in parameters based on chunk information. + * + * By calling this method, the host is attempting to update the plug-in's current state to + * match the data stored in a chunk. The plug-in should initialize itself to this new + * state by calling \ref SetParameterNormalizedValue() for each of the relevant parameters. + * + * \param[in] iChunkID + * ID of the chunk that is being set + * \param[in] iChunk + * The chunk + * + */ + virtual AAX_Result SetChunk ( AAX_CTypeID iChunkID, const AAX_SPlugInChunk * iChunk ) = 0; + /*! + * \brief Determine if a chunk represents settings that are equivalent to the plug-in's + * current state + * + * \compatibility In Pro Tools, this method will only be called if a prior call to + * \ref AAX_IACFEffectParameters::GetNumberOfChanges() "GetNumberOfChanges()" has + * indicated that the plug-in's state has changed. If the plug-in's current settings + * are different from the settings in \c aChunkP then the plug-in's Compare Light will + * be illuminated in the plug-in header, allowing users to toggle between the + * plug-in's custom state and its saved state. + * + * \param[in] iChunkP + * The chunk that is to be tested + * \param[out] oIsEqual + * True if the chunk represents equivalent settings when compared with the plug-in's + * current state. False if the chunk represents non-equivalent settings + * + */ + virtual AAX_Result CompareActiveChunk ( const AAX_SPlugInChunk * iChunkP, AAX_CBoolean * oIsEqual ) const = 0; + /*! + * \brief Retrieves the number of parameter changes made since the plug-in's creation + * + * This method is polled regularly by the host, and can additionally be triggered by some + * events such as mouse clicks. When the number provided by this method changes, the host + * subsequently calls \ref CompareActiveChunk() to determine if the plug-in's Compare light + * should be activated. + * + * The value provided by this method should increment with each call to + * \ref AAX_IACFEffectParameters::UpdateParameterNormalizedValue() "UpdateParameterNormalizedValue()" + * + * \ingroup CommonInterface_DataModel_Overrides + * + * \param[out] oNumChanges + * Must be set to indicate the number of parameter changes that have occurred since plug-in + * initialization. + */ + virtual AAX_Result GetNumberOfChanges ( int32_t * oNumChanges ) const = 0; + //@}end Chunk methods + + /** @name Thread methods + * + */ + //@{ + /*! + * \brief Periodic wakeup callback for idle-time operations + * + * This method is called from the host using a non-main thread. In general, it should + * be driven at approximately one call per 30 ms. However, the wakeup is not guaranteed to + * be called at any regular interval - for example, it could be held off by a high real-time + * processing load - and there is no host contract regarding maximum latency between wakeup + * calls. + * + * This wakeup thread runs continuously and cannot be armed/disarmed or by the plug-in. + * + */ + virtual AAX_Result TimerWakeup( ) = 0; + //@}end Thread methods + + /** @name Auxiliary UI methods + * + */ + //@{ + /*! \brief Generate a set of output values based on a set of given input values. + * + * This method is used by the host to generate graphical curves. Given a set of input + * values, e.g. frequencies in Hz, this method should generate a corresponding set of output + * values, e.g. dB gain at each frequency. The semantics of these input and output values are + * dictated by \p iCurveType. See \ref AAX_ECurveType. + * + * Plug-ins may also define custom curve type IDs to use this method internally. For example, + * the plug-in's GUI could use this method to request curve data in an arbitrary format. + * + * - \note This method may be called by the host simultaneously from multiple threads with differents \p iValues. + * - \note \p oValues must be allocated by caller with the same size as \p iValues (\p iNumValues). + * + * \compatibility Versions of S6 software which support the + * \ref AAX_IACFEffectParameters_V3::GetCurveDataDisplayRange() "GetCurveDataDisplayRange()" + * method will not display a plug-in's curve data unless both + * \ref AAX_IACFEffectParameters::GetCurveData() "GetCurveData()" and + * \ref AAX_IACFEffectParameters_V3::GetCurveDataDisplayRange() "GetCurveDataDisplayRange()" are + * supported by the plug-in. + * + * \warning S6 currently polls this method to update a plug-in's EQ or dynamics curves + * based on changes to the parameters mapped to the plug-in's EQ or dynamics center section page + * tables. Parameters that are not included in these page tables will not trigger updates to the + * curves displayed on S6. (GWSW-7314, \ref PTSW-195316) + * + * \param[in] iCurveType + * One of \ref AAX_ECurveType + * \param[in] iValues + * An array of input values + * \param[in] iNumValues + * The size of \p iValues + * \param[out] oValues + * An array of ouptut values + * + * \return This method must return \ref AAX_ERROR_UNIMPLEMENTED if the plug-in does not support + * curve data for the requested \c iCurveType + * + * @ingroup AdditionalFeatures_CurveDisplays + * + */ + virtual AAX_Result GetCurveData( /* AAX_ECurveType */ AAX_CTypeID iCurveType, const float * iValues, uint32_t iNumValues, float * oValues ) const = 0; + //@}end Auxiliary UI methods + + /** @name Custom data methods + * + * These functions exist as a proxiable way to move data between different modules (e.g. AAX_IEffectParameters and AAX_IEffectGUI.) + * Using these, the GUI can query any data through GetCustomData() with a plug-in defined \c typeID, \c void* and size. This has an advantage + * over just sharing memory in that this function can work as a remote proxy as we enable those sorts of features later in the platform. + * Likewise, the GUI can also set arbitrary data on the data model by using the SetCustomData() function with the same idea. + * + * \note These are plug-in internal only. They are not called from the host right now, or likely ever. + */ + //@{ + /*! \brief An optional interface hook for getting custom data from another module + * + * \param[in] iDataBlockID + * Identifier for the requested block of custom data + * \param[in] inDataSize + * Size of provided buffer, in bytes + * \param[out] oData + * Pointer to an allocated buffer. Data will be written here. + * \param[out] oDataWritten + * The number of bytes actually written + */ + virtual AAX_Result GetCustomData( AAX_CTypeID iDataBlockID, uint32_t inDataSize, void* oData, uint32_t* oDataWritten) const = 0; + + /*! \brief An optional interface hook for setting custom data for use by another module + * + * \param[in] iDataBlockID + * Identifier for the provided block of custom data + * \param[in] inDataSize + * Size of provided buffer, in bytes + * \param[in] iData + * Pointer to the data buffer + */ + virtual AAX_Result SetCustomData( AAX_CTypeID iDataBlockID, uint32_t inDataSize, const void* iData ) = 0; + //@}end Custom Data methods + + /** @name MIDI methods + * + */ + //@{ + /** \brief MIDI update callback + * + * Call \ref AAX_IController::GetNextMIDIPacket() from within this method to retrieve and + * process MIDI packets directly within the Effect's data model. MIDI data will also be + * delivered to the Effect algorithm. + * + * This method is called regularly by the host, similarly to + * \ref AAX_IEffectParameters::TimerWakeup() + */ + virtual AAX_Result DoMIDITransfers() = 0; + //@}end MIDI methods +}; + +/** @brief Hybrid render processing context + + \sa AAX_IACFEffectParameters_V2::RenderAudio_Hybrid() + + \ingroup additionalFeatures_Hybrid + */ +struct AAX_SHybridRenderInfo +{ + float** mAudioInputs; + int32_t* mNumAudioInputs; + float** mAudioOutputs; + int32_t* mNumAudioOutputs; + int32_t* mNumSamples; + AAX_CTimestamp* mClock; +}; + +/** @brief Supplemental interface for an %AAX Plug-in's data model + + @details + This is a supplemental interface for an instance of a plug-in's data model. This + interface gets exposed to the host application. Host applications that support + %AAX versioned features may call into these methods. See \ref CommonInterface_DataModel. + + \note Your implementation of this interface must inherit from + \ref AAX_IEffectParameters. + + \todo Add documentation for expected error state return values + + \ingroup CommonInterface_DataModel +*/ +class AAX_IACFEffectParameters_V2 : public AAX_IACFEffectParameters +{ +public: + + /** @name Hybrid audio methods + * + */ + //@{ + /** \brief Hybrid audio render function + * + * This method is called from the host to render audio for the hybrid piece of the algorithm. + * + * \note To use this method plug-in should register some hybrid inputs and ouputs in "Describe" + * + * \ingroup additionalFeatures_Hybrid + */ + virtual AAX_Result RenderAudio_Hybrid(AAX_SHybridRenderInfo* ioRenderInfo) = 0; + //@}end Hybrid audio methods + + /** @name MIDI methods + * + */ + //@{ + /** \brief MIDI update callback + * + * This method is called by the host for each pending MIDI packet for MIDI nodes in algorithm + * context structure. Overwrite this method in Plug-In's EffectParameter class if you want to receive MIDI data packets + * directly in the data model. MIDI data will also be delivered to the Effect algorithm. + * + * The host calls this method in Effects that register one or more MIDI nodes using + * \ref AAX_IComponentDescriptor::AddMIDINode(). Effects that do not require MIDI data to be sent to the + * plug-in algorithm should override + * \ref AAX_IACFEffectParameters_V2::UpdateControlMIDINodes() "UpdateControlMIDINodes()". + * + * \param[in] inFieldIndex + * MIDI node field index in algorithm context structure + * \param[in] iPacket + * The incoming MIDI packet for the node + */ + virtual AAX_Result UpdateMIDINodes ( AAX_CFieldIndex inFieldIndex, AAX_CMidiPacket& iPacket ) = 0; + //@{ + /** \brief MIDI update callback for control MIDI nodes + * + * This method is called by the host for each pending MIDI packet for Control MIDI nodes. + * Overwrite this method in Plug-In's EffectParameter class if you want to receive MIDI data packets directly + * in the data model. + * + * The host calls this method in Effects that register one or more Control MIDI nodes using + * \ref AAX_IEffectDescriptor::AddControlMIDINode(). Effects with algorithms that use MIDI data nodes should + * override \ref AAX_IACFEffectParameters_V2::UpdateMIDINodes() "UpdateMIDINodes()". + * + * \note This method will not be called if an Effect includes any MIDI nodes in its algorithm context structure. + * + * \param[in] nodeID + * Identifier for the MIDI node + * \param[in] iPacket + * The incoming MIDI packet for the node + */ + virtual AAX_Result UpdateControlMIDINodes ( AAX_CTypeID nodeID, AAX_CMidiPacket& iPacket ) = 0; + //@}end MIDI methods +}; + +/** @brief Supplemental interface for an %AAX Plug-in's data model + + @details + This is a supplemental interface for an instance of a plug-in's data model. This + interface gets exposed to the host application. Host applications that support + %AAX versioned features may call into these methods. See \ref CommonInterface_DataModel. + + \note Your implementation of this interface must inherit from + \ref AAX_IEffectParameters. + + \todo Add documentation for expected error state return values + + \ingroup CommonInterface_DataModel +*/ +class AAX_IACFEffectParameters_V3 : public AAX_IACFEffectParameters_V2 +{ +public: + + /** @name Auxiliary UI methods + * + */ + //@{ + /*! \brief Indicates which meters correspond to the X and Y axes of the EQ or Dynamics graph. + * + * These meters can be used by attached control surfaces to present an indicator in the same + * X/Y coordinate plane as the plug-in's curve data. + * + * \param[in] iCurveType + * One of \ref AAX_ECurveType + * \param[out] oXMeterId + * Id of the X-axis meter + * \param[out] oYMeterId + * Id of the Y-axis meter + * + * \return This method should return \ref AAX_ERROR_UNIMPLEMENTED if the plug-in does not implement it. + * + * @ingroup AdditionalFeatures_CurveDisplays + * + */ + virtual AAX_Result GetCurveDataMeterIds( /* AAX_ECurveType */ AAX_CTypeID iCurveType, uint32_t *oXMeterId, uint32_t *oYMeterId) const = 0; + + /*! \brief Determines the range of the graph shown by the plug-in + * + * Min/max arguments define the range of the axes of the graph. + * + * \param[in] iCurveType + * One of \ref AAX_ECurveType + * \param[out] oXMin + * Min value of X-axis range + * \param[out] oXMax + * Max value of X-axis range + * \param[out] oYMin + * Min value of Y-axis range + * \param[out] oYMax + * Max value of Y-axis range + * + * \return This method should return \ref AAX_ERROR_UNIMPLEMENTED if the plug-in does not implement it. + * + * @ingroup AdditionalFeatures_CurveDisplays + * + */ + virtual AAX_Result GetCurveDataDisplayRange( /* AAX_ECurveType */ AAX_CTypeID iCurveType, float *oXMin, float *oXMax, float *oYMin, float *oYMax ) const = 0; + //@}end Auxiliary UI methods +}; + +/** @brief Supplemental interface for an %AAX Plug-in's data model + + @details + This is a supplemental interface for an instance of a plug-in's data model. This + interface gets exposed to the host application. Host applications that support + %AAX versioned features may call into these methods. See \ref CommonInterface_DataModel. + + \note Your implementation of this interface must inherit from + \ref AAX_IEffectParameters. + + \todo Add documentation for expected error state return values + + \ingroup CommonInterface_DataModel + */ +class AAX_IACFEffectParameters_V4 : public AAX_IACFEffectParameters_V3 +{ +public: + + /** @name Auxiliary UI methods + * + */ + //@{ + /*! \brief Allow the plug-in to update its page tables + * + * Called by the plug-in host, usually in response to a + * \ref AAX_eNotificationEvent_ParameterMappingChanged notification sent from the + * plug-in. + * + * Use this method to change the page table mapping for the plug-in instance + * or to apply other changes to auxiliary UIs which use the plug-in page tables, + * such as setting focus to a new page. + * + * See \ref AAX_Page_Table_Guide for more information about page tables. + * + * \param[in] inTableType + * Four-char type identifier for the table type (e.g. \c 'PgTL', \c 'Av81', etc.) + * \param[in] inTablePageSize + * Page size for the table + * \param[in] iHostUnknown + * \parblock + * Unknown interface from the host which may support interfaces providing additional + * features or information. + * + * All interfaces queried from this unknown will be valid only within the scope of + * this \ref AAX_IEffectParameters::UpdatePageTable() "UpdatePageTable()" + * execution and will be relevant for only the current plug-in instance. + * \endparblock + * \param[in,out] ioPageTableUnknown + * Unknown interface which supports \ref AAX_IPageTable. This object represents + * the page table data which is currently stored by the host for this plug-in instance + * for the given table type and page size. This data and may be edited within + * the scope of \ref AAX_IEffectParameters::UpdatePageTable() "UpdatePageTable()" + * to change the page table mapping for this plug-in instance. + * + * \return This method should return \ref AAX_ERROR_UNIMPLEMENTED if the plug-in does + * not implement it or when no change is requested by the plug-in. This allows + * optimizations to be used in the host when no UI update is required following this + * call. + * + * \sa \ref AAX_eNotificationEvent_ParameterMappingChanged + * + */ + virtual AAX_Result UpdatePageTable(uint32_t inTableType, int32_t inTablePageSize, IACFUnknown* iHostUnknown, IACFUnknown* ioPageTableUnknown) const = 0; + //@}end Auxiliary UI methods +}; + +#ifdef __clang__ +#pragma clang diagnostic pop +#endif + +#endif // AAX_IACFEFFECTPARAMETERS_H diff --git a/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_IACFFeatureInfo.h b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_IACFFeatureInfo.h new file mode 100644 index 0000000000..3d02879505 --- /dev/null +++ b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_IACFFeatureInfo.h @@ -0,0 +1,80 @@ +/*================================================================================================*/ +/* + * Copyright 2016-2017, 2023-2024 Avid Technology, Inc. + * All rights reserved. + * + * This file is part of the Avid AAX SDK. + * + * The AAX SDK is subject to commercial or open-source licensing. + * + * By using the AAX SDK, you agree to the terms of both the Avid AAX SDK License + * Agreement and Avid Privacy Policy. + * + * AAX SDK License: https://developer.avid.com/aax + * Privacy Policy: https://www.avid.com/legal/privacy-policy-statement + * + * Or: You may also use this code under the terms of the GPL v3 (see + * www.gnu.org/licenses). + * + * THE AAX SDK IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER + * EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE + * DISCLAIMED. + */ + +#ifndef AAXLibrary_AAX_IACFFeatureInfo_h +#define AAXLibrary_AAX_IACFFeatureInfo_h + +#include "AAX.h" + +class AAX_IACFPropertyMap; + +#ifdef __clang__ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wnon-virtual-dtor" +#endif + +#include "acfunknown.h" + +/** Information about host support for a particular feature + + Acquired using \ref AAX_IACFDescriptionHost::AcquireFeatureProperties() + + This interface is shared between multiple features. The specific feature which this object + represents is the feature whose ID was used in the call to acquire this interface. + + See the feature UID documentation for which properties support additional property map data + + IID: \ref IID_IAAXFeatureInfoV1 + + \note Do not \c QueryInterface() for \ref IID_IAAXFeatureInfoV1 since this does not + indicate which specific feature is being requested. Instead, use + \ref AAX_IDescriptionHost::AcquireFeatureProperties() + */ +class AAX_IACFFeatureInfo : public IACFUnknown +{ +public: + // NOTE: Documentation is copied directly from AAX_IFeatureInfo despite an adaptation of parameter types (AAX_ESupportLevel* to AAX_ESupportLevel&) + /** + * \copydoc AAX_IFeatureInfo::SupportLevel() + * + * \sa AAX_IFeatureInfo::SupportLevel() + */ + virtual AAX_Result SupportLevel(AAX_ESupportLevel* oSupportLevel) const = 0; ///< \copydoc AAX_IFeatureInfo::SupportLevel() + + // NOTE: Documentation is not copied directly from AAX_IFeatureInfo due to an adaptation of parameter types (IACFUnknown to AAX_IPropertyMap) + /** + * \copybrief AAX_IFeatureInfo::AcquireProperties() + * + * \p outProperties must support \ref AAX_IACFPropertyMap const methods + * + * \sa AAX_IFeatureInfo::AcquireProperties() + */ + virtual AAX_Result AcquireProperties(IACFUnknown** outProperties) = 0; +}; + +#ifdef __clang__ +#pragma clang diagnostic pop +#endif + + +#endif diff --git a/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_IACFHostProcessor.h b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_IACFHostProcessor.h new file mode 100644 index 0000000000..faa2e9be60 --- /dev/null +++ b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_IACFHostProcessor.h @@ -0,0 +1,99 @@ +/*================================================================================================*/ +/* + * + * Copyright 2013-2017, 2023-2024 Avid Technology, Inc. + * All rights reserved. + * + * This file is part of the Avid AAX SDK. + * + * The AAX SDK is subject to commercial or open-source licensing. + * + * By using the AAX SDK, you agree to the terms of both the Avid AAX SDK License + * Agreement and Avid Privacy Policy. + * + * AAX SDK License: https://developer.avid.com/aax + * Privacy Policy: https://www.avid.com/legal/privacy-policy-statement + * + * Or: You may also use this code under the terms of the GPL v3 (see + * www.gnu.org/licenses). + * + * THE AAX SDK IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER + * EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE + * DISCLAIMED. + * + */ + +/** + * \file AAX_IACFHostProcessor.h + * + * \brief The host processor interface that is exposed to the host application + * + */ +/*================================================================================================*/ + + +#ifndef AAX_IACFHOSTPROCESSOR_H +#define AAX_IACFHOSTPROCESSOR_H + +#include "AAX.h" + +#ifdef __clang__ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wnon-virtual-dtor" +#endif + +#include "acfunknown.h" + +class AAX_IHostProcessorDelegate; +class AAX_IEffectParameters; +class AAX_IString; + +/** + * \brief Versioned interface for an %AAX host processing component + * + * \details + * \note This interface gets exposed to the host application. See + * \ref AAX_CHostProcessor for method documentation. + * + * \legacy This interface provides offline processing features + * analogous to the legacy AudioSuite plug-in architecture + * + * \ingroup AuxInterface_HostProcessor + * + */ +class AAX_IACFHostProcessor : public IACFUnknown +{ +public: + virtual AAX_Result Initialize(IACFUnknown* iController) = 0; ///< \copydoc AAX_CHostProcessor::Initialize() + virtual AAX_Result Uninitialize() = 0; ///< \copydoc AAX_CHostProcessor::Uninitialize() + + virtual AAX_Result InitOutputBounds ( int64_t iSrcStart, int64_t iSrcEnd, int64_t * oDstStart, int64_t * oDstEnd ) = 0; ///< \copydoc AAX_CHostProcessor::InitOutputBounds() + virtual AAX_Result SetLocation ( int64_t iSample ) = 0; ///< \copydoc AAX_CHostProcessor::SetLocation() + + virtual AAX_Result RenderAudio ( const float * const inAudioIns [], int32_t inAudioInCount, float * const iAudioOuts [], int32_t iAudioOutCount, int32_t * ioWindowSize ) = 0; ///< \copydoc AAX_CHostProcessor::RenderAudio() + virtual AAX_Result PreRender ( int32_t inAudioInCount, int32_t iAudioOutCount, int32_t iWindowSize ) = 0; ///< \copydoc AAX_CHostProcessor::PreRender() + virtual AAX_Result PostRender () = 0; ///< \copydoc AAX_CHostProcessor::PostRender() + + virtual AAX_Result AnalyzeAudio ( const float * const inAudioIns [], int32_t inAudioInCount, int32_t * ioWindowSize ) = 0; ///< \copydoc AAX_CHostProcessor::AnalyzeAudio() + virtual AAX_Result PreAnalyze ( int32_t inAudioInCount, int32_t iWindowSize ) = 0; ///< \copydoc AAX_CHostProcessor::PreAnalyze() + virtual AAX_Result PostAnalyze () = 0; ///< \copydoc AAX_CHostProcessor::PostAnalyze() +}; + +/** + * \brief Supplemental interface for an %AAX host processing component + * + * \details + * \note This interface gets exposed to the host application. See + * \ref AAX_CHostProcessor for method documentation. + */ +class AAX_IACFHostProcessor_V2 : public AAX_IACFHostProcessor +{ +public: + virtual AAX_Result GetClipNameSuffix ( int32_t inMaxLength, AAX_IString* outString ) const = 0; ///< \copydoc AAX_CHostProcessor::GetClipNameSuffix() +}; + +#ifdef __clang__ +#pragma clang diagnostic pop +#endif + +#endif //AAX_IACFHOSTPROCESSOR_H diff --git a/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_IACFHostProcessorDelegate.h b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_IACFHostProcessorDelegate.h new file mode 100644 index 0000000000..b445272ec4 --- /dev/null +++ b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_IACFHostProcessorDelegate.h @@ -0,0 +1,76 @@ +/*================================================================================================*/ +/* + * + * Copyright 2013-2017, 2023-2024 Avid Technology, Inc. + * All rights reserved. + * + * This file is part of the Avid AAX SDK. + * + * The AAX SDK is subject to commercial or open-source licensing. + * + * By using the AAX SDK, you agree to the terms of both the Avid AAX SDK License + * Agreement and Avid Privacy Policy. + * + * AAX SDK License: https://developer.avid.com/aax + * Privacy Policy: https://www.avid.com/legal/privacy-policy-statement + * + * Or: You may also use this code under the terms of the GPL v3 (see + * www.gnu.org/licenses). + * + * THE AAX SDK IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER + * EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE + * DISCLAIMED. + * + */ + +/** + * \file AAX_IACFHostProcessorDelegate.h + * + */ +/*================================================================================================*/ + + +#ifndef AAX_IACFHOSTPROCESSORDELEGATE_H +#define AAX_IACFHOSTPROCESSORDELEGATE_H + +#include "AAX.h" + +#ifdef __clang__ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wnon-virtual-dtor" +#endif + +#include "acfunknown.h" + + +/** @brief Versioned interface for host methods specific to offline processing + */ +class AAX_IACFHostProcessorDelegate : public IACFUnknown +{ +public: + virtual AAX_Result GetAudio ( const float * const inAudioIns [], int32_t inAudioInCount, int64_t inLocation, int32_t * ioNumSamples ) = 0; ///< \copydoc AAX_IHostProcessorDelegate::GetAudio() + virtual int32_t GetSideChainInputNum () = 0; ///< \copydoc AAX_IHostProcessorDelegate::GetSideChainInputNum() +}; + + +/** @brief Versioned interface for host methods specific to offline processing + */ +class AAX_IACFHostProcessorDelegate_V2 : public AAX_IACFHostProcessorDelegate +{ +public: + virtual AAX_Result ForceAnalyze () = 0; ///< \copydoc AAX_IHostProcessorDelegate::ForceAnalyze() +}; + +/** @brief Versioned interface for host methods specific to offline processing + */ +class AAX_IACFHostProcessorDelegate_V3 : public AAX_IACFHostProcessorDelegate_V2 +{ +public: + virtual AAX_Result ForceProcess () = 0; ///< \copydoc AAX_IHostProcessorDelegate::ForceProcess() +}; + +#ifdef __clang__ +#pragma clang diagnostic pop +#endif + +#endif // #ifndef AAX_IACFHOSTPROCESSORDELEGATE_H diff --git a/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_IACFHostServices.h b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_IACFHostServices.h new file mode 100644 index 0000000000..c8b0ee2ed0 --- /dev/null +++ b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_IACFHostServices.h @@ -0,0 +1,94 @@ +/*================================================================================================*/ +/* + * + * Copyright 2013-2015, 2018, 2023-2024 Avid Technology, Inc. + * All rights reserved. + * + * This file is part of the Avid AAX SDK. + * + * The AAX SDK is subject to commercial or open-source licensing. + * + * By using the AAX SDK, you agree to the terms of both the Avid AAX SDK License + * Agreement and Avid Privacy Policy. + * + * AAX SDK License: https://developer.avid.com/aax + * Privacy Policy: https://www.avid.com/legal/privacy-policy-statement + * + * Or: You may also use this code under the terms of the GPL v3 (see + * www.gnu.org/licenses). + * + * THE AAX SDK IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER + * EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE + * DISCLAIMED. + * + */ + +/** + * \file AAX_IACFHostServices.h + * + */ +/*================================================================================================*/ + + +#ifndef AAX_IACFHOSTSERVICES_H +#define AAX_IACFHOSTSERVICES_H + +#include "AAX.h" + +#ifdef __clang__ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wnon-virtual-dtor" +#endif + +#include "acfunknown.h" + +/** \brief Versioned interface to diagnostic and debugging services provided by the %AAX host + */ +class AAX_IACFHostServices : public IACFUnknown +{ +public: + /** \deprecated Legacy version of \ref AAX_IACFHostServices_V3::HandleAssertFailure() implemented by older hosts + + \details + Prior to \ref AAX_IACFHostServices_V3::HandleAssertFailure(), the \ref AAX_ASSERT macro, a wrapper around + \ref AAX_IACFHostServices::Assert() "Assert()", was only compiled into debug plug-in builds. + \ref AAX_ASSERT is now compiled in to all plug-in builds and the original debug-only form is + available through \ref AAX_DEBUGASSERT. + + Because the implementation of \ref AAX_IACFHostServices::Assert() "Assert()" in the host is + not aware of the plug-in's build configuation, older hosts implemented this method with a + warning dialog in all cases. Newer hosts - + those which implement \ref AAX_IACFHostServices_V3::HandleAssertFailure() "HandleAssertFailure()" - will log assertion + failures but will not present any user dialog in shipping builds of the host software. + + In order to prevent assertion failure dialogs from appearing to users who run new builds of + plug-ins containing \ref AAX_ASSERT calls in older hosts the deprecated + \ref AAX_IACFHostServices::Assert() "Assert()" method should only be called from debug plug-in + builds. + */ + virtual AAX_Result Assert ( const char * iFile, int32_t iLine, const char * iNote ) = 0; + + virtual AAX_Result Trace ( int32_t iPriority, const char * iMessage ) = 0; ///< \copydoc AAX_IHostServices::Trace() +}; + +/** \brief V2 of versioned interface to diagnostic and debugging services provided by the %AAX host + */ +class AAX_IACFHostServices_V2 : public AAX_IACFHostServices +{ +public: + virtual AAX_Result StackTrace ( int32_t iTracePriority, int32_t iStackTracePriority, const char * iMessage ) = 0; ///< \copydoc AAX_IHostServices::StackTrace() +}; + +/** \brief V3 of versioned interface to diagnostic and debugging services provided by the %AAX host + */ +class AAX_IACFHostServices_V3 : public AAX_IACFHostServices_V2 +{ +public: + virtual AAX_Result HandleAssertFailure ( const char * iFile, int32_t iLine, const char * iNote, /* AAX_EAssertFlags */ int32_t iFlags ) const = 0; ///< \copydoc AAX_IHostServices::HandleAssertFailure() +}; + +#ifdef __clang__ +#pragma clang diagnostic pop +#endif + +#endif // #ifndef AAX_IACFHOSTSERVICES_H diff --git a/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_IACFPageTable.h b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_IACFPageTable.h new file mode 100644 index 0000000000..debcd2209a --- /dev/null +++ b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_IACFPageTable.h @@ -0,0 +1,77 @@ +/*================================================================================================*/ +/* + * Copyright 2016-2017, 2023-2024 Avid Technology, Inc. + * All rights reserved. + * + * This file is part of the Avid AAX SDK. + * + * The AAX SDK is subject to commercial or open-source licensing. + * + * By using the AAX SDK, you agree to the terms of both the Avid AAX SDK License + * Agreement and Avid Privacy Policy. + * + * AAX SDK License: https://developer.avid.com/aax + * Privacy Policy: https://www.avid.com/legal/privacy-policy-statement + * + * Or: You may also use this code under the terms of the GPL v3 (see + * www.gnu.org/licenses). + * + * THE AAX SDK IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER + * EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE + * DISCLAIMED. + */ + +#ifndef AAXLibrary_AAX_IACFPageTable_h +#define AAXLibrary_AAX_IACFPageTable_h + +// AAX Includes +#include "AAX.h" + +#ifdef __clang__ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wnon-virtual-dtor" +#endif + +// ACF Includes +#include "acfunknown.h" + +// Forward declarations +class AAX_IString; + +/** \brief Versioned interface to the host's representation of a plug-in instance's page table + */ +class AAX_IACFPageTable : public IACFUnknown +{ +public: + virtual AAX_Result Clear() = 0; ///< \copydoc AAX_IPageTable::Clear() + virtual AAX_Result Empty(AAX_CBoolean& oEmpty) const = 0; ///< \copydoc AAX_IPageTable::Empty() + virtual AAX_Result GetNumPages(int32_t& oNumPages) const = 0; ///< \copydoc AAX_IPageTable::GetNumPages() + virtual AAX_Result InsertPage(int32_t iPage) = 0; ///< \copydoc AAX_IPageTable::InsertPage() + virtual AAX_Result RemovePage(int32_t iPage) = 0; ///< \copydoc AAX_IPageTable::RemovePage() + virtual AAX_Result GetNumMappedParameterIDs(int32_t iPage, int32_t& oNumParameterIdentifiers) const = 0; ///< \copydoc AAX_IPageTable::GetNumMappedParameterIDs() + virtual AAX_Result ClearMappedParameter(int32_t iPage, int32_t iIndex) = 0; ///< \copydoc AAX_IPageTable::ClearMappedParameter() + virtual AAX_Result GetMappedParameterID(int32_t iPage, int32_t iIndex, AAX_IString& oParameterIdentifier) const = 0; ///< \copydoc AAX_IPageTable::GetMappedParameterID() + virtual AAX_Result MapParameterID(AAX_CParamID iParameterIdentifier, int32_t iPage, int32_t iIndex) = 0; ///< \copydoc AAX_IPageTable::MapParameterID() +}; + +/** \brief Versioned interface to the host's representation of a plug-in instance's page table + */ +class AAX_IACFPageTable_V2 : public AAX_IACFPageTable +{ +public: + virtual AAX_Result GetNumParametersWithNameVariations(int32_t& oNumParameterIdentifiers) const = 0; ///< \copydoc AAX_IPageTable::GetNumParametersWithNameVariations() + virtual AAX_Result GetNameVariationParameterIDAtIndex(int32_t iIndex, AAX_IString& oParameterIdentifier) const = 0; ///< \copydoc AAX_IPageTable::GetNameVariationParameterIDAtIndex() + virtual AAX_Result GetNumNameVariationsForParameter(AAX_CPageTableParamID iParameterIdentifier, int32_t& oNumVariations) const = 0; ///< \copydoc AAX_IPageTable::GetNumNameVariationsForParameter() + virtual AAX_Result GetParameterNameVariationAtIndex(AAX_CPageTableParamID iParameterIdentifier, int32_t iIndex, AAX_IString& oNameVariation, int32_t& oLength) const = 0; ///< \copydoc AAX_IPageTable::GetParameterNameVariationAtIndex() + virtual AAX_Result GetParameterNameVariationOfLength(AAX_CPageTableParamID iParameterIdentifier, int32_t iLength, AAX_IString& oNameVariation) const = 0; ///< \copydoc AAX_IPageTable::GetParameterNameVariationOfLength() + virtual AAX_Result ClearParameterNameVariations() = 0; ///< \copydoc AAX_IPageTable::ClearParameterNameVariations() + virtual AAX_Result ClearNameVariationsForParameter(AAX_CPageTableParamID iParameterIdentifier) = 0; ///< \copydoc AAX_IPageTable::ClearNameVariationsForParameter() + virtual AAX_Result SetParameterNameVariation(AAX_CPageTableParamID iParameterIdentifier, const AAX_IString& iNameVariation, int32_t iLength) = 0; ///< \copydoc AAX_IPageTable::SetParameterNameVariation() +}; + +#ifdef __clang__ +#pragma clang diagnostic pop +#endif + + +#endif // AAXLibrary_AAX_IACFPageTable_h diff --git a/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_IACFPageTableController.h b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_IACFPageTableController.h new file mode 100644 index 0000000000..9a3c5d6fef --- /dev/null +++ b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_IACFPageTableController.h @@ -0,0 +1,210 @@ +/*================================================================================================*/ +/* + * Copyright 2016-2017, 2023-2024 Avid Technology, Inc. + * All rights reserved. + * + * This file is part of the Avid AAX SDK. + * + * The AAX SDK is subject to commercial or open-source licensing. + * + * By using the AAX SDK, you agree to the terms of both the Avid AAX SDK License + * Agreement and Avid Privacy Policy. + * + * AAX SDK License: https://developer.avid.com/aax + * Privacy Policy: https://www.avid.com/legal/privacy-policy-statement + * + * Or: You may also use this code under the terms of the GPL v3 (see + * www.gnu.org/licenses). + * + * THE AAX SDK IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER + * EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE + * DISCLAIMED. + */ + +#ifndef AAXLibrary_AAX_IACFPageTableController_h +#define AAXLibrary_AAX_IACFPageTableController_h + +#include "AAX.h" + +#ifdef __clang__ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wnon-virtual-dtor" +#endif + +#include "acfunknown.h" + + +/** \brief Interface for host operations related to the page tables for this plug-in + + \note In the %AAX Library, access to this interface is provided through \ref AAX_IController + */ +class AAX_IACFPageTableController : public IACFUnknown +{ +public: + // NOTE: Documentation is not copied directly from AAX_IController due to an adaptation of parameter types (IACFUnknown to AAX_IPageTable) + /** + * \copybrief AAX_IController::CreateTableCopyForEffect() + * + * The host will reject the copy and return an error if the requested plug-in type is unkown, if + * \p inTableType is unknown or if \p inTablePageSize is not a supported size for the given table type. + * + * The host may also restrict plug-ins to only copying page table data from certain plug-in types, + * such as plug-ins from the same manufacturer or plug-in types within the same effect. + * + * See \ref AAX_Page_Table_Guide for more information about page tables. + * + * \returns \ref AAX_ERROR_NULL_ARGUMENT if \p oPageTable is null + * + * \returns \ref AAX_ERROR_INVALID_ARGUMENT if no valid page table mapping can be created due to the + * specified arguments + * + * \param[in] inManufacturerID + * \ref AAX_eProperty_ManufacturerID "Manufacturer ID" of the desired plug-in type + * \param[in] inProductID + * \ref AAX_eProperty_ProductID "Product ID" of the desired plug-in type + * \param[in] inPlugInID + * Type ID of the desired plug-in type (\ref AAX_eProperty_PlugInID_Native, \ref AAX_eProperty_PlugInID_TI) + * \param[in] inTableType + * Four-char type identifier for the requested table type (e.g. \c 'PgTL', \c 'Av81', etc.) + * \param[in] inTablePageSize + * Page size for the requested table. Some tables support multiple page sizes. + * \param[out] oPageTable + * The page table object to which the page table data should be copied. \p oPageTable must support \ref AAX_IACFPageTable + * + * \sa AAX_IController::CreateTableCopyForEffect() + * + */ + virtual + AAX_Result + CopyTableForEffect( + AAX_CPropertyValue inManufacturerID, + AAX_CPropertyValue inProductID, + AAX_CPropertyValue inPlugInID, + uint32_t inTableType, + int32_t inTablePageSize, + IACFUnknown* oPageTable) const = 0; + + // NOTE: Documentation is not copied directly from AAX_IController due to an adaptation of parameter types (IACFUnknown to AAX_IPageTable) + /** + * \copybrief AAX_IController::CreateTableCopyForLayout() + * + * The host will reject the copy and return an error if the requested effect ID is unkown or if + * \p inLayoutName is not a valid layout name for the page tables registered for the effect. + * + * The host may also restrict plug-ins to only copying page table data from certain effects, + * such as effects registered within the current AAX plug-in bundle. + * + * See \ref AAX_Page_Table_Guide for more information about page tables. + * + * \returns \ref AAX_ERROR_NULL_ARGUMENT if \p inEffectID, \p inLayoutName, or \p oPageTable is null + * + * \returns \ref AAX_ERROR_INVALID_ARGUMENT if no valid page table mapping can be created due to the + * specified arguments + * + * \param[in] inEffectID + * Effect ID for the desired effect. See \ref AAX_ICollection::AddEffect() + * \param[in] inLayoutName + * Page table layout name ("name" attribute of the \c PTLayout XML tag) + * \param[in] inTableType + * Four-char type identifier for the requested table type (e.g. \c 'PgTL', \c 'Av81', etc.) + * \param[in] inTablePageSize + * Page size for the requested table. Some tables support multiple page sizes. + * \param[out] oPageTable + * The page table object to which the page table data should be copied. \p oPageTable must support \ref AAX_IACFPageTable + * + * \sa AAX_IController::CreateTableCopyForLayout() + */ + virtual + AAX_Result + CopyTableOfLayoutForEffect( + const char * inEffectID, + const char * inLayoutName, + uint32_t inTableType, + int32_t inTablePageSize, + IACFUnknown* oPageTable) const = 0; +}; + +/** @copydoc AAX_IACFPageTableController +*/ +class AAX_IACFPageTableController_V2 : public AAX_IACFPageTableController +{ +public: + /** \copybrief AAX_IACFPageTableController::CopyTableForEffect() + * + * \returns \ref AAX_ERROR_NULL_ARGUMENT if \p inPageTableFilePath or \p oPageTable is null + * + * \returns \ref AAX_ERROR_UNSUPPORTED_ENCODING if \p inFilePathEncoding has unsupported encoding value + * + * \returns \ref AAX_ERROR_INVALID_ARGUMENT if no valid page table mapping can be created due to the + * specified arguments + * + * \param[in] inPageTableFilePath + * Path to XML page table file. + * \param[in] inFilePathEncoding + * File path text encoding. + * \param[in] inManufacturerID + * \ref AAX_eProperty_ManufacturerID "Manufacturer ID" of the desired plug-in type + * \param[in] inProductID + * \ref AAX_eProperty_ProductID "Product ID" of the desired plug-in type + * \param[in] inPlugInID + * Type ID of the desired plug-in type (\ref AAX_eProperty_PlugInID_Native, \ref AAX_eProperty_PlugInID_TI) + * \param[in] inTableType + * Four-char type identifier for the requested table type (e.g. \c 'PgTL', \c 'Av81', etc.) + * \param[in] inTablePageSize + * Page size for the requested table. Some tables support multiple page sizes. + * \param[out] oPageTable + * The page table object to which the page table data should be copied. \p oPageTable must support \ref AAX_IACFPageTable + * + * \sa AAX_IController::CreateTableCopyForEffect() + */ + virtual + AAX_Result + CopyTableForEffectFromFile( + const char* inPageTableFilePath, + AAX_ETextEncoding inFilePathEncoding, + AAX_CPropertyValue inManufacturerID, + AAX_CPropertyValue inProductID, + AAX_CPropertyValue inPlugInID, + uint32_t inTableType, + int32_t inTablePageSize, + IACFUnknown* oPageTable) const = 0; + + /** \copybrief AAX_IACFPageTableController::CopyTableOfLayoutForEffect() + * + * \returns \ref AAX_ERROR_NULL_ARGUMENT if \p inPageTableFilePath, \p inLayoutName, or \p oPageTable is null + * + * \returns \ref AAX_ERROR_UNSUPPORTED_ENCODING if \p inFilePathEncoding has unsupported encoding value + * + * \returns \ref AAX_ERROR_INVALID_ARGUMENT if no valid page table mapping can be created due to the specified arguments + * + * \param[in] inPageTableFilePath + * Path to XML page table file. + * \param[in] inFilePathEncoding + * File path text encoding. + * \param[in] inLayoutName + * Page table layout name ("name" attribute of the \c PTLayout XML tag) + * \param[in] inTableType + * Four-char type identifier for the requested table type (e.g. \c 'PgTL', \c 'Av81', etc.) + * \param[in] inTablePageSize + * Page size for the requested table. Some tables support multiple page sizes. + * \param[out] oPageTable + * The page table object to which the page table data should be copied. \p oPageTable must support \ref AAX_IACFPageTable + * + * \sa AAX_IController::CreateTableCopyForLayout() + */ + virtual + AAX_Result + CopyTableOfLayoutFromFile( + const char* inPageTableFilePath, + AAX_ETextEncoding inFilePathEncoding, + const char* inLayoutName, + uint32_t inTableType, + int32_t inTablePageSize, + IACFUnknown* oPageTable) const = 0; +}; + +#ifdef __clang__ +#pragma clang diagnostic pop +#endif + +#endif diff --git a/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_IACFPrivateDataAccess.h b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_IACFPrivateDataAccess.h new file mode 100644 index 0000000000..08eab1af03 --- /dev/null +++ b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_IACFPrivateDataAccess.h @@ -0,0 +1,65 @@ +/*================================================================================================*/ +/* + * + * Copyright 2013-2017, 2023-2024 Avid Technology, Inc. + * All rights reserved. + * + * This file is part of the Avid AAX SDK. + * + * The AAX SDK is subject to commercial or open-source licensing. + * + * By using the AAX SDK, you agree to the terms of both the Avid AAX SDK License + * Agreement and Avid Privacy Policy. + * + * AAX SDK License: https://developer.avid.com/aax + * Privacy Policy: https://www.avid.com/legal/privacy-policy-statement + * + * Or: You may also use this code under the terms of the GPL v3 (see + * www.gnu.org/licenses). + * + * THE AAX SDK IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER + * EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE + * DISCLAIMED. + * + */ + +/** + * \file AAX_IACFPrivateDataAccess.h + * + * \brief Interface for the %AAX host's data access functionality. + * + */ +/*================================================================================================*/ + + +#ifndef _AAX_IACFPrivateDATAACCESS_H_ +#define _AAX_IACFPrivateDATAACCESS_H_ + +#include "AAX.h" + +#ifdef __clang__ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wnon-virtual-dtor" +#endif + +#include "acfunknown.h" + +/** \brief Interface for the %AAX host's data access functionality. + + \details + \ingroup AuxInterface_DirectData + */ +class AAX_IACFPrivateDataAccess : public IACFUnknown +{ +public: + + virtual AAX_Result ReadPortDirect( AAX_CFieldIndex inFieldIndex, const uint32_t inOffset, const uint32_t inSize, void* outBuffer ) = 0; ///< \copydoc AAX_IPrivateDataAccess::ReadPortDirect() + virtual AAX_Result WritePortDirect( AAX_CFieldIndex inFieldIndex, const uint32_t inOffset, const uint32_t inSize, const void* inBuffer ) = 0; ///< \copydoc AAX_IPrivateDataAccess::WritePortDirect() + +}; + +#ifdef __clang__ +#pragma clang diagnostic pop +#endif + +#endif // #ifndef _AAX_IACFPrivateDATAACCESS_H_ diff --git a/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_IACFPropertyMap.h b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_IACFPropertyMap.h new file mode 100644 index 0000000000..23f46c43d1 --- /dev/null +++ b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_IACFPropertyMap.h @@ -0,0 +1,79 @@ +/*================================================================================================*/ +/* + * + * Copyright 2013-2017, 2023-2024 Avid Technology, Inc. + * All rights reserved. + * + * This file is part of the Avid AAX SDK. + * + * The AAX SDK is subject to commercial or open-source licensing. + * + * By using the AAX SDK, you agree to the terms of both the Avid AAX SDK License + * Agreement and Avid Privacy Policy. + * + * AAX SDK License: https://developer.avid.com/aax + * Privacy Policy: https://www.avid.com/legal/privacy-policy-statement + * + * Or: You may also use this code under the terms of the GPL v3 (see + * www.gnu.org/licenses). + * + * THE AAX SDK IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER + * EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE + * DISCLAIMED. + * + */ + +/** + * \file AAX_IACFPropertyMap.h + * + * \brief Versioned interface for an AAX_IPropertyMap + * + */ +/*================================================================================================*/ + + +#ifndef AAX_IACFPROPERTYMAP_H +#define AAX_IACFPROPERTYMAP_H + +#include "AAX.h" + +#ifdef __clang__ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wnon-virtual-dtor" +#endif + +#include "acfunknown.h" + +/** \brief Versioned interface for an \ref AAX_IPropertyMap + */ +class AAX_IACFPropertyMap : public IACFUnknown +{ +public: + virtual AAX_CBoolean GetProperty ( AAX_EProperty inProperty, AAX_CPropertyValue * outValue ) const = 0; ///< \copydoc AAX_IPropertyMap::GetProperty() + virtual AAX_Result AddProperty ( AAX_EProperty inProperty, AAX_CPropertyValue inValue ) = 0; ///< \copydoc AAX_IPropertyMap::AddProperty() + virtual AAX_Result RemoveProperty ( AAX_EProperty inProperty ) = 0; ///< \copydoc AAX_IPropertyMap::RemoveProperty() +}; + +/** \brief Versioned interface for an \ref AAX_IPropertyMap + */ +class AAX_IACFPropertyMap_V2 : public AAX_IACFPropertyMap +{ +public: + virtual AAX_Result AddPropertyWithIDArray ( AAX_EProperty inProperty, const AAX_SPlugInIdentifierTriad* inPluginIDs, uint32_t inNumPluginIDs) = 0; ///< \copydoc AAX_IPropertyMap::AddPropertyWithIDArray() + virtual AAX_CBoolean GetPropertyWithIDArray ( AAX_EProperty inProperty, const AAX_SPlugInIdentifierTriad** outPluginIDs, uint32_t* outNumPluginIDs) const = 0; ///< \copydoc AAX_IPropertyMap::GetPropertyWithIDArray() +}; + +/** \brief Versioned interface for an \ref AAX_IPropertyMap + */ +class AAX_IACFPropertyMap_V3 : public AAX_IACFPropertyMap_V2 +{ +public: + virtual AAX_CBoolean GetProperty64 ( AAX_EProperty inProperty, AAX_CPropertyValue64 * outValue ) const = 0; ///< \copydoc AAX_IPropertyMap::GetProperty() + virtual AAX_Result AddProperty64 ( AAX_EProperty inProperty, AAX_CPropertyValue64 inValue ) = 0; ///< \copydoc AAX_IPropertyMap::AddProperty() +}; + +#ifdef __clang__ +#pragma clang diagnostic pop +#endif + +#endif // AAX_IACFPROPERTYMAP_H diff --git a/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_IACFSessionDocument.h b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_IACFSessionDocument.h new file mode 100644 index 0000000000..8d0462896c --- /dev/null +++ b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_IACFSessionDocument.h @@ -0,0 +1,65 @@ +/*================================================================================================*/ +/* + * + * Copyright 2023-2024 Avid Technology, Inc. + * All rights reserved. + * + * This file is part of the Avid AAX SDK. + * + * The AAX SDK is subject to commercial or open-source licensing. + * + * By using the AAX SDK, you agree to the terms of both the Avid AAX SDK License + * Agreement and Avid Privacy Policy. + * + * AAX SDK License: https://developer.avid.com/aax + * Privacy Policy: https://www.avid.com/legal/privacy-policy-statement + * + * Or: You may also use this code under the terms of the GPL v3 (see + * www.gnu.org/licenses). + * + * THE AAX SDK IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER + * EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE + * DISCLAIMED. + * + */ + +/** + * \file AAX_IACFSessionDocument.h + */ +/*================================================================================================*/ + +#pragma once +#ifndef AAX_IACFSessionDocument_H +#define AAX_IACFSessionDocument_H + +#ifdef __clang__ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wnon-virtual-dtor" +#endif + +#include "AAX_UIDs.h" +#include "AAX.h" +#include "acfunknown.h" + +/** + * \brief Interface representing information in a host session document + * + * Plug-in implementations should use \ref AAX_ISessionDocument , which + * provides specific convenience methods for supported data types. + */ +class AAX_IACFSessionDocument : public IACFUnknown +{ +public: + /** + * \brief Get data from the document + * + * \copydetails AAX_ISessionDocument::GetDocumentData + */ + virtual AAX_Result GetDocumentData(AAX_DocumentData_UID const & inDataType, IACFUnknown ** outData) = 0; +}; + +#ifdef __clang__ +#pragma clang diagnostic pop +#endif + +#endif // AAX_IACFSessionDocument_H diff --git a/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_IACFSessionDocumentClient.h b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_IACFSessionDocumentClient.h new file mode 100644 index 0000000000..d6aefe3f60 --- /dev/null +++ b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_IACFSessionDocumentClient.h @@ -0,0 +1,109 @@ +/*================================================================================================*/ +/* + * + * Copyright 2023-2024 Avid Technology, Inc. + * All rights reserved. + * + * This file is part of the Avid AAX SDK. + * + * The AAX SDK is subject to commercial or open-source licensing. + * + * By using the AAX SDK, you agree to the terms of both the Avid AAX SDK License + * Agreement and Avid Privacy Policy. + * + * AAX SDK License: https://developer.avid.com/aax + * Privacy Policy: https://www.avid.com/legal/privacy-policy-statement + * + * Or: You may also use this code under the terms of the GPL v3 (see + * www.gnu.org/licenses). + * + * THE AAX SDK IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER + * EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE + * DISCLAIMED. + * + */ + +/** + * \file AAX_IACFSessionDocumentClient.h + */ +/*================================================================================================*/ + +#pragma once +#ifndef AAX_IACFSessionDocumentClient_H +#define AAX_IACFSessionDocumentClient_H + +#ifdef __clang__ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wnon-virtual-dtor" +#endif + +#include "AAX_UIDs.h" +#include "AAX.h" +#include "acfunknown.h" + +/** + * \brief Interface representing a client of the session document interface + * + * For example, a plug-in implementation that makes calls on the session + * document interface provided by the host. + */ +class AAX_IACFSessionDocumentClient : public IACFUnknown +{ +public: + /** @name Initialization and uninitialization + */ + //@{ + virtual AAX_Result Initialize (IACFUnknown * iUnknown) = 0; + virtual AAX_Result Uninitialize (void) = 0; + //@}end Initialization and uninitialization + + /** @name Session document access + */ + //@{ + /** + * \brief Sets or removes a session document + * + * \param[in] iSessionDocument + * Interface supporting at least \ref AAX_IACFSessionDocument, or + * \c nullptr to indicate that any session document that is currently + * held should be released. + */ + virtual AAX_Result SetSessionDocument(IACFUnknown * iSessionDocument) = 0; + //@}end Session document access + + /** @name %AAX host and plug-in event notification + */ + //@{ + /*! + * \brief Notification Hook + * + * Called from the host to deliver notifications to this object. + * + * Look at the \ref AAX_ENotificationEvent enumeration to see a description of events you can listen for and the + * data they come with. + * + * - \note Different notifications are sent to different objects within a plug-in. If you are not seeing an expected + * notification, try checking the other plug-in objects' \c NotificationReceived() methods. + * - \note the host may dispatch notifications synchronously or asynchronously, and calls to this method may + * occur concurrently on multiple threads. + * + * A plug-in may also dispatch custom notifications using \ref AAX_IController::SendNotification(). Custom + * notifications will be posted back to the plug-in's other objects which support a \c NotificationReceived() + * method (e.g. the data model). + * + * \param[in] inNotificationType + * Type of notification being received. Notifications form the host are one of \ref AAX_ENotificationEvent + * \param[in] inNotificationData + * Block of incoming notification data + * \param[in] inNotificationDataSize + * Size of \p inNotificationData, in bytes + */ + virtual AAX_Result NotificationReceived(/* AAX_ENotificationEvent */ AAX_CTypeID inNotificationType, const void * inNotificationData, uint32_t inNotificationDataSize) = 0; + //@}end %AAX host and plug-in event notification +}; + +#ifdef __clang__ +#pragma clang diagnostic pop +#endif + +#endif // AAX_IACFSessionDocumentClient_H diff --git a/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_IACFTask.h b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_IACFTask.h new file mode 100644 index 0000000000..4f649786fd --- /dev/null +++ b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_IACFTask.h @@ -0,0 +1,98 @@ +/*================================================================================================*/ +/* + * + * Copyright 2023-2024 Avid Technology, Inc. + * All rights reserved. + * + * This file is part of the Avid AAX SDK. + * + * The AAX SDK is subject to commercial or open-source licensing. + * + * By using the AAX SDK, you agree to the terms of both the Avid AAX SDK License + * Agreement and Avid Privacy Policy. + * + * AAX SDK License: https://developer.avid.com/aax + * Privacy Policy: https://www.avid.com/legal/privacy-policy-statement + * + * Or: You may also use this code under the terms of the GPL v3 (see + * www.gnu.org/licenses). + * + * THE AAX SDK IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER + * EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE + * DISCLAIMED. + * + */ + +/** + * \file AAX_IACFTask.h + * + * \brief Defines the interface representing an asynchronous task + * + */ +/*================================================================================================*/ + +#pragma once + +#ifndef AAX_IACFTask_H +#define AAX_IACFTask_H + +#include "AAX.h" + +#ifdef __clang__ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wnon-virtual-dtor" +#endif + +#include "acfunknown.h" + +class AAX_IACFDataBuffer; + +/** + * Completion status for use with \ref AAX_ITask::SetDone() + * + * \ingroup AuxInterface_TaskAgent + */ +enum class AAX_TaskCompletionStatus : int32_t { + None = 0 + ,Done = 1 + ,Canceled = 2 + ,Error = 3 +}; + +/** + * \brief Versioned interface for an asynchronous task + * + * \copydetails AAX_ITask + * + * \ingroup AuxInterface_TaskAgent + */ +class AAX_IACFTask : public IACFUnknown +{ +public: + virtual AAX_Result GetType(AAX_CTypeID * oType) const = 0; ///< \copydoc AAX_ITask::GetType() + virtual AAX_IACFDataBuffer const * GetArgumentOfType(AAX_CTypeID iType) const = 0; ///< \copydoc AAX_ITask::GetArgumentOfType() + + virtual AAX_Result SetProgress(float iProgress) = 0; ///< \copydoc AAX_ITask::SetProgress() + virtual float GetProgress() const = 0; ///< \copydoc AAX_ITask::GetProgress() + + virtual AAX_Result AddResult(AAX_IACFDataBuffer const * iResult) = 0; ///< \copydoc AAX_ITask::AddResult() + + /** + * \brief Inform the host that the task is completed. + * + * \details + * If \ref AAX_SUCCESS is returned, the object should be + * considered invalid and released by the caller. + * + * \param[in] iStatus + * The final status of the task. This indicates to the host + * whether or not the task was performed as requested. + */ + virtual AAX_Result SetDone(AAX_TaskCompletionStatus iStatus) = 0; +}; + +#ifdef __clang__ +#pragma clang diagnostic pop +#endif + +#endif //AAX_IACFTask_H diff --git a/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_IACFTaskAgent.h b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_IACFTaskAgent.h new file mode 100644 index 0000000000..3bd36c8c66 --- /dev/null +++ b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_IACFTaskAgent.h @@ -0,0 +1,108 @@ +/*================================================================================================*/ +/* + * + * Copyright 2023-2024 Avid Technology, Inc. + * All rights reserved. + * + * This file is part of the Avid AAX SDK. + * + * The AAX SDK is subject to commercial or open-source licensing. + * + * By using the AAX SDK, you agree to the terms of both the Avid AAX SDK License + * Agreement and Avid Privacy Policy. + * + * AAX SDK License: https://developer.avid.com/aax + * Privacy Policy: https://www.avid.com/legal/privacy-policy-statement + * + * Or: You may also use this code under the terms of the GPL v3 (see + * www.gnu.org/licenses). + * + * THE AAX SDK IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER + * EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE + * DISCLAIMED. + * + */ + +/** + * \file AAX_IACFTaskAgent.h + */ +/*================================================================================================*/ + +#pragma once + +#ifndef AAX_IACFTaskAgent_H +#define AAX_IACFTaskAgent_H + +#include "AAX.h" + +#ifdef __clang__ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wnon-virtual-dtor" +#endif + +#include "acfunknown.h" + +class IACFUnknown; + + +/** + * \brief Versioned interface for a component that accepts task requests + * + * \details + * \pluginimp + * + * The task agent is expected to complete the requested tasks asynchronously + * and to provide progress and completion details via calls on the + * \ref AAX_IACFTask interface as the tasks proceed. + * + * \sa AAX_ITask + * + * \ingroup AuxInterface_TaskAgent + */ +class AAX_IACFTaskAgent : public IACFUnknown +{ +public: + /** @name Initialization and uninitialization + */ + //@{ + /** + * Initialize the object + * + * \param[in] iController + * Interface allowing access to other objects in the object graph + * such as the plug-in's data model. + */ + virtual AAX_Result Initialize(IACFUnknown* iController) = 0; + /** + * Uninitialize the object + * + * This method should release references to any shared objects + */ + virtual AAX_Result Uninitialize() = 0; + //@} Initialization and uninitialization + + /** @name Task management + */ + //@{ + /** + * Request that the agent perform a task + * + * \param[in] iTask + * The task to perform. The agent must retain a reference to + * this task if it will be used beyond the scope of this method. + * This object should support at least \ref AAX_IACFTask . + */ + virtual AAX_Result AddTask(IACFUnknown * iTask) = 0; + /** + * Request that the agent cancel all outstanding tasks + */ + virtual AAX_Result CancelAllTasks() = 0; + //@} Task management +}; + + +#ifdef __clang__ +#pragma clang diagnostic pop +#endif + +#endif diff --git a/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_IACFTransport.h b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_IACFTransport.h new file mode 100644 index 0000000000..9e7b05e991 --- /dev/null +++ b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_IACFTransport.h @@ -0,0 +1,111 @@ +/*================================================================================================*/ +/* + * + * Copyright 2013-2015, 2019-2021, 2023-2024 Avid Technology, Inc. + * All rights reserved. + * + * This file is part of the Avid AAX SDK. + * + * The AAX SDK is subject to commercial or open-source licensing. + * + * By using the AAX SDK, you agree to the terms of both the Avid AAX SDK License + * Agreement and Avid Privacy Policy. + * + * AAX SDK License: https://developer.avid.com/aax + * Privacy Policy: https://www.avid.com/legal/privacy-policy-statement + * + * Or: You may also use this code under the terms of the GPL v3 (see + * www.gnu.org/licenses). + * + * THE AAX SDK IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER + * EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE + * DISCLAIMED. + * + */ + +/** + * \file AAX_IACFTransport.h + * + * \brief Interface for accessing the host's transport state + */ +/*================================================================================================*/ + +#ifndef AAX_IACFTRANSPORT_H +#define AAX_IACFTRANSPORT_H + +#pragma once + +#include "AAX.h" +#include "AAX_Enums.h" + +#ifdef __clang__ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wnon-virtual-dtor" +#endif + +#include "acfunknown.h" + +/** \brief Versioned interface to get information about the host's transport state + */ +class AAX_IACFTransport : public IACFUnknown +{ +public: + + virtual AAX_Result GetCurrentTempo ( double* TempoBPM ) const = 0; ///< \copydoc AAX_ITransport::GetCurrentTempo() + virtual AAX_Result GetCurrentMeter ( int32_t* MeterNumerator, int32_t* MeterDenominator ) const = 0; ///< \copydoc AAX_ITransport::GetCurrentMeter() + virtual AAX_Result IsTransportPlaying ( bool* isPlaying ) const = 0; ///< \copydoc AAX_ITransport::IsTransportPlaying() + virtual AAX_Result GetCurrentTickPosition ( int64_t* TickPosition ) const = 0; ///< \copydoc AAX_ITransport::GetCurrentTickPosition() + virtual AAX_Result GetCurrentLoopPosition ( bool* bLooping, int64_t* LoopStartTick, int64_t* LoopEndTick ) const = 0; ///< \copydoc AAX_ITransport::GetCurrentLoopPosition() + virtual AAX_Result GetCurrentNativeSampleLocation ( int64_t* SampleLocation ) const = 0; ///< \copydoc AAX_ITransport::GetCurrentNativeSampleLocation() + virtual AAX_Result GetCustomTickPosition ( int64_t* oTickPosition, int64_t iSampleLocation ) const = 0; ///< \copydoc AAX_ITransport::GetCustomTickPosition() + virtual AAX_Result GetBarBeatPosition ( int32_t* Bars, int32_t* Beats, int64_t* DisplayTicks, int64_t SampleLocation ) const = 0; ///< \copydoc AAX_ITransport::GetBarBeatPosition() + virtual AAX_Result GetTicksPerQuarter ( uint32_t* ticks ) const = 0; ///< \copydoc AAX_ITransport::GetTicksPerQuarter() + virtual AAX_Result GetCurrentTicksPerBeat ( uint32_t* ticks ) const = 0; ///< \copydoc AAX_ITransport::GetCurrentTicksPerBeat() + +}; + +/** \brief Versioned interface to get information about the host's transport state + */ +class AAX_IACFTransport_V2 : public AAX_IACFTransport +{ +public: + + virtual AAX_Result GetTimelineSelectionStartPosition( int64_t* oSampleLocation ) const = 0; ///< \copydoc AAX_ITransport::GetTimelineSelectionStartPosition() + virtual AAX_Result GetTimeCodeInfo( AAX_EFrameRate* oFrameRate, int32_t* oOffset ) const = 0; ///< \copydoc AAX_ITransport::GetTimeCodeInfo() + virtual AAX_Result GetFeetFramesInfo( AAX_EFeetFramesRate* oFeetFramesRate, int64_t* oOffset ) const = 0; ///< \copydoc AAX_ITransport::GetFeetFramesInfo() + virtual AAX_Result IsMetronomeEnabled ( int32_t* isEnabled ) const = 0; ///< \copydoc AAX_ITransport::IsMetronomeEnabled() +}; + +/** \brief Versioned interface to get information about the host's transport state + */ +class AAX_IACFTransport_V3 : public AAX_IACFTransport_V2 +{ +public: + + virtual AAX_Result GetHDTimeCodeInfo( AAX_EFrameRate* oHDFrameRate, int64_t* oHDOffset ) const = 0; ///< \copydoc AAX_ITransport::GetHDTimeCodeInfo() +}; + +/** \brief Versioned interface to get information about the host's transport state + */ +class AAX_IACFTransport_V4 : public AAX_IACFTransport_V3 +{ +public: + + virtual AAX_Result GetTimelineSelectionEndPosition( int64_t* oSampleLocation ) const = 0; ///< \copydoc AAX_ITransport::GetTimelineSelectionEndPosition() +}; + +/** \brief Versioned interface to get information about the host's transport state + */ +class AAX_IACFTransport_V5 : public AAX_IACFTransport_V4 +{ +public: + + virtual AAX_Result GetKeySignature( int64_t iSampleLocation, uint32_t* oKeySignature ) const = 0; ///< \copydoc AAX_ITransport::GetKeySignature() +}; + +#ifdef __clang__ +#pragma clang diagnostic pop +#endif + +#endif // AAX_IACFTRANSPORT_H + diff --git a/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_IACFTransportControl.h b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_IACFTransportControl.h new file mode 100644 index 0000000000..71ddf4631b --- /dev/null +++ b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_IACFTransportControl.h @@ -0,0 +1,64 @@ +/*================================================================================================*/ +/* + * + * Copyright 2023-2024 Avid Technology, Inc. + * All rights reserved. + * + * This file is part of the Avid AAX SDK. + * + * The AAX SDK is subject to commercial or open-source licensing. + * + * By using the AAX SDK, you agree to the terms of both the Avid AAX SDK License + * Agreement and Avid Privacy Policy. + * + * AAX SDK License: https://developer.avid.com/aax + * Privacy Policy: https://www.avid.com/legal/privacy-policy-statement + * + * Or: You may also use this code under the terms of the GPL v3 (see + * www.gnu.org/licenses). + * + * THE AAX SDK IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER + * EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE + * DISCLAIMED. + * + */ + +/** + * \file AAX_IACFTransportControl.h + * + * \brief Interface for control over the host's transport state + */ +/*================================================================================================*/ + +#ifndef AAX_IACFTRANSPORTCONTROL_H +#define AAX_IACFTRANSPORTCONTROL_H + +#pragma once + +#include "AAX.h" +#include "AAX_Enums.h" + +#ifdef __clang__ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wnon-virtual-dtor" +#endif + +#include "acfunknown.h" + +/** \brief Versioned interface to control the host's transport state + */ +class AAX_IACFTransportControl : public IACFUnknown +{ +public: + + virtual AAX_Result RequestTransportStart() = 0; ///< \copydoc AAX_ITransport::RequestTransportStart() + virtual AAX_Result RequestTransportStop() = 0; ///< \copydoc AAX_ITransport::RequestTransportStop() + +}; + +#ifdef __clang__ +#pragma clang diagnostic pop +#endif + +#endif // AAX_IACFTRANSPORTCONTROL_H + diff --git a/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_IACFViewContainer.h b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_IACFViewContainer.h new file mode 100644 index 0000000000..b530ff8529 --- /dev/null +++ b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_IACFViewContainer.h @@ -0,0 +1,122 @@ +/*================================================================================================*/ +/* + * + * Copyright 2013-2017, 2019, 2021, 2023-2024 Avid Technology, Inc. + * All rights reserved. + * + * This file is part of the Avid AAX SDK. + * + * The AAX SDK is subject to commercial or open-source licensing. + * + * By using the AAX SDK, you agree to the terms of both the Avid AAX SDK License + * Agreement and Avid Privacy Policy. + * + * AAX SDK License: https://developer.avid.com/aax + * Privacy Policy: https://www.avid.com/legal/privacy-policy-statement + * + * Or: You may also use this code under the terms of the GPL v3 (see + * www.gnu.org/licenses). + * + * THE AAX SDK IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER + * EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE + * DISCLAIMED. + * + */ + +/** + * \file AAX_IACFViewContainer.h + * + * \brief Interface for the %AAX host's view of a single instance of an + * effect. Used by both clients of the AAXHost and by effect components. + * + */ +/*================================================================================================*/ + + +#ifndef _AAX_IACFVIEWCONTAINER_H_ +#define _AAX_IACFVIEWCONTAINER_H_ + +#include "AAX_GUITypes.h" +#include "AAX.h" + +#ifdef __clang__ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wnon-virtual-dtor" +#endif + +#include "acfunknown.h" + +/** \brief Interface for the %AAX host's view of a single instance of an + * effect. Used by both clients of the host app and by effect components. + * + * \details + * \sa \ref AAX_IViewContainer + */ +class AAX_IACFViewContainer : public IACFUnknown +{ +public: + /** @name View and GUI state queries + */ + //@{ + virtual int32_t GetType () = 0; ///< \copydoc AAX_IViewContainer::GetType() + virtual void * GetPtr () = 0; ///< \copydoc AAX_IViewContainer::GetPtr() + virtual AAX_Result GetModifiers ( uint32_t * outModifiers ) = 0; ///< \copydoc AAX_IViewContainer::GetModifiers() + //@}end View and GUI state queries + + /** @name View change requests + */ + //@{ + virtual AAX_Result SetViewSize ( AAX_Point & inSize ) = 0; ///< \copydoc AAX_IViewContainer::SetViewSize() + //@}end View change requests + + /** @name Host event handlers + */ + //@{ + virtual AAX_Result HandleParameterMouseDown ( AAX_CParamID inParamID, uint32_t inModifiers ) = 0; ///< \copydoc AAX_IViewContainer::HandleParameterMouseDown() + virtual AAX_Result HandleParameterMouseDrag ( AAX_CParamID inParamID, uint32_t inModifiers ) = 0; ///< \copydoc AAX_IViewContainer::HandleParameterMouseDrag() + virtual AAX_Result HandleParameterMouseUp ( AAX_CParamID inParamID, uint32_t inModifiers ) = 0; ///< \copydoc AAX_IViewContainer::HandleParameterMouseUp() + //@}end Host event handlers +}; + + +/** \brief Supplemental interface for the %AAX host's view of a single instance of an + * effect. Used by both clients of the host app and by effect components. + * + * \details + * \sa \ref AAX_IViewContainer + */ +class AAX_IACFViewContainer_V2 : public AAX_IACFViewContainer +{ +public: + /** @name Host event handlers + */ + //@{ + virtual AAX_Result HandleMultipleParametersMouseDown ( const AAX_CParamID* inParamIDs, uint32_t inNumOfParams, uint32_t inModifiers ) = 0; ///< \copydoc AAX_IViewContainer::HandleMultipleParametersMouseDown() + virtual AAX_Result HandleMultipleParametersMouseDrag ( const AAX_CParamID* inParamIDs, uint32_t inNumOfParams, uint32_t inModifiers ) = 0; ///< \copydoc AAX_IViewContainer::HandleMultipleParametersMouseDrag() + virtual AAX_Result HandleMultipleParametersMouseUp ( const AAX_CParamID* inParamIDs, uint32_t inNumOfParams, uint32_t inModifiers ) = 0; ///< \copydoc AAX_IViewContainer::HandleMultipleParametersMouseUp() + //@}end Host event handlers +}; + + +/** \brief Additional methods to track mouse as it moves over controls + * + * \details + * \sa \ref AAX_IViewContainer + */ +class AAX_IACFViewContainer_V3 : public AAX_IACFViewContainer_V2 +{ +public: + /** @name Host event handlers + */ + //@{ + virtual AAX_Result HandleParameterMouseEnter(AAX_CParamID inParamID, uint32_t inModifiers ) = 0; ///< \copydoc AAX_IViewContainer::HandleParameterMouseEnter() + virtual AAX_Result HandleParameterMouseExit(AAX_CParamID inParamID, uint32_t inModifiers ) = 0; ///< \copydoc AAX_IViewContainer::HandleParameterMouseExit() + //@}end Host event handlers +}; + + +#ifdef __clang__ +#pragma clang diagnostic pop +#endif + +#endif diff --git a/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_IAutomationDelegate.h b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_IAutomationDelegate.h new file mode 100644 index 0000000000..900efaa5ad --- /dev/null +++ b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_IAutomationDelegate.h @@ -0,0 +1,148 @@ +/*================================================================================================*/ +/* + * + * Copyright 2014-2017, 2023-2024 Avid Technology, Inc. + * All rights reserved. + * + * This file is part of the Avid AAX SDK. + * + * The AAX SDK is subject to commercial or open-source licensing. + * + * By using the AAX SDK, you agree to the terms of both the Avid AAX SDK License + * Agreement and Avid Privacy Policy. + * + * AAX SDK License: https://developer.avid.com/aax + * Privacy Policy: https://www.avid.com/legal/privacy-policy-statement + * + * Or: You may also use this code under the terms of the GPL v3 (see + * www.gnu.org/licenses). + * + * THE AAX SDK IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER + * EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE + * DISCLAIMED. + * + */ + +/** + * \file AAX_IAutomationDelegate.h + * + * \brief Interface allowing an %AAX plug-in to interact with the host's automation system + * + */ +/*================================================================================================*/ + + +#ifndef AAX_IAUTOMATIONDELEGATE_H +#define AAX_IAUTOMATIONDELEGATE_H + +#include "AAX.h" + +/** \brief Interface allowing an %AAX plug-in to interact with the host's event system + * + * \details + * \hostimp + * + * This delegate provides a means of interacting with the host's event system in order to ensure + * that events such as parameter updates are properly arbitrated and broadcast to all listeners. The automation + * delegate is used regardless of whether or not an individual parameter is "automatable" or "automation-enabled". + * + * A parameter must be registered with the automation delegate in order for updates to the parameter's control in the + * plug-in's GUI or other controller (control surface, etc.) to be successfully processed by the host and sent to the + * \ref AAX_IEffectParameters object. + * + * The parameter identifiers used by this interface correspond to the control IDs used to identify parameters in the + * \ref AAX_CParameterManager "Parameter Mananger". + */ +class AAX_IAutomationDelegate +{ +public: + + virtual ~AAX_IAutomationDelegate() {} + + /** + * Register a control with the automation system using a char* based control identifier + * + * The automation delegate owns a list of the IDs of all of the parameters that have been registered with it. This + * list is used to set up listeners for all of the registered parameters such that the automation delegate may + * update the plug-in when the state of any of the registered parameters have been modified. + * + * \sa AAX_IAutomationDelegate::UnregisterParameter() + * + * \param[in] iParameterID + * Parameter ID that is being registered + */ + virtual AAX_Result RegisterParameter ( AAX_CParamID iParameterID ) = 0; + + /** + * Unregister a control with the automation system using a char* based control identifier + * + * \note All registered controls should be unregistered or the system might leak. + * + * \sa AAX_IAutomationDelegate::RegisterParameter() + * + * \param[in] iParameterID + * Parameter ID that is being registered + */ + virtual AAX_Result UnregisterParameter ( AAX_CParamID iParameterID ) = 0; + + /** + * Submits a request for the given parameter's value to be changed + * + * \param[in] iParameterID + * ID of the parameter for which a change is requested + * \param[in] normalizedValue + * The requested new parameter value, formatted as a double and normalized to [0 1] + */ + virtual AAX_Result PostSetValueRequest ( AAX_CParamID iParameterID, double normalizedValue ) const = 0; + + /** + * Notifies listeners that a parameter's value has changed + * + * \param[in] iParameterID + * ID of the parameter that has been updated + * \param[in] normalizedValue + * The current parameter value, formatted as a double and normalized to [0 1] + */ + virtual AAX_Result PostCurrentValue( AAX_CParamID iParameterID, double normalizedValue ) const = 0; + + /** + * Requests that the given parameter be "touched", i.e. locked for updates by the current client + * + * \param[in] iParameterID + * ID of the parameter that will be touched + */ + virtual AAX_Result PostTouchRequest( AAX_CParamID iParameterID ) = 0; + + /** + * Requests that the given parameter be "released", i.e. available for updates from any client + * + * \param[in] iParameterID + * ID of the parameter that will be released + */ + virtual AAX_Result PostReleaseRequest( AAX_CParamID iParameterID ) = 0; + + /** + * Gets the current touched state of a parameter + * + * \param[in] iParameterID + * ID of the parameter that is being queried + * \param[out] oTouched + * The current touch state of the parameter + */ + virtual AAX_Result GetTouchState ( AAX_CParamID iParameterID, AAX_CBoolean * oTouched ) = 0; + + /** + * Notify listeners that the parameter's display name has changed + * + * Note that this is not part of the underlying automation delegate interface with + * the host; it is converted on the %AAX side to a notification posted to the host + * via the \ref AAX_IController . + * + * \param[in] iParameterID + * ID of the parameter that has been updated + */ + virtual AAX_Result ParameterNameChanged ( AAX_CParamID iParameterID ) = 0; +}; + + +#endif ////AAX_IAUTOMATIONDELEGATE_H diff --git a/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_ICollection.h b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_ICollection.h new file mode 100644 index 0000000000..ea22be4690 --- /dev/null +++ b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_ICollection.h @@ -0,0 +1,174 @@ +/*================================================================================================*/ +/* + * + * Copyright 2013-2017, 2019, 2023-2024 Avid Technology, Inc. + * All rights reserved. + * + * This file is part of the Avid AAX SDK. + * + * The AAX SDK is subject to commercial or open-source licensing. + * + * By using the AAX SDK, you agree to the terms of both the Avid AAX SDK License + * Agreement and Avid Privacy Policy. + * + * AAX SDK License: https://developer.avid.com/aax + * Privacy Policy: https://www.avid.com/legal/privacy-policy-statement + * + * Or: You may also use this code under the terms of the GPL v3 (see + * www.gnu.org/licenses). + * + * THE AAX SDK IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER + * EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE + * DISCLAIMED. + * + */ + +/** + * \file AAX_ICollection.h + * + * \brief Interface to represent a plug-in binary's static description + * + */ +/*================================================================================================*/ + + +#ifndef AAX_ICOLLECTION_H +#define AAX_ICOLLECTION_H + +#include "AAX.h" + +class AAX_IEffectDescriptor; +class AAX_IPropertyMap; +class AAX_IDescriptionHost; +class IACFDefinition; + +/** @brief Interface to represent a plug-in binary's static description + + @details + \hostimp + + The \ref AAX_ICollection interface provides a creation function for new plug-in descriptors, + which in turn provides access to the various interfaces necessary for describing a plug-in. + When a plug-in description is complete, it is added to the collection via the \ref AddEffect + method. The \ref AAX_ICollection interface also provides some additional description methods that + are used to describe the overall plug-in package. These methods can be used to describe the + plug-in package's name, the name of the plug-in's manufacturer, and the plug-in package + version. + + \legacy The information in AAX_ICollection is roughly analogous to the information + provided by CProcessGroup in the legacy plug-in library + + \ingroup CommonInterface_Describe +*/ +class AAX_ICollection +{ +public: + virtual ~AAX_ICollection() {} + +public: // AAX_IACFCollection + + /** @brief Create a new Effect descriptor. + + */ + virtual AAX_IEffectDescriptor * NewDescriptor () = 0; + + /** @brief Add an Effect description to the collection. + + Each Effect that a plug-in registers with \ref AAX_ICollection::AddEffect() is considered + a completely different user-facing product. For example, in Avid's Dynamics III plug-in the + Expander, Compressor, and DeEsser are each registered as separate Effects. All stem format + variations within each Effect are registered within that Effect's \ref AAX_IEffectDescriptor + using \ref AAX_IEffectDescriptor::AddComponent() "AddComponent()". + + The \ref AAX_eProperty_ProductID value for all ProcessProcs within a single Effect must be + identical. + + This method passes ownership of an \ref AAX_IEffectDescriptor object to the + \ref AAX_ICollection. The \ref AAX_IEffectDescriptor must not be deleted by the %AAX plug-in, + nor should it be edited in any way after it is passed to the \ref AAX_ICollection. + + @param[in] inEffectID + The effect ID. + @param[in] inEffectDescriptor + The Effect descriptor. + + */ + virtual AAX_Result AddEffect ( const char * inEffectID, AAX_IEffectDescriptor* inEffectDescriptor ) = 0; + + /** @brief Set the plug-in manufacturer name. + + @param[in] inPackageName + The name of the manufacturer. + + */ + virtual AAX_Result SetManufacturerName( const char* inPackageName ) = 0; + /** @brief Set the plug-in package name. + + May be called multiple times to add abbreviated package names. + + \note Every plug-in must include at least one name variant with 16 + or fewer characters, plus a null terminating character. Used for Presets folder. + + @param[in] inPackageName + The name of the package. + + */ + virtual AAX_Result AddPackageName( const char *inPackageName ) = 0; + /** @brief Set the plug-in package version number. + + @param[in] inVersion + The package version numner. + + */ + virtual AAX_Result SetPackageVersion( uint32_t inVersion ) = 0; + /** @brief Create a new property map + + + */ + virtual AAX_IPropertyMap * NewPropertyMap () = 0; + /** @brief Set the properties of the collection + + @param[in] inProperties + Collection properties + + + */ + virtual AAX_Result SetProperties ( AAX_IPropertyMap * inProperties ) = 0; + + /** @brief Get the current version of the host + + See \ref AAXATTR_Client_Version for information about the version data format + + @param[in] outVersion + Host version + + */ + virtual AAX_Result GetHostVersion(uint32_t* outVersion) const = 0; + +public: // AAX_ICollection + + /** Get a pointer to an \ref AAX_IDescriptionHost, if supported by the host + + This interface is served by the \ref AAX_ICollection in order to avoid requiring a new + method prototype for the \ref GetEffectDescriptions() method called from the %AAX Library. + + @sa \ref AAX_UIDs.h for available feature UIDs, e.g. \ref AAXATTR_ClientFeature_AuxOutputStem + */ + virtual AAX_IDescriptionHost* DescriptionHost() = 0; + virtual const AAX_IDescriptionHost* DescriptionHost() const = 0; ///< \copydoc AAX_ICollection::DescriptionHost() + + /** Get a pointer to an \ref IACFDefinition, if supported by the host + + This interface is served by the \ref AAX_ICollection in order to avoid requiring a new + method prototype for the \ref GetEffectDescriptions() method called from the %AAX Library. + + @sa \ref AAX_UIDs.h for available host attribute UIDs, e.g. \ref AAXATTR_Client_Level + + The implementation of \ref AAX_ICollection owns the referenced object. No AddRef occurs. + + \ref IACFDefinition::DefineAttribute() is not supported on this object + */ + virtual IACFDefinition* HostDefinition() const = 0; +}; + +#endif diff --git a/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_IComponentDescriptor.h b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_IComponentDescriptor.h new file mode 100644 index 0000000000..1297334cea --- /dev/null +++ b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_IComponentDescriptor.h @@ -0,0 +1,490 @@ +/*================================================================================================*/ +/* + * + * Copyright 2013-2017, 2023-2024 Avid Technology, Inc. + * All rights reserved. + * + * This file is part of the Avid AAX SDK. + * + * The AAX SDK is subject to commercial or open-source licensing. + * + * By using the AAX SDK, you agree to the terms of both the Avid AAX SDK License + * Agreement and Avid Privacy Policy. + * + * AAX SDK License: https://developer.avid.com/aax + * Privacy Policy: https://www.avid.com/legal/privacy-policy-statement + * + * Or: You may also use this code under the terms of the GPL v3 (see + * www.gnu.org/licenses). + * + * THE AAX SDK IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER + * EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE + * DISCLAIMED. + * + */ + +/** + * \file AAX_IComponentDescriptor.h + * + * \brief Description interface for an %AAX plug-in algorithm + * + */ +/*================================================================================================*/ + + +#ifndef _AAX_ICOMPONENTDESCRIPTOR_H_ +#define _AAX_ICOMPONENTDESCRIPTOR_H_ + +#include "AAX.h" +#include "AAX_IDma.h" +#include "AAX_Callbacks.h" + +class AAX_IPropertyMap; + + +/** \brief Description interface for an %AAX plug-in component + + \details + \hostimp + + This is an abstract interface containing everything needed to describe a single + algorithm of an Effect. For more information about algorithm processing in + %AAX plug-ins, see \ref CommonInterface_Algorithm. + + \ingroup CommonInterface_Describe +*/ +class AAX_IComponentDescriptor +{ +public: + virtual ~AAX_IComponentDescriptor() {} + + /*! + * \brief Clears the descriptor + * + * Clears the descriptor and readies it for the next algorithm description + * + */ + virtual AAX_Result Clear () = 0; + + /*! + * \brief Subscribes an audio input context field + * + * Defines an audio in port for host-provided information in the algorithm's + * context structure. + * + * - Data type: float** + * - Data kind: An array of float arrays, one for each input channel + * + * \param[in] inFieldIndex + * Unique identifier for the field, generated using \ref AAX_FIELD_INDEX + */ + virtual AAX_Result AddAudioIn ( AAX_CFieldIndex inFieldIndex ) = 0; + + /*! + * \brief Subscribes an audio output context field + * + * Defines an audio out port for host-provided information in the algorithm's + * context structure. + * + * - Data type: float** + * - Data kind: An array of float arrays, one for each output channel + * + * \param[in] inFieldIndex + * Unique identifier for the field, generated using \ref AAX_FIELD_INDEX + */ + virtual AAX_Result AddAudioOut ( AAX_CFieldIndex inFieldIndex ) = 0; + + /*! + * \brief Subscribes a buffer length context field + * + * Defines a buffer length port for host-provided information in the algorithm's + * context structure. + * + * - Data type: int32_t* + * - Data kind: The number of samples in the current audio buffer + * + * \param[in] inFieldIndex + * Unique identifier for the field, generated using \ref AAX_FIELD_INDEX + */ + virtual AAX_Result AddAudioBufferLength ( AAX_CFieldIndex inFieldIndex ) = 0; + + /*! + * \brief Subscribes a sample rate context field + * + * Defines a sample rate port for host-provided information in the algorithm's + * context structure. + * + * - Data type: \ref AAX_CSampleRate * + * - Data kind: The current sample rate + * + * \param[in] inFieldIndex + * Unique identifier for the field, generated using \ref AAX_FIELD_INDEX + */ + virtual AAX_Result AddSampleRate ( AAX_CFieldIndex inFieldIndex ) = 0; + + /*! + * \brief Subscribes a clock context field + * + * Defines a clock port for host-provided information in the algorithm's + * context structure. + * + * - Data type: \ref AAX_CTimestamp * + * - Data kind: A running counter which increments even when the transport is not + * playing. The counter increments exactly once per sample quantum. + * + * \compatibility As of Pro Tools 11.1, this field may be used in both Native + * and DSP plug-ins. The DSP clock data is a 16-bit cycling counter. This field + * was only available for Native plug-ins in previous Pro Tools versions. + * + * \param[in] inFieldIndex + * Unique identifier for the field, generated using \ref AAX_FIELD_INDEX + */ + virtual AAX_Result AddClock ( AAX_CFieldIndex inFieldIndex ) = 0; + + /*! + * \brief Subscribes a side-chain input context field + * + * Defines a side-chain input port for host-provided information in the algorithm's + * context structure. + * + * - Data type: int32_t* + * - Data kind: The index of the plug-in's first side-chain input channel + * within the array of input audio buffers + * + * \param[in] inFieldIndex + * Unique identifier for the field, generated using \ref AAX_FIELD_INDEX + */ + virtual AAX_Result AddSideChainIn ( AAX_CFieldIndex inFieldIndex ) = 0; + + /*! + * \brief Adds a custom data port to the algorithm context + * + * Defines a read-only data port for plug-in information in the algorithm's + * context structure. The plug-in can send information to this port + * using \ref AAX_IController::PostPacket(). + * + * The host guarantees that all packets will be delivered to this + * port in the order in which they were posted, up to the point of + * a packet buffer overflow, though some packets may be dropped depending + * on the \p inPortType and host implementation. + * + * \note When a plug-in is operating in offline (AudioSuite) mode, all + * data ports operate as \ref AAX_eDataInPortType_Unbuffered ports + * + * \param[in] inFieldIndex + * Unique identifier for the port, generated using \ref AAX_FIELD_INDEX + * \param[in] inPacketSize + * Size of the data packets that will be sent to this port + * \param[in] inPortType + * The requested packet delivery behavior for this port + */ + virtual AAX_Result AddDataInPort ( AAX_CFieldIndex inFieldIndex, uint32_t inPacketSize, AAX_EDataInPortType inPortType = AAX_eDataInPortType_Buffered ) = 0; + + /** @brief Adds an auxiliary output stem for a plug-in. + * + * Use this method to add additional output channels to the algorithm context. + * + * The aux output stem audio buffers will be added to the end of the audio outputs array + * in the order in which they are described. When writing audio data to a specific aux + * output, find the proper starting channel by accumulating all of the channels of the + * main output stem format and any previously-described aux output stems. + * + * The plug-in is responsible for providing a meaningful name for each aux outputs. At + * the very least, individual outputs should be labeled "Output xx", where "xx" is the + * aux output number as it is defined in the plug-in. The output name should also include + * the words "mono" and "stereo" to support when users are looking for an output with a + * specific stem format. + * + * \compatibility There is a hard limit to the number of outputs that Pro Tools supports for a + * single plug-in instance. This limit is currently set at 256 channels, which includes all of + * the plug-in's output channels in addition to the sum total of all of its aux output stem + * channels. + * + * \compatibility Pro Tools supports only mono and stereo auxiliary output stem formats + * + * \warning This method will return an error code on hosts which do not support auxiliary + * output stems. This indicates that the host will not provide audio buffers for auxiliary + * output stems during processing. A plug-in must not attempt to write data into auxiliary + * output stem buffers which have not been provided by the host! + * + * \param[in] inFieldIndex + * DEPRECATED: This parameter is no longer needed by the host, but is included in the interface for binary compatibility + * \param[in] inStemFormat + * The stem format of the new aux output + * \param[in] inNameUTF8 + * The name of the aux output. This name is static and cannot be changed after the descriptor is submitted to the host + * + */ + virtual AAX_Result AddAuxOutputStem ( AAX_CFieldIndex inFieldIndex, int32_t inStemFormat, const char inNameUTF8[]) = 0; + /*! + * \brief Adds a private data port to the algorithm context + * + * Defines a read/write data port for private state data. + * Data written to this port will be maintained by the host + * between calls to the algorithm context. + * + * \sa alg_pd_registration + * + * \param[in] inFieldIndex + * Unique identifier for the port, generated using \ref AAX_FIELD_INDEX + * \param[in] inDataSize + * Size of the data packets that will be sent to this port + * \param[in] inOptions + * Options that define the private data port's behavior + */ + virtual AAX_Result AddPrivateData ( AAX_CFieldIndex inFieldIndex, int32_t inDataSize, /* AAX_EPrivateDataOptions */ uint32_t inOptions = AAX_ePrivateDataOptions_DefaultOptions ) = 0; + + /*! + * \brief Adds a block of data to a context that is not saved between callbacks and is scaled by the system buffer size. + * + * This can be very useful if you use block processing and need to store intermediate results. Just specify your base element + * size and the system will scale the overall block size by the buffer size. For example, to create a buffer of floats that is + * the length of the block, specify 4 bytes as the elementsize. + * + * This data block does not retain state across callback and can also be reused across instances on memory contrained systems. + * + * \param[in] inFieldIndex + * Unique identifier for the port, generated using \ref AAX_FIELD_INDEX + * \param[in] inDataElementSize + * The size of a single piece of data in the block. This number will be multipied by the processing block size to determine total block size. + */ + virtual AAX_Result AddTemporaryData( AAX_CFieldIndex inFieldIndex, uint32_t inDataElementSize) = 0; + + /** + \brief Adds a DMA field to the plug-in's context + + DMA (direct memory access) provides efficient reads from and writes to external memory on the + DSP. DMA behavior is emulated in host-based plug-ins for cross-platform portability. + + \note The order in which DMA instances are added defines their priority and therefore order of + execution of DMA operations. In most plug-ins, Scatter fields should be placed first in order + to achieve the lowest possible access latency. + + For more information, see \ref additionalFeatures_DMA . + + \todo Update the DMA system management such that operation priority can be set arbitrarily + + \param[in] inFieldIndex + Unique identifier for the field, generated using \ref AAX_FIELD_INDEX + \param[in] inDmaMode + AAX_IDma::EMode that will apply to this field + + */ + virtual AAX_Result AddDmaInstance ( AAX_CFieldIndex inFieldIndex, AAX_IDma::EMode inDmaMode ) = 0; + + /** @brief Adds a meter field to the plug-in's context + + Meter fields include an array of meter tap values, with one tap per meter per context. Only + one meter field should be added per Component. Individual meter behaviors can be described + at the Effect level. + + For more information, see \ref AdditionalFeatures_Meters . + + \param[in] inFieldIndex + Unique identifier for the field, generated using \ref AAX_FIELD_INDEX + \param[in] inMeterIDs + Array of 32-bit IDs, one for each meter. Meter IDs must be unique within the Effect. + \param[in] inMeterCount + The number of meters included in this field + */ + virtual AAX_Result AddMeters ( AAX_CFieldIndex inFieldIndex, const AAX_CTypeID* inMeterIDs, const uint32_t inMeterCount ) = 0; + + /** @brief Adds a MIDI node field to the plug-in's context + + - Data type: \ref AAX_IMIDINode * + + The resulting MIDI node data will be available both in the algorithm context and in the plug-in's + \ref AAX_IEffectParameters "data model" via + \ref AAX_IACFEffectParameters_V2::UpdateMIDINodes() "UpdateMIDINodes()". + + To add a MIDI node that is only accessible to the plug-in's data model, use + \ref AAX_IEffectDescriptor::AddControlMIDINode() + + \compatibility Due to current restrictions MIDI data won't be delivered to DSP algorithms, only to %AAX Native. + + \param[in] inFieldIndex + The ID of the port. MIDI node ports should formatted as a pointer to an \ref AAX_IMIDINode. + \param[in] inNodeType + The type of MIDI node, as \ref AAX_EMIDINodeType + \param[in] inNodeName + The name of the MIDI node as it should appear in the host's UI + \param[in] channelMask + The channel mask for the MIDI node. This parameter specifies used MIDI channels. For Global MIDI nodes, use a mask of \ref AAX_EMidiGlobalNodeSelectors + */ + virtual AAX_Result AddMIDINode ( AAX_CFieldIndex inFieldIndex, AAX_EMIDINodeType inNodeType, const char inNodeName[], uint32_t channelMask ) = 0; + + /*! + * \brief Subscribes a context field to host-provided services or information + * + * \note Currently for internal use only. + * + * \param[in] inFieldIndex + * Unique identifier for the field, generated using \ref AAX_FIELD_INDEX + * \param[in] inFieldType + * Type of field that is being added + */ + virtual AAX_Result AddReservedField ( AAX_CFieldIndex inFieldIndex, uint32_t inFieldType ) = 0; + + /** @brief Creates a new, empty property map. + + The component descriptor owns the reference to the resulting property map, and + the underlying property map is destroyed when the component descriptor is + released. + + */ + virtual AAX_IPropertyMap * NewPropertyMap () const = 0; // CONST? + + /** @brief Creates a new property map using an existing property map + + The component descriptor owns the reference to the resulting property map, and + the underlying property map is destroyed when the component descriptor is + released. + + \param[in] inPropertyMap + The property values in this map will be copied into the new map + + */ + virtual AAX_IPropertyMap * DuplicatePropertyMap (AAX_IPropertyMap* inPropertyMap) const = 0; + /** \brief Registers an algorithm processing entrypoint (process procedure) for the + * native architecture + * + * \param[in] inProcessProc + * Symbol for this processing callback + * \param[in] inProperties + * A property map for this processing callback. The property map's values are copied + * by the host and associated with the new ProcessProc. The property map contents are + * unchanged and the map may be re-used when registering additional ProcessProcs. + * \param[in] inInstanceInitProc + * Initialization routine that will be called when a new instance of the Effect + * is created. See \ref alg_initialization. + * \param[in] inBackgroundProc + * Background routine that will be called in an idle context within the same + * address space as the associated process procedure. See + * \ref additionalFeatures_BackgroundProc + * \param[out] outProcID + * \todo document this parameter + */ + virtual AAX_Result AddProcessProc_Native ( + AAX_CProcessProc inProcessProc, + AAX_IPropertyMap * inProperties = NULL, + AAX_CInstanceInitProc inInstanceInitProc = NULL, + AAX_CBackgroundProc inBackgroundProc = NULL, + AAX_CSelector * outProcID = NULL) = 0; + /** \brief Registers an algorithm processing entrypoint (process procedure) for the + * native architecture + * + * \param[in] inDLLFileNameUTF8 + * UTF-8 encoded filename for the ELF DLL containing the algorithm code fragment + * \param[in] inProcessProcSymbol + * Symbol for this processing callback + * \param[in] inProperties + * A property map for this processing callback. The property map's values are copied + * by the host and associated with the new ProcessProc. The property map contents are + * unchanged and the map may be re-used when registering additional ProcessProcs. + * \param[in] inInstanceInitProcSymbol + * Initialization routine that will be called when a new instance of the Effect + * is created. Must be included in the same DLL as the main algorithm + * entrypoint. See \ref alg_initialization. + * \param[in] inBackgroundProcSymbol + * Background routine that will be called in an idle context within the same + * address space as the associated process procedure. Must be included in the + * same DLL as the main algorithm entrypoint. See + * \ref additionalFeatures_BackgroundProc + * \param[out] outProcID + * \todo document this parameter + */ + virtual AAX_Result AddProcessProc_TI ( + const char inDLLFileNameUTF8 [], + const char inProcessProcSymbol [], + AAX_IPropertyMap * inProperties, + const char inInstanceInitProcSymbol [] = NULL, + const char inBackgroundProcSymbol [] = NULL, + AAX_CSelector * outProcID = NULL) = 0; + + /** \brief Registers one or more algorithm processing entrypoints (process procedures) + * + * Any non-overlapping set of processing entrypoints may be specified. Typically this can + * be used to specify both Native and TI entrypoints using the same call. + * + * The %AAX Library implementation of this method includes backwards compatibility logic + * to complete the ProcessProc registration on hosts which do not support this method. + * Therefore plug-in code may use this single registration routine instead of separate + * calls to \ref AddProcessProc_Native(), \ref AddProcessProc_TI(), etc. regardless of the + * host version. + * + * The following properties replace the input arguments to the platform-specific + * registration methods: + * + * \ref AddProcessProc_Native() (\ref AAX_eProperty_PlugInID_Native, \ref AAX_eProperty_PlugInID_AudioSuite) + * - \ref AAX_CProcessProc \c iProcessProc: \ref AAX_eProperty_NativeProcessProc (required) + * - \ref AAX_CInstanceInitProc \c iInstanceInitProc: \ref AAX_eProperty_NativeInstanceInitProc (optional) + * - \ref AAX_CBackgroundProc \c iBackgroundProc: \ref AAX_eProperty_NativeBackgroundProc (optional) + * + * \ref AddProcessProc_TI() (\ref AAX_eProperty_PlugInID_TI) + * - const char inDLLFileNameUTF8[]: \ref AAX_eProperty_TIDLLFileName (required) + * - const char iProcessProcSymbol[]: \ref AAX_eProperty_TIProcessProc (required) + * - const char iInstanceInitProcSymbol[]: \ref AAX_eProperty_TIInstanceInitProc (optional) + * - const char iBackgroundProcSymbol[]: \ref AAX_eProperty_TIBackgroundProc (optional) + * + * If any platform-specific plug-in ID property is present in \p iProperties then + * \ref AddProcessProc() will check for the required properties for that platform. + * + * \note \ref AAX_eProperty_AudioBufferLength will be ignored for the Native and AudioSuite ProcessProcs + * since it should only be used for %AAX DSP. + * + * \param[in] inProperties + * A property map for this processing callback. The property map's values are copied + * by the host and associated with the new ProcessProc. The property map contents are + * unchanged and the map may be re-used when registering additional ProcessProcs. + * + * \param[out] outProcIDs + * \todo document this parameter + * Returned array will be NULL-terminated + * + * \param[in] inProcIDsSize + * The size of the array provided to \p oProcIDs. If \p oProcIDs is non-NULL but \p iProcIDsSize is not + * large enough for all of the registered ProcessProcs (plus one for NULL termination) then this method + * will fail with \ref AAX_ERROR_ARGUMENT_BUFFER_OVERFLOW + */ + virtual AAX_Result AddProcessProc ( + AAX_IPropertyMap* inProperties, + AAX_CSelector* outProcIDs = NULL, + int32_t inProcIDsSize = 0) = 0; + + /** \brief Registers an algorithm processing entrypoint (process procedure) for the + * native architecture + * + * This template provides an \ref AAX_CALLBACK based interface to the + * \ref AddProcessProc_Native method. + * + * \sa \ref AAX_IComponentDescriptor::AddProcessProc_Native(AAX_CProcessProc,AAX_IPropertyMap*,AAX_CInstanceInitProc,AAX_CBackgroundProc,AAX_CSelector*) + * + * \param[in] inProperties + * A property map for this processing callback. The property map's values are copied + * by the host and associated with the new ProcessProc. The property map contents are + * unchanged and the map may be re-used when registering additional ProcessProcs. + */ + template + AAX_Result AddProcessProc_Native ( + void (AAX_CALLBACK *inProcessProc) ( aContextType * const inInstancesBegin [], const void * inInstancesEnd), + AAX_IPropertyMap * inProperties = NULL, + int32_t (AAX_CALLBACK *inInstanceInitProc) ( const aContextType * inInstanceContextPtr, AAX_EComponentInstanceInitAction inAction ) = NULL, + int32_t (AAX_CALLBACK *inBackgroundProc) ( void ) = NULL ); +}; + +template +inline AAX_Result +AAX_IComponentDescriptor::AddProcessProc_Native ( + void (AAX_CALLBACK *inProcessProc) ( aContextType * const inInstancesBegin [], const void * inInstancesEnd), + AAX_IPropertyMap * inProperties, + int32_t (AAX_CALLBACK *inInstanceInitProc) ( const aContextType * inInstanceContextPtr, AAX_EComponentInstanceInitAction inAction ), + int32_t (AAX_CALLBACK *inBackgroundProc) ( void ) ) +{ + return this->AddProcessProc_Native( + reinterpret_cast ( inProcessProc ), + inProperties, + reinterpret_cast( inInstanceInitProc ), + reinterpret_cast( inBackgroundProc ) ); +} + +#endif // #ifndef _AAX_ICOMPONENTDESCRIPTOR_H_ diff --git a/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_IContainer.h b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_IContainer.h new file mode 100644 index 0000000000..a462fde124 --- /dev/null +++ b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_IContainer.h @@ -0,0 +1,64 @@ +/*================================================================================================*/ +/* + * + * Copyright 2015, 2023-2024 Avid Technology, Inc. + * All rights reserved. + * + * This file is part of the Avid AAX SDK. + * + * The AAX SDK is subject to commercial or open-source licensing. + * + * By using the AAX SDK, you agree to the terms of both the Avid AAX SDK License + * Agreement and Avid Privacy Policy. + * + * AAX SDK License: https://developer.avid.com/aax + * Privacy Policy: https://www.avid.com/legal/privacy-policy-statement + * + * Or: You may also use this code under the terms of the GPL v3 (see + * www.gnu.org/licenses). + * + * THE AAX SDK IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER + * EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE + * DISCLAIMED. + * + */ + +/** + * \file AAX_IContainer.h + * + * \brief Abstract container interface + * + */ +/*================================================================================================*/ +/// @cond ignore +#ifndef AAX_ICONTAINER_H +#define AAX_ICONTAINER_H +/// @endcond + + +/** Abstract container interface + */ +class AAX_IContainer +{ +public: + virtual ~AAX_IContainer() {} + +public: + enum EStatus + { + eStatus_Success = 0 ///< Operation succeeded + ,eStatus_Overflow = 1 ///< Internal buffer overflow + ,eStatus_NotInitialized = 2 ///< Uninitialized container + ,eStatus_Unavailable = 3 ///< An internal resource was not available + ,eStatus_Unsupported = 4 ///< Operation is unsupported + }; + +public: + /** Clear the container + */ + virtual void Clear() = 0; +}; + +/// @cond ignore +#endif /* defined(AAX_ICONTAINER_H) */ +/// @endcond diff --git a/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_IController.h b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_IController.h new file mode 100644 index 0000000000..b8b9b19c70 --- /dev/null +++ b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_IController.h @@ -0,0 +1,579 @@ +/*================================================================================================*/ +/* + * + * Copyright 2013-2017, 2023-2024 Avid Technology, Inc. + * All rights reserved. + * + * This file is part of the Avid AAX SDK. + * + * The AAX SDK is subject to commercial or open-source licensing. + * + * By using the AAX SDK, you agree to the terms of both the Avid AAX SDK License + * Agreement and Avid Privacy Policy. + * + * AAX SDK License: https://developer.avid.com/aax + * Privacy Policy: https://www.avid.com/legal/privacy-policy-statement + * + * Or: You may also use this code under the terms of the GPL v3 (see + * www.gnu.org/licenses). + * + * THE AAX SDK IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER + * EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE + * DISCLAIMED. + * + */ + +/** + * \file AAX_IController.h + * + * \brief Interface for the %AAX host's view of a single instance of an effect + * + */ +/*================================================================================================*/ + + +#ifndef _AAX_ICONTROLLER_H_ +#define _AAX_ICONTROLLER_H_ + +#include "AAX_Properties.h" +#include "AAX_IString.h" +#include "AAX.h" +#include + +// Forward declarations +class AAX_IPageTable; + + +/** + * \brief Interface for the %AAX host's view of a single instance of an effect. + * Used by both clients of the %AAX host and by effect components. + * + * \details + * \hostimp + */ +class AAX_IController +{ +public: + + virtual ~AAX_IController(void) {} + + /** @name Host information getters + * + * Call these methods to retrieve environment and run-time information from the %AAX host. + */ + //@{ + virtual AAX_Result GetEffectID ( + AAX_IString * outEffectID) const = 0; + /*! + * \brief CALL: Returns the current literal sample rate + * + * \param[out] outSampleRate + * The current sample rate + */ + virtual // AAX_VController + AAX_Result + GetSampleRate ( + AAX_CSampleRate *outSampleRate ) const = 0; + /*! + * \brief CALL: Returns the plug-in's input stem format + * + * \param[out] outStemFormat + * The current input stem format + */ + virtual // AAX_VController + AAX_Result + GetInputStemFormat ( + AAX_EStemFormat *outStemFormat ) const = 0; + /*! + * \brief CALL: Returns the plug-in's output stem format + * + * \param[out] outStemFormat + * The current output stem format + */ + virtual // AAX_VController + AAX_Result + GetOutputStemFormat ( + AAX_EStemFormat *outStemFormat) const = 0; + /*! + * \brief CALL: Returns the most recent signal (algorithmic) latency that has been + * published by the plug-in + * + * This method provides the most recently published signal latency. The host may not + * have updated its delay compensation to match this signal latency yet, so plug-ins + * that dynamically change their latency using + * \ref AAX_IController::SetSignalLatency() "SetSignalLatency()" should always wait for + * an \ref AAX_eNotificationEvent_SignalLatencyChanged notification before updating its + * algorithm to incur this latency. + * + * \sa \ref AAX_IController::SetSignalLatency() "SetSignalLatency()" + * + * \param[out] outSamples + * The number of samples of signal delay published by the plug-in + */ + virtual + AAX_Result + GetSignalLatency( + int32_t* outSamples) const = 0; + /*! + * \brief CALL: returns the plug-in's current real-time DSP cycle count + * + * This method provides the number of cycles that the %AAX host expects the DSP plug-in + * to consume. The host uses this value when allocating DSP resources for the plug-in. + * + * \note A plug-in should never apply a DSP algorithm with more demanding resource + * requirements than what is currently accounted for by the host. To set a higher cycle + * count value, a plug-in must call \ref AAX_IController::SetCycleCount(), then poll + * \ref AAX_IController::GetCycleCount() until the new value has been applied. Once the + * host has recognized the new cycle count value, the plug-in may apply the more + * demanding algorithm. + * + * \param[in] inWhichCycleCount + * Selector for the requested cycle count metric. One of: + * \li \ref AAX_eProperty_TI_SharedCycleCount + * \li \ref AAX_eProperty_TI_InstanceCycleCount + * \li \ref AAX_eProperty_TI_MaxInstancesPerChip + * \param[in] outNumCycles + * The current value of the selected cycle count metric + * + * \todo PLACEHOLDER - NOT CURRENTLY IMPLEMENTED IN HOST + */ + virtual + AAX_Result + GetCycleCount( + AAX_EProperty inWhichCycleCount, + AAX_CPropertyValue* outNumCycles) const = 0; + /*! + * \brief CALL: Returns the current Time Of Day (TOD) of the system + * + * This method provides a plug-in the TOD (in samples) of the current system. TOD is the + * number of samples that the playhead has traversed since the beginning of playback. + * + * \note The TOD value is the immediate value of the audio engine playhead. This value is + * incremented within the audio engine's real-time rendering context; it is not + * synchronized with non-real-time calls to plug-in interface methods. + * + * \param[out] outTODLocation + * The current Time Of Day as set by the host + */ + virtual + AAX_Result + GetTODLocation ( + AAX_CTimeOfDay* outTODLocation ) const = 0; + //@} Host information accessors + + /** @name Host information setters + * + * Call these methods to set dynamic plug-in run-time information on the %AAX host. + */ + //@{ + /*! + * \brief CALL: Submits a request to change the delay compensation value that the host uses + * to account for the plug-in's signal (algorithmic) latency + * + * This method is used to request a change in the number of samples that the %AAX host + * expects the plug-in to delay a signal. + * + * The host is not guaranteed to immediately apply the new latency value. A plug-in should + * avoid incurring an actual algorithmic latency that is different than the latency accounted + * for by the host. + * + * To set a new latency value, a plug-in must call \ref AAX_IController::SetSignalLatency(), + * then wait for an \ref AAX_eNotificationEvent_SignalLatencyChanged notification. Once this + * notification has been received, \ref AAX_IController::GetSignalLatency() will reflect the + * updated latency value and the plug-in should immediately apply any relevant algorithmic + * changes that alter its latency to this new value. + * + * \warning Parameters which affect the latency of a plug-in should not be made available for + * control through automation. This will result in audible glitches when delay compensation + * is adjusted while playing back automation for these parameters. + * + * \param[in] inNumSamples + * The number of samples of signal delay that the plug-in requests to incur + */ + virtual + AAX_Result + SetSignalLatency( + int32_t inNumSamples) = 0; + /*! + * \brief CALL: Indicates a change in the plug-in's real-time DSP cycle count + * + * This method is used to request a change in the number of cycles that the %AAX host + * expects the DSP plug-in to consume. + * + * \note A plug-in should never apply a DSP algorithm with more demanding resource + * requirements than what is currently accounted for by the host. To set a higher cycle + * count value, a plug-in must call \ref AAX_IController::SetCycleCount(), then poll + * \ref AAX_IController::GetCycleCount() until the new value has been applied. Once the + * host has recognized the new cycle count value, the plug-in may apply the more + * demanding algorithm. + * + * \param[in] inWhichCycleCounts + * Array of selectors indicating the specific cycle count metrics that should be set. + * Each selector must be one of: + * \li \ref AAX_eProperty_TI_SharedCycleCount + * \li \ref AAX_eProperty_TI_InstanceCycleCount + * \li \ref AAX_eProperty_TI_MaxInstancesPerChip + * \param[in] iValues + * An array of values requested, one for each of the selected cycle count metrics. + * \param[in] numValues + * The size of \p iValues + * + * \todo PLACEHOLDER - NOT CURRENTLY IMPLEMENTED IN HOST + */ + virtual + AAX_Result + SetCycleCount( + AAX_EProperty* inWhichCycleCounts, + AAX_CPropertyValue* iValues, + int32_t numValues) = 0; + //@} Host information setters + + /** @name Posting methods + * + * Call these methods to post new plug-in information to the host's data management system. + */ + //@{ + /*! + * \brief CALL: Posts a data packet to the host for routing between plug-in components + * + * The posted packet is identified with a \ref AAX_CFieldIndex packet index value, which is + * equivalent to the target data port's identifier. The packet's + * payload must have the expected size for the given packet index / data port, as defined + * when the port is created in \ref CommonInterface_Describe "Describe". + * See AAX_IComponentDescriptor::AddDataInPort(). + * + * \warning Any data structures that will be passed between platforms (for example, sent to + * a TI DSP in an %AAX DSP plug-in) must be properly data-aligned for compatibility across + * both platforms. See \ref AAX_ALIGN_FILE_ALG for more information about guaranteeing + * cross-platform compatibility of data structures used for algorithm processing. + * + * \note All calls to this method should be made within the scope of + * \ref AAX_IEffectParameters::GenerateCoefficients(). Calls from outside this method may + * result in packets not being delivered. See \ref PT-206161 + * + * \param[in] inFieldIndex + * The packet's destination port + * \param[in] inPayloadP + * A pointer to the packet's payload data + * \param[in] inPayloadSize + * The size, in bytes, of the payload data + */ + virtual // AAX_VController + AAX_Result + PostPacket ( + AAX_CFieldIndex inFieldIndex, + const void * inPayloadP, + uint32_t inPayloadSize) = 0; + //@} Posting methods + + /** @name Notification methods + * + * Call these methods to send events among plug-in components + */ + //@{ + /*! + * \brief CALL: Dispatch a notification + * + * The notification is handled by the host and may be delivered back to other plug-in components such as + * the GUI or data model (via \ref AAX_IEffectGUI::NotificationReceived() or + * \ref AAX_IEffectParameters::NotificationReceived(), respectively) depending on the notification type. + * + * The host may choose to dispatch the posted notification either synchronously or asynchronously. + * + * See the \ref AAX_ENotificationEvent documentation for more information. + * + * This method is supported by %AAX V2 Hosts only. Check the return code + * on the return of this function. If the error is \ref AAX_ERROR_UNIMPLEMENTED, your plug-in is being + * loaded into a host that doesn't support this feature. + * + * \param[in] inNotificationType + * Type of notification to send + * \param[in] inNotificationData + * Block of notification data + * \param[in] inNotificationDataSize + * Size of \p inNotificationData, in bytes + */ + virtual AAX_Result SendNotification (/* AAX_ENotificationEvent */ AAX_CTypeID inNotificationType, const void* inNotificationData, uint32_t inNotificationDataSize) = 0; + /*! + * \brief CALL: Sends an event to the GUI (no payload) + * + * This version of the notification method is a convenience for notifications which do not take any + * payload data. Internally, it simply calls + * \ref AAX_IController::SendNotification(AAX_CTypeID, const void*, uint32_t) with a null payload. + * + * \param[in] inNotificationType + * Type of notification to send + */ + virtual AAX_Result SendNotification (/* AAX_ENotificationEvent */ AAX_CTypeID inNotificationType) = 0; + //@} Notification methods + + /** @name Metering methods + * + * Methods to access the plug-in's host-managed metering information. + * + * \sa \ref AdditionalFeatures_Meters + */ + //@{ + /*! + * \brief CALL: Retrieves the current value of a host-managed plug-in meter + * + * \param[in] inMeterID + * ID of the meter that is being queried + * \param[out] outMeterValue + * The queried meter's current value + */ + virtual AAX_Result GetCurrentMeterValue ( AAX_CTypeID inMeterID, float * outMeterValue ) const = 0; + /*! + * \brief CALL: Retrieves the currently held peak value of a host-managed plug-in meter + * + * \param[in] inMeterID + * ID of the meter that is being queried + * \param[out] outMeterPeakValue + * The queried meter's currently held peak value + */ + virtual AAX_Result GetMeterPeakValue ( AAX_CTypeID inMeterID, float * outMeterPeakValue ) const = 0; + /*! + * \brief CALL: Clears the peak value from a host-managed plug-in meter + * + * \param[in] inMeterID + * ID of the meter that is being cleared + */ + virtual AAX_Result ClearMeterPeakValue ( AAX_CTypeID inMeterID ) const = 0; + /*! + * \brief CALL: Retrieves the number of host-managed meters registered by a plug-in. + * + * See AAX_IComponentDescriptor::AddMeters(). + * + * \param[out] outMeterCount + * The number of registered plug-in meters. + */ + virtual AAX_Result GetMeterCount ( uint32_t * outMeterCount ) const = 0; + /*! + * \brief CALL: Retrieves the clipped flag from a host-managed plug-in meter. + * + * See AAX_IComponentDescriptor::AddMeters(). + * + * \param[in] inMeterID + * ID of the meter that is being queried. + * \param[out] outClipped + * The queried meter's clipped flag. + */ + virtual AAX_Result GetMeterClipped ( AAX_CTypeID inMeterID, AAX_CBoolean * outClipped ) const = 0; + /*! + * \brief CALL: Clears the clipped flag from a host-managed plug-in meter. + * + * See AAX_IComponentDescriptor::AddMeters(). + * + * \param[in] inMeterID + * ID of the meter that is being cleared. + */ + virtual AAX_Result ClearMeterClipped ( AAX_CTypeID inMeterID ) const = 0; + //@} Metering methods + + + /** @name MIDI methods + * + * Methods to access the plug-in's host-managed MIDI information. + * + */ + //@{ + /*! + * \brief CALL: Retrieves MIDI packets for described MIDI nodes. + * + * \param[out] outPort + * port ID of the MIDI node that has unhandled packet + * \param[out] outPacket + * The MIDI packet + */ + virtual AAX_Result GetNextMIDIPacket ( AAX_CFieldIndex* outPort, AAX_CMidiPacket* outPacket ) = 0; + //@} MIDI methods + + /*! + * \brief CALL: Returns the latency between the algorithm normal input samples and the inputs returning from the hyrbid component + * + * This method provides the number of samples that the %AAX host expects the plug-in to delay + * a signal. The host will use this value when accounting for latency across the system. + * + * \note This value will generally scale up with sample rate, although it's not a simple multiple due to some fixed overhead. + * This value will be fixed for any given sample rate regardless of other buffer size settings in the host app. + * + * \param[out] outSamples + * The number of samples of hybrid signal delay + * + * \ingroup additionalFeatures_Hybrid + */ + virtual + AAX_Result GetHybridSignalLatency(int32_t* outSamples) const = 0; + /*! + * \brief CALL: Returns the current automation timestamp if called during the + * \ref AAX_IACFEffectParameters::GenerateCoefficients() "GenerateCoefficients()" call AND the generation + * of coefficients is being triggered by an automation point instead of immediate changes. + * + * \note This function will return 0 if called from outside of + * \ref AAX_IACFEffectParameters::GenerateCoefficients() "GenerateCoefficients()" or if the + * \ref AAX_IACFEffectParameters::GenerateCoefficients() "GenerateCoefficients()" + * call was initiated due to a non-automated change. In those cases, you can get your sample offset from the transport + * start using \ref GetTODLocation(). + * + * \param[out] outTimestamp + * The current coefficient timestamp. Sample count from transport start. + */ + virtual + AAX_Result GetCurrentAutomationTimestamp(AAX_CTransportCounter* outTimestamp) const = 0; + /*! + * \brief CALL: Returns name of the host application this plug-in instance is being loaded by. This string also typically includes version information. + * + * \compatibility Pro Tools versions from Pro Tools 11.0 to Pro Tools 12.3.1 will return a generic + * version string to this call. This issue is resolved beginning in Pro Tools 12.4. + * + * \param[out] outHostNameString + * The name of the current host application. + */ + virtual + AAX_Result GetHostName(AAX_IString* outHostNameString) const = 0; + /*! + * \brief CALL: Returns execution platform type, native or TI + * + * \param[out] outTargetPlatform + * The type of the current execution platform as one of \ref AAX_ETargetPlatform. + */ + virtual + AAX_Result GetPlugInTargetPlatform(AAX_CTargetPlatform* outTargetPlatform) const = 0; + /*! + * \brief CALL: Returns true for AudioSuite instances + * + * \param[out] outIsAudioSuite + * The boolean flag which indicate true for AudioSuite instances. + */ + virtual + AAX_Result GetIsAudioSuite(AAX_CBoolean* outIsAudioSuite) const = 0; + + /** + * \brief Copy the current page table data for a particular plug-in type + * + * The host may restrict plug-ins to only copying page table data from certain plug-in types, + * such as plug-ins from the same manufacturer or plug-in types within the same effect. + * + * See \ref AAX_Page_Table_Guide for more information about page tables. + * + * \returns A new page table object to which the requested page table data has been copied. Ownership + * of this object passes to the caller. + * + * \returns a null pointer if the requested plug-in type is unknown, if + * \p inTableType is unknown or if \p inTablePageSize is not a supported size for the given table + * type. + * + * \param[in] inManufacturerID + * \ref AAX_eProperty_ManufacturerID "Manufacturer ID" of the desired plug-in type + * \param[in] inProductID + * \ref AAX_eProperty_ProductID "Product ID" of the desired plug-in type + * \param[in] inPlugInID + * Type ID of the desired plug-in type (\ref AAX_eProperty_PlugInID_Native, \ref AAX_eProperty_PlugInID_TI) + * \param[in] inTableType + * Four-char type identifier for the requested table type (e.g. \c 'PgTL', \c 'Av81', etc.) + * \param[in] inTablePageSize + * Page size for the requested table. Some tables support multiple page sizes. + */ + virtual + AAX_IPageTable* + CreateTableCopyForEffect( + AAX_CPropertyValue inManufacturerID, + AAX_CPropertyValue inProductID, + AAX_CPropertyValue inPlugInID, + uint32_t inTableType, + int32_t inTablePageSize) const = 0; + + /** + * \brief Copy the current page table data for a particular plug-in effect and page table layout + * + * The host may restrict plug-ins to only copying page table data from certain effects, + * such as effects registered within the current AAX plug-in bundle. + * + * See \ref AAX_Page_Table_Guide for more information about page tables. + * + * \returns A new page table object to which the requested page table data has been copied. Ownership + * of this object passes to the caller. + * + * \returns a null pointer if the requested effect ID is unknown or if \p inLayoutName is not a + * valid layout name for the page tables registered for the effect. + * + * \param[in] inEffectID + * Effect ID for the desired effect. See \ref AAX_ICollection::AddEffect() + * \param[in] inLayoutName + * Page table layout name ("name" attribute of the \c PTLayout XML tag) + * \param[in] inTableType + * Four-char type identifier for the requested table type (e.g. \c 'PgTL', \c 'Av81', etc.) + * \param[in] inTablePageSize + * Page size for the requested table. Some tables support multiple page sizes. + */ + virtual + AAX_IPageTable* + CreateTableCopyForLayout( + const char * inEffectID, + const char * inLayoutName, + uint32_t inTableType, + int32_t inTablePageSize) const = 0; + + /** \copybrief AAX_IController::CreateTableCopyForEffect() + * + * \returns A new page table object to which the requested page table data has been copied. Ownership + * of this object passes to the caller. + * + * \returns a null pointer if the requested plug-in type is unkown, if + * \p inTableType is unknown or if \p inTablePageSize is not a supported size for the given table type. + * + * \param[in] inPageTableFilePath + * Path to XML page table file. + * \param[in] inFilePathEncoding + * File path text encoding. + * \param[in] inManufacturerID + * \ref AAX_eProperty_ManufacturerID "Manufacturer ID" of the desired plug-in type + * \param[in] inProductID + * \ref AAX_eProperty_ProductID "Product ID" of the desired plug-in type + * \param[in] inPlugInID + * Type ID of the desired plug-in type (\ref AAX_eProperty_PlugInID_Native, \ref AAX_eProperty_PlugInID_TI) + * \param[in] inTableType + * Four-char type identifier for the requested table type (e.g. \c 'PgTL', \c 'Av81', etc.) + * \param[in] inTablePageSize + * Page size for the requested table. Some tables support multiple page sizes. + */ + virtual + AAX_IPageTable* + CreateTableCopyForEffectFromFile( + const char* inPageTableFilePath, + AAX_ETextEncoding inFilePathEncoding, + AAX_CPropertyValue inManufacturerID, + AAX_CPropertyValue inProductID, + AAX_CPropertyValue inPlugInID, + uint32_t inTableType, + int32_t inTablePageSize) const = 0; + + /** \copybrief AAX_IController::CreateTableCopyForLayout() + * + * \returns A new page table object to which the requested page table data has been copied. Ownership + * of this object passes to the caller. + * + * \returns a null pointer if \p inLayoutName is not a valid layout name for the page tables file. + * + * \param[in] inPageTableFilePath + * Path to XML page table file. + * \param[in] inFilePathEncoding + * File path text encoding. + * \param[in] inLayoutName + * Page table layout name ("name" attribute of the \c PTLayout XML tag) + * \param[in] inTableType + * Four-char type identifier for the requested table type (e.g. \c 'PgTL', \c 'Av81', etc.) + * \param[in] inTablePageSize + * Page size for the requested table. Some tables support multiple page sizes. + */ + virtual + AAX_IPageTable* + CreateTableCopyForLayoutFromFile( + const char* inPageTableFilePath, + AAX_ETextEncoding inFilePathEncoding, + const char* inLayoutName, + uint32_t inTableType, + int32_t inTablePageSize) const = 0; +}; + +#endif // #ifndef _AAX_IPLUGIN_H_ diff --git a/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_IDataBuffer.h b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_IDataBuffer.h new file mode 100644 index 0000000000..f268438c2f --- /dev/null +++ b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_IDataBuffer.h @@ -0,0 +1,70 @@ +/*================================================================================================*/ +/* + * + * Copyright 2023-2024 Avid Technology, Inc. + * All rights reserved. + * + * This file is part of the Avid AAX SDK. + * + * The AAX SDK is subject to commercial or open-source licensing. + * + * By using the AAX SDK, you agree to the terms of both the Avid AAX SDK License + * Agreement and Avid Privacy Policy. + * + * AAX SDK License: https://developer.avid.com/aax + * Privacy Policy: https://www.avid.com/legal/privacy-policy-statement + * + * Or: You may also use this code under the terms of the GPL v3 (see + * www.gnu.org/licenses). + * + * THE AAX SDK IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER + * EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE + * DISCLAIMED. + * + */ + +/** + * \file AAX_IDataBuffer.h + */ +/*================================================================================================*/ + +#pragma once + +#ifndef AAX_IDataBuffer_H +#define AAX_IDataBuffer_H + +#include "AAX_IACFDataBuffer.h" +#include "AAX.h" +#include "CACFUnknown.h" +#include "AAX_UIDs.h" +#include "acfextras.h" + + +/** + * \brief Interface for reference counted data buffers + * + * \copydetails AAX_IACFDataBuffer + */ +class AAX_IDataBuffer : public AAX_IACFDataBuffer + , public CACFUnknown +{ +public: + ACF_DECLARE_STANDARD_UNKNOWN() + + ACFMETHOD(InternalQueryInterface)(const acfIID & riid, void **ppvObjOut) AAX_OVERRIDE + { + if (riid == IID_IAAXDataBufferV1) + { + *ppvObjOut = static_cast(this); + ( static_cast(*ppvObjOut))->AddRef(); + return ACF_OK; + } + + return this->CACFUnknown::InternalQueryInterface(riid, ppvObjOut); + } + + // CACFUnknown does not support operator=() + AAX_DELETE(AAX_IDataBuffer& operator= (const AAX_IDataBuffer&)); +}; + +#endif diff --git a/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_IDataBufferWrapper.h b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_IDataBufferWrapper.h new file mode 100644 index 0000000000..3eca695e63 --- /dev/null +++ b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_IDataBufferWrapper.h @@ -0,0 +1,58 @@ +/*================================================================================================*/ +/* + * + * Copyright 2023-2024 Avid Technology, Inc. + * All rights reserved. + * + * This file is part of the Avid AAX SDK. + * + * The AAX SDK is subject to commercial or open-source licensing. + * + * By using the AAX SDK, you agree to the terms of both the Avid AAX SDK License + * Agreement and Avid Privacy Policy. + * + * AAX SDK License: https://developer.avid.com/aax + * Privacy Policy: https://www.avid.com/legal/privacy-policy-statement + * + * Or: You may also use this code under the terms of the GPL v3 (see + * www.gnu.org/licenses). + * + * THE AAX SDK IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER + * EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE + * DISCLAIMED. + * + */ + +/** + * \file AAX_IDataBufferWrapper.h + */ +/*================================================================================================*/ + +#pragma once +#ifndef AAX_IDATABUFFERWRAPPER_H +#define AAX_IDATABUFFERWRAPPER_H + +#include "AAX.h" + +/** + * \brief Wrapper for an \ref AAX_IDataBuffer + * + * \details + * Like \ref AAX_IController and similar classes, this class provides a non-ACF + * interface matching an ACF interface, in this case \ref AAX_IACFDataBuffer . + * + * The implementation of this interface will contain a reference counted pointer + * to the underlying ACF interface. This interface may be extended with + * convenience functions that are not required on the underlying ACF interface. + */ +class AAX_IDataBufferWrapper +{ +public: + virtual ~AAX_IDataBufferWrapper() = default; + + virtual AAX_Result Type(AAX_CTypeID * oType) const = 0; ///< \copydoc AAX_IDataBuffer::Type + virtual AAX_Result Size(int32_t * oSize) const = 0; ///< \copydoc AAX_IDataBuffer::Size + virtual AAX_Result Data(void const ** oBuffer) const = 0; ///< \copydoc AAX_IDataBuffer::Data +}; + +#endif // AAX_IDATABUFFERWRAPPER_H diff --git a/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_IDescriptionHost.h b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_IDescriptionHost.h new file mode 100644 index 0000000000..46e9cad4d4 --- /dev/null +++ b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_IDescriptionHost.h @@ -0,0 +1,68 @@ +/*================================================================================================*/ +/* + * Copyright 2016-2017, 2023-2024 Avid Technology, Inc. + * All rights reserved. + * + * This file is part of the Avid AAX SDK. + * + * The AAX SDK is subject to commercial or open-source licensing. + * + * By using the AAX SDK, you agree to the terms of both the Avid AAX SDK License + * Agreement and Avid Privacy Policy. + * + * AAX SDK License: https://developer.avid.com/aax + * Privacy Policy: https://www.avid.com/legal/privacy-policy-statement + * + * Or: You may also use this code under the terms of the GPL v3 (see + * www.gnu.org/licenses). + * + * THE AAX SDK IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER + * EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE + * DISCLAIMED. + */ + +#ifndef AAXLibrary_AAX_IDescriptionHost_h +#define AAXLibrary_AAX_IDescriptionHost_h + +#include "AAX.h" + +class AAX_IFeatureInfo; + + +/** Interface to host services provided during plug-in description + */ +class AAX_IDescriptionHost +{ +public: + virtual ~AAX_IDescriptionHost() {} + +public: + /** Get the client's feature object for a given feature ID + + Similar to \c QueryInterface() but uses a feature identifier rather than a true IID + + Ownership of the returned object is passed to the caller; the caller is responsible for destroying the object, e.g. by + capturing the returned object in a smart pointer. + + \code + // AAX_IDescriptionHost* descHost + std::unique_ptr featureInfoPtr(descHost->AcquireFeatureProperties(someFeatureUID); + \endcode + + \return An \ref AAX_IFeatureInfo interface with access to the host's feature properties for this feature. + \return \c NULL if the desired feature was not found or if an error occurred + + \note May return an \ref AAX_IFeatureInfo object with limited method support, which would return an error such as + \ref AAX_ERROR_NULL_OBJECT or \ref AAX_ERROR_UNIMPLEMENTED to interface calls. + + \note If no \ref AAX_IFeatureInfo is provided then that may mean that the host is unaware of the feature, or it may mean + that the host is aware of the feature but has not implemented the %AAX feature support interface for this feature yet. + + \param[in] inFeatureID + Identifier of the requested feature + + */ + virtual const AAX_IFeatureInfo* AcquireFeatureProperties(const AAX_Feature_UID& inFeatureID) const = 0; +}; + +#endif diff --git a/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_IDisplayDelegate.h b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_IDisplayDelegate.h new file mode 100644 index 0000000000..676fd456bc --- /dev/null +++ b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_IDisplayDelegate.h @@ -0,0 +1,138 @@ +/*================================================================================================*/ +/* + * + * Copyright 2014-2015, 2023-2024 Avid Technology, Inc. + * All rights reserved. + * + * This file is part of the Avid AAX SDK. + * + * The AAX SDK is subject to commercial or open-source licensing. + * + * By using the AAX SDK, you agree to the terms of both the Avid AAX SDK License + * Agreement and Avid Privacy Policy. + * + * AAX SDK License: https://developer.avid.com/aax + * Privacy Policy: https://www.avid.com/legal/privacy-policy-statement + * + * Or: You may also use this code under the terms of the GPL v3 (see + * www.gnu.org/licenses). + * + * THE AAX SDK IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER + * EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE + * DISCLAIMED. + * + */ + +/** + * \file AAX_IDisplayDelegate.h + * + * \brief Defines the display behavior for a parameter + * + */ +/*================================================================================================*/ + + +#ifndef AAX_IDISPLAYDELETGATE_H +#define AAX_IDISPLAYDELETGATE_H + +#include "AAX.h" + + +//Forward declarations +class AAX_CString; + +/** \brief Defines the display behavior for a parameter. + + \details + This interface represents a delegate class to be used in conjunction with AAX_IParameter. + AAX_IParameter delegates all conversion operations between strings and real parameter + values to classes that meet this interface. You can think of AAX_ITaperDelegate subclasses + as simple string serialization routines that enable a specific string conversions for an + arbitrary parameter. + + For more information about how parameter delegates operate, see the AAX_ITaperDelegate and + \ref AAXLibraryFeatures_ParameterManager documentation. + + \note This class is \em not part of the %AAX ABI and must not be passed between the plug-in + and the host. + + \ingroup AAXLibraryFeatures_ParameterManager_DisplayDelegates + +*/ +class AAX_IDisplayDelegateBase +{ +public: + /** \brief Virtual destructor + * + * \note This destructor MUST be virtual to prevent memory leaks. + */ + virtual ~AAX_IDisplayDelegateBase() { } +}; + +/** Display delegate interface template + + \copydoc AAXLibraryFeatures_ParameterManager_DisplayDelegates + \ingroup AAXLibraryFeatures_ParameterManager_DisplayDelegates + */ +template +class AAX_IDisplayDelegate : public AAX_IDisplayDelegateBase +{ +public: + + /** \brief Constructs and returns a copy of the display delegate + * + * In general, this method's implementation can use a simple copy constructor: + + \code + template + AAX_CSubclassDisplayDelegate* AAX_CSubclassDisplayDelegate::Clone() const + { + return new AAX_CSubclassDisplayDelegate(*this); + } + \endcode + + */ + virtual AAX_IDisplayDelegate* Clone() const = 0; + + /** \brief Converts a real parameter value to a string representation + * + * \param[in] value + * The real parameter value that will be converted + * \param[out] valueString + * A string corresponding to value + * + * \retval true The string conversion was successful + * \retval false The string conversion was unsuccessful + */ + virtual bool ValueToString(T value, AAX_CString* valueString) const = 0; + + /** \brief Converts a real parameter value to a string representation using a size hint, useful for control surfaces and other character limited displays. + * + * \param[in] value + * The real parameter value that will be converted + * \param[in] maxNumChars + * Size hint for the desired maximum number of characters in the string (not including null termination) + * \param[out] valueString + * A string corresponding to value + * + * \retval true The string conversion was successful + * \retval false The string conversion was unsuccessful + */ + virtual bool ValueToString(T value, int32_t maxNumChars, AAX_CString* valueString) const = 0; + + /** \brief Converts a string to a real parameter value + * + * \param[in] valueString + * The string that will be converted + * \param[out] value + * The real parameter value corresponding to valueString + * + * \retval true The string conversion was successful + * \retval false The string conversion was unsuccessful + */ + virtual bool StringToValue(const AAX_CString& valueString, T* value) const = 0; +}; + + + +#endif //AAX_IDISPLAYDELETGATE_H diff --git a/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_IDisplayDelegateDecorator.h b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_IDisplayDelegateDecorator.h new file mode 100644 index 0000000000..e6ce61baaf --- /dev/null +++ b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_IDisplayDelegateDecorator.h @@ -0,0 +1,218 @@ +/*================================================================================================*/ +/* + * + * Copyright 2014-2017, 2019, 2023-2024 Avid Technology, Inc. + * All rights reserved. + * + * This file is part of the Avid AAX SDK. + * + * The AAX SDK is subject to commercial or open-source licensing. + * + * By using the AAX SDK, you agree to the terms of both the Avid AAX SDK License + * Agreement and Avid Privacy Policy. + * + * AAX SDK License: https://developer.avid.com/aax + * Privacy Policy: https://www.avid.com/legal/privacy-policy-statement + * + * Or: You may also use this code under the terms of the GPL v3 (see + * www.gnu.org/licenses). + * + * THE AAX SDK IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER + * EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE + * DISCLAIMED. + * + */ + +/** + * \file AAX_IDisplayDelegateDecorator.h + * + * \brief The base class for all concrete display delegate decorators + * + */ +/*================================================================================================*/ + + +#ifndef AAX_IDISPLAYDELEGATEDECORATOR_H +#define AAX_IDISPLAYDELEGATEDECORATOR_H + +#include "AAX_IDisplayDelegate.h" + + +/** \brief The base class for all concrete display delegate decorators + + @details + \ingroup AAXLibraryFeatures_ParameterManager_DisplayDelegates_Decorators + + \copydetails AAXLibraryFeatures_ParameterManager_DisplayDelegates_Decorators + + \note This class is \em not part of the %AAX ABI and must not be passed between the plug-in + and the host. + + */ +template +class AAX_IDisplayDelegateDecorator : public AAX_IDisplayDelegate +{ +public: + /** \brief Constructor + * + * This class implements the decorator pattern, which is a sort of wrapper. The object that + * is being wrapped is passed into this constructor. This object is passed by reference + * because it must be copied to prevent any potential memory ambigities. + * + * This constructor sets the local mWrappedDisplayDelegate member to a clone of the provided + * AAX_IDisplayDelegate. + * + * \param[in] displayDelegate + * The decorated display delegate. + */ + AAX_IDisplayDelegateDecorator(const AAX_IDisplayDelegate& displayDelegate); + + /** \brief Copy constructor + * + * This class implements the decorator pattern, which is a sort of wrapper. The object that + * is being wrapped is passed into this constructor. This object is passed by reference + * because it must be copied to prevent any potential memory ambigities. + * + * This constructor sets the local mWrappedDisplayDelegate member to a clone of the provided + * AAX_IDisplayDelegateDecorator, allowing multiply-decorated display delegates. + * + * \param[in] other + * The display delegate decorator that will be set as the wrapped delegate of this object + */ + AAX_IDisplayDelegateDecorator(const AAX_IDisplayDelegateDecorator& other); + + /** \brief Virtual destructor + * + * \note This destructor must be overriden here in order to delete the wrapped display delegate + * object upon decorator destruction. + */ + ~AAX_IDisplayDelegateDecorator() AAX_OVERRIDE; + + /** \brief Constructs and returns a copy of the display delegate decorator + * + * In general, this method's implementation can use a simple copy constructor: + + \code + template + AAX_CSubclassDisplayDelegate* AAX_CSubclassDisplayDelegate::Clone() const + { + return new AAX_CSubclassDisplayDelegate(*this); + } + \endcode + + * + * \note This is an idiomatic method in the decorator pattern, so watch for potential problems + * if this method is ever changed or removed. + * + */ + AAX_IDisplayDelegateDecorator* Clone() const AAX_OVERRIDE; + + /** \brief Converts a string to a real parameter value + * + * Override of the AAX_IDisplayDelegate implementation to call into the wrapped object. Display + * delegate decorators should call into this implementation to pass ValueToString() calls on + * to the wrapped object after applying their own value-to-string decoration. + * + * \param[in] valueString + * The string that will be converted + * \param[out] value + * The real parameter value corresponding to valueString + * + * \retval true The string conversion was successful + * \retval false The string conversion was unsuccessful + */ + bool ValueToString(T value, AAX_CString* valueString) const AAX_OVERRIDE; + + /** \brief Converts a string to a real parameter value with a size constraint. + * + * Override of the AAX_IDisplayDelegate implementation to call into the wrapped object. Display + * delegate decorators should call into this implementation to pass ValueToString() calls on + * to the wrapped object after applying their own value-to-string decoration. + * + * \param[in] valueString + * The string that will be converted + * \param[in] maxNumChars + * Size hint for the desired maximum number of characters in the string (not including null termination) + * \param[out] value + * The real parameter value corresponding to valueString + * + * \retval true The string conversion was successful + * \retval false The string conversion was unsuccessful + */ + bool ValueToString(T value, int32_t maxNumChars, AAX_CString* valueString) const AAX_OVERRIDE; + + /** \brief Converts a string to a real parameter value + * + * Override of the DisplayDecorator implementation to call into the wrapped object. Display + * delegate decorators should call into this implementation to pass StringToValue() calls on + * to the wrapped object after applying their own string-to-value decoding. + * + * \param[in] valueString + * The string that will be converted + * \param[out] value + * The real parameter value corresponding to valueString + * + * \retval true The string conversion was successful + * \retval false The string conversion was unsuccessful + */ + bool StringToValue(const AAX_CString& valueString, T* value) const AAX_OVERRIDE; + +private: + const AAX_IDisplayDelegate* mWrappedDisplayDelegate; + + /** Default constructor not allowed. */ + AAX_IDisplayDelegateDecorator() { } +}; + +template +AAX_IDisplayDelegateDecorator::AAX_IDisplayDelegateDecorator(const AAX_IDisplayDelegate& displayDelegate) : + AAX_IDisplayDelegate(), + mWrappedDisplayDelegate(displayDelegate.Clone()) +{ + +} + +template +AAX_IDisplayDelegateDecorator::AAX_IDisplayDelegateDecorator(const AAX_IDisplayDelegateDecorator& other) : + mWrappedDisplayDelegate(other.mWrappedDisplayDelegate->Clone()) +{ + +} + +template +AAX_IDisplayDelegateDecorator::~AAX_IDisplayDelegateDecorator() +{ + delete mWrappedDisplayDelegate; +} + +template +AAX_IDisplayDelegateDecorator* AAX_IDisplayDelegateDecorator::Clone() const +{ + return new AAX_IDisplayDelegateDecorator(*this); +} + +template +bool AAX_IDisplayDelegateDecorator::ValueToString(T value, AAX_CString* valueString) const +{ + return mWrappedDisplayDelegate->ValueToString(value, valueString); +} + +template +bool AAX_IDisplayDelegateDecorator::ValueToString(T value, int32_t maxNumChars, AAX_CString* valueString) const +{ + return mWrappedDisplayDelegate->ValueToString(value, maxNumChars, valueString); +} + +template +bool AAX_IDisplayDelegateDecorator::StringToValue(const AAX_CString& valueString, T* value) const +{ + return mWrappedDisplayDelegate->StringToValue(valueString, value); +} + + + + +#endif //AAX_IDISPLAYDELEGATEDECORATOR_H + + + diff --git a/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_IDma.h b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_IDma.h new file mode 100644 index 0000000000..62bf65593d --- /dev/null +++ b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_IDma.h @@ -0,0 +1,294 @@ +/*================================================================================================*/ +/* + * + * Copyright 2014-2015, 2023-2024 Avid Technology, Inc. + * All rights reserved. + * + * This file is part of the Avid AAX SDK. + * + * The AAX SDK is subject to commercial or open-source licensing. + * + * By using the AAX SDK, you agree to the terms of both the Avid AAX SDK License + * Agreement and Avid Privacy Policy. + * + * AAX SDK License: https://developer.avid.com/aax + * Privacy Policy: https://www.avid.com/legal/privacy-policy-statement + * + * Or: You may also use this code under the terms of the GPL v3 (see + * www.gnu.org/licenses). + * + * THE AAX SDK IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER + * EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE + * DISCLAIMED. + * + */ + +/** + * \file AAX_IDma.h + * + * \brief Cross-platform interface for access to the host's direct memory access (DMA) facilities + * + */ +/*================================================================================================*/ + + +#pragma once + +#ifndef AAX_IDMA_H +#define AAX_IDMA_H + +#include "AAX.h" + + +#ifndef AAX_DMA_API +# ifdef _MSC_VER +# define AAX_DMA_API __cdecl +# else +# define AAX_DMA_API +# endif +#endif // AAX_DMA_API + +/** + * \brief Cross-platform interface for access to the host's direct memory access (DMA) facilities + * + * \details + * \hostimp + * + * This interface is provided via a DMA port in the plug-in's algorithm context. + * + * \sa \ref AAX_IComponentDescriptor::AddDmaInstance() + * \sa \ref additionalFeatures_DMA + */ +class AAX_IDma +{ +public: + enum EState + { + eState_Error = -1, + eState_Init = 0, + eState_Running = 1, + eState_Complete = 2, + eState_Pending = 3 + }; + + // WARNING! These need to be kept in sync with the TI dMAX microcode EventType IDs! + /** @brief DMA mode IDs + + These IDs are used to bind DMA context fields to a particular DMA mode when + describing the fields with \ref AAX_IComponentDescriptor::AddDmaInstance() + */ + enum EMode + { + eMode_Error = -1, + + eMode_Burst = 6, ///< Burst mode (uncommon) + eMode_Gather = 10, ///< Gather mode + eMode_Scatter = 11, ///< Scatter mode + + }; + + +public: + virtual ~AAX_IDma() {} + + //////////////////////////////////////////////////////////////////////////////////////////// + /** @name Basic DMA operation + * + * + * + */ + //@{ + /** @brief Posts the transfer request to the DMA server + * + * @note Whichever mode this method is called on first will be the first mode to start + * transferring. Most plug-ins should therefore call this method for their Scatter + * DMA fields before their Gather DMA fields so that the scattered data is available + * as quickly as possible for future gathers. + * + * @returns \c AAX_SUCCESS on success + */ + virtual AAX_Result AAX_DMA_API PostRequest() = 0; + /** @brief Query whether a transfer has completed + * + * A return value of false indicates an error, and that the DMA missed its cycle + * count deadline + * + * @note This function should not be used for polling within a Process loop! + * Instead, it can be used as a test for DMA failure. This test is usually + * performed via a Debug-only assert. + * + * @todo Clarify return value meaning -- ambiguity in documentation + * + * @returns \b true if all pending transfers are complete + * @returns \b false if pending transfers are not complete + */ + virtual int32_t AAX_DMA_API IsTransferComplete() = 0; + /** @brief Sets the DMA State + * + * @note This method is part of the host interface and should not be used by plug-ins + * + * @returns \c AAX_SUCCESS on success + */ + virtual AAX_Result AAX_DMA_API SetDmaState( EState iState ) = 0; + /** @brief Inquire to find the state of the DMA instance. + */ + virtual EState AAX_DMA_API GetDmaState() const = 0; + /** @brief Inquire to find the mode of the DMA instance. + * + * This value does not change, so there is no setter. + */ + virtual EMode AAX_DMA_API GetDmaMode() const = 0; + //@} end Basic DMA operation + + + //////////////////////////////////////////////////////////////////////////////////////////// + /** @name Methods for Burst operation + * + * Use these methods in conjunction with \ref AAX_IDma::eMode_Burst + */ + //@{ + /** @brief Sets the address of the source buffer + * + * @param[in] iSrc + * Address of the location in the source buffer where + * the read transfer should begin + * + * @returns \c AAX_SUCCESS on success + */ + virtual AAX_Result AAX_DMA_API SetSrc( int8_t * iSrc ) = 0; + /** @brief Gets the address of the source buffer + */ + virtual int8_t * AAX_DMA_API GetSrc() = 0; + /** @brief Sets the address of the destination buffer + * + * @param[in] iDst + * Address of the location in the destination buffer where + * the write transfer should begin + * + * @returns \c AAX_SUCCESS on success + */ + virtual AAX_Result AAX_DMA_API SetDst( int8_t * iDst ) = 0; + /** @brief Gets the address of the destination buffer + */ + virtual int8_t * AAX_DMA_API GetDst() = 0; + + /** @brief Sets the length of each burst + * + * @note Burst length must be between 1 and 64 Bytes, inclusive + * @note 64-Byte transfers are recommended for the fastest overall transfer speed + * + * @returns \c AAX_SUCCESS on success + */ + virtual AAX_Result AAX_DMA_API SetBurstLength( int32_t iBurstLengthBytes ) = 0; + /** @brief Gets the length of each burst + */ + virtual int32_t AAX_DMA_API GetBurstLength() = 0; + /** @brief Sets the number of bursts to perform before giving up priority to other DMA transfers. + * + * Valid values are 1, 2, 4, or 16. + * + * The full transmission may be broken up into several series of bursts, and thus the total size + * of the data being transferred is not bounded by the number of bursts times the burst length. + * + * @param[in] iNumBursts + * The number of bursts + * + * @returns \c AAX_SUCCESS on success + */ + virtual AAX_Result AAX_DMA_API SetNumBursts( int32_t iNumBursts ) = 0; + /** @brief Gets the number of bursts to perform before giving up priority to other DMA transfers + */ + virtual int32_t AAX_DMA_API GetNumBursts() = 0; + /** @brief Sets the size of the whole transfer + * + * @param[in] iTransferSizeBytes + * The transfer size, in Bytes + * + * @returns \c AAX_SUCCESS on success + */ + virtual AAX_Result AAX_DMA_API SetTransferSize( int32_t iTransferSizeBytes ) = 0; + /** @brief Gets the size of the whole transfer, in Bytes + */ + virtual int32_t AAX_DMA_API GetTransferSize() = 0; + //@} end Methods for Burst operation + + + //////////////////////////////////////////////////////////////////////////////////////////// + /** @name Methods for Scatter and Gather operation + * + * Use these methods in conjunction with \ref AAX_IDma::eMode_Scatter and + * \ref AAX_IDma::eMode_Gather + */ + //@{ + /** @brief Sets the address of the FIFO buffer for the DMA transfer (usually the external memory block) + * + * @returns \c AAX_SUCCESS on success + */ + virtual AAX_Result AAX_DMA_API SetFifoBuffer( int8_t * iFifoBase ) = 0; + /** @brief Gets the address of the FIFO buffer for the DMA transfer + */ + virtual int8_t * AAX_DMA_API GetFifoBuffer() = 0; + /** @brief Sets the address of the linear buffer for the DMA transfer (usually the internal memory block) + * + * @returns \c AAX_SUCCESS on success + */ + virtual AAX_Result AAX_DMA_API SetLinearBuffer( int8_t * iLinearBase ) = 0; + /** @brief Gets the address of the linear buffer for the DMA transfer + */ + virtual int8_t * AAX_DMA_API GetLinearBuffer() = 0; + /** @brief Sets the offset table for the DMA transfer + * + * The offset table provides a list of Byte-aligned memory offsets into the FIFO + * buffer. The transfer will be broken into a series of individual bursts, each + * beginning at the specified offset locations within the FIFO buffer. The size + * of each burst is set by \ref AAX_IDma::SetBurstLength "SetBurstLength()". + * + * @sa AAX_IDma::SetNumOffsets() + * @sa AAX_IDma::SetBaseOffset() + * + * @returns \c AAX_SUCCESS on success + */ + virtual AAX_Result AAX_DMA_API SetOffsetTable( const int32_t * iOffsetTable ) = 0; + /** @brief Gets the offset table for the DMA transfer + */ + virtual const int32_t * AAX_DMA_API GetOffsetTable() = 0; + /** @brief Sets the number of offets in the offset table + * + * @sa AAX_IDma::SetOffsetTable() + * + * @returns \c AAX_SUCCESS on success + */ + virtual AAX_Result AAX_DMA_API SetNumOffsets( int32_t iNumOffsets ) = 0; + /** @brief Gets the number of offets in the offset table + */ + virtual int32_t AAX_DMA_API GetNumOffsets() = 0; + /** @brief Sets the relative base offset into the FIFO where transfers will begin + * + * The base offset will be added to each value in the offset table in order to determine + * the starting offset within the FIFO buffer for each burst. + * + * @sa AAX_IDma::SetOffsetTable() + * + * @returns \c AAX_SUCCESS on success + */ + virtual AAX_Result AAX_DMA_API SetBaseOffset( int32_t iBaseOffsetBytes ) = 0; + /** @brief Gets the relative base offset into the FIFO where transfers will begin + */ + virtual int32_t AAX_DMA_API GetBaseOffset() = 0; + /** @brief Sets the size of the FIFO buffer, in bytes + * + * @note The FIFO buffer must be padded with at least enough memory to accommodate + * one burst, as defined by \ref AAX_IDma::SetBurstLength "SetBurstLength()". + * + * @returns \c AAX_SUCCESS on success + */ + virtual AAX_Result AAX_DMA_API SetFifoSize( int32_t iSizeBytes ) = 0; + /** @brief Gets the size of the FIFO buffer, in bytes + */ + virtual int32_t AAX_DMA_API GetFifoSize() = 0; + //@} end Methods for Scatter and Gather operation +}; + + + +#endif // AAX_IDMA_H diff --git a/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_IEffectDescriptor.h b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_IEffectDescriptor.h new file mode 100644 index 0000000000..6633c3dbe8 --- /dev/null +++ b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_IEffectDescriptor.h @@ -0,0 +1,168 @@ +/*================================================================================================*/ +/* + * + * Copyright 2013-2017, 2023-2024 Avid Technology, Inc. + * All rights reserved. + * + * This file is part of the Avid AAX SDK. + * + * The AAX SDK is subject to commercial or open-source licensing. + * + * By using the AAX SDK, you agree to the terms of both the Avid AAX SDK License + * Agreement and Avid Privacy Policy. + * + * AAX SDK License: https://developer.avid.com/aax + * Privacy Policy: https://www.avid.com/legal/privacy-policy-statement + * + * Or: You may also use this code under the terms of the GPL v3 (see + * www.gnu.org/licenses). + * + * THE AAX SDK IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER + * EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE + * DISCLAIMED. + * + */ + +/** + * \file AAX_IEffectDescriptor.h + * + * \brief Description interface for an effect's (plug-in type's) components + * + */ +/*================================================================================================*/ + + +#ifndef AAX_IEFFECTDESCRIPTOR_H +#define AAX_IEFFECTDESCRIPTOR_H + +#include "AAX.h" +#include "AAX_Callbacks.h" + +class AAX_IComponentDescriptor; +class AAX_IPropertyMap; + +/** + \brief Description interface for an effect's (plug-in type's) components + + \details + \hostimp + + Each Effect represents a different "type" of plug-in. The host will present different + Effects to the user as separate products, even if they are derived from the same + \ref AAX_ICollection description. + + \sa \ref AAX_ICollection::AddEffect() + + \ingroup CommonInterface_Describe + + */ +class AAX_IEffectDescriptor +{ +public: + virtual ~AAX_IEffectDescriptor() {} + /** @brief Create an instance of a component descriptor. + + */ + virtual AAX_IComponentDescriptor * NewComponentDescriptor () = 0; + /** @brief Add a component to an instance of a component descriptor. + + Unlike with \ref AAX_ICollection::AddEffect(), the \ref AAX_IEffectDescriptor does + not take ownership of the \ref AAX_IComponentDescriptor that is passed to it in this + method. The host copies out the contents of this descriptor, and thus the plug-in may + re-use the same descriptor object when creating additional similar components. + + @param[in] inComponentDescriptor + + */ + virtual AAX_Result AddComponent ( AAX_IComponentDescriptor* inComponentDescriptor ) = 0; + /** @brief Add a name to the Effect. + + May be called multiple times to add abbreviated Effect names. + + \note Every Effect must include at least one name variant with 31 + or fewer characters, plus a null terminating character + + @param[in] inPlugInName + The name assigned to the plug-in. + */ + virtual AAX_Result AddName ( const char *inPlugInName ) = 0; + /** @brief Add a category to your plug-in. See \ref AAX_EPlugInCategory. + + @param[in] inCategory + One of the categories for the plug-in. + + */ + virtual AAX_Result AddCategory ( uint32_t inCategory ) = 0; + /** @brief Add a category to your plug-in. See \ref AAX_EPlugInCategory. + + @param[in] inCategory + One of the categories for the plug-in. + @param[in] inParamID + The parameter ID of the parameter used to bypass the category seciont of the plug-in. + + */ + virtual AAX_Result AddCategoryBypassParameter ( uint32_t inCategory, AAX_CParamID inParamID ) = 0; + /** @brief Add a process pointer. + + @param[in] inProcPtr + A process pointer. + @param[in] inProcID + A process ID. + + */ + virtual AAX_Result AddProcPtr ( void * inProcPtr, AAX_CProcPtrID inProcID ) = 0; + /** @brief Create a new property map + + + */ + virtual AAX_IPropertyMap * NewPropertyMap () = 0; + /** @brief Set the properties of a new property map. + + @param[in] inProperties + Description + + + */ + virtual AAX_Result SetProperties ( AAX_IPropertyMap * inProperties ) = 0; + /** @brief Set resource file info. + + @param[in] inResourceType + See AAX_EResourceType. + @param[in] inInfo + Definition varies on the resource type. + + */ + virtual AAX_Result AddResourceInfo ( AAX_EResourceType inResourceType, const char * inInfo ) = 0; + /** @brief Add name and property map to meter with given ID. + + @param[in] inMeterID + The ID of the meter being described. + @param[in] inMeterName + The name of the meter. + @param[in] inProperties + The property map containing meter related data such as meter type, orientation, etc. + + */ + virtual AAX_Result AddMeterDescription( AAX_CTypeID inMeterID, const char * inMeterName, AAX_IPropertyMap * inProperties ) = 0; + /** @brief Add a control MIDI node to the plug-in data model. + + - This MIDI node may receive note data as well as control data. + - To send MIDI data to the plug-in's algorithm, use + \ref AAX_IComponentDescriptor::AddMIDINode(). + + \sa \ref AAX_IACFEffectParameters_V2::UpdateControlMIDINodes() + + @param[in] inNodeID + The ID for the new control MIDI node. + @param[in] inNodeType + The type of the node. + @param[in] inNodeName + The name of the node. + @param[in] inChannelMask + The bit mask for required nodes channels (up to 16) or required global events for global node. + */ + virtual AAX_Result AddControlMIDINode ( AAX_CTypeID inNodeID, AAX_EMIDINodeType inNodeType, const char inNodeName[], uint32_t inChannelMask ) = 0; + +}; + +#endif // AAX_IEFFECTDESCRIPTOR_H diff --git a/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_IEffectDirectData.h b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_IEffectDirectData.h new file mode 100644 index 0000000000..8398c72839 --- /dev/null +++ b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_IEffectDirectData.h @@ -0,0 +1,75 @@ +/*================================================================================================*/ +/* + * + * Copyright 2014-2017, 2019-2021, 2023-2024 Avid Technology, Inc. + * All rights reserved. + * + * This file is part of the Avid AAX SDK. + * + * The AAX SDK is subject to commercial or open-source licensing. + * + * By using the AAX SDK, you agree to the terms of both the Avid AAX SDK License + * Agreement and Avid Privacy Policy. + * + * AAX SDK License: https://developer.avid.com/aax + * Privacy Policy: https://www.avid.com/legal/privacy-policy-statement + * + * Or: You may also use this code under the terms of the GPL v3 (see + * www.gnu.org/licenses). + * + * THE AAX SDK IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER + * EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE + * DISCLAIMED. + * + */ + +/** + * \file AAX_IEffectDirectData.h + * + * \brief Optional interface for direct access to alg memory + * + */ +/*================================================================================================*/ + + +#ifndef AAX_IEFFECTDIRECTDATA_H +#define AAX_IEFFECTDIRECTDATA_H + +#include "AAX_IACFEffectDirectData.h" +#include "AAX.h" +#include "CACFUnknown.h" + + +/** @brief The interface for a %AAX Plug-in's direct data interface. + + @details + @pluginimp + + This is the interface for an instance of a plug-in's direct data interface that + gets exposed to the host application. A plug-in needs to inherit from this interface + and override all of the virtual functions to support direct data access functionality. + + Direct data access allows a plug-in to directly manipulate the data in its algorithm's + private data blocks. The callback methods in this interface provide a safe context + from which this kind of access may be attempted. + + \note This class always inherits from the latest version of the interface and thus requires any + subclass to implement all the methods in the latest version of the interface. + + \note See AAX_IACFEffectDirectData for further information. + + \ingroup AuxInterface_DirectData +*/ +class AAX_IEffectDirectData : public AAX_IACFEffectDirectData_V2, + public CACFUnknown +{ +public: + ACF_DECLARE_STANDARD_UNKNOWN() + + ACFMETHOD(InternalQueryInterface)(const acfIID & riid, void **ppvObjOut) override; + + // CACFUnknown does not support operator=() + AAX_DELETE(AAX_IEffectDirectData& operator= (const AAX_IEffectDirectData&)); +}; + +#endif //AAX_IEFFECTDIRECTDATA_H diff --git a/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_IEffectGUI.h b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_IEffectGUI.h new file mode 100644 index 0000000000..fdfe667a17 --- /dev/null +++ b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_IEffectGUI.h @@ -0,0 +1,75 @@ +/*================================================================================================*/ +/* + * + * Copyright 2014-2017, 2019-2021, 2023-2024 Avid Technology, Inc. + * All rights reserved. + * + * This file is part of the Avid AAX SDK. + * + * The AAX SDK is subject to commercial or open-source licensing. + * + * By using the AAX SDK, you agree to the terms of both the Avid AAX SDK License + * Agreement and Avid Privacy Policy. + * + * AAX SDK License: https://developer.avid.com/aax + * Privacy Policy: https://www.avid.com/legal/privacy-policy-statement + * + * Or: You may also use this code under the terms of the GPL v3 (see + * www.gnu.org/licenses). + * + * THE AAX SDK IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER + * EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE + * DISCLAIMED. + * + */ + +/** + * \file AAX_IEffectGUI.h + * + * \brief The interface for a %AAX Plug-in's user interface + * + */ +/*================================================================================================*/ + + +#ifndef AAX_IEFFECTGUI_H +#define AAX_IEFFECTGUI_H + +#include "AAX_IACFEffectGUI.h" +#include "AAX.h" +#include "CACFUnknown.h" + + +/** @brief The interface for a %AAX Plug-in's user interface. + + @details + @pluginimp + + This is the interface for an instance of a plug-in's GUI that gets exposed to + the host application. You need to inherit from this interface and override all + of the virtual functions to create a plug-in GUI. + + To create the GUI for an %AAX plug-in it is required that you inherit from + this interface and override all of the virtual functions from + \ref AAX_IACFEffectGUI. In nearly all cases you will be able to take advantage of + the implementations in the %AAX library's \ref AAX_CEffectGUI class and only override the + few specific methods that you want to explicitly customize. + + \note This class always inherits from the latest version of the interface and thus requires any + subclass to implement all the methods in the latest version of the interface. + + \ingroup CommonInterface_GUI +*/ +class AAX_IEffectGUI : public AAX_IACFEffectGUI, + public CACFUnknown +{ +public: + ACF_DECLARE_STANDARD_UNKNOWN() + + ACFMETHOD(InternalQueryInterface)(const acfIID & riid, void **ppvObjOut) override; + + // CACFUnknown does not support operator=() + AAX_DELETE(AAX_IEffectGUI& operator= (const AAX_IEffectGUI&)); +}; + +#endif //AAX_IEFFECTGUI_H diff --git a/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_IEffectParameters.h b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_IEffectParameters.h new file mode 100644 index 0000000000..e9cb00bc0c --- /dev/null +++ b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_IEffectParameters.h @@ -0,0 +1,103 @@ +/*================================================================================================*/ +/* + * + * Copyright 2013-2017, 2019-2021, 2023-2024 Avid Technology, Inc. + * All rights reserved. + * + * This file is part of the Avid AAX SDK. + * + * The AAX SDK is subject to commercial or open-source licensing. + * + * By using the AAX SDK, you agree to the terms of both the Avid AAX SDK License + * Agreement and Avid Privacy Policy. + * + * AAX SDK License: https://developer.avid.com/aax + * Privacy Policy: https://www.avid.com/legal/privacy-policy-statement + * + * Or: You may also use this code under the terms of the GPL v3 (see + * www.gnu.org/licenses). + * + * THE AAX SDK IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER + * EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE + * DISCLAIMED. + * + */ + +/** + * \file AAX_IEffectParameters.h + * + * \brief The interface for an %AAX Plug-in's data model + * + */ +/*================================================================================================*/ + + +#ifndef AAX_IEFFECTPARAMETERS_H +#define AAX_IEFFECTPARAMETERS_H + +#include "AAX_IACFEffectParameters.h" +#include "AAX.h" +#include "CACFUnknown.h" + +/** @brief The interface for an %AAX Plug-in's data model. + + @details + @pluginimp + + The interface for an instance of a plug-in's data model. A plug-in's implementation + of this interface is responsible for creating the plug-in's set of parameters and + for defining how the plug-in will respond when these parameters are changed via + control updates or preset loads. In order for information to be routed from the + plug-in's data model to its algorithm, the parameters that are created here must be + registered with the host in the plug-in's + \ref CommonInterface_Describe "Description callback". + + At \ref AAX_IACFEffectParameters::Initialize() "initialization", the host provides + this interface with a reference to AAX_IController, which provides access from the + data model back to the host. This reference provides a means of querying information + from the host such as stem format or sample rate, and is also responsible for + communication between the data model and the plug-in's (decoupled) algorithm. See + \ref CommonInterface_Algorithm. + + You will most likely inherit your implementation of this interface from + \ref AAX_CEffectParameters, a default implementation that provides basic data model + functionality such as adding custom parameters, setting control values, restoring + state, generating coefficients, etc., which you can override and customize as + needed. + + The following tags appear in the descriptions for methods of this class and its + derived classes: + \li \c CALL: Components in the plug-in should call this method to get / set + data in the data model. + + \note + \li This class always inherits from the latest version of the interface and thus + requires any subclass to implement all the methods in the latest version of the + interface. The current version of \ref AAX_CEffectParameters provides a convenient + default implementation for all methods in the latest interface. + \li Except where noted otherwise, the parameter values referenced by the methods in + this interface are normalized values. See \ref AAXLibraryFeatures_ParameterManager + for more information. + + \legacy In the legacy plug-in SDK, these methods were found in CProcess and + \c CEffectProcess. For additional \c CProcess methods, see \ref AAX_IEffectGUI. + + \section AAX_IEffectParameters_relclass Related classes + \dotfile aax_ieffectparams_related.dot "Classes related to AAX_IEffectParameters by inheritance or composition" + \dotfile aax_ieffectparams_contained.dot "Classes owned as member objects of AAX_CEffectParameters" + + \ingroup CommonInterface_DataModel +*/ +class AAX_IEffectParameters : public AAX_IACFEffectParameters_V4 + , public CACFUnknown +{ +public: + ACF_DECLARE_STANDARD_UNKNOWN() + + ACFMETHOD(InternalQueryInterface)(const acfIID & riid, void **ppvObjOut) override; + + // CACFUnknown does not support operator=() + AAX_DELETE(AAX_IEffectParameters& operator= (const AAX_IEffectParameters&)); +}; + +#endif // AAX_IEFFECTPARAMETERS_H diff --git a/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_IFeatureInfo.h b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_IFeatureInfo.h new file mode 100644 index 0000000000..e164be543d --- /dev/null +++ b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_IFeatureInfo.h @@ -0,0 +1,74 @@ +/*================================================================================================*/ +/* + * Copyright 2016-2017, 2023-2024 Avid Technology, Inc. + * All rights reserved. + * + * This file is part of the Avid AAX SDK. + * + * The AAX SDK is subject to commercial or open-source licensing. + * + * By using the AAX SDK, you agree to the terms of both the Avid AAX SDK License + * Agreement and Avid Privacy Policy. + * + * AAX SDK License: https://developer.avid.com/aax + * Privacy Policy: https://www.avid.com/legal/privacy-policy-statement + * + * Or: You may also use this code under the terms of the GPL v3 (see + * www.gnu.org/licenses). + * + * THE AAX SDK IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER + * EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE + * DISCLAIMED. + */ + +#ifndef AAXLibrary_AAX_IFeatureInfo_h +#define AAXLibrary_AAX_IFeatureInfo_h + +#include "AAX.h" + + +class AAX_IPropertyMap; + + +class AAX_IFeatureInfo +{ +public: + virtual ~AAX_IFeatureInfo() {} + +public: // AAX_IACFFeatureInfo + /** Determine the level of support for this feature by the host + + \note The host will not provide an underlying \ref AAX_IACFFeatureInfo interface for features which it does not + recognize at all, resulting in a \ref AAX_ERROR_NULL_OBJECT error code + */ + virtual AAX_Result SupportLevel(AAX_ESupportLevel& oSupportLevel) const = 0; + + /** Additional properties providing details of the feature support + + See the feature's UID for documentation of which features provide additional properties + + Ownership of the returned object is passed to the caller; the caller is responsible for destroying the object, e.g. by + capturing the returned object in a smart pointer. + + \code + // AAX_IFeatureInfo* featureInfo + std::unique_ptr featurePropertiesPtr(featureInfo->AcquireProperties(); + \endcode + + \return An \ref AAX_IPropertyMap interface with access to the host's properties for this feature. + \return \c NULL if the desired feature was not found or if an error occurred + + \note May return an \ref AAX_IPropertyMap object with limited method support, which would return an error such as + \ref AAX_ERROR_NULL_OBJECT or \ref AAX_ERROR_UNIMPLEMENTED to interface calls. + + */ + virtual const AAX_IPropertyMap* AcquireProperties() const = 0; + +public: // AAX_IFeatureInfo + /** Returns the ID of the feature which this object represents + */ + virtual const AAX_Feature_UID& ID() const = 0; +}; + + +#endif diff --git a/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_IHostProcessor.h b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_IHostProcessor.h new file mode 100644 index 0000000000..1d022f9bfe --- /dev/null +++ b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_IHostProcessor.h @@ -0,0 +1,65 @@ +/*================================================================================================*/ +/* + * + * Copyright 2013-2017, 2019-2021, 2023-2024 Avid Technology, Inc. + * All rights reserved. + * + * This file is part of the Avid AAX SDK. + * + * The AAX SDK is subject to commercial or open-source licensing. + * + * By using the AAX SDK, you agree to the terms of both the Avid AAX SDK License + * Agreement and Avid Privacy Policy. + * + * AAX SDK License: https://developer.avid.com/aax + * Privacy Policy: https://www.avid.com/legal/privacy-policy-statement + * + * Or: You may also use this code under the terms of the GPL v3 (see + * www.gnu.org/licenses). + * + * THE AAX SDK IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER + * EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE + * DISCLAIMED. + * + */ + +/** + * \file AAX_IHostProcessor.h + * + * \brief Base class for the host processor interface which is extended by plugin code + * + */ +/*================================================================================================*/ + + +#ifndef AAX_IHOSTPROCESSOR_H +#define AAX_IHOSTPROCESSOR_H + +#include "AAX_IACFHostProcessor.h" +#include "AAX.h" +#include "CACFUnknown.h" + +/*! \brief Base class for the host processor interface + + \details + \pluginimp + + \note This class always inherits from the latest version of the interface and thus requires any + subclass to implement all the methods in the latest version of the interface. Most plug-ins + will inherit from the AAX_CHostProcessor convenience class. + + \ingroup AuxInterface_HostProcessor +*/ +class AAX_IHostProcessor : public AAX_IACFHostProcessor_V2, + public CACFUnknown +{ +public: + ACF_DECLARE_STANDARD_UNKNOWN() + + ACFMETHOD(InternalQueryInterface)(const acfIID & riid, void **ppvObjOut) override; + + // CACFUnknown does not support operator=() + AAX_DELETE(AAX_IHostProcessor& operator= (const AAX_IHostProcessor&)); +}; + +#endif //AAX_IHOSTPROCESSOR_H diff --git a/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_IHostProcessorDelegate.h b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_IHostProcessorDelegate.h new file mode 100644 index 0000000000..ed4454aa96 --- /dev/null +++ b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_IHostProcessorDelegate.h @@ -0,0 +1,105 @@ +/*================================================================================================*/ +/* + * + * Copyright 2014-2017, 2023-2024 Avid Technology, Inc. + * All rights reserved. + * + * This file is part of the Avid AAX SDK. + * + * The AAX SDK is subject to commercial or open-source licensing. + * + * By using the AAX SDK, you agree to the terms of both the Avid AAX SDK License + * Agreement and Avid Privacy Policy. + * + * AAX SDK License: https://developer.avid.com/aax + * Privacy Policy: https://www.avid.com/legal/privacy-policy-statement + * + * Or: You may also use this code under the terms of the GPL v3 (see + * www.gnu.org/licenses). + * + * THE AAX SDK IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER + * EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE + * DISCLAIMED. + * + */ + +/** + * \file AAX_IHostProcessorDelegate.h + * + * \brief Interface allowing plug-in's HostProcessor to interact with the host's side + */ +/*================================================================================================*/ + + +#ifndef AAX_IHOSTPROCESSORDELEGATE_H +#define AAX_IHOSTPROCESSORDELEGATE_H + +#include "AAX.h" + +/*! @brief Versioned interface for host methods specific to offline processing + + \details + \hostimp + + The host provides a host processor delegate to a plug-in's \ref AAX_IHostProcessor "host processor" object at initialization. + The host processor object may make calls to this object to get information about the current render pass or to affect the + plug-in's offline processing behavior. + + \ingroup AuxInterface_HostProcessor +*/ +class AAX_IHostProcessorDelegate +{ +public: + + virtual ~AAX_IHostProcessorDelegate() {} + + /*! + * \brief CALL: Randomly access audio from the timeline + * + * Called from within \ref AAX_IHostProcessor::RenderAudio(), this method fills a buffer of samples with randomly-accessed + * data from the current input processing region on the timeline, including any extra samples such as processing "handles". + * + * \note Plug-ins that use this feature must set \ref AAX_eProperty_UsesRandomAccess to \c true + * \note It is not possible to retrieve samples from outside of the current input processing region + * \note Always check the return value of this method before using the randomly-accessed samples + * + * \param[in] inAudioIns + * Timeline audio buffer(s). This must be set to \c inAudioIns from \ref AAX_IHostProcessor::RenderAudio() + * \internal See PTSW-183848: \ref AAX_IHostProcessorDelegate::GetAudio() ignores input audio buffer parameter \endinternal + * \param[in] inAudioInCount + * Number of buffers in \c inAudioIns. This must be set to \c inAudioInCount from \ref AAX_IHostProcessor::RenderAudio() + * \internal See PTSW-183848: \ref AAX_IHostProcessorDelegate::GetAudio() ignores input audio buffer parameter \endinternal + * \param[in] inLocation + * A sample location relative to the beginning of the currently processed region, e.g. a value of 0 corresponds to the + * timeline location returned by \ref AAX_CHostProcessor::GetSrcStart() + * \param[in,out] ioNumSamples + * \li Input: The maximum number of samples to read. + * \li Output: The actual number of samples that were read from the timeline + */ + virtual AAX_Result GetAudio ( const float * const inAudioIns [], int32_t inAudioInCount, int64_t inLocation, int32_t * ioNumSamples ) = 0; + /*! \brief CALL: Returns the index of the side chain input buffer + * + * Called from within \ref AAX_IHostProcessor::RenderAudio(), this method returns the index of the side chain input sample + * buffer within \c inAudioIns. + * + */ + virtual int32_t GetSideChainInputNum () = 0; + /*! + * \brief CALL: Request an analysis pass + * + * Call this method to request an analysis pass from within the plug-in. Most plug-ins should rely on the host to trigger + * analysis passes when appropriate. However, plug-ins that require an analysis pass a) outside of the context of + * host-driven render or analysis, or b) when internal plug-in data changes may need to call \c ForceAnalyze(). + */ + virtual AAX_Result ForceAnalyze () = 0; + /*! + * \brief CALL: Request a process pass + * + * Call this method to request a process pass from within the plug-in. If \ref AAX_eProperty_RequiresAnalysis is defined, + * the resulting process pass will be preceded by an analysis pass. This method should only be used in rare circumstances + * by plug-ins that must launch processing outside of the normal host AudioSuite workflow. + */ + virtual AAX_Result ForceProcess () = 0; +}; + +#endif // #ifndef _AAX_IPLUGIN_H_ diff --git a/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_IHostServices.h b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_IHostServices.h new file mode 100644 index 0000000000..03b85959d7 --- /dev/null +++ b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_IHostServices.h @@ -0,0 +1,100 @@ +/*================================================================================================*/ +/* + * + * Copyright 2014-2015, 2018, 2023-2024 Avid Technology, Inc. + * All rights reserved. + * + * This file is part of the Avid AAX SDK. + * + * The AAX SDK is subject to commercial or open-source licensing. + * + * By using the AAX SDK, you agree to the terms of both the Avid AAX SDK License + * Agreement and Avid Privacy Policy. + * + * AAX SDK License: https://developer.avid.com/aax + * Privacy Policy: https://www.avid.com/legal/privacy-policy-statement + * + * Or: You may also use this code under the terms of the GPL v3 (see + * www.gnu.org/licenses). + * + * THE AAX SDK IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER + * EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE + * DISCLAIMED. + * + */ + +/** + * \file AAX_IHostServices.h + * + * \brief Various host services + * + */ +/*================================================================================================*/ + + +#ifndef AAX_IHOSTSERVICES_H +#define AAX_IHOSTSERVICES_H + +#include "AAX.h" + +/** \brief Interface to diagnostic and debugging services provided by the %AAX host + + \details + \hostimp + + \sa \ref AAX_IACFHostServices +*/ +class AAX_IHostServices +{ +public: + + virtual ~AAX_IHostServices() {} + + /** \brief Handle an assertion failure + + \details + Use this method to delegate assertion failure handling to the host + + Use \p inFlags to request that specific behavior be included when handling the + failure. This request may not be fulfilled by the host, and absence of a flag + does not preclude the host from using that behavior when handling the failure. + + \param[in] iFile + The name of the file containing the assert check. Usually \c __FILE__ + \param[in] iLine + The line number of the assert check. Usually \c __LINE__ + \param[in] iNote + Text to display related to the assert. Usually the condition which failed + \param[in] iFlags + Bitfield of \ref AAX_EAssertFlags to request specific handling behavior + */ + virtual AAX_Result HandleAssertFailure ( const char * iFile, int32_t iLine, const char * iNote, /* AAX_EAssertFlags */ int32_t iFlags ) const = 0; + /** \brief Log a trace message + + \param[in] iPriority + Priority of the trace, used for log filtering. One of \ref kAAX_Trace_Priority_Low, \ref kAAX_Trace_Priority_Normal, \ref kAAX_Trace_Priority_High + \param[in] iMessage + Message string to log + */ + virtual AAX_Result Trace ( int32_t iPriority, const char * iMessage ) const = 0; + /** \brief Log a trace message or a stack trace + + If the logging output filtering is set to include logs with + \p iStackTracePriority then both the logging message and a stack trace will + be emitted, regardless of \p iTracePriority. + + If the logging output filtering is set to include logs with \p iTracePriority + but to exclude logs with \p iStackTracePriority then this will emit a normal + log with no stack trace. + + \param[in] iTracePriority + Priority of the trace, used for log filtering. One of \ref kAAX_Trace_Priority_Low, \ref kAAX_Trace_Priority_Normal, \ref kAAX_Trace_Priority_High + \param[in] iStackTracePriority + Priority of the stack trace, used for log filtering. One of \ref kAAX_Trace_Priority_Low, \ref kAAX_Trace_Priority_Normal, \ref kAAX_Trace_Priority_High + \param[in] iMessage + Message string to log + */ + virtual AAX_Result StackTrace ( int32_t iTracePriority, int32_t iStackTracePriority, const char * iMessage ) const = 0; +}; + +#endif // #ifndef AAX_IHOSTSERVICES_H diff --git a/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_IMIDINode.h b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_IMIDINode.h new file mode 100644 index 0000000000..89ab59cc33 --- /dev/null +++ b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_IMIDINode.h @@ -0,0 +1,93 @@ +/*================================================================================================*/ +/* + * Copyright 2014-2017, 2023-2024 Avid Technology, Inc. + * All rights reserved. + * + * This file is part of the Avid AAX SDK. + * + * The AAX SDK is subject to commercial or open-source licensing. + * + * By using the AAX SDK, you agree to the terms of both the Avid AAX SDK License + * Agreement and Avid Privacy Policy. + * + * AAX SDK License: https://developer.avid.com/aax + * Privacy Policy: https://www.avid.com/legal/privacy-policy-statement + * + * Or: You may also use this code under the terms of the GPL v3 (see + * www.gnu.org/licenses). + * + * THE AAX SDK IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER + * EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE + * DISCLAIMED. + * + */ + +/** + * \file AAX_IMIDINode.h + * + * \brief Declaration of the base MIDI Node interface. + * + * \author by Andriy Goshko + */ +/*================================================================================================*/ +/// @cond ignore +#pragma once +#ifndef AAX_IMIDINODE_H +#define AAX_IMIDINODE_H +/// @endcond + +#include "AAX.h" +#include "AAX_ITransport.h" + +/** \brief Interface for accessing information in a MIDI node + * + * \details + * \hostimp + * + * \sa AAX_IComponentDescriptor::AddMIDINode + */ +class AAX_IMIDINode +{ +public: + virtual ~AAX_IMIDINode() {} + + /** \brief Returns a MIDI stream data structure + * + * + */ + virtual AAX_CMidiStream* GetNodeBuffer () = 0; + + /** \brief Posts an \ref AAX_CMidiPacket to an output MIDI node + * + * \compatibility Pro Tools supports the following MIDI events from plug-ins: + * - NoteOn + * - NoteOff + * - Pitch bend + * - Polyphonic key pressure + * - Bank select (controller #0) + * - Program change (no bank) + * - Channel pressure + * + * + * \param[in] packet + * The MIDI packet to be pushed to a MIDI output node + */ + virtual AAX_Result PostMIDIPacket (AAX_CMidiPacket *packet) = 0; + + /** \brief Returns a transport object + * + * \warning The returned interface is not versioned. Calling a method on this interface + * that is not supported by the host will result in undefined behavior, usually a crash. + * You must either check the host version before using this interface or limit the use + * of this interface to \ref AAX_IACFTransport "V1 Transport interface" methods. + * + * Wherever possible, use a versioned Transport object such as the one created in + * \ref AAX_CEffectParameters::Initialize() rather than this unversioned interface. + */ + virtual AAX_ITransport* GetTransport () = 0; +}; + + +/// @cond ignore +#endif // AAX_IMIDINODE_H +/// @endcond diff --git a/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_IPageTable.h b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_IPageTable.h new file mode 100644 index 0000000000..1c07998e50 --- /dev/null +++ b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_IPageTable.h @@ -0,0 +1,309 @@ +/*================================================================================================*/ +/* + * Copyright 2016-2017, 2023-2024 Avid Technology, Inc. + * All rights reserved. + * + * This file is part of the Avid AAX SDK. + * + * The AAX SDK is subject to commercial or open-source licensing. + * + * By using the AAX SDK, you agree to the terms of both the Avid AAX SDK License + * Agreement and Avid Privacy Policy. + * + * AAX SDK License: https://developer.avid.com/aax + * Privacy Policy: https://www.avid.com/legal/privacy-policy-statement + * + * Or: You may also use this code under the terms of the GPL v3 (see + * www.gnu.org/licenses). + * + * THE AAX SDK IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER + * EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE + * DISCLAIMED. + */ + +#ifndef AAXLibrary_AAX_IPageTable_h +#define AAXLibrary_AAX_IPageTable_h + +#include "AAX.h" +#include "AAX_IString.h" + +class IACFUnknown; + + +/** \brief Interface to the host's representation of a plug-in instance's page table + + \sa \ref AAX_IEffectParameters::UpdatePageTable() + */ +class AAX_IPageTable +{ +public: + + /** \brief Virtual destructor + * + * \note This destructor MUST be virtual to prevent memory leaks. + */ + virtual ~AAX_IPageTable() { } + + // + // AAX_IACFPageTable + // + + /** \brief Clears all parameter mappings from the table + + This method does not clear any parameter name variations from the table. For that, use + \ref AAX_IPageTable::ClearParameterNameVariations() or + \ref AAX_IPageTable::ClearNameVariationsForParameter() + */ + virtual AAX_Result Clear() = 0; + + /** \brief Indicates whether the table is empty + + A table is empty if it contains no pages. A table which contains pages but no parameter + assignments is not empty. A table which has associated parameter name variations but no pages + is empty. + + \param[out] oEmpty + \c true if this table is empty + */ + virtual AAX_Result Empty(AAX_CBoolean& oEmpty) const = 0; + + /** \brief Get the number of pages currently in this table + + \param[out] oNumPages + The number of pages which are present in the page table. Some pages might not contain any + parameter assignments. + */ + virtual AAX_Result GetNumPages(int32_t& oNumPages) const = 0; + + /** \brief Insert a new empty page before the page at index \c iPage + + \returns \ref AAX_ERROR_INVALID_ARGUMENT if \p iPage is greater than the total number of pages + + \param[in] iPage + The insertion point page index + */ + virtual AAX_Result InsertPage(int32_t iPage) = 0; + + /** \brief Remove the page at index \c iPage + + \returns \ref AAX_ERROR_INVALID_ARGUMENT if \p iPage is greater than the index of the last existing page + + \param[in] iPage + The target page index + */ + virtual AAX_Result RemovePage(int32_t iPage) = 0; + + /** \brief Returns the total number of parameter IDs which are mapped to a page + + \note The number of mapped parameter IDs does not correspond to the actual slot indices of + the parameter assignments. For example, a page could have three total parameter assignments + with parameters mapped to slots 2, 4, and 6. + + \returns \ref AAX_ERROR_INVALID_ARGUMENT if \p iPage is greater than the index of the last existing page + + \param[in] iPage + The target page index + \param[out] oNumParameterIdentifiers + The number of parameter identifiers which are mapped to the target page + */ + virtual AAX_Result GetNumMappedParameterIDs(int32_t iPage, int32_t& oNumParameterIdentifiers) const = 0; + + /** \brief Clear the parameter at a particular index in this table + + \returns \ref AAX_SUCCESS even if no parameter was mapped at the given index (the index is still clear) + + \param[in] iPage + The target page index + \param[in] iIndex + The target parameter slot index within the target page + */ + virtual AAX_Result ClearMappedParameter(int32_t iPage, int32_t iIndex) = 0; + + /** \brief Get the parameter identifier which is currently mapped to an index in this table + + \returns \ref AAX_ERROR_INVALID_ARGUMENT if no parameter is mapped at the specified page/index location + + \param[in] iPage + The target page index + \param[in] iIndex + The target parameter slot index within the target page + \param[out] oParameterIdentifier + The identifier used for the mapped parameter in the page table (may be parameter name or ID) + */ + virtual AAX_Result GetMappedParameterID(int32_t iPage, int32_t iIndex, AAX_IString& oParameterIdentifier) const = 0; + + /** \brief Map a parameter to this table + + If \p iParameterIdentifier is an empty string then the parameter assignment will be cleared + + \returns \ref AAX_ERROR_NULL_ARGUMENT if \p iParameterIdentifier is null + + \returns \ref AAX_ERROR_INVALID_ARGUMENT if \p iPage is greater than the index of the last existing page + + \returns \ref AAX_ERROR_INVALID_ARGUMENT if \p iIndex is negative + + \param[in] iParameterIdentifier + The identifier for the parameter which will be mapped + \param[in] iPage + The target page index + \param[in] iIndex + The target parameter slot index within the target page + */ + virtual AAX_Result MapParameterID(AAX_CPageTableParamID iParameterIdentifier, int32_t iPage, int32_t iIndex) = 0; + + /** Get the number of parameters with name variations defined for the current table type + + Provides the number of parameters with %lt;ControlNameVariations%lt; which are explicitly + defined for the current page table type. + + \note Normally parameter name variations are only used with the 'PgTL' table type + + - \sa \ref AAX_IPageTable::GetNameVariationParameterIDAtIndex() + + \param[out] oNumParameterIdentifiers + The number of parameters with name variations explicitly associated with the current table type. + + */ + virtual AAX_Result GetNumParametersWithNameVariations(int32_t& oNumParameterIdentifiers) const = 0; + + /** Get the identifier for a parameter with name variations defined for the current table type + + \note Normally parameter name variations are only used with the 'PgTL' table type + + - \sa \ref AAX_IPageTable::GetNumParametersWithNameVariations() + + \param[in] iIndex + The target parameter index within the list of parameters with explicit name variations defined + for this table type. + \param[out] oParameterIdentifier + The identifier used for the parameter in the page table name variations list (may be parameter + name or ID) + + */ + virtual AAX_Result GetNameVariationParameterIDAtIndex(int32_t iIndex, AAX_IString& oParameterIdentifier) const = 0; + + /** Get the number of name variations defined for a parameter + + Provides the number of %lt;ControlNameVariations%lt; which are explicitly defined for + \p iParameterIdentifier for the current page table type. No fallback logic is used to resolve this to + the list of variations which would actually be used for an attached control surface if no explicit + variations are defined for the current table type. + + \note Normally parameter name variations are only used with the 'PgTL' table type + + - \sa \ref AAX_IPageTable::GetParameterNameVariationAtIndex() + + \returns \ref AAX_SUCCESS and provides zero to \p oNumVariations if \p iParameterIdentifier is not + found + + \param[in] iParameterIdentifier + The identifier for the parameter + \param[out] oNumVariations + The number of name variations which are defined for this parameter and explicitly associated with + the current table type. + + */ + virtual AAX_Result GetNumNameVariationsForParameter(AAX_CPageTableParamID iParameterIdentifier, int32_t& oNumVariations) const = 0; + + /** Get a parameter name variation from the page table + + Only returns %lt;ControlNameVariations%lt; which are explicitly defined for the + current page table type. No fallback logic is used to resolve this to the abbreviation which would + actually be shown on an attached control surface if no explicit variation is defined for the current + table type. + + \note Normally parameter name variations are only used with the 'PgTL' table type + + - \sa \ref AAX_IPageTable::GetNumNameVariationsForParameter() + - \sa \ref AAX_IPageTable::GetParameterNameVariationOfLength() + + \returns \ref AAX_ERROR_NO_ABBREVIATED_PARAMETER_NAME if no suitable variation is defined for this table + + \returns \ref AAX_ERROR_ARGUMENT_OUT_OF_RANGE if \p iIndex is out of range + + \param[in] iParameterIdentifier + The identifier for the parameter + \param[in] iIndex + Index of the name variation + \param[out] oNameVariation + The name variation, if one is explicitly defined for this table type + \param[out] oLength + The length value for this name variation. This corresponds to the variation's sz attribute + in the page table XML and may be different from the string length of \p iNameVariation. + */ + virtual AAX_Result GetParameterNameVariationAtIndex(AAX_CPageTableParamID iParameterIdentifier, int32_t iIndex, AAX_IString& oNameVariation, int32_t& oLength) const = 0; + + /** Get a parameter name variation of a particular length from the page table + + Only returns %lt;ControlNameVariations%lt; which are explicitly defined of \p iLength for the + current page table type. No fallback logic is used to resolve this to the abbreviation which would + actually be shown on an attached control surface if no explicit variation is defined for the specified + length or current table type. + + \note Normally parameter name variations are only used with the 'PgTL' table type + + - \sa \ref AAX_IPageTable::GetParameterNameVariationAtIndex() + + \returns \ref AAX_ERROR_NO_ABBREVIATED_PARAMETER_NAME if no suitable variation is defined for this table + + \param[in] iParameterIdentifier + The identifier for the parameter + \param[in] iLength + The variation length to check, i.e. the \c sz attribute for the name variation in the page table XML + \param[out] oNameVariation + The name variation, if one is explicitly defined for this table type and \p iLength + */ + virtual AAX_Result GetParameterNameVariationOfLength(AAX_CPageTableParamID iParameterIdentifier, int32_t iLength, AAX_IString& oNameVariation) const = 0; + + /** Clears all name variations for the current page table type + + \note Normally parameter name variations are only used with the 'PgTL' table type + + \sa \ref AAX_IPageTable::Clear() + \sa \ref AAX_IPageTable::ClearNameVariationsForParameter() + */ + virtual AAX_Result ClearParameterNameVariations() = 0; + + /** Clears all name variations for a single parameter for the current page table type + + \warning This will invalidate the list of parameter name variations indices, i.e. the parameter + identifier associated with each index by \ref AAX_IPageTable::GetNameVariationParameterIDAtIndex() + + \note Normally parameter name variations are only used with the 'PgTL' table type + + \sa \ref AAX_IPageTable::Clear() + \sa \ref AAX_IPageTable::ClearParameterNameVariations() + + \returns \ref AAX_SUCCESS and provides zero to \p oNumVariations if \p iParameterIdentifier is not + found + + \param[in] iParameterIdentifier + The identifier for the parameter + */ + virtual AAX_Result ClearNameVariationsForParameter(AAX_CPageTableParamID iParameterIdentifier) = 0; + + /** Sets a name variation explicitly for the current page table type + + This will add a new name variation or overwrite the existing name variation with the same length which + is defined for the current table type. + + \warning If no name variation previously existed for this parameter then this will invalidate the list + of parameter name variations indices, i.e. the parameter identifier associated with each index by + \ref AAX_IPageTable::GetNameVariationParameterIDAtIndex() + + \note Normally parameter name variations are only used with the 'PgTL' table type + + \returns AAX_ERROR_INVALID_ARGUMENT if \p iNameVariation is empty or if \p iLength is less than zero + + \param[in] iParameterIdentifier + The identifier for the parameter + \param[in] iNameVariation + The new parameter name variation + \param[in] iLength + The length value for this name variation. This corresponds to the variation's sz attribute + in the page table XML and is not required to match the length of \p iNameVariation. + */ + virtual AAX_Result SetParameterNameVariation(AAX_CPageTableParamID iParameterIdentifier, const AAX_IString& iNameVariation, int32_t iLength) = 0; +}; + +#endif diff --git a/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_IParameter.h b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_IParameter.h new file mode 100644 index 0000000000..b86ab3dc8e --- /dev/null +++ b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_IParameter.h @@ -0,0 +1,692 @@ +/*================================================================================================*/ +/* + * + * Copyright 2013-2017, 2023-2024 Avid Technology, Inc. + * All rights reserved. + * + * This file is part of the Avid AAX SDK. + * + * The AAX SDK is subject to commercial or open-source licensing. + * + * By using the AAX SDK, you agree to the terms of both the Avid AAX SDK License + * Agreement and Avid Privacy Policy. + * + * AAX SDK License: https://developer.avid.com/aax + * Privacy Policy: https://www.avid.com/legal/privacy-policy-statement + * + * Or: You may also use this code under the terms of the GPL v3 (see + * www.gnu.org/licenses). + * + * THE AAX SDK IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER + * EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE + * DISCLAIMED. + * + */ + +/** + * \file AAX_IParameter.h + * + * \brief The base interface for all normalizable plug-in parameters + * + */ +/*================================================================================================*/ + + +#ifndef AAX_IPARAMETER_H +#define AAX_IPARAMETER_H + +#include "AAX.h" //for types + +//Forward Declarations +class AAX_CString; +class AAX_IAutomationDelegate; +class AAX_ITaperDelegateBase; +class AAX_IDisplayDelegateBase; +class AAX_IString; + +/** @brief An abstract interface representing a parameter value of arbitrary type + + @details + @sdkinternal + + @sa \ref AAX_IParameter + */ +class AAX_IParameterValue +{ +public: + /** \brief Virtual destructor + * + * \note This destructor MUST be virtual to prevent memory leaks. + */ + virtual ~AAX_IParameterValue() { } + + /** \brief Clones the parameter object + * + * \note Does NOT set the automation delegate on the clone; ownership of the automation + * delegate and parameter registration/unregistration stays with the original parameter + */ + virtual AAX_IParameterValue* Clone() const = 0; + + /** \brief Returns the parameter's unique identifier + * + * This unique ID is used by the \ref AAXLibraryFeatures_ParameterManager and by outside + * applications to uniquely identify and target control messages. This value may not be + * changed after the parameter has been constructed. + */ + virtual AAX_CParamID Identifier() const = 0; + + /** @name Typed accessors + * + */ + //@{ + /** \brief Retrieves the parameter's value as a bool + * + * \param[out] value + * The parameter's real value. Set only if conversion is successful. + * + * \retval true The conversion to bool was successful + * \retval false The conversion to bool was unsuccessful + */ + virtual bool GetValueAsBool(bool* value) const = 0; + + /** \brief Retrieves the parameter's value as an int32_t + * + * \param[out] value + * The parameter's real value. Set only if conversion is successful. + * + * \retval true The conversion to int32_t was successful + * \retval false The conversion to int32_t was unsuccessful + */ + virtual bool GetValueAsInt32(int32_t* value) const = 0; + + /** \brief Retrieves the parameter's value as a float + * + * \param[out] value + * The parameter's real value. Set only if conversion is successful. + * + * \retval true The conversion to float was successful + * \retval false The conversion to float was unsuccessful + */ + virtual bool GetValueAsFloat(float* value) const = 0; + + /** \brief Retrieves the parameter's value as a double + * + * \param[out] value + * The parameter's real value. Set only if conversion is successful. + * + * \retval true The conversion to double was successful + * \retval false The conversion to double was unsuccessful + */ + virtual bool GetValueAsDouble(double* value) const = 0; + + /** \brief Retrieves the parameter's value as a string + * + * \param[out] value + * The parameter's real value. Set only if conversion is successful. + * + * \retval true The conversion to string was successful + * \retval false The conversion to string was unsuccessful + */ + virtual bool GetValueAsString(AAX_IString* value) const = 0; + //@} Typed accessors +}; + +/** @brief The base interface for all normalizable plug-in parameters + + @details + @sdkinternal + + This class is an outside interface for an arbitrarily typed parameter. The subclasses of this + generic interface hold the parameter's state and conversion functionality. + + \note This class is \em not part of the %AAX ABI and must not be passed between the plug-in and + the host. Version checking is recommended when passing references to this interface between + plug-in modules (e.g. between the data model and the GUI) + + \ingroup AAXLibraryFeatures_ParameterManager + +*/ +class AAX_IParameter +{ +public: + /** \brief Virtual destructor + * + * \note This destructor MUST be virtual to prevent memory leaks. + */ + virtual ~AAX_IParameter() { } + + /** \brief Clone the parameter's value to a new \ref AAX_IParameterValue object + * + * The returned object is independent from the \ref AAX_IParameter. For example, + * changing the state of the returned object will not result in a change to the + * original \ref AAX_IParameter. + */ + virtual AAX_IParameterValue* CloneValue() const = 0; + + /** @name Identification methods + * + */ + //@{ + /** \brief Returns the parameter's unique identifier + * + * This unique ID is used by the \ref AAXLibraryFeatures_ParameterManager and by outside + * applications to uniquely identify and target control messages. This value may not be + * changed after the parameter has been constructed. + */ + virtual AAX_CParamID Identifier() const = 0; + + /** \brief Sets the parameter's display name + * + * This name is used for display only, it is not used for indexing or identifying the parameter + * This name may be changed after the parameter has been created, but display name changes + * may not be recognized by all %AAX hosts. + * + * \param[in] name + * Display name that will be assigned to the parameter + */ + virtual void SetName(const AAX_CString& name) = 0; + + /** \brief Returns the parameter's display name + * + * \note This method returns a const reference in order to prevent a string copy. Do not cast + * away the const to change this value. + */ + virtual const AAX_CString& Name() const = 0; + + /** \brief Sets the parameter's shortened display name + * + * This name is used for display only, it is not used for indexing or identifying the parameter + * These names show up when the host asks for shorter length parameter names for display on Control Surfaces + * or other string length constrained situations. + * + * \param[in] name + * Shortened display names that will be assigned to the parameter + */ + virtual void AddShortenedName(const AAX_CString& name) = 0; + + /** \brief Returns the parameter's shortened display name + * + * \note This method returns a const reference in order to prevent a string copy. Do not cast + * away the const to change this value. + */ + virtual const AAX_CString& ShortenedName(int32_t iNumCharacters) const = 0; + + /** \brief Clears the internal list of shortened display names. + * + */ + virtual void ClearShortenedNames() = 0; + //@} Identification methods + + + /** @name Automation methods + * + */ + //@{ + /** \brief Returns true if the parameter is automatable, false if it is not + * + * \note Subclasses that return true in this method must support host-based automation. + */ + virtual bool Automatable() const = 0; + + /** \brief Sets the automation delegate (if one is required) + * + * \param[in] iAutomationDelegate + * A reference to the parameter manager's automation delegate interface + */ + virtual void SetAutomationDelegate( AAX_IAutomationDelegate * iAutomationDelegate ) = 0; + + /** \brief Signals the automation system that a control has been touched + * + * Call this method in response to GUI events that begin editing, such as a mouse down. + * After this method has been called you are free to call SetNormalizedValue() as much + * as you need, e.g. in order to respond to subsequent mouse moved events. Call Release() to + * free the parameter for updates from other controls. + */ + virtual void Touch() = 0; + + /** \brief Signals the automation system that a control has been released + * + * Call this method in response to GUI events that complete editing, such as a mouse up. + * Once this method has been called you should not call SetNormalizedValue() again until + * after the next call to Touch(). + */ + virtual void Release() = 0; + //@} Automation methods + + /** @name Taper methods + * + */ + //@{ + /** \brief Sets a parameter value using it's normalized representation + * + * For more information regarding normalized values, see + * \ref AAXLibraryFeatures_ParameterManager + * + * \param[in] newNormalizedValue + * New value (normalized) to which the parameter will be set + */ + virtual void SetNormalizedValue(double newNormalizedValue) = 0; + + /** \brief Returns the normalized representation of the parameter's current real value + * + */ + virtual double GetNormalizedValue() const = 0; + + /** \brief Sets the parameter's default value using its normalized representation + * + */ + virtual void SetNormalizedDefaultValue(double normalizedDefault) = 0; + + /** \brief Returns the normalized representation of the parameter's real default value + * + */ + virtual double GetNormalizedDefaultValue() const = 0; + + /** \brief Restores the state of this parameter to its default value + * + */ + virtual void SetToDefaultValue() = 0; + + /** \brief Sets the number of discrete steps for this parameter + * + * Stepped parameter values are useful for discrete parameters and for "jumping" events such + * as mouse wheels, page up/down, etc. The parameter's step size is used to specify the + * coarseness of those changes. + * + * \note numSteps MUST be greater than zero. All other values may be considered an error + * by the host. + * + * \param[in] numSteps + * The number of steps that the parameter will use + */ + virtual void SetNumberOfSteps(uint32_t numSteps) = 0; + + /** \brief Returns the number of discrete steps used by the parameter + * + * See \ref SetNumberOfSteps() for more information about parameter steps. + */ + virtual uint32_t GetNumberOfSteps() const = 0; + + /** \brief Returns the current step for the current value of the parameter + * + * See \ref SetNumberOfSteps() for more information about parameter steps. + */ + virtual uint32_t GetStepValue() const = 0; + + /** \brief Returns the normalized value for a given step + * + * See \ref SetNumberOfSteps() for more information about parameter steps. + */ + virtual double GetNormalizedValueFromStep(uint32_t iStep) const = 0; + + /** \brief Returns the step value for a normalized value of the parameter + * + * See \ref SetNumberOfSteps() for more information about parameter steps. + */ + virtual uint32_t GetStepValueFromNormalizedValue(double normalizedValue) const = 0; + + /** \brief Returns the current step for the current value of the parameter + * + * See \ref SetNumberOfSteps() for more information about parameter steps. + */ + virtual void SetStepValue(uint32_t iStep) = 0; + + //@} Taper methods + + + /** @name Display methods + * + * This functionality is most often used by GUIs, but can also be useful for state + * serialization. + */ + //@{ + /** \brief Serializes the parameter value into a string + * + * \param[out] valueString + * A string representing the parameter's real value + * + * \retval true The string conversion was successful + * \retval false The string conversion was unsuccessful + */ + virtual bool GetValueString(AAX_CString* valueString) const = 0; + + /** \brief Serializes the parameter value into a string, size hint included. + * + * \param[in] iMaxNumChars + * A size hint for the size of the string being requested. Useful for control surfaces and other limited area text fields. (make sure that size of desired string also has room for null termination) + * \param[out] valueString + * A string representing the parameter's real value + * + * \retval true The string conversion was successful + * \retval false The string conversion was unsuccessful + */ + virtual bool GetValueString(int32_t iMaxNumChars, AAX_CString* valueString) const = 0; + + /** \brief Converts a bool to a normalized parameter value + * + * \param[in] value + * A value for the parameter + * \param[out] normalizedValue + * The normalized parameter value associated with value + * + * \retval true The value conversion was successful + * \retval false The value conversion was unsuccessful + */ + virtual bool GetNormalizedValueFromBool(bool value, double *normalizedValue) const = 0; + + /** \brief Converts an integer to a normalized parameter value + * + * \param[in] value + * A value for the parameter + * \param[out] normalizedValue + * The normalized parameter value associated with value + * + * \retval true The value conversion was successful + * \retval false The value conversion was unsuccessful + */ + virtual bool GetNormalizedValueFromInt32(int32_t value, double *normalizedValue) const = 0; + + /** \brief Converts a float to a normalized parameter value + * + * \param[in] value + * A value for the parameter + * \param[out] normalizedValue + * The normalized parameter value associated with value + * + * \retval true The value conversion was successful + * \retval false The value conversion was unsuccessful + */ + virtual bool GetNormalizedValueFromFloat(float value, double *normalizedValue) const = 0; + + /** \brief Converts a double to a normalized parameter value + * + * \param[in] value + * A value for the parameter + * \param[out] normalizedValue + * The normalized parameter value associated with value + * + * \retval true The value conversion was successful + * \retval false The value conversion was unsuccessful + */ + virtual bool GetNormalizedValueFromDouble(double value, double *normalizedValue) const = 0; + + /** \brief Converts a given string to a normalized parameter value + * + * \param[in] valueString + * A string representing a possible real value for the parameter + * \param[out] normalizedValue + * The normalized parameter value associated with valueString + * + * \retval true The string conversion was successful + * \retval false The string conversion was unsuccessful + */ + virtual bool GetNormalizedValueFromString(const AAX_CString& valueString, double *normalizedValue) const = 0; + + /** \brief Converts a normalized parameter value to a bool representing the corresponding real + * value + * + * \param[in] normalizedValue + * The normalized value to convert + * \param[out] value + * The converted value. Set only if conversion is successful. + * + * \retval true The conversion to bool was successful + * \retval false The conversion to bool was unsuccessful + */ + virtual bool GetBoolFromNormalizedValue(double normalizedValue, bool* value) const = 0; + + /** \brief Converts a normalized parameter value to an integer representing the corresponding real + * value + * + * \param[in] normalizedValue + * The normalized value to convert + * \param[out] value + * The converted value. Set only if conversion is successful. + * + * \retval true The conversion to int32_t was successful + * \retval false The conversion to int32_t was unsuccessful + */ + virtual bool GetInt32FromNormalizedValue(double normalizedValue, int32_t* value) const = 0; + + /** \brief Converts a normalized parameter value to a float representing the corresponding real + * value + * + * \param[in] normalizedValue + * The normalized value to convert + * \param[out] value + * The converted value. Set only if conversion is successful. + * + * \retval true The conversion to float was successful + * \retval false The conversion to float was unsuccessful + */ + virtual bool GetFloatFromNormalizedValue(double normalizedValue, float* value) const = 0; + + /** \brief Converts a normalized parameter value to a double representing the corresponding real + * value + * + * \param[in] normalizedValue + * The normalized value to convert + * \param[out] value + * The converted value. Set only if conversion is successful. + * + * \retval true The conversion to double was successful + * \retval false The conversion to double was unsuccessful + */ + virtual bool GetDoubleFromNormalizedValue(double normalizedValue, double* value) const = 0; + + /** \brief Converts a normalized parameter value to a string representing the corresponding real + * value + * + * \param[in] normalizedValue + * A normalized parameter value + * \param[out] valueString + * A string representing the parameter value associated with normalizedValue + * + * \retval true The string conversion was successful + * \retval false The string conversion was unsuccessful + */ + virtual bool GetStringFromNormalizedValue(double normalizedValue, AAX_CString& valueString) const = 0; + + /** \brief Converts a normalized parameter value to a string representing the corresponding real, size hint included. + * value + * + * \param[in] normalizedValue + * A normalized parameter value + * \param[in] iMaxNumChars + * A size hint for the size of the string being requested. Useful for control surfaces and other limited area text fields. (make sure that size of desired string also has room for null termination) + * \param[out] valueString + * A string representing the parameter value associated with normalizedValue + * + * \retval true The string conversion was successful + * \retval false The string conversion was unsuccessful + */ + virtual bool GetStringFromNormalizedValue(double normalizedValue, int32_t iMaxNumChars, AAX_CString& valueString) const = 0; + + /** \brief Converts a string to a real parameter value and sets the parameter to this value + * + * \param[in] newValueString + * A string representing the parameter's new real value + * + * \retval true The string conversion was successful + * \retval false The string conversion was unsuccessful + */ + virtual bool SetValueFromString(const AAX_CString& newValueString) = 0; + //@} Display methods + + /** @name Typed accessors + * + */ + //@{ + /** \brief Retrieves the parameter's value as a bool + * + * \param[out] value + * The parameter's real value. Set only if conversion is successful. + * + * \retval true The conversion to bool was successful + * \retval false The conversion to bool was unsuccessful + */ + virtual bool GetValueAsBool(bool* value) const = 0; + + /** \brief Retrieves the parameter's value as an int32_t + * + * \param[out] value + * The parameter's real value. Set only if conversion is successful. + * + * \retval true The conversion to int32_t was successful + * \retval false The conversion to int32_t was unsuccessful + */ + virtual bool GetValueAsInt32(int32_t* value) const = 0; + + /** \brief Retrieves the parameter's value as a float + * + * \param[out] value + * The parameter's real value. Set only if conversion is successful. + * + * \retval true The conversion to float was successful + * \retval false The conversion to float was unsuccessful + */ + virtual bool GetValueAsFloat(float* value) const = 0; + + /** \brief Retrieves the parameter's value as a double + * + * \param[out] value + * The parameter's real value. Set only if conversion is successful. + * + * \retval true The conversion to double was successful + * \retval false The conversion to double was unsuccessful + */ + virtual bool GetValueAsDouble(double* value) const = 0; + + /** \brief Retrieves the parameter's value as a string + * + * \param[out] value + * The parameter's real value. Set only if conversion is successful. + * + * \retval true The conversion to string was successful + * \retval false The conversion to string was unsuccessful + */ + virtual bool GetValueAsString(AAX_IString* value) const = 0; + + /** \brief Sets the parameter's value as a bool + * + * \param[out] value + * The parameter's real value. Set only if conversion is successful. + * + * \retval true The conversion from bool was successful + * \retval false The conversion from bool was unsuccessful + */ + virtual bool SetValueWithBool(bool value) = 0; + + /** \brief Sets the parameter's value as an int32_t + * + * \param[out] value + * The parameter's real value. Set only if conversion is successful. + * + * \retval true The conversion from int32_t was successful + * \retval false The conversion from int32_t was unsuccessful + */ + virtual bool SetValueWithInt32(int32_t value) = 0; + + /** \brief Sets the parameter's value as a float + * + * \param[out] value + * The parameter's real value. Set only if conversion is successful. + * + * \retval true The conversion from float was successful + * \retval false The conversion from float was unsuccessful + */ + virtual bool SetValueWithFloat(float value) = 0; + + /** \brief Sets the parameter's value as a double + * + * \param[out] value + * The parameter's real value. Set only if conversion is successful. + * + * \retval true The conversion from double was successful + * \retval false The conversion from double was unsuccessful + */ + virtual bool SetValueWithDouble(double value) = 0; + + /** \brief Sets the parameter's value as a string + * + * \param[out] value + * The parameter's real value. Set only if conversion is successful. + * + * \retval true The conversion from string was successful + * \retval false The conversion from string was unsuccessful + */ + virtual bool SetValueWithString(const AAX_IString& value) = 0; + //@} Typed accessors + + + /** \brief Sets the type of this parameter + * + * See \ref GetType for use cases + * + * \param[in] iControlType + * The parameter's new type as an AAX_EParameterType + */ + virtual void SetType( AAX_EParameterType iControlType ) = 0; + + /** \brief Returns the type of this parameter as an AAX_EParameterType + * + * \todo Document use cases for control type + */ + virtual AAX_EParameterType GetType() const = 0; + + + /** \brief Sets the orientation of this parameter + * + * \param[in] iOrientation + * The parameter's new orientation + */ + virtual void SetOrientation( AAX_EParameterOrientation iOrientation ) = 0; + + /** \brief Returns the orientation of this parameter + * + */ + virtual AAX_EParameterOrientation GetOrientation() const = 0; + + /*! + * \brief Sets the parameter's taper delegate + * + * \param[in] inTaperDelegate + * A reference to the parameter's new taper delegate + * \param[in] inPreserveValue + * \todo Document this parameter + */ + virtual void SetTaperDelegate ( AAX_ITaperDelegateBase & inTaperDelegate, bool inPreserveValue ) = 0; + + /*! + * \brief Sets the parameter's display delegate + * + * \param[in] inDisplayDelegate + * A reference to the parameter's new display delegate + */ + virtual void SetDisplayDelegate ( AAX_IDisplayDelegateBase & inDisplayDelegate ) = 0; + +public: + /** @name Host interface methods + * + */ + //@{ + /*! + * \brief Sets the parameter's state given a normalized value + * + * This is the second half of the parameter setting operation that is initiated with a call to + * SetValue(). Parameters should not be set directly using this method; instead, use + * SetValue(). + * + * \param[in] newNormalizedValue + * Normalized value that will be used to set the parameter's new state + */ + virtual void UpdateNormalizedValue(double newNormalizedValue) = 0; + //@} Host interface methods + +}; + +#endif //AAX_IPARAMETER_H + + + + diff --git a/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_IPointerQueue.h b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_IPointerQueue.h new file mode 100644 index 0000000000..1de93d6a43 --- /dev/null +++ b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_IPointerQueue.h @@ -0,0 +1,89 @@ +/*================================================================================================*/ +/* + * Copyright 2015, 2018, 2023-2024 Avid Technology, Inc. + * All rights reserved. + * + * This file is part of the Avid AAX SDK. + * + * The AAX SDK is subject to commercial or open-source licensing. + * + * By using the AAX SDK, you agree to the terms of both the Avid AAX SDK License + * Agreement and Avid Privacy Policy. + * + * AAX SDK License: https://developer.avid.com/aax + * Privacy Policy: https://www.avid.com/legal/privacy-policy-statement + * + * Or: You may also use this code under the terms of the GPL v3 (see + * www.gnu.org/licenses). + * + * THE AAX SDK IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER + * EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE + * DISCLAIMED. + * + */ + +/** + * \file AAX_IPointerQueue.h + * + * \brief Abstract interface for a basic FIFO queue of pointers-to-objects + * + */ +/*================================================================================================*/ +/// @cond ignore +#ifndef AAX_IPOINTERQUEUE_H +#define AAX_IPOINTERQUEUE_H +/// @endcond + +// AAX Includes +#include "AAX_IContainer.h" + + +/** Abstract interface for a basic FIFO queue of pointers-to-objects + */ +template +class AAX_IPointerQueue : public AAX_IContainer +{ +public: + virtual ~AAX_IPointerQueue() {} + +public: + typedef T template_type; ///< The type used for this template instance + typedef T* value_type; ///< The type of values stored in this queue + +public: // AAX_IContainer + /** @copybrief AAX_IContainer::Clear() + + @note This operation is NOT atomic + @note This does NOT call the destructor for any pointed-to elements; it only clears + the pointer values in the queue + */ + virtual void Clear() = 0; + +public: // AAX_IPointerQueue + /** Push an element onto the queue + + Call from: Write thread + + @return \ref AAX_IContainer::eStatus_Success if the push succeeded + */ + virtual AAX_IContainer::EStatus Push(value_type inElem) = 0; + /** Pop the front element from the queue + + Call from: Read thread + + @return \c NULL if no element is available + */ + virtual value_type Pop() = 0; + /** Get the current top element without popping it off of the queue + + Call from: Read thread + + @note This value will change if another thread calls \ref Pop() + */ + virtual value_type Peek() const = 0; +}; + + +/// @cond ignore +#endif /* defined(AAX_IPOINTERQUEUE_H) */ +/// @endcond diff --git a/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_IPrivateDataAccess.h b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_IPrivateDataAccess.h new file mode 100644 index 0000000000..2cdbe8f647 --- /dev/null +++ b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_IPrivateDataAccess.h @@ -0,0 +1,92 @@ +/*================================================================================================*/ +/* + * + * Copyright 2014-2017, 2023-2024 Avid Technology, Inc. + * All rights reserved. + * + * This file is part of the Avid AAX SDK. + * + * The AAX SDK is subject to commercial or open-source licensing. + * + * By using the AAX SDK, you agree to the terms of both the Avid AAX SDK License + * Agreement and Avid Privacy Policy. + * + * AAX SDK License: https://developer.avid.com/aax + * Privacy Policy: https://www.avid.com/legal/privacy-policy-statement + * + * Or: You may also use this code under the terms of the GPL v3 (see + * www.gnu.org/licenses). + * + * THE AAX SDK IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER + * EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE + * DISCLAIMED. + * + */ + +/** + * \file AAX_IPrivateDataAccess.h + * + * \brief Interface to data access provided by host to plug-in + * + */ +/*================================================================================================*/ + + +#ifndef AAX_IPRIVATEDATAACCESS_H +#define AAX_IPRIVATEDATAACCESS_H + +#include "AAX.h" + + +/** @brief Interface to data access provided by host to plug-in. + + @details + @hostimp + + WARNING: AAX_IPrivateDataAccess objects are not reference counted and + are not guaranteed to exist beyond the scope of the method(s) + they are passed into. + + \sa AAX_IACFEffectDirectData::TimerWakeup + + \ingroup AuxInterface_DirectData + +*/ +class AAX_IPrivateDataAccess +{ +public: + virtual ~AAX_IPrivateDataAccess() {} + + /** @brief Read data directly from DSP at the given port. + + \note Blocking + + @param[in] inFieldIndex + The port to read from. + @param[in] inOffset + Offset into data to start reading. + @param[in] inSize + Amount of data to read (in bytes). + @param[out] outBuffer + Pointer to storage for data to be read into. + + */ + virtual AAX_Result ReadPortDirect( AAX_CFieldIndex inFieldIndex, const uint32_t inOffset, const uint32_t inSize, void* outBuffer ) = 0; + + /** @brief Write data directly to DSP at the given port. + + \note Blocking + + @param[in] inFieldIndex + The port to write to. + @param[in] inOffset + Offset into data to begin writing. + @param[in] inSize + Amount of data to write (in bytes). + @param[in] inBuffer + Pointer to data being written. + */ + virtual AAX_Result WritePortDirect( AAX_CFieldIndex inFieldIndex, const uint32_t inOffset, const uint32_t inSize, const void* inBuffer ) = 0; +}; + +#endif //AAX_IPRIVATEDATAACCESS_H diff --git a/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_IPropertyMap.h b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_IPropertyMap.h new file mode 100644 index 0000000000..40e000b0cc --- /dev/null +++ b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_IPropertyMap.h @@ -0,0 +1,173 @@ +/*================================================================================================*/ +/* + * + * Copyright 2013-2017, 2023-2024 Avid Technology, Inc. + * All rights reserved. + * + * This file is part of the Avid AAX SDK. + * + * The AAX SDK is subject to commercial or open-source licensing. + * + * By using the AAX SDK, you agree to the terms of both the Avid AAX SDK License + * Agreement and Avid Privacy Policy. + * + * AAX SDK License: https://developer.avid.com/aax + * Privacy Policy: https://www.avid.com/legal/privacy-policy-statement + * + * Or: You may also use this code under the terms of the GPL v3 (see + * www.gnu.org/licenses). + * + * THE AAX SDK IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER + * EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE + * DISCLAIMED. + * + */ + +/** + * \file AAX_IPropertyMap.h + * + * \brief Generic plug-in description property map + * + */ +/*================================================================================================*/ + + +#ifndef AAX_IPROPERTYMAP_H +#define AAX_IPROPERTYMAP_H + +#include "AAX_Properties.h" +#include "AAX.h" + +class IACFUnknown; + +/** + \brief Generic plug-in description property map + + \details + \hostimp + + Property Maps are used to associate specific sets of properties with plug-in description + interfaces. For example, an audio processing component might register mono and stereo callbacks, + or Native and TI callbacks, assigning each \c ProcessProc the applicable property mapping. + This allows the host to determine the correct callback to use depending on the environment in + which the plug-in is instantiated. + + %AAX does not require that every value in %AAX IPropertyMap be assigned by the developer. + Unassigned properties do not have defined default values; if a + specific value is not assigned to one of an element's properties then the element must + support any value for that property. For example, if an audio processing component does + not define its callback's audio buffer length property, the host will assume that the callback + will support any buffer length. + + - To create a new property map: \ref AAX_IComponentDescriptor::NewPropertyMap() + - To copy an existing property map: \ref AAX_IComponentDescriptor::DuplicatePropertyMap() + + \ingroup CommonInterface_Describe + + */ +class AAX_IPropertyMap +{ +public: + virtual ~AAX_IPropertyMap() {} + + + // + // AAX_IACFPropertyMap methods + // + + /** @brief Get a property value from a property map + + Returns true if the selected property is supported, false if it is not + + @param[in] inProperty + The property ID + @param[out] outValue + The property value + + + */ + virtual AAX_CBoolean GetProperty ( AAX_EProperty inProperty, AAX_CPropertyValue * outValue ) const = 0; + /** @brief Get a property value from a property map with a pointer-sized value + + Returns true if the selected property is supported, false if it is not + + @param[in] inProperty + The property ID + @param[out] outValue + The property value + + + */ + virtual AAX_CBoolean GetPointerProperty ( AAX_EProperty inProperty, const void** outValue ) const = 0; + /** @brief Add a property to a property map + + \note This method may return an error if adding the property was unsuccessful. If there is a + failure when adding a required property then registration of the relevant description element + must be abandoned and the plug-in's description logic should proceed to the next element. + + @param[in] inProperty + The property ID. + @param[in] inValue + + + */ + virtual AAX_Result AddProperty ( AAX_EProperty inProperty, AAX_CPropertyValue inValue ) = 0; + /** @brief Add a property to a property map with a pointer-sized value + + Use this method to add properties which require a pointer-sized value. Do not use this + method to add a property unless a pointer-sized value is explicitly specified in the + property documentation. + + \note This method may return an error if adding the property was unsuccessful. If there is a + failure when adding a required property then registration of the relevant description element + must be abandoned and the plug-in's description logic should proceed to the next element. + + @param[in] inProperty + The property ID. + @param[in] inValue + + */ + virtual AAX_Result AddPointerProperty ( AAX_EProperty inProperty, const void* inValue ) = 0; + virtual AAX_Result AddPointerProperty ( AAX_EProperty inProperty, const char* inValue ) = 0; ///< @copydoc AddPointerProperty(AAX_EProperty, const void*) + /** @brief Remove a property from a property map + + @param[in] inProperty + The property ID. + */ + virtual AAX_Result RemoveProperty ( AAX_EProperty inProperty ) = 0; + + /** @brief Add an array of plug-in IDs to a property map + + @param[in] inProperty + The property ID. + @param[in] inPluginIDs + An array of \ref AAX_SPlugInIdentifierTriad + @param[in] inNumPluginIDs + The length of \c iPluginIDs + + */ + virtual AAX_Result AddPropertyWithIDArray ( AAX_EProperty inProperty, const AAX_SPlugInIdentifierTriad* inPluginIDs, uint32_t inNumPluginIDs) = 0; + + /** @brief Get an array of plug-in IDs from a property map + + @param[in] inProperty + The property ID. + @param[out] outPluginIDs + A pointer that will be set to reference an array of \ref AAX_SPlugInIdentifierTriad + @param[in] outNumPluginIDs + The length of \c oPluginIDs + + */ + virtual AAX_CBoolean GetPropertyWithIDArray ( AAX_EProperty inProperty, const AAX_SPlugInIdentifierTriad** outPluginIDs, uint32_t* outNumPluginIDs) const = 0; + + + // + // AAX_IPropertyMap methods + // + + /** Returns the most up-to-date underlying interface + */ + virtual IACFUnknown* GetIUnknown() = 0; +}; + +#endif // AAX_IPROPERTYMAP_H diff --git a/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_ISessionDocument.h b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_ISessionDocument.h new file mode 100644 index 0000000000..c3e350e946 --- /dev/null +++ b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_ISessionDocument.h @@ -0,0 +1,111 @@ +/*================================================================================================*/ +/* + * + * Copyright 2023-2024 Avid Technology, Inc. + * All rights reserved. + * + * This file is part of the Avid AAX SDK. + * + * The AAX SDK is subject to commercial or open-source licensing. + * + * By using the AAX SDK, you agree to the terms of both the Avid AAX SDK License + * Agreement and Avid Privacy Policy. + * + * AAX SDK License: https://developer.avid.com/aax + * Privacy Policy: https://www.avid.com/legal/privacy-policy-statement + * + * Or: You may also use this code under the terms of the GPL v3 (see + * www.gnu.org/licenses). + * + * THE AAX SDK IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER + * EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE + * DISCLAIMED. + * + */ + +/** + * \file AAX_ISessionDocument.h + */ +/*================================================================================================*/ + +#pragma once +#ifndef AAX_ISessionDocument_H +#define AAX_ISessionDocument_H + +#include "AAX_SessionDocumentTypes.h" +#include "AAX_UIDs.h" +#include "AAX.h" +#include + +class IACFUnknown; + +/** + * \brief Interface representing information in a host session document + * + * This interface wraps the versioned interfaces defined in + * \ref AAX_IACFSessionDocument.h and provides additional convenience + * functions providing session data back in the expected format. + * + * \sa \ref AAX_ISessionDocumentClient + */ +class AAX_ISessionDocument +{ +public: + virtual ~AAX_ISessionDocument() = default; + + class TempoMap + { + public: + virtual ~TempoMap() = default; + virtual int32_t Size() const = 0; + virtual AAX_CTempoBreakpoint const * Data() const = 0; + }; + + /** + * \brief Check whether this session document is valid + */ + virtual bool Valid() const = 0; + + /** + * \brief Get a copy of the document's tempo map + * + * \return A TempoMap interface representing a copy of the current + * tempo map. + * \return \c nullptr if the host does not support tempo map data or if + * an error occurred. + */ + virtual std::unique_ptr GetTempoMap() = 0; + + /** Get document data of a generic type + * + * Similar to \c QueryInterface() but uses a data type identifier rather + * than a true IID + * + * The provided interface has already had a reference added, so be careful + * not to add an additional reference: + * + * \code + * ACFPtr ptr; + * IACFUnknown * docDataPtr{nullptr}; + * if (AAX_SUCCESS == doc->GetDocumentData(dataUID, &docDataPtr) && docDataPtr) { + * ptr.attach(std::static_cast(docDataPtr)); // attach does not AddRef + * } + * \endcode + * + * + * \param[in] inDataType + * The type of the document data requested + * + * \param[out] outData + * An interface providing the requested data, or \c nullptr if the host + * does not support or cannot provide the requested data type. The + * reference count has been incremented on this object on behalf of the + * caller, so the caller must not add an additional reference + * count and must decrement the reference count on this object to + * release it. For information about which interface to expect for each + * requested data type, see the documentation for that data type. + */ + virtual AAX_Result GetDocumentData(AAX_DocumentData_UID const & inDataType, IACFUnknown ** outData) = 0; +}; + +#endif // AAX_ISessionDocument_H diff --git a/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_ISessionDocumentClient.h b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_ISessionDocumentClient.h new file mode 100644 index 0000000000..9a7f4d81d8 --- /dev/null +++ b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_ISessionDocumentClient.h @@ -0,0 +1,58 @@ +/*================================================================================================*/ +/* + * + * Copyright 2023-2024 Avid Technology, Inc. + * All rights reserved. + * + * This file is part of the Avid AAX SDK. + * + * The AAX SDK is subject to commercial or open-source licensing. + * + * By using the AAX SDK, you agree to the terms of both the Avid AAX SDK License + * Agreement and Avid Privacy Policy. + * + * AAX SDK License: https://developer.avid.com/aax + * Privacy Policy: https://www.avid.com/legal/privacy-policy-statement + * + * Or: You may also use this code under the terms of the GPL v3 (see + * www.gnu.org/licenses). + * + * THE AAX SDK IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER + * EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE + * DISCLAIMED. + * + */ + +/** + * \file AAX_ISessionDocumentClient.h + */ +/*================================================================================================*/ + +#pragma once +#ifndef AAX_ISessionDocumentClient_H +#define AAX_ISessionDocumentClient_H + +#include "AAX_IACFSessionDocumentClient.h" +#include "AAX.h" +#include "CACFUnknown.h" + + +/** + * \brief Interface representing a client of the session document interface + * + * For example, a plug-in implementation that makes calls on the session + * document interface provided by the host. + */ +class AAX_ISessionDocumentClient : public AAX_IACFSessionDocumentClient, + public CACFUnknown +{ +public: + ACF_DECLARE_STANDARD_UNKNOWN() + + ACFMETHOD(InternalQueryInterface)(const acfIID & riid, void **ppvObjOut) override; + + // CACFUnknown does not support operator=() + AAX_DELETE(AAX_ISessionDocumentClient& operator= (const AAX_ISessionDocumentClient&)); +}; + +#endif //AAX_ISessionDocumentClient_H diff --git a/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_IString.h b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_IString.h new file mode 100644 index 0000000000..afed41e7f4 --- /dev/null +++ b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_IString.h @@ -0,0 +1,72 @@ +/*================================================================================================*/ +/* + * + * Copyright 2013-2015, 2023-2024 Avid Technology, Inc. + * All rights reserved. + * + * This file is part of the Avid AAX SDK. + * + * The AAX SDK is subject to commercial or open-source licensing. + * + * By using the AAX SDK, you agree to the terms of both the Avid AAX SDK License + * Agreement and Avid Privacy Policy. + * + * AAX SDK License: https://developer.avid.com/aax + * Privacy Policy: https://www.avid.com/legal/privacy-policy-statement + * + * Or: You may also use this code under the terms of the GPL v3 (see + * www.gnu.org/licenses). + * + * THE AAX SDK IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER + * EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE + * DISCLAIMED. + * + */ + +/** + * \file AAX_IString.h + * + * \brief An %AAX string interface + * + */ +/*================================================================================================*/ + + +#ifndef AAX_ISTRING_H +#define AAX_ISTRING_H + +#include "AAX.h" //for types + + +/** +* \brief A simple string container that can be passed across a binary boundary. This class, for simplicity, is not versioned and thus can never change. +* +* \details +* For a real string implementation, see AAX_CString, which inherits from this interface, but provides a much richer string interface. +* +* This object is not versioned with ACF for a variety of reasons, but the biggest implication of that is that THIS INTERFACE CAN NEVER CHANGE! +* +*/ +class AAX_IString +{ +public: + /** Virtual Destructor */ + virtual ~AAX_IString () {} + + /** Length methods */ + virtual uint32_t Length () const = 0; + virtual uint32_t MaxLength () const = 0; + + /** C string methods */ + virtual const char * Get () const = 0; + virtual void Set ( const char * iString ) = 0; + + /** Assignment operators */ + virtual AAX_IString & operator=(const AAX_IString & iOther) = 0; + virtual AAX_IString & operator=(const char * iString) = 0; +}; + + + + +#endif //AAX_ISTRING_H diff --git a/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_ITaperDelegate.h b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_ITaperDelegate.h new file mode 100644 index 0000000000..808bfda5fb --- /dev/null +++ b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_ITaperDelegate.h @@ -0,0 +1,166 @@ +/*================================================================================================*/ +/* + * + * Copyright 2014-2015, 2023-2024 Avid Technology, Inc. + * All rights reserved. + * + * This file is part of the Avid AAX SDK. + * + * The AAX SDK is subject to commercial or open-source licensing. + * + * By using the AAX SDK, you agree to the terms of both the Avid AAX SDK License + * Agreement and Avid Privacy Policy. + * + * AAX SDK License: https://developer.avid.com/aax + * Privacy Policy: https://www.avid.com/legal/privacy-policy-statement + * + * Or: You may also use this code under the terms of the GPL v3 (see + * www.gnu.org/licenses). + * + * THE AAX SDK IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER + * EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE + * DISCLAIMED. + * + */ + +/** + * \file AAX_ITaperDelegate.h + * + * \brief Defines the taper conversion behavior for a parameter + * + */ +/*================================================================================================*/ + + +#ifndef AAX_ITAPERDELEGATE_H +#define AAX_ITAPERDELEGATE_H + + + +/** \brief Defines the taper conversion behavior for a parameter. + + \details + \sdkinternal + + This interface represents a delegate class to be used in conjunction with \ref AAX_IParameter. + \ref AAX_IParameter delegates all conversion operations between normalized and real parameter + values to classes that meet this interface. You can think of \ref AAX_ITaperDelegate subclasses + as simple taper conversion routines that enable a specific taper or range conversion + function on an arbitrary parameter. + + To demonstrate the use of this interface, we will examine a simple call routine into a + parameter: + + \par + 1. The host application calls into the plug-in's \ref AAX_CParameterManager with a Parameter + ID and a new normalized parameter value. This new value could be coming from an automation + lane, a control surface, or any other parameter control; from the plug-in's perspective, + these are all identical. + + \par + 2. The AAX_CParameterManager finds the specified \ref AAX_CParameter and calls + \ref AAX_IParameter::SetNormalizedValue() on that parameter + + \par + 3. \ref AAX_IParameter::SetNormalizedValue() results in a call into the parameter's concrete + taper delegate to convert the normalized value to a real value. + + Using this pattern, the parameter manager is able to use real parameter values without + actually knowing how to perform the conversion between normalized and real values. + + The inverse of the above example can also happen, e.g. when a control is updated + from within the data model. In this case, the parameter can call into its concrete + taper delegate in order to normalize the updated value, which can then be passed on to any + observers that require normalized values, such as the host app. + + For more information about the parameter manager, see the \ref AAXLibraryFeatures_ParameterManager + documentation page. + + \ingroup AAXLibraryFeatures_ParameterManager_TaperDelegates + +*/ +class AAX_ITaperDelegateBase +{ +public: + /** \brief Virtual destructor + * + * \note This destructor MUST be virtual to prevent memory leaks. + */ + virtual ~AAX_ITaperDelegateBase() { } +}; + +/** Taper delegate interface template + + \copydoc AAXLibraryFeatures_ParameterManager_TaperDelegates + \ingroup AAXLibraryFeatures_ParameterManager_TaperDelegates + */ +template +class AAX_ITaperDelegate : public AAX_ITaperDelegateBase +{ +public: + /** \brief Constructs and returns a copy of the taper delegate + * + * In general, this method's implementation can use a simple copy constructor: + + \code + template + AAX_CSubclassTaperDelegate* AAX_CSubclassTaperDelegate::Clone() const + { + return new AAX_CSubclassTaperDelegate(*this); + } + \endcode + + */ + virtual AAX_ITaperDelegate* Clone() const = 0; + + /** \brief Returns the taper's maximum real value + * + */ + virtual T GetMaximumValue() const = 0; + + /** \brief Returns the taper's minimum real value + * + */ + virtual T GetMinimumValue() const = 0; + + /** \brief Applies a contraint to the value and returns the constrained value + * + * This method is useful if the taper requires a contraint beyond simple minimum and maximum + * real value limits. + * + * \note This is the function that should actually enforces the constraints in + * NormalizeToReal() and RealToNormalized(). + * + * \param[in] value + * The unconstrained value + */ + virtual T ConstrainRealValue(T value) const = 0; + + /** \brief Converts a normalized value to a real value + * + * This is where the actual taper algorithm is implemented. + * + * This function should perform the exact inverse of RealToNormalized(), to + * within the roundoff precision of the individual taper implementation. + * + * \param[in] normalizedValue + * The normalized value that will be converted + */ + virtual T NormalizedToReal(double normalizedValue) const = 0; + + /** \brief Normalizes a real parameter value + * + * This is where the actual taper algorithm is implemented. + * + * This function should perform the exact inverse of NormalizedToReal(), to + * within the roundoff precision of the individual taper implementation. + * + * \param[in] realValue + * The real parameter value that will be normalized + */ + virtual double RealToNormalized(T realValue) const = 0; +}; + + + +#endif //AAX_ITAPERDELEGATE_H diff --git a/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_ITask.h b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_ITask.h new file mode 100644 index 0000000000..2631313378 --- /dev/null +++ b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_ITask.h @@ -0,0 +1,142 @@ +/*================================================================================================*/ +/* + * + * Copyright 2023-2024 Avid Technology, Inc. + * All rights reserved. + * + * This file is part of the Avid AAX SDK. + * + * The AAX SDK is subject to commercial or open-source licensing. + * + * By using the AAX SDK, you agree to the terms of both the Avid AAX SDK License + * Agreement and Avid Privacy Policy. + * + * AAX SDK License: https://developer.avid.com/aax + * Privacy Policy: https://www.avid.com/legal/privacy-policy-statement + * + * Or: You may also use this code under the terms of the GPL v3 (see + * www.gnu.org/licenses). + * + * THE AAX SDK IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER + * EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE + * DISCLAIMED. + * + */ + +/** + * \file AAX_ITask.h + */ +/*================================================================================================*/ + +#pragma once + +#ifndef AAX_ITask_H +#define AAX_ITask_H + +#include "AAX_IACFTask.h" +#include "AAX.h" + +class AAX_IACFDataBuffer; + + +/** + * \brief Interface representing a request to perform a task + * + * \details + * \hostimp + * + * Used by the \ref AAX_ITaskAgent "task agent". + * + * This interface describes a task request and provides a way for + * the agent to express one or more results of the task as well as + * the progress of the task. + * + * This interface is open-ended for both inputs and outputs. The + * host and agent must use common definitions for specific task + * types, their possible arguments, and the expected results. + * + * \ingroup AuxInterface_TaskAgent + */ +class AAX_ITask +{ +public: + virtual ~AAX_ITask() = default; + + /** + * An identifier defining the type of the requested task + * + * \param[out] oType + * The type of this task request + */ + virtual AAX_Result GetType(AAX_CTypeID * oType) const = 0; + + /** + * Additional information defining the request, depending on + * the task type + * + * \param[in] iType + * The type of argument requested. Possible argument types, if + * any, and the resulting data buffer format must be defined per + * task type. + * + * \return The requested argument data, or nullptr. This data + * buffer's type ID is expected to match \c iType . The caller + * takes ownership of this object. + */ + virtual AAX_IACFDataBuffer const * GetArgumentOfType(AAX_CTypeID iType) const = 0; + + /** + * Inform the host about the current status of the task + * + * \param[in] iProgress + * A value between 0 (no progress) and 1 (complete) + */ + virtual AAX_Result SetProgress(float iProgress) = 0; + + /** + * Returns the current progress + */ + virtual float GetProgress() const = 0; + + /** + * \brief Attach result data to this task + * + * \details + * This can be called multiple times to add multiple types + * of results to a single task. + * + * The host may process the result data immediately or may + * wait for the task to complete. + * + * The plug-in is expected to release the data buffer upon + * making this call. At a minimum, the data buffer must not + * be changed after this call is made. See \c ACFPtr::inArg() + * + * \param[in] iResult + * A buffer containing the result data. Expected result types, if + * any, and their data buffer format must be defined per task type. + */ + virtual AAX_Result AddResult(AAX_IACFDataBuffer const * iResult) = 0; + + /** + * \brief Inform the host that the task is completed. + * + * \details + * If successful, returns a null pointer. Otherwise, returns + * a pointer back to the same object. This is the expected + * usage pattern: + * + * \code{.cpp} + * // release the task on success, retain it on failure + * myTask = myTask->SetDone(status); + * \endcode + * + * \param[in] iStatus + * The final status of the task. This indicates to the host + * whether or not the task was performed as requested. + */ + virtual AAX_ITask * SetDone(AAX_TaskCompletionStatus iStatus) = 0; +}; + + +#endif diff --git a/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_ITaskAgent.h b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_ITaskAgent.h new file mode 100644 index 0000000000..91e5d0304e --- /dev/null +++ b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_ITaskAgent.h @@ -0,0 +1,59 @@ +/*================================================================================================*/ +/* + * + * Copyright 2023-2024 Avid Technology, Inc. + * All rights reserved. + * + * This file is part of the Avid AAX SDK. + * + * The AAX SDK is subject to commercial or open-source licensing. + * + * By using the AAX SDK, you agree to the terms of both the Avid AAX SDK License + * Agreement and Avid Privacy Policy. + * + * AAX SDK License: https://developer.avid.com/aax + * Privacy Policy: https://www.avid.com/legal/privacy-policy-statement + * + * Or: You may also use this code under the terms of the GPL v3 (see + * www.gnu.org/licenses). + * + * THE AAX SDK IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER + * EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE + * DISCLAIMED. + * + */ + +/** + * \file AAX_ITaskAgent.h + */ +/*================================================================================================*/ + + +#ifndef AAX_ITaskAgent_H +#define AAX_ITaskAgent_H + +#include "AAX_IACFTaskAgent.h" +#include "AAX.h" +#include "CACFUnknown.h" + + +/** + * \brief Interface for a component that accepts task requests + * + * \copydetails AAX_IACFTaskAgent + * + * \ingroup AuxInterface_TaskAgent + */ +class AAX_ITaskAgent : public AAX_IACFTaskAgent + , public CACFUnknown +{ +public: + ACF_DECLARE_STANDARD_UNKNOWN() + + ACFMETHOD(InternalQueryInterface)(const acfIID & riid, void **ppvObjOut) AAX_OVERRIDE; + + // CACFUnknown does not support operator=() + AAX_DELETE(AAX_ITaskAgent& operator= (const AAX_ITaskAgent&)); +}; + +#endif //AAX_IEFFECTDIRECTDATA_H diff --git a/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_ITransport.h b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_ITransport.h new file mode 100644 index 0000000000..729c075443 --- /dev/null +++ b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_ITransport.h @@ -0,0 +1,288 @@ +/*================================================================================================*/ +/* + * + * Copyright 2013-2015, 2018-2021, 2023-2024 Avid Technology, Inc. + * All rights reserved. + * + * This file is part of the Avid AAX SDK. + * + * The AAX SDK is subject to commercial or open-source licensing. + * + * By using the AAX SDK, you agree to the terms of both the Avid AAX SDK License + * Agreement and Avid Privacy Policy. + * + * AAX SDK License: https://developer.avid.com/aax + * Privacy Policy: https://www.avid.com/legal/privacy-policy-statement + * + * Or: You may also use this code under the terms of the GPL v3 (see + * www.gnu.org/licenses). + * + * THE AAX SDK IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER + * EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE + * DISCLAIMED. + * + */ + +/** + * \file AAX_ITransport.h + * + * \brief The interface for query ProTools transport information + * + * \note To use this interface plug-in must describe AAX_eProperty_UsesMIDI property + */ +/*================================================================================================*/ + + +#ifndef AAX_ITRANSPORT_H +#define AAX_ITRANSPORT_H + +#pragma once + +#include "AAX.h" +#include "AAX_Enums.h" + +/** \brief Interface to information about the host's transport state + + \details + \hostimp + + Plug-ins that use this interface should describe \ref AAX_eProperty_UsesTransport as 1 + + Classes that inherit from \ref AAX_CEffectParameters or \ref AAX_CEffectGUI can use + \ref AAX_CEffectParameters::Transport() / \ref AAX_CEffectGUI::Transport() to access + this interface. This interface is used as a local interface to the \ref AAX_VTransport + versioned implemenation, which dispatches calls to the appropriate host-supplied versioned + transport interface depending on which features are supported by the host. See + \ref AAX_CEffectParameters::Initialize() for an example. + + A copy of this interface may also be obtained directly from the host using + \ref AAX_IMIDINode::GetTransport(). However, in this case the interface is not versioned, + so the host and the plugin may not agree on the interface. This can lead to undefined + behavior. See the documentation at \ref AAX_IMIDINode::GetTransport() for more + information. + +*/ +class AAX_ITransport +{ +public: + + /** \brief Virtual destructor + * + * \note This destructor MUST be virtual to prevent memory leaks. + */ + virtual ~AAX_ITransport() { } + + /*! + * \brief CALL: Gets the current tempo + * + * Returns the tempo corresponding to the current position of the transport counter + * + * \note The resolution of the tempo returned here is based on the host's tempo resolution, so it will match the tempo displayed in the host. + * Use \ref AAX_ITransport::GetCurrentTicksPerBeat() "GetCurrentTicksPerBeat()" to calculate the tempo resolution note. + * + * \param[out] TempoBPM The current tempo in beats per minute + */ + virtual AAX_Result GetCurrentTempo ( double* TempoBPM ) const = 0; + + /*! + * \brief CALL: Gets the current meter + * + * Returns the meter corresponding to the current position of the transport counter + * + * \param[out] MeterNumerator The numerator portion of the meter + * \param[out] MeterDenominator The denominator portion of the meter + */ + virtual AAX_Result GetCurrentMeter ( int32_t* MeterNumerator, int32_t* MeterDenominator ) const = 0; + + /*! + * \brief CALL: Indicates whether or not the transport is playing back + * + * \param[out] isPlaying \c true if the transport is currently in playback + */ + virtual AAX_Result IsTransportPlaying ( bool* isPlaying ) const = 0; + + /*! + * \brief CALL: Gets the current tick position + * + * Returns the current tick position corresponding to the current transport position. One + * "Tick" is represented here as 1/960000 of a quarter note. That is, there are 960,000 of + * these ticks in a quarter note. + * + * \compatibility The tick resolution here is different than that of the tick displayed in + * Pro Tools. "Display ticks" (as they are called) are 1/960 of a quarter note. + * + * \param[out] TickPosition The tick position value + */ + virtual AAX_Result GetCurrentTickPosition ( int64_t* TickPosition ) const = 0; + + /*! + * \brief CALL: Gets current information on loop playback + * + * \compatibility This does not indicate anything about the status of the "Loop Record" option. Even + * when the host is configured to loop playback, looping may not occur if certain conditions are not + * met (i.e. the length of the selection is too short) + * + * \param[out] bLooping \c true if the host is configured to loop playback + * \param[out] LoopStartTick The starting tick position of the selection being looped (see \ref AAX_ITransport::GetCurrentTickPosition() "GetCurrentTickPosition()") + * \param[out] LoopEndTick The ending tick position of the selection being looped (see \ref AAX_ITransport::GetCurrentTickPosition() "GetCurrentTickPosition()") + */ + virtual AAX_Result GetCurrentLoopPosition ( bool* bLooping, int64_t* LoopStartTick, int64_t* LoopEndTick ) const = 0; + /*! + * \brief CALL: Gets the current playback location of the native audio engine + * + * When called from a ProcessProc render callback, this method will provide the absolute sample location at the + * beginning of the callback's audio buffers. + * + * When called from \ref AAX_IEffectParameters::RenderAudio_Hybrid(), this method will provide the absolute + * sample location for the samples in the method's output audio buffers. To calculate the absolute sample + * location for the sampels in the method's input buffers (i.e. the timelin location where the samples + * originated) subtract the value provided by \ref AAX_IController::GetHybridSignalLatency() from this value. + * + * When called from a non-real-time thread, this method will provide the current location of the samples being + * processed by the plug-in's ProcessProc on its real-time processing thread. + * + * \note This method only returns a value during playback. It cannot be used to determine, e.g., the location of + * the timeline selector while the host is not in playback. + * + * \param[out] SampleLocation Absolute sample location of the first sample in the current native processing buffer + */ + virtual AAX_Result GetCurrentNativeSampleLocation ( int64_t* SampleLocation ) const = 0; + + /*! + * \brief CALL: Given an absolute sample position, gets the corresponding tick position + * + * \compatibility There is a minor performance cost associated with using this API in Pro Tools. It should not be + * used excessively without need. + * + * \param[out] oTickPosition the timeline tick position corresponding to \c iSampleLocation + * \param[in] iSampleLocation An absolute sample location (see \ref AAX_ITransport::GetCurrentNativeSampleLocation() "GetCurrentNativeSampleLocation()") + */ + virtual AAX_Result GetCustomTickPosition( int64_t* oTickPosition, int64_t iSampleLocation) const = 0; + + /*! + * \brief CALL: Given an absolute sample position, gets the corresponding bar and beat position + * + * \compatibility There is a minor performance cost associated with using this API in Pro Tools. It should not be + * used excessively without need. + * + * \param[out] Bars The bar corresponding to \c SampleLocation + * \param[out] Beats The beat corresponding to \c SampleLocation + * \param[out] DisplayTicks The ticks corresponding to \c SampleLocation + * \param[in] SampleLocation An absolute sample location (see \ref AAX_ITransport::GetCurrentNativeSampleLocation() "GetCurrentNativeSampleLocation()") + */ + virtual AAX_Result GetBarBeatPosition(int32_t* Bars, int32_t* Beats, int64_t* DisplayTicks, int64_t SampleLocation) const = 0; + + /*! + * \brief CALL: Retrieves the number of ticks per quarter note + * + * \param[out] ticks + */ + virtual AAX_Result GetTicksPerQuarter ( uint32_t* ticks ) const = 0; + + /*! + * \brief CALL: Retrieves the number of ticks per beat + * + * \param[out] ticks + */ + virtual AAX_Result GetCurrentTicksPerBeat ( uint32_t* ticks ) const = 0; + + /*! + * \brief CALL: Retrieves the absolute sample position of the beginning of the current transport selection + * + * \note This method is part of the \ref AAX_IACFTransport_V2 "version 2 transport interface" + * + * \param[out] oSampleLocation + */ + virtual AAX_Result GetTimelineSelectionStartPosition ( int64_t* oSampleLocation ) const = 0; + + /*! + * \brief CALL: Retrieves the current time code frame rate and offset + * + * \note This method is part of the \ref AAX_IACFTransport_V2 "version 2 transport interface" + * + * \param[out] oFrameRate + * \param[out] oOffset + */ + virtual AAX_Result GetTimeCodeInfo( AAX_EFrameRate* oFrameRate, int32_t* oOffset ) const = 0; + + /*! + * \brief CALL: Retrieves the current timecode feet/frames rate and offset + * + * \note This method is part of the \ref AAX_IACFTransport_V2 "version 2 transport interface" + * + * \param[out] oFeetFramesRate + * \param[out] oOffset + */ + virtual AAX_Result GetFeetFramesInfo( AAX_EFeetFramesRate* oFeetFramesRate, int64_t* oOffset ) const = 0; + + /*! + * \brief Sets isEnabled to true if the metronome is enabled + * + * \note This method is part of the \ref AAX_IACFTransport_V2 "version 2 transport interface" + * + * \param[out] isEnabled + */ + virtual AAX_Result IsMetronomeEnabled ( int32_t* isEnabled ) const = 0; + + /*! + * \brief CALL: Retrieves the current HD time code frame rate and offset + * + * \note This method is part of the \ref AAX_IACFTransport_V3 "version 3 transport interface" + * + * \param[out] oHDFrameRate + * \param[out] oHDOffset + */ + virtual AAX_Result GetHDTimeCodeInfo( AAX_EFrameRate* oHDFrameRate, int64_t* oHDOffset ) const = 0; + + /*! + * \brief CALL: Request that the host transport start playback + * + * \note This method is part of the \ref AAX_IACFTransportControl interface + */ + virtual AAX_Result RequestTransportStart() = 0; + + /*! + * \brief CALL: Request that the host transport stop playback + * + * \note This method is part of the \ref AAX_IACFTransportControl interface + */ + virtual AAX_Result RequestTransportStop() = 0; + + /*! + * \brief CALL: Retrieves the absolute sample position of the end of the current transport selection + * + * \note This method is part of the \ref AAX_IACFTransport_V4 "version 4 transport interface" + * + * \param[out] oSampleLocation + */ + virtual AAX_Result GetTimelineSelectionEndPosition ( int64_t* oSampleLocation ) const = 0; + + /*! + * \brief CALL: Retrieves the key signature at a sample location + * + * The signature is provided as a bitfield: + * - 31-20: Chromatic scale elements, ordered MSB (root) to LSB + * - 19-4: (Reserved) + * - 3-0: Root note (C natural = 0) + * + * For example + * + * \verbatim + * D# Major + * Ionian D# + * 0b 101011010101 0000 00000000 0000 0011 + * + * E Phrygian + * Phrygian E + * 0b 110101011010 0000 00000000 0000 0100 + * + * Chromatic + * Chromatic C + * 0b 111111111111 0000 00000000 0000 0000 + * \endverbatim + */ + virtual AAX_Result GetKeySignature( int64_t iSampleLocation, uint32_t* oKeySignature ) const = 0; +}; + +#endif // AAX_ITRANSPORT_H + diff --git a/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_IViewContainer.h b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_IViewContainer.h new file mode 100644 index 0000000000..1e138777b0 --- /dev/null +++ b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_IViewContainer.h @@ -0,0 +1,218 @@ +/*================================================================================================*/ +/* + * + * Copyright 2013-2017, 2019, 2021, 2023-2024 Avid Technology, Inc. + * All rights reserved. + * + * This file is part of the Avid AAX SDK. + * + * The AAX SDK is subject to commercial or open-source licensing. + * + * By using the AAX SDK, you agree to the terms of both the Avid AAX SDK License + * Agreement and Avid Privacy Policy. + * + * AAX SDK License: https://developer.avid.com/aax + * Privacy Policy: https://www.avid.com/legal/privacy-policy-statement + * + * Or: You may also use this code under the terms of the GPL v3 (see + * www.gnu.org/licenses). + * + * THE AAX SDK IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER + * EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE + * DISCLAIMED. + * + */ + +/** + * \file AAX_IViewContainer.h + * + * \brief Interface for the %AAX host's view of a single instance of an effect + * + */ +/*================================================================================================*/ + + +#ifndef _AAX_IVIEWCONTAINER_H_ +#define _AAX_IVIEWCONTAINER_H_ + +#include "AAX_GUITypes.h" +#include "AAX.h" + + +/** \brief Interface for the %AAX host's view of a single instance of an + * effect. Used both by clients of the %AAX host and by effect components. + * + * \details + * \hostimp + * + * \ingroup CommonInterface_GUI + */ +class AAX_IViewContainer +{ +public: + virtual ~AAX_IViewContainer(void) {} + + /** @name View and GUI state queries + */ + //@{ + /** \brief Returns the raw view type as one of \ref AAX_EViewContainer_Type + */ + virtual int32_t GetType () = 0; + /** \brief Returns a pointer to the raw view + */ + virtual void * GetPtr () = 0; + /** \brief Queries the host for the current \ref AAX_EModifiers "modifier keys". + + This method returns a bit mask with bits set for each of the currently active + modifier keys. This method does not return the state of the \ref AAX_eModifiers_SecondaryButton. + + \compatibility Although this method allows plug-ins to acquire the current state of the Windows + key (normally blocked by Pro Tools), plug-ins should not use key combinations that require this key. + + \param[out] outModifiers + Current modifiers as a bitmask of \ref AAX_EModifiers + */ + virtual AAX_Result GetModifiers ( uint32_t * outModifiers ) = 0; + //@}end View and GUI state queries + + /** @name View change requests + */ + //@{ + /** \brief Request a change to the main view size + + \note \li For compatibility with the smallest supported displays, + plug-in GUI dimensions should not exceed 749x617 pixels, or 749x565 + pixels for plug-ins with sidechain support. + + \param[in] inSize + The new size to which the plug-in view should be set + */ + virtual AAX_Result SetViewSize ( AAX_Point & inSize ) = 0; + //@}end View change requests + + /** @name Host event handlers + * + * These methods are used to pass plug-in GUI events to the host for + * handling. Events should always be passed on in this way when there + * is a possibility of the host overriding the event with its own + * behavior. + * + * For example, in Pro Tools a command-control-option-click on any + * automatable plug-in parameter editor should bring up that parameter's + * automation pop-up menu, and a control-right click should display + * the parameter's automation lane in the Pro Tools Edit window. In + * order for Pro Tools to handle these events, the plug-in must pass + * them on using \ref HandleParameterMouseDown() + * + * For each of these methods: + * \li \ref AAX_SUCCESS is returned if the event was successfully handled + * by the host. In most cases, no further action will be required from + * the plug-in after the host successfully handles an event. + * \li \ref AAX_ERROR_UNIMPLEMENTED is returned if the event was not + * handled by the host. In this case, the plug-in should perform its own + * event handling. + * + */ + //@{ + /** \brief Alert the host to a mouse down event + + \param[in] inParamID + ID of the parameter whose control is being edited + \param[in] inModifiers + A bitmask of \ref AAX_EModifiers values + */ + virtual AAX_Result HandleParameterMouseDown ( AAX_CParamID inParamID, uint32_t inModifiers ) = 0; + /** \brief Alert the host to a mouse drag event + + \warning The host may return \ref AAX_ERROR_UNIMPLEMENTED for this + event even if the host did handle the corresponding mouse down event. + A plug-in should ignore any following mouse drag and mouse up events + that correspond to a host-managed mouse down event. (\ref PTSW-195209) + + \param[in] inParamID + ID of the parameter whose control is being edited + \param[in] inModifiers + A bitmask of \ref AAX_EModifiers values + */ + virtual AAX_Result HandleParameterMouseDrag ( AAX_CParamID inParamID, uint32_t inModifiers ) = 0; + /** \brief Alert the host to a mouse up event + + \warning The host may return \ref AAX_ERROR_UNIMPLEMENTED for this + event even if the host did handle the corresponding mouse down event. + A plug-in should ignore any following mouse drag and mouse up events + that correspond to a host-managed mouse down event. (\ref PTSW-195209) + + \param[in] inParamID + ID of the parameter whose control is being edited + \param[in] inModifiers + A bitmask of \ref AAX_EModifiers values + */ + virtual AAX_Result HandleParameterMouseUp ( AAX_CParamID inParamID, uint32_t inModifiers ) = 0; + + /** \brief Alert the host to a mouse enter event to the parameter's control + + \param[in] inParamID + ID of the parameter whose control is being entered + \param[in] inModifiers + A bitmask of \ref AAX_EModifiers values + + \brief Returns AAX_SUCCESS if event was processed successfully, otherwise an AAX_ERROR code + */ + virtual AAX_Result HandleParameterMouseEnter ( AAX_CParamID inParamID, uint32_t inModifiers ) = 0; + + /** \brief Alert the host to a mouse exit event from the parameter's control + + \param[in] inParamID + ID of the parameter whose control is being exited + \param[in] inModifiers + A bitmask of \ref AAX_EModifiers values + + \brief Returns AAX_SUCCESS if event was processed successfully, otherwise an AAX_ERROR code + */ + virtual AAX_Result HandleParameterMouseExit( AAX_CParamID inParamID, uint32_t inModifiers ) = 0; + + /** \brief Alert the host to a mouse down event + + \param[in] inParamIDs + IDs of the parameters that belong to the same GUI element whose controls are being edited + \param[in] inNumOfParams + Number of parameter IDS + \param[in] inModifiers + A bitmask of \ref AAX_EModifiers values + */ + virtual AAX_Result HandleMultipleParametersMouseDown ( const AAX_CParamID* inParamIDs, uint32_t inNumOfParams, uint32_t inModifiers ) = 0; + /** \brief Alert the host to a mouse drag event + + \warning The host may return \ref AAX_ERROR_UNIMPLEMENTED for this + event even if the host did handle the corresponding mouse down event. + A plug-in should ignore any following mouse drag and mouse up events + that correspond to a host-managed mouse down event. (\ref PTSW-195209) + + \param[in] inParamIDs + IDs of the parameters that belong to the same GUI element whose controls are being edited + \param[in] inNumOfParams + Number of parameter IDS + \param[in] inModifiers + A bitmask of \ref AAX_EModifiers values + */ + virtual AAX_Result HandleMultipleParametersMouseDrag ( const AAX_CParamID* inParamIDs, uint32_t inNumOfParams, uint32_t inModifiers ) = 0; + /** \brief Alert the host to a mouse up event + + \warning The host may return \ref AAX_ERROR_UNIMPLEMENTED for this + event even if the host did handle the corresponding mouse down event. + A plug-in should ignore any following mouse drag and mouse up events + that correspond to a host-managed mouse down event. (\ref PTSW-195209) + + \param[in] inParamIDs + IDs of the parameters that belong to the same GUI element whose controls are being edited + \param[in] inNumOfParams + Number of parameter IDS + \param[in] inModifiers + A bitmask of \ref AAX_EModifiers values + */ + virtual AAX_Result HandleMultipleParametersMouseUp ( const AAX_CParamID* inParamIDs, uint32_t inNumOfParams, uint32_t inModifiers ) = 0; + //@}end Host event handlers +}; + +#endif + diff --git a/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_Init.h b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_Init.h new file mode 100644 index 0000000000..923d4d022e --- /dev/null +++ b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_Init.h @@ -0,0 +1,124 @@ +/*================================================================================================*/ +/* + * + * Copyright 2013-2017, 2023-2024 Avid Technology, Inc. + * All rights reserved. + * + * This file is part of the Avid AAX SDK. + * + * The AAX SDK is subject to commercial or open-source licensing. + * + * By using the AAX SDK, you agree to the terms of both the Avid AAX SDK License + * Agreement and Avid Privacy Policy. + * + * AAX SDK License: https://developer.avid.com/aax + * Privacy Policy: https://www.avid.com/legal/privacy-policy-statement + * + * Or: You may also use this code under the terms of the GPL v3 (see + * www.gnu.org/licenses). + * + * THE AAX SDK IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER + * EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE + * DISCLAIMED. + * + */ + +/** + * \file AAX_Init.h + * + * \brief %AAX library implementations of required plug-in initialization, registration, + * and tear-down methods. + * + */ +/*================================================================================================*/ + + +#include "AAX.h" +#include "acfbasetypes.h" + +class IACFUnknown; +class IACFPluginDefinition; +class IACFComponentDefinition; + + +/** @copybrief ACFRegisterPlugin() + + @details + This method determines the number of components defined in the dll. The + implementation of this method in the %AAX library calls the following function, + which must be implemented somewhere in your plug-in: + + \code + extern AAX_Result GetEffectDescriptions( AAX_ICollection * outCollection ); + \endcode + + Wrapped by \ref ACFRegisterPlugin() + + \ingroup CommonInterface_Describe +*/ +AAX_Result AAXRegisterPlugin(IACFUnknown * pUnkHost, IACFPluginDefinition **ppPluginDefinition); + +/** @copybrief ACFRegisterComponent() + + @details + The implementation of this method in the %AAX library simply sets + \c *ppComponentDefinition to NULL and returns \ref AAX_SUCCESS. + + Wrapped by \ref ACFRegisterComponent() +*/ +AAX_Result AAXRegisterComponent (IACFUnknown * pUnkHost, acfUInt32 index, IACFComponentDefinition **ppComponentDefinition); + +/** @copybrief ACFGetClassFactory() + + @details + This method is required by ACF but is not supported by AAX. Therefore the + implementation of this method in the %AAX library simply sets \c *ppOut to NULL + and returns \ref AAX_ERROR_UNIMPLEMENTED. + + Wrapped by \ref ACFGetClassFactory() +*/ +AAX_Result AAXGetClassFactory (IACFUnknown * pUnkHost, const acfCLSID& clsid, const acfIID& iid, void** ppOut); + +/** @copybrief ACFCanUnloadNow() + + @details + The implementation of this method in the %AAX library returns the result of + \c GetActiveObjectCount() as an \ref AAX_Result, with zero active objects + interpreted as \ref AAX_SUCCESS (see CACFUnknown.h) + + Wrapped by \ref ACFCanUnloadNow() +*/ +AAX_Result AAXCanUnloadNow(IACFUnknown* pUnkHost); + +/** @copybrief ACFStartup() + + @details + Called once at init time. The implementation of this method in the %AAX library + uses \c pUnkHost as an \c IACFComponentFactory to initialize global services + (see acfbaseapi.h) + + Wrapped by \ref ACFStartup() +*/ +AAX_Result AAXStartup(IACFUnknown* pUnkHost); + +/** @copybrief ACFShutdown() + + @details + Called once before unloading the DLL. The implementation of this method in the %AAX + library tears down any globally initialized state and releases any globally + retained resources. + + Wrapped by \ref ACFShutdown() +*/ +AAX_Result AAXShutdown(IACFUnknown* pUnkHost); + +/** @copybrief ACFGetSDKVersion() + + @details + The implementation of this method in the %AAX library provides a 64-bit value in + which the upper 32 bits represent the SDK version and the lower 32 bits represent + the revision number of the SDK. See \ref AAX_Version.h + + Wrapped by \ref ACFGetSDKVersion() +*/ +AAX_Result AAXGetSDKVersion( acfUInt64 *oSDKVersion ); diff --git a/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_MIDIUtilities.h b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_MIDIUtilities.h new file mode 100644 index 0000000000..9062f58c23 --- /dev/null +++ b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_MIDIUtilities.h @@ -0,0 +1,174 @@ +/*================================================================================================*/ +/* + * Copyright 2015, 2023-2024 Avid Technology, Inc. + * All rights reserved. + * + * This file is part of the Avid AAX SDK. + * + * The AAX SDK is subject to commercial or open-source licensing. + * + * By using the AAX SDK, you agree to the terms of both the Avid AAX SDK License + * Agreement and Avid Privacy Policy. + * + * AAX SDK License: https://developer.avid.com/aax + * Privacy Policy: https://www.avid.com/legal/privacy-policy-statement + * + * Or: You may also use this code under the terms of the GPL v3 (see + * www.gnu.org/licenses). + * + * THE AAX SDK IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER + * EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE + * DISCLAIMED. + */ + +/** + * \file AAX_MIDIUtilities.h + * + * \brief Utilities for managing MIDI data + * + */ +/*================================================================================================*/ +/// @cond ignore +#ifndef AAX_MIDIUtilities_h +#define AAX_MIDIUtilities_h +/// @endcond + +// AAX Includes +#include "AAX.h" + +namespace AAX +{ + // + // Some MIDI defines + // + + /// Values for the status nibble in a MIDI packet + enum EStatusNibble + { + eStatusNibble_NoteOff = 0x80 + ,eStatusNibble_NoteOn = 0x90 + ,eStatusNibble_KeyPressure = 0xA0 + ,eStatusNibble_ControlChange = 0xB0 + ,eStatusNibble_ChannelMode = 0xB0 + ,eStatusNibble_ProgramChange = 0xC0 + ,eStatusNibble_ChannelPressure = 0xD0 + ,eStatusNibble_PitchBend = 0xE0 + ,eStatusNibble_SystemCommon = 0xF0 + ,eStatusNibble_SystemRealTime = 0xF0 + }; + + /// Values for the status byte in a MIDI packet + enum EStatusByte + { + eStatusByte_SysExBegin = 0xF0 + ,eStatusByte_MTCQuarterFrame = 0xF1 + ,eStatusByte_SongPosition = 0xF2 + ,eStatusByte_SongSelect = 0xF3 + ,eStatusByte_TuneRequest = 0xF6 + ,eStatusByte_SysExEnd = 0xF7 + ,eStatusByte_TimingClock = 0xF8 + ,eStatusByte_Start = 0xFA + ,eStatusByte_Continue = 0xFB + ,eStatusByte_Stop = 0xFC + ,eStatusByte_ActiveSensing = 0xFE + ,eStatusByte_Reset = 0xFF + }; + + /// Values for the first data byte in a Channel Mode Message MIDI packet + enum EChannelModeData + { + eChannelModeData_AllSoundOff = 120 + ,eChannelModeData_ResetControllers = 121 + ,eChannelModeData_LocalControl = 122 + ,eChannelModeData_AllNotesOff = 123 + ,eChannelModeData_OmniOff = 124 + ,eChannelModeData_OmniOn = 125 + ,eChannelModeData_PolyOff = 126 + ,eChannelModeData_PolyOn = 127 + }; + + /// Special message data for the first data byte in a message + enum ESpecialData + { + eSpecialData_AccentedClick = 0x00 ///< For use when the high status nibble is \ref eStatusNibble_NoteOn and the low status nibble is zero + ,eSpecialData_UnaccentedClick = 0x01 ///< For use when the high status nibble is \ref eStatusNibble_NoteOn and the low status nibble is zero + }; + + + // + // Basic MIDI utility functions + // + + /// Returns true if \c inPacket is a Note On message + inline bool IsNoteOn(const AAX_CMidiPacket* inPacket) + { + if (!inPacket) { return false; } + const uint8_t sn = (inPacket->mData[0] & 0xF0); // status nibble + const uint8_t data2 = inPacket->mData[2]; + return ((eStatusNibble_NoteOn == sn) && + (0x00 != data2)); + } + + /// Returns true if \c inPacket is a Note Off message, or a Note On message with velocity zero + inline bool IsNoteOff(const AAX_CMidiPacket* inPacket) + { + if (!inPacket) { return false; } + const uint8_t sn = (inPacket->mData[0] & 0xF0); // status nibble + const uint8_t data2 = inPacket->mData[2]; + return ((eStatusNibble_NoteOff == sn) || ((eStatusNibble_NoteOn == sn) && (0x00 == data2))); + } + + /// Returns true if \c inPacket is an All Sound Off or All Notes Off message + inline bool IsAllNotesOff(const AAX_CMidiPacket* inPacket) + { + if (!inPacket) { return false; } + const uint8_t sn = (inPacket->mData[0] & 0xF0); // status nibble + const uint8_t data1 = inPacket->mData[1]; + const uint8_t data2 = inPacket->mData[2]; + if (eStatusNibble_ChannelMode == sn) + { + if (eChannelModeData_PolyOff == data1) + { + return true; + } + else if ((eChannelModeData_AllSoundOff == data1) || + (eChannelModeData_AllNotesOff == data1) || + (eChannelModeData_OmniOff == data1) || + (eChannelModeData_OmniOn == data1) || + (eChannelModeData_PolyOn == data1)) + { + return (0x00 == data2); + } + } + + return false; + } + + /// Returns true if \c inPacket is a special Pro Tools accented click message + inline bool IsAccentedClick(const AAX_CMidiPacket* inPacket) + { + return ((inPacket) && + (eStatusNibble_NoteOn == (inPacket->mData[0] & 0xF0)) && + (0x00 == (inPacket->mData[0] & 0x0F)) && + (eSpecialData_AccentedClick == inPacket->mData[1])); + } + + /// Returns true if \c inPacket is a special Pro Tools unaccented click message + inline bool IsUnaccentedClick(const AAX_CMidiPacket* inPacket) + { + return ((inPacket) && + (eStatusNibble_NoteOn == (inPacket->mData[0] & 0xF0)) && + (0x00 == (inPacket->mData[0] & 0x0F)) && + (eSpecialData_UnaccentedClick == inPacket->mData[1])); + } + + /// Returns true if \c inPacket is a special Pro Tools click message + inline bool IsClick(const AAX_CMidiPacket* inPacket) + { + return (IsAccentedClick(inPacket) || IsUnaccentedClick(inPacket)); + } +} // namespace AAX + +/// @cond ignore +#endif // AAX_MIDIUtilities_h +/// @endcond diff --git a/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_PageTableUtilities.h b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_PageTableUtilities.h new file mode 100644 index 0000000000..be9e4c59b3 --- /dev/null +++ b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_PageTableUtilities.h @@ -0,0 +1,232 @@ +/*================================================================================================*/ +/* + * Copyright 2016-2017, 2023-2024 Avid Technology, Inc. + * All rights reserved. + * + * This file is part of the Avid AAX SDK. + * + * The AAX SDK is subject to commercial or open-source licensing. + * + * By using the AAX SDK, you agree to the terms of both the Avid AAX SDK License + * Agreement and Avid Privacy Policy. + * + * AAX SDK License: https://developer.avid.com/aax + * Privacy Policy: https://www.avid.com/legal/privacy-policy-statement + * + * Or: You may also use this code under the terms of the GPL v3 (see + * www.gnu.org/licenses). + * + * THE AAX SDK IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER + * EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE + * DISCLAIMED. + */ + +#ifndef AAXLibrary_AAX_PageTableUtilities_h +#define AAXLibrary_AAX_PageTableUtilities_h + +#include "AAX_CString.h" +#include "AAX.h" + +namespace AAX +{ + /** Compare the parameter mappings in two page tables + + \p T1 and \p T2: Page table class types (e.g. \ref AAX_IACFPageTable, \ref AAX_IPageTable) + */ + template + inline bool PageTableParameterMappingsAreEqual(const T1& inL, const T2& inR) + { + AAX_Result errL = AAX_SUCCESS; + AAX_Result errR = AAX_SUCCESS; + + int32_t numPagesL = -1; + int32_t numPagesR = -1; + errL = inL.GetNumPages(numPagesL); + errR = inR.GetNumPages(numPagesR); + + if (errL != errR || numPagesL != numPagesR) { return false; } + else if (AAX_SUCCESS != errL) { return true; } // can't get page data from either table + + for (int32_t i = 0; i < numPagesL; ++i) + { + int32_t numParamsL = -1; + int32_t numParamsR = -1; + errL = inL.GetNumMappedParameterIDs(i, numParamsL); + errR = inR.GetNumMappedParameterIDs(i, numParamsR); + + if (errL != errR || numParamsL != numParamsR) { return false; } + else if (AAX_SUCCESS != errL) { continue; } // skip this page if equal errors were returned + + for (int32_t j = 0; j < numParamsL; ++j) + { + AAX_CString paramIdentifierL; + AAX_CString paramIdentifierR; + errL = inL.GetMappedParameterID(i, j, paramIdentifierL); + errR = inR.GetMappedParameterID(i, j, paramIdentifierR); + + if (errL != errR || paramIdentifierL != paramIdentifierR) { return false; } + } + } + + return true; + } + + template + inline bool PageTableParameterNameVariationsAreEqual(const T1& inL, const T2& inR) + { + AAX_Result errL = AAX_SUCCESS; + AAX_Result errR = AAX_SUCCESS; + + int32_t numParamIdentifiersL = -1; + int32_t numParamIdentifiersR = -1; + errL = inL.GetNumParametersWithNameVariations(numParamIdentifiersL); + errR = inR.GetNumParametersWithNameVariations(numParamIdentifiersR); + + if (errL != errR || numParamIdentifiersL != numParamIdentifiersR) { return false; } + else if (AAX_SUCCESS != errL) { return true; } // can't get parameter name variation data from either table + + for (int32_t i = 0; i < numParamIdentifiersL; ++i) + { + AAX_CString paramIdentifierL; + AAX_CString paramIdentifierR; + errL = inL.GetNameVariationParameterIDAtIndex(i, paramIdentifierL); + errL = inR.GetNameVariationParameterIDAtIndex(i, paramIdentifierR); + + if (errL != errR || paramIdentifierL != paramIdentifierR) { return false; } + else if (AAX_SUCCESS != errL) { continue; } // skip this index if equal errors were returned + + int32_t numVariationsL = -1; + int32_t numVariationsR = -1; + errL = inL.GetNumNameVariationsForParameter(paramIdentifierL.Get(), numVariationsL); + errL = inR.GetNumNameVariationsForParameter(paramIdentifierR.Get(), numVariationsR); + + if (errL != errR || numVariationsL != numVariationsR) { return false; } + else if (AAX_SUCCESS != errL) { continue; } // skip this index if equal errors were returned + + for (int32_t j = 0; j < numVariationsL; ++j) + { + AAX_CString nameVariationL; + int32_t lengthL; + AAX_CString nameVariationR; + int32_t lengthR; + errL = inL.GetParameterNameVariationAtIndex(paramIdentifierL.Get(), j, nameVariationL, lengthL); + errR = inR.GetParameterNameVariationAtIndex(paramIdentifierR.Get(), j, nameVariationR, lengthR); + + if (errL != errR || lengthL != lengthR || nameVariationL != nameVariationR) { return false; } + } + } + + return true; + } + + template + inline bool PageTablesAreEqual(const T1& inL, const T2& inR) + { + return (PageTableParameterMappingsAreEqual(inL, inR) && PageTableParameterNameVariationsAreEqual(inL, inR)); + } + + /** Copy a page table + + \p T: A page table class type (e.g. \ref AAX_IACFPageTable, \ref AAX_IPageTable) + */ + template + inline void CopyPageTable(T& to, const T& from) + { + to.Clear(); + + // Copy page tables + int32_t curPageIndex; + from.GetNumPages(curPageIndex); + while (0 < curPageIndex--) + { + to.InsertPage(0); + + int32_t numIDsRemaining = 0; + from.GetNumMappedParameterIDs(curPageIndex, numIDsRemaining); + for (int32_t curSlotIndex = 0; 0 < numIDsRemaining; ++curSlotIndex) // numIDsRemaining is decremented in the loop body + { + AAX_CString curParam; + const AAX_Result getParamResult = from.GetMappedParameterID(curPageIndex, curSlotIndex, curParam); + if (AAX_SUCCESS == getParamResult) + { + to.MapParameterID(curParam.CString(), 0, curSlotIndex); + --numIDsRemaining; + } + } + } + + // Copy name variations + int32_t numParameterIdentifiers = 0; + to.ClearParameterNameVariations(); + from.GetNumParametersWithNameVariations(numParameterIdentifiers); + for (int32_t curParamIndex = 0; curParamIndex < numParameterIdentifiers; ++curParamIndex) + { + AAX_CString curParamIdentifier; + from.GetNameVariationParameterIDAtIndex(curParamIndex, curParamIdentifier); + + int32_t numNameVariations = 0; + from.GetNumNameVariationsForParameter(curParamIdentifier.Get(), numNameVariations); + + for (int32_t curNameVariationIndex = 0; curNameVariationIndex < numNameVariations; ++curNameVariationIndex) + { + int32_t curNameVariationLength; + AAX_CString curNameVariation; + from.GetParameterNameVariationAtIndex(curParamIdentifier.Get(), curNameVariationIndex, curNameVariation, curNameVariationLength); + to.SetParameterNameVariation(curParamIdentifier.Get(), curNameVariation, curNameVariationLength); + } + } + } + + /** Find all slots where a particular parameter is mapped + + \p T: A page table class type (e.g. \ref AAX_IACFPageTable, \ref AAX_IPageTable) + + \returns A vector of pairs of [page index, slot index] each representing a single mapping of the parameter + */ + template + inline std::vector > FindParameterMappingsInPageTable(const T& inTable, AAX_CParamID inParameterID) + { + const AAX_CString searchParamID(inParameterID); + std::vector > foundParamMappings; + + int32_t numPages = 0; + inTable.GetNumPages(numPages); + for (int32_t i = 0; i < numPages; ++i) + { + int32_t numIDsRemaining = 0; + inTable.GetNumMappedParameterIDs(i, numIDsRemaining); + for (int32_t curSlotIndex = 0; 0 < numIDsRemaining; ++curSlotIndex) // numIDs is decremented in the loop body + { + AAX_CString curParam; + const AAX_Result getParamResult = inTable.GetMappedParameterID(i, curSlotIndex, curParam); + if (AAX_SUCCESS == getParamResult) + { + if (searchParamID == curParam) + { + foundParamMappings.push_back(std::make_pair(i, curSlotIndex)); + } + + --numIDsRemaining; + } + } + } + + return foundParamMappings; + } + + /** Remove all mappings of a particular from a page table + + \p T: A page table class type (e.g. \ref AAX_IACFPageTable, \ref AAX_IPageTable) + */ + template + inline void ClearMappedParameterByID(T& ioTable, AAX_CParamID inParameterID) + { + const auto paramMappings(AAX::FindParameterMappingsInPageTable(ioTable, inParameterID)); + for (const auto& locationPair : paramMappings) + { + ioTable.ClearMappedParameter(locationPair.first, locationPair.second); + } + } +} + +#endif diff --git a/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_PopStructAlignment.h b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_PopStructAlignment.h new file mode 100644 index 0000000000..b804a1785a --- /dev/null +++ b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_PopStructAlignment.h @@ -0,0 +1,80 @@ +/*================================================================================================*/ +/* + * + * Copyright 2014-2015, 2018, 2023-2024 Avid Technology, Inc. + * All rights reserved. + * + * This file is part of the Avid AAX SDK. + * + * The AAX SDK is subject to commercial or open-source licensing. + * + * By using the AAX SDK, you agree to the terms of both the Avid AAX SDK License + * Agreement and Avid Privacy Policy. + * + * AAX SDK License: https://developer.avid.com/aax + * Privacy Policy: https://www.avid.com/legal/privacy-policy-statement + * + * Or: You may also use this code under the terms of the GPL v3 (see + * www.gnu.org/licenses). + * + * THE AAX SDK IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER + * EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE + * DISCLAIMED. + * + */ + +/** + * \file AAX_PopStructAlignment.h + * + * \brief Resets (pops) the struct alignment to its previous value + * + * \details + * \sa AAX_ALIGN_HOST + * \sa AAX_ALIGN_ALG + * \sa AAX_ALIGN_RESET + * + * \note Inclusion of this file is mandatory after any 'push' inclusion. + * \note Some compilers do not properly "pop" alignment, so nesting + * push/pop inclusions is not allowed. + * + * \sa \ref AAX_Push2ByteStructAlignment.h + * \sa \ref AAX_Push4ByteStructAlignment.h + * \sa \ref AAX_Push8ByteStructAlignment.h + * + * \internal + * NOTE: we don't use include guards for this file because it *is* possible to + * include this file multiple times in the same file. + * \endinternal + * + */ +/*================================================================================================*/ + +// Nesting of struct alignment headers is not allowed +#ifndef __AAX_CUSTOM_STRUCT_ALIGN_IS_SET__ +#error "No AAX struct alignment has been set. Cannot undo." +#else +#undef __AAX_CUSTOM_STRUCT_ALIGN_IS_SET__ +#endif + +#ifdef _TMS320C6X +// Do nothing for TI +#elif defined (_MSC_VER) +#pragma pack(pop) +#elif defined (__GNUC__) +// Uncomment this warning suppression if you really want to apply packing to a virtual data +// structure, but note that there is no guarantee of cross-platform compatibility for such +// a structure. For more information, see the AAX_ALIGN_FILE_ALG macro documentation +// #ifdef __clang__ +// #pragma clang diagnostic push +// #pragma clang diagnostic ignored "-Wno-incompatible-ms-struct" +// #endif +#pragma ms_struct off +// #ifdef __clang__ +// #pragma clang diagnostic pop +// #endif +#pragma pack(pop) +#elif defined (__MWERKS__) +#pragma options align=reset +#else +#error "You need to supply a pragma here to pop structure packing" +#endif diff --git a/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_PostStructAlignmentHelper.h b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_PostStructAlignmentHelper.h new file mode 100644 index 0000000000..d7adfd2ee6 --- /dev/null +++ b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_PostStructAlignmentHelper.h @@ -0,0 +1,38 @@ +/*================================================================================================*/ +/* + * + * Copyright 2018, 2023-2024 Avid Technology, Inc. + * All rights reserved. + * + * This file is part of the Avid AAX SDK. + * + * The AAX SDK is subject to commercial or open-source licensing. + * + * By using the AAX SDK, you agree to the terms of both the Avid AAX SDK License + * Agreement and Avid Privacy Policy. + * + * AAX SDK License: https://developer.avid.com/aax + * Privacy Policy: https://www.avid.com/legal/privacy-policy-statement + * + * Or: You may also use this code under the terms of the GPL v3 (see + * www.gnu.org/licenses). + * + * THE AAX SDK IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER + * EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE + * DISCLAIMED. + * + */ + +/** + * \file AAX_PostStructAlignmentHelper.h + * + * \brief Helper file for data alignment macros + */ +/*================================================================================================*/ + +#if defined (__clang__) + #if defined (AAX_SDK__PRE_STRUCT_ALIGNMENT_HELPER_DID_PUSH_A_CHANGE) + #pragma clang diagnostic pop + #undef AAX_SDK__PRE_STRUCT_ALIGNMENT_HELPER_DID_PUSH_A_CHANGE + #endif +#endif diff --git a/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_PreStructAlignmentHelper.h b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_PreStructAlignmentHelper.h new file mode 100644 index 0000000000..22de584989 --- /dev/null +++ b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_PreStructAlignmentHelper.h @@ -0,0 +1,43 @@ +/*================================================================================================*/ +/* + * + * Copyright 2018, 2023-2024 Avid Technology, Inc. + * All rights reserved. + * + * This file is part of the Avid AAX SDK. + * + * The AAX SDK is subject to commercial or open-source licensing. + * + * By using the AAX SDK, you agree to the terms of both the Avid AAX SDK License + * Agreement and Avid Privacy Policy. + * + * AAX SDK License: https://developer.avid.com/aax + * Privacy Policy: https://www.avid.com/legal/privacy-policy-statement + * + * Or: You may also use this code under the terms of the GPL v3 (see + * www.gnu.org/licenses). + * + * THE AAX SDK IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER + * EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE + * DISCLAIMED. + * + */ + +/** + * \file AAX_PreStructAlignmentHelper.h + * + * \brief Helper file for data alignment macros + */ +/*================================================================================================*/ + +#if defined (AAX_SDK__PRE_STRUCT_ALIGNMENT_HELPER_DID_PUSH_A_CHANGE) + #warning nested struct alignment directives are not tested +#endif + +#if defined (__clang__) + #if __has_warning ("-Wpragma-pack") + #define AAX_SDK__PRE_STRUCT_ALIGNMENT_HELPER_DID_PUSH_A_CHANGE 1 + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wpragma-pack" + #endif +#endif diff --git a/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_Properties.h b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_Properties.h new file mode 100644 index 0000000000..d4990fac3c --- /dev/null +++ b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_Properties.h @@ -0,0 +1,934 @@ +/*================================================================================================*/ +/* + * + * Copyright 2013-2017, 2019-2021, 2023-2024 Avid Technology, Inc. + * All rights reserved. + * + * This file is part of the Avid AAX SDK. + * + * The AAX SDK is subject to commercial or open-source licensing. + * + * By using the AAX SDK, you agree to the terms of both the Avid AAX SDK License + * Agreement and Avid Privacy Policy. + * + * AAX SDK License: https://developer.avid.com/aax + * Privacy Policy: https://www.avid.com/legal/privacy-policy-statement + * + * Or: You may also use this code under the terms of the GPL v3 (see + * www.gnu.org/licenses). + * + * THE AAX SDK IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER + * EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE + * DISCLAIMED. + * + */ + +/** + * \file AAX_Properties.h + * + * \brief Contains IDs for properties that can be added to an AAX_IPropertyMap + * + */ +/*================================================================================================*/ + + +/// @cond ignore +#pragma once +#ifndef AAX_PROPERTIES_H +#define AAX_PROPERTIES_H +/// @endcond + +#ifndef _AAX_H_ +#include "AAX.h" +#endif + + +// Add new values only at the end of existing sections! + +/** \brief The list of properties that can be added to an \ref AAX_IPropertyMap + * + * \details + * See \ref AAX_IPropertyMap::AddProperty() for more information + * + *

Sections

+ * - \ref AAX_eProperty_PlugInSpecPropsBase "Plug-In spec properties" + * - \ref AAX_eProperty_ProcessProcPropsBase "ProcessProc properties" + * - \ref AAX_eProperty_GeneralPropsBase "General properties" + * - \ref AAX_eProperty_TI_SharedCycleCount "TI-specific properties" + * - \ref AAX_eProperty_AudiosuitePropsBase "Offline (AudioSuite) properties" + * - \ref AAX_eProperty_GUIBase "GUI properties" + * - \ref AAX_eProperty_MeterBase "Meter properties" + * - \ref AAX_eProperty_ConstraintBase "Plug-in management constraints" + * + * + * \legacy These property IDs are somewhat analogous to the pluginGestalt + * system in the legacy SDK, and several \ref AAX_EProperty values correlate + * directly with a corresponding legacy plug-in gestalt. + * + * \legacy To ensure session + * interchange compatibility, make sure the 4 character IDs for + * \ref AAX_eProperty_ManufacturerID, \ref AAX_eProperty_ProductID, + * \ref AAX_eProperty_PlugInID_Native, and + * \ref AAX_eProperty_PlugInID_AudioSuite are identical to the legacy SDK's + * counterpart. + * + */ +// Current CCS doesn't support C++11 +#ifdef _TMS320C6X +enum AAX_EProperty +#else +enum AAX_EProperty : int32_t +#endif +{ + AAX_eProperty_NoID = 0, + AAX_eProperty_MinProp = 10, // MUST BE EQUAL TO MINIMUM PROPERTY VALUE + +//--------------------------------------------------------------------- +#if 0 +#pragma mark Plug-In spec properties +#endif + /** @name Plug-In spec properties + * + */ + //@{ + /**
*/ + AAX_eProperty_PlugInSpecPropsBase = 10, + /** \brief Four-character osid-style manufacturer identifier + * + * Should be registered with Avid, and must be identical for all plug-ins from the same + * manufacturer. + * + * \li Apply this property at the \b ProcessProc level for plug-ins that support audio + * processing using a \b ProcessProc callback, or at the \b Effect level for all other + * plug-ins. + * + * \legacy For legacy plug-in session compatibility, this ID should match the Manufacturer ID + * used in the corresponding legacy plug-ins. + */ + AAX_eProperty_ManufacturerID = 11, + /** \brief Four-character osid-style Effect identifier + * + * Must be identical for all \b ProcessProcs within a single + * \ref AAX_IEffectDescriptor "Effect". + * + * \li Apply this property at the \b ProcessProc level for plug-ins that support audio + * processing using a \b ProcessProc callback, or at the \b Effect level for all other + * plug-ins. + * + * \legacy For legacy plug-in session compatibility, this ID should match the Product ID used + * in the corresponding legacy plug-in. + */ + AAX_eProperty_ProductID = 12, + /** \brief Four-character osid-style plug-in type identifier for real-time native audio Effects + * + * All registered plug-in type IDs (\ref AAX_eProperty_PlugInID_Native, + * \ref AAX_eProperty_PlugInID_AudioSuite, \ref AAX_eProperty_PlugInID_TI, etc.) must be + * unique across all ProcessProcs registered within a single + * \ref AAX_IEffectDescriptor "Effect". + * + * \warning As with all plug-in ID properties, this value must remain constant across all + * releases of the plug-in which support this Effect configuration. The value of this + * property should be stored in a constant rather than being calculated at run-time in order + * to avoid unresolvable compatibility issues with saved sessions which can occur of an ID + * value is accidentally changed between two plug-in version releases. + * + * \li Apply this property at the \b ProcessProc level + * + * \legacy For legacy plug-in session compatibility, this ID should match the Type ID used in + * the corresponding legacy RTAS plug-in Types. + */ + AAX_eProperty_PlugInID_Native = 13, + /** \brief \deprecated Use \ref AAX_eProperty_PlugInID_Native + */ + AAX_eProperty_PlugInID_RTAS = AAX_eProperty_PlugInID_Native, + /** \brief Four-character osid-style plug-in type identifier for offline native audio Effects + * + * All registered plug-in type IDs (\ref AAX_eProperty_PlugInID_Native, + * \ref AAX_eProperty_PlugInID_AudioSuite, \ref AAX_eProperty_PlugInID_TI, etc.) must be + * unique across all ProcessProcs registered within a single + * \ref AAX_IEffectDescriptor "Effect". + * + * \li Apply this property at the \b ProcessProc level for plug-ins that support audio + * processing using a \b ProcessProc callback, or at the \b Effect level for all other + * AudioSuite plug-ins (e.g. those that use the \ref AAX_IHostProcessor interface.) + * + * \legacy For legacy plug-in session compatibility, this ID should match the Type ID used in + * the corresponding legacy AudioSuite plug-in Types. + */ + AAX_eProperty_PlugInID_AudioSuite = 14, + /** \brief Four-character osid-style plug-in type identifier for real-time TI-accelerated audio + * Effect types + * + * All registered plug-in type IDs (\ref AAX_eProperty_PlugInID_Native, + * \ref AAX_eProperty_PlugInID_AudioSuite, \ref AAX_eProperty_PlugInID_TI, etc.) must be + * unique across all ProcessProcs registered within a single + * \ref AAX_IEffectDescriptor "Effect". + * + * \warning As with all plug-in ID properties, this value must remain constant across all + * releases of the plug-in which support this Effect configuration. The value of this + * property should be stored in a constant rather than being calculated at run-time in order + * to avoid unresolvable compatibility issues with saved sessions which can occur of an ID + * value is accidentally changed between two plug-in version releases. + * + * \li Apply this property at the \b ProcessProc level + * + * \legacy For legacy plug-in session compatibility, this ID should match the Type ID + * used in the corresponding legacy TDM plug-in Types. + */ + AAX_eProperty_PlugInID_TI = 15, + /** \brief Four-character osid-style plug-in type identifier for Effect types that do not + * process audio + * + * All registered plug-in type IDs (\ref AAX_eProperty_PlugInID_Native, + * \ref AAX_eProperty_PlugInID_AudioSuite, \ref AAX_eProperty_PlugInID_TI, etc.) must be + * unique across all ProcessProcs registered within a single + * \ref AAX_IEffectDescriptor "Effect". + * + * \warning As with all plug-in ID properties, this value must remain constant across all + * releases of the plug-in which support this Effect configuration. The value of this + * property should be stored in a constant rather than being calculated at run-time in order + * to avoid unresolvable compatibility issues with saved sessions which can occur of an ID + * value is accidentally changed between two plug-in version releases. + * + * \li Apply this property at the \b Effect level + */ + AAX_eProperty_PlugInID_NoProcessing = 16, + /** \brief Four-character osid-style plug-in type identifier for a corresponding deprecated type + * + * Only one deprecated effect ID may correspond to each valid (non-deprecated) effect ID. + * To associate a plug-in type with more than one deprecated type, use the following properties instead: + * - @ref AAX_eProperty_Deprecated_DSP_Plugin_List + * - @ref AAX_eProperty_Deprecated_Native_Plugin_List + * + * \li Apply this property at the \b ProcessProc level + */ + AAX_eProperty_PlugInID_Deprecated = 18, + /** \brief \deprecated Use \ref AAX_eProperty_Deprecated_Native_Plugin_List and \ref AAX_eProperty_Deprecated_DSP_Plugin_List + * See AAX_eProperty_PlugInID_RTAS for an example. + */ + AAX_eProperty_Deprecated_Plugin_List = 21, + /** \brief Specify a list of DSP plug-ins that are related to a plug-in type. + * + * \li For example, use this property inside a Native process to tell the host that this plug-in can be used + * in place of a DSP version. + * \li This property must be applied at the ProcessProc level and used with the + * \ref AAX_IPropertyMap::AddPropertyWithIDArray method, which takes a list of full plug-in identifier + * specification triads (ManufacturerID, ProductID, PluginID) + */ + AAX_eProperty_Related_DSP_Plugin_List = 22, + /** \brief Specify a list of Native plug-ins that are related to a plug-in type. + * + * \li This property must be applied at the ProcessProc level and used with the + * \ref AAX_IPropertyMap::AddPropertyWithIDArray method, which takes a list of full plug-in identifier + * specification triads (ManufacturerID, ProductID, PluginID) + */ + AAX_eProperty_Related_Native_Plugin_List = 23, + /** \brief Specify a list of DSP plug-ins that are deprecated by a new plug-in type. + * + * \li This property must be applied at the ProcessProc level and used with the AddPropertyWithIDArray, which + * is a list of full plug-in specs (ManufacturerID, ProductID, PluginID) + */ + AAX_eProperty_Deprecated_DSP_Plugin_List = 24, + /** \brief Specify a list of Native plug-ins that are deprecated by a new plug-in type. + * + * \li This property must be applied at the ProcessProc level and used with the AddPropertyWithIDArray, which + * is a list of full plug-in specs (ManufacturerID, ProductID, PluginID) + */ + AAX_eProperty_Deprecated_Native_Plugin_List = AAX_eProperty_Deprecated_Plugin_List, + /** \brief Four-character osid-style plug-in type identifier for audio effects rendered on + * external hardware. + * + * \note This property is not currently used by any %AAX plug-in host software + * + * All registered plug-in type IDs must be unique across all ProcessProcs registered within a + * single \ref AAX_IEffectDescriptor "Effect". + * + * \warning As with all plug-in ID properties, this value must remain constant across all + * releases of the plug-in which support this Effect configuration. The value of this + * property should be stored in a constant rather than being calculated at run-time in order + * to avoid unresolvable compatibility issues with saved sessions which can occur of an ID + * value is accidentally changed between two plug-in version releases. + * + * \li Apply this property at the \b ProcessProc level + */ + AAX_eProperty_PlugInID_ExternalProcessor = 25, + /** \brief Identifier for the type of the external processor hardware + * + * \sa \ref AAX_eProperty_PlugInID_ExternalProcessor + * + * The value of this property will be specific to the external processor hardware. Currently + * there are no public external processor hardware type IDs. + * + * \li Apply this property at the \b ProcessProc level + */ + AAX_eProperty_ExternalProcessorTypeID = 26, + //@}end Plug-In spec properties + +//--------------------------------------------------------------------- +#if 0 +#pragma mark ProcessProc properties +#endif + /** @name ProcessProc properties + * + */ + //@{ + /**
*/ + AAX_eProperty_ProcessProcPropsBase = 35, + /** Address of a native effect's ProcessProc callback + * + * Data type: \ref AAX_CProcessProc + * + * For use with \ref AAX_IComponentDescriptor::AddProcessProc() + */ + AAX_eProperty_NativeProcessProc = 36, + /** Address of a native effect's instance initialization callback + * + * Data type: \ref AAX_CInstanceInitProc + * + * For use with \ref AAX_IComponentDescriptor::AddProcessProc() + */ + AAX_eProperty_NativeInstanceInitProc = 37, + /** Address of a native effect's background callback + * + * Data type: \ref AAX_CBackgroundProc + * + * For use with \ref AAX_IComponentDescriptor::AddProcessProc() + */ + AAX_eProperty_NativeBackgroundProc = 38, + /** Name of the DLL for a TI effect + * + * Data type: UTF-8 C-string + * + * For use with \ref AAX_IComponentDescriptor::AddProcessProc() + */ + AAX_eProperty_TIDLLFileName = 39, + /** Name of a TI effect's ProcessProc callback + * + * Data type: C-string + * + * For use with \ref AAX_IComponentDescriptor::AddProcessProc() + */ + AAX_eProperty_TIProcessProc = 40, + /** Name of a TI effect's instance initialization callback + * + * Data type: C-string + * + * For use with \ref AAX_IComponentDescriptor::AddProcessProc() + */ + AAX_eProperty_TIInstanceInitProc = 41, + /** Name of a TI effect's background callback + * + * Data type: C-string + * + * For use with \ref AAX_IComponentDescriptor::AddProcessProc() + */ + AAX_eProperty_TIBackgroundProc = 42, + //@}end Plug-In spec properties + +//--------------------------------------------------------------------- +#if 0 +#pragma mark General properties +#endif + /** @name General properties + * + */ + //@{ + /**
*/ + AAX_eProperty_GeneralPropsBase = 50, + /** \brief Input stem format. One of \ref AAX_EStemFormat + * + * \li Apply this property at the \b ProcessProc level + * + * For offline processing, use \ref AAX_eProperty_NumberOfInputs + */ + AAX_eProperty_InputStemFormat = 51, + /** \brief Output stem format. One of \ref AAX_EStemFormat + * + * \li Apply this property at the \b ProcessProc level + * + * For offline processing, use \ref AAX_eProperty_NumberOfOutputs + */ + AAX_eProperty_OutputStemFormat = 52, + /** \brief Audio buffer length for DSP processing callbacks. One of + * \ref AAX_EAudioBufferLengthDSP + * + * \li Apply this property at the \b ProcessProc level + * \li This property is only applicable to DSP algorithms + */ + AAX_eProperty_DSP_AudioBufferLength = 54, + /** \brief \deprecated Use \ref AAX_eProperty_DSP_AudioBufferLength + */ + AAX_eProperty_AudioBufferLength = AAX_eProperty_DSP_AudioBufferLength, + /** \brief Default latency contribution of a given processing callback, in samples + * + * \li Apply this property at the \b ProcessProc level + * + * Unlike most properties, an Effect's latency contribution may also be changed dynamically at + * runtime. This is done via \ref AAX_IController::SetSignalLatency(). Dynamic latency + * reporting may not be recognized by the host application in all circumstances, however, so + * Effects should \em always define any nonzero initial latency value using + * \ref AAX_eProperty_LatencyContribution + * + * \compatibility Maximum delay compensation limits will vary from host to host. If your + * plug-in exceeds the delay compensation sample limit for a given %AAX host then you should + * note this limitation in your user documentation. Example limits: + * - Pro Tools 9 and higher: 16,383 samples at 44.1/48 kHz, 32,767 samples at 88.2/96 kHz, or 65,534 samples at 176.4/192 kHz + * - Media Composer 8.1 and higher: 16,383 samples at 44.1/48 kHz, 32,767 samples at 88.2/96 kHz + */ + AAX_eProperty_LatencyContribution = 56, + /** \brief Specifies which sample rates the Effect supports. A mask of \ref AAX_ESampleRateMask + * + * \li Apply this property at the \b ProcessProc level + * + * \sa \ref AAX_IComponentDescriptor::AddSampleRate() + */ + AAX_eProperty_SampleRate = 58, + /** \brief The plug-in supports a Master Bypass control + * + * \li Apply this property at the \b ProcessProc level + * + * Nearly all %AAX plug-ins should set this property to \c true + * + * Set this property to \c false (0) to disable Master Bypass for plug-ins that cannot be bypassed, + * such as fold-down plug-ins that convert to a narrower channel format. + * + * \legacy Was pluginGestalt_CanBypass. + */ + AAX_eProperty_CanBypass = 60, + /** \brief Side chain stem format. One of \ref AAX_EStemFormat + * + * \compatibility Currently Pro Tools supports only \ref AAX_eStemFormat_Mono side chain inputs + * + * \li Apply this property at the \b ProcessProc level + * + * \compatibility AAX_eProperty_SideChainStemFormat is not currently implemented in DAE or AAE + */ + AAX_eProperty_SideChainStemFormat = 61, + //@}end General properties + +//--------------------------------------------------------------------- +#if 0 +#pragma mark TI-specific properties +#endif + /** @name TI-specific properties + * + */ + //@{ + /** \brief Shared cycle count (outer, per clump, loop overhead) + * + * \li Apply this property at the \b ProcessProc level + * \li This property is only applicable to DSP algorithms + */ + AAX_eProperty_TI_SharedCycleCount = 62, + /** \brief Instance cycle count (inner, per instance, loop overhead) + * + * \li Apply this property at the \b ProcessProc level + * \li This property is only applicable to DSP algorithms + */ + AAX_eProperty_TI_InstanceCycleCount = 63, + /** \brief Maximum number of instances of this plug-in that can be loaded on a chip. This + * property is only used for DMA and background thread-enabled plug-ins. + * + * \li Apply this property at the \b ProcessProc level + * \li This property is only applicable to DSP algorithms + */ + AAX_eProperty_TI_MaxInstancesPerChip = 64, + /** \brief Allow different plug-in types to share the same DSP even if + * \ref AAX_eProperty_TI_MaxInstancesPerChip is declared + * + * In general, this is not desired behavior. However, this can be useful if your plug-in + * instance counts are bound by a system constraint other than CPU usage and you require + * chip-sharing between instances of different types of the plug-in. + * + * \note In addition to defining this property, the types which will share allocations on + * the same DSP chip must be compiled into the same ELF DLL file. + * + * \li Apply this property at the \b ProcessProc level + * \li This property is only applicable to DSP algorithms + */ + AAX_eProperty_TI_ForceAllowChipSharing = 65, + //@}end TI-specific properties + +//--------------------------------------------------------------------- +#if 0 +#pragma mark General properties (continued) +#endif + /** @name General properties + * + * + * + */ + //@{ + /** \brief The plug-in never alters its audio signal, audio output is always equal to audio input + * + * \li Apply this property at the \b ProcessProc level + * + * Setting this property allows host to optimize audio routing and reduce audio latency. + */ + AAX_eProperty_AlwaysBypass = 75, + /** \brief Indicates whether or not the plug-in should be shown in insert menus. + * + * \li Apply this property to show or hide the plug-in from the Pro Tools insert menus. + * \li This property value is \c true by default. + */ + AAX_eProperty_ShowInMenus = 76, + //@}end General properties (continued) + +//--------------------------------------------------------------------- +#if 0 +#pragma mark AAX Hybrid properties +#endif + /** @name %AAX Hybrid properties + * + */ + //@{ + /** \brief Hybrid Output stem format. One of \ref AAX_EStemFormat + * + * This property represents the stem format for the audio channels that are sent from the + * ProcessProc callback to the \ref AAX_IEffectParameters::RenderAudio_Hybrid() method + * + * \li Apply this property at the \b ProcessProc level + * \li Normally plugins will set this to the same thing as \ref AAX_eProperty_InputStemFormat + * + * \ingroup additionalFeatures_Hybrid + */ + AAX_eProperty_HybridOutputStemFormat = 90, + /** \brief Hybrid Input stem format. One of \ref AAX_EStemFormat + * + * This property represents the stem format for the audio channels that are sent from the + * \ref AAX_IEffectParameters::RenderAudio_Hybrid() method to the ProcessProc callback + * + * \li Apply this property at the \b ProcessProc level + * \li Normally plugins will set this to the same thing as \ref AAX_eProperty_OutputStemFormat + * + * \ingroup additionalFeatures_Hybrid + */ + AAX_eProperty_HybridInputStemFormat = 91, + //@}end %AAX Hybrid properties + +//--------------------------------------------------------------------- +#if 0 +#pragma mark Offline (AudioSuite) properties +#endif + /** @name Offline (AudioSuite) properties + * + */ + //@{ + /**
*/ + AAX_eProperty_AudiosuitePropsBase = 100, + /** \brief The Effect requires random access to audio data + * + * \li Apply this property at the \ref AAX_IEffectDescriptor level + * \li This property is only applicable to \ref AuxInterface_HostProcessor "Host Processor" + * algorithms + * + * \legacy Was pluginGestalt_UsesRandomAccess + */ + AAX_eProperty_UsesRandomAccess = 101, + /** \brief The Effect requires an analysis pass + * + * \li Apply this property at the \ref AAX_IEffectDescriptor level + * \li This property is only applicable to offline processing + * + * \legacy Was pluginGestalt_RequiresAnalysis + */ + AAX_eProperty_RequiresAnalysis = 102, + /** \brief The Effect supports an analysis pass, but does not require it + * + * \compatibility In Media Composer, optional analysis will also be performed automatically + * before each channel is rendered. See \ref MCDEV-2904 + * + * \li Apply this property at the \ref AAX_IEffectDescriptor level + * \li This property is only applicable to offline processing + * + * \legacy Was pluginGestalt_OptionalAnalysis + */ + AAX_eProperty_OptionalAnalysis = 103, + /** \brief The Effect requires analysis, but is also allowed to preview + * + * \li Apply this property at the \ref AAX_IEffectDescriptor level + * \li This property is only applicable to offline processing + * + * \legacy Was pluginGestalt_AnalyzeOnTheFly + */ + AAX_eProperty_AllowPreviewWithoutAnalysis = 104, + /** \brief Informs the host application to reassign output to a different track + * + * \li Apply this property at the \ref AAX_IEffectDescriptor level + * \li This property is only applicable to offline processing + * + * \compatibility This property is not supported on Media Composer + * + * \legacy Was pluginGestalt_DestinationTrack + */ + AAX_eProperty_DestinationTrack = 105, + /** \brief The host should make all of the processed track's data available to the Effect + * + * \li Apply this property at the \ref AAX_IEffectDescriptor level + * \li This property is only applicable to \ref AuxInterface_HostProcessor "Host Processor" + * algorithms + * + * \legacy Was pluginGestalt_RequestsAllTrackData + */ + AAX_eProperty_RequestsAllTrackData = 106, + /** \brief The Effect only processes on continuous data and does not support 'clip by clip' + * rendering + * + * \li Apply this property at the \ref AAX_IEffectDescriptor level + * \li This property is only applicable to offline processing + * + * \legacy Was pluginGestalt_ContinuousOnly + */ + AAX_eProperty_ContinuousOnly = 107, + /** \brief The Effect wants multi-input mode only (no mono mode option) + * + * \note See bug \ref PT-258560 + * + * \li Apply this property at the \ref AAX_IEffectDescriptor level + * \li This property is only applicable to offline processing + * + * \legacy Was pluginGestalt_MultiInputModeOnly + */ + AAX_eProperty_MultiInputModeOnly = 108, + /** \brief The Effect does not support preview + * + * \li Apply this property at the \ref AAX_IEffectDescriptor level + * \li This property is only applicable to offline processing + * + * \legacy Was pluginGestalt_DisablePreview + */ + AAX_eProperty_DisablePreview = 110, + /** \brief The Effect may not increment its output sample during some rendering calls + * + * \li Apply this property at the \ref AAX_IEffectDescriptor level + * \li This property is only applicable to \ref AuxInterface_HostProcessor "Host Processor" + * algorithms + * + * \legacy Was pluginGestalt_DoesntIncrOutputSample + */ + AAX_eProperty_DoesntIncrOutputSample = 112, + /** \brief The number of input channels that the plug-in supports + * + * \li Apply this property at the \ref AAX_IEffectDescriptor level + * \li This property is only applicable to \ref AuxInterface_HostProcessor "Host Processor" + * algorithms + * + * For real-time processing, use \ref AAX_eProperty_InputStemFormat + */ + AAX_eProperty_NumberOfInputs = 113, + /** \brief The number of output channels that the plug-in supports + * + * \li Apply this property at the \ref AAX_IEffectDescriptor level + * \li This property is only applicable to \ref AuxInterface_HostProcessor "Host Processor" + * algorithms + * + * For real-time processing, use \ref AAX_eProperty_OutputStemFormat + */ + AAX_eProperty_NumberOfOutputs = 114, + /** \brief Prevents the application of rendered region handles by the host + * + * \li Apply this property at the \ref AAX_IEffectDescriptor level + * \li This property is only applicable to offline processing + */ + AAX_eProperty_DisableHandles = 115, + /** \brief Tells the host that the plug-in supports side chain inputs + * + * \li Apply this property at the \ref AAX_IEffectDescriptor level + * \li This property is only applicable to offline processing + */ + AAX_eProperty_SupportsSideChainInput = 116, + /** \brief Requests that the host apply dithering to the Effect's output + * + * \li Apply this property at the \ref AAX_IEffectDescriptor level + * \li This property is only applicable to offline processing + * + * \legacy Was pluginGestalt_NeedsOutputDithered + */ + AAX_eProperty_NeedsOutputDithered = 117, + /** \brief The plug-in supports audiosuite reverse. By default, all reverb and delay + * plug-ins support this feature. If a plug-in needs to opt out of this feature, they + * can set this property to true. + * + * \li Apply this property at the \ref AAX_IEffectDescriptor level + * \li This property is only applicable to offline processing + * + * \compatibility AAX_eProperty_DisableAudiosuiteReverse is not currently implemented + */ + AAX_eProperty_DisableAudiosuiteReverse = 118, + + AAX_eProperty_MaxASProp, // Intentionally given no explicit value + //@}end Offline (AudioSuite) properties + +//--------------------------------------------------------------------- +#if 0 +#pragma mark GUI properties +#endif + /** @name GUI properties + * + */ + //@{ + /**
*/ + AAX_eProperty_GUIBase = 150, + /** \brief Requests a host-generated GUI based on the Effect's parameters + * + * Use this property while your plug-in is in development to test the plug-in's + * data model and algorithm before its GUI has been created, or when troubleshooting + * problems to isolate the data model and algorithm operation from the plug-in's GUI. + * + * \li Apply this property at the \b ProcessProc level + * + * \compatibility Currently supported by Pro Tools only + * + * \note See \ref PTSW-189725 + */ + AAX_eProperty_UsesClientGUI = 151, + + AAX_eProperty_MaxGUIProp, // Intentionally given no explicit value + //@}end GUI properties + +//--------------------------------------------------------------------- +#if 0 +#pragma mark Meter properties +#endif + /** @name Meter properties + * + * These properties define the behavior of individual meters + * + * For more information about meters in AAX, see \ref AdditionalFeatures_Meters + */ + //@{ + /**
*/ + AAX_eProperty_MeterBase = 199, + /** \brief Indicates meter type as one of \ref AAX_EMeterType + * + * \li Apply this property at the \ref AAX_IEffectDescriptor::AddMeterDescription() level + */ + AAX_eProperty_Meter_Type = 200, + /** \brief Indicates meter orientation as one of \ref AAX_EMeterOrientation + * + * \li Apply this property at the \ref AAX_IEffectDescriptor::AddMeterDescription() level + */ + AAX_eProperty_Meter_Orientation = 201, + /** \brief Indicates meter ballistics preference as one of \ref AAX_EMeterBallisticType + * + * \li Apply this property at the \ref AAX_IEffectDescriptor::AddMeterDescription() level + */ + AAX_eProperty_Meter_Ballistics = 202, + + AAX_eProperty_MaxMeterProp, // Intentionally given no explicit value + //@}end GUI properties + +//--------------------------------------------------------------------- +#if 0 +#pragma mark Plug-in management constraints +#endif + /** @name Plug-in management constraints + * + * These properties define constraints on how the host may manage + * the plug-in's various components and modules, as well as its + * overall configuration. + */ + //@{ + /**
*/ + AAX_eProperty_ConstraintBase = 299, + /** \brief Constraint on the algorithm's location, as a mask of \ref AAX_EConstraintLocationMask + * + * \li Apply this property at the \b ProcessProc level + */ + AAX_eProperty_Constraint_Location = 300, + /** \brief Constraint on the topology of the Effect's modules, as one of + * \ref AAX_EConstraintTopology + * + * \li Apply this property at the \ref AAX_IEffectDescriptor level + */ + AAX_eProperty_Constraint_Topology = 301, + /** \brief Tells the host that it should never unload the plug-in binary + * + * \li Apply this property at the \ref AAX_IEffectDescriptor level + * + * \compatibility AAX_eProperty_Constraint_NeverUnload is not currently implemented in DAE or AAE + */ + AAX_eProperty_Constraint_NeverUnload = 302, + /** \brief Tells the host that it should never cache the plug-in binary. Only use this if required as + * there is a performance penalty on launch to not use the Cache. Set this property to 1, if you really need + * to not cache. Default is 0. + * + * The most common reason for a plug-in to require this constraint is if the plug-in's configuration can + * change based on external conditions. Most of the data contained in the plug-in's description routine is + * cached, so if the plug-in description can change between launches of the host application then the plug-in + * should apply this constraint to prevent the host from using stale description information. + * + * This property should be applied at the collection level as it affects the entire bundle. + * + * \li Apply this property at the \ref AAX_IEffectDescriptor level + */ + AAX_eProperty_Constraint_NeverCache = 303, + /** \brief Indicates whether or not the plug-in supports multi-mono configurations + * (\c true/\c false) + * + * \note Multi-mono mode may not work as expected for VIs and other plug-ins which rely on non-global + * MIDI input. Depending on the host, multi-mono instances may not all be automatically connected to + * the same MIDI port upon instantiation. Therefore it is recommended to set this property to \c 0 for + * any plug-ins if this lack of automatic connection may confuse users. + * + * \li Apply this property at the \b ProcessProc level + */ + AAX_eProperty_Constraint_MultiMonoSupport = 304, + + AAX_eProperty_MaxConstraintProp, // Intentionally given no explicit value + //@} end Plug-in management constraints (NOTE: CONTINUED BELOW) + +//--------------------------------------------------------------------- +#if 0 +#pragma mark Plug-in features +#endif + /** @name Plug-in features + * + * These properties declare plug-in support (or lack of support) for certain + * host features. + */ + //@{ + AAX_eProperty_FeaturesBase = 305, // No room was given, so this equals AAX_eProperty_SupportsSaveRestore + /** \brief Indicates whether or not the plug-in supports Save/Restore features. + * (\c true/\c false) + * + * \li Apply this property to show or hide the Settings section in the plug-in window. + * \li This property value is true by default. + * + * \legacy Was pluginGestalt_SupportsSaveRestore + */ + AAX_eProperty_SupportsSaveRestore = 305, + /** \brief Indicates whether or not the plug-in uses transport requests. + * (\c true/\c false) + * + * \li Apply this property if your plug-in uses AAX_ITransport class. + * \li Apply this property at the \ref AAX_IEffectDescriptor level + */ + AAX_eProperty_UsesTransport = 306, + /** \brief This property specifies whether the plug-in bundle contains an XML file per plug-in type. + * + * \details + * %AAX plug-ins always provide XML page table data via external files referenced by + * \ref AAX_eResourceType_PageTable. If \ref AAX_eProperty_StoreXMLPageTablesByEffect is not defined + * or is set to 0 (the default) then the host may assume that all Effects in the collection use the same XML + * page table file. If this property is set to a non-zero value, the plug-in may describe a different + * \ref AAX_eResourceType_PageTable for each separate Effect. + * + * This property needs to be set at the collection level. + */ + AAX_eProperty_StoreXMLPageTablesByEffect = 307, + /** \brief \deprecated Use \ref AAX_eProperty_StoreXMLPageTablesByEffect + */ + AAX_eProperty_StoreXMLPageTablesByType = AAX_eProperty_StoreXMLPageTablesByEffect, + /** \brief Indicates whether the plug-in supports SetChunk and GetChunk calls on threads other than the main thread. + * It is actually important for plug-ins to support these calls on non-main threads, so that is the default. + * However, in response to a few companies having issues with this, we have decided to support this constraint + * for now. + * + * property value should be set to true if you need Chunk calls on the main thread. + * + * Values: 0 (off, default), 1 (on) + * + * \li Apply this property at the \ref AAX_IEffectDescriptor level + */ + AAX_eProperty_RequiresChunkCallsOnMainThread = 308, + /** \brief Indicates whether the plug-in subscribes to the \ref AAX_eNotificationEvent_TransportStateChanged "TransportStateChanged" notification + * to receive transport info. + * + * property value should be set to true if you need subscribe to the TransportStateNotification. + * + * Values: 0 (off, default), 1 (on) + * + * \li Apply this property at the \ref AAX_IEffectDescriptor level + */ + AAX_eProperty_ObservesTransportState = 309, + /** \brief Indicates whether or not the plug-in uses transport control requests. + * (\c true/\c false) + * + * \li Apply this property if your plug-in uses \ref AAX_IACFTransportControl methods in the \ref AAX_ITransport class. + * \li Apply this property at the \ref AAX_IEffectDescriptor level + */ + AAX_eProperty_UsesTransportControl = 311, + + AAX_eProperty_MaxFeaturesProp, // Intentionally given no explicit value + //@} end Plug-in features + +//--------------------------------------------------------------------- +#if 0 +#pragma mark Plug-in management constraints (continued) +#endif + /** @name Plug-in management constraints + * + * + */ + //@{ + AAX_eProperty_ConstraintBase_2 = 350, + + /** \brief Indicates that the plug-in's processing should never be disabled by the host + * (\c true/\c false) + * + * Some hosts will disable processing for plug-in chains in certain circumstances to conserve system resources, e.g. + * when the chains' output drops to silence for an extended period. + * + * \note This property may impact performance of other plug-ins. For example, the Dynamic Plug-In Processing feature + * in Pro Tools operates over chains of plug-ins rather than single instances; any plug-in that defines + * \ref AAX_eProperty_Constraint_AlwaysProcess will force its entire signal chain to continue processing. + * Therefore it is important to avoid using this property unless features such as Dynamic Plug-In Processing are + * actually interfering in some way with the operation of the plug-in. + * + * \li This property value is false by default. + * \li Apply this property at the \ref AAX_IEffectDescriptor level + */ + AAX_eProperty_Constraint_AlwaysProcess = 351, + + /** \brief Requests that the host does not send default settings chunks to the plug-in + * after instantiation (\c true/\c false) + * + * Some hosts will apply the plug-in's default settings via chunks after creating a + * new plug-in instance as a way to ensure that the all new plug-in instances are + * initialized to the same state. + * + * If a plug-in can make this guarantee itself and does not wish to receive any + * default settings chunks from the host after instantiation then it may set this + * property. + * + * Support for this property is not guaranteed; the plug-in must be able to handle + * default settings chunk application even if this property is set, or clearly + * document the plug-in's host compatibility. + * + * \note See bug \ref PT-284916 + * + * \li Apply this property at the \ref AAX_IEffectDescriptor level + # + + */ + AAX_eProperty_Constraint_DoNotApplyDefaultSettings = 352, + + AAX_eProperty_MaxConstraintProp_2, // Intentionally given no explicit value + //@} end Plug-in management constraints + +//--------------------------------------------------------------------- +#if 0 +#pragma mark Debug properties +#endif + /** @name Debug properties + */ + //@{ + AAX_eProperty_DebugPropertiesBase = 400, + /** \brief Enables host debug logging for this plug-in. + * + * This logging is made via DigiTrace using the DTF_AAXHOST facility, generally at DTP_LOW priority + * + * \li It is recommended to set this property to \c 1 for debug builds and to \c 0 for release builds of a plug-in + * \li Apply this property at the \ref AAX_IEffectDescriptor level + */ + AAX_eProperty_EnableHostDebugLogs = 401, + //@} end Debug properties + + AAX_eProperty_MaxProp, // ALWAYS LEAVE AS LAST PROPERTY VALUE + AAX_eProperty_MaxCap = 10000 // Maximum possible property value over the lifetime of AAX +}; AAX_ENUM_SIZE_CHECK(AAX_EProperty); + +/// @cond ignore +#endif // AAX_PROPERTIES_H +/// @endcond diff --git a/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_Push2ByteStructAlignment.h b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_Push2ByteStructAlignment.h new file mode 100644 index 0000000000..398dd2dcd4 --- /dev/null +++ b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_Push2ByteStructAlignment.h @@ -0,0 +1,106 @@ +/*================================================================================================*/ +/* + * + * Copyright 2014-2015, 2018, 2023-2024 Avid Technology, Inc. + * All rights reserved. + * + * This file is part of the Avid AAX SDK. + * + * The AAX SDK is subject to commercial or open-source licensing. + * + * By using the AAX SDK, you agree to the terms of both the Avid AAX SDK License + * Agreement and Avid Privacy Policy. + * + * AAX SDK License: https://developer.avid.com/aax + * Privacy Policy: https://www.avid.com/legal/privacy-policy-statement + * + * Or: You may also use this code under the terms of the GPL v3 (see + * www.gnu.org/licenses). + * + * THE AAX SDK IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER + * EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE + * DISCLAIMED. + * + */ + +/** + * \file AAX_Push2ByteStructAlignment.h + * + * \brief Set the struct alignment to 2-byte. This file will throw an error on platforms that do + * not support 2-byte alignment (i.e. TI DSPs) + * + * \details + * When setting the alignment for a struct in order to match a particular environment (e.g. + * host/plug-in binary compatibility) the following macros are recommended: + * \li \ref AAX_ALIGN_FILE_HOST + * \li \ref AAX_ALIGN_FILE_ALG + * \li \ref AAX_ALIGN_FILE_RESET + * + * \section AAX_Push2ByteStructAlignment_usagenotes Usage notes + * + * \li Always follow an inclusion of this file with a matching + * inclusion of AAX_PopStructAlignment.h + * + * \li Do not place other file \c \#include after this file. For example: + * \code + * // HeaderFile1.h + * #include AAX_Push2ByteStructAlignment.h + * #include HeaderFile2.h // this file now has 2-byte alignment also!! + * // HeaderFile1.h definitions... + * #include AAX_PopStructAlignment.h + * // end HeaderFile1.h + * \endcode + * This will cause problems if HeaderFile2.h is included elsewhere without the 2-byte + * alignment which will manifest as hard to find run-time bugs. The proper usage is: + * \code + * // HeaderFile1.h + * #include HeaderFile2.h + * #include AAX_Push2ByteStructAlignment.h + * // HeaderFile1.h definitions... + * #include AAX_PopStructAlignment.h + * // end HeaderFile1.h + * \endcode + * + * \sa \ref AAX_Push4ByteStructAlignment.h + * \sa \ref AAX_Push8ByteStructAlignment.h + * \sa \ref AAX_PopStructAlignment.h + * + * \internal + * NOTE: we don't use include guards for this file because it *is* possible to + * include this file multiple times in the same file. + * \endinternal + * + * + */ +/*================================================================================================*/ + +#ifdef _TMS320C6X +#error "TI structure packing changes not supported" +#elif defined (_MSC_VER) +#pragma warning( disable : 4103 ) // used #pragma pack to change alignment +#pragma pack(push, 2) +#elif defined (__GNUC__) +// Uncomment this warning suppression if you really want to apply packing to a virtual data +// structure, but note that there is no guarantee of cross-platform compatibility for such +// a structure. For more information, see the AAX_ALIGN_FILE_ALG macro documentation +// #ifdef __clang__ +// #pragma clang diagnostic push +// #pragma clang diagnostic ignored "-Wno-incompatible-ms-struct" +// #endif +#pragma ms_struct on +// #ifdef __clang__ +// #pragma clang diagnostic pop +// #endif +#pragma pack(push, 2) +#elif defined (__MWERKS__) +#pragma options align=mac68k +#else +#error "You need to supply a pragma here to set structure alignment to 2 bytes" +#endif + +// Nesting of struct alignment headers is not allowed +#ifdef __AAX_CUSTOM_STRUCT_ALIGN_IS_SET__ +#error "Nested AAX struct alignment directives" +#else +#define __AAX_CUSTOM_STRUCT_ALIGN_IS_SET__ +#endif diff --git a/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_Push4ByteStructAlignment.h b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_Push4ByteStructAlignment.h new file mode 100644 index 0000000000..e42bd9d6dd --- /dev/null +++ b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_Push4ByteStructAlignment.h @@ -0,0 +1,105 @@ +/*================================================================================================*/ +/* + * + * Copyright 2014-2015, 2018, 2023-2024 Avid Technology, Inc. + * All rights reserved. + * + * This file is part of the Avid AAX SDK. + * + * The AAX SDK is subject to commercial or open-source licensing. + * + * By using the AAX SDK, you agree to the terms of both the Avid AAX SDK License + * Agreement and Avid Privacy Policy. + * + * AAX SDK License: https://developer.avid.com/aax + * Privacy Policy: https://www.avid.com/legal/privacy-policy-statement + * + * Or: You may also use this code under the terms of the GPL v3 (see + * www.gnu.org/licenses). + * + * THE AAX SDK IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER + * EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE + * DISCLAIMED. + * + */ + +/** + * \file AAX_Push4ByteStructAlignment.h + * + * \brief Set the struct alignment to 4-byte + * + * \details + * When setting the alignment for a struct in order to match a particular environment (e.g. + * host/plug-in binary compatibility) the following macros are recommended: + * \li \ref AAX_ALIGN_FILE_HOST + * \li \ref AAX_ALIGN_FILE_ALG + * \li \ref AAX_ALIGN_FILE_RESET + * + * \section AAX_Push4ByteStructAlignment_usagenotes Usage notes + * + * \li Always follow an inclusion of this file with a matching + * inclusion of AAX_PopStructAlignment.h + * + * \li Do not place other file \c \#include after this file. For example: + * \code + * // HeaderFile1.h + * #include AAX_Push4ByteStructAlignment.h + * #include HeaderFile2.h // this file now has 4-byte alignment also!! + * // HeaderFile1.h definitions... + * #include AAX_PopStructAlignment.h + * // end HeaderFile1.h + * \endcode + * This will cause problems if HeaderFile2.h is included elsewhere without the 4-byte + * alignment which will manifest as hard to find run-time bugs. The proper usage is: + * \code + * // HeaderFile1.h + * #include HeaderFile2.h + * #include AAX_Push4ByteStructAlignment.h + * // HeaderFile1.h definitions... + * #include AAX_PopStructAlignment.h + * // end HeaderFile1.h + * \endcode + * + * \sa \ref AAX_Push2ByteStructAlignment.h + * \sa \ref AAX_Push8ByteStructAlignment.h + * \sa \ref AAX_PopStructAlignment.h + * + * \internal + * NOTE: we don't use include guards for this file because it *is* possible to + * include this file multiple times in the same file. + * \endinternal + * + * + */ +/*================================================================================================*/ + +#ifdef _TMS320C6X +// TI is OK - 4 byte alignment is the only allowed alignment +#elif defined (_MSC_VER) +#pragma warning( disable : 4103 ) // used #pragma pack to change alignment +#pragma pack(push, 4) +#elif defined (__GNUC__) +// Uncomment this warning suppression if you really want to apply packing to a virtual data +// structure, but note that there is no guarantee of cross-platform compatibility for such +// a structure. For more information, see the AAX_ALIGN_FILE_ALG macro documentation +// #ifdef __clang__ +// #pragma clang diagnostic push +// #pragma clang diagnostic ignored "-Wno-incompatible-ms-struct" +// #endif +#pragma ms_struct on +// #ifdef __clang__ +// #pragma clang diagnostic pop +// #endif +#pragma pack(push, 4) +#elif defined (__MWERKS__) +#pragma options align=mac68k +#else +#error "You need to supply a pragma here to set structure alignment to 4 bytes" +#endif + +// Nesting of struct alignment headers is not allowed +#ifdef __AAX_CUSTOM_STRUCT_ALIGN_IS_SET__ +#error "Nested AAX struct alignment directives" +#else +#define __AAX_CUSTOM_STRUCT_ALIGN_IS_SET__ +#endif diff --git a/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_Push8ByteStructAlignment.h b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_Push8ByteStructAlignment.h new file mode 100644 index 0000000000..35d60b3596 --- /dev/null +++ b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_Push8ByteStructAlignment.h @@ -0,0 +1,105 @@ +/*================================================================================================*/ +/* + * + * Copyright 2014-2015, 2018, 2023-2024 Avid Technology, Inc. + * All rights reserved. + * + * This file is part of the Avid AAX SDK. + * + * The AAX SDK is subject to commercial or open-source licensing. + * + * By using the AAX SDK, you agree to the terms of both the Avid AAX SDK License + * Agreement and Avid Privacy Policy. + * + * AAX SDK License: https://developer.avid.com/aax + * Privacy Policy: https://www.avid.com/legal/privacy-policy-statement + * + * Or: You may also use this code under the terms of the GPL v3 (see + * www.gnu.org/licenses). + * + * THE AAX SDK IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER + * EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE + * DISCLAIMED. + * + */ + +/** + * \file AAX_Push8ByteStructAlignment.h + * + * \brief Set the struct alignment to 8-byte + * + * \details + * When setting the alignment for a struct in order to match a particular environment (e.g. + * host/plug-in binary compatibility) the following macros are recommended: + * \li \ref AAX_ALIGN_FILE_HOST + * \li \ref AAX_ALIGN_FILE_ALG + * \li \ref AAX_ALIGN_FILE_RESET + * + * \section AAX_Push8ByteStructAlignment_usagenotes Usage notes + * + * \li Always follow an inclusion of this file with a matching + * inclusion of AAX_PopStructAlignment.h + * + * \li Do not place other file \c \#include after this file. For example: + * \code + * // HeaderFile1.h + * #include AAX_Push8ByteStructAlignment.h + * #include HeaderFile2.h // this file now has 8-byte alignment also!! + * // HeaderFile1.h definitions... + * #include AAX_PopStructAlignment.h + * // end HeaderFile1.h + * \endcode + * This will cause problems if HeaderFile2.h is included elsewhere without the 8-byte + * alignment which will manifest as hard to find run-time bugs. The proper usage is: + * \code + * // HeaderFile1.h + * #include HeaderFile2.h + * #include AAX_Push8ByteStructAlignment.h + * // HeaderFile1.h definitions... + * #include AAX_PopStructAlignment.h + * // end HeaderFile1.h + * \endcode + * + * \sa \ref AAX_Push2ByteStructAlignment.h + * \sa \ref AAX_Push4ByteStructAlignment.h + * \sa \ref AAX_PopStructAlignment.h + * + * \internal + * NOTE: we don't use include guards for this file because it *is* possible to + * include this file multiple times in the same file. + * \endinternal + * + * + */ +/*================================================================================================*/ + +#ifdef _TMS320C6X +// TI is OK - 8 byte alignment is the only allowed alignment +#elif defined (_MSC_VER) +#pragma warning( disable : 4103 ) // used #pragma pack to change alignment +#pragma pack(push, 8) +#elif defined (__GNUC__) +// Uncomment this warning suppression if you really want to apply packing to a virtual data +// structure, but note that there is no guarantee of cross-platform compatibility for such +// a structure. For more information, see the AAX_ALIGN_FILE_ALG macro documentation +// #ifdef __clang__ +// #pragma clang diagnostic push +// #pragma clang diagnostic ignored "-Wno-incompatible-ms-struct" +// #endif +#pragma ms_struct on +// #ifdef __clang__ +// #pragma clang diagnostic pop +// #endif +#pragma pack(push, 8) +#elif defined (__MWERKS__) +#pragma options align=mac68k +#else +#error "You need to supply a pragma here to set structure alignment to 8 bytes" +#endif + +// Nesting of struct alignment headers is not allowed +#ifdef __AAX_CUSTOM_STRUCT_ALIGN_IS_SET__ +#error "Nested AAX struct alignment directives" +#else +#define __AAX_CUSTOM_STRUCT_ALIGN_IS_SET__ +#endif diff --git a/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_SessionDocumentTypes.h b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_SessionDocumentTypes.h new file mode 100644 index 0000000000..b2ac66b466 --- /dev/null +++ b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_SessionDocumentTypes.h @@ -0,0 +1,55 @@ +/*================================================================================================*/ +/* + * + * Copyright 2023-2024 Avid Technology, Inc. + * All rights reserved. + * + * This file is part of the Avid AAX SDK. + * + * The AAX SDK is subject to commercial or open-source licensing. + * + * By using the AAX SDK, you agree to the terms of both the Avid AAX SDK License + * Agreement and Avid Privacy Policy. + * + * AAX SDK License: https://developer.avid.com/aax + * Privacy Policy: https://www.avid.com/legal/privacy-policy-statement + * + * Or: You may also use this code under the terms of the GPL v3 (see + * www.gnu.org/licenses). + * + * THE AAX SDK IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER + * EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE + * DISCLAIMED. + * + */ + +/** + * \file AAX_SessionDocumentTypes.h + */ +/*================================================================================================*/ + +#pragma once +#ifndef AAX_SessionDocumentTypes_H +#define AAX_SessionDocumentTypes_H + +#include "AAX.h" +#include + +AAX_CONSTEXPR AAX_CTypeID kAAX_DataBufferType_TempoBreakpointArray = 'AXtB'; + +#include AAX_ALIGN_FILE_BEGIN +#include AAX_ALIGN_FILE_HOST +#include AAX_ALIGN_FILE_END + +struct AAX_CTempoBreakpoint +{ + int64_t mSampleLocation{0}; + float mValue{0.f}; +}; +static_assert(16 == sizeof(AAX_CTempoBreakpoint), "Unexpected size for AAX_CTempoBreakpoint"); + +#include AAX_ALIGN_FILE_BEGIN +#include AAX_ALIGN_FILE_RESET +#include AAX_ALIGN_FILE_END + +#endif // AAX_SessionDocumentTypes_H diff --git a/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_SliderConversions.h b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_SliderConversions.h new file mode 100644 index 0000000000..6c425d7dd1 --- /dev/null +++ b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_SliderConversions.h @@ -0,0 +1,93 @@ +/*================================================================================================*/ +/* + * + * Copyright 2013-2015, 2023-2024 Avid Technology, Inc. + * All rights reserved. + * + * This file is part of the Avid AAX SDK. + * + * The AAX SDK is subject to commercial or open-source licensing. + * + * By using the AAX SDK, you agree to the terms of both the Avid AAX SDK License + * Agreement and Avid Privacy Policy. + * + * AAX SDK License: https://developer.avid.com/aax + * Privacy Policy: https://www.avid.com/legal/privacy-policy-statement + * + * Or: You may also use this code under the terms of the GPL v3 (see + * www.gnu.org/licenses). + * + * THE AAX SDK IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER + * EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE + * DISCLAIMED. + * + */ + +/** + * \file AAX_SliderConversions.h + * + * \brief Legacy utilities for converting parameter values to and from the normalized full-scale + * 32-bit fixed domain that was used for RTAS/TDM plug-ins. + * + * \details + * \legacy These utilities may be required in order to maintain settings chunk compatibility with + * plug-ins that were ported from the legacy RTAS/TDM format. + * + * \note %AAX does not provide facilities for converting to and from extended80 data types. If you + * use these types in your plug-in settings then you must provide your own chunk data parsing + * routines. + * + */ +/*================================================================================================*/ + + +#pragma once + +#ifndef AAX_SLIDERCONVERSIONS_H +#define AAX_SLIDERCONVERSIONS_H + +#include "AAX.h" +#include +#include + + +#define AAX_LIMIT(v1,firstVal,secondVal) ( (secondVal > firstVal) ? (std::max)((std::min)(v1,secondVal),firstVal) : (std::min)((std::max)(v1,secondVal),firstVal) ) + +int32_t LongControlToNewRange (int32_t aValue, int32_t rangeMin, int32_t rangeMax); + +/** \brief Convert from int32_t control value 0x80000000...0x7FFFFFFF + * to a int32_t ranging from rangeMin to rangeMax (linear) + */ +int32_t LongToLongControl (int32_t aValue, int32_t rangeMin, int32_t rangeMax); + +/** \brief Convert from int32_t control value 0x80000000...0x7FFFFFFF + * to an double ranging from firstVal to secondVal (linear) + */ +double LongControlToDouble(int32_t aValue, double firstVal, double secondVal); + +/** \brief Convert from an double ranging from firstVal to secondVal (linear) + * to int32_t control value 0x80000000...0x7FFFFFFF + */ +int32_t DoubleToLongControl (double aValue, double firstVal, double secondVal); + +int32_t DoubleToLongControlNonlinear(double aValue, double* minVal, double* rangePercent, int32_t numRanges); +double LongControlToDoubleNonlinear(int32_t aValue, double* minVal, double* rangePercent, int32_t numRanges); + +/** \brief Convert from int32_t control value 0x80000000...0x7FFFFFFF + * to an double ranging from minVal to maxVal (logarithmic) + * + * \details + * \note This is LOGARITHMIC, so minVal & maxVal have to be > zero! + */ +double LongControlToLogDouble(int32_t aValue, double minVal, double maxVal); + +/** \brief Convert from an double ranging from minVal to maxVal (logarithmic) + * to int32_t control value 0x80000000...0x7FFFFFFF + * + * \details + * \note This is LOGARITHMIC, so minVal & maxVal have to be > zero! + */ +int32_t LogDoubleToLongControl(double aValue, double minVal, double maxVal); + +#endif // AAX_SLIDERCONVERSIONS_H + diff --git a/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_StringUtilities.h b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_StringUtilities.h new file mode 100644 index 0000000000..f15d16516a --- /dev/null +++ b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_StringUtilities.h @@ -0,0 +1,77 @@ +/*================================================================================================*/ +/* + * + * Copyright 2014-2016, 2018, 2023-2024 Avid Technology, Inc. + * All rights reserved. + * + * This file is part of the Avid AAX SDK. + * + * The AAX SDK is subject to commercial or open-source licensing. + * + * By using the AAX SDK, you agree to the terms of both the Avid AAX SDK License + * Agreement and Avid Privacy Policy. + * + * AAX SDK License: https://developer.avid.com/aax + * Privacy Policy: https://www.avid.com/legal/privacy-policy-statement + * + * Or: You may also use this code under the terms of the GPL v3 (see + * www.gnu.org/licenses). + * + * THE AAX SDK IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER + * EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE + * DISCLAIMED. + */ + +/** + * \file AAX_StringUtilities.h + * + * \brief Various string utility definitions for %AAX Native + */ +/*================================================================================================*/ +#pragma once + +#ifndef AAXLibrary_AAX_StringUtilities_h +#define AAXLibrary_AAX_StringUtilities_h + +// AAX headers +#include "AAX.h" +#include "AAX_Enums.h" + +// Standard Library headers +#include + +class AAX_IString; + + +//------------------------------------------------ +#pragma mark Utility functions + +namespace AAX +{ + inline void GetCStringOfLength(char *stringOut, const char* stringIn, int32_t aMaxChars); + inline int32_t Caseless_strcmp(const char* cs, const char* ct); + + inline std::string Binary2String(uint32_t binaryValue, int32_t numBits); + inline uint32_t String2Binary(const AAX_IString& s); + + inline bool IsASCII(char inChar); + inline bool IsFourCharASCII(uint32_t inFourChar); + + inline std::string AsStringFourChar(uint32_t inFourChar); + inline std::string AsStringPropertyValue(AAX_EProperty inProperty, AAX_CPropertyValue inPropertyValue); + inline std::string AsStringInt32(int32_t inInt32); + inline std::string AsStringUInt32(uint32_t inUInt32); + inline std::string AsStringIDTriad(const AAX_SPlugInIdentifierTriad& inIDTriad); + inline std::string AsStringStemFormat(AAX_EStemFormat inStemFormat, bool inAbbreviate = false); + inline std::string AsStringStemChannel(AAX_EStemFormat inStemFormat, uint32_t inChannelIndex, bool inAbbreviate); + inline std::string AsStringResult(AAX_Result inResult); +} // namespace AAX + + +//------------------------------------------------------ +#pragma mark Implementation header + +#include "AAX_StringUtilities.hpp" + + +#endif /* AAXLibrary_AAX_StringUtilities_h */ diff --git a/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_StringUtilities.hpp b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_StringUtilities.hpp new file mode 100644 index 0000000000..73057431d2 --- /dev/null +++ b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_StringUtilities.hpp @@ -0,0 +1,847 @@ +/*================================================================================================*/ +/* + * Copyright 2014-2017, 2019-2021, 2023-2024 Avid Technology, Inc. + * All rights reserved. + * + * This file is part of the Avid AAX SDK. + * + * The AAX SDK is subject to commercial or open-source licensing. + * + * By using the AAX SDK, you agree to the terms of both the Avid AAX SDK License + * Agreement and Avid Privacy Policy. + * + * AAX SDK License: https://developer.avid.com/aax + * Privacy Policy: https://www.avid.com/legal/privacy-policy-statement + * + * Or: You may also use this code under the terms of the GPL v3 (see + * www.gnu.org/licenses). + * + * THE AAX SDK IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER + * EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE + * DISCLAIMED. + */ +/*================================================================================================*/ + +#ifndef AAXLibrary_AAX_StringUtilities_hpp +#define AAXLibrary_AAX_StringUtilities_hpp + +#include "AAX_IString.h" +#include "AAX_Errors.h" +#include "AAX_Assert.h" + +#include +#include + +#include +#include +#include +#include + +//=========================================================================== +// +// FloatToString: Convert the given floating point number to a pascal string. +// +//=========================================================================== +/* +void FloatToString(float aNumber, StringPtr aString) +{ + Str255 MantissaStr; + double aDouble; + StringPtr tempStr; + int32_t mantissa,tens,hundreds; + int16_t count; + + aDouble = (double) aNumber; + if (aNumber < 0.0) // take abs value + aDouble = -aDouble; + + aDouble += 0.005; // perform rounding by adding 1/2 of the hundreths digit + + mantissa = aDouble; + tens = (aDouble * 10.0) - (mantissa * 10.0); + hundreds = (aDouble * 100.0) - (mantissa * 100.0) - (tens * 10.0); + + NumToString(mantissa, MantissaStr); + + // set up string length + if (aNumber < 0.0) + *aString++ = (char) (1 + 3 + *MantissaStr); + else + *aString++ = (char) (3 + *MantissaStr); + + tempStr = MantissaStr; + + // copy mantissa first + count = *tempStr++; + + if (aNumber < 0.0) + *aString++ = '-'; + + while (count--) + *aString++ = *tempStr++; + + *aString++ = '.'; + *aString++ = (char) (tens + '0'); + *aString++ = (char) (hundreds + '0'); +} +*/ + +///============================================================== +// +// GetCStringOfLength +// +// A routine for selecting a string based on the size passed in +// by the client. If none of the strings are short enough then +// the shortest string is truncated to fit. +// +// stringIn="A Very Nice String\nA String\nAStrng\nStr\n"; +// +// Submitted from Erik Gavriluk of BombFactory (Free of Charge) +// Debugged and separator character changed by Frederick Umminger +//=============================================================== + +void AAX::GetCStringOfLength(char *s_out, const char* s_in, int32_t aMaxChars) +{ + AAX_ASSERT(0 < aMaxChars); + + const char kSeparator = '\n'; + + if(s_in) + { + const char* s_begin = s_in; + const char* s_end = s_begin; + while(s_begin) + { + // Count characters in current substring + while((*s_end != kSeparator) && (*s_end != '\0')) + { + s_end++; + }; + + // If substring is less than or equal to aMaxChars then use it. + if((s_end-s_begin <= aMaxChars) || (*s_end=='\0')) + { + break; + } + + s_begin = ++s_end; + } + // We don't use strncpy in order to make sure a '\0' gets put on the end of s_out + *s_out = '\0'; + const int32_t length = int32_t(s_end-s_begin); + if (0 < length && 0 < aMaxChars) + { + std::strncat(s_out, s_begin, static_cast(std::max(0, std::min(aMaxChars,length)))); + } + } + else if (0 < aMaxChars) + { + strncpy(s_out, "", static_cast(aMaxChars)); + }; +} + +int32_t AAX::Caseless_strcmp(const char* cs, const char* ct) +{ + if(cs) + { + if(ct) + { + while(*cs && *ct) + { + int32_t cmp = toupper(*ct++) - toupper(*cs++); + if(cmp) return cmp; + }; + if(*cs) + { + return -1; + } + else + { + if(*ct) + { + return 1; + } + else + { + return 0; + }; + }; + } + else + { + return -1; + }; + } + else + { + if(ct) + return 1; + else + return 0; + } + +} + + +std::string AAX::Binary2String(uint32_t value, int32_t numBits) +{ + std::string s; + + uint32_t currentBitMask = (static_cast(0x1) << (numBits-1)); + + while (currentBitMask != 0) + { + if (currentBitMask & value) + { + s += "1"; + } + else + { + s += "0"; + }; + currentBitMask >>= 1; + } + return s; +} + +uint32_t AAX::String2Binary(const AAX_IString& s) +{ + uint32_t value = 0; + + const char* const cS = s.Get(); + int32_t length = int32_t(s.Length()); + for(int32_t i = 0; i < length ; i++) + { + switch(cS[i]) + { + case '0': + break; + case '1': + value |= (0x1 << (length-1-i)); + break; + default: + AAX_ASSERT('0' == cS[i] || '1' == cS[i]); + }; + }; + + return value; +} + +bool AAX::IsASCII(char inChar) +{ + return (0x20 <= inChar) && (0x7E >= inChar); +} + +bool AAX::IsFourCharASCII(uint32_t inFourChar) +{ + const uint32_t oneCharMask = 0x000000FF; + const size_t oneCharNumBits = 8; + + bool result = true; + for (uint16_t i = 3; true == result /* i value checked within loop */; --i) + { + const char curChar = static_cast((inFourChar >> (i*oneCharNumBits)) & oneCharMask); + result = result && IsASCII(curChar); + if (0 == i) { break; } + } + return result; +} + +std::string AAX::AsStringFourChar(uint32_t inFourChar) +{ + AAX_CONSTEXPR uint32_t oneCharMask = 0x000000FF; + AAX_CONSTEXPR int16_t oneCharNumBits = 8; + AAX_CONSTEXPR auto unknownChar = "(?)"; // for current usage, a raw string here is slightly more efficient than a std::string + + std::string resultStr; + for (int16_t i = 3; i >= 0; --i) + { + const char curChar = static_cast((inFourChar >> (i*oneCharNumBits)) & oneCharMask); + + // Prefer an explicit 'if' statement instead of a ternary operator to allow using the most + // efficient 'append' operator in each case + if (IsASCII(curChar)) + { + resultStr += curChar; + } + else + { + resultStr += unknownChar; + } + } + return resultStr; +} + +namespace AAX { namespace internal { +template +std::string ToHexadecimal(T inValue, bool inLeadingZeros = false) +{ + AAX_CONSTEXPR char hexChars[] = "0123456789abcdef"; + AAX_CONSTEXPR size_t size = sizeof(T) * 2; + + std::string buffer{"0"}; + + // This conditional is to respect the expected output on 'inValud=0': "0" (instead of "0x0") + if (inValue) + { + buffer += 'x'; + bool first_non_zero = inLeadingZeros; + + // Largest integers will have 16 hex characters, just below the short-string + // optimization of std::string, so no dynamic allocation is required + for (size_t i = 0; i < size; ++i) + { + const auto c = hexChars[(inValue >> 4 * (size - 1 - i)) & 0xf]; + if (first_non_zero || c != '0') + { + first_non_zero = true; + buffer += c; + } + } + } + + return buffer; +} +}} + +std::string AAX::AsStringPropertyValue(AAX_EProperty inProperty, AAX_CPropertyValue inPropertyValue) +{ + // Attempt to infer a sensible way to print the property + if (AAX_eProperty_SampleRate == inProperty || + AAX_eProperty_Constraint_Location == inProperty) + { + // Print specific properties' values as bitfield + + // We want the exact bits, so we memcpy to avoid any potential issues + // with casting from signed to unsigned + uint32_t bitfield; + memcpy(&bitfield, &inPropertyValue, sizeof(uint32_t)); + + AAX_CONSTEXPR int32_t maxNumBitsToShow = 8; // Currently there are no bitfield properties with more than 8 possible flags + return AAX::Binary2String(bitfield, maxNumBitsToShow); + } + + if (AAX::IsFourCharASCII(static_cast(inPropertyValue))) + { + // Print values in ASCII range as four-char + return '\'' + AAX::AsStringFourChar(static_cast(inPropertyValue)) + '\''; + } + + if (0x00FFFFFF < abs(inPropertyValue)) + { + // Print values with most bits used as hex + return internal::ToHexadecimal(inPropertyValue); + } + + // Otherwise, print as simple decimal + return std::to_string(static_cast(inPropertyValue)); +} + +std::string AAX::AsStringInt32(int32_t inInt32) +{ + return std::to_string((long int)inInt32); +} + +std::string AAX::AsStringUInt32(uint32_t inUInt32) +{ + return std::to_string((unsigned long)inUInt32); +} + +std::string AAX::AsStringIDTriad(const AAX_SPlugInIdentifierTriad& inIDTriad) +{ + std::string result = "("; + + result += "man: '" + AAX::AsStringFourChar(inIDTriad.mManufacturerID) + "', "; + result += "prod: '" + AAX::AsStringFourChar(inIDTriad.mProductID) + "', "; + result += "type: '" + AAX::AsStringFourChar(inIDTriad.mPlugInID) + "'"; + + result += ")"; + return result; +} + +std::string AAX::AsStringStemFormat(AAX_EStemFormat inStemFormat, bool inAbbreviate) +{ + switch (inStemFormat) + { + case AAX_eStemFormat_Mono: { return std::string("Mono"); break; } + case AAX_eStemFormat_Stereo: { return std::string(inAbbreviate ? "St" : "Stereo"); break; } + case AAX_eStemFormat_LCR: { return std::string("LCR"); break; } + case AAX_eStemFormat_LCRS: { return std::string("LCRS"); break; } + case AAX_eStemFormat_Quad: { return std::string("Quad"); break; } + case AAX_eStemFormat_5_0: { return std::string("5.0"); break; } + case AAX_eStemFormat_5_1: { return std::string("5.1"); break; } + case AAX_eStemFormat_6_0: { return std::string("6.0"); break; } + case AAX_eStemFormat_6_1: { return std::string("6.1"); break; } + case AAX_eStemFormat_7_0_SDDS: { return std::string(inAbbreviate ? "7.0 S" : "7.0 SDDS"); break; } + case AAX_eStemFormat_7_1_SDDS: { return std::string(inAbbreviate ? "7.1 S" : "7.1 SDDS"); break; } + case AAX_eStemFormat_7_0_DTS: { return std::string("7.0"); break; } + case AAX_eStemFormat_7_1_DTS: { return std::string("7.1"); break; } + case AAX_eStemFormat_7_0_2: {return std::string("7.0.2"); break; } + case AAX_eStemFormat_7_1_2: { return std::string("7.1.2"); break; } + case AAX_eStemFormat_Ambi_1_ACN: { return std::string(inAbbreviate ? "Amb1" : "Ambisonics (1st Order)"); break; } + case AAX_eStemFormat_Ambi_2_ACN: { return std::string(inAbbreviate ? "Amb2" : "Ambisonics (2nd Order)"); break; } + case AAX_eStemFormat_Ambi_3_ACN: { return std::string(inAbbreviate ? "Amb3" : "Ambisonics (3rd Order)"); break; } + case AAX_eStemFormat_Ambi_4_ACN: { return std::string(inAbbreviate ? "Amb4" : "Ambisonics (4th Order)"); break; } + case AAX_eStemFormat_Ambi_5_ACN: { return std::string(inAbbreviate ? "Amb5" : "Ambisonics (5th Order)"); break; } + case AAX_eStemFormat_Ambi_6_ACN: { return std::string(inAbbreviate ? "Amb6" : "Ambisonics (6th Order)"); break; } + case AAX_eStemFormat_Ambi_7_ACN: { return std::string(inAbbreviate ? "Amb7" : "Ambisonics (7th Order)"); break; } + case AAX_eStemFormat_5_0_2: { return std::string("5.0.2"); break; } + case AAX_eStemFormat_5_1_2: { return std::string("5.1.2"); break; } + case AAX_eStemFormat_5_0_4: { return std::string("5.0.4"); break; } + case AAX_eStemFormat_5_1_4: { return std::string("5.1.4"); break; } + case AAX_eStemFormat_7_0_4: { return std::string("7.0.4"); break; } + case AAX_eStemFormat_7_1_4: { return std::string("7.1.4"); break; } + case AAX_eStemFormat_7_0_6: { return std::string("7.0.6"); break; } + case AAX_eStemFormat_7_1_6: { return std::string("7.1.6"); break; } + case AAX_eStemFormat_9_0_4: { return std::string("9.0.4"); break; } + case AAX_eStemFormat_9_1_4: { return std::string("9.1.4"); break; } + case AAX_eStemFormat_9_0_6: { return std::string("9.0.6"); break; } + case AAX_eStemFormat_9_1_6: { return std::string("9.1.6"); break; } + + + case AAX_eStemFormat_None: { return std::string("None"); break; } + case AAX_eStemFormat_Any: { return std::string("Any"); break; } + + case AAX_eStemFormat_INT32_MAX: + case AAX_eStemFormatNum: + default: { return std::string(inAbbreviate ? "unk" : "unknown stem format"); break; } + } +} + +std::string AAX::AsStringStemChannel(AAX_EStemFormat inStemFormat, uint32_t inChannelIndex, bool inAbbreviate) +{ + switch (inStemFormat) + { + case AAX_eStemFormat_Mono: + if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "M" : "Audio"); } + break; + case AAX_eStemFormat_Stereo: + if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "L" : "Left"); } + if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "R" : "Right"); } + break; + case AAX_eStemFormat_LCR: + if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "L" : "Left"); } + if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "C" : "Center"); } + if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "R" : "Right"); } + break; + case AAX_eStemFormat_LCRS: + if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "L" : "Left"); } + if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "C" : "Center"); } + if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "R" : "Right"); } + if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "S" : "Surround"); } + break; + case AAX_eStemFormat_Quad: + if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "L" : "Left"); } + if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "R" : "Right"); } + if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Ls" : "Left Surround"); } + if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Rs" : "Right Surround"); } + break; + case AAX_eStemFormat_5_0: + if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "L" : "Left"); } + if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "C" : "Center"); } + if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "R" : "Right"); } + if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Ls" : "Left Surround"); } + if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Rs" : "Right Surround"); } + break; + case AAX_eStemFormat_5_1: + if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "L" : "Left"); } + if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "C" : "Center"); } + if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "R" : "Right"); } + if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Ls" : "Left Surround"); } + if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Rs" : "Right Surround"); } + if (0 == inChannelIndex--) { return std::string("LFE"); } + break; + case AAX_eStemFormat_6_0: + if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "L" : "Left"); } + if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "C" : "Center"); } + if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "R" : "Right"); } + if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Ls" : "Left Surround"); } + if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Cs" : "Center Surround"); } + if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Rs" : "Right Surround"); } + break; + case AAX_eStemFormat_6_1: + if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "L" : "Left"); } + if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "C" : "Center"); } + if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "R" : "Right"); } + if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Ls" : "Left Surround"); } + if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Cs" : "Center Surround"); } + if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Rs" : "Right Surround"); } + if (0 == inChannelIndex--) { return std::string("LFE"); } + break; + case AAX_eStemFormat_7_0_SDDS: + if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "L" : "Left"); } + if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Lc" : "Left Center"); } + if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "C" : "Center"); } + if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Rc" : "Right Center"); } + if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "R" : "Right"); } + if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Ls" : "Left Surround"); } + if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Rs" : "Right Surround"); } + break; + case AAX_eStemFormat_7_1_SDDS: + if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "L" : "Left"); } + if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Lc" : "Left Center"); } + if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "C" : "Center"); } + if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Rc" : "Right Center"); } + if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "R" : "Right"); } + if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Ls" : "Left Surround"); } + if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Rs" : "Right Surround"); } + if (0 == inChannelIndex--) { return std::string("LFE"); } + break; + case AAX_eStemFormat_7_0_DTS: + if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "L" : "Left"); } + if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "C" : "Center"); } + if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "R" : "Right"); } + if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Lss" : "Left Surround Side"); } + if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Rss" : "Right Surround Side"); } + if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Lsr" : "Left Surround Rear"); } + if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Rsr" : "Right Surround Rear"); } + break; + case AAX_eStemFormat_7_1_DTS: + if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "L" : "Left"); } + if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "C" : "Center"); } + if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "R" : "Right"); } + if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Lss" : "Left Surround Side"); } + if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Rss" : "Right Surround Side"); } + if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Lsr" : "Left Surround Rear"); } + if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Rsr" : "Right Surround Rear"); } + if (0 == inChannelIndex--) { return std::string("LFE"); } + break; + case AAX_eStemFormat_7_0_2: + if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "L" : "Left"); } + if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "C" : "Center"); } + if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "R" : "Right"); } + if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Lss" : "Left Surround Side"); } + if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Rss" : "Right Surround Side"); } + if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Lsr" : "Left Surround Rear"); } + if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Rsr" : "Right Surround Rear"); } + if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "LTS" : "Left Top Surround"); } + if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "RTS" : "Right Top Surround"); } + break; + case AAX_eStemFormat_7_1_2: + if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "L" : "Left"); } + if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "C" : "Center"); } + if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "R" : "Right"); } + if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Lss" : "Left Surround Side"); } + if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Rss" : "Right Surround Side"); } + if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Lsr" : "Left Surround Rear"); } + if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Rsr" : "Right Surround Rear"); } + if (0 == inChannelIndex--) { return std::string("LFE"); } + if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "LTS" : "Left Top Surround"); } + if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "RTS" : "Right Top Surround"); } + break; + case AAX_eStemFormat_Ambi_1_ACN: + case AAX_eStemFormat_Ambi_2_ACN: + case AAX_eStemFormat_Ambi_3_ACN: + case AAX_eStemFormat_Ambi_4_ACN: + case AAX_eStemFormat_Ambi_5_ACN: + case AAX_eStemFormat_Ambi_6_ACN: + case AAX_eStemFormat_Ambi_7_ACN: + if (0 == inChannelIndex--) { return std::string("1"); } + if (0 == inChannelIndex--) { return std::string("2"); } + if (0 == inChannelIndex--) { return std::string("3"); } + if (0 == inChannelIndex--) { return std::string("4"); } + if (0 == inChannelIndex--) { return std::string("5"); } + if (0 == inChannelIndex--) { return std::string("6"); } + if (0 == inChannelIndex--) { return std::string("7"); } + if (0 == inChannelIndex--) { return std::string("8"); } + if (0 == inChannelIndex--) { return std::string("9"); } + if (0 == inChannelIndex--) { return std::string("10"); } + if (0 == inChannelIndex--) { return std::string("11"); } + if (0 == inChannelIndex--) { return std::string("12"); } + if (0 == inChannelIndex--) { return std::string("13"); } + if (0 == inChannelIndex--) { return std::string("14"); } + if (0 == inChannelIndex--) { return std::string("15"); } + if (0 == inChannelIndex--) { return std::string("16"); } + if (0 == inChannelIndex--) { return std::string("17"); } + if (0 == inChannelIndex--) { return std::string("18"); } + if (0 == inChannelIndex--) { return std::string("19"); } + if (0 == inChannelIndex--) { return std::string("20"); } + if (0 == inChannelIndex--) { return std::string("21"); } + if (0 == inChannelIndex--) { return std::string("22"); } + if (0 == inChannelIndex--) { return std::string("23"); } + if (0 == inChannelIndex--) { return std::string("24"); } + if (0 == inChannelIndex--) { return std::string("25"); } + if (0 == inChannelIndex--) { return std::string("26"); } + if (0 == inChannelIndex--) { return std::string("27"); } + if (0 == inChannelIndex--) { return std::string("28"); } + if (0 == inChannelIndex--) { return std::string("29"); } + if (0 == inChannelIndex--) { return std::string("30"); } + if (0 == inChannelIndex--) { return std::string("31"); } + if (0 == inChannelIndex--) { return std::string("32"); } + if (0 == inChannelIndex--) { return std::string("33"); } + if (0 == inChannelIndex--) { return std::string("34"); } + if (0 == inChannelIndex--) { return std::string("35"); } + if (0 == inChannelIndex--) { return std::string("36"); } + if (0 == inChannelIndex--) { return std::string("37"); } + if (0 == inChannelIndex--) { return std::string("38"); } + if (0 == inChannelIndex--) { return std::string("39"); } + if (0 == inChannelIndex--) { return std::string("40"); } + if (0 == inChannelIndex--) { return std::string("41"); } + if (0 == inChannelIndex--) { return std::string("42"); } + if (0 == inChannelIndex--) { return std::string("43"); } + if (0 == inChannelIndex--) { return std::string("44"); } + if (0 == inChannelIndex--) { return std::string("45"); } + if (0 == inChannelIndex--) { return std::string("46"); } + if (0 == inChannelIndex--) { return std::string("47"); } + if (0 == inChannelIndex--) { return std::string("48"); } + if (0 == inChannelIndex--) { return std::string("49"); } + if (0 == inChannelIndex--) { return std::string("50"); } + if (0 == inChannelIndex--) { return std::string("51"); } + if (0 == inChannelIndex--) { return std::string("52"); } + if (0 == inChannelIndex--) { return std::string("53"); } + if (0 == inChannelIndex--) { return std::string("54"); } + if (0 == inChannelIndex--) { return std::string("55"); } + if (0 == inChannelIndex--) { return std::string("56"); } + if (0 == inChannelIndex--) { return std::string("57"); } + if (0 == inChannelIndex--) { return std::string("58"); } + if (0 == inChannelIndex--) { return std::string("59"); } + if (0 == inChannelIndex--) { return std::string("60"); } + if (0 == inChannelIndex--) { return std::string("61"); } + if (0 == inChannelIndex--) { return std::string("62"); } + if (0 == inChannelIndex--) { return std::string("63"); } + if (0 == inChannelIndex--) { return std::string("64"); } + break; + case AAX_eStemFormat_5_0_2: + if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "L" : "Left"); } + if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "C" : "Center"); } + if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "R" : "Right"); } + if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Ls" : "Left Surround"); } + if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Rs" : "Right Surround"); } + if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Ltm" : "Left Top Middle"); } + if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Rtm" : "Right Top Middle"); } + break; + case AAX_eStemFormat_5_1_2: + if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "L" : "Left"); } + if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "C" : "Center"); } + if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "R" : "Right"); } + if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Ls" : "Left Surround"); } + if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Rs" : "Right Surround"); } + if (0 == inChannelIndex--) { return std::string("LFE"); } + if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Ltm" : "Left Top Middle"); } + if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Rtm" : "Right Top Middle"); } + break; + case AAX_eStemFormat_5_0_4: + if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "L" : "Left"); } + if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "C" : "Center"); } + if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "R" : "Right"); } + if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Ls" : "Left Surround"); } + if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Rs" : "Right Surround"); } + if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Ltf" : "Left Top Front"); } + if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Rtf" : "Right Top Front"); } + if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Ltr" : "Left Top Rear"); } + if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Rtr" : "Right Top Rear"); } + break; + case AAX_eStemFormat_5_1_4: + if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "L" : "Left"); } + if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "C" : "Center"); } + if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "R" : "Right"); } + if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Ls" : "Left Surround"); } + if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Rs" : "Right Surround"); } + if (0 == inChannelIndex--) { return std::string("LFE"); } + if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Ltf" : "Left Top Front"); } + if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Rtf" : "Right Top Front"); } + if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Ltr" : "Left Top Rear"); } + if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Rtr" : "Right Top Rear"); } + break; + case AAX_eStemFormat_7_0_4: + if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "L" : "Left"); } + if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "C" : "Center"); } + if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "R" : "Right"); } + if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Lss" : "Left Surround Side"); } + if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Rss" : "Right Surround Side"); } + if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Lsr" : "Left Surround Rear"); } + if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Rsr" : "Right Surround Rear"); } + if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Ltf" : "Left Top Front"); } + if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Rtf" : "Right Top Front"); } + if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Ltr" : "Left Top Rear"); } + if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Rtr" : "Right Top Rear"); } + break; + case AAX_eStemFormat_7_1_4: + if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "L" : "Left"); } + if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "C" : "Center"); } + if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "R" : "Right"); } + if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Lss" : "Left Surround Side"); } + if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Rss" : "Right Surround Side"); } + if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Lsr" : "Left Surround Rear"); } + if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Rsr" : "Right Surround Rear"); } + if (0 == inChannelIndex--) { return std::string("LFE"); } + if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Ltf" : "Left Top Front"); } + if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Rtf" : "Right Top Front"); } + if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Ltr" : "Left Top Rear"); } + if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Rtr" : "Right Top Rear"); } + break; + case AAX_eStemFormat_7_0_6: + if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "L" : "Left"); } + if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "C" : "Center"); } + if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "R" : "Right"); } + if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Lss" : "Left Surround Side"); } + if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Rss" : "Right Surround Side"); } + if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Lsr" : "Left Surround Rear"); } + if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Rsr" : "Right Surround Rear"); } + if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Ltf" : "Left Top Front"); } + if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Rtf" : "Right Top Front"); } + if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Ltm" : "Left Top Middle"); } + if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Rtm" : "Right Top Middle"); } + if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Ltr" : "Left Top Rear"); } + if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Rtr" : "Right Top Rear"); } + break; + case AAX_eStemFormat_7_1_6: + if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "L" : "Left"); } + if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "C" : "Center"); } + if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "R" : "Right"); } + if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Lss" : "Left Surround Side"); } + if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Rss" : "Right Surround Side"); } + if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Lsr" : "Left Surround Rear"); } + if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Rsr" : "Right Surround Rear"); } + if (0 == inChannelIndex--) { return std::string("LFE"); } + if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Ltf" : "Left Top Front"); } + if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Rtf" : "Right Top Front"); } + if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Ltm" : "Left Top Middle"); } + if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Rtm" : "Right Top Middle"); } + if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Ltr" : "Left Top Rear"); } + if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Rtr" : "Right Top Rear"); } + break; + case AAX_eStemFormat_9_0_4: + if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "L" : "Left"); } + if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "C" : "Center"); } + if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "R" : "Right"); } + if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Lw" : "Left Wide"); } + if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Rw" : "Right Wide"); } + if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Lss" : "Left Surround Side"); } + if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Rss" : "Right Surround Side"); } + if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Lsr" : "Left Surround Rear"); } + if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Rsr" : "Right Surround Rear"); } + if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Ltf" : "Left Top Front"); } + if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Rtf" : "Right Top Front"); } + if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Ltr" : "Left Top Rear"); } + if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Rtr" : "Right Top Rear"); } + break; + case AAX_eStemFormat_9_1_4: + if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "L" : "Left"); } + if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "C" : "Center"); } + if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "R" : "Right"); } + if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Lw" : "Left Wide"); } + if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Rw" : "Right Wide"); } + if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Lss" : "Left Surround Side"); } + if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Rss" : "Right Surround Side"); } + if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Lsr" : "Left Surround Rear"); } + if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Rsr" : "Right Surround Rear"); } + if (0 == inChannelIndex--) { return std::string("LFE"); } + if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Ltf" : "Left Top Front"); } + if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Rtf" : "Right Top Front"); } + if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Ltr" : "Left Top Rear"); } + if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Rtr" : "Right Top Rear"); } + break; + case AAX_eStemFormat_9_0_6: + if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "L" : "Left"); } + if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "C" : "Center"); } + if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "R" : "Right"); } + if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Lw" : "Left Wide"); } + if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Rw" : "Right Wide"); } + if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Lss" : "Left Surround Side"); } + if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Rss" : "Right Surround Side"); } + if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Lsr" : "Left Surround Rear"); } + if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Rsr" : "Right Surround Rear"); } + if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Ltf" : "Left Top Front"); } + if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Rtf" : "Right Top Front"); } + if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Ltm" : "Left Top Middle"); } + if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Rtm" : "Right Top Middle"); } + if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Ltr" : "Left Top Rear"); } + if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Rtr" : "Right Top Rear"); } + break; + case AAX_eStemFormat_9_1_6: + if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "L" : "Left"); } + if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "C" : "Center"); } + if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "R" : "Right"); } + if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Lw" : "Left Wide"); } + if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Rw" : "Right Wide"); } + if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Lss" : "Left Surround Side"); } + if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Rss" : "Right Surround Side"); } + if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Lsr" : "Left Surround Rear"); } + if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Rsr" : "Right Surround Rear"); } + if (0 == inChannelIndex--) { return std::string("LFE"); } + if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Ltf" : "Left Top Front"); } + if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Rtf" : "Right Top Front"); } + if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Ltm" : "Left Top Middle"); } + if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Rtm" : "Right Top Middle"); } + if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Ltr" : "Left Top Rear"); } + if (0 == inChannelIndex--) { return std::string(inAbbreviate ? "Rtr" : "Right Top Rear"); } + break; + + + case AAX_eStemFormat_None: + break; + case AAX_eStemFormat_Any: + break; + + case AAX_eStemFormat_INT32_MAX: + case AAX_eStemFormatNum: + default: + break; + } + + return std::string(inAbbreviate ? "?" : "unknown"); +} + +std::string AAX::AsStringResult(AAX_Result inResult) +{ +#ifdef DEFINE_AAX_ERROR_STRING +#undef DEFINE_AAX_ERROR_STRING +#endif +#define DEFINE_AAX_ERROR_STRING(X) if (X == inResult) { return std::string(#X); } + + DEFINE_AAX_ERROR_STRING(AAX_SUCCESS); + DEFINE_AAX_ERROR_STRING(AAX_ERROR_INVALID_PARAMETER_ID); + DEFINE_AAX_ERROR_STRING(AAX_ERROR_INVALID_STRING_CONVERSION); + DEFINE_AAX_ERROR_STRING(AAX_ERROR_INVALID_METER_INDEX); + DEFINE_AAX_ERROR_STRING(AAX_ERROR_NULL_OBJECT); + DEFINE_AAX_ERROR_STRING(AAX_ERROR_OLDER_VERSION); + DEFINE_AAX_ERROR_STRING(AAX_ERROR_INVALID_CHUNK_INDEX); + DEFINE_AAX_ERROR_STRING(AAX_ERROR_INVALID_CHUNK_ID); + DEFINE_AAX_ERROR_STRING(AAX_ERROR_INCORRECT_CHUNK_SIZE); + DEFINE_AAX_ERROR_STRING(AAX_ERROR_UNIMPLEMENTED); + DEFINE_AAX_ERROR_STRING(AAX_ERROR_INVALID_PARAMETER_INDEX); + DEFINE_AAX_ERROR_STRING(AAX_ERROR_NOT_INITIALIZED); + DEFINE_AAX_ERROR_STRING(AAX_ERROR_ACF_ERROR); + DEFINE_AAX_ERROR_STRING(AAX_ERROR_INVALID_METER_TYPE); + DEFINE_AAX_ERROR_STRING(AAX_ERROR_CONTEXT_ALREADY_HAS_METERS); + DEFINE_AAX_ERROR_STRING(AAX_ERROR_NULL_COMPONENT); + DEFINE_AAX_ERROR_STRING(AAX_ERROR_PORT_ID_OUT_OF_RANGE); + DEFINE_AAX_ERROR_STRING(AAX_ERROR_FIELD_TYPE_DOES_NOT_SUPPORT_DIRECT_ACCESS); + DEFINE_AAX_ERROR_STRING(AAX_ERROR_DIRECT_ACCESS_OUT_OF_BOUNDS); + DEFINE_AAX_ERROR_STRING(AAX_ERROR_FIFO_FULL); + DEFINE_AAX_ERROR_STRING(AAX_ERROR_INITIALIZING_PACKET_STREAM_THREAD); + DEFINE_AAX_ERROR_STRING(AAX_ERROR_POST_PACKET_FAILED); + DEFINE_AAX_ERROR_STRING(AAX_RESULT_PACKET_STREAM_NOT_EMPTY); + DEFINE_AAX_ERROR_STRING(AAX_RESULT_ADD_FIELD_UNSUPPORTED_FIELD_TYPE); + DEFINE_AAX_ERROR_STRING(AAX_ERROR_MIXER_THREAD_FALLING_BEHIND); + DEFINE_AAX_ERROR_STRING(AAX_ERROR_INVALID_FIELD_INDEX); + DEFINE_AAX_ERROR_STRING(AAX_ERROR_MALFORMED_CHUNK); + DEFINE_AAX_ERROR_STRING(AAX_ERROR_TOD_BEHIND); + DEFINE_AAX_ERROR_STRING(AAX_RESULT_NEW_PACKET_POSTED); + DEFINE_AAX_ERROR_STRING(AAX_ERROR_PLUGIN_NOT_AUTHORIZED); + DEFINE_AAX_ERROR_STRING(AAX_ERROR_PLUGIN_NULL_PARAMETER); + DEFINE_AAX_ERROR_STRING(AAX_ERROR_NOTIFICATION_FAILED); + DEFINE_AAX_ERROR_STRING(AAX_ERROR_INVALID_VIEW_SIZE); + DEFINE_AAX_ERROR_STRING(AAX_ERROR_SIGNED_INT_OVERFLOW); + DEFINE_AAX_ERROR_STRING(AAX_ERROR_NO_COMPONENTS); + DEFINE_AAX_ERROR_STRING(AAX_ERROR_DUPLICATE_EFFECT_ID); + DEFINE_AAX_ERROR_STRING(AAX_ERROR_DUPLICATE_TYPE_ID); + DEFINE_AAX_ERROR_STRING(AAX_ERROR_EMPTY_EFFECT_NAME); + DEFINE_AAX_ERROR_STRING(AAX_ERROR_UNKNOWN_PLUGIN); + DEFINE_AAX_ERROR_STRING(AAX_ERROR_PROPERTY_UNDEFINED); + DEFINE_AAX_ERROR_STRING(AAX_ERROR_INVALID_PATH); + DEFINE_AAX_ERROR_STRING(AAX_ERROR_UNKNOWN_ID); + DEFINE_AAX_ERROR_STRING(AAX_ERROR_UNKNOWN_EXCEPTION); + DEFINE_AAX_ERROR_STRING(AAX_ERROR_INVALID_ARGUMENT); + DEFINE_AAX_ERROR_STRING(AAX_ERROR_NULL_ARGUMENT); + DEFINE_AAX_ERROR_STRING(AAX_ERROR_INVALID_INTERNAL_DATA); + DEFINE_AAX_ERROR_STRING(AAX_ERROR_ARGUMENT_BUFFER_OVERFLOW); + + if (AAX_ERROR_PLUGIN_BEGIN >= inResult && AAX_ERROR_PLUGIN_END <= inResult) + return std::string("plug-in defined error"); + + return std::string(""); +} + +#endif diff --git a/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_TransportTypes.h b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_TransportTypes.h new file mode 100644 index 0000000000..971f5b1cac --- /dev/null +++ b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_TransportTypes.h @@ -0,0 +1,102 @@ +/*================================================================================================*/ +/* + * + * Copyright 2020-2021, 2023-2024 Avid Technology, Inc. + * All rights reserved. + * + * This file is part of the Avid AAX SDK. + * + * The AAX SDK is subject to commercial or open-source licensing. + * + * By using the AAX SDK, you agree to the terms of both the Avid AAX SDK License + * Agreement and Avid Privacy Policy. + * + * AAX SDK License: https://developer.avid.com/aax + * Privacy Policy: https://www.avid.com/legal/privacy-policy-statement + * + * Or: You may also use this code under the terms of the GPL v3 (see + * www.gnu.org/licenses). + * + * THE AAX SDK IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER + * EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE + * DISCLAIMED. + * + */ + +/** + * \file AAX_TransportTypes.h + * + * \brief Structures, enums and other definitions used in transport + * + */ +/*================================================================================================*/ + +#ifndef AAX_TransportTypes_h_ +#define AAX_TransportTypes_h_ +#pragma once + +// AAX Includes +#include "AAX.h" + +// Standard Library Includes +#include +#include + +#include AAX_ALIGN_FILE_BEGIN +#include AAX_ALIGN_FILE_HOST +#include AAX_ALIGN_FILE_END + +/** + Helper structure for payload data described transport state information. + */ +struct AAX_TransportStateInfo_V1 +{ + AAX_ETransportState mTransportState; + AAX_ERecordMode mRecordMode; + AAX_CBoolean mIsRecordEnabled; + AAX_CBoolean mIsRecording; + AAX_CBoolean mIsLoopEnabled; + + AAX_TransportStateInfo_V1() : + mTransportState(AAX_eTransportState_Unknown), + mRecordMode(AAX_eRecordMode_Unknown), + mIsRecordEnabled(false), + mIsRecording(false), + mIsLoopEnabled(false) + { + static_assert(sizeof(AAX_TransportStateInfo_V1) == 12, "Invalid size of AAX_TransportStateInfo_V1 struct during compilation!"); + } + + inline std::string ToString() const + { + std::stringstream ss; + + ss << "{" << std::endl; + ss << "\"transport_state\": " << mTransportState << "," << std::endl; + ss << "\"record_mode\": " << mRecordMode << "," << std::endl; + ss << "\"is_record_enabled\": " << mIsRecordEnabled << "," << std::endl; + ss << "\"is_recording\": " << mIsRecording << "," << std::endl; + ss << "\"is_loop_enabled\": " << mIsLoopEnabled << std::endl; + ss << "}"; + + return ss.str(); + } +}; + +#include AAX_ALIGN_FILE_BEGIN +#include AAX_ALIGN_FILE_RESET +#include AAX_ALIGN_FILE_END + +inline bool operator==(const AAX_TransportStateInfo_V1& state1, const AAX_TransportStateInfo_V1& state2) +{ + return (state1.mTransportState == state2.mTransportState) && (state1.mRecordMode == state2.mRecordMode) && + (state1.mIsRecordEnabled == state2.mIsRecordEnabled) && (state1.mIsRecording == state2.mIsRecording) && + (state1.mIsLoopEnabled == state2.mIsLoopEnabled); +} + +inline bool operator!=(const AAX_TransportStateInfo_V1& state1, const AAX_TransportStateInfo_V1& state2) +{ + return !(state1 == state2); +} + +#endif // #ifndef AAX_TransportTypes_h_ diff --git a/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_UIDs.h b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_UIDs.h new file mode 100644 index 0000000000..828524b621 --- /dev/null +++ b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_UIDs.h @@ -0,0 +1,372 @@ +/*================================================================================================*/ +/* + * + * Copyright 2013-2017, 2019-2021, 2023-2024 Avid Technology, Inc. + * All rights reserved. + * + * This file is part of the Avid AAX SDK. + * + * The AAX SDK is subject to commercial or open-source licensing. + * + * By using the AAX SDK, you agree to the terms of both the Avid AAX SDK License + * Agreement and Avid Privacy Policy. + * + * AAX SDK License: https://developer.avid.com/aax + * Privacy Policy: https://www.avid.com/legal/privacy-policy-statement + * + * Or: You may also use this code under the terms of the GPL v3 (see + * www.gnu.org/licenses). + * + * THE AAX SDK IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER + * EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE + * DISCLAIMED. + * + */ + +/** + * \file AAX_UIDs.h + * + * \brief Unique identifiers for AAX/ACF interfaces + * + */ +/*================================================================================================*/ + +/// @cond ignore +#ifndef AAX_UIDS_H +#define AAX_UIDS_H +/// @endcond + +#include "acfbasetypes.h" +#include "defineacfuid.h" + +// Pull in the declarations of all standard ACF UIDs +#include "acfuids.h" + + + +/** @name %AAX Host interface IDs + * + */ +//@{ +/// ACF component ID for \ref AAX_IHostServices components +DEFINE_ACFUID(acfIID, AAXCompID_HostServices, 0x88882c2d, 0xebbc, 0x42ef, 0xc0, 0xab, 0x89, 0x81, 0xb0, 0xbd, 0x0c, 0xca); +/// ACF interface ID for \ref AAX_IACFHostServices +DEFINE_ACFUID(acfIID, IID_IAAXHostServicesV1, 0x96d42c2d, 0xebbc, 0x41ef, 0xb0, 0xab, 0x99, 0x91, 0xa0, 0xed, 0x0c, 0xca); +/// ACF interface ID for \ref AAX_IACFHostServices_V2 +DEFINE_ACFUID(acfIID, IID_IAAXHostServicesV2, 0xa207ee9e, 0xb442, 0x11e4, 0xa7, 0x1e, 0x12, 0xe3, 0xf5, 0x12, 0xa3, 0x38); +/// ACF interface ID for \ref AAX_IACFHostServices_V3 +DEFINE_ACFUID(acfIID, IID_IAAXHostServicesV3, 0x12bea399, 0x9a4f, 0x4353, 0x80, 0x98, 0x39, 0x16, 0xfa, 0x71, 0x89, 0x8d); + +/// ACF component ID for \ref AAX_ICollection components +DEFINE_ACFUID(acfIID, AAXCompID_AAXCollection, 0x89882c2d, 0x77bc, 0x42ef, 0x70, 0x7b, 0x79, 0x81, 0xb7, 0xbd, 0x0c, 0xca); +/// ACF interface ID for \ref AAX_IACFCollection +DEFINE_ACFUID(acfIID, IID_IAAXCollectionV1, 0x96d42c2d, 0xebbc, 0x41df, 0xb1, 0xab, 0x99, 0x91, 0xa2, 0xee, 0x0c, 0xca); + +/// ACF component ID for \ref AAX_IEffectDescriptor components +DEFINE_ACFUID(acfIID, AAXCompID_AAXEffectDescriptor, 0x89872c2d, 0x75bc, 0x423f, 0x40, 0x1b, 0xf9, 0xa1, 0xba, 0xad, 0x0c, 0xca); +/// ACF interface ID for \ref AAX_IACFEffectDescriptor +DEFINE_ACFUID(acfIID, IID_IAAXEffectDescriptorV1, 0x96d42c2d, 0xebbc, 0x41ef, 0xd1, 0xcb, 0x49, 0x94, 0x42, 0xe4, 0x0f, 0xda); +/// ACF interface ID for \ref AAX_IACFEffectDescriptor_V2 +DEFINE_ACFUID(acfIID, IID_IAAXEffectDescriptorV2, 0x41eccc52, 0x416b, 0x4072, 0x84, 0xbd, 0x40, 0xb0, 0x52, 0x10, 0xa7, 0x4c); + +/// ACF component ID for \ref AAX_IComponentDescriptor components +DEFINE_ACFUID(acfIID, AAXCompID_AAXComponentDescriptor, 0x94872c3d, 0x95bc, 0x413d, 0xd0, 0xdb, 0xd9, 0xb1, 0x2a, 0xad, 0x0c, 0xca); +/// ACF interface ID for \ref AAX_IACFComponentDescriptor +DEFINE_ACFUID(acfIID, IID_IAAXComponentDescriptorV1, 0x96e42c2d, 0xe2bc, 0x51ef, 0x61, 0xc7, 0x48, 0x99, 0x4a, 0xeb, 0x0c, 0xda); +/// ACF interface ID for \ref AAX_IACFComponentDescriptor_V2 +DEFINE_ACFUID(acfIID, IID_IAAXComponentDescriptorV2, 0x1895259e, 0xaaa9, 0x4f0f, 0xa9, 0x85, 0x14, 0x98, 0x37, 0xb7, 0x6f, 0x89); +/// ACF interface ID for \ref AAX_IACFComponentDescriptor_V3 +DEFINE_ACFUID(acfIID, IID_IAAXComponentDescriptorV3, 0x979cfcd4, 0x2bcb, 0x43ae, 0x9c, 0xd0, 0x2d, 0x0e, 0xcd, 0x2a, 0xdc, 0xd5); + + +/// ACF component ID for \ref AAX_IPropertyMap components +DEFINE_ACFUID(acfIID, AAXCompID_AAXPropertyMap, 0xa587ad3d, 0xd53c, 0x4adc, 0xd0, 0xdd, 0xd9, 0xd1, 0x2d, 0xdd, 0xdc, 0xda); +/// ACF interface ID for \ref AAX_IACFPropertyMap +DEFINE_ACFUID(acfIID, IID_IAAXPropertyMapV1, 0x96ee2c2d, 0xeecc, 0x5eff, 0xe2, 0xd7, 0xe8, 0x49, 0xe3, 0xe2, 0xee, 0xee); +/// ACF interface ID for \ref AAX_IACFPropertyMap_V2 +DEFINE_ACFUID(acfIID, IID_IAAXPropertyMapV2, 0x7177df80, 0x7c9c, 0x11e2, 0xb9, 0x2a, 0x08, 0x00, 0x20, 0x0c, 0x9a, 0x66); +/// ACF interface ID for \ref AAX_IACFPropertyMap_V3 +DEFINE_ACFUID(acfIID, IID_IAAXPropertyMapV3, 0x6d4ab208, 0xd34b, 0x4368, 0xb4, 0xf1, 0x58, 0xbc, 0x24, 0x3f, 0x45, 0xc9); + +/// ACF component ID for \ref AAX_IHostProcessorDelegate components +DEFINE_ACFUID(acfIID, AAXCompID_HostProcessorDelegate, 0xab933d9d, 0x5434, 0x25dc, 0x19, 0x0b, 0x09, 0x23, 0x2d, 0xdd, 0x38, 0x8a); +/// ACF interface ID for \ref AAX_IACFHostProcessorDelegate +DEFINE_ACFUID(acfIID, IID_IAAXHostProcessorDelegateV1, 0x9d4e3d3d, 0x43dc, 0x5eda, 0x82, 0x27, 0xe2, 0xf2, 0xf8, 0xd5, 0x6e, 0x8e); +/// ACF interface ID for \ref AAX_IACFHostProcessorDelegate_V2 +DEFINE_ACFUID(acfIID, IID_IAAXHostProcessorDelegateV2, 0xfb6de2c9, 0x29d0, 0x4683, 0xb3, 0x48, 0xc7, 0x78, 0xf4, 0xcd, 0x62, 0x5b); +/// ACF interface ID for \ref AAX_IACFHostProcessorDelegate_V3 +DEFINE_ACFUID(acfIID, IID_IAAXHostProcessorDelegateV3, 0x5dfef2b3, 0x7027, 0x46b5, 0xae, 0x3a, 0x27, 0x94, 0xc6, 0xe0, 0xa8, 0xa0); + +/// ACF component ID for \ref AAX_IAutomationDelegate components +DEFINE_ACFUID(acfIID, AAXCompID_AutomationDelegate, 0xab943d9d, 0x5534, 0x26dc, 0x29, 0xab, 0xc9, 0xb3, 0x2d, 0x2d, 0x28, 0x8a); +/// ACF interface ID for \ref AAX_IACFAutomationDelegate +DEFINE_ACFUID(acfIID, IID_IAAXAutomationDelegateV1, 0x9d5e3d3d, 0x42dc, 0x5efa, 0x22, 0x17, 0xee, 0xe2, 0xe8, 0xe5, 0x3e, 0x2e); + +/// ACF component ID for \ref AAX_IController components +DEFINE_ACFUID(acfIID, AAXCompID_Controller, 0xab944d4d, 0x15c4, 0xc61c, 0x3d, 0x3b, 0xf9, 0xbf, 0x1d, 0x20, 0x18, 0x4a); +/// ACF interface ID for \ref AAX_IACFController +DEFINE_ACFUID(acfIID, IID_IAAXControllerV1, 0x9d5e3e3d, 0x52dc, 0x5efb, 0x20, 0x18, 0xde, 0x1d, 0xe2, 0xe6, 0x3f, 0x4e); +/// ACF interface ID for \ref AAX_IACFController_V2 +DEFINE_ACFUID(acfIID, IID_IAAXControllerV2, 0x4c59aa0e, 0xd7c0, 0x4205, 0x8b, 0x6c, 0x32, 0x46, 0x8d, 0x42, 0xd2, 0x02); +/// ACF interface ID for \ref AAX_IACFController_V3 +DEFINE_ACFUID(acfIID, IID_IAAXControllerV3, 0xdd6f168c, 0xda86, 0x44f8, 0xb8, 0x64, 0xd6, 0xcd, 0x22, 0x19, 0x26, 0xe7); + +/// ACF component ID for %AAX page table controller components +DEFINE_ACFUID(acfIID, AAXCompID_PageTableController, 0x63355d80, 0xbfe1, 0x4291, 0xa6, 0x27, 0xc6, 0x5c, 0xb9, 0x58, 0x91, 0x40); +/// ACF interface ID for \ref AAX_IACFPageTableController +DEFINE_ACFUID(acfIID, IID_IAAXPageTableController, 0x2e9d35fb, 0xbacc, 0x4b2c, 0xb5, 0xd7, 0xc6, 0xe8, 0x51, 0xf5, 0x69, 0xbd); +/// ACF interface ID for \ref AAX_IACFPageTableController_V2 +DEFINE_ACFUID(acfIID, IID_IAAXPageTableControllerV2, 0x6c6b83e, 0x9d87, 0x4938, 0x8a, 0x38, 0xf8, 0xe4, 0x5b, 0x10, 0xa2, 0x4a); + +/// ACF component ID for \ref AAX_IPrivateDataAccess components +DEFINE_ACFUID(acfIID, AAXCompID_PrivateDataAccess, 0xab945d4d, 0x15c6, 0xc61c, 0x3f, 0x3f, 0xf9, 0xbf, 0x1d, 0x20, 0x18, 0x4c); +/// ACF interface ID for \ref AAX_IACFPrivateDataAccess +DEFINE_ACFUID(acfIID, IID_IAAXPrivateDataAccessV1, 0x9d5e6e3f, 0x52de, 0x5efd, 0x22, 0x18, 0xdf, 0x1f, 0xe3, 0xe8, 0x3f, 0x4c); + +/// ACF component ID for \ref AAX_IViewContainer components +DEFINE_ACFUID(acfIID, AAXCompID_ViewContainer, 0xdede24bd, 0xc2ff, 0x467a, 0xae, 0x2d, 0x5f, 0x29, 0x1d, 0x19, 0x22, 0x2b); +/// ACF interface ID for \ref AAX_IACFViewContainer +DEFINE_ACFUID(acfIID, IID_IAAXViewContainerV1, 0x22da0bbc, 0xd550, 0x4d5e, 0x8c, 0xc6, 0x73, 0x44, 0x83, 0xb8, 0x83, 0x7f); +/// ACF interface ID for \ref AAX_IACFViewContainer_V2 +DEFINE_ACFUID(acfIID, IID_IAAXViewContainerV2, 0x9143a0be, 0x7a79, 0x4d02, 0xae, 0x25, 0xaa, 0xdb, 0xa7, 0x6a, 0x50, 0xb2); +/// ACF interface ID for \ref AAX_IACFViewContainer_V3 +DEFINE_ACFUID(acfIID, IID_IAAXViewContainerV3, 0x07cda0fd, 0xbe98, 0x4dd7, 0x92, 0xe0, 0x02, 0x37, 0x57, 0xdf, 0x2e, 0x01); + +/// ACF component ID for \ref AAX_ITransport components +DEFINE_ACFUID(acfIID, AAXCompID_Transport, 0x8a9fa236, 0x2176, 0x49e1, 0xb6, 0x24, 0x82, 0x7d, 0x2b, 0x43, 0x31, 0x5c); +/// ACF interface ID for \ref AAX_IACFTransport +DEFINE_ACFUID(acfIID, IID_IAAXTransportV1, 0x5cee4ef4, 0x6337, 0x4359, 0xb6, 0x3b, 0xfe, 0x58, 0xdc, 0x36, 0x54, 0x3a); +/// ACF interface ID for \ref AAX_IACFTransport_V2 +DEFINE_ACFUID(acfIID, IID_IAAXTransportV2, 0x203cbd9f, 0x982c, 0x4fe6, 0xa8, 0x27, 0x7, 0x48, 0x2, 0x57, 0xae, 0xc3); +/// ACF interface ID for \ref AAX_IACFTransport_V3 +DEFINE_ACFUID(acfIID, IID_IAAXTransportV3, 0xaf79e815, 0xecfe, 0x1fb4, 0x8a, 0x2e, 0x24, 0xab, 0x0e, 0xc0, 0x8e, 0xf0); +/// ACF interface ID for \ref AAX_IACFTransport_V4 +DEFINE_ACFUID(acfIID, IID_IAAXTransportV4, 0xcad3748b, 0x5f34, 0x4a1d, 0xb5, 0x9e, 0x12, 0x6e, 0xcf, 0xb0, 0x11, 0x77); +/// ACF interface ID for \ref AAX_IACFTransport_V5 +DEFINE_ACFUID(acfIID, IID_IAAXTransportV5, 0xe8b5e908, 0xf8f6, 0x44ba, 0xac, 0x92, 0x1d, 0x8e, 0xe1, 0xd4, 0x4b, 0x58); + +/// ACF component ID for AAX_ITransportControl components (accessed via AAX_ITransport) +DEFINE_ACFUID(acfIID, AAXCompID_TransportControl, 0x0717ac4d, 0xdf87, 0x44b1, 0x82, 0x7b, 0x5b, 0x6f, 0x9b, 0xe3, 0x50, 0xf5); +/// ACF interface ID for \ref AAX_IACFTransportControl +DEFINE_ACFUID(acfIID, IID_IAAXTransportControlV1, 0xce6ddb20, 0x1b7c, 0x4559, 0x9e, 0xe8, 0xd7, 0x69, 0x86, 0x45, 0xa1, 0x43); + +/// ACF component ID for \ref AAX_IPageTable components +DEFINE_ACFUID(acfIID, AAXCompID_PageTable, 0xdbc22879, 0xa24e, 0x4ac6, 0x97, 0x21, 0x93, 0x8b, 0x72, 0xd8, 0xe8, 0x1b); +/// ACF interface ID for \ref AAX_IACFPageTable +DEFINE_ACFUID(acfIID, IID_IAAXPageTableV1, 0x33c9e5be, 0x1ce3, 0x4085, 0x91, 0xa7, 0x09, 0xd6, 0xf8, 0xee, 0x4b, 0x64); +/// ACF interface ID for \ref AAX_IACFPageTable_V2 +DEFINE_ACFUID(acfIID, IID_IAAXPageTableV2, 0xd0f25d1b, 0x9c5b, 0x4d2e, 0x8f, 0x1f, 0x45, 0xbc, 0x93, 0x47, 0x32, 0xf7); + + +/// ACF component ID for \ref AAX_IDescriptionHost components +DEFINE_ACFUID(acfIID, AAX_CompID_DescriptionHost, 0x84e184ce, 0x353c, 0x4928, 0x80, 0x61, 0x04, 0x60, 0x06, 0xb3, 0x1b, 0x52); +/// ACF interface ID for \ref AAX_IACFDescriptionHost +DEFINE_ACFUID(acfIID, IID_IAAXDescriptionHostV1, 0xe5bc71df, 0x4c1f, 0x4cc4, 0x81, 0x4a, 0x5a, 0x7d, 0xd0, 0xe7, 0x0e, 0xf5); + +/// ACF component ID for \ref AAX_IFeatureInfo components +DEFINE_ACFUID(acfIID, AAX_CompID_FeatureInfo, 0x617d2e4f, 0x3556, 0x483b, 0xb4, 0xde, 0x05, 0x3c, 0xc3, 0x92, 0x17, 0x53); +/// ACF interface ID for \ref AAX_IACFFeatureInfo +DEFINE_ACFUID(acfIID, IID_IAAXFeatureInfoV1, 0x24545609, 0xa7c4, 0x44d4, 0xab, 0xb8, 0xcf, 0x13, 0xea, 0x9d, 0x0b, 0xdf); + +/// ACF component ID for \ref AAX_ITask components +DEFINE_ACFUID(acfIID, AAXCompID_Task, 0xa5237386, 0xd1a7, 0x490d, 0x5, 0x8, 0x3, 0x2, 0xd, 0x0, 0x2, 0x1); +/// ACF interface ID for \ref AAX_IACFTask +DEFINE_ACFUID(acfIID, IID_IAAXTaskV1, 0x9733f64b, 0x45d6, 0x47ba, 0x8, 0xb, 0x9, 0xd, 0xd, 0x7, 0x8, 0xa); + +/// ACF component ID for \ref AAX_ISessionDocument components +DEFINE_ACFUID(acfIID, AAXCompID_SessionDocument, 0x65fd4d4a, 0xf85e, 0x46fd, 0x8b, 0x7c, 0xa0, 0x31, 0x5c, 0x93, 0x2a, 0xd1); +/// ACF interface ID for \ref AAX_IACFSessionDocument +DEFINE_ACFUID(acfIID, IID_IAAXSessionDocumentV1, 0x4be26025, 0x27c9, 0x467e, 0x85, 0xd6, 0x78, 0xb5, 0xf1, 0xea, 0x7c, 0xdb); + +//@}end AAX host interface IDs + + + + + +/** @name %AAX plug-in interface IDs + * + */ +//@{ +/// ACF component ID for \ref AAX_IEffectParameters components +DEFINE_ACFUID(acfIID, AAXCompID_EffectParameters, 0xab97bd9d, 0x9b3c, 0x4bdc, 0xb9, 0x9b, 0x59, 0x51, 0xbd, 0x5d, 0x48, 0x4a); +/// ACF interface ID for \ref AAX_IACFEffectParameters +DEFINE_ACFUID(acfIID, IID_IAAXEffectParametersV1, 0x964e333d, 0x334c, 0x533f, 0xc2, 0xc7, 0x38, 0x34, 0xc3, 0xc2, 0x3e, 0x3e); +/// ACF interface ID for \ref AAX_IACFEffectParameters_V2 +DEFINE_ACFUID(acfIID, IID_IAAXEffectParametersV2, 0xf1f47d06, 0x308f, 0x4cc5, 0x9c, 0x7c, 0x50, 0xa8, 0x3f, 0x8a, 0xb8, 0x13); +/// ACF interface ID for \ref AAX_IACFEffectParameters_V3 +DEFINE_ACFUID(acfIID, IID_IAAXEffectParametersV3, 0xd2540e9d, 0x9163, 0x42bb, 0xa6, 0xfd, 0x81, 0xe1, 0xe, 0xa3, 0x24, 0x98); +/// ACF interface ID for \ref AAX_IACFEffectParameters_V4 +DEFINE_ACFUID(acfIID, IID_IAAXEffectParametersV4, 0x2e485536, 0x31a3, 0x4697, 0x9c, 0x16, 0xe5, 0x9b, 0xf6, 0xb2, 0x8a, 0x41); + +/// ACF component ID for \ref AAX_IHostProcessor components +DEFINE_ACFUID(acfIID, AAXCompID_HostProcessor, 0xab953d9d, 0x5b34, 0x45dc, 0x49, 0x3b, 0x29, 0x53, 0xcd, 0xdd, 0x48, 0x4a); +/// ACF interface ID for \ref AAX_IACFHostProcessor +DEFINE_ACFUID(acfIID, IID_IAAXHostProcessorV1, 0x964e3f3d, 0x434c, 0x5e3a, 0xa2, 0xe7, 0xe8, 0xf4, 0xf3, 0xd2, 0x2e, 0x2e); +/// ACF interface ID for \ref AAX_IACFHostProcessor_V2 +DEFINE_ACFUID(acfIID, IID_IAAXHostProcessorV2, 0x457546c0, 0xf6bc, 0x4af9, 0xbf, 0xf7, 0xeb, 0xdd, 0xc0, 0x5e, 0x56, 0xde); + +/// ACF component ID for \ref AAX_IEffectGUI components +DEFINE_ACFUID(acfIID, AAXCompID_EffectGUI, 0xab94339d, 0x3b34, 0x35dc, 0x29, 0x32, 0x19, 0x23, 0x1d, 0x1d, 0x48, 0x2a); +/// ACF interface ID for \ref AAX_IACFEffectGUI +DEFINE_ACFUID(acfIID, IID_IAAXEffectGUIV1, 0x964e323d, 0x424c, 0x5e1a, 0x22, 0x27, 0x28, 0x24, 0x23, 0x22, 0x2e, 0x1e); + +/// ACF component ID for \ref AAX_IEffectDirectData components +DEFINE_ACFUID(acfIID, AAXCompID_EffectDirectData, 0xaafe80ab, 0x5b34, 0x4522, 0x49, 0x3b, 0x29, 0x53, 0xcd, 0xdd, 0x48, 0x4b); +/// ACF interface ID for \ref AAX_IACFEffectDirectData +DEFINE_ACFUID(acfIID, IID_IAAXEffectDirectDataV1, 0x964e80ab, 0x434c, 0x5e22, 0xa2, 0xe7, 0xe8, 0xf4, 0xf3, 0xd2, 0x2e, 0x2f); +// ACF interface ID for \ref AAX_IACFEffectDirectData_V2 +DEFINE_ACFUID(acfIID, IID_IAAXEffectDirectDataV2, 0x156ea622, 0xbd2e, 0x11e9, 0x9c, 0xb5, 0x2a, 0x2a, 0xe2, 0xdb, 0xcc, 0xe4); + +/// ACF component ID for \ref AAX_ITaskAgent components +DEFINE_ACFUID(acfIID, AAXCompID_TaskAgent, 0xb0753064, 0xc37e, 0x11ed, 0xaf, 0xa1, 0x02, 0x42, 0xac, 0xe2, 0x00, 0x12); +/// ACF interface ID for \ref AAX_IACFTaskAgent +DEFINE_ACFUID(acfIID, IID_IAAXTaskAgentV1, 0xc096be3e, 0xbc3e, 0x4c38, 0x86, 0x1d, 0x06, 0xa4, 0xba, 0xa4, 0x10, 0x05); + +/// ACF component ID for \ref AAX_ISessionDocumentClient components +DEFINE_ACFUID(acfIID, AAXCompID_SessionDocumentClient, 0x2280c3d5, 0x38f9, 0x43c5, 0x90, 0x1d, 0x8d, 0x1a, 0xfe, 0xb4, 0x2f, 0xa5); +/// ACF interface ID for \ref AAX_IACFSessionDocumentClient +DEFINE_ACFUID(acfIID, IID_IAAXSessionDocumentClientV1, 0xadaebe77, 0xe1b6, 0x468d, 0x96, 0x60, 0xb6, 0xfb, 0xb7, 0x22, 0x4c, 0xa8); + + +//@}end AAX plug-in interface IDs + + + +/** @name Other %AAX interface IDs + * + */ +//@{ +/// ACF component ID for \ref AAX_IDataBuffer components +DEFINE_ACFUID(acfIID, AAXCompID_DataBuffer, 0x2b21890c, 0x02c9, 0x4a56, 0xf, 0xc, 0xe, 0x3, 0x9, 0x3, 0x1, 0x6); +/// ACF interface ID for \ref AAX_IACFDataBuffer +DEFINE_ACFUID(acfIID, IID_IAAXDataBufferV1, 0x206ec31a, 0x7756, 0x4220, 0x6, 0x0, 0xc, 0xf, 0x6, 0xf, 0x7, 0x7); +//@}end Other AAX interface IDs + + + + + + +/** @name %AAX Feature UIDs + * + */ +//@{ + +/** Identifier for %AAX features + + See \ref AAX_IDescriptionHost::AcquireFeatureProperties() and \ref AAX_IFeatureInfo + */ +using AAX_Feature_UID = acfUID; + +/** \var AAXATTR_ClientFeature_StemFormat + + \brief Client stem format feature support + + \details + To determine the client's support for specific stem formats, use the property map + + Property map contents + Key: \ref AAX_EStemFormat values + Value: \ref AAX_ESupportLevel value; if undefined then no information is available + */ +DEFINE_ACFUID(AAX_Feature_UID, AAXATTR_ClientFeature_StemFormat, 0x729dd3e6, 0xd3dc, 0x484c, 0x91, 0x69, 0xf0, 0x64, 0xa0, 0x12, 0x60, 0x1d); + +/** \var AAXATTR_ClientFeature_AuxOutputStem + + \brief Client \ref additionalFeatures_AOS "Auxiliary Output Stem" feature support + + Plug-ins must detect when a host does not support AOS in order to avoid running off the end of the output audio buffer list in the + audio algorithm. + + \ref AAX_IComponentDescriptor::AddAuxOutputStem() "AddAuxOutputStem()" will return an error for hosts that do not support this feature, so typically + a feature support query using this \ref AAX_Feature_UID is not required. + */ +DEFINE_ACFUID(AAX_Feature_UID, AAXATTR_ClientFeature_AuxOutputStem, 0x5bea3f7a, 0x2be8, 0x4fe1, 0x83, 0xb2, 0x94, 0xec, 0x91, 0x31, 0xb8, 0x52); + +/** \var AAXATTR_ClientFeature_AuxOutputStem + + \brief Client \ref additionalFeatures_Sidechain "Side Chain" feature support + */ +DEFINE_ACFUID(AAX_Feature_UID, AAXATTR_ClientFeature_SideChainInput, 0x98b0a514, 0x2b96, 0x4e1f, 0x87, 0x81, 0x99, 0x08, 0xc9, 0xe3, 0xe6, 0x8b); + +/** \var AAXATTR_ClientFeature_MIDI + + \brief Client \ref additionalFeatures_MIDI "MIDI" feature support + */ +DEFINE_ACFUID(AAX_Feature_UID, AAXATTR_ClientFeature_MIDI, 0xf5b0816c, 0x5768, 0x49c2, 0xae, 0x3e, 0x85, 0x0d, 0xe3, 0x42, 0xeb, 0x07); + + +//@}end AAX Feature UIDs + + +/** @name %AAX host attributes + * + */ +//@{ + +/** \var AAXATTR_Client_Level + + \brief Client application level + + \details + Type: \c uint32_t (\c ACFTypeID_UInt32) + Value: one of \ref AAX_EHostLevel + + Query using the host's \ref IACFDefinition + */ +DEFINE_ACFUID(acfUID, AAXATTR_Client_Level, 0xe550868e, 0x1e6a, 0x482b, 0xb5, 0x86, 0x73, 0xf1, 0x24, 0x6e, 0x12, 0x6b); + +/** \var AAXATTR_Client_Version + + \brief Client application version + + \details + Type: \c uint32_t (\c ACFTypeID_UInt32) + + The value contains the host version in 3 sections: + - First section - 16 bits - major version + - Second section - 8 bits - minor version + - Third section - 8 bits - revision version. + + e.g. for 2023.3.1 (major.minor.revision): + \verbatim + major - 0000011111100111 + minor - 00000011 + revision - 00000001 + \endverbatim + + in a result value this would be represented as : + 00000111111001110000001100000001, or in decimal: 132580097 + + Query using the host's \ref IACFDefinition + */ +DEFINE_ACFUID(acfUID, AAXATTR_Client_Version, 0x950cf999, 0x37aa, 0x49de, 0x8d, 0xcc, 0xbe, 0x7f, 0xa7, 0x3e, 0x6a, 0xee); + + +//@}end AAX host attributes + +/** @name %AAX document data type UIDs + */ +//@{ + +/** Identifier for %AAX document data types + * + * \sa \ref AAX_IACFSessionDocument + */ +using AAX_DocumentData_UID = acfUID; + +/** \var AAX_DocumentDataType_TempoMap + * + * The session tempo map + * + * Provides an \ref AAX_IACFDataBuffer containing a list of + * \ref AAX_CTempoBreakpoint elements. + */ +DEFINE_ACFUID(AAX_DocumentData_UID, AAX_DocumentDataType_TempoMap, 0x2515e52b, 0x5b3e, 0x4354, 0x86, 0xeb, 0x93, 0x49, 0x6a, 0xc8, 0xa3, 0x37); + +//@}end AAX document data type UIDs + +/// @cond ignore +#endif +/// @endcond diff --git a/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_UtilsNative.h b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_UtilsNative.h new file mode 100644 index 0000000000..a786a74e27 --- /dev/null +++ b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_UtilsNative.h @@ -0,0 +1,92 @@ +/*================================================================================================*/ +/* + + * Copyright 2013-2017, 2023-2024 Avid Technology, Inc. + * All rights reserved. + * + * This file is part of the Avid AAX SDK. + * + * The AAX SDK is subject to commercial or open-source licensing. + * + * By using the AAX SDK, you agree to the terms of both the Avid AAX SDK License + * Agreement and Avid Privacy Policy. + * + * AAX SDK License: https://developer.avid.com/aax + * Privacy Policy: https://www.avid.com/legal/privacy-policy-statement + * + * Or: You may also use this code under the terms of the GPL v3 (see + * www.gnu.org/licenses). + * + * THE AAX SDK IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER + * EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE + * DISCLAIMED. + * + */ + +/** + * \file AAX_UtilsNative.h + * + * \brief Various utility definitions for %AAX Native + * + */ +/*================================================================================================*/ + + +#pragma once + +#ifndef _AAX_UTILSNATIVE_H_ +#define _AAX_UTILSNATIVE_H_ + + +#ifndef _TMS320C6X + +// AAX Includes +#include "AAX_CString.h" +#include "AAX_IString.h" +#include "AAX_Assert.h" +#include "AAX.h" + +// Standard Library Includes +#include // for log() +#include + + +//------------------------------------------------ +#pragma mark Utility functions + +namespace AAX +{ + + /** \brief Double-precision safe log function. Returns zero + * for input values that are <= 0.0 + */ + inline double SafeLog (double aValue) { return aValue <= 0.0 ? 0.0 : log(aValue); } + + /** \brief Single-precision safe log function. Returns zero + * for input values that are <= 0.0 + */ + inline float SafeLogf (float aValue) { return aValue <= 0.0f ? 0.0f : logf(aValue); } + + /** \brief Helper function to check if two parameter IDs are equivalent + */ + inline AAX_CBoolean IsParameterIDEqual ( AAX_CParamID iParam1, AAX_CParamID iParam2 ) { return static_cast( strcmp ( iParam1, iParam2 ) == 0 ); } + + /** \brief Helper function to check if two Effect IDs are equivalent + */ + inline AAX_CBoolean IsEffectIDEqual ( const AAX_IString * iEffectID1, const AAX_IString * iEffectID2 ) { return static_cast( strcmp ( iEffectID1->Get(), iEffectID2->Get() ) == 0 ); } + + /** \brief Helper function to check if a notification ID is reserved for host notifications + */ + inline AAX_CBoolean IsAvidNotification ( AAX_CTypeID inNotificationID ) + { + return (AAX_CBoolean)((('A' == ((inNotificationID & 0xFF000000) >> 24)) && + ('X' == ((inNotificationID & 0x00FF0000) >> 16))) || + (inNotificationID == 'ASPv')); + } + +} // namespace AAX + + +#endif // #ifndef _TMS320C6X + +#endif // #ifndef _AAX_UTILSNATIVE_H_ diff --git a/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_VAutomationDelegate.h b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_VAutomationDelegate.h new file mode 100644 index 0000000000..29444d6b8e --- /dev/null +++ b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_VAutomationDelegate.h @@ -0,0 +1,73 @@ +/*================================================================================================*/ +/* + * + * Copyright 2014-2017, 2019, 2023-2024 Avid Technology, Inc. + * All rights reserved. + * + * This file is part of the Avid AAX SDK. + * + * The AAX SDK is subject to commercial or open-source licensing. + * + * By using the AAX SDK, you agree to the terms of both the Avid AAX SDK License + * Agreement and Avid Privacy Policy. + * + * AAX SDK License: https://developer.avid.com/aax + * Privacy Policy: https://www.avid.com/legal/privacy-policy-statement + * + * Or: You may also use this code under the terms of the GPL v3 (see + * www.gnu.org/licenses). + * + * THE AAX SDK IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER + * EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE + * DISCLAIMED. + * + */ + +/** + * \file AAX_VAutomationDelegate.h + * + * \brief Version-managed concrete AutomationDelegate class + * + */ +/*================================================================================================*/ + +#ifndef AAX_VAUTOMATIONDELEGATE_H +#define AAX_VAUTOMATIONDELEGATE_H + +#include "AAX_IAutomationDelegate.h" +#include "AAX_IACFAutomationDelegate.h" +#include "ACFPtr.h" + +class AAX_IACFAutomationDelegate; +class AAX_IACFController_V2; +class IACFUnknown; + +/** + * \brief Version-managed concrete \ref AAX_IAutomationDelegate "automation delegate" class + * + */ +class AAX_VAutomationDelegate : public AAX_IAutomationDelegate +{ +public: + AAX_VAutomationDelegate( IACFUnknown * pUnknown ); + ~AAX_VAutomationDelegate() AAX_OVERRIDE; + + IACFUnknown* GetUnknown() const { return mIAutomationDelegate; } + + AAX_Result RegisterParameter ( AAX_CParamID iParameterID ) AAX_OVERRIDE; + AAX_Result UnregisterParameter ( AAX_CParamID iParameterID ) AAX_OVERRIDE; + AAX_Result PostSetValueRequest ( AAX_CParamID iParameterID, double iNormalizedValue ) const AAX_OVERRIDE; + AAX_Result PostCurrentValue ( AAX_CParamID iParameterID, double iNormalizedValue ) const AAX_OVERRIDE; + AAX_Result PostTouchRequest ( AAX_CParamID iParameterID ) AAX_OVERRIDE; + AAX_Result PostReleaseRequest ( AAX_CParamID iParameterID ) AAX_OVERRIDE; + AAX_Result GetTouchState ( AAX_CParamID iParameterID, AAX_CBoolean * outTouched ) AAX_OVERRIDE; + AAX_Result ParameterNameChanged ( AAX_CParamID iParameterID ) AAX_OVERRIDE; + +private: + ACFPtr mIAutomationDelegate; + ACFPtr mIController; +}; + + + +#endif //AAX_IAUTOMATIONDELEGATE_H diff --git a/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_VCollection.h b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_VCollection.h new file mode 100644 index 0000000000..443ec7cb03 --- /dev/null +++ b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_VCollection.h @@ -0,0 +1,87 @@ +/*================================================================================================*/ +/* + * + * Copyright 2013-2017, 2019, 2023-2024 Avid Technology, Inc. + * All rights reserved. + * + * This file is part of the Avid AAX SDK. + * + * The AAX SDK is subject to commercial or open-source licensing. + * + * By using the AAX SDK, you agree to the terms of both the Avid AAX SDK License + * Agreement and Avid Privacy Policy. + * + * AAX SDK License: https://developer.avid.com/aax + * Privacy Policy: https://www.avid.com/legal/privacy-policy-statement + * + * Or: You may also use this code under the terms of the GPL v3 (see + * www.gnu.org/licenses). + * + * THE AAX SDK IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER + * EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE + * DISCLAIMED. + * + */ + +/** + * \file AAX_VCollection.h + * + * \brief Version-managed concrete Collection class + * + */ +/*================================================================================================*/ + +#ifndef AAX_VCOLLECTION_H +#define AAX_VCOLLECTION_H + +#include "AAX.h" +#include "AAX_ICollection.h" +#include "AAX_IACFCollection.h" +#include "AAX_VDescriptionHost.h" +#include "acfunknown.h" +#include "ACFPtr.h" +#include + +class IACFUnknown; +class IACFPluginDefinition; +class AAX_IACFCollection; +class AAX_IEffectDescriptor; + +/** + * \brief Version-managed concrete \ref AAX_ICollection class + * + */ +class AAX_VCollection : public AAX_ICollection +{ +public: + AAX_VCollection (IACFUnknown * pUnkHost); + ~AAX_VCollection () AAX_OVERRIDE; + + /** \copydoc AAX_ICollection::NewDescriptor() + * + * This implementation retains each generated \ref AAX_IEffectDescriptor and destroys the descriptor upon AAX_VCollection destruction + */ + AAX_IEffectDescriptor * NewDescriptor () AAX_OVERRIDE; ///< \copydoc AAX_ICollection::NewDescriptor() + AAX_Result AddEffect ( const char * inEffectID, AAX_IEffectDescriptor * inEffectDescriptor ) AAX_OVERRIDE; ///< \copydoc AAX_ICollection::AddEffect() + AAX_Result SetManufacturerName( const char* inPackageName ) AAX_OVERRIDE; ///< \copydoc AAX_ICollection::SetManufacturerName() + AAX_Result AddPackageName( const char *inPackageName ) AAX_OVERRIDE; ///< \copydoc AAX_ICollection::AddPackageName() + AAX_Result SetPackageVersion( uint32_t inVersion ) AAX_OVERRIDE; ///< \copydoc AAX_ICollection::SetPackageVersion() + AAX_IPropertyMap * NewPropertyMap () AAX_OVERRIDE; ///< \copydoc AAX_ICollection::NewPropertyMap() + AAX_Result SetProperties ( AAX_IPropertyMap * inProperties ) AAX_OVERRIDE; ///< \copydoc AAX_ICollection::SetProperties() + AAX_Result GetHostVersion(uint32_t* outVersion) const AAX_OVERRIDE; ///< \copydoc AAX_ICollection::GetHostVersion() + + AAX_IDescriptionHost* DescriptionHost() AAX_OVERRIDE; ///< \copydoc AAX_ICollection::DescriptionHost() + const AAX_IDescriptionHost* DescriptionHost() const AAX_OVERRIDE; ///< \copydoc AAX_ICollection::DescriptionHost() const + IACFDefinition* HostDefinition() const AAX_OVERRIDE; ///< \copydoc AAX_ICollection::HostDefinition() const + + IACFPluginDefinition* GetIUnknown() const; + +private: + ACFPtr mUnkHost; + ACFPtr mIACFCollection; + AAX_VDescriptionHost mDescriptionHost; + std::set mEffectDescriptors; + std::set mPropertyMaps; +}; + +#endif diff --git a/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_VComponentDescriptor.h b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_VComponentDescriptor.h new file mode 100644 index 0000000000..dd60f93541 --- /dev/null +++ b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_VComponentDescriptor.h @@ -0,0 +1,134 @@ +/*================================================================================================*/ +/* + * + * Copyright 2013-2017, 2019, 2023-2024 Avid Technology, Inc. + * All rights reserved. + * + * This file is part of the Avid AAX SDK. + * + * The AAX SDK is subject to commercial or open-source licensing. + * + * By using the AAX SDK, you agree to the terms of both the Avid AAX SDK License + * Agreement and Avid Privacy Policy. + * + * AAX SDK License: https://developer.avid.com/aax + * Privacy Policy: https://www.avid.com/legal/privacy-policy-statement + * + * Or: You may also use this code under the terms of the GPL v3 (see + * www.gnu.org/licenses). + * + * THE AAX SDK IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER + * EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE + * DISCLAIMED. + * + */ + +/** + * \file AAX_VComponentDescriptor.h + * + * \brief Version-managed concrete ComponentDescriptor class + * + */ +/*================================================================================================*/ + +#ifndef AAX_VCOMPONENTDESCRIPTOR_H +#define AAX_VCOMPONENTDESCRIPTOR_H + +// AAX Includes +#include "AAX_IComponentDescriptor.h" +#include "AAX_IDma.h" +#include "AAX_IACFComponentDescriptor.h" + +// ACF Includes +#include "acfunknown.h" +#include "ACFPtr.h" + +// Standard Includes +#include + + +class AAX_IPropertyMap; +class AAX_IACFComponentDescriptor; +class AAX_IACFComponentDescriptorV2; +class IACFUnknown; + +/** + * \brief Version-managed concrete \ref AAX_IComponentDescriptor class + * + */ +class AAX_VComponentDescriptor : public AAX_IComponentDescriptor +{ +public: + AAX_VComponentDescriptor ( IACFUnknown * pUnkHost ); + ~AAX_VComponentDescriptor () AAX_OVERRIDE; + + AAX_Result Clear () AAX_OVERRIDE; ///< \copydoc AAX_IComponentDescriptor::Clear() + AAX_Result AddReservedField ( AAX_CFieldIndex inFieldIndex, uint32_t inFieldType ) AAX_OVERRIDE; ///< \copydoc AAX_IComponentDescriptor::AddReservedField() + AAX_Result AddAudioIn ( AAX_CFieldIndex inFieldIndex ) AAX_OVERRIDE; ///< \copydoc AAX_IComponentDescriptor::AddAudioIn() + AAX_Result AddAudioOut ( AAX_CFieldIndex inFieldIndex ) AAX_OVERRIDE; ///< \copydoc AAX_IComponentDescriptor::AddAudioOut() + AAX_Result AddAudioBufferLength ( AAX_CFieldIndex inFieldIndex ) AAX_OVERRIDE; ///< \copydoc AAX_IComponentDescriptor::AddAudioBufferLength() + AAX_Result AddSampleRate ( AAX_CFieldIndex inFieldIndex ) AAX_OVERRIDE; ///< \copydoc AAX_IComponentDescriptor::AddSampleRate() + AAX_Result AddClock ( AAX_CFieldIndex inFieldIndex ) AAX_OVERRIDE; ///< \copydoc AAX_IComponentDescriptor::AddClock() + AAX_Result AddSideChainIn ( AAX_CFieldIndex inFieldIndex ) AAX_OVERRIDE; ///< \copydoc AAX_IComponentDescriptor::AddSideChainIn() + + AAX_Result AddDataInPort ( AAX_CFieldIndex inFieldIndex, uint32_t inPacketSize, AAX_EDataInPortType inPortType ) AAX_OVERRIDE; ///< \copydoc AAX_IComponentDescriptor::AddDataInPort() + AAX_Result AddAuxOutputStem ( AAX_CFieldIndex inFieldIndex, int32_t inStemFormat, const char inNameUTF8[]) AAX_OVERRIDE; ///< \copydoc AAX_IComponentDescriptor::AddAuxOutputStem() + AAX_Result AddPrivateData ( AAX_CFieldIndex inFieldIndex, int32_t inDataSize, uint32_t inOptions ) AAX_OVERRIDE; ///< \copydoc AAX_IComponentDescriptor::AddPrivateData() + AAX_Result AddTemporaryData( AAX_CFieldIndex inFieldIndex, uint32_t inDataElementSize) AAX_OVERRIDE; ///< \copydoc AAX_IComponentDescriptor::AddTemporaryData() + AAX_Result AddDmaInstance ( AAX_CFieldIndex inFieldIndex, AAX_IDma::EMode inDmaMode ) AAX_OVERRIDE; ///< \copydoc AAX_IComponentDescriptor::AddDmaInstance() + AAX_Result AddMeters ( AAX_CFieldIndex inFieldIndex, const AAX_CTypeID* inMeterIDs, const uint32_t inMeterCount) AAX_OVERRIDE; ///< \copydoc AAX_IComponentDescriptor::AddMeters() + AAX_Result AddMIDINode ( AAX_CFieldIndex inFieldIndex, AAX_EMIDINodeType inNodeType, const char inNodeName[], uint32_t channelMask ) AAX_OVERRIDE; ///< \copydoc AAX_IComponentDescriptor::AddMIDINode() + + + /** \copydoc AAX_IComponentDescriptor::NewPropertyMap() + * + * This implementation retains each generated \ref AAX_IPropertyMap and destroys the property map upon \ref AAX_VComponentDescriptor destruction + */ + AAX_IPropertyMap * NewPropertyMap () const AAX_OVERRIDE; + /** \copydoc AAX_IComponentDescriptor::DuplicatePropertyMap() + * + * This implementation retains each generated \ref AAX_IPropertyMap and destroys the property map upon \ref AAX_VComponentDescriptor destruction + */ + AAX_IPropertyMap * DuplicatePropertyMap (AAX_IPropertyMap* inPropertyMap) const AAX_OVERRIDE; + /** \copydoc AAX_IComponentDescriptor::AddProcessProc_Native() + */ + virtual AAX_Result AddProcessProc_Native ( + AAX_CProcessProc inProcessProc, + AAX_IPropertyMap * inProperties = NULL, + AAX_CInstanceInitProc inInstanceInitProc = NULL, + AAX_CBackgroundProc inBackgroundProc = NULL, + AAX_CSelector * outProcID = NULL ) AAX_OVERRIDE; + /** \copydoc AAX_IComponentDescriptor::AddProcessProc_TI() + */ + virtual AAX_Result AddProcessProc_TI ( + const char inDLLFileNameUTF8[], + const char inProcessProcSymbol[], + AAX_IPropertyMap * inProperties = NULL, + const char inInstanceInitProcSymbol [] = NULL, + const char inBackgroundProcSymbol [] = NULL, + AAX_CSelector * outProcID = NULL ) AAX_OVERRIDE; + /** \copydoc AAX_IComponentDescriptor::AddProcessProc() + */ + virtual AAX_Result AddProcessProc ( + AAX_IPropertyMap* inProperties, + AAX_CSelector* outProcIDs = NULL, + int32_t inProcIDsSize = 0) AAX_OVERRIDE; + + + IACFUnknown* GetIUnknown(void) const; + +private: + // Used for backwards compatibility with clients which do not support AddProcessProc + friend class AAX_VPropertyMap; + static const std::set& PointerPropertiesUsedByAddProcessProc(); + +private: + ACFPtr mUnkHost; + ACFPtr mIACFComponentDescriptor; + ACFPtr mIACFComponentDescriptorV2; + ACFPtr mIACFComponentDescriptorV3; + std::set mPropertyMaps; +}; + + +#endif // #ifndef _AAX_ICOMPONENTDESCRIPTOR_H_ diff --git a/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_VController.h b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_VController.h new file mode 100644 index 0000000000..3a0602b751 --- /dev/null +++ b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_VController.h @@ -0,0 +1,168 @@ +/*================================================================================================*/ +/* + * + * Copyright 2013-2017, 2019, 2023-2024 Avid Technology, Inc. + * All rights reserved. + * + * This file is part of the Avid AAX SDK. + * + * The AAX SDK is subject to commercial or open-source licensing. + * + * By using the AAX SDK, you agree to the terms of both the Avid AAX SDK License + * Agreement and Avid Privacy Policy. + * + * AAX SDK License: https://developer.avid.com/aax + * Privacy Policy: https://www.avid.com/legal/privacy-policy-statement + * + * Or: You may also use this code under the terms of the GPL v3 (see + * www.gnu.org/licenses). + * + * THE AAX SDK IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER + * EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE + * DISCLAIMED. + * + */ + +/** + * \file AAX_VController.h + * + * \brief Version-managed concrete Controller class + * + */ +/*================================================================================================*/ + +#ifndef AAX_VCONTROLLER_H +#define AAX_VCONTROLLER_H + +#include "AAX_IController.h" +#include "AAX_IACFController.h" + +#ifdef __clang__ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wself-assign" +#pragma clang diagnostic ignored "-Wnon-virtual-dtor" +#endif + +#include "ACFPtr.h" + +#ifdef __clang__ +#pragma clang diagnostic pop +#endif + +class IACFUnknown; +class IACFComponentFactory; +class AAX_IACFPageTableController; +class AAX_IACFPageTableController_V2; +class AAX_IACFPageTable_V2; + +/*! + \brief Version-managed concrete \ref AAX_IController "Controller" class + + \details + For usage information, see \ref using_acf_host_provided_interfaces + + */ +class AAX_VController : public AAX_IController +{ +public: + AAX_VController( IACFUnknown* pUnknown ); + ~AAX_VController() override; + + //Host Information Getters + AAX_Result GetEffectID ( AAX_IString * outEffectID) const AAX_OVERRIDE; ///< \copydoc AAX_IController::GetEffectID() + AAX_Result GetSampleRate ( AAX_CSampleRate * outSampleRate ) const AAX_OVERRIDE; ///< \copydoc AAX_IController::GetSampleRate() + AAX_Result GetInputStemFormat ( AAX_EStemFormat * outStemFormat ) const AAX_OVERRIDE; ///< \copydoc AAX_IController::GetInputStemFormat() + AAX_Result GetOutputStemFormat ( AAX_EStemFormat * outStemFormat ) const AAX_OVERRIDE; ///< \copydoc AAX_IController::GetOutputStemFormat() + AAX_Result GetSignalLatency( int32_t* outSamples) const AAX_OVERRIDE; ///< \copydoc AAX_IController::GetSignalLatency() + AAX_Result GetHybridSignalLatency(int32_t* outSamples) const AAX_OVERRIDE; ///< \copydoc AAX_IController::GetHybridSignalLatency() + AAX_Result GetPlugInTargetPlatform(AAX_CTargetPlatform* outTargetPlatform) const AAX_OVERRIDE; ///< \copydoc AAX_IController::GetPlugInTargetPlatform() + AAX_Result GetIsAudioSuite(AAX_CBoolean* outIsAudioSuite) const AAX_OVERRIDE; ///< \copydoc AAX_IController::GetIsAudioSuite() + AAX_Result GetCycleCount( AAX_EProperty inWhichCycleCount, AAX_CPropertyValue* outNumCycles) const AAX_OVERRIDE; ///< \copydoc AAX_IController::GetCycleCount() + AAX_Result GetTODLocation ( AAX_CTimeOfDay* outTODLocation ) const AAX_OVERRIDE; ///< \copydoc AAX_IController::GetTODLocation() + AAX_Result GetCurrentAutomationTimestamp(AAX_CTransportCounter* outTimestamp) const AAX_OVERRIDE; ///< \copydoc AAX_IController::GetCurrentAutomationTimestamp() + AAX_Result GetHostName(AAX_IString* outHostNameString) const AAX_OVERRIDE; ///< \copydoc AAX_IController::GetHostName() + + //Host Information Setters (Dynamic info) + AAX_Result SetSignalLatency(int32_t inNumSamples) AAX_OVERRIDE; ///< \copydoc AAX_IController::SetSignalLatency() + AAX_Result SetCycleCount( AAX_EProperty* inWhichCycleCounts, AAX_CPropertyValue* iValues, int32_t numValues) AAX_OVERRIDE; ///< \copydoc AAX_IController::SetCycleCount() + + //Posting functions. + AAX_Result PostPacket ( AAX_CFieldIndex inFieldIndex, const void * inPayloadP, uint32_t inPayloadSize ) AAX_OVERRIDE; ///< \copydoc AAX_IController::PostPacket() + + // Notification functions + AAX_Result SendNotification ( AAX_CTypeID inNotificationType, const void* inNotificationData, uint32_t inNotificationDataSize ) AAX_OVERRIDE; ///< \copydoc AAX_IController::SendNotification(AAX_CTypeID, const void*, uint32_t) + AAX_Result SendNotification ( AAX_CTypeID inNotificationType) AAX_OVERRIDE; ///< \copydoc AAX_IController::SendNotification(AAX_CTypeID) \note Not an AAX interface method + + //Metering functions + AAX_Result GetCurrentMeterValue ( AAX_CTypeID inMeterID, float * outMeterValue ) const AAX_OVERRIDE; ///< \copydoc AAX_IController::GetCurrentMeterValue() + AAX_Result GetMeterPeakValue( AAX_CTypeID inMeterID, float * outMeterPeakValue ) const AAX_OVERRIDE; ///< \copydoc AAX_IController::GetMeterPeakValue() + AAX_Result ClearMeterPeakValue ( AAX_CTypeID inMeterID ) const AAX_OVERRIDE; ///< \copydoc AAX_IController::ClearMeterPeakValue() + AAX_Result GetMeterClipped ( AAX_CTypeID inMeterID, AAX_CBoolean * outClipped ) const AAX_OVERRIDE; ///< \copydoc AAX_IController::GetMeterClipped() + AAX_Result ClearMeterClipped ( AAX_CTypeID inMeterID ) const AAX_OVERRIDE; ///< \copydoc AAX_IController::ClearMeterClipped() + AAX_Result GetMeterCount ( uint32_t * outMeterCount ) const AAX_OVERRIDE; ///< \copydoc AAX_IController::GetMeterCount() + + //MIDI functions + AAX_Result GetNextMIDIPacket( AAX_CFieldIndex* outPort, AAX_CMidiPacket* outPacket ) AAX_OVERRIDE; ///< \copydoc AAX_IController::GetNextMIDIPacket() + + // PageTables functions + /** \copydoc AAX_IController::CreateTableCopyForEffect() + */ + AAX_IPageTable* + CreateTableCopyForEffect(AAX_CPropertyValue inManufacturerID, + AAX_CPropertyValue inProductID, + AAX_CPropertyValue inPlugInID, + uint32_t inTableType, + int32_t inTablePageSize) const AAX_OVERRIDE; + /** \copydoc AAX_IController::CreateTableCopyForLayout() + */ + AAX_IPageTable* + CreateTableCopyForLayout(const char * inEffectID, + const char * inLayoutName, + uint32_t inTableType, + int32_t inTablePageSize) const AAX_OVERRIDE; + /** \copydoc AAX_IController::CreateTableCopyForEffectFromFile() + */ + AAX_IPageTable* + CreateTableCopyForEffectFromFile(const char* inPageTableFilePath, + AAX_ETextEncoding inFilePathEncoding, + AAX_CPropertyValue inManufacturerID, + AAX_CPropertyValue inProductID, + AAX_CPropertyValue inPlugInID, + uint32_t inTableType, + int32_t inTablePageSize) const AAX_OVERRIDE; + /** \copydoc AAX_IController::CreateTableCopyForLayoutFromFile() + */ + AAX_IPageTable* + CreateTableCopyForLayoutFromFile(const char* inPageTableFilePath, + AAX_ETextEncoding inFilePathEncoding, + const char* inLayoutName, + uint32_t inTableType, + int32_t inTablePageSize) const AAX_OVERRIDE; + +private: + /** @name Component factory methods + * + */ + //@{ + /** Creates a new, empty \ref AAX_IPageTable object + + The returned pointer may be NULL if the host does not support the page table interface. + */ + ACFPtr CreatePageTable() const; + //@}end Component factory methods + +private: + ACFPtr mIController; + ACFPtr mIControllerV2; + ACFPtr mIControllerV3; + + // AAX_IACFPageTableController interface methods are aggregated into AAX_IController + ACFPtr mIPageTableController; + ACFPtr mIPageTableControllerV2; + + ACFPtr mComponentFactory; +}; + + +#endif // AAX_VCONTROLLER_H + diff --git a/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_VDataBufferWrapper.h b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_VDataBufferWrapper.h new file mode 100644 index 0000000000..45a88c9ed3 --- /dev/null +++ b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_VDataBufferWrapper.h @@ -0,0 +1,66 @@ +/*================================================================================================*/ +/* + * + * Copyright 2023-2024 Avid Technology, Inc. + * All rights reserved. + * + * This file is part of the Avid AAX SDK. + * + * The AAX SDK is subject to commercial or open-source licensing. + * + * By using the AAX SDK, you agree to the terms of both the Avid AAX SDK License + * Agreement and Avid Privacy Policy. + * + * AAX SDK License: https://developer.avid.com/aax + * Privacy Policy: https://www.avid.com/legal/privacy-policy-statement + * + * Or: You may also use this code under the terms of the GPL v3 (see + * www.gnu.org/licenses). + * + * THE AAX SDK IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER + * EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE + * DISCLAIMED. + * + */ + +/** + * \file AAX_VDataBufferWrapper.h + */ +/*================================================================================================*/ + +#pragma once +#ifndef AAX_VDATABUFFERWRAPPER_H +#define AAX_VDATABUFFERWRAPPER_H + +#include "AAX_IDataBufferWrapper.h" +#include "ACFPtr.h" + +class IACFUnknown; +class AAX_IACFDataBuffer; + +/** + * \brief Wrapper for an \ref AAX_IDataBuffer + * + * \details + * Like \ref AAX_IController and similar classes, this class provides a non-ACF + * interface matching an ACF interface, in this case \ref AAX_IACFDataBuffer . + * + * The implementation of this interface will contain a reference counted pointer + * to the underlying ACF interface. This interface may be extended with + * convenience functions that are not required on the underlying ACF interface. + */ +class AAX_VDataBufferWrapper : public AAX_IDataBufferWrapper +{ +public: + explicit AAX_VDataBufferWrapper(IACFUnknown * iUnknown); + ~AAX_VDataBufferWrapper() AAX_OVERRIDE; + + AAX_Result Type(AAX_CTypeID * oType) const AAX_OVERRIDE; ///< \copydoc AAX_IDataBuffer::Type + AAX_Result Size(int32_t * oSize) const AAX_OVERRIDE; ///< \copydoc AAX_IDataBuffer::Size + AAX_Result Data(void const ** oBuffer) const AAX_OVERRIDE; ///< \copydoc AAX_IDataBuffer::Data + +private: + ACFPtr mDataBufferV1; +}; + +#endif // AAX_VDATABUFFERWRAPPER_H diff --git a/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_VDescriptionHost.h b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_VDescriptionHost.h new file mode 100644 index 0000000000..266fbc508e --- /dev/null +++ b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_VDescriptionHost.h @@ -0,0 +1,65 @@ +/*================================================================================================*/ +/* + * Copyright 2016-2017, 2019, 2023-2024 Avid Technology, Inc. + * All rights reserved. + * + * This file is part of the Avid AAX SDK. + * + * The AAX SDK is subject to commercial or open-source licensing. + * + * By using the AAX SDK, you agree to the terms of both the Avid AAX SDK License + * Agreement and Avid Privacy Policy. + * + * AAX SDK License: https://developer.avid.com/aax + * Privacy Policy: https://www.avid.com/legal/privacy-policy-statement + * + * Or: You may also use this code under the terms of the GPL v3 (see + * www.gnu.org/licenses). + * + * THE AAX SDK IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER + * EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE + * DISCLAIMED. + */ + +#ifndef AAXLibrary_AAX_VDescriptionHost_h +#define AAXLibrary_AAX_VDescriptionHost_h + + +#include "AAX_IDescriptionHost.h" +#include "ACFPtr.h" + + +class AAX_IACFDescriptionHost; +class IACFDefinition; + + +/** Versioned wrapper for access to host service interfaces provided during plug-in description + + This object aggregates access to \ref AAX_IACFDescriptionHost and \ref IACFDefinition, with + support depending on the interface support level of the \ref IACFUnknown which is passed to + this object upon creation. + */ +class AAX_VDescriptionHost : public AAX_IDescriptionHost +{ +public: + explicit AAX_VDescriptionHost( IACFUnknown* pUnknown ); + ~AAX_VDescriptionHost() AAX_OVERRIDE; + +public: // AAX_IDescriptionHost + const AAX_IFeatureInfo* AcquireFeatureProperties(const AAX_Feature_UID& inFeatureID) const AAX_OVERRIDE; ///< \copydoc AAX_IDescriptionHost::AcquireFeatureProperties() + +public: // AAX_VDescriptionHost + bool Supported() const { return !mDescriptionHost.isNull(); } + AAX_IACFDescriptionHost* DescriptionHost() { return mDescriptionHost.inArg(); } // does not addref + const AAX_IACFDescriptionHost* DescriptionHost() const { return mDescriptionHost.inArg(); } // does not addref + IACFDefinition* HostDefinition() const { return mHostInformation.inArg(); } // does not addref + +private: + ACFPtr mDescriptionHost; + ACFPtr mHostInformation; +}; + + + + +#endif // AAXLibrary_AAX_VDescriptionHost_h diff --git a/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_VEffectDescriptor.h b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_VEffectDescriptor.h new file mode 100644 index 0000000000..05850955b1 --- /dev/null +++ b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_VEffectDescriptor.h @@ -0,0 +1,92 @@ +/*================================================================================================*/ +/* + * + * Copyright 2013-2017, 2019, 2023-2024 Avid Technology, Inc. + * All rights reserved. + * + * This file is part of the Avid AAX SDK. + * + * The AAX SDK is subject to commercial or open-source licensing. + * + * By using the AAX SDK, you agree to the terms of both the Avid AAX SDK License + * Agreement and Avid Privacy Policy. + * + * AAX SDK License: https://developer.avid.com/aax + * Privacy Policy: https://www.avid.com/legal/privacy-policy-statement + * + * Or: You may also use this code under the terms of the GPL v3 (see + * www.gnu.org/licenses). + * + * THE AAX SDK IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER + * EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE + * DISCLAIMED. + * + */ + +/** + * \file AAX_VEffectDescriptor.h + * + * \brief Version-managed concrete EffectDescriptor class + * + */ +/*================================================================================================*/ + +#ifndef AAX_VEFFECTDESCRIPTOR_H +#define AAX_VEFFECTDESCRIPTOR_H + +#include "AAX.h" +#include "AAX_IEffectDescriptor.h" +#include "AAX_IACFEffectDescriptor.h" +#include "acfunknown.h" +#include "ACFPtr.h" + +#include +#include + +class AAX_IComponentDescriptor; +class AAX_IPropertyMap; +class AAX_IACFEffectDescriptor; +class IACFUnknown; + +/** + * \brief Version-managed concrete \ref AAX_IEffectDescriptor class + * + */ +class AAX_VEffectDescriptor : public AAX_IEffectDescriptor +{ +public: + AAX_VEffectDescriptor ( IACFUnknown * pUnkHost ); + ~AAX_VEffectDescriptor () AAX_OVERRIDE; + + /** \copydoc AAX_IEffectDescriptor::NewComponentDescriptor() + * + * This implementation retains each generated \ref AAX_IComponentDescriptor and destroys the property map upon AAX_VEffectDescriptor destruction + */ + AAX_IComponentDescriptor * NewComponentDescriptor () AAX_OVERRIDE; + AAX_Result AddComponent ( AAX_IComponentDescriptor * inComponentDescriptor ) AAX_OVERRIDE; ///< \copydoc AAX_IEffectDescriptor::AddComponent() + AAX_Result AddName ( const char * inPlugInName ) AAX_OVERRIDE; ///< \copydoc AAX_IEffectDescriptor::AddName() + AAX_Result AddCategory ( uint32_t inCategory ) AAX_OVERRIDE; ///< \copydoc AAX_IEffectDescriptor::AddCategory() + AAX_Result AddCategoryBypassParameter ( uint32_t inCategory, AAX_CParamID inParamID ) AAX_OVERRIDE; ///< \copydoc AAX_IEffectDescriptor::AddCategoryBypassParameter() + AAX_Result AddProcPtr ( void * inProcPtr, AAX_CProcPtrID inProcID ) AAX_OVERRIDE; ///< \copydoc AAX_IEffectDescriptor::AddProcPtr() + /** \copydoc AAX_IEffectDescriptor::NewPropertyMap() + * + * This implementation retains each generated \ref AAX_IPropertyMap and destroys the property map upon AAX_VEffectDescriptor destruction + */ + AAX_IPropertyMap * NewPropertyMap () AAX_OVERRIDE; + AAX_Result SetProperties ( AAX_IPropertyMap * inProperties ) AAX_OVERRIDE; ///< \copydoc AAX_IEffectDescriptor::SetProperties() + AAX_Result AddResourceInfo ( AAX_EResourceType inResourceType, const char * inInfo ) AAX_OVERRIDE; ///< \copydoc AAX_IEffectDescriptor::AddResourceInfo() + AAX_Result AddMeterDescription( AAX_CTypeID inMeterID, const char * inMeterName, AAX_IPropertyMap * inProperties ) AAX_OVERRIDE; ///< \copydoc AAX_IEffectDescriptor::AddMeterDescription() + AAX_Result AddControlMIDINode ( AAX_CTypeID inNodeID, AAX_EMIDINodeType inNodeType, const char inNodeName[], uint32_t inChannelMask ) AAX_OVERRIDE; ///< \copydoc AAX_IEffectDescriptor::AddControlMIDINode() + + IACFUnknown* GetIUnknown(void) const; + +private: + ACFPtr mUnkHost; + ACFPtr mIACFEffectDescriptor; + ACFPtr mIACFEffectDescriptorV2; + std::set mComponentDescriptors; + std::set mPropertyMaps; + +}; + +#endif // AAX_VEFFECTDESCRIPTOR_H diff --git a/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_VFeatureInfo.h b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_VFeatureInfo.h new file mode 100644 index 0000000000..9d6ba99d30 --- /dev/null +++ b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_VFeatureInfo.h @@ -0,0 +1,57 @@ +/*================================================================================================*/ +/* + * Copyright 2016-2017, 2019, 2023-2024 Avid Technology, Inc. + * All rights reserved. + * + * This file is part of the Avid AAX SDK. + * + * The AAX SDK is subject to commercial or open-source licensing. + * + * By using the AAX SDK, you agree to the terms of both the Avid AAX SDK License + * Agreement and Avid Privacy Policy. + * + * AAX SDK License: https://developer.avid.com/aax + * Privacy Policy: https://www.avid.com/legal/privacy-policy-statement + * + * Or: You may also use this code under the terms of the GPL v3 (see + * www.gnu.org/licenses). + * + * THE AAX SDK IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER + * EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE + * DISCLAIMED. + */ + +#ifndef AAXLibrary_AAX_VFeatureInfo_h +#define AAXLibrary_AAX_VFeatureInfo_h + +#include "AAX_IFeatureInfo.h" + +#include "ACFPtr.h" +#include "acfbasetypes.h" + + +class AAX_IPropertyMap; +class AAX_IACFFeatureInfo; + + +/** Concrete implementation of \ref AAX_IFeatureInfo, which provides a version-controlled + interface to host feature information + */ +class AAX_VFeatureInfo : public AAX_IFeatureInfo +{ +public: + explicit AAX_VFeatureInfo( IACFUnknown* pUnknown, const AAX_Feature_UID& inFeatureID ); + ~AAX_VFeatureInfo() AAX_OVERRIDE; + +public: // AAX_IFeatureInfo + AAX_Result SupportLevel(AAX_ESupportLevel& oSupportLevel) const AAX_OVERRIDE; ///< \copydoc AAX_IFeatureInfo::SupportLevel() + const AAX_IPropertyMap* AcquireProperties() const AAX_OVERRIDE; ///< \copydoc AAX_IFeatureInfo::AcquireProperties() + const AAX_Feature_UID& ID() const AAX_OVERRIDE; ///< \copydoc AAX_IFeatureInfo::ID() + +private: + AAX_Feature_UID mFeatureID; + ACFPtr mIFeature; +}; + + +#endif diff --git a/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_VHostProcessorDelegate.h b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_VHostProcessorDelegate.h new file mode 100644 index 0000000000..091873989a --- /dev/null +++ b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_VHostProcessorDelegate.h @@ -0,0 +1,69 @@ +/*================================================================================================*/ +/* + * + * Copyright 2013-2017, 2019, 2023-2024 Avid Technology, Inc. + * All rights reserved. + * + * This file is part of the Avid AAX SDK. + * + * The AAX SDK is subject to commercial or open-source licensing. + * + * By using the AAX SDK, you agree to the terms of both the Avid AAX SDK License + * Agreement and Avid Privacy Policy. + * + * AAX SDK License: https://developer.avid.com/aax + * Privacy Policy: https://www.avid.com/legal/privacy-policy-statement + * + * Or: You may also use this code under the terms of the GPL v3 (see + * www.gnu.org/licenses). + * + * THE AAX SDK IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER + * EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE + * DISCLAIMED. + * + */ + +/** + * \file AAX_VHostProcessorDelegate.h + * + * \brief Version-managed concrete HostProcessorDelegate class + * + */ +/*================================================================================================*/ + +#ifndef AAX_VHOSTPROCESSORDELEGATE_H +#define AAX_VHOSTPROCESSORDELEGATE_H + +#include "AAX_IHostProcessorDelegate.h" +#include "AAX_IACFHostProcessorDelegate.h" +#include "ACFPtr.h" + + +class IACFUnknown; +class AAX_IACFHostProcessorDelegate; + +/*! \brief Version-managed concrete \ref AAX_IHostProcessorDelegate "Host Processor delegate" class + + \details + \ingroup AuxInterface_HostProcessor +*/ +class AAX_VHostProcessorDelegate : public AAX_IHostProcessorDelegate +{ +public: + AAX_VHostProcessorDelegate( IACFUnknown* pUnknown ); + + AAX_Result GetAudio ( const float * const inAudioIns [], int32_t inAudioInCount, int64_t inLocation, int32_t * ioNumSamples ) AAX_OVERRIDE; ///< \copydoc AAX_IHostProcessorDelegate::GetAudio() + int32_t GetSideChainInputNum () AAX_OVERRIDE; ///< \copydoc AAX_IHostProcessorDelegate::GetSideChainInputNum() + AAX_Result ForceAnalyze () AAX_OVERRIDE; ///< \copydoc AAX_IHostProcessorDelegate::ForceAnalyze() + AAX_Result ForceProcess () AAX_OVERRIDE; ///< \copydoc AAX_IHostProcessorDelegate::ForceProcess() + +private: + ACFPtr mIHostProcessorDelegate; + ACFPtr mIHostProcessorDelegateV2; + ACFPtr mIHostProcessorDelegateV3; +}; + + + +#endif //AAX_IAUTOMATIONDELEGATE_H + diff --git a/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_VHostServices.h b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_VHostServices.h new file mode 100644 index 0000000000..a598682cb3 --- /dev/null +++ b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_VHostServices.h @@ -0,0 +1,71 @@ +/*================================================================================================*/ +/* + * + * Copyright 2014-2017, 2019, 2023-2024 Avid Technology, Inc. + * All rights reserved. + * + * This file is part of the Avid AAX SDK. + * + * The AAX SDK is subject to commercial or open-source licensing. + * + * By using the AAX SDK, you agree to the terms of both the Avid AAX SDK License + * Agreement and Avid Privacy Policy. + * + * AAX SDK License: https://developer.avid.com/aax + * Privacy Policy: https://www.avid.com/legal/privacy-policy-statement + * + * Or: You may also use this code under the terms of the GPL v3 (see + * www.gnu.org/licenses). + * + * THE AAX SDK IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER + * EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE + * DISCLAIMED. + * + */ + +/** + * \file AAX_VHostServices.h + * + * \brief Version-managed concrete HostServices class + * + */ +/*================================================================================================*/ +#ifndef AAX_VHOSTSERVICES_H +#define AAX_VHOSTSERVICES_H + +#include "AAX_IHostServices.h" +#include "AAX.h" +#include "acfunknown.h" +#include "ACFPtr.h" +#include "AAX_IACFHostServices.h" + + +class IACFUnknown; +class AAX_IACFHostServices; + +/** + * \brief Version-managed concrete \ref AAX_IHostServices class + * + */ +class AAX_VHostServices : public AAX_IHostServices +{ +public: + AAX_VHostServices( IACFUnknown * pUnkHost ); + ~AAX_VHostServices( ); + + AAX_Result HandleAssertFailure ( const char * iFile, int32_t iLine, const char * iNote, /* AAX_EAssertFlags */ int32_t iFlags ) const AAX_OVERRIDE; ///< \copydoc AAX_IHostServices::HandleAssertFailure() + AAX_Result Trace ( int32_t iPriority, const char * iMessage ) const AAX_OVERRIDE; ///< \copydoc AAX_IHostServices::Trace() + AAX_Result StackTrace ( int32_t iTracePriority, int32_t iStackTracePriority, const char * iMessage ) const AAX_OVERRIDE; ///< \copydoc AAX_IHostServices::StackTrace() + +private: + ACFPtr mIACFHostServices; + ACFPtr mIACFHostServices2; + ACFPtr mIACFHostServices3; +}; + + + +#endif //AAX_IAUTOMATIONDELEGATE_H + + + diff --git a/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_VPageTable.h b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_VPageTable.h new file mode 100644 index 0000000000..08f8aaddd7 --- /dev/null +++ b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_VPageTable.h @@ -0,0 +1,86 @@ +/*================================================================================================*/ +/* + * Copyright 2016-2017, 2019, 2023-2024 Avid Technology, Inc. + * All rights reserved. + * + * This file is part of the Avid AAX SDK. + * + * The AAX SDK is subject to commercial or open-source licensing. + * + * By using the AAX SDK, you agree to the terms of both the Avid AAX SDK License + * Agreement and Avid Privacy Policy. + * + * AAX SDK License: https://developer.avid.com/aax + * Privacy Policy: https://www.avid.com/legal/privacy-policy-statement + * + * Or: You may also use this code under the terms of the GPL v3 (see + * www.gnu.org/licenses). + * + * THE AAX SDK IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER + * EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE + * DISCLAIMED. + */ + +#ifndef AAXLibrary_AAX_VPageTable_h +#define AAXLibrary_AAX_VPageTable_h + +#include "AAX_IPageTable.h" +#include "AAX_IACFPageTable.h" +#include "ACFPtr.h" + +/** + * \brief Version-managed concrete \ref AAX_IPageTable class + * + */ +class AAX_VPageTable : public AAX_IPageTable +{ +public: + AAX_VPageTable( IACFUnknown* pUnknown ); + ~AAX_VPageTable() AAX_OVERRIDE; + + // AAX_IACFPageTable + AAX_Result Clear() AAX_OVERRIDE; ///< \copydoc AAX_IPageTable::Clear() + AAX_Result Empty(AAX_CBoolean& oEmpty) const AAX_OVERRIDE; ///< \copydoc AAX_IPageTable::Empty() + AAX_Result GetNumPages(int32_t& oNumPages) const AAX_OVERRIDE; ///< \copydoc AAX_IPageTable::GetNumPages() + AAX_Result InsertPage(int32_t iPage) AAX_OVERRIDE; ///< \copydoc AAX_IPageTable::InsertPage() + AAX_Result RemovePage(int32_t iPage) AAX_OVERRIDE; ///< \copydoc AAX_IPageTable::RemovePage() + AAX_Result GetNumMappedParameterIDs(int32_t iPage, int32_t& oNumParameterIdentifiers) const AAX_OVERRIDE; ///< \copydoc AAX_IPageTable::GetNumMappedParameterIDs() + AAX_Result ClearMappedParameter(int32_t iPage, int32_t iIndex) AAX_OVERRIDE; ///< \copydoc AAX_IPageTable::ClearMappedParameter() + AAX_Result GetMappedParameterID(int32_t iPage, int32_t iIndex, AAX_IString& oParameterIdentifier) const AAX_OVERRIDE; ///< \copydoc AAX_IPageTable::GetMappedParameterID() + AAX_Result MapParameterID(AAX_CParamID iParameterIdentifier, int32_t iPage, int32_t iIndex) AAX_OVERRIDE; ///< \copydoc AAX_IPageTable::MapParameterID() + + // AAX_IACFPageTable_V2 + AAX_Result GetNumParametersWithNameVariations(int32_t& oNumParameterIdentifiers) const AAX_OVERRIDE; ///< \copydoc AAX_IPageTable::GetNumParametersWithNameVariations() + AAX_Result GetNameVariationParameterIDAtIndex(int32_t iIndex, AAX_IString& oParameterIdentifier) const AAX_OVERRIDE; ///< \copydoc AAX_IPageTable::GetNameVariationParameterIDAtIndex() + AAX_Result GetNumNameVariationsForParameter(AAX_CPageTableParamID iParameterIdentifier, int32_t& oNumVariations) const AAX_OVERRIDE; ///< \copydoc AAX_IPageTable::GetNumNameVariationsForParameter() + AAX_Result GetParameterNameVariationAtIndex(AAX_CPageTableParamID iParameterIdentifier, int32_t iIndex, AAX_IString& oNameVariation, int32_t& oLength) const AAX_OVERRIDE; ///< \copydoc AAX_IPageTable::GetParameterNameVariationAtIndex() + AAX_Result GetParameterNameVariationOfLength(AAX_CPageTableParamID iParameterIdentifier, int32_t iLength, AAX_IString& oNameVariation) const AAX_OVERRIDE; ///< \copydoc AAX_IPageTable::GetParameterNameVariationOfLength() + AAX_Result ClearParameterNameVariations() AAX_OVERRIDE; ///< \copydoc AAX_IPageTable::ClearParameterNameVariations() + AAX_Result ClearNameVariationsForParameter(AAX_CPageTableParamID iParameterIdentifier) AAX_OVERRIDE; ///< \copydoc AAX_IPageTable::ClearNameVariationsForParameter() + AAX_Result SetParameterNameVariation(AAX_CPageTableParamID iParameterIdentifier, const AAX_IString& iNameVariation, int32_t iLength) AAX_OVERRIDE; ///< \copydoc AAX_IPageTable::SetParameterNameVariation() + + // AAX_VPageTable + + /** Returns the latest supported versioned ACF interface (e.g. an \ref AAX_IACFPageTable) which + is wrapped by this \ref AAX_IPageTable + */ + const IACFUnknown* AsUnknown() const + { + return mIPageTable.inArg(); + } + + /** \copydoc AAX_VPageTable::AsUnknown() const + */ + IACFUnknown* AsUnknown() + { + return mIPageTable.inArg(); + } + + bool IsSupported() const { return !mIPageTable.isNull(); } + +private: + ACFPtr mIPageTable; + ACFPtr mIPageTable2; +}; + +#endif diff --git a/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_VPrivateDataAccess.h b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_VPrivateDataAccess.h new file mode 100644 index 0000000000..7d10603293 --- /dev/null +++ b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_VPrivateDataAccess.h @@ -0,0 +1,64 @@ +/*================================================================================================*/ +/* + * + * Copyright 2014-2017, 2019, 2023-2024 Avid Technology, Inc. + * All rights reserved. + * + * This file is part of the Avid AAX SDK. + * + * The AAX SDK is subject to commercial or open-source licensing. + * + * By using the AAX SDK, you agree to the terms of both the Avid AAX SDK License + * Agreement and Avid Privacy Policy. + * + * AAX SDK License: https://developer.avid.com/aax + * Privacy Policy: https://www.avid.com/legal/privacy-policy-statement + * + * Or: You may also use this code under the terms of the GPL v3 (see + * www.gnu.org/licenses). + * + * THE AAX SDK IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER + * EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE + * DISCLAIMED. + * + */ + +/** + * \file AAX_VPrivateDataAccess.h + * + * \brief Version-managed concrete PrivateDataAccess class + * + */ +/*================================================================================================*/ +#ifndef AAX_VPRIVATEDATAACCESS_H +#define AAX_VPRIVATEDATAACCESS_H + +#include "AAX_IPrivateDataAccess.h" +#include "AAX_IACFPrivateDataAccess.h" +#include "ACFPtr.h" + + +class IACFUnknown; + +/** + * \brief Version-managed concrete \ref AAX_IPrivateDataAccess class + * + */ +class AAX_VPrivateDataAccess : public AAX_IPrivateDataAccess +{ +public: + AAX_VPrivateDataAccess( IACFUnknown* pUnknown ); + ~AAX_VPrivateDataAccess() AAX_OVERRIDE; + + // Direct access methods + AAX_Result ReadPortDirect( AAX_CFieldIndex inFieldIndex, const uint32_t inOffset, const uint32_t inSize, void* outBuffer ) AAX_OVERRIDE; ///< \copydoc AAX_IPrivateDataAccess::ReadPortDirect() + AAX_Result WritePortDirect( AAX_CFieldIndex inFieldIndex, const uint32_t inOffset, const uint32_t inSize, const void* inBuffer ) AAX_OVERRIDE; ///< \copydoc AAX_IPrivateDataAccess::WritePortDirect() + + +private: + AAX_IACFPrivateDataAccess* mIPrivateDataAccess; +}; + + +#endif //AAX_VPRIVATEDATAACCESS_H + diff --git a/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_VPropertyMap.h b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_VPropertyMap.h new file mode 100644 index 0000000000..8bdd7502db --- /dev/null +++ b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_VPropertyMap.h @@ -0,0 +1,98 @@ +/*================================================================================================*/ +/* + * + * Copyright 2013-2017, 2019, 2023-2024 Avid Technology, Inc. + * All rights reserved. + * + * This file is part of the Avid AAX SDK. + * + * The AAX SDK is subject to commercial or open-source licensing. + * + * By using the AAX SDK, you agree to the terms of both the Avid AAX SDK License + * Agreement and Avid Privacy Policy. + * + * AAX SDK License: https://developer.avid.com/aax + * Privacy Policy: https://www.avid.com/legal/privacy-policy-statement + * + * Or: You may also use this code under the terms of the GPL v3 (see + * www.gnu.org/licenses). + * + * THE AAX SDK IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER + * EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE + * DISCLAIMED. + * + */ + +/** + * \file AAX_VPropertyMap.h + * + * \brief Version-managed concrete PropertyMap class + * + */ +/*================================================================================================*/ + +#ifndef AAX_VPROPERTYMAP_H +#define AAX_VPROPERTYMAP_H + +// AAX Includes +#include "AAX_IPropertyMap.h" +#include "AAX_IACFPropertyMap.h" +#include "AAX.h" + +// ACF Includes +#include "acfunknown.h" +#include "ACFPtr.h" + +// Standard Includes +#include + + +class IACFComponentFactory; +class AAX_IACFPropertyMap; +class AAX_IACFDescriptionHost; + +/** + * \brief Version-managed concrete \ref AAX_IPropertyMap class + * + */ +class AAX_VPropertyMap : public AAX_IPropertyMap +{ +public: + // Using static creation methods instead of public constructor in order to + // distinguish between creating a new property map from a component factory + // and acquiring a reference to an existing property map. + static AAX_VPropertyMap* Create ( IACFUnknown* inComponentFactory ); ///< \p inComponentFactory must support \c IID_IACFComponentFactory - otherwise NULL is returned + static AAX_VPropertyMap* Acquire ( IACFUnknown* inPropertyMapUnknown ); ///< \p inPropertyMapUnknown must support at least one \ref AAX_IPropertyMap interface - otherwise an \ref AAX_VPropertyMap object with no backing interface is returned + +private: + AAX_VPropertyMap (); + void InitWithFactory (IACFComponentFactory* inComponentFactory, IACFUnknown* inAuxiliaryUnknown); ///< \p inAuxiliaryUnknown should support at least \ref IID_IAAXDescriptionHostV1 (may be NULL) + void InitWithPropertyMap (IACFUnknown* inPropertyMapUnknown, IACFUnknown* inAuxiliaryUnknown); ///< \p inAuxiliaryUnknown should support at least \ref IID_IAAXDescriptionHostV1 (may be NULL) + +public: + ~AAX_VPropertyMap(void) AAX_OVERRIDE; + + // AAX_IACFPropertyMap methods + AAX_CBoolean GetProperty ( AAX_EProperty inProperty, AAX_CPropertyValue * outValue ) const AAX_OVERRIDE; ///< \copydoc AAX_IPropertyMap::GetProperty() + AAX_CBoolean GetPointerProperty ( AAX_EProperty inProperty, const void** outValue ) const AAX_OVERRIDE; ///< \copydoc AAX_IPropertyMap::GetPointerProperty() + AAX_Result AddProperty ( AAX_EProperty inProperty, AAX_CPropertyValue inValue ) AAX_OVERRIDE; ///< \copydoc AAX_IPropertyMap::AddProperty() + AAX_Result AddPointerProperty ( AAX_EProperty inProperty, const void* inValue ) AAX_OVERRIDE; ///< \copydoc AAX_IPropertyMap::AddPointerProperty(AAX_EProperty, const void*) + AAX_Result AddPointerProperty ( AAX_EProperty inProperty, const char* inValue ) AAX_OVERRIDE; ///< \copydoc AAX_IPropertyMap::AddPointerProperty(AAX_EProperty, const char*) + AAX_Result RemoveProperty ( AAX_EProperty inProperty ) AAX_OVERRIDE; ///< \copydoc AAX_IPropertyMap::RemoveProperty() + AAX_Result AddPropertyWithIDArray ( AAX_EProperty inProperty, const AAX_SPlugInIdentifierTriad* inPluginIDs, uint32_t inNumPluginIDs) AAX_OVERRIDE; ///< \copydoc AAX_IPropertyMap::AddPropertyWithIDArray() + AAX_CBoolean GetPropertyWithIDArray ( AAX_EProperty inProperty, const AAX_SPlugInIdentifierTriad** outPluginIDs, uint32_t* outNumPluginIDs) const AAX_OVERRIDE; ///< \copydoc AAX_IPropertyMap::GetPropertyWithIDArray() + + // AAX_IPropertyMap methods + IACFUnknown* GetIUnknown() AAX_OVERRIDE; ///< \copydoc AAX_IPropertyMap::GetIUnknown() + +private: + ACFPtr mIACFPropertyMap; + ACFPtr mIACFPropertyMapV2; + ACFPtr mIACFPropertyMapV3; + ACFPtr mIACFDescriptionHost; + std::map mLocalPointerPropertyCache; +}; + + + +#endif // AAX_VPROPERTYMAP_H diff --git a/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_VSessionDocument.h b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_VSessionDocument.h new file mode 100644 index 0000000000..759a6d42f2 --- /dev/null +++ b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_VSessionDocument.h @@ -0,0 +1,71 @@ +/*================================================================================================*/ +/* + * + * Copyright 2023-2024 Avid Technology, Inc. + * All rights reserved. + * + * This file is part of the Avid AAX SDK. + * + * The AAX SDK is subject to commercial or open-source licensing. + * + * By using the AAX SDK, you agree to the terms of both the Avid AAX SDK License + * Agreement and Avid Privacy Policy. + * + * AAX SDK License: https://developer.avid.com/aax + * Privacy Policy: https://www.avid.com/legal/privacy-policy-statement + * + * Or: You may also use this code under the terms of the GPL v3 (see + * www.gnu.org/licenses). + * + * THE AAX SDK IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER + * EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE + * DISCLAIMED. + * + */ + +/** + * \file AAX_VSessionDocument.h + */ +/*================================================================================================*/ + +#pragma once +#ifndef AAX_VSessionDocument_H +#define AAX_VSessionDocument_H + +#include "AAX_ISessionDocument.h" +#include "ACFPtr.h" + +class AAX_IACFSessionDocument; +class AAX_IDataBufferWrapper; + +class AAX_VSessionDocument : public AAX_ISessionDocument +{ +public: + explicit AAX_VSessionDocument(IACFUnknown * iUnknown); + ~AAX_VSessionDocument() AAX_OVERRIDE; + + class VTempoMap : public AAX_ISessionDocument::TempoMap + { + public: + ~VTempoMap() AAX_OVERRIDE; + explicit VTempoMap(IACFUnknown & inDataBuffer); + int32_t Size() const AAX_OVERRIDE; + AAX_CTempoBreakpoint const * Data() const AAX_OVERRIDE; + private: + std::unique_ptr mDataBuffer; + }; + + /** + * \brief Release all interface references + */ + void Clear(); + + bool Valid() const AAX_OVERRIDE; + std::unique_ptr GetTempoMap() AAX_OVERRIDE; + AAX_Result GetDocumentData(AAX_DocumentData_UID const & inDataType, IACFUnknown ** outData) AAX_OVERRIDE; + +private: + ACFPtr mSessionDocumentV1; +}; + +#endif // AAX_VSessionDocument_H diff --git a/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_VTask.h b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_VTask.h new file mode 100644 index 0000000000..b0dfbc5756 --- /dev/null +++ b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_VTask.h @@ -0,0 +1,63 @@ +/*================================================================================================*/ +/* + * + * Copyright 2023-2024 Avid Technology, Inc. + * All rights reserved. + * + * This file is part of the Avid AAX SDK. + * + * The AAX SDK is subject to commercial or open-source licensing. + * + * By using the AAX SDK, you agree to the terms of both the Avid AAX SDK License + * Agreement and Avid Privacy Policy. + * + * AAX SDK License: https://developer.avid.com/aax + * Privacy Policy: https://www.avid.com/legal/privacy-policy-statement + * + * Or: You may also use this code under the terms of the GPL v3 (see + * www.gnu.org/licenses). + * + * THE AAX SDK IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER + * EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE + * DISCLAIMED. + * + */ + +/** + * \file AAX_VTask.h + */ +/*================================================================================================*/ + +#pragma once + +#ifndef AAX_VTask_H +#define AAX_VTask_H + +#include "AAX_ITask.h" +#include "AAX.h" + +#include "ACFPtr.h" + +class IACFUnknown; + +/*! + \brief Version-managed concrete \ref AAX_ITask + */ +class AAX_VTask : public AAX_ITask +{ +public: + explicit AAX_VTask( IACFUnknown* pUnknown ); + ~AAX_VTask() AAX_OVERRIDE; + + AAX_Result GetType(AAX_CTypeID * oType) const AAX_OVERRIDE; ///< \copydoc AAX_ITask::GetType() + AAX_IACFDataBuffer const * GetArgumentOfType(AAX_CTypeID iType) const AAX_OVERRIDE; ///< \copydoc AAX_ITask::GetArgumentOfType() + + AAX_Result SetProgress(float iProgress) AAX_OVERRIDE; ///< \copydoc AAX_ITask::SetProgress() + float GetProgress() const AAX_OVERRIDE; ///< \copydoc AAX_ITask::GetProgress() + AAX_Result AddResult(AAX_IACFDataBuffer const * iResult) AAX_OVERRIDE; ///< \copydoc AAX_ITask::AddResult() + AAX_ITask * SetDone(AAX_TaskCompletionStatus iStatus) AAX_OVERRIDE; ///< \copydoc AAX_ITask::SetDone() +private: + ACFPtr mTaskV1; +}; + +#endif diff --git a/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_VTransport.h b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_VTransport.h new file mode 100644 index 0000000000..8c79efc277 --- /dev/null +++ b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_VTransport.h @@ -0,0 +1,96 @@ +/*================================================================================================*/ +/* + * + * Copyright 2013-2017, 2019-2021, 2023-2024 Avid Technology, Inc. + * All rights reserved. + * + * This file is part of the Avid AAX SDK. + * + * The AAX SDK is subject to commercial or open-source licensing. + * + * By using the AAX SDK, you agree to the terms of both the Avid AAX SDK License + * Agreement and Avid Privacy Policy. + * + * AAX SDK License: https://developer.avid.com/aax + * Privacy Policy: https://www.avid.com/legal/privacy-policy-statement + * + * Or: You may also use this code under the terms of the GPL v3 (see + * www.gnu.org/licenses). + * + * THE AAX SDK IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER + * EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE + * DISCLAIMED. + * + */ + +/** + * \file AAX_VTransport.h + * + * \brief Version-managed concrete Transport class + * + */ +/*================================================================================================*/ + +#ifndef AAX_VTRANSPORT_H +#define AAX_VTRANSPORT_H + +#pragma once + +#include "AAX_ITransport.h" +#include "AAX_IACFTransport.h" +#include "AAX_IACFTransportControl.h" +#include "ACFPtr.h" + +/** + * \brief Version-managed concrete \ref AAX_ITransport class + * + */ +class AAX_VTransport : public AAX_ITransport +{ +public: + AAX_VTransport( IACFUnknown* pUnknown ); + ~AAX_VTransport() AAX_OVERRIDE; + + // Transport Information Getters + // AAX_IACFTransport + AAX_Result GetCurrentTempo ( double* TempoBPM ) const AAX_OVERRIDE; ///< \copydoc AAX_ITransport::GetCurrentTempo() + AAX_Result GetCurrentMeter ( int32_t* MeterNumerator, int32_t* MeterDenominator ) const AAX_OVERRIDE; ///< \copydoc AAX_ITransport::GetCurrentMeter() + AAX_Result IsTransportPlaying ( bool* isPlaying ) const AAX_OVERRIDE; ///< \copydoc AAX_ITransport::IsTransportPlaying() + AAX_Result GetCurrentTickPosition ( int64_t* TickPosition ) const AAX_OVERRIDE; ///< \copydoc AAX_ITransport::GetCurrentTickPosition() + AAX_Result GetCurrentLoopPosition ( bool* bLooping, int64_t* LoopStartTick, int64_t* LoopEndTick ) const AAX_OVERRIDE; ///< \copydoc AAX_ITransport::GetCurrentLoopPosition() + AAX_Result GetCurrentNativeSampleLocation ( int64_t* SampleLocation ) const AAX_OVERRIDE; ///< \copydoc AAX_ITransport::GetCurrentNativeSampleLocation() + AAX_Result GetCustomTickPosition( int64_t* oTickPosition, int64_t iSampleLocation) const AAX_OVERRIDE; ///< \copydoc AAX_ITransport::GetCustomTickPosition() + AAX_Result GetBarBeatPosition(int32_t* Bars, int32_t* Beats, int64_t* DisplayTicks, int64_t SampleLocation) const AAX_OVERRIDE; ///< \copydoc AAX_ITransport::GetBarBeatPosition() + AAX_Result GetTicksPerQuarter ( uint32_t* ticks ) const AAX_OVERRIDE; ///< \copydoc AAX_ITransport::GetTicksPerQuarter() + AAX_Result GetCurrentTicksPerBeat ( uint32_t* ticks ) const AAX_OVERRIDE; ///< \copydoc AAX_ITransport::GetCurrentTicksPerBeat() + + // AAX_IACFTransport_V2 + AAX_Result GetTimelineSelectionStartPosition ( int64_t* oSampleLocation ) const AAX_OVERRIDE; ///< \copydoc AAX_ITransport::GetTimelineSelectionStartPosition() + AAX_Result GetTimeCodeInfo( AAX_EFrameRate* oFrameRate, int32_t* oOffset ) const AAX_OVERRIDE; ///< \copydoc AAX_ITransport::GetTimeCodeInfo() + AAX_Result GetFeetFramesInfo( AAX_EFeetFramesRate* oFeetFramesRate, int64_t* oOffset ) const AAX_OVERRIDE; ///< \copydoc AAX_ITransport::GetFeetFramesInfo() + AAX_Result IsMetronomeEnabled ( int32_t* isEnabled ) const AAX_OVERRIDE; ///< \copydoc AAX_ITransport::IsMetronomeEnabled() + + // AAX_IACFTransport_V3 + AAX_Result GetHDTimeCodeInfo( AAX_EFrameRate* oHDFrameRate, int64_t* oHDOffset ) const AAX_OVERRIDE; ///< \copydoc AAX_ITransport::GetHDTimeCodeInfo() + + // AAX_IACFTransport_V4 + AAX_Result GetTimelineSelectionEndPosition( int64_t* oSampleLocation ) const AAX_OVERRIDE; ///< \copydoc AAX_ITransport::GetTimelineSelectionEndPosition() + + // AAX_IACFTransport_V5 + AAX_Result GetKeySignature( int64_t iSampleLocation, uint32_t* oKeySignature ) const AAX_OVERRIDE; ///< \copydoc AAX_ITransport::GetKeySignature() + + // AAX_IACFTransportControl + AAX_Result RequestTransportStart() AAX_OVERRIDE; ///< \copydoc AAX_ITransport::RequestTransportStart() + AAX_Result RequestTransportStop() AAX_OVERRIDE; ///< \copydoc AAX_ITransport::RequestTransportStop() + +private: + ACFPtr mITransport; + ACFPtr mITransportV2; + ACFPtr mITransportV3; + ACFPtr mITransportV4; + ACFPtr mITransportV5; + ACFPtr mITransportControl; +}; + +#endif // AAX_VTRANSPORT_H + diff --git a/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_VViewContainer.h b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_VViewContainer.h new file mode 100644 index 0000000000..480919adb0 --- /dev/null +++ b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_VViewContainer.h @@ -0,0 +1,79 @@ +/*================================================================================================*/ +/* + * + * Copyright 2013-2017, 2019, 2021, 2023-2024 Avid Technology, Inc. + * All rights reserved. + * + * This file is part of the Avid AAX SDK. + * + * The AAX SDK is subject to commercial or open-source licensing. + * + * By using the AAX SDK, you agree to the terms of both the Avid AAX SDK License + * Agreement and Avid Privacy Policy. + * + * AAX SDK License: https://developer.avid.com/aax + * Privacy Policy: https://www.avid.com/legal/privacy-policy-statement + * + * Or: You may also use this code under the terms of the GPL v3 (see + * www.gnu.org/licenses). + * + * THE AAX SDK IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER + * EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE + * DISCLAIMED. + * + */ + +/** + * \file AAX_VViewContainer.h + * + * \brief Version-managed concrete ViewContainer class + * + */ +/*================================================================================================*/ + +#ifndef AAX_VVIEWCONTAINER_H +#define AAX_VVIEWCONTAINER_H + +#include "AAX_IViewContainer.h" +#include "AAX_IACFViewContainer.h" +#include "ACFPtr.h" + + +class IACFUnknown; + +/** + * \brief Version-managed concrete \ref AAX_IViewContainer class + * + */ +class AAX_VViewContainer : public AAX_IViewContainer +{ +public: + AAX_VViewContainer( IACFUnknown * pUnknown ); + ~AAX_VViewContainer() AAX_OVERRIDE; + + // AAX_IACFViewContainer + + // Getters + int32_t GetType () AAX_OVERRIDE; ///< \copydoc AAX_IViewContainer::GetType() + void * GetPtr () AAX_OVERRIDE; ///< \copydoc AAX_IViewContainer::GetPtr() + AAX_Result GetModifiers ( uint32_t * outModifiers ) AAX_OVERRIDE; ///< \copydoc AAX_IViewContainer::GetModifiers() + + // Setters + AAX_Result SetViewSize ( AAX_Point & inSize ) AAX_OVERRIDE; ///< \copydoc AAX_IViewContainer::SetViewSize() + AAX_Result HandleParameterMouseDown ( AAX_CParamID inParamID, uint32_t inModifiers ) AAX_OVERRIDE; ///< \copydoc AAX_IViewContainer::HandleParameterMouseDown() + AAX_Result HandleParameterMouseDrag ( AAX_CParamID inParamID, uint32_t inModifiers ) AAX_OVERRIDE; ///< \copydoc AAX_IViewContainer::HandleParameterMouseDrag() + AAX_Result HandleParameterMouseUp ( AAX_CParamID inParamID, uint32_t inModifiers ) AAX_OVERRIDE; ///< \copydoc AAX_IViewContainer::HandleParameterMouseUp() + AAX_Result HandleParameterMouseEnter ( AAX_CParamID inParamID, uint32_t inModifiers ) AAX_OVERRIDE; ///< \copydoc AAX_IViewContainer::HandleParameterMouseEnter() + AAX_Result HandleParameterMouseExit ( AAX_CParamID inParamID, uint32_t inModifiers ) AAX_OVERRIDE; ///< \copydoc AAX_IViewContainer::HandleParameterMouseExit() + AAX_Result HandleMultipleParametersMouseDown ( const AAX_CParamID* inParamIDs, uint32_t inNumOfParams, uint32_t inModifiers ) AAX_OVERRIDE; ///< \copydoc AAX_IViewContainer::HandleMultipleParametersMouseDown() + AAX_Result HandleMultipleParametersMouseDrag ( const AAX_CParamID* inParamIDs, uint32_t inNumOfParams, uint32_t inModifiers ) AAX_OVERRIDE; ///< \copydoc AAX_IViewContainer::HandleMultipleParametersMouseDrag() + AAX_Result HandleMultipleParametersMouseUp ( const AAX_CParamID* inParamIDs, uint32_t inNumOfParams, uint32_t inModifiers ) AAX_OVERRIDE; ///< \copydoc AAX_IViewContainer::HandleMultipleParametersMouseUp() + +private: + ACFPtr mIViewContainer; + ACFPtr mIViewContainerV2; + ACFPtr mIViewContainerV3; +}; + + +#endif //AAX_VVIEWCONTAINER_H diff --git a/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_Version.h b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_Version.h new file mode 100644 index 0000000000..6d38fc8be5 --- /dev/null +++ b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_Version.h @@ -0,0 +1,91 @@ +/*================================================================================================*/ +/* + + * Copyright 2013-2017, 2019, 2021-2024 Avid Technology, Inc. + * All rights reserved. + * + * This file is part of the Avid AAX SDK. + * + * The AAX SDK is subject to commercial or open-source licensing. + * + * By using the AAX SDK, you agree to the terms of both the Avid AAX SDK License + * Agreement and Avid Privacy Policy. + * + * AAX SDK License: https://developer.avid.com/aax + * Privacy Policy: https://www.avid.com/legal/privacy-policy-statement + * + * Or: You may also use this code under the terms of the GPL v3 (see + * www.gnu.org/licenses). + * + * THE AAX SDK IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER + * EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE + * DISCLAIMED. + * + */ + +/** + * \file AAX_Version.h + * + * \brief Version stamp header for the %AAX SDK + * + * This file defines a unique number that can be used to identify the version of the %AAX SDK + */ +/*================================================================================================*/ + + +#pragma once + +#ifndef _AAX_VERSION_H_ +#define _AAX_VERSION_H_ + + +/** \brief The SDK's version number + * + * \details + * This version number is generally updated only when changes have been + * made to the %AAX binary interface + * + * - The first byte is the major version number + * - The second byte is the minor version number + * + * For example: + * - SDK 1.0.5 > \c 0x0100 + * - SDK 10.2.1 > \c 0x0A02 + * + */ +#define AAX_SDK_VERSION ( 0x0206 ) + +/** \brief An atomic revision number for the source included in this SDK + */ +#define AAX_SDK_CURRENT_REVISION ( 20207000 ) + + +#define AAX_SDK_1p0p1_REVISION ( 3712639 ) +#define AAX_SDK_1p0p2_REVISION ( 3780585 ) +#define AAX_SDK_1p0p3_REVISION ( 3895859 ) +#define AAX_SDK_1p0p4_REVISION ( 4333589 ) +#define AAX_SDK_1p0p5_REVISION ( 4598560 ) +#define AAX_SDK_1p0p6_REVISION ( 5051497 ) +#define AAX_SDK_1p5p0_REVISION ( 5740047 ) +#define AAX_SDK_2p0b1_REVISION ( 6169787 ) +#define AAX_SDK_2p0p0_REVISION ( 6307708 ) +#define AAX_SDK_2p0p1_REVISION ( 6361692 ) +#define AAX_SDK_2p1p0_REVISION ( 7820991 ) +#define AAX_SDK_2p1p1_REVISION ( 8086416 ) +#define AAX_SDK_2p2p0_REVISION ( 9967334 ) +#define AAX_SDK_2p2p1_REVISION ( 10693954 ) +#define AAX_SDK_2p2p2_REVISION ( 11819832 ) +#define AAX_SDK_2p3p0_REVISION ( 12546840 ) +#define AAX_SDK_2p3p1_REVISION ( 13200373 ) +#define AAX_SDK_2p3p2_REVISION ( 14017972 ) +#define AAX_SDK_2p4p0_REVISION ( 20204000 ) +#define AAX_SDK_2p4p1_REVISION ( 20204010 ) +#define AAX_SDK_2p5p0_REVISION ( 20205000 ) +#define AAX_SDK_2p6p0_REVISION ( 20206000 ) +#define AAX_SDK_2p6p1_REVISION ( 20206001 ) +#define AAX_SDK_2p7p0_REVISION ( 20207000 ) +//CURREVSTAMP < do not remove this comment + + + +#endif // #ifndef _AAX_VERSION_H_ diff --git a/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/ACF/ACFPtr.h b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/ACF/ACFPtr.h new file mode 100644 index 0000000000..b0b25b5eca --- /dev/null +++ b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/ACF/ACFPtr.h @@ -0,0 +1,387 @@ +/*********************************************************************** + + This file is part of the Avid AAX SDK. + + The AAX SDK is subject to commercial or open-source licensing. + + By using the AAX SDK, you agree to the terms of both the Avid AAX SDK License + Agreement and Avid Privacy Policy. + + AAX SDK License: https://developer.avid.com/aax + Privacy Policy: https://www.avid.com/legal/privacy-policy-statement + + Or: You may also use this code under the terms of the GPL v3 (see + www.gnu.org/licenses). + + THE AAX SDK IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER + EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE + DISCLAIMED. + + Copyright (c) 2004, 2024 Avid Technology, Inc. All rights reserved. + +************************************************************************/ + + + + +/*! + \file ACFPtr.h + \brief Smart pointer template. Used for automation of referance counting +*/ + +#ifndef ACFPtr_h +#define ACFPtr_h + +#include "acfbasetypes.h" +#include "acfresult.h" +#include "acfassert.h" + +#include "acfunknown.h" // for IACFUnknown and ACFMETHODCALLTYPE + +/*! \def ACFPTR_CAN_THROW + Macro to conditionally include or exclude the use of C++ exceptions. + + If client code does not need exceptions then define ACFPTR_CAN_THROW 0 + for the each executable project that uses this header. + */ +#ifndef ACFPTR_CAN_THROW +#define ACFPTR_CAN_THROW 1 // default is to allow throwing of C++ exceptions. +#endif + +#ifdef __clang__ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wnon-virtual-dtor" +#endif // __clang__ + +/*! + Class used to prevent add ref on stuff by ACFPtr::operator ->(). + Added by Stephen Wilson of Digidesign. + */ +template +class ACFNoAddRefReleaseOnPtr : public T +{ +private: + virtual acfUInt32 ACFMETHODCALLTYPE AddRef()=0; + virtual acfUInt32 ACFMETHODCALLTYPE Release()=0; +}; + +#ifdef __clang__ +#pragma clang diagnostic pop +#endif // __clang__ + + +/*! + Template arguments: + + T: the kind of object to which this pointer will + point. This class must support QueryInterface(), AddRef() and Release() methods. +*/ +template +class ACFPtr +{ +public: + /// Default constructor + ACFPtr (); + + /// Copy constructor + ACFPtr (const ACFPtr & rhs); + + /// Construct from a reference, the reference will be AddRef'd. + ACFPtr (T * reference); + + /// Constructor shorthand for reference0->QueryInterface(iid, (void**)&_reference). + /// NOTE: The return value from QueryInterface is ignored. if the internal reference + /// is 0 then eiher the error "was" ACF_E_NOINTERFACE or ACF_E_INVALIDARG if + /// reference0 was 0 (or ACF_E_POINTER). + ACFPtr (const acfIID & iid, IACFUnknown * reference0); + + /// Destructor + ~ACFPtr (); + + /// assignment operator + ACFPtr & operator= (const ACFPtr & rhs); + + /// assignment operator for a new reference + ACFPtr & operator= (T * rhs); + + /// Method that is used pass the internal reference as an input argument to a + /// function or method. This is just a more explicit version of the coercion + /// operator T * () const; + /// \note The reference count for the returned interface pointer has not been increased with AddRef(); + T* inArg() const ; + + /// Method that is used pass the internal reference as an output argument to a + /// function or method. + /// \note If there is an internal reference to an interface then it will be released. + T** outArg(); + + /// Method that is used pass the internal reference as an in/out argument to a + /// function or method. + /// \note If there is an internal reference to an interface then it is not released. + /// The function or method that is accepting the in/out argument it responsible for + /// either releasing, reusing or replacing the given interface pointed to by T*. If + /// the given interface is reused it does not have to be AddRef'd. + T** inOutArg(); + + /// Allows passing this smart ptr as argument to methods which expect + /// a T** or a void**, in order to fill it in. (e.g. QueryInterface). NOTE: if the internal + /// reference is non-NULL it will be Released. + /// to this object. + /// \deprecated Please use the outArg() method (or inOutArg()) instead. + T** operator& (); + + /// Allows passing this smart ptr as argument to methods which expect + /// a T *. + operator T * () const; + + /// member access operators. NOTE: this method will throw ACFRESULT(ACF_E_POINTER) + /// if _reference is 0. + ACFNoAddRefReleaseOnPtr * operator-> (); + + /// const member access operator. NOTE: this method will throw ACFRESULT(ACF_E_POINTER) + /// if _reference is 0. (note: AddRef() and Release() are non-const so they cannot + /// be called from this const operator.) + const T * operator-> () const; + + /// Allows caller to determine whether or not the internal reference pointer has been + /// assigned. + bool isNull() const; + + /// Allows calling operator ! just like a regular pointer. Returns true if the + /// internal reference pointer isNull. + bool operator! () const; + + /// Direct assignment of reference without calling AddRef(). This could + /// be called if an interface has already been AddRef'd. + void attach(T * reference); + + /// Return the internal reference without calling Release(). + T * detach(void); + +private: + /// Internal method to acquire another reference to the interface stored in _reference + /// (call AddRef()) + void acquire(void); + + /// Release the current reference. + void clear(void); + +private: + /// Current referenced interface + T * _reference; +}; + + + + +// +// Examples and recommended practices +// + +#if 0 +#endif + + + + + + +// +// Implementations +// + +template +inline ACFPtr::ACFPtr () + : _reference (0) +{ +} + + +template +inline ACFPtr::ACFPtr(const ACFPtr & rhs) + : _reference (rhs._reference) +{ + acquire(); +} + + +template +inline ACFPtr::ACFPtr(T * reference) + : _reference (reference) +{ + acquire(); +} + +template +inline ACFPtr::ACFPtr (const acfIID & iid, IACFUnknown * reference0) + : _reference (0) +{ + if (!reference0) { +#if ACFPTR_CAN_THROW + throw ACFRESULT( ACF_E_INVALIDARG ); +#else + ACFASSERT(reference0); +#endif + } else { + ACFRESULT result = reference0->QueryInterface (iid, reinterpret_cast (&_reference)); + if (ACFFAILED(result)) +#if ACFPTR_CAN_THROW + throw ACFRESULT(result); +#else + ACFASSERT(ACFSUCCEEDED(result)); +#endif + } +} + +template +inline ACFPtr::~ACFPtr () +{ + clear(); +} + + +template +inline ACFPtr & ACFPtr::operator= (const ACFPtr & rhs) +{ + if (&rhs != this) + { + clear(); + _reference = rhs._reference; + acquire(); + } + return *this; +} + + +template +inline ACFPtr & ACFPtr::operator= (T * rhs) +{ + if (rhs != _reference) + { + if (rhs) + rhs->AddRef(); + clear(); + _reference = rhs; + } + return *this; +} + +template +inline T* ACFPtr::inArg() const +{ + return _reference; +} + +template +inline T** ACFPtr::outArg() +{ + clear(); + return &_reference; +} + +template +inline T** ACFPtr::inOutArg() +{ + return &_reference; +} + + +template +inline T** ACFPtr::operator & () +{ + clear(); + return &_reference; +} + + +template +inline ACFPtr::operator T * () const +{ + return _reference; +} + + +template +inline ACFNoAddRefReleaseOnPtr* ACFPtr::operator-> () +{ +#if ACFPTR_CAN_THROW + if (NULL == _reference) + throw ACFRESULT(ACF_E_POINTER); +#else + ACFASSERT(_reference); // reference pointer has not been initialized! +#endif + return (ACFNoAddRefReleaseOnPtr*)_reference; +} + + +template +inline const T* ACFPtr::operator-> () const +{ +#if ACFPTR_CAN_THROW + if (NULL == _reference) + throw ACFRESULT(ACF_E_POINTER); +#else + ACFASSERT(_reference); // reference pointer has not been initialized! +#endif + return _reference; +} + + +template +inline bool ACFPtr::isNull () const +{ + return (NULL == _reference); +} + + +template +inline bool ACFPtr::operator! () const +{ + return isNull(); +} + + +template +inline void ACFPtr::attach (T * reference) +{ + clear(); + _reference = reference; +} + + +template +inline T * ACFPtr::detach (void) +{ +#if ACFPTR_CAN_THROW + if (NULL == _reference) + throw ACFRESULT(ACF_E_POINTER); +#else + ACFASSERT(_reference); // reference pointer has not been initialized! +#endif + T * reference = _reference; + _reference = 0; + return reference; +} + + +template +inline void ACFPtr::acquire(void) +{ + if (_reference) + _reference->AddRef(); +} + + +template +inline void ACFPtr::clear (void) +{ + if (_reference) + { + _reference->Release(); + _reference = 0; + } + +} + + +#endif // ! ACFPtr_h diff --git a/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/ACF/CACFClassFactory.cpp b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/ACF/CACFClassFactory.cpp new file mode 100644 index 0000000000..2f78604bcb --- /dev/null +++ b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/ACF/CACFClassFactory.cpp @@ -0,0 +1,136 @@ +/*********************************************************************** + + This file is part of the Avid AAX SDK. + + The AAX SDK is subject to commercial or open-source licensing. + + By using the AAX SDK, you agree to the terms of both the Avid AAX SDK License + Agreement and Avid Privacy Policy. + + AAX SDK License: https://developer.avid.com/aax + Privacy Policy: https://www.avid.com/legal/privacy-policy-statement + + Or: You may also use this code under the terms of the GPL v3 (see + www.gnu.org/licenses). + + THE AAX SDK IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER + EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE + DISCLAIMED. + + Copyright (c) 2004, 2021, 2024 Avid Technology, Inc. All rights reserved. + +************************************************************************/ + + +/*! + \file CACFClassFactory.cpp + \brief Implementation for the CACFClassFactory class. +*/ + +#include "CACFClassFactory.h" +#include "acfextras.h" +#include "acfassert.h" + + +ACFRESULT CACFClassFactory::Create(ACFCreateObjectProc pfnCreate, const acfIID& iid, void** ppOut) +{ + ACFRESULT result = ACF_OK; + + if (!pfnCreate || !ppOut) + return ACF_E_INVALIDARG; + *ppOut = 0; + + CACFClassFactory * classFactory = new (std::nothrow) CACFClassFactory(pfnCreate); + if (!classFactory) + return ACF_E_OUTOFMEMORY; + + // Take ownership of the classFactory (all objects are internally created with a starting + // reference count of 0. + classFactory->AddRef(); + + // See if the factory supports the requested interface. If this succeeds + // then the reference count will be two. If it fails the reference + // count will be one and the factory object will be deleted when the classFactory + // Release method is called below. + result = classFactory->QueryInterface(iid, ppOut); + + // Release ownership of classFactory. + classFactory->Release(); + + return result; +} + +// Implementation +CACFClassFactory::CACFClassFactory(ACFCreateObjectProc pfnCreate) + : CACFUnknown(0), + m_pfnCreate(pfnCreate) +{ + ACFASSERT (m_pfnCreate); +} + +CACFClassFactory::~CACFClassFactory() +{ + m_pfnCreate = 0; +} + +ACFRESULT CACFClassFactory::InternalQueryInterface +( + const acfIID & riid, + void **ppvObj) +{ + if (!ppvObj) + return ACF_E_INVALIDARG; + + if (riid == IID_IACFClassFactory) + { + *ppvObj = (IACFClassFactory *)this; + ( static_cast(*ppvObj) )->AddRef(); + return ACF_OK; + } + + // Always delegate back to base implementation. + return CACFUnknown::InternalQueryInterface(riid, ppvObj); +} + + +// Object creation is delegated to the callback function passed into +// the constructor. +ACFMETHODIMP CACFClassFactory::CreateInstance +( + IACFUnknown * pUnkHost, + IACFUnknown * pUnkOuter, + const acfIID & riid, + void * * ppvObj) +{ + ACFRESULT result = ACF_OK; + + if (!m_pfnCreate) // this instance was not initialized properly. + return ACF_E_UNEXPECTED; + if (!pUnkHost || !ppvObj) + return ACF_E_INVALIDARG; + + *ppvObj = 0; + + // \note "Note that the non delegating versions of QueryInteface, + // AddRef, and Re lase are used. If a stand-alone identity is + // being created, this is certainly appropriate. If an aggregate + // is being created, this is necessary to ensure that the inner + // object is Addrefed, not the outer object. Also note that + // the outer object must request IUnknown as the initial + // interface. This is mandated by the COM Specification. + // If the outer object could request any initial interface, then + // the inner object would essentially need to keep two duplicate + // sets of vptrs, one set that delegated its QueryInterface, + // AddRef, and Release implementations and another set that did + // not. By restricting the initial interface to IUnknown, the + // object implementor needs to isolate only the one vptr to act + // as the non delegating IUnknown." (p. 194, "Essential COM", by + // Don Box, Addison Wesley, 2nd Printing Feb. 1998) + + if (pUnkOuter && (IID_IACFUnknown != riid)) + return ACF_CLASS_E_NOAGGREGATION; + + // Ask the callback function to create the object instance. + result = (*m_pfnCreate)(pUnkHost, pUnkOuter, riid, ppvObj); + return result; +} diff --git a/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/ACF/CACFClassFactory.h b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/ACF/CACFClassFactory.h new file mode 100644 index 0000000000..712d9cf318 --- /dev/null +++ b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/ACF/CACFClassFactory.h @@ -0,0 +1,73 @@ +/*********************************************************************** + + This file is part of the Avid AAX SDK. + + The AAX SDK is subject to commercial or open-source licensing. + + By using the AAX SDK, you agree to the terms of both the Avid AAX SDK License + Agreement and Avid Privacy Policy. + + AAX SDK License: https://developer.avid.com/aax + Privacy Policy: https://www.avid.com/legal/privacy-policy-statement + + Or: You may also use this code under the terms of the GPL v3 (see + www.gnu.org/licenses). + + THE AAX SDK IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER + EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE + DISCLAIMED. + + Copyright (c) 2004, 2018, 2021, 2024 Avid Technology, Inc. All rights reserved. + +************************************************************************/ + + + + +#ifndef CACFClassFactory_h +#define CACFClassFactory_h + +#ifndef CACFUnknown_h +#include "CACFUnknown.h" +#endif + +/*! + \file CACFClassFactory.h + \brief Define the object creation callback function that should be + implemented as a static method for every concrete ACF object. +*/ + +typedef ACFRESULT (*ACFCreateObjectProc)(IACFUnknown *, IACFUnknown *, const acfIID& iid, void** ppOut); + +class CACFClassFactory : + public IACFClassFactory, + public CACFUnknown +{ +public: + // Default factory method for creating class factories. + static ACFRESULT Create (ACFCreateObjectProc pfnCreate, const acfIID& iid, void** ppOut); + + // IACFUnknown methods + ACF_DECLARE_STANDARD_UNKNOWN() + +protected: + CACFClassFactory(ACFCreateObjectProc createProc); + + virtual ~CACFClassFactory(); + + // ACFUnknown override + ACFMETHOD(InternalQueryInterface)(const acfIID & riid, void **ppv) ACF_OVERRIDE; + +public: + // IACFClassFactory methods + ACFMETHOD(CreateInstance)(IACFUnknown * pUnkHost, IACFUnknown * pUnkOuter, const acfIID & riid, void ** ppv) ACF_OVERRIDE; + +private: + CACFClassFactory(); // Default constructor is prohibited. + CACFClassFactory(const CACFClassFactory&); // non-copyable + + ACFCreateObjectProc m_pfnCreate; +}; + + +#endif // CACFClassFactory_h diff --git a/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/ACF/CACFUnknown.h b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/ACF/CACFUnknown.h new file mode 100644 index 0000000000..cdfd8c4fc4 --- /dev/null +++ b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/ACF/CACFUnknown.h @@ -0,0 +1,515 @@ +/*********************************************************************** + + This file is part of the Avid AAX SDK. + + The AAX SDK is subject to commercial or open-source licensing. + + By using the AAX SDK, you agree to the terms of both the Avid AAX SDK License + Agreement and Avid Privacy Policy. + + AAX SDK License: https://developer.avid.com/aax + Privacy Policy: https://www.avid.com/legal/privacy-policy-statement + + Or: You may also use this code under the terms of the GPL v3 (see + www.gnu.org/licenses). + + THE AAX SDK IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER + EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE + DISCLAIMED. + + Copyright (c) 2004, 2018, 2024 Avid Technology, Inc. All rights reserved. + +************************************************************************/ + + + +#ifndef CACFUnknown_h +#define CACFUnknown_h + +/*! + \file CACFUnknown.h + \brief Class declaration for ACF objects that need to inherit an implementation of + IACFUnknown super-class that will support aggregation. + + Modified 1998-06-30 by TRR for use by AAF. + Modified 2001-04-14 by TRR for use by AVX2. + Renamed 2004-02-27 by TRR for use by ACF. +*/ + +#include "acfbaseapi.h" +#include "acfresult.h" +#include + + +/*! + \brief 32-bit Atomic increment + */ +ACFEXTERN_C acfUInt32 ACFInterlockedIncrement (acfUInt32 & value); + +/*! + \brief 32-bit Atomic decrement + */ +ACFEXTERN_C acfUInt32 ACFInterlockedDecrement (acfUInt32 & value); + + +//=--------------------------------------------------------------------------= +// ACF_DECLARE_STANDARD_UNKNOWN +//=--------------------------------------------------------------------------= +// Macro to insert standard implementation if delegating IACFUnknown interface. +// +// All objects that are going to inherit from CACFUnknown for their IACFUnknown +// implementation should put this in their class declaration instead of the +// three IACFUnknown methods. This macro is usually embedded within the ACF_DECLARE_CONCRETE +// macro. (See the example for ACF_DECLARE_FACTORY) +// +#define ACF_DECLARE_STANDARD_UNKNOWN() \ + ACFMETHOD(QueryInterface)(const acfIID & riid, void **ppvObjOut) ACF_OVERRIDE \ + { \ + return ExternalQueryInterface(riid, ppvObjOut); \ + } \ + ACFMETHOD_(acfUInt32, AddRef)(void) ACF_OVERRIDE \ + { \ + return ExternalAddRef(); \ + } \ + ACFMETHOD_(acfUInt32, Release)(void) ACF_OVERRIDE \ + { \ + return ExternalRelease(); \ + } + + +//=--------------------------------------------------------------------------= +// ACF_DECLARE_SINGLETON_UNKNOWN +//=--------------------------------------------------------------------------= +// Macro to insert a singleton, non-aggregating implementation IACFUnknown +// interface. +// +// All objects that are going to inherit from CACFUnknown for their IACFUnknown +// implementation should put this in their class declaration instead of the +// three IACFUnknown methods. This macro is usually embedded within the ACF_DECLARE_SINGLETON +// macro. (See the example for ACF_DECLARE_FACTORY) +// +//#error change this to use regular reference counting +#define ACF_DECLARE_SINGLETON_UNKNOWN() ACF_DECLARE_STANDARD_UNKNOWN() +/*\ + ACFMETHOD(QueryInterface)(const acfIID & riid, void **ppvObjOut) \ + { \ + return InternalQueryInterface(riid, ppvObjOut); \ + } \ + ACFMETHOD_(acfUInt32, InternalAddRef)(void) \ + { \ + return 1; \ + } \ + ACFMETHOD_(acfUInt32, InternalRelease)(void) \ + { \ + return 1; \ + } \ + ACFMETHOD_(acfUInt32, AddRef)(void) \ + { \ + return 1; \ + } \ + ACFMETHOD_(acfUInt32, Release)(void) \ + { \ + return 1; \ + }*/ + + +//=--------------------------------------------------------------------------= +// ACF_DECLARE_COM_QUERYINTERFACE +//=--------------------------------------------------------------------------= +// Macro to insert when COM interface needs to be implemented by an ACF object +// deriving from CACFUnknown class. +// +// This macro is used as a bridging technology between ACF and COM while +// porting COM interfaces to ACF. +// Once completely ported, this macro can be simply removed from the class. +// +#define ACF_DECLARE_COM_QUERYINTERFACE() \ + ACFMETHOD(QueryInterface)(REFIID riid, void **ppvObjOut) \ + { \ + return InternalQueryInterface( reinterpret_cast(riid), ppvObjOut); \ + } \ + + +//=--------------------------------------------------------------------------= +// ACF_DECLARE_FACTORY +//=--------------------------------------------------------------------------= +// Macro to declare the interface for object class factory. +// +// All COM objects will need to use this macro within their class declaration +// so that DllGetClassObject can correctly instantiate an appropriate +// ACFClassFactory that will use the defined factory method to implement +// the IClassFactory interface. This macro is usually embedded within the +// ACF_DECLARE_CONCRETE macro. +// +// The Following example will declare the factory method of Foo +// module CFoo.h +// class CFoo : +// public IFoo, +// public CACFUnknown +// { +// public: +// CFoo(IACFUnknown *pUnkOuter); +// virtual ~CFoo(); +// +// // Declare the factory for this class. +// ACF_DECLARE_FACTORY(); +// +// // Declare the standard delegating unknown methods +// ACF_DECLARE_STANDARD_UNKNOWN(); +// +// // IFoo methods +// //... +// }; +// +// +// // will generate the following method declarations +// class CFoo : +// public IFoo, +// public CACFUnknown +// { +// public: +// CFoo(IACFUnknown *pUnkOuter); +// virtual ~CFoo(); +// +// // Declare the factory for this class. +// static ACFRESULT ACFCreate(IACFUnknown *pUnkOuter, void **ppvObjOut); +// +// // Declare the standard delegating unknown methods +// ACFMETHOD(QueryInterface)(const acfIID & riid, void **ppvObjOut) +// { +// return ExternalQueryInterface(riid, ppvObjOut); +// } +// ACFMETHOD_(acfUInt32, AddRef)(void) +// { +// return ExternalAddRef(); +// } +// ACFMETHOD_(acfUInt32, Release)(void) +// { +// return ExternalRelease(); +// } +// +// // IFoo methods +// //... +// }; +// +#define XACF_DECLARE_FACTORY(xclass) \ + static ACFRESULT ACFCreate(IACFUnknown *pUnkHost, IACFUnknown *pUnkOuter, xclass **ppvObjOut) + +#define ACF_DECLARE_FACTORY() \ + static ACFRESULT ACFCreate(IACFUnknown *pUnkHost, IACFUnknown *pUnkOuter, const acfIID & iid, void **ppvObjOut) + + +//=--------------------------------------------------------------------------= +// ACF_DEFINE_FACTORY +//=--------------------------------------------------------------------------= +// Macro to define the implementation for object class factory. +// +// Base name of the ACF class implemenation. This should be the expected +// COM implementation calss name. +// +// All ACF objects can need to use this macro within their class definition +// so that ACFGetClassFactory can correctly instantiate an appropriate +// ACFClassFactory that will use the defined factory method to implement +// the IACFClassFactory interface. This macro is usually embedded within the +// ACF_DECLARE_CONCRETE macro. +// +// The Following example will define the factory method of Foo | +// module Foo.cpp +// ACF_DEFINE_FACTORY(CFoo) +// +// will generate the following method definition +// ACFRESULT CFoo::ACFCreate(IACFUnknown *pUnkHost, IACFUnknown *pUnkOuter, void **ppvObjOut) +// { +// ACFRESULT result = ACF_OK; +// *ppvObjOut = NULL; +// CFoo *pNewObject new CFoo(pUnkOuter); +// if (NULL == pNewObject) +// return ACF_E_OUTOFMEMORY; +// result = pNewObject->InitializeInstance(pUnkHost); +// if (ACFFAILED(result)) +// { +// delete pNewObject; +// return result; +// } +// *ppvObjOut = pNewObject; +// ((IACFUnknown *)(*ppvObjOut))->AddRef(); +// return S_OK; +// } +// +#define XACF_DEFINE_FACTORY(xclass) \ + ACFRESULT xclass::ACFCreate(IACFUnknown * pUnkHost, IACFUnknown *pUnkOuter, xclass **ppvObjOut) \ + { \ + ACFRESULT result = ACF_OK; \ + *ppvObjOut = 0; \ + xclass *pNewObject = new (std::nothrow) xclass(pUnkOuter); \ + if (!pNewObject) \ + return ACF_E_OUTOFMEMORY; \ + result = pNewObject->InitializeInstance(pUnkHost); \ + if (ACFFAILED(result)) \ + { \ + delete pNewObject; \ + return result; \ + } \ + *ppvObjOut = pNewObject; \ + pNewObject->InternalAddRef(); \ + return result; \ + } + +#define ACF_DEFINE_FACTORY(xclass) \ +ACFRESULT xclass::ACFCreate(IACFUnknown * pUnkHost, IACFUnknown *pUnkOuter, const acfIID & iid, void **ppvObjOut) \ +{ \ + ACFRESULT result = ACF_OK; \ + *ppvObjOut = 0; \ + xclass *pNewObject = new (std::nothrow) xclass(pUnkOuter); \ + if (!pNewObject) \ + return ACF_E_OUTOFMEMORY; \ + pNewObject->InternalAddRef(); \ + result = pNewObject->InitializeInstance(pUnkHost); \ + if (ACFFAILED(result)) \ + { \ + delete pNewObject; \ + return result; \ + } \ + result = pNewObject->InternalQueryInterface(iid, ppvObjOut); \ + pNewObject->InternalRelease(); \ + return result; \ +} + + +//=--------------------------------------------------------------------------= +// ACF_DECLARE_CONCRETE +//=--------------------------------------------------------------------------= +// Macro to declare the interface for object class factory. +// +// All COM objects will need to use this macro within their class declaration +// so that DllGetClassObject can correctly instantiate an appropriate +// ACFClassFactory that will use the defined factory method to implement +// the IClassFactory interface. Note: this is just a short cut for calling +// ACF_DECLARE_STANDARD_UNKNOWN(); followed by ACF_DECLARE_FACTORY(); +// +#define ACF_DECLARE_CONCRETE() \ + ACF_DECLARE_STANDARD_UNKNOWN() \ + ACF_DECLARE_FACTORY() + +// JEB added this +#define XACF_DECLARE_CONCRETE(xclass) \ + ACF_DECLARE_STANDARD_UNKNOWN() \ + XACF_DECLARE_FACTORY(xclass) + +//=--------------------------------------------------------------------------= +// ACF_DEFINE_CONCRETE +//=--------------------------------------------------------------------------= +// Macro to define the implementation for object class factory. +// +// All COM objects will need to use this macro within their class definition +// so that DllGetClassObject can correctly instantiate an appropriate +// ACFClassFactory that will use the defined factory method to implement +// the IACFClassFactory interface.Note: this is just a alias for calling +// ACF_DEFINE_FACTORY(xclass); . +// +#define ACF_DEFINE_CONCRETE(xclass) \ + ACF_DEFINE_FACTORY(xclass) + +#define ACF_DEFINE_XCONCRETE(xclass) \ + ACF_DEFINE_XFACTORY(xclass) + +// JEB added this +#define XACF_DEFINE_CONCRETE(xclass) \ + XACF_DEFINE_FACTORY(xclass) + + +//=--------------------------------------------------------------------------= +// ACF_DECLARE_SINGLETON +//=--------------------------------------------------------------------------= +// Macro to declare the interface for object class factory. +// +// All COM objects will need to use this macro within their class declaration +// so that DllGetClassObject can correctly instantiate an appropriate +// ACFClassFactory that will use the defined factory method to implement +// the IClassFactory interface. Note: this is just a short cut for calling +// ACF_DECLARE_STANDARD_UNKNOWN(); followed by ACF_DECLARE_FACTORY(); +// +#define ACF_DECLARE_SINGLETON() \ + ACF_DECLARE_SINGLETON_UNKNOWN() \ + ACF_DECLARE_FACTORY() + +//=--------------------------------------------------------------------------= +// ACF_DEFINE_SINGLETON +//=--------------------------------------------------------------------------= +// Macro to define the implementation for object class factory. +// +// All COM objects will need to use this macro within their class definition +// so that DllGetClassObject can correctly instantiate an appropriate +// ACFClassFactory that will use the defined factory method to implement +// the IACFClassFactory interface.Note: this is just a alias for calling +// ACF_DEFINE_FACTORY(xclass); . +// +#define ACF_DEFINE_SINGLETON(xclass) \ + ACF_DEFINE_FACTORY(xclass) + + +//=--------------------------------------------------------------------------= +// Virtual base class that provides a default implementation if IACFUnknown +// which also allows subclasses to be aggregated. +// +// This class doesn't inherit from IACFUnknown since people inheriting from it +// are going to do so, and just delegate their IACFUnknown calls to the External* +// member functions on this object. The internal private unknown object does +// need to inherit from IACFUnknown, since it will be used directly as an IACFUnknown +// object. +// +class CACFUnknown; + +class CACFUnknown +{ +public: + // Default Constructor + CACFUnknown(); + + // Constructor, create with controlling unknown. + CACFUnknown(IACFUnknown *pUnkOuter); + + // Destructor + virtual ~CACFUnknown(); + + // Manage total number of outstanding "live" objects. Used by ACFCanUnloadNow. + static acfUInt32 GetActiveObjectCount(void); + +protected: + // Override this method initialize contained or aggregated interfaces. + ACFMETHOD(InitializeInstance)(IACFUnknown *) + { + return ACF_OK; + } + + // Override this method release any contained or aggregated interfaces. + ACFMETHOD_(void, FinalRelease)(void) {} + + // Override this method to implement reusable pools of components. + // The default implementation will just call delete this. + ACFMETHOD_(void, ReclaimMemory)(void); + + // Return the current "controlling" unknown pointer (not reference counted. + IACFUnknown * GetControllingUnknown(void) const + { + return m_pUnkOuter; + } + + // Delagates IACFUnknown.QueryInterface to controlling unknown. + ACFRESULT ExternalQueryInterface(const acfIID & riid, void **ppvObjOut) + { + return m_pUnkOuter->QueryInterface(riid, ppvObjOut); + } + + // Delagates IACFUnknown.AddRef to controlling unknown. + acfUInt32 ExternalAddRef(void) + { + return m_pUnkOuter->AddRef(); + } + + // Delagates IACFUnknown.Release to controlling unknown. + acfUInt32 ExternalRelease(void) + { + return m_pUnkOuter->Release(); + } + + + // People should use this during creation to return their private + // unknown + // + inline IACFUnknown *GetPrivateUnknown (void) + { + return &m_UnkPrivate; + } + + + // Called by CACFUnknown::QueryInterface. + // This method is overridden by all derived classes to check for + // specific interface implementations. + ACFMETHOD(InternalQueryInterface)(const acfIID & riid, void **ppvObjOut); + + // Allows access to the non-aggregating IACFUnknown implementation + // for this class. + ACFMETHOD_(acfUInt32, InternalAddRef)(void); + + // Allows access to the non-aggregating IACFUnknown implementation + // for this class. + ACFMETHOD_(acfUInt32, InternalRelease)(void); + + // Manage total number of outstanding "live" objects. Used by ACFCanUnloadNow. + static acfUInt32 IncrementActiveObjects(void); + static acfUInt32 DecrementActiveObjects(void); + +private: + // Copy constructor + CACFUnknown(const CACFUnknown& ); + + // Assignment + CACFUnknown& operator= (const CACFUnknown&); + + // PrivateUnknown + // The inner, private unknown implementation is for the aggregator + // to control the lifetime of this object, and for those cases where + // this object isn't aggregated. + // + class PrivateUnknown : public IACFUnknown + { + public: + virtual ~PrivateUnknown() {} + + inline void SetParentUnknown(CACFUnknown *parent) + { + m_This = parent; + } + + // Implements non-delegating IACFUnknown.QueryInterface. + ACFMETHOD(QueryInterface)(const acfIID & riid, void **ppvObjOut) + { + return This()->InternalQueryInterface(riid, ppvObjOut); + } + + // Implements non-delegating IACFUnknown.AddRef. + ACFMETHOD_(acfUInt32, AddRef)(void) + { + return This()->InternalAddRef(); + } + + // Implements non-delegating IACFUnknown.Release. + ACFMETHOD_(acfUInt32, Release)(void) + { + return This()->InternalRelease(); + } + + + private: + // Return pointer to outer object's this pointer. + CACFUnknown *This() { return m_This; } + CACFUnknown *m_This; + }; + + // so they can reference themselves in CACFUnknown from pMainUnknown() + // + friend class PrivateUnknown; + + // so the class factory's CreateInstance method can call the private + // non delegating methods. + // + friend class ACFClassFactory; + + + // number of live objects. + static acfUInt32 m_ActiveObjects; + + // Member data: + + // Current reference count for this object. + acfUInt32 m_cRef; + + // Outer controlling Unknown + IACFUnknown *m_pUnkOuter; + + // Nested class instance that implements the non-delegating IACFUnknown interface. + PrivateUnknown m_UnkPrivate; +}; + +#endif // CACFUnknown_h diff --git a/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/ACF/ConstACFPtr.h b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/ACF/ConstACFPtr.h new file mode 100644 index 0000000000..f148fabe2c --- /dev/null +++ b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/ACF/ConstACFPtr.h @@ -0,0 +1,417 @@ +/*********************************************************************** + + This file is part of the Avid AAX SDK. + + The AAX SDK is subject to commercial or open-source licensing. + + By using the AAX SDK, you agree to the terms of both the Avid AAX SDK License + Agreement and Avid Privacy Policy. + + AAX SDK License: https://developer.avid.com/aax + Privacy Policy: https://www.avid.com/legal/privacy-policy-statement + + Or: You may also use this code under the terms of the GPL v3 (see + www.gnu.org/licenses). + + THE AAX SDK IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER + EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE + DISCLAIMED. + + Copyright (c) 2004, 2024 Avid Technology, Inc. All rights reserved. + +************************************************************************/ + + + + +/*! + \file ConstACFPtr.h + \brief Smart pointer template. Used for automation of referance counting +*/ + +#ifndef ConstACFPtr_h +#define ConstACFPtr_h + +#include "acfbasetypes.h" +#include "acfresult.h" +#include "acfassert.h" + +#include "acfunknown.h" // for IACFUnknown and ACFMETHODCALLTYPE + +/*! \def ACFPTR_CAN_THROW + Macro to conditionally include or exclude the use of C++ exceptions. + + If client code does not need exceptions then define ACFPTR_CAN_THROW 0 + for the each executable project that uses this header. + */ +#ifndef ACFPTR_CAN_THROW +#define ACFPTR_CAN_THROW 1 // default is to allow throwing of C++ exceptions. +#endif + +/*! + Class used to prevent add ref on stuff by ConstACFPtr::operator ->(). + Added by Stephen Wilson of Digidesign. + */ +template +class ConstACFNoAddRefReleaseOnPtr : public T +{ +private: + virtual acfUInt32 ACFMETHODCALLTYPE AddRef()=0; + virtual acfUInt32 ACFMETHODCALLTYPE Release()=0; +}; + + +/*! + Template arguments: + + T: the kind of object to which this pointer will + point. This class must support QueryInterface(), AddRef() and Release() methods. +*/ +template +class ConstACFPtr +{ +public: + /// Default constructor + ConstACFPtr (); + + /// Copy constructor + ConstACFPtr (const ConstACFPtr & rhs); + + /// Construct from a reference, the reference will be AddRef'd. + ConstACFPtr (const T * reference); + + /// Constructor shorthand for reference0->QueryInterface(iid, (void**)&_reference). + /// NOTE: The return value from QueryInterface is ignored. if the internal reference + /// is 0 then eiher the error "was" ACF_E_NOINTERFACE or ACF_E_INVALIDARG if + /// reference0 was 0 (or ACF_E_POINTER). + ConstACFPtr (const acfIID & iid, IACFUnknown * reference0); + + /// Constructor shorthand for reference0->QueryInterface(iid, (void**)&_reference). + /// NOTE: The return value from QueryInterface is ignored. if the internal reference + /// is 0 then eiher the error "was" ACF_E_NOINTERFACE or ACF_E_INVALIDARG if + /// reference0 was 0 (or ACF_E_POINTER). + ConstACFPtr (const acfIID & iid, const IACFUnknown * reference0); + + /// Destructor + ~ConstACFPtr (); + + /// assignment operator + ConstACFPtr & operator= (const ConstACFPtr & rhs); + + /// assignment operator for a new reference + ConstACFPtr & operator= (const T * rhs); + + /// Method that is used pass the internal reference as an input argument to a + /// function or method. This is just a more explicit version of the coercion + /// operator T * () const; + /// \note The reference count for the returned interface pointer has not been increased with AddRef(); + const T* inArg() const ; + + /// Method that is used pass the internal reference as an output argument to a + /// function or method. + /// \note If there is an internal reference to an interface then it will be released. + const T* * outArg(); + + /// Method that is used pass the internal reference as an in/out argument to a + /// function or method. + /// \note If there is an internal reference to an interface then it is not released. + /// The function or method that is accepting the in/out argument it responsible for + /// either releasing, reusing or replacing the given interface pointed to by T*. If + /// the given interface is reused it does not have to be AddRef'd. + const T* * inOutArg(); + + /// Allows passing this smart ptr as argument to methods which expect + /// a T** or a void**, in order to fill it in. (e.g. QueryInterface). NOTE: if the internal + /// reference is non-NULL it will be Released. + /// to this object. + /// \deprecated Please use the outArg() method (or inOutArg()) instead. + const T* * operator& (); + + /// Allows passing this smart ptr as argument to methods which expect + /// a T *. + operator const T * () const; + + /// member access operators. NOTE: this method will throw ACFRESULT(ACF_E_POINTER) + /// if _reference is 0. + ConstACFNoAddRefReleaseOnPtr *const operator-> () const; + + /// const member access operator. NOTE: this method will throw ACFRESULT(ACF_E_POINTER) + /// if _reference is 0. (note: AddRef() and Release() are non-const so they cannot + /// be called from this const operator.) + const T *const operator-> () ; + + /// Allows caller to determine whether or not the internal reference pointer has been + /// assigned. + bool isNull() const; + + /// Allows calling operator ! just like a regular pointer. Returns true if the + /// internal reference pointer isNull. + bool operator! () const; + + /// Direct assignment of reference without calling AddRef(). This could + /// be called if an interface has already been AddRef'd. + void attach(const T * reference); + + /// Return the internal reference without calling Release(). + const T * detach(void); + +private: + /// Internal method to acquire another reference to the interface stored in _reference + /// (call AddRef()) + void acquire(void); + + /// Release the current reference. + void clear(void); + +private: + /// Current referenced interface + const T * _reference; +}; + + + + +// +// Examples and recommended practices +// + +#if 0 +#endif + + + + + + +// +// Implementations +// + +template +inline ConstACFPtr::ConstACFPtr () + : _reference (0) +{ +} + + +template +inline ConstACFPtr::ConstACFPtr(const ConstACFPtr & rhs) + : _reference (rhs._reference) +{ + acquire(); +} + + +template +inline ConstACFPtr::ConstACFPtr(const T * reference) + : _reference (reference) +{ + acquire(); +} + +template +inline ConstACFPtr::ConstACFPtr (const acfIID & iid, IACFUnknown * reference0) + : _reference (0) +{ + if (!reference0) { +#if ACFPTR_CAN_THROW + throw ACFRESULT( ACF_E_INVALIDARG ); +#else + ACFASSERT(reference0); +#endif + } else { + T* ref = NULL;; + ACFRESULT result = reference0->QueryInterface (iid, reinterpret_cast (&ref)); + _reference = ref; + if (ACFFAILED(result)) +#if ACFPTR_CAN_THROW + throw ACFRESULT(result); +#else + ACFASSERT(ACFSUCCEEDED(result)); +#endif + } +} + +template +inline ConstACFPtr::ConstACFPtr (const acfIID & iid, const IACFUnknown * reference0) + : _reference (0) +{ + if (!reference0) { +#if ACFPTR_CAN_THROW + throw ACFRESULT( ACF_E_INVALIDARG ); +#else + ACFASSERT(reference0); +#endif + } else { + IACFUnknown* ref0 = const_cast(reference0); + T* ref = NULL;; + ACFRESULT result = ref0->QueryInterface (iid, reinterpret_cast (&ref)); + _reference = ref; + if (ACFFAILED(result)) +#if ACFPTR_CAN_THROW + throw ACFRESULT(result); +#else + ACFASSERT(ACFSUCCEEDED(result)); +#endif + } +} + +template +inline ConstACFPtr::~ConstACFPtr () +{ + clear(); +} + + +template +inline ConstACFPtr & ConstACFPtr::operator= (const ConstACFPtr & rhs) +{ + if (&rhs != this) + { + clear(); + _reference = rhs._reference; + acquire(); + } + return *this; +} + + +template +inline ConstACFPtr & ConstACFPtr::operator= (const T * rhs) +{ + if (rhs != _reference) + { + if (rhs) + { + T* ref = const_cast(rhs); + ref->AddRef(); + } + clear(); + _reference = rhs; + } + return *this; +} + +template +inline const T* ConstACFPtr::inArg() const +{ + return _reference; +} + +template +inline const T** ConstACFPtr::outArg() +{ + clear(); + return &_reference; +} + +template +inline const T** ConstACFPtr::inOutArg() +{ + return &_reference; +} + + +template +inline const T** ConstACFPtr::operator & () +{ + clear(); + return &_reference; +} + + +template +inline ConstACFPtr::operator const T * () const +{ + return _reference; +} + + +template +inline ConstACFNoAddRefReleaseOnPtr*const ConstACFPtr::operator-> () const +{ +#if ACFPTR_CAN_THROW + if (NULL == _reference) + throw ACFRESULT(ACF_E_POINTER); +#else + ACFASSERT(_reference); // reference pointer has not been initialized! +#endif + return (ConstACFNoAddRefReleaseOnPtr*)_reference; +} + + +template +inline const T*const ConstACFPtr::operator-> () +{ +#if ACFPTR_CAN_THROW + if (NULL == _reference) + throw ACFRESULT(ACF_E_POINTER); +#else + ACFASSERT(_reference); // reference pointer has not been initialized! +#endif + return _reference; +} + + +template +inline bool ConstACFPtr::isNull () const +{ + return (NULL == _reference); +} + + +template +inline bool ConstACFPtr::operator! () const +{ + return isNull(); +} + + +template +inline void ConstACFPtr::attach (const T * reference) +{ + clear(); + _reference = reference; +} + + +template +inline const T * ConstACFPtr::detach (void) +{ +#if ACFPTR_CAN_THROW + if (NULL == _reference) + throw ACFRESULT(ACF_E_POINTER); +#else + ACFASSERT(_reference); // reference pointer has not been initialized! +#endif + const T * reference = _reference; + _reference = 0; + return reference; +} + + +template +inline void ConstACFPtr::acquire(void) +{ + if ( _reference ) + { + T* ref = const_cast(_reference); + ref->AddRef(); + } +} + + +template +inline void ConstACFPtr::clear (void) +{ + if ( _reference ) + { + T* ref = const_cast(_reference); + ref->Release(); + _reference = 0; + } + +} + + +#endif // ! ConstACFPtr_h diff --git a/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/ACF/acfassert.h b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/ACF/acfassert.h new file mode 100644 index 0000000000..9ef8b3596e --- /dev/null +++ b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/ACF/acfassert.h @@ -0,0 +1,53 @@ +/*********************************************************************** + + This file is part of the Avid AAX SDK. + + The AAX SDK is subject to commercial or open-source licensing. + + By using the AAX SDK, you agree to the terms of both the Avid AAX SDK License + Agreement and Avid Privacy Policy. + + AAX SDK License: https://developer.avid.com/aax + Privacy Policy: https://www.avid.com/legal/privacy-policy-statement + + Or: You may also use this code under the terms of the GPL v3 (see + www.gnu.org/licenses). + + THE AAX SDK IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER + EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE + DISCLAIMED. + + Copyright (c) 2004, 2024 Avid Technology, Inc. All rights reserved. + +************************************************************************/ + + + + +/*! + \file acfassert.h + + \brief Wrapper for AVX2 assertions. + \remarks The default definition uses + ansi assert so it does not require c++ exceptions to be + enabled. + This also adds guards to assert.h so that it can safely + be included in a header file (CW bug). +*/ +#ifndef ACFASSERT + +#ifndef assert + +#if defined(__MACH__) && !defined(__GNUC__) +// This configuration for /usr/include/gcc/darwin/2.5.2/assert.h uses +// prinf and abort WITHOUT including the definitions. transdel-2001-SEPT-21. +#include // printf() +#include // abort() +#endif + +#include "assert.h" +#endif + +#define ACFASSERT assert + +#endif diff --git a/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/ACF/acfbaseapi.h b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/ACF/acfbaseapi.h new file mode 100644 index 0000000000..045f532caa --- /dev/null +++ b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/ACF/acfbaseapi.h @@ -0,0 +1,788 @@ +/*********************************************************************** + + This file is part of the Avid AAX SDK. + + The AAX SDK is subject to commercial or open-source licensing. + + By using the AAX SDK, you agree to the terms of both the Avid AAX SDK License + Agreement and Avid Privacy Policy. + + AAX SDK License: https://developer.avid.com/aax + Privacy Policy: https://www.avid.com/legal/privacy-policy-statement + + Or: You may also use this code under the terms of the GPL v3 (see + www.gnu.org/licenses). + + THE AAX SDK IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER + EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE + DISCLAIMED. + + Copyright 2004-2013 Avid Technology, Inc. + +************************************************************************/ + + + + +#ifndef acfbaseapi_h +#define acfbaseapi_h + +/*! + \file acfbaseapi.h + \brief Defines the common public interfaces that must be implemented + or used by all ACF plugins. + \remarks + The plugin must export their ACFRegisterPlugin, ACFRegisterComponent, + ACFGetClassFactory and ACFCanUnloadNow functions; the typedefs are located + here to ensure all are changed at the same time. + */ + + +#include "acfbasetypes.h" +#include "acfunknown.h" +//#include "acfresult.h" + + +class IACFClassFactory; // implemented by plug-ins + +class IACFDefinition; // implemented by host +class IACFPluginDefinition; // implemented by host +class IACFComponentDefinition; // implemented by host +class IACFEnumDefinitions; // implemented by host +class IACFComponentFactory; // implemented by host + + + + +///////////////////////////////////////////////////////////////////////////////////////////////// +// +// Required Plug-in callbacks: +// ACFRegisterPlugin +// ACFRegisterComponent +// ACFGetClassFactory +// ACFCanUnloadNow +// +// Optional Plug-in callbacks: +// ACFStartup +// ACFShutdown + + +/*! + \b ACFRegisterPlugin + \brief Required callback function to register a plug-in definition with the host. + \remarks + The host will call this function to allow the plug-in to initialize a plug-in definition + with required and optional attributes for this plug-in. This is the first plug-in + function called by the host during the registration process. The returned plug-in + definition is released after the plug-in's components have been registered. + \note: This function must be exported from every ACF plug-in. + The Host uses this callback to define the basic attributes necessary to manage + an ACF plug-in. + \param pUnkHost The unknown interface of the ACF host. Use this interface dynamically + access host services. In this case use the IACFComponentFactory interface to create + a built-in plug-in definition. + \param ppPluginDefinition Pointer to an IACFPluginDefinition interface pointer + */ +ACFPLUGINAPI ACFRegisterPlugin ( + IACFUnknown * pUnkHost, + IACFPluginDefinition **ppPluginDefinition +); + + +/*! + \b ACFRegisterComponent + \brief Required callback function to register a plug-in component definition with the host. + \remarks + The host will call this function to allow the plug-in to initialize a component + definition with required and optional attributes. This plug-in function is called once + for every component indicated by the previous call to ACFRegisterPlugin. The returned + component definition is released after all of the plug-in's components have been + registered. + \note This function must be exported from every ACF plug-in. + The Host uses this callback to define the basic attributes necessary to manage + an ACF plug-in component. + \param pUnkHost The unknown interface of the ACF host. Use this interface dynamically + access host services. In this case use the IACFComponentFactory interface to create + a built-in component definition. + \param index The zero based index of the component to define. + \param ppComponentDefinition Pointer to an IACFComponentDefinition interface pointer + */ +ACFPLUGINAPI ACFRegisterComponent ( + IACFUnknown * pUnkHost, + acfUInt32 index, + IACFComponentDefinition **ppComponentDefinition +); + + +/*! + \b ACFGetClassFactory + \brief Required callback function that returns a component class factory for the corresponding clsid. + \remarks + This function performs exactly the same function as the standard DllGetClassObject except that + ACF uses an IACFClassFactory instead of IClassFactory. + + For further details see the examples or search the web for DllGetClassObject. + \note This function must be exported from every ACF plug-in. + The Host uses this callback to indirectly create component objects through an associated + class factory interface, IACFClassFactory. + \param pUnkHost The unknown interface of the ACF host. Use this interface to dynamically + access host services. + \param clsid The unique identifier of a component implemenation class + \param iid The interface identifier for the class factory interface, usually IID_IACFClassFactory + \param ppOut + */ +ACFPLUGINAPI ACFGetClassFactory ( + IACFUnknown * pUnkHost, + const acfCLSID& clsid, + const acfIID& iid, + void** ppOut +); + +/*! + \b ACFCanUnloadNow + \brief Required callback function that allows the plug-in to determine when it is safe to be unloaded. + \remarks + If it is safe to unload the plug-in module (i.e. no outstanding external references to internal + objects) then return ACF_OK, otherwise ACF_FALSE (or any error code). + \note When the plug-in registration process is complete ACFCanUnloadNow() should return ACF_OK. + \note This function must be exported from every ACF plug-in. + The Host uses this callback to determine if it is safe to unload the plug-in. + \param pUnkHost The unknown interface of the ACF host. Use this interface to dynamically + access host services. + */ +ACFPLUGINAPI ACFCanUnloadNow (IACFUnknown * pUnkHost); + +/*! + \b ACFStartup + \brief Opitional callback to the plug-in to allow plug-in module perform global initialization. + \remarks + This opitional callback if it exists will be called once by the ACF Host before the first + call to ACFGetClassFactory. Use this routine to initialize any global state or services + required by the plug-in and any plug-in components. + \note The plug-in module may have been unloaded after registration or loaded without registration + before ACFStartup is called. ACFStartup is only called after a plug-in any its components + have been registered. + \note This function may be exported from any ACF plug-in. + The Host uses this callback to provide an optional hook for plug-ins to safely + initialize global state. + \param pUnkHost The unknown interface of the ACF host. Use this interface dynamically + access host services. + */ +ACFPLUGINAPI ACFStartup (IACFUnknown * pUnkHost); + +/*! + \b ACFShutdown + \brief Opitional callback to the plug-in to allow plug-in module perform global cleanup. + \remarks + This opitional callback if it exists will be called by the ACF Host before a plug-in module + is unloaded. Use this routine to cleanup any global state or cached component services + used by the plug-in or any of plug-in components. It must be safe for the host to unload the + plug-in module after the calling ACFShutdown (i.e. ACFCanUnloadNow() must return ACF_OK). + \note The ACFShutdown is never called during the registration process; it is only called + by the host after the plug-in module has been loaded to create components. + \note This function may be exported from any ACF plug-in. + The Host uses this callback to provide an optional hook for plug-ins to safely + cleanup global state. + \param pUnkHost The unknown interface of the ACF host. Use this interface dynamically + access host services. + */ +ACFPLUGINAPI ACFShutdown (IACFUnknown * pUnkHost); + + + + +#if ACF_MAC && !defined (_MSC_VER) +typedef ACFAPICALLTYPE ACFRESULT (* ACFREGISTERPLUGINTYPE) (IACFUnknown *, IACFPluginDefinition **); +typedef ACFAPICALLTYPE ACFRESULT (* ACFREGISTERCOMPONENTTYPE) (IACFUnknown *, acfUInt32, IACFComponentDefinition **); +typedef ACFAPICALLTYPE ACFRESULT (* ACFGETCLASSFACTORYTYPE) (IACFUnknown *, const acfCLSID&, const acfIID&, void**); +typedef ACFAPICALLTYPE ACFRESULT (* ACFCANUNLOADNOWTYPE) (IACFUnknown *); +typedef ACFAPICALLTYPE ACFRESULT (* ACFSTARTUPTYPE) (IACFUnknown *); +typedef ACFAPICALLTYPE ACFRESULT (* ACFSHUTDOWNTYPE) (IACFUnknown *); +#else + + +typedef ACFRESULT (ACFAPICALLTYPE * ACFREGISTERPLUGINTYPE) (IACFUnknown *, IACFPluginDefinition **); + +typedef ACFRESULT (ACFAPICALLTYPE * ACFREGISTERCOMPONENTTYPE) (IACFUnknown *, acfUInt32, IACFComponentDefinition **); + +typedef ACFRESULT (ACFAPICALLTYPE * ACFGETCLASSFACTORYTYPE) (IACFUnknown *, const acfCLSID&, const acfIID&, void**); + +typedef ACFRESULT (ACFAPICALLTYPE * ACFCANUNLOADNOWTYPE) (IACFUnknown *); + +typedef ACFRESULT (ACFAPICALLTYPE * ACFSTARTUPTYPE) (IACFUnknown *); + +typedef ACFRESULT (ACFAPICALLTYPE * ACFSHUTDOWNTYPE) (IACFUnknown *); + +#endif + + + + +///////////////////////////////////////////////////////////////////////////////////////////////// +// + +/*! + \b IID_IACFClassFactory + \remarks + The interface identifier for IACFClassFactory. + \note IID_IACFClassFactory != IID_IClassFactory! \n type: UID + \n context: global + \n ACFNamespace name: +*/ +DEFINE_ACFUID(acfIID, IID_IACFClassFactory, 0x80996EEE, 0x7FCF, 0x11D6, 0xAC, 0xA8, 0x00, 0x30, 0x65, 0x42, 0xA0, 0x24); + +/*! + \interface IACFClassFactory + \brief Publicly inherits from IACFUnknown.Publicly inherits from IACFUnknown.Provides the abstract interface for component creation. + \remarks + Every component implemenation class must have a corresponding class factory that implements + the IACFClassFactory interface. + + For general information about class factories see the associated documentation for IClassFactory. + \note Plug-ins implement this interface to encapsulate component creation [Abstract Factory]. + The host will use instances of this interface returned from the plug-in's ACFGetClassFactory + callback function to manage the creation of new components. + */ + +#ifdef __clang__ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wnon-virtual-dtor" +#endif // __clang__ + +class IACFClassFactory : public IACFUnknown +{ +public: + +/*! + \b CreateInstance + \brief Creates an instance of an uninitialized object of the class associated with this + class factory. + \remarks + This method is generally called only by the host through the methods of the IACFComponentFactory + interface: CreateComponent() and CreateInstance(). + \param pUnkHost Pointer to the host implementation object's IACFUnknown interface. + \param pUnkOuter Pointer to object's controlling unknown. If NULL then the object is not + being created as part of an aggregate. If non-NULL then pointer is the aggregate's IACFUnknown + interface (the controlling IACFUnknown). + \param iid Identifier for the initial interface to the new object. + \param ppOut Address of pointer variable that receives the interface pointer corresponding to the + given iid. + */ + virtual ACFRESULT ACFMETHODCALLTYPE CreateInstance ( + IACFUnknown *pUnkHost, + IACFUnknown* pUnkOuter, + const acfIID& iid, + void** ppOut + ) = 0; + +}; + + + +///////////////////////////////////////////////////////////////////////////////////////////////// +// +// The rest of basic ACF interfaces are implementated by the host. These interfaces are used by +// the plug-in to define the plug-in and its components and to create registered components. +// IACFDefinition +// IACFPluginDefinition +// IACFComponentDefinition +// IACFComponentFactory +// + + + +/*! + \b IID_IACFDefinition + \remarks + The interface identifier for IACFDefinition. + \n type: UID + \n context: global + \n ACFNamespace name: +*/ +DEFINE_ACFUID(acfIID, IID_IACFDefinition, 0xE51741F1, 0x7FCF, 0x11D6, 0xAA, 0xC3, 0x00, 0x30, 0x65, 0x42, 0xA0, 0x24); + +/*! + \interface IACFDefinition + \brief Publicly inherits from IACFUnknown.This abstract interface is used to indentify all of the plug-in components in the host. + \remarks + This interface is the base class for both plug-in and component definitions. All defined + attributes are read only. + + \note This interface does not provide any attribute enumeration. You must know the uid of the associated + with the attribute that you need to find. + \note This interface is implemented by the host. + The plug-in will use this interface to define optional attributes for both plug-in and + component implementations classes. + */ + +class IACFDefinition : public IACFUnknown +{ +public: + +/*! + \b DefineAttribute + \brief Add a read only attribute to the definition. + \remarks + Use the method to define additional global attributes for you component. This + method will fail if the attribute has already been defined. + + \param attributeID Unique identifier for attribute + \param typeID Indicates the type of the attribute data + \param attrData Pointer to buffer that contains the attribute data + \param attrDataSize Size of the attribute buffer + */ + virtual ACFRESULT ACFMETHODCALLTYPE DefineAttribute ( + const acfUID& attributeID, + const acfUID& typeID, + const void *attrData, + acfUInt32 attrDataSize + ) = 0; + + +/*! + \brief Returns information about the given attribute. + \remarks + Use this method to retrieve the type and size of a given attribute. + \param attributeID Unique identifier for attribute + \param typeID Indicates the type of the attribute data + \param attrDataSize Size of the attribute data + */ + virtual ACFRESULT ACFMETHODCALLTYPE GetAttributeInfo ( + const acfUID& attributeID, + acfUID * typeID, + acfUInt32 * attrDataSize + ) = 0; + + +/*! + \b CopyAttribute + \brief Copy the a given attribute. + \remarks + Use this method to access the contents of a given attribute. + \param attributeID Unique identifier for attribute + \param typeID Indicates the type of the attribute data + \param attrData Pointer to buffer to copy the attribute data + \param attrDataSize Size of the attribute buffer + */ + virtual ACFRESULT ACFMETHODCALLTYPE CopyAttribute ( + const acfUID& attributeID, + const acfUID& typeID, + void *attrData, + acfUInt32 attrDataSize + ) = 0; + +}; + + + +///////////////////////////////////////////////////////////////////////////////////////////////// +// + +/*! + \b IID_IACFPluginDefinition + \remarks + The interface identifier for IACFPluginDefinition. + \n type: UID + \n context: global + \n ACFNamespace name: +*/ +DEFINE_ACFUID(acfIID, IID_IACFPluginDefinition, 0x00EEF015, 0x7FD0, 0x11D6, 0x84, 0x85, 0x00, 0x30, 0x65, 0x42, 0xA0, 0x24); + +/*! + \interface IACFPluginDefinition + \brief Publicly inherits from IACFDefinition.Provides the abstract interface for defining ACF plug-ins. + \remarks + An object that implements this interface must be returned to the host from + the ACFRegisterPlugin callback. This object is only valid during the + registration of the plug-in. + \note This interface is implemented by the host. + Plug-in The plug-in will use this interface to register itself + with the ACF host. \note The components implemented by a plug-in are + registered separately in the ACFRegisterComponent callback. + */ + +class IACFPluginDefinition : public IACFDefinition +{ +public: + +/*! + \b InitializePlugin + \brief Initializes the minimum required attributes for any ACF plug-in. + \remarks + This method should be called within the context of the ACFRegisterPlugin callback. + Use the DefineAttribute method to add optional attributes. + \param uid Unique identifier for the plug-in + \param majorVersion Major version of the plug-in + \param minorVersion Minor version of the plug-in + \param name The name of the plug-in (may be used for host console debugging) + \param vendorID The unique vendor identifier (obtained from Avid with licensed ACF SDK) + \param vendorName The plug-in's vendor name + \param componentCount The number of component implementation classes exported from + this plug-in. + \param cacheDefinition Indicates whether the plug-in registration information can be cached. + If kACFTrue then the host can launch faster and only load the plug-in modules if and when + any contained components are actually used. + */ + virtual ACFRESULT ACFMETHODCALLTYPE InitializePlugin ( + const acfUID& uid, + acfUInt32 majorVersion, + acfUInt32 minorVersion, + const acfWChar* name, + const acfUID& vendorID, + const acfWChar* vendorName, + acfUInt32 componentCount, + acfBool cacheDefinition + ) = 0; + +}; + + + +///////////////////////////////////////////////////////////////////////////////////////////////// +// + +/*! + \b IID_IACFComponentDefinition + \remarks + The interface identifier for IACFComponentDefinition. + \n type: UID + \n context: global + \n ACFNamespace name: +*/ +DEFINE_ACFUID(acfIID, IID_IACFComponentDefinition, 0x1718A226, 0x7FD0, 0x11D6, 0xBD, 0x1D, 0x00, 0x30, 0x65, 0x42, 0xA0, 0x24); + +/*! + \interface IACFComponentDefinition + \brief Publicly inherits from IACFDefinition.Provides the abstract interface for defining generic components. + \remarks + This interface is used to define the basic attributes required by a generic + component. This interface is provided as the basis for plug-ins to define + their own sharable components. An object that implements this interface + must be returned to the host from the ACFRegisterComponent callback. This + object is only valid during the registration of the plug-in. + + \note The ACF may use component subclass interface for each component type + - image effects + - parameters + - meta sync + - etc... + + \note This interface is implemented by the host. + The plug-in will use this interface to define a generic component. + */ + +class IACFComponentDefinition : public IACFDefinition +{ +public: + +/*! + \b InitializeComponent + \brief Initializes the minimum required attributes for any ACF component. + \remarks + This method should be called within the context of the ACFRegisterComponent callback. + Use the DefineAttribute method to add optional attributes. + \param componentID Unique identifier for the component + \param componentTypeID Indicates the type of the component (utility) being defined \ref ComponentType + \param majorVersion Major version of the component + \param minorVersion Minor version of the component + \param clsid The unique component implementation class identifier + \param name Name of the component (may be used for host console debugging) + */ + virtual ACFRESULT ACFMETHODCALLTYPE InitializeComponent ( + const acfUID& componentID, + const acfUID& componentTypeID, + acfUInt32 majorVersion, + acfUInt32 minorVersion, + const acfCLSID& clsid, + const acfWChar* name + ) = 0; + +}; + + + +///////////////////////////////////////////////////////////////////////////////////////////////// +// + +/*! + \b IID_IACFComponentFactory + \remarks + The interface identifier for IACFEnumDefinitions. + \n type: UID + \n context: global + \n ACFNamespace name: +*/ +DEFINE_ACFUID(acfIID, IID_IACFEnumDefinitions, 0xC34189E3, 0x8398, 0x11D6, 0x84, 0x7E, 0x00, 0x30, 0x65, 0x42, 0xA0, 0x24); + +/*! + \interface IACFEnumDefinitions + \brief Provides the abstract interface for enumerating definitions. + \remarks + \note This "Enumeration" interface is different from "standard" COM for several reasons: + -# Enumerations of related interfaces are expected to support the same type of definitions + interface. + -# There no "partial success" in ACF. If the caller asks for the Next 10 definitions + and there are only 9 Next method will FAIL. If all of the requested definitions do + not support the given iid then the Next method will FAIL. If the caller asks for 0 definitions + then the Next method will FAIL. (RESULT codes:TBD) + -# Unlike the "standard" COM enumeration interface this interface could actually be remoted + without an a special "RemoteAs" method in a proxy dll. (Of course we have no plans to ever + remote ACF interfaces...) + \note This interface is implemented by the host. + A plug-in will use this interface to access of related definitions. + \n \b Example: Enumerating all definitions of a given type + \code +ACFRESULT EnumerateDefinitions(IACFComponentFactory *pComponentFactory) +{ + if (!pComponentFactory) + return ACF_E_POINTER; + + BEGIN_ACF_METHOD + + ACFSmartPtr pEnumDefinitions; + acfcheck( pComponentFactory->EnumDefinitions( ACFCompType_ImageEffect, &pEnumDefinitions) ); + + // + // Access definitions one at a time: + // + ACFSmartPtr pComponentDef; + while (ACFSUCCEEDED(pEnumDefinitions->Next(1, IID_IACFComponentDefinition, (IACFDefinition **)pComponentDef) ) + { + // Process the definition... + } + + acfcheck( pEnumDefinitions->Reset() ); + + // + // Slurp all of the definitions up in one call to Next. + // + avxUInt32 count = pEnumDefinitions->Count(); + if (0 < count) + { + IACFComponentDefinition ** ppComponentDefinitions = new (IACFComponentDefinition*)[count]; + if (!ppComponentDefinitions) + return ACF_E_OUTOFMEMORY; + + if (ACFSUCCEEDED(pEnumDefinitions->Next(count, IID_IACFComponentDefinition, (IACFDefinition **)ppComponentDefinitions) ) + { + // + // Process all of the definitions... + // + + + // Release all of the returned interfaces... + for (acfUInt32 i = 0; i < count; ++i) + { + ppComponentDefinitions[i]->Release(); + ppComponentDefinitions[i] = 0; + } + } + + // cleanup + delete [] ppComponentDefinitions; + } + + END_ACF_METHOD +} +\endcode + */ + +class IACFEnumDefinitions : public IACFUnknown +{ +public: + +/*! + \b Count + \brief Return the number of definitions in the enumeration. + \remarks + */ + virtual acfUInt32 ACFMETHODCALLTYPE Count ( + void + ) = 0; + +/*! + \b Next + \brief Return the next count definitions from the enumeration. + \remarks + Use this method to retreive a given number of definitions all with the + initial interface given by iid. The caller is responsible for releasing + the returned intefaces. + \param count number of definitions to retrieve into x. + \param iid Identifier for the initial interface to the definitions. + \param x Address of array variable that receives the interface pointer(s) corresponding to the + given iid. + */ + virtual ACFRESULT ACFMETHODCALLTYPE Next ( + acfUInt32 count, + const acfIID& iid, + IACFDefinition** x + ) = 0; + +/*! + \b Reset + \brief Reset to the beginning of the enumeration. + \remarks + */ + virtual ACFRESULT ACFMETHODCALLTYPE Reset ( + void + ) = 0; + +/*! + \b Clone + \brief Clone to the current state of the enumeration. + \remarks + \param ppEnum Address of IACFEnumDefinitions interface pointer variable that receives the + cloned enumeration. + */ + virtual ACFRESULT ACFMETHODCALLTYPE Clone ( + IACFEnumDefinitions **ppEnum + ) = 0; + +}; + + + +///////////////////////////////////////////////////////////////////////////////////////////////// +// + +/*! + \b IID_IACFComponentFactory + \remarks + The interface identifier for IACFComponentFactory. + \n type: UID + \n context: global + \n ACFNamespace name: +*/ +DEFINE_ACFUID(acfIID, IID_IACFComponentFactory, 0x382B6A96, 0x7FD0, 0x11D6, 0xBC, 0xFE, 0x00, 0x30, 0x65, 0x42, 0xA0, 0x24); + +/*! + \interface IACFComponentFactory + \brief Publicly inherits from IACFUnknown.Provides the abstract interface for object creation. + \remarks + This is one of the services provided by the host implementation object. The IACFUnknown + interface to the host is passed into every plug-in callback and every component + implementation class through the IACFClassFactory::CreateInstance + method. Use QueryInterface to acquire a reference to the host's component factory + interface. + \note This interface is implemented by the host. + The plug-in will use this interface to ask the host to create components + or specific component implemenation classes that have been defined with the host. + */ + +class IACFComponentFactory : public IACFUnknown +{ +public: + +/*! + \b CreateComponent + \brief Creates an instance of an uninitialized component. + \remarks + The CreateComponent method is the general component creation method used by the host + and all plug-ins. If more than a single class has been registered for the given component + this method will automatically create the latest acceptable version. + + If you don't want the host to choose the class to create for a given component and you + know the specific implementation class id then use the CreateInstance method instead. + \param compid Identifier of the Component + \param pUnkOuter Pointer to object's controlling unknown. If NULL then the object is not + being created as part of an aggregate. If non-NULL then pointer is the aggregate's IACFUnknown + interface (the controlling IACFUnknown). + \param iid Identifier for the initial interface to the new object. + \param x Address of pointer variable that receives the interface pointer corresponding to the + given iid. + */ + virtual ACFRESULT ACFMETHODCALLTYPE CreateComponent ( + const acfUID& compid, + IACFUnknown* pUnkOuter, + const acfIID& iid, + void** x + ) = 0; + + +/*! + \b CreateInstance + \brief Creates an instance of an uninitialized component. + \remarks + The Createinstance method is the general object creation method used by the host + and all plug-ins. Only use this method you really need to create a particular component + implementation class. For example, you might want to create your new version of an existing + component by creating and reusing part of a previous version (\note for the two versions to + coexist in the same host they should be in the same plug-in, if they are in different plug-ins + the the plug-in ids must be different). + \param clsid Class identifier of the component implementation object. + \param pUnkOuter Pointer to object's controlling unknown. If NULL then the object is not + being created as part of an aggregate. If non-NULL then pointer is the aggregate's IACFUnknown + interface (the controlling IACFUnknown). + \param iid Identifier for the initial interface to the new object. + \param x Address of pointer variable that receives the interface pointer corresponding to the + given iid. + */ + virtual ACFRESULT ACFMETHODCALLTYPE CreateInstance ( + const acfCLSID& clsid, + IACFUnknown* pUnkOuter, + const acfIID& iid, + void** x + ) = 0; + + +/*! + \b GetClassFactory + \brief Returns the class factory for a given component class implementation. + \remarks + The GetClassFactory method is the low-level method to return a class factory for + a particular component implementation. Use this method if you know the implementation + class and you need create many instances of the same component. The overhead of the + looking up the factorty (and loading the dll if necessary) is only performed once. Then + call the factory's CreateInstance() method to create each component instance. + + \note The caller is responsible for initializing each component instance created + from the class factory. + \param clsid Class identifier of the component implementation object. + \param iid Identifier for the initial interface to the new class factory object. + \param x Address of pointer variable that receives the class factory interface pointer + corresponding to the given iid. + */ + virtual ACFRESULT ACFMETHODCALLTYPE GetClassFactory ( + const acfCLSID& clsid, + const acfIID& iid, + void** x + ) = 0; + +/*! + \b FindDefinition + \brief Allows the plug-in to lookup a particular definition that has been registered with + the host. + \remarks + Use the method to find a existing definition that has been registered with the host. + \param uid Unique identifier for the definition + \param iid The interface identifier for the type of definition interface we want. + \param ppDefinition + */ + virtual ACFRESULT ACFMETHODCALLTYPE FindDefinition ( + const acfUID& uid, + const acfIID& iid, + IACFDefinition **ppDefinition + ) = 0; + + +/*! + \b EnumDefinitions + \brief Allows enumeration of all of the registered definitions of a particular type. + \remarks + This method provides a mechanism of managing groups of plug-in components. This can be + used to create an "effects manager", "codec manager", "file translator manager", etc... + \param componentTypeID Unique identifier for the definition \ref ComponentType + \param ppEnum + */ + virtual ACFRESULT ACFMETHODCALLTYPE EnumDefinitions ( + const acfUID& componentTypeID, + IACFEnumDefinitions **ppEnum + ) = 0; + +}; + +#ifdef __clang__ +#pragma clang diagnostic pop +#endif // __clang__ + +#endif // acfbaseapi_h diff --git a/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/ACF/acfbasetypes.h b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/ACF/acfbasetypes.h new file mode 100644 index 0000000000..652fd77db0 --- /dev/null +++ b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/ACF/acfbasetypes.h @@ -0,0 +1,889 @@ +/*********************************************************************** + This file is part of the Avid AAX SDK. + + The AAX SDK is subject to commercial or open-source licensing. + + By using the AAX SDK, you agree to the terms of both the Avid AAX SDK License + Agreement and Avid Privacy Policy. + + AAX SDK License: https://developer.avid.com/aax + Privacy Policy: https://www.avid.com/legal/privacy-policy-statement + + Or: You may also use this code under the terms of the GPL v3 (see + www.gnu.org/licenses). + + THE AAX SDK IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER + EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE + DISCLAIMED. + +* +* Copyright 2004, 2008-2010, 2013, 2018, 2024 Avid Technology, Inc. +* +************************************************************************/ + +#ifndef acfbasetypes_h +#define acfbasetypes_h + +/*! + \file acfbasetypes.h + \brief Defines all of the C types shared by all ACF hosts and plug-ins. + + The layout for this file is based upon AAFPlatform.h which is availabled from SourceForge. + */ + +/* wchar_t definition */ +#include + + +/* + * For C++11 or greater will be used override identifier. + */ +#if __cplusplus >= 201103L +#define ACF_OVERRIDE override +#else +#define ACF_OVERRIDE +#endif + +/* + * Construct a numeric GCC version that can easily be used to test for features that + * were added for specific versions. + */ +#if defined(__GNUC__) +#define ACF_COMPILER_GCC_VERSION (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) +#endif + + +/*! + * Compiler: Microsoft Visual C++ + * Processor: Intel x86 + * OS: Windows NT + */ +#if defined(__INTEL_COMPILER) && defined(_MSC_VER) && defined(_M_IX86) && defined(_WIN32) +#define ACF_CPU_INTEL +#define ACF_OS_WINDOWS +#define ACF_COMPILER_INTEL +#define ACF_PLATFORM_INTEL_INTEL_WINDOWS + + +/*! + * Compiler: Microsoft Visual C++ + * Processor: Intel x86, 64bit + * OS: Windows NT + */ +#elif defined(__INTEL_COMPILER) && defined(_MSC_VER) && (defined(_M_AMD64) || defined(_M_IA64)) && defined(_WIN64) +#define ACF_CPU_INTEL +#define ACF_OS_WINDOWS +#define ACF_OS_64 +#define ACF_COMPILER_INTEL +#define ACF_PLATFORM_INTEL_INTEL_WINDOWS +#define ACF_PLATFORM_INTEL_INTEL64_WINDOWS + + +/*! + * Compiler: Microsoft Visual C++ + * Processor: Intel x64 + * OS: Windows NT 64bit + */ +#elif defined(_MSC_VER) && (defined(_M_AMD64) || defined(_M_IA64)) && defined(_WIN64) +#define ACF_CPU_INTEL +#define ACF_OS_64 +#define ACF_OS_WINDOWS +#define ACF_COMPILER_MSC +#define ACF_PLATFORM_MSC_INTEL_WINDOWS +#define ACF_PLATFORM_MSC_INTEL64_WINDOWS + + +/*! + * Compiler: Microsoft Visual C++ + * Processor: Intel x86 + * OS: Windows NT 32bit + */ +#elif defined(_MSC_VER) && defined(_M_IX86) && defined(_WIN32) +#define ACF_CPU_INTEL +#define ACF_OS_WINDOWS +#define ACF_COMPILER_MSC +#define ACF_PLATFORM_MSC_INTEL_WINDOWS + + +/*! + * Compiler: Metrowerks CodeWarrior + * Processor: PowerPC + * OS: MacOS 10 + */ +#elif defined(__MWERKS__) && defined(__MACH__) +#define ACF_CPU_POWERPC +#define ACF_OS_MACOS10 +#define ACF_COMPILER_MWERKS +#define ACF_PLATFORM_MWERKS_POWERPC_MACOS10 + + +/*! + * Compiler: Metrowerks CodeWarrior + * Processor: PowerPC + * OS: Classic MacOS + */ +#elif defined(__MWERKS__) && defined(__POWERPC__) && defined(macintosh) +#define ACF_CPU_POWERPC +#define ACF_OS_MACOS +#define ACF_COMPILER_MWERKS +#define ACF_PLATFORM_MWERKS_POWERPC_MACOS + + +/*! + * Compiler: Metrowerks CodeWarrior + * Processor: Intel x86 + * OS: Windows NT + */ +#elif defined(__MWERKS__) && defined(_M_IX86) && defined(_WIN32) +#define ACF_CPU_INTEL +#define ACF_OS_WINDOWS +#define ACF_COMPILER_MWERKS +#define ACF_PLATFORM_MWERKS_INTEL_WINDOWS + + +/*! + * Compiler: GNU C++ + * Processor: MIPS + * OS: IRIX + */ +#elif defined(__GNUC__) && defined(__mips__) && defined(__sgi__) +#define ACF_CPU_MIPS +#define ACF_OS_IRIX +#define ACF_OS_UNIX +#define ACF_COMPILER_GCC +#define ACF_PLATFORM_GCC_MIPS_IRIX + + +/*! + * Compiler: MIPSpro C++ + * Processor: MIPS + * OS: IRIX + */ +#elif defined(mips) && defined(sgi) +#define ACF_CPU_MIPS +#define ACF_OS_IRIX +#define ACF_OS_UNIX +#define ACF_COMPILER_MIPSPRO +#define ACF_PLATFORM_MIPSPRO_MIPS_IRIX + + +/*! + * Compiler: GNU C++ + * Processor: Intel x86 + * OS: linux + */ +#elif defined(__GNUC__) && defined(__i386__) && defined(__linux__) +#define ACF_CPU_INTEL +#define ACF_OS_LINUX +#define ACF_OS_UNIX +#define ACF_COMPILER_GCC +#define ACF_PLATFORM_GCC_INTEL_LINUX + + +/*! + * Compiler: GNU C++ + * Processor: ARM + * OS: linux + */ +#elif defined(__GNUC__) && defined(__arm__) && defined(__linux__) +#define ACF_CPU_ARM +#define ACF_OS_LINUX +#define ACF_OS_UNIX +#define ACF_COMPILER_GCC +#define ACF_PLATFORM_GCC_ARM_LINUX + + +/*! + * Compiler: GNU C++ + * Processor: AARCH64 + * OS: linux + */ +#elif defined(__GNUC__) && defined(__aarch64__) && defined(__linux__) +#define ACF_CPU_AARCH64 +#define ACF_OS_64 +#define ACF_OS_LINUX +#define ACF_OS_UNIX +#define ACF_COMPILER_GCC +#define ACF_PLATFORM_GCC_ARM_LINUX + + +/*! + * Compiler: GNU C++ + * Processor: Intel x86, 64-bit + * OS: linux + */ +#elif defined(__GNUC__) && defined(__x86_64__) && defined(__linux__) +#define ACF_CPU_INTEL +#define ACF_OS_64 +#define ACF_OS_LINUX +#define ACF_OS_UNIX +#define ACF_COMPILER_GCC +#define ACF_PLATFORM_GCC_INTEL_LINUX +#define ACF_PLATFORM_GCC_INTEL64_LINUX + + +/*! + * Compiler: GNU C++ + * Processor: Intel x86 + * OS: FreeBSD + */ +#elif defined(__GNUC__) && defined(__i386__) && defined(__FreeBSD__) +#define ACF_CPU_INTEL +#define ACF_OS_FREEBSD +#define ACF_OS_UNIX +#define ACF_COMPILER_GCC +#define ACF_PLATFORM_GCC_INTEL_FREEBSD + + +/*! +* Compiler: GNU C++ +* Processor: Intel x86, 64-bit +* OS: FreeBSD +*/ +#elif defined(__GNUC__) && defined(__x86_64__) && defined(__FreeBSD__) +#define ACF_CPU_INTEL +#define ACF_OS_64 +#define ACF_OS_FREEBSD +#define ACF_OS_UNIX +#define ACF_COMPILER_GCC +#define ACF_PLATFORM_GCC_INTEL_FREEBSD +#define ACF_PLATFORM_GCC_INTEL64_FREEBSD + + +/*! + * Compiler: GNU C++ + * Processor: PowerPC, 32-bit + * OS: MacOS 10 + */ +#elif defined(__GNUC__) && defined(__ppc__) && defined(__APPLE__) && defined(__APPLE_CC__) +#define ACF_CPU_POWERPC +#define ACF_OS_MACOS10 +#define ACF_OS_UNIX +#define ACF_COMPILER_GCC +#define ACF_PLATFORM_GCC_POWERPC_MACOS10 + + +/*! + * Compiler: GNU C++ + * Processor: PowerPC, 64-bit + * OS: MacOS 10 + */ +#elif defined(__GNUC__) && defined(__ppc64__) && defined(__APPLE__) && defined(__APPLE_CC__) +#define ACF_CPU_POWERPC +#define ACF_OS_64 +#define ACF_OS_MACOS10 +#define ACF_OS_UNIX +#define ACF_COMPILER_GCC +#define ACF_PLATFORM_GCC_POWERPC_MACOS10 +#define ACF_PLATFORM_GCC_POWERPC64_MACOS10 + + +/*! + * Compiler: GNU C++ + * Processor: Intel x86 + * OS: MacOS 10 + */ +#elif defined(__GNUC__) && defined(__i386__) && defined(__APPLE__) && defined(__APPLE_CC__) +#define ACF_CPU_INTEL +#define ACF_OS_MACOS10 +#define ACF_OS_UNIX +#define ACF_COMPILER_GCC +#define ACF_PLATFORM_GCC_INTEL_MACOS10 + + +/*! +* Compiler: GNU C++ + * Processor: Intel x86, 64-bit + * OS: MacOS 10 + */ +#elif defined(__GNUC__) && defined(__x86_64__) && defined(__APPLE__) && defined(__APPLE_CC__) +#define ACF_CPU_INTEL +#define ACF_OS_64 +#define ACF_OS_MACOS10 +#define ACF_OS_UNIX +#define ACF_COMPILER_GCC +#define ACF_PLATFORM_GCC_INTEL_MACOS10 +#define ACF_PLATFORM_GCC_INTEL64_MACOS10 + + +/*! + * Compiler: Intel Compiler + * Processor: Intel x86 + * OS: MacOS 10 + */ +#elif (defined(__INTEL_COMPILER) || defined(__ICL) || defined(__ICC)) && defined(__MACH__) +#define ACF_CPU_INTEL +#define ACF_OS_MACOS10 +#define ACF_OS_UNIX +#define ACF_COMPILER_INTEL +#define ACF_PLATFORM_INTEL_INTEL_MACOS10 + + +/*! + * Compiler: GNU C++ + * Processor: ARM + * OS: linux + */ +#elif defined(__GNUC__) && defined(__arm__) && defined(__linux__) +#define ACF_CPU_ARM +#define ACF_OS_LINUX +#define ACF_OS_UNIX +#define ACF_COMPILER_GCC +#define ACF_PLATFORM_GCC_ARM_LINUX + + +/*! + * Compiler: Arm Compiler + * Processor: Arm + * OS: iOS + */ +#elif (TARGET_OS_IOS) +#define ACF_CPU_ARM +#define ACF_OS_IOS +#define ACF_OS_UNIX +#define ACF_COMPILER_ARM +#define ACF_PLATFORM_ARM_IOS + + +/*! +* Compiler: GNU C++ + * Processor: ARM, 64-bit + * OS: MacOS 11 + */ +#elif defined(__GNUC__) && defined(__arm64__) && ( defined(__APPLE_CPP__) || defined(__APPLE_CC__) ) +#define ACF_CPU_ARM +#define ACF_OS_64 +#define ACF_OS_MACOS10 +#define ACF_OS_MACOS11 +#define ACF_OS_UNIX +#define ACF_COMPILER_GCC +#define ACF_PLATFORM_GCC_ARM_MACOS11 +#define ACF_PLATFORM_GCC_ARM64_MACOS11 + + +#else +#error Unknown platform + +#endif +/*! End of Platform definition */ + + +/*! + * For compatibility with earlier releases of the sdk + */ +#if defined(ACF_PLATFORM_MWERKS_POWERPC_MACOS10) || defined(ACF_PLATFORM_GCC_POWERPC_MACOS10) || defined(ACF_PLATFORM_GCC_INTEL_MACOS10) || defined(ACF_PLATFORM_GCC_ARM64_MACOS11) + #define ACF_MAC 0 + #define ACF_WIN 0 + #define ACF_MACH 1 +#elif defined(ACF_PLATFORM_MWERKS_POWERPC_MACOS) + #define ACF_MAC 1 + #define ACF_WIN 0 + #define ACF_MACH 0 +#elif defined(ACF_PLATFORM_MSC_INTEL_WINDOWS) || defined(ACF_PLATFORM_INTEL_INTEL_WINDOWS) || defined(ACF_PLATFORM_MWERKS_INTEL_WINDOWS) + #define ACF_MAC 0 + #define ACF_WIN 1 + #define ACF_MACH 0 +#elif defined(ACF_OS_LINUX) || defined(ACF_OS_FREEBSD) + #define ACF_MAC 0 + #define ACF_WIN 0 + #define ACF_MACH 0 + #define ACF_UNIX 1 +#elif defined(ACF_OS_IOS) + #define ACF_IOS 1 + #define ACF_MAC 0 + #define ACF_WIN 0 + #define ACF_MACH 0 + #define ACF_UNIX 0 +#else + #error Unknown OS! +#endif + + +#ifdef __cplusplus +#define ACFEXTERN_C extern "C" +#else +#define ACFEXTERN_C +#endif + + +// +#if defined(ACF_COMPILER_GCC_VERSION) && (ACF_COMPILER_GCC_VERSION >= 40000) + #if defined(ACFPLUGIN_EXPORTS) + #define ACFEXPORT __attribute__((visibility("default"))) + #else + #define ACFEXPORT + #endif +#elif ((defined(_MSC_VER) || defined(__INTEL_COMPILER) || defined(__MWERKS__)) && (defined(_WIN32) || defined(_WIN64))) + #if defined(ACFPLUGIN_EXPORTS) + #define ACFEXPORT __declspec(dllexport) + #else + #define ACFEXPORT + #endif +#else + #define ACFEXPORT +#endif + + + +// Define used to force the size of enum types to 4 bytes. +#define ACF_FORCE_LONG 0x7FFFFFFFL + + +/*! Minimalist set of types + * \note some of these definitions are compiler dependent! + */ + +/*! + * Classic MacOS + */ +#if defined( ACF_PLATFORM_MWERKS_POWERPC_MACOS ) +typedef unsigned char acfUInt8; +typedef acfUInt8 acfByte; +typedef signed char acfSInt8; +typedef acfUInt8 acfUChar; +typedef acfSInt8 acfSChar; +typedef unsigned short int acfUInt16; +typedef signed short int acfSInt16; +typedef unsigned long int acfUInt32; +typedef signed long int acfSInt32; + +#if (__MWERKS__ >= 0x1100) +typedef unsigned long long int acfUInt64; +typedef signed long long int acfSInt64; +#else +#error "The ACF API required built-in support for 64-bit integers!" +#endif + +typedef char acfChar; + +typedef wchar_t acfUniChar; + +typedef double acfFloat64; + +typedef float acfFloat32; + +typedef long ACFRESULT; + + +/*! + * MacOS 10 & Windows with Metrowerks + */ +#elif defined( ACF_PLATFORM_MWERKS_POWERPC_MACOS10 ) || defined( ACF_PLATFORM_MWERKS_INTEL_WINDOWS ) +typedef unsigned char acfUInt8; +typedef acfUInt8 acfByte; +typedef signed char acfSInt8; +typedef acfUInt8 acfUChar; +typedef acfSInt8 acfSChar; +typedef unsigned short int acfUInt16; +typedef signed short int acfSInt16; +typedef unsigned long int acfUInt32; +typedef signed long int acfSInt32; +typedef unsigned long long int acfUInt64; +typedef signed long long int acfSInt64; + +typedef char acfChar; + +typedef wchar_t acfUniChar; + +typedef double acfFloat64; + +typedef float acfFloat32; + +typedef long ACFRESULT; + + +/*! + * Windows + */ +#elif defined( ACF_PLATFORM_MSC_INTEL_WINDOWS ) || defined(ACF_PLATFORM_INTEL_INTEL_WINDOWS) +typedef unsigned char acfUInt8; +typedef acfUInt8 acfByte; +typedef signed char acfSInt8; +typedef acfUInt8 acfUChar; +typedef acfSInt8 acfSChar; +typedef unsigned short int acfUInt16; +typedef signed short int acfSInt16; +typedef unsigned long int acfUInt32; +typedef signed long int acfSInt32; + +typedef unsigned __int64 acfUInt64; +typedef __int64 acfSInt64; + +typedef char acfChar; + +typedef wchar_t acfUniChar; + +typedef double acfFloat64; + +typedef float acfFloat32; + +typedef long ACFRESULT; + + +/*! + * IRIX + */ +#elif defined( ACF_PLATFORM_MIPSPRO_MIPS_IRIX ) || defined( ACF_PLATFORM_GCC_MIPS_IRIX ) +typedef unsigned char acfUInt8; +typedef acfUInt8 acfByte; +typedef signed char acfSInt8; +typedef acfUInt8 acfUChar; +typedef acfSInt8 acfSChar; +typedef unsigned short int acfUInt16; +typedef signed short int acfSInt16; +typedef unsigned long int acfUInt32; +typedef signed long int acfSInt32; + +#if defined( __LONGLONG ) || defined( _LONGLONG ) +typedef unsigned long long int acfUInt64; +typedef signed long long int acfSInt64; +#else +#error "The ACF API required built-in support for 64-bit integers!" +#endif + +typedef char acfChar; + +typedef wchar_t acfUniChar; + +typedef double acfFloat64; + +typedef float acfFloat32; + +typedef long ACFRESULT; + + +/*! + * 64-bit GCC: Linux, FreeBSD, Darwin, etc. + */ +#elif defined( ACF_COMPILER_GCC ) && defined( ACF_OS_64 ) +typedef unsigned char acfUInt8; +typedef acfUInt8 acfByte; +typedef signed char acfSInt8; +typedef acfUInt8 acfUChar; +typedef acfSInt8 acfSChar; +typedef unsigned short acfUInt16; +typedef signed short acfSInt16; +typedef unsigned int acfUInt32; +typedef signed int acfSInt32; +typedef unsigned long long acfUInt64; +typedef signed long long acfSInt64; + +typedef char acfChar; + +typedef wchar_t acfUniChar; + +typedef double acfFloat64; + +typedef float acfFloat32; + +typedef int ACFRESULT; + + +/*! + * 32-bit GCC: Linux, FreeBSD, Darwin, etc. + */ +#elif ( defined( ACF_COMPILER_GCC ) && !defined( ACF_OS_64 ) ) || defined( ACF_COMPILER_ARM ) +typedef unsigned char acfUInt8; +typedef acfUInt8 acfByte; +typedef signed char acfSInt8; +typedef acfUInt8 acfUChar; +typedef acfSInt8 acfSChar; +typedef unsigned short int acfUInt16; +typedef signed short int acfSInt16; +typedef unsigned long int acfUInt32; +typedef signed long int acfSInt32; +typedef unsigned long long int acfUInt64; +typedef signed long long int acfSInt64; + +typedef char acfChar; + +typedef wchar_t acfUniChar; + +typedef double acfFloat64; + +typedef float acfFloat32; + +typedef long ACFRESULT; + + +#else + #error "Unsupported compiler!" +#endif + + +/*! + Fall back to define ACF_OS_64 just in case we missed a more specific compiler/platform/os above. + */ +#ifndef ACF_OS_64 +#if (defined(_M_AMD64) || defined(_M_IA64) || defined(__x86_64__) || defined(__arm64__) || defined(__x86_64) || defined(_IA64) || defined(__IA64__) || defined(__ia64__) || defined(__ppc64__)) +#define ACF_OS_64 +#endif +#endif + + +/*! + Define integer types that are the same size as pointer that can be used for architecture + and platform independent pointer arithmetic. + */ +#if defined(ACF_OS_64) +typedef acfSInt64 acfSIntPtr; +typedef acfUInt64 acfUIntPtr; +#elif defined(ACF_OS_WINDOWS) +typedef __w64 acfSInt32 acfSIntPtr; +typedef __w64 acfUInt32 acfUIntPtr; +#else +typedef acfSInt32 acfSIntPtr; +typedef acfUInt32 acfUIntPtr; +#endif + + +/*! + Define deprecated acfDouble as acfFloat64 to maintain compatibility with older interfaces. + */ +#define acfDouble acfFloat64 + +/*! + Define deprecated acfFloat as acfFloat32 to maintain compatibility with older interfaces. + */ +#define acfFloat acfFloat32 + + +/*! + \typedef acfWChar +*/ +typedef acfUniChar acfWChar; + + +/*! + \typedef acfUTF8 + \brief Data type for UTF8 encoded character data. +*/ +typedef acfUInt8 acfUTF8; + + +/*! + \typedef acfUTF16 + \brief Data type for UTF16 encoded character data. +*/ +typedef acfUInt16 acfUTF16; + + +/*! + \typedef acfUTF32 + \brief Data type for UTF32 encoded character data. +*/ +typedef acfUInt32 acfUTF32; + + +/*! + \typedef acfBoolean + \brief C-style Boolean type for ACF + \remarks + \n \em kACFFalse Represents boolean false + \n \em kACFTrue Represents boolean true + \note + \n Never test for equality of an acfBoolean integer variable directly with kACFTrue. + \n For example: + \code + acfSInt32 l_lVal = 42; + acfBoolean l_bCondition1 = l_lVal; + ... + if (l_bCondition1 == kACFTrue) + { + // Will never be reached + // This example does not work as expected because the integer value of l_bCondition1 is 42. + } + ... + if ((l_bCondition1 != kACFFalse) || (l_bCondition1 != 0) || (l_bCondition1) || (!!l_bCondition1)) + { + // This block will be reached. + } + \endcode + + +*/ +typedef acfSInt32 acfBoolean; + + +/*! + \typedef acfBool + \brief Old enum Boolean type for ACF (deprecated) + \remarks + \n \em kACFFalse Represents boolean false + \n \em kACFTrue Represents boolean true + \deprecated The use of acfBool in an ACF interface is now deprecated in favor of the integer-based \ref acfBoolean type. + \n Any ACF interface that has been released with acfBool is frozen and will remain unchanged. +*/ +typedef enum _acfBool { + kACFFalse = 0L, + kACFTrue = 1L, + kACFBool_Max = ACF_FORCE_LONG +} acfBool; + + + +/*! + \typedef acfUID + \brief GUID compatible structure for ACF. +*/ +typedef struct _acfUID { + acfUInt32 Data1; + acfUInt16 Data2; + acfUInt16 Data3; + acfUInt8 Data4[8]; +} acfUID; + + +/*! + \typedef acfIID + \brief IID compatible structure for ACF. +*/ +typedef acfUID acfIID; + + +/*! + \typedef acfCLSID + \brief CLSID compatible structure for ACF. +*/ +typedef acfUID acfCLSID; + + + +/*! + \typedef acfPoint + \brief Represents a two dimensional integer point + \n \em x The x coordinate. + \n \em y The y coordinate. +*/ +typedef struct _acfPoint { + acfSInt32 x; + acfSInt32 y; +} acfPoint; + + +/*! + \typedef acfRect + \brief Represents a two dimensional integer rectangle. + \n \em x1 The first x coordinate. + \n \em y1 The first y coordinate. + \n \em x2 The second x coordinate. + \n \em y2 The second y coordinate. +*/ +typedef struct _acfRect { + acfSInt32 x1; + acfSInt32 y1; + acfSInt32 x2; + acfSInt32 y2; +} acfRect; + + +/*! + \typedef acfBBox + \brief Alias for acfRect. +*/ +typedef acfRect acfBBox; + + +/*! + \typedef acfBounds + \brief Alias for acfRect. +*/ +typedef acfRect acfBounds; + + +/*! + \typedef acfSize + \brief Represents a two dimensional integer size. + \n \em dx Distance in the x dimension. + \n \em dy Distance in the y dimension. +*/ +typedef struct _acfSize { + acfSInt32 dx; + acfSInt32 dy; +} acfSize; + + +/*! + \typedef acfRational32 + \brief Represents a rational number with 32-bit signed numerator and denominator components. + \n \em numerator + \n \em denominator +*/ +typedef struct _acfRational32 { + acfSInt32 numerator; + acfSInt32 denominator; +} acfRational32; + + +/*! + \typedef acfRational64 + \brief Represents a rational number with 64-bit signed numerator and denominator components. + \n \em numerator + \n \em denominator +*/ +typedef struct _acfRational64 { + acfSInt64 numerator; + acfSInt64 denominator; +} acfRational64; + + +/*! + \enum acfDebugLevel + \brief Used by host to determine what console messages should be displayed. + \n \em kACFDebugLevel_None Used by the host to suppress all output to the console. + \n \em kACFDebugLevel_Error Display plug in errors in host console. + \n \em kACFDebugLevel_Warning Display plug in warnings in host console. + \n \em kACFDebugLevel_Verbose Display plug in verbose messages in host console. + \n \em kACFDebugLevel_Trace Display plug in trace messages in host console. + \n \em kACFDebugLevel_Info Display important plug in information messages in host console. + \n \em kACFDebugLevel_Full Display all plug in messages in host console. + \note It is recommended that all hosts support Error, Warning and Info messages by default. +*/ +typedef enum _acfDebugLevel { + kACFDebugLevel_None = 0, + kACFDebugLevel_Error = 1 << 0, + kACFDebugLevel_Warning = 1 << 1, + kACFDebugLevel_Verbose = 1 << 2, + kACFDebugLevel_Trace = 1 << 3, + kACFDebugLevel_Info = 1 << 4, + kACFDebugLevel_Full = 0xFFFFFFFF, + kACFDebugLevel_Max = ACF_FORCE_LONG +} acfDebugLevel; + + + +typedef acfUInt16 acfByteOrder; + + +/*! + kACFBigendianByteOrder + Indicates that the data is in big endian byte order. In this case the type's + Reorder method will be called when the client that accesses the corresponding value + data is on a little endian system. + */ +const acfByteOrder kACFBigEndianByteOrder = 0x4D4D; // 'MM' + +/*! + kACFLittleendianByteOrder + Indicates that the data is in little endian byte order. In this case the type's + Reorder method will be called when the client that accesses the corresponding value + data is on a big endian system. + */ +const acfByteOrder kACFLittleEndianByteOrder = 0x4949; // 'II' + +/*! + kACFUnspecifiedByteOrder + Indicates that the data type has an unspecified byte order. In this case the type's + Reorder method will be called but only value meta-data will be swapped, the client that + reads the corresponding value data must perform its own byte swapping if necessary. + */ +const acfByteOrder kACFUnspecifiedByteOrder = 0x5555; // 'UU' + +/*! + ACF_SIZE_UNK + Used in the IACFDefinition interface when copying and defining attributes. It signals the function + calculate, when possible, to calculate the size of the attribute. This is particularly useful with strings. +*/ +const acfUInt32 ACF_SIZE_UNK = (acfUInt32)(-1); + +#endif // acfbasetypes_h diff --git a/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/ACF/acfcheckm.h b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/ACF/acfcheckm.h new file mode 100644 index 0000000000..5a535ed8bb --- /dev/null +++ b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/ACF/acfcheckm.h @@ -0,0 +1,149 @@ +/*********************************************************************** + + This file is part of the Avid AAX SDK. + + The AAX SDK is subject to commercial or open-source licensing. + + By using the AAX SDK, you agree to the terms of both the Avid AAX SDK License + Agreement and Avid Privacy Policy. + + AAX SDK License: https://developer.avid.com/aax + Privacy Policy: https://www.avid.com/legal/privacy-policy-statement + + Or: You may also use this code under the terms of the GPL v3 (see + www.gnu.org/licenses). + + THE AAX SDK IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER + EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE + DISCLAIMED. + + Copyright (c) 2004, 2024 Avid Technology, Inc. All rights reserved. + +************************************************************************/ +#ifndef acfMessageCheck_h +#define acfMessageCheck_h + + + /*! + \file acfcheckm.h + \brief Utility to report ACFRESULTS as a string and display the result in a Message box. + \remarks + The code within acfcheckm are designed to aid debugging. The code may be freely modified. + + + \author Todd Kelly + \date March 2005 + \note This file is intended to help debugging of ACFRESULTS + It is a starting point for ACF developers. You may freely + modify acfCheckM.h and acfCheckM.cpp to + meet your needs. The acfMessageCheck files are intended to + suplement acfcheck( ). In Windows you will need to ling to User32.lib + in order to use the MessageBox functionality. + + */ + + + +#include "acfbasetypes.h" +#include "acfresult.h" + + + +////////////////////////////////// +// Build Options + +// REPORT_RESULT_AS_STRING - +// Create message only in a debug environment +#ifdef _DEBUG + #ifdef _WIN32 + // Currently windows only + #define REPORT_RESULT_AS_STRING + #endif +#else + #define THROWACFRESULT +#endif + +#ifdef NDEBUG +#define NO_MESSAGE +#endif + +/*! + Defining THROWACFRESULT, allows or supress acfcheckmM +to throwing a failed ACFRESULT. + The defualt prevents throwing in a debug build. + Because a message box is enough warning when + debugging... + A defualt release build will throw any result that + represents failure. + + Enabling provides for behaviour similar to acfcheck + which does throw a result. + In a release build the default behaviour is to throw +*/ + +#ifdef THROWACFRESULT + #define THROWRESULT throw +#else + #define THROWRESULT +#endif + + +#ifdef _WIN32 +#ifndef UNICODE + #pragma message ( "Unicode should be defined" ) +#endif +#endif + + + +#ifndef WIDEN2 +#define WIDEN2(x) L ## x +#endif + +#ifndef WIDEN +#define WIDEN(x) WIDEN2(x) +#endif + +#ifndef __FUNCTION__ + #define __FUNCTION__ "" +#endif + + +/*! + AcfResultToString + Given an ACF Result, the result is converted to a + a message string that easier for a human to read. + example return would be "ACF_E_NOTIMPL" +*/ +const wchar_t* ACFResultToString( ACFRESULT result ); + + +#undef acfcheckM + +/*! + \def acfcheckM( _ACF_result_ ) + In a debug build: + In windows - acfcheckM an ACFRESULT in a message box with the + result code as a human readable string along with the file, function + and line that the error occurred in. + + In release build: acfcheckM should do nothing or throw a failed result, depending + on the definition of THROWACFRESULT +*/ + +#ifdef REPORT_RESULT_AS_STRING + ACFRESULT _acfcheckM( ACFRESULT result, const wchar_t* file , const wchar_t* functioname, int line ); + #define acfcheckM(_result_) (_acfcheckM( _result_, WIDEN(__FILE__) , WIDEN(__FUNCTION__) , __LINE__ )) +#else + #ifdef THROWACFRESULT + inline void acfcheckM( ACFRESULT _result_) { if (ACFFAILED(_result_)) THROWRESULT ACFRESULT(_result_);} + #else + #define acfcheckM( _result_ ) ( _result_) + #endif +#endif /* NDEBUG */ + + + + +#endif //acfMessageCheck_h + diff --git a/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/ACF/acfextras.h b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/ACF/acfextras.h new file mode 100644 index 0000000000..63fc2f663c --- /dev/null +++ b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/ACF/acfextras.h @@ -0,0 +1,186 @@ +/*********************************************************************** + + This file is part of the Avid AAX SDK. + + The AAX SDK is subject to commercial or open-source licensing. + + By using the AAX SDK, you agree to the terms of both the Avid AAX SDK License + Agreement and Avid Privacy Policy. + + AAX SDK License: https://developer.avid.com/aax + Privacy Policy: https://www.avid.com/legal/privacy-policy-statement + + Or: You may also use this code under the terms of the GPL v3 (see + www.gnu.org/licenses). + + THE AAX SDK IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER + EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE + DISCLAIMED. + + Copyright (c) 2004, 2024 Avid Technology, Inc. All rights reserved. + +************************************************************************/ + + +#ifndef __acfextras_h__ +#define __acfextras_h__ + +#include "acfbasetypes.h" +#include "acfresult.h" + +/*! + \file acfextras.h + \brief acfUID comparison operators. Utility and error checking Macros. +*/ + +inline bool operator == (const acfUID& lhs, const acfUID& rhs) +{ + return ((lhs.Data1 == rhs.Data1) && + (lhs.Data2 == rhs.Data2) && + (lhs.Data3 == rhs.Data3) && + (lhs.Data4[0] == rhs.Data4[0]) && + (lhs.Data4[1] == rhs.Data4[1]) && + (lhs.Data4[2] == rhs.Data4[2]) && + (lhs.Data4[3] == rhs.Data4[3]) && + (lhs.Data4[4] == rhs.Data4[4]) && + (lhs.Data4[5] == rhs.Data4[5]) && + (lhs.Data4[6] == rhs.Data4[6]) && + (lhs.Data4[7] == rhs.Data4[7])); +} + +inline bool operator != (const acfUID& lhs, + const acfUID& rhs) +{ + return !(lhs == rhs); +} + + +// Macro to enforce relationship between the interface id and +// its associated interface type arguments in QueryInterface. +// In the following example: +// IXInterfaceType * pInterface = 0; +// pUnk->QueryInterface(IID_IXInterfaceType, (void **)&pInterface); +// +// The QueryInterface call can be rewritten to be compiler +// safe as: +// pUnk->QueryInterface(IID_PPV_ARG(IXInterfaceType, &pInterface)); +// Macro from "Essential COM", by Don Box. +#define IID_PPV_ARG(Type, Expr) IID_##Type, \ + reinterpret_cast(static_cast(Expr)) + +// Namespace version of IID_PPV_ARG. +#define NS_IID_PPV_ARG(NameSpace, Type, Expr) \ + NameSpace::IID_##Type, \ + reinterpret_cast(static_cast(Expr)) + +// NOTE: We may not want the less than operator to be inline... +inline bool operator < (const acfUID& lhs, const acfUID& rhs) +{ + if (lhs.Data1 < rhs.Data1) + return true; + else if (lhs.Data1 == rhs.Data1) + { + if (lhs.Data2 < rhs.Data2) + return true; + else if (lhs.Data2 == rhs.Data2) + { + if (lhs.Data3 < rhs.Data3) + return true; + else if (lhs.Data3 == rhs.Data3) + { + if (lhs.Data4[0] < rhs.Data4[0]) + return true; + else if (lhs.Data4[0] == rhs.Data4[0]) + { + if (lhs.Data4[1] < rhs.Data4[1]) + return true; + else if (lhs.Data4[1] == rhs.Data4[1]) + { + if (lhs.Data4[2] < rhs.Data4[2]) + return true; + else if (lhs.Data4[2] == rhs.Data4[2]) + { + if (lhs.Data4[3] < rhs.Data4[3]) + return true; + else if (lhs.Data4[3] == rhs.Data4[3]) + { + if (lhs.Data4[4] < rhs.Data4[4]) + return true; + else if (lhs.Data4[4] == rhs.Data4[4]) + { + if (lhs.Data4[5] < rhs.Data4[5]) + return true; + else if (lhs.Data4[5] == rhs.Data4[5]) + { + if (lhs.Data4[6] < rhs.Data4[6]) + return true; + else if (lhs.Data4[6] == rhs.Data4[6]) + { + if (lhs.Data4[7] < rhs.Data4[7]) + return true; + } + } + } + } + } + } + } + } + } + } + + return false; +} + + +// Preliminary exception handlers for ACF methods. + +/*! + \b BEGIN_ACF_METHOD + \brief Opens a try block for ACF result codes + \remarks BEGIN_ACF_METHOD must be followed by a + corresponding END_ACF_METHOD. BEGIN_ACF_METHOD is the try + end of the exception block. These MACROS define a + try and catch block for the handling ACFRESULT exceptions. + */ +#define BEGIN_ACF_METHOD\ + ACFRESULT avx2methodresult = ACF_OK;\ + try\ + { +/*! + \b END_ACF_METHOD + \brief closes a try block for ACF result codes + \remarks END_ACF_METHOD must be preceeded by a + corresponding BEGIN_ACF_METHOD. END_ACF_METHOD is the catch + end of the exception block.These MACROS define a + try and catch block for the handling ACFRESULT exceptions. + */ +#define END_ACF_METHOD\ + }\ + catch (ACFRESULT & acfresultexception)\ + {\ + avx2methodresult = acfresultexception;\ + }\ + catch (...)\ + {\ + avx2methodresult = ACF_E_UNEXPECTED;\ + }\ + return avx2methodresult; +/*! + \b acfcheck( result ) + \brief acfcheck is a convenience function used for validating the + success of returning ACFRESULT codes. + \remarks if the return code is a comprised of a + ACFFAILED code this function will throw an ACFRESULT exception. + For this reason, use of the function should be wrapped in a + try -- catch block that can handle the exception, such as the + BEGIN_ACF_METHOD and END_ACF_METHOD macros. + +*/ +inline void acfcheck(ACFRESULT result) +{ + if (ACFFAILED(result)) + throw ACFRESULT(result); +} + +#endif // __acfextras_h__ diff --git a/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/ACF/acfresult.h b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/ACF/acfresult.h new file mode 100644 index 0000000000..76627d7f90 --- /dev/null +++ b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/ACF/acfresult.h @@ -0,0 +1,384 @@ +/*********************************************************************** + + This file is part of the Avid AAX SDK. + + The AAX SDK is subject to commercial or open-source licensing. + + By using the AAX SDK, you agree to the terms of both the Avid AAX SDK License + Agreement and Avid Privacy Policy. + + AAX SDK License: https://developer.avid.com/aax + Privacy Policy: https://www.avid.com/legal/privacy-policy-statement + + Or: You may also use this code under the terms of the GPL v3 (see + www.gnu.org/licenses). + + THE AAX SDK IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER + EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE + DISCLAIMED. + + Copyright (c) 2004, 2024 Avid Technology, Inc. All rights reserved. + +************************************************************************/ + + + +#ifndef acfresult_h +#define acfresult_h + +/*! + \file acfresult.h + \brief Defines the common result codes. + \remarks + Result codes contain embedded information describing + the severity, status and factors in the result. Note + A successful result is not defined as 1. The ACFSUCCEEDED() + and ACFFAILED() macros should be used for determining + the result. + \note Define ACF equivalent of COM HRESULT. + */ + +#include "acfbasetypes.h" + +/*! +\defgroup ResultCodes Result Codes +Result codes are values returned from methods in an interface. Result codes are bitfield that provide a richer set of information +than a simple true or false return value. The result code can be used to determine the exact nature of a failure in the API. +*/ + +//@{ + + +/*! +Macro that creates an ACFRESULT value from component pieces +*/ +#define MAKE_ACFRESULT(sev,fac,code) \ + ((ACFRESULT) (((acfUInt32)(sev)<<31) | ((acfUInt32)(fac)<<16) | ((acfUInt32)(code))) ) + +/*! +Macro that creates a custom ACFRESULT +*/ +#define MAKE_CUSTOM_ACFRESULT(sev,fac,code) \ + ((ACFRESULT) (((acfUInt32)(sev)<<31) | (1 << 29) | ((acfUInt32)(fac)<<16) | ((acfUInt32)(code))) ) + + +/*! +Macro that checks for the success of an ACFRESULT. Note that general success or failure should not be tested +against binary operators. Use the ACFSUCCEEDED and ACFFAILED macros instead. +*/ +#define ACFSUCCEEDED(Status) ((ACFRESULT)(Status) >= 0) + +/*! +Macro that checks for the failure of a ACFRESULT. Note that general success or failure should not be tested +against binary operators. Use the ACFSUCCEEDED and ACFFAILED macros instead. +*/ +#define ACFFAILED(Status) ((ACFRESULT)(Status)<0) + + + +/*! + \brief Success: A successful return result. + \remarks The function succeeded and returned a Boolean true. + ACF_OK is defined as 0. +*/ + +#define ACF_OK 0L + + +/*! + \def ACF_FALSE + \brief Success: A false return result. + \remarks The function succeeded and returned a Boolean false. + ACF_FALSE is defined as 1. +*/ + +#define ACF_FALSE MAKE_ACFRESULT(0, 0, 1) + + +/*! + \def ACF_E_UNEXPECTED + \brief Error: unexpected return result. + \remarks Should be returned as a generic error + when an unanticipated problem has arisen. The result + is generally a catastrophic error. + */ +#define ACF_E_UNEXPECTED MAKE_ACFRESULT(1, 0, 0xffff) + // relatively catastrophic failure +/*! + \def ACF_E_NOTIMPL + \brief Error: the call is not implemented result. + \remarks Used for forward thinking and future features. +*/ +#define ACF_E_NOTIMPL MAKE_ACFRESULT(1, 0, 1) + // not implemented +/*! + \def ACF_E_OUTOFMEMORY + \brief Error: out of memory. + \remarks Out of memory error, if there were more + memory, you would could forget the error. +*/ +#define ACF_E_OUTOFMEMORY MAKE_ACFRESULT(1, 0, 2) + // ran out of memory +/*! + \def ACF_E_INVALIDARG + \brief Error: an argument passed to the function is invalid. + \remarks Not to be confused with an invalid pointer argument. + An invalid argument is given when the wrong or inconsistent + information is passed to the function. +*/ +#define ACF_E_INVALIDARG MAKE_ACFRESULT(1, 0, 3) + // one or more arguments are invalid +/*! + \def ACF_E_NOINTERFACE + \brief Error: there is no such interface + \remarks A compatible interface can not be found. +*/ +#define ACF_E_NOINTERFACE MAKE_ACFRESULT(1, 0, 4) + // no such interface supported + +/*! + \def ACF_E_POINTER + \brief Error: the pointer is invalid + \remarks The pointer is most likely not initialized properly. + It could also be of the wrong type. +*/ +#define ACF_E_POINTER MAKE_ACFRESULT(1, 0, 5) + // invalid pointer + +/*! + \def ACF_E_HANDLE + \brief Error: the handle is invalid + \remarks The handle could be of the wrong type, no longer valid + or closed. +*/ +#define ACF_E_HANDLE MAKE_ACFRESULT(1, 0, 6) + // invalid handle +/*! + \def ACF_E_ABORT + \brief Error: The call is being aborted. +*/ +#define ACF_E_ABORT MAKE_ACFRESULT(1, 0, 7) + // operation aborted +/*! + \def ACF_E_FAIL + \brief Error: Unspecified error. +*/ +#define ACF_E_FAIL MAKE_ACFRESULT(1, 0, 8) + // unspecified error +/*! + \def ACF_E_ACCESSDENIED + \brief Error: Access to a resource was denied. + \remarks Check permissions and serialization. +*/ +#define ACF_E_ACCESSDENIED MAKE_ACFRESULT(1, 0, 9) + +/*! + \def ACF_E_ATTRIBUTEUNDEFINED + \brief Error: The specified attribute could not be found. + \remarks Ensure the attribute was registered with DefineAttribute. +*/ +#define ACF_E_ATTRIBUTEUNDEFINED MAKE_CUSTOM_ACFRESULT(1, 0, 10) + // general access denied error +/*! + \def ACF_E_WRONGTYPE + \brief Error: The specified type id does not match the expected type ID + \remarks Ensure the type is correct +*/ +#define ACF_E_WRONGTYPE MAKE_CUSTOM_ACFRESULT(1, 0, 11) + + +/*! + \def ACF_E_OUT_OF_RANGE + \brief Error: Out of range + \remarks The index was inaccurate or out of range +*/ +#define ACF_E_OUT_OF_RANGE MAKE_ACFRESULT(1, 0, 12 ) + + +/*! +\def ACF_E_UNKNOWNDEFINITION +\brief Error: a requested definition can not be found. +\remarks The definition does not exist or is not registered with this host. +*/ +#define ACF_E_UNKNOWNDEFINITION MAKE_ACFRESULT( 1, 0, 13 ) + + + +/*! + \def ACF_E_CLASSNOTREG + \brief Error: The specified type id could not be found. + \remarks Ensure the type is valid. See acfbasetypes.h for valid types and avx2uids.h + for a list of standard types and thier corresponding uids. +*/ +#define ACF_E_CLASSNOTREG MAKE_ACFRESULT(1, 0x0004, 0x0154) + +/*! + \def ACF_E_BUFFERTOOSMALL + \brief Error: The specified buffer is invalid. + \remarks The buffer's is inappropriate. For a fixed size object, it could mean + there is a mismatch between the defined size and the arguments buffer size. +*/ +#define ACF_E_BUFFERTOOSMALL MAKE_ACFRESULT(1, 0x0002, 0x8016) + + +/*! + \def ACF_CLASS_E_NOAGGREGATION + \brief Error: There is no aggregate class + \remarks The class does not support aggregation (or class object is remote). +*/ +#define ACF_CLASS_E_NOAGGREGATION MAKE_ACFRESULT(1, 0x0004, 0x0110) + // class does not support aggregation (or class object is remote) +/*! + \def ACF_CLASS_E_CLASSNOTAVAILABLE + \brief Error: a requested class is not available. + \remarks The dll doesn't support that class (returned from DllGetClassObject) +*/ +#define ACF_CLASS_E_CLASSNOTAVAILABLE MAKE_ACFRESULT(1, 0x0004, 0x0111) + // dll doesn't support that class (returned from DllGetClassObject) + + +/*! + \def ACF_E_OUTOFRESOURCES + \brief Error: out of system resources + \remarks There were not enough system resources to satisfy the request. +*/ +#define ACF_E_OUTOFRESOURCES MAKE_CUSTOM_ACFRESULT(1, 0, 101) + +/*! + \def ACF_E_ALREADYINITIALIZED + \brief Error: entity has already been initialized + \remarks This result indicates that the internal state of some entity has already been initialized. +*/ +#define ACF_E_ALREADYINITIALIZED MAKE_CUSTOM_ACFRESULT(1, 0, 102) + +/*! + \def ACF_E_BUSY + \brief Error: entity is already used by another component (or thread) + \remarks This result indicates that the internal state of some entity is being used by another component (or thread). +*/ +#define ACF_E_BUSY MAKE_CUSTOM_ACFRESULT(1, 0, 103) + +/*! + \def ACF_E_NOTINITIALIZED + \brief Error: entity has not been initialized properly. + \remarks This result indicates that the internal state of some entity has not been initialize. +*/ +#define ACF_E_NOTINITIALIZED MAKE_CUSTOM_ACFRESULT(1, 0, 104) + +/*! + \def ACF_E_DATANOTAVAILABLE + \brief Error: entity could not retrieve the data. + \remarks This result indicates that the system was too busy to retrieve the data. +*/ +#define ACF_E_DATANOTAVAILABLE MAKE_CUSTOM_ACFRESULT(1, 0, 105) + +/*! + \def ACF_E_PARAMETERNOTAVAILABLE + \brief Error: entity could not retrieve the data. + \remarks This result indicates that the requested parameter is not available. +*/ +#define ACF_E_PARAMETERNOTAVAILABLE MAKE_CUSTOM_ACFRESULT(1, 0, 106) + +/*! + \def ACF_E_UNKNOWNTYPE + \brief Error: type is not known. + \remarks This result indicates that the corresponding type has not been completed defined in the current host. +*/ +#define ACF_E_UNKNOWNTYPE MAKE_CUSTOM_ACFRESULT(1, 0, 107) + +/*! + \def ACF_E_ALREADYDEFINED + \brief Error: The Definition already exists. + \remarks . +*/ +#define ACF_E_ALREADYDEFINED MAKE_CUSTOM_ACFRESULT(1, 0, 108) + +/*! + \def ACF_E_LAYOUTNOTAVAILABLE + \brief Error: entity could not retrieve the data. + \remarks This result indicates the the requested layout is not available. +*/ +#define ACF_E_LAYOUTNOTAVAILABLE MAKE_CUSTOM_ACFRESULT(1, 0, 109) + + +/*! +\def ACF_E_INVALIDTYPESIZE +\brief Error: Invalid type size +\remarks The type size is invalid, the buffer size does not match the type. +This can happen when the type ID does not match the data type. +*/ +#define ACF_E_INVALIDTYPESIZE MAKE_ACFRESULT(1, 0, 110 ) + +/*! +\def ACF_E_NODATA +\brief Error: entity could not retrieve the data because there is no data. +\remarks This result indicates that the system was unable to retrieve the data because there is none. +*/ +#define ACF_E_NODATA MAKE_CUSTOM_ACFRESULT(1, 0, 111) + + +/*! +\def ACF_E_TIMEOUT +\brief Error: entity's processing took longer that it was prepared to wait. The connection is timed out. +\remarks +*/ +#define ACF_E_TIMEOUT MAKE_CUSTOM_ACFRESULT(1, 0, 112) + +/*! +\def ACF_E_ENTITLEMENT +\brief Error: Plug-in could not be loaded because it is not entitled +\remarks +*/ +#define ACF_E_ENTITLEMENT MAKE_CUSTOM_ACFRESULT(1, 0, 113) + +/*! + \def ACF_E_CACHEHASHMISSING + \brief Error: Plug-in cache file is missing the hash data. + \remarks + */ +#define ACF_E_CACHEHASHMISSING MAKE_CUSTOM_ACFRESULT(1, 0, 114) + +/*! + \def ACF_E_CACHEHASHMISSMATCH + \brief Error: Plug-in cache file is stale and needs to be recreated. + \remarks + */ +#define ACF_E_CACHEHASHMISSMATCH MAKE_CUSTOM_ACFRESULT(1, 0, 115) + +/*! + \def ACF_E_NOTCOMPATIBLE + \brief Error: Plug-in module could not be loaded or register because it is incompatible with another plugin or application. + \remarks + */ +#define ACF_E_NOTCOMPATIBLE MAKE_CUSTOM_ACFRESULT(1, 0, 116) + +/*! + \def ACF_E_DISABLED + \brief Error: Plug-in module could not be loaded because it has been explicitely disabled. + \remarks + */ +#define ACF_E_DISABLED MAKE_CUSTOM_ACFRESULT(1, 0, 117) + +/*! + \def ACF_E_ACFCACHEREGISTER + \brief Error: Plug-in module could not be loaded or registered by the acfcacheregister process. + \remarks + */ +#define ACF_E_ACFCACHEREGISTER MAKE_CUSTOM_ACFRESULT(1, 0, 118) + +/*! + \def ACF_E_ACFCACHEREGISTERMISSING + \brief Error: The acfcacheregister process was not installed with the plugin host process. + \remarks + */ +#define ACF_E_ACFCACHEREGISTERMISSING MAKE_CUSTOM_ACFRESULT(1, 0, 119) + +/*! + \def ACF_E_PLUGINCACHENOTSUPPORTED + \brief Error: The plugin host has not enabled plugin caching (\sa ACFATTR_Host_SupportsPluginCache). + \remarks + */ +#define ACF_E_PLUGINCACHENOTSUPPORTED MAKE_CUSTOM_ACFRESULT(1, 0, 120) + +//@} // End ResultCodes +#endif // acfresult_h diff --git a/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/ACF/acfuids.h b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/ACF/acfuids.h new file mode 100644 index 0000000000..be576fb692 --- /dev/null +++ b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/ACF/acfuids.h @@ -0,0 +1,1138 @@ +/*********************************************************************** + + This file is part of the Avid AAX SDK. + + The AAX SDK is subject to commercial or open-source licensing. + + By using the AAX SDK, you agree to the terms of both the Avid AAX SDK License + Agreement and Avid Privacy Policy. + + AAX SDK License: https://developer.avid.com/aax + Privacy Policy: https://www.avid.com/legal/privacy-policy-statement + + Or: You may also use this code under the terms of the GPL v3 (see + www.gnu.org/licenses). + + THE AAX SDK IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER + EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE + DISCLAIMED. + + Copyright (c) 2004, 2024 Avid Technology, Inc. All rights reserved. + +************************************************************************/ + + +#ifndef acfuids_h +#define acfuids_h + +/*! + \file acfuids.h + \brief This file is the master definition of all UIDs for ACF and is included in acfunknown.h. +*/ + + +/*! + \defgroup ComponentType UIDS: Component Types + The component types fundamentally determine the nature of the plugin. + Compnent Type uid's are used to specify the type of interfaces the plugin will define in the IACFComponentDefinition::InitializeComponent() call. + Types of ACF Components that can be implemented by a plug-in (and registered with the host) +*/ + +//@{ + +/*! +\remarks Used to specify a codec component +\n type: UIDS \n \b function: \em ACFRegisterComponent \n context: private \n +*/ + DEFINE_ACFUID(acfUID, ACFCompType_Codec, 0xD5960204, 0x709B, 0x11D6, 0x91, 0xB2, 0x00, 0x30, 0x65, 0x8A, 0x65, 0x04); + +/*! + \remarks Used to specify a component defined by IAVXEffectDefinition and using the IAVXEffect interface +\n type: UIDS \n \b function: \em ACFRegisterComponent \n context: global \n +*/ + DEFINE_ACFUID(acfUID, ACFCompType_ImageEffect, 0x30f97600, 0x68fc, 0x11d5, 0x8c, 0xc5, 0x8a, 0xb4, 0x1b, 0x9e, 0xf8, 0x40); + + +/*! +\remarks Used to specify a utility component. +\n type: UIDS \n \b function: \em ACFRegisterComponent \n context: private \n +*/ + DEFINE_ACFUID(acfUID, ACFCompType_Utility, 0xa911bb00, 0x76b4, 0x11d5, 0x9b, 0xa2, 0x8e, 0x1a, 0xdd, 0x2d, 0x2a, 0x27); + +/*! +\remarks Used to specify a component defined by IAVXModalUI_V0 and using the IAVXModalUI_V0 interface +\n type: UIDS \n \b function: \em ACFRegisterComponent \n context: IAVXEffect \n +*/ + DEFINE_ACFUID(acfUID, ACFCompType_ModalUI, 0xBF35E5C6, 0xE6CC, 0x11D6, 0xAE, 0xD1, 0x00, 0x03, 0x93, 0x83, 0x00, 0x8C); + +/*! +\remarks Used to specify a component defined by IACFModelessUI and using the IACFModelessUI interface +\n type: UIDS \n \b function: \em ACFRegisterComponent \n context: IAVXEffect \n +*/ + DEFINE_ACFUID(acfUID, ACFCompType_ModelessUI, 0x56C23ACA, 0xB582, 0x11D8, 0x9A, 0x6E, 0x00, 0x0A, 0x95, 0xB0, 0x00, 0x3C); + +/*! +\remarks Used to specify a component defined by IAVXGraphicOverlay and using the IAVXGraphicOverlay interface +\n type: UIDS \n \b function: \em ACFRegisterComponent \n context: IAVXEffect \n +*/ + DEFINE_ACFUID(acfUID, ACFCompType_GraphicOverlay, 0xa1c8a58, 0xcbe3, 0x4690, 0x9c, 0x46, 0x2e, 0xa1, 0xb0, 0x79, 0x5b, 0xde); + +/*! +\remarks Used to specify a component defined by IACFDefinition and using the IACFDefinition interface +\n type: UIDS \n \b function: \em ACFRegisterComponent \n context: global \n +*/ + DEFINE_ACFUID(acfUID, ACFCompType_TypeDefinition, 0xd7df1180, 0x68fe, 0x11d5, 0x8c, 0xc5, 0x8a, 0x8e, 0xf7, 0x9e, 0x1c, 0x30); + +/*! +\remarks Used to specify a default component +\n type: UIDS \n \b function: \em ACFRegisterComponent \n context: global \n +*/ + DEFINE_ACFUID(acfUID, ACFCompType_Default, 0xec66ec80, 0x6986, 0x11d5, 0x9b, 0xa2, 0x8d, 0xb4, 0xb4, 0x2d, 0xfd, 0x37); + +/*! +\remarks Used to specify the an IAVXConformAVX1 component. +\n type: UIDS \n \b function: \em ACFRegisterComponent \n context: global \n +7E14445E-506C-4cb4-ACD9-81D20720D032 +*/ + +DEFINE_ACFUID(acfUID, ACFCompType_AVX1Conform, 0x7e14445e, 0x506c, 0x4cb4, 0xac, 0xd9, 0x81, 0xd2, 0x7, 0x20, 0xd0, 0x32); + + +/*! +\remarks Used to specify the an IAVXEffectConformDefinition component. +\n type: UIDS \n \b function: \em ACFRegisterComponent \n context: global \n +6127BDDD-4679-4cf9-B865-53D22E167763 +*/ + +DEFINE_ACFUID(acfUID, ACFCompType_AdvancedConform, 0x6127bddd, 0x4679, 0x4cf9, 0xb8, 0x65, 0x53, 0xd2, 0x2e, 0x16, 0x77, 0x63); + +/*! +\remarks Used to specify the an AVXEffectConformDefinition component. +\n type: UIDS \n \b function: \em ACFRegisterComponent \n context: global \n + F0BB6D92-D63C-4e73-96F5-F75461EC29CE + + +DEFINE_ACFUID(acfUID, ACFCompType_AVXEffectConformDefinition, 0xf0bb6d92, 0xd63c, 0x4e73, 0x96, 0xf5, 0xf7, 0x54, 0x61, 0xec, 0x29, 0xce); +*/ + +/*! +\remarks Used to specify a component defined by IACFComponentDefinition and implements the + IAVXUpdateParams interface. +\n type: UIDS \n \b function: \em ACFRegisterComponent \n \b context: global \n + {A32E8C65-971F-48b4-828F-0A1C2EFDFE62} +*/ +DEFINE_ACFUID(acfUID, ACFCompType_UpdateParams, 0xa32e8c65, 0x971f, 0x48b4, 0x82, 0x8f, 0xa, 0x1c, 0x2e, 0xfd, 0xfe, 0x62); + +/*! +\remarks Used to specify a property controller associated to a property container +\n type: UIDS \n \b function: \em ACFRegisterComponent \n \n context: global \n + {AE2A8ED4-6239-4757-9F6D-82E45489F437} +*/ +DEFINE_ACFUID(acfIID, ACFCompType_PropertyContainerController, 0xae2a8ed4, 0x6239, 0x4757, 0x9f , 0x6d , 0x82 , 0xe4 , 0x54 , 0x89 , 0xf4 , 0x37 ); + +//@} End ComponentType + + + +/*! + \defgroup GuidStdComponentID UIDS: Standard Component Types + The component ids for built-in host provided components. +*/ + +//@{ + +/*! +\remarks Used to specify standard component. +\n type: UIDS; \n method: CreateComponent; \n context: IACFComponentFactory \n +*/ + DEFINE_ACFUID(acfUID, ACFCompID_PluginDefinition, 0x6F8508AE, 0x7295, 0x11D6, 0x89, 0x52, 0x00, 0x30, 0x65, 0x8A, 0x65, 0x04); + +/*! +\remarks Used to create the basic component definition in a class factory using IACFComponentFactory interface +\n type: UIDS; \n method: CreateComponent; \n context: global \n +*/ + DEFINE_ACFUID(acfUID, ACFCompID_ComponentDefinition, 0x6C422BFA, 0x70E5, 0x11D6, 0x8C, 0xDD, 0x00, 0x30, 0x65, 0x8A, 0x65, 0x04); +/*! +\remarks Used to create the PropertyContainer component definition in a class factory using IACFComponentFactory interface +\n type: UIDS; \n method: CreateComponent; \n context: global \n +*/ + + DEFINE_ACFUID(acfIID, ACFCompID_PropertyContainerDefinition, 0xb6b7a135, 0x555e, 0x4b07, 0x82 , 0xbe , 0x58 , 0xd1 , 0xd6 , 0xdf , 0x53 , 0xab ); + +/*! +\remarks Used to create the basic effect component in a class factory using IACFComponentFactory interface +\n type: UIDS; \n method: CreateComponent; \n context: global \n +*/ + DEFINE_ACFUID(acfUID, ACFCompID_EffectDefinition, 0xfa6ce63d, 0x35c3, 0x469c, 0x8d, 0x80, 0xf9, 0xcf, 0x8f, 0xce, 0x7a, 0x1); +/*! +\remarks Used to create the basic effect component in a class factory using IACFComponentFactory interface +\n type: UIDS; \n method: CreateComponent; \n context: global \n +*/ + DEFINE_ACFUID(acfUID, ACFCompID_CompositeEffectDefinition, 0x5046f68f, 0x512c, 0x4c44, 0xae , 0x50 , 0x09 , 0x1e , 0x24 , 0xbd , 0x19 , 0x31 ); + +/*! +\remarks Used to simplify parameter and layout creation IACFComponentFactory interface +\n type: UIDS; \n method: CreateComponent; \n context: effects \n +*/ + DEFINE_ACFUID(acfUID, ACFCompID_ParamDefinitionGenerator,0x53e3772e, 0x8930, 0x4fe9, 0x85, 0xc9, 0x4f, 0xc6, 0x50, 0xf2, 0x38, 0x15); + +/*! +\remarks Used to simplify parameter and layout creation IACFComponentFactory interface +\n type: UIDS; \n method: CreateComponent; \n context: effects \n +*/ +DEFINE_ACFUID(acfUID, ACFCompID_ParamDefinitionGeneratorFromString, 0x9b1386d0, 0x381d, 0x4c6e, 0x82, 0x4a, 0xe1, 0x26, 0x7c, 0x2, 0xb8, 0xcf); + + +/*! +\remarks Used to create the basic parameter component in a class factory using IACFComponentFactory interface +\n type: UIDS; \n method: CreateComponent; \n context: effects \n +*/ + DEFINE_ACFUID(acfUID, ACFCompID_ParameterDefinition, 0x2ca1d73c, 0x7de5, 0x4f8c, 0x81, 0xe0, 0x40, 0xa0, 0x65, 0x5f, 0x9a, 0x4a); + +/*! +\remarks Used to create the basic layout component in a class factory using IACFComponentFactory interface +\n type: UIDS; \n method: CreateComponent; \n context: effects \n +*/ + DEFINE_ACFUID(acfUID, ACFCompID_LayoutDefinition, 0xb710c2bc, 0xdd00, 0x4f3c, 0xa8, 0xcc, 0xed, 0x54, 0x51, 0xf2, 0xb, 0xb4 ); + +/*! +\remarks Used to create the basic array component in a class factory using IACFComponentFactory interface +\n type: UIDS; \n method: CreateComponent; \n context: global \n +\n ACFNamespace name: com.avid.component.arraytypedefinition +\n UID String: 045d982d-51a2-3393-a0fb-e86ebdec0027 +*/ + DEFINE_ACFUID(acfUID, ACFCompID_ArrayTypeDefinition, 0x045d982d, 0x51a2, 0x00a0, 0xa0, 0xfb, 0xe8, 0x6e, 0xbd, 0xec, 0x00, 0x27); + + +/*! +\remarks Used to contain a list of definitions IAVX2ConformAssociation +\n type: UIDS; \n method: CreateComponent; \n context: global \n +\n ACFNamespace name: +\n UID String: 4C95268F-71F6-4c52-B498-A640ABC75A12 +*/ + + DEFINE_ACFUID(acfUID, ACFCompID_ConformAssociation, 0x4c95268f, 0x71f6, 0x4c52, 0xb4, 0x98, 0xa6, 0x40, 0xab, 0xc7, 0x5a, 0x12); + + +/*! +\remarks Used to create the basic array component in a class factory using IAVXConformDefinition component. +\n type: UIDS; \n method: CreateComponent; \n context: global \n +\n ACFNamespace name: +\n UID String: DBC683A8-40CD-4abd-9ABC-8528C2509F8F +*/ + + DEFINE_ACFUID(acfUID, ACFCompID_EffectConformDefinition, 0xdbc683a8, 0x40cd, 0x4abd, 0x9a, 0xbc, 0x85, 0x28, 0xc2, 0x50, 0x9f, 0x8f); + + +//@} End StdComponentID + + +/*! +\remarks AVXComponentID_HostMemeoryAllocator +This is the component id used for the host memory allocator. All memory +allocated with this component will be from the host's memory address space. +Use this object to allocate dynamic buffers for plug-ins. The plug-in could also +override the global C++ new function in the plug-in so that all C++ objects can use +the same host memory allocator (this will require implementing the ACFStartup +and ACFShutdown callbacks). + +\note The host memory allocator is implemented by the host it is accessed through +the IACFMalloc interface with IID equal to IID_IACFMalloc (see acfmemory.h). +\n type: UIDS; \n method: CreateComponent; \n context: global \n +\n ACFNamespace name: +\n UID String: +*/ + DEFINE_ACFUID(acfUID, ACFCompID_HostMemoryAllocator, 0xc97930cf, 0xfbb8, 0x4789, 0xaf, 0x19, 0x51, 0xd4, 0xc2, 0x25, 0x59, 0xc0); + + + + +/*! + \defgroup GuidHostProvidedParams UIDS: Pre-Defined Parameters + The component ids for built-in host provided parameters. +*/ +//@{ +/*! +\remarks Used to specify that an effect uses a Modal dialog IACFComponentFactory interface +\n type: UIDS; \n method: CreateComponent; \n context: global \n +\n ACFNamespace name: com.avid.component.compositetypedefinition +\n UID String: +*/ + DEFINE_ACFUID( acfUID, ABOUT_BOX_GUID, 0x3c24cecc, 0xc6b, 0x4aec, 0xbd, 0x75, 0x1a, 0x56, 0xaf, 0x25, 0x16, 0xbe); +//@} End HostProvidedParams + + + + + + + /*! + \defgroup GuidBaseDatatTypes UIDS: Base Data Types + Definition ids for built-in types + */ + // +//@{ + + /*! + \defgroup GuidFundementalTypes UIDS: Fundamental Types + Definition ids for built-in type + */ + // + //@{ + /*! + \remarks Used to define a parameter of type acfUInt8 + \n type: UIDS; \n method: IAVXParameterDefinition; \n context: global \n + \n ACFNamespace name: + \n UID String: + */ + DEFINE_ACFUID(acfUID, ACFTypeID_UInt8, 0x7C62A3A4, 0x7103, 0x11D6, 0xA6, 0x63, 0x00, 0x30, 0x65, 0x8A, 0x65, 0x04); + + /*! + \remarks Used to define a parameter of type acfSInt8 + \n type: UIDS; \n method: IAVXParameterDefinition; \n context: global \n + \n ACFNamespace name: + \n UID String: + */ + DEFINE_ACFUID(acfUID, ACFTypeID_SInt8, 0x10AF7E67, 0x7103, 0x11D6, 0xA6, 0x63, 0x00, 0x30, 0x65, 0x8A, 0x65, 0x04); + + /*! + \remarks Used to define a parameter of type acfUInt16 + \n type: UIDS; \n method: IAVXParameterDefinition; \n context: global \n + \n ACFNamespace name: + \n UID String: + */ + DEFINE_ACFUID(acfUID, ACFTypeID_UInt16, 0x2C74B500, 0x7103, 0x11D6, 0xA6, 0x63, 0x00, 0x30, 0x65, 0x8A, 0x65, 0x04); + + /*! + \remarks Used to define a parameter of type acfSInt16 + \n type: UIDS; \n method: IAVXParameterDefinition; \n context: global \n + \n ACFNamespace name: + \n UID String: + */ + DEFINE_ACFUID(acfUID, ACFTypeID_SInt16, 0x30E1D692, 0x7103, 0x11D6, 0xA6, 0x63, 0x00, 0x30, 0x65, 0x8A, 0x65, 0x04); + + /*! + \remarks Used to define a parameter of type acfUInt32 + \n type: UIDS; \n method: IAVXParameterDefinition; \n context: global \n + \n ACFNamespace name: + \n UID String: + */ + DEFINE_ACFUID(acfUID, ACFTypeID_UInt32, 0x4EB1A950, 0x7103, 0x11D6, 0xA6, 0x63, 0x00, 0x30, 0x65, 0x8A, 0x65, 0x04); + + /*! + \remarks Used to define a parameter of type acfSInt32 + \n type: UIDS; \n method: IAVXParameterDefinition; \n context: global \n + \n ACFNamespace name: + \n UID String: + */ + DEFINE_ACFUID(acfUID, ACFTypeID_SInt32, 0x52B99EB7, 0x7103, 0x11D6, 0xA6, 0x63, 0x00, 0x30, 0x65, 0x8A, 0x65, 0x04); + + /*! + \warning This type is not yet supported + \remarks Used to define a parameter of type acfSInt64 + \n type: UIDS; \n method: IAVXParameterDefinition; \n context: global \n + \n ACFNamespace name: + \n UID String: + \warning This type is not yet supported + */ + DEFINE_ACFUID(acfUID, ACFTypeID_UInt64, 0x64E362FC, 0x7103, 0x11D6, 0xA6, 0x63, 0x00, 0x30, 0x65, 0x8A, 0x65, 0x04); + + /*! + \warning This type is not yet supported + \remarks Used to define a parameter of type acfSInt64 + \n type: UIDS; \n method: IAVXParameterDefinition; \n context: global \n + \n ACFNamespace name: + \n UID String: + \warning This type is not yet supported + */ + DEFINE_ACFUID(acfUID, ACFTypeID_SInt64, 0x68553414, 0x7103, 0x11D6, 0xA6, 0x63, 0x00, 0x30, 0x65, 0x8A, 0x65, 0x04); + + /*! + \warning This type is not yet supported + \remarks Used to define a parameter of type avx2Float + \n type: UIDS; \n method: IAVXParameterDefinition; \n context: global \n + \n ACFNamespace name: + \n UID String: + \warning This type is not yet supported + */ + DEFINE_ACFUID(acfUID, ACFTypeID_Float, 0x2C74B501, 0x7233, 0x11D6, 0xAC, 0xF3, 0x00, 0x30, 0x65, 0x8A, 0x65, 0x04); + + /*! + \remarks Used to define a parameter of type acfDouble + \n type: UIDS; \n method: IAVXParameterDefinition; \n context: global \n + \n ACFNamespace name: + \n UID String: + */ + DEFINE_ACFUID(acfUID, ACFTypeID_Double, 0xB6F8CE00, 0x7233, 0x11D6, 0xAC, 0xF3, 0x00, 0x30, 0x65, 0x8A, 0x65, 0x04); + + /*! + \remarks Used to define a enumerator of type acfBool.An acfBool can have the value kACFFalse or kACFTrue. + \n type: UIDS; \n method: IAVXParameterDefinition; \n context: global \n + \n ACFNamespace name: + \n UID String: + */ + DEFINE_ACFUID(acfUID, ACFTypeID_Boolean, 0x27A179D8, 0x7103, 0x11D6, 0x94, 0xF7, 0x00, 0x30, 0x65, 0x8A, 0x65, 0x04); + + /*! + \remarks Used to define a parameter of type acfChar + \n type: UIDS; \n method: IAVXParameterDefinition; \n context: global \n + \n ACFNamespace name: com.avid.component.type.char + \n UID String: f3f962a3-bb90-3e7d-afe4-8242bc3e4711 + */ + DEFINE_ACFUID(acfUID, ACFTypeID_Char, 0xf3f962a3, 0xbb90, 0x00af, 0xaf, 0xe4, 0x82, 0x42, 0xbc, 0x3e, 0x47, 0x11); + + /*! + \remarks Used to define a parameter of type acfUniChar + \n type: UIDS; \n method: IAVXParameterDefinition; \n context: global \n + \n ACFNamespace name: + \n UID String: + */ + DEFINE_ACFUID(acfUID, ACFTypeID_UniChar, 0x4E0677D6, 0x7293, 0x11D6, 0xB4, 0xE4, 0x00, 0x30, 0x65, 0x8A, 0x65, 0x04); + + + /*! + \remarks Used to define a parameter of type acfUID + \n type: UIDS; \n method: IAVXParameterDefinition; \n context: global \n + \n ACFNamespace name: + \n UID String: + */ + DEFINE_ACFUID(acfUID, ACFTypeID_UID, 0x905DBB84, 0x7104, 0x11D6, 0xAE, 0xD3, 0x00, 0x30, 0x65, 0x8A, 0x65, 0x04); + //@} End FundementalTypes + + /*! + \defgroup GuidStringTypes UIDS: String Types + \n \note String types are null terminated + */ + //@{ + + /*! + \remarks Used to define a unicode string parameters and definition attributes. + \n type: UIDS; \n method: IACFDefinition and subclasses; \n context: global \n + \n ACFNamespace name: + \n UID String: + */ + DEFINE_ACFUID(acfUID, ACFTypeID_UnicodeString, 0x40C6B9BA, 0x7103, 0x11D6, 0xBB, 0x30, 0x00, 0x30, 0x65, 0x8A, 0x65, 0x04); + + /*! + \remarks Used to define a parameter that acts as an ASCII string + \n type: UIDS; \n method: IAVXParameterDefinition; \n context: global \n + \n ACFNamespace name: + \n UID String: + */ + DEFINE_ACFUID(acfUID, ACFTypeID_ASCIIString, 0xbac7f4c7, 0x7eeb, 0x4898, 0xbe, 0x2c, 0x8, 0x5f, 0x7, 0x11, 0x3c, 0xc5); + + /*! + \remarks Used to define a UTF-8 encoded string parameter. + \n type: UIDS; \n method: IAVXParameterDefinition; \n context: global \n + \n ACFNamespace name: + \n UID String: + */ + DEFINE_ACFUID(acfUID, ACFTypeID_UTF8String, 0x219a99cc, 0x2c8b, 0x4224, 0x86, 0xfe, 0xc0, 0x57, 0x94, 0x5, 0x5e, 0x1d); + + /*! + \remarks Used to define a UTF-16 encoded string parameter. + \n type: UIDS; \n method: IAVXParameterDefinition; \n context: global \n + \n ACFNamespace name: + \n UID String: + */ + DEFINE_ACFUID(acfUID, ACFTypeID_UTF16String, 0xdd6a731e, 0x8ed1, 0x4d19, 0xa0, 0x96, 0x2b, 0xa, 0x69, 0x67, 0xc1, 0x3f); + //@} End StringTypes + + /*! + \defgroup PersistentGuidStringTypes UIDS: Private String Types + \n \note String types are null terminated + */ + //@{ + + /*! + \remarks Internal type that is used only by some host applications to persist ACFTypeID_UnicodeString parameters and definition attributes. + \n type: UIDS; \n method: IACFDefinition and subclasses; \n context: global \n + \n ACFNamespace name: + \warning A component may encounter this data type on older hosts that did not have any support for persisting ACFTypeID_UnicodeString + data. This type is reserved for host applications and should never be used in any definition by a plug-in. + Newer plug-ins should be written to either fail gracefully or convert the returned UTF8 as necessary. + */ + DEFINE_ACFUID(acfUID, ACFTypeID_WideStringPersistedAsUTF8, 0x72223182, 0xaa0a, 0x4c76, 0xba, 0x3d, 0xf8, 0x8c, 0x91, 0x8b, 0x67, 0xb5); + + /*! + \remarks Internal type that is used only by some host applications to persist ACFTypeID_UTF16String parameters and definition attributes. + \n type: UIDS; \n method: IACFDefinition and subclasses; \n context: global \n + \n ACFNamespace name: + \warning A component may encounter this data type on older hosts that did not have any support for persisting ACFTypeID_UTF16String + data. This type is reserved for host applications and should never be used in any definition by a plug-in. + Newer plug-ins should be written to either fail gracefully or convert the returned UTF8 as necessary. + */ + DEFINE_ACFUID(acfUID, ACFTypeID_UTF16StringPersistedAsUTF8, 0x3319f04a, 0xac69, 0x4525, 0xb9, 0xe8, 0x22, 0x6, 0x36, 0x2f, 0xd2, 0x33); + //@} End StringTypes + + /*! + \defgroup GuidArrayTypes UIDS: Array types + */ + //@{ + + /*! + \remarks Used to define a parameter that is an array of Uid's + \n type: UIDS; \n method: IAVXParameterDefinition; \n context: global \n + \n ACFNamespace name: + \n UID String: + */ + DEFINE_ACFUID(acfUID, ACFTypeID_UIDArray, 0xD2E8D2E4, 0x7963, 0x11D6, 0xB8, 0x7B, 0x00, 0x30, 0x65, 0x42, 0xA0, 0x24); + + /*! + \remarks Used to define a a user defined parameter. Byte swapping is the responsibility of plugin. + \n type: UIDS; \n method: IAVXParameterDefinition; \n context: global \n + \n ACFNamespace name: + \n UID String: + */ + DEFINE_ACFUID(acfUID, ACFTypeID_ByteArray, 0xC02F2CAA, 0x7293, 0x11D6, 0xB4, 0xE4, 0x00, 0x30, 0x65, 0x8A, 0x65, 0x04); + + /*! + \remarks Used to define a parameter that is an array of acfUInt16's + \n type: UIDS; \n method: IAVXParameterDefinition; \n context: global \n + \n ACFNamespace name: + \n UID String: + */ + DEFINE_ACFUID(acfUID, ACFTypeID_Int16Array, 0xF33C004C, 0x7963, 0x11D6, 0x88, 0x28, 0x00, 0x30, 0x65, 0x42, 0xA0, 0x24); + + /*! + \remarks Used to define a parameter that is an array of acfUInt32 's + \n type: UIDS; \n method: IAVXParameterDefinition; \n context: global \n + \n ACFNamespace name: + \n UID String: + */ + DEFINE_ACFUID(acfUID, ACFTypeID_Int32Array, 0x06576FE2, 0x7964, 0x11D6, 0xB7, 0x42, 0x00, 0x30, 0x65, 0x42, 0xA0, 0x24); + + /*! + \remarks Used to define a parameter that is an array of acfUInt64 + \n type: UIDS; \n method: IAVXParameterDefinition; \n context: global \n + \n ACFNamespace name: + \n UID String: + */ + DEFINE_ACFUID(acfUID, ACFTypeID_Int64Array, 0x2F64D88A, 0x7964, 0x11D6, 0x84, 0x4F, 0x00, 0x30, 0x65, 0x42, 0xA0, 0x24); + + /*! + \remarks Used to define a parameter that is an array of acfFloat + \n type: UIDS; \n method: IAVXParameterDefinition; \n context: global \n + \n ACFNamespace name: + \n UID String: 5FFF159C-C1F0-4093-B701-02AA4ACE2FD5 + */ + DEFINE_ACFUID(acfUID, ACFTypeID_FloatArray, 0x5fff159c, 0xc1f0, 0x4093, 0xb7, 0x1, 0x2, 0xaa, 0x4a, 0xce, 0x2f, 0xd5); + + /*! + \remarks Used to define a parameter that is an array of acfFloat + \n type: UIDS; \n method: IAVXParameterDefinition; \n context: global \n + \n ACFNamespace name: + \n UID String: E1C94795-A4EB-46a0-8132-9085C235079A + */ + DEFINE_ACFUID(acfUID, ACFTypeID_DoubleArray, 0xe1c94795, 0xa4eb, 0x46a0, 0x81, 0x32, 0x90, 0x85, 0xc2, 0x35, 0x7, 0x9a); + + /*! + \remarks Used to define a parameter that is an array of acfBool + \n type: UIDS; \n method: IAVXParameterDefinition; \n context: global \n + \n ACFNamespace name: + \n UID String: C6B68935-3015-4ecd-B7BA-1750295DE9A8 + */ + DEFINE_ACFUID(acfUID, ACFTypeID_BooleanArray, 0xc6b68935, 0x3015, 0x4ecd, 0xb7, 0xba, 0x17, 0x50, 0x29, 0x5d, 0xe9, 0xa8); + + //@} end ArrayTypes + + + /*! + \defgroup GuidSpecialTypes UIDS: Specialized Types + */ + //@{ + + /*! + \remarks Used to define a value of type acfPoint + \n type: acfPoint \n method: IACFValue; \n context: global \n + \n UID String: ddf6e71d-f596-3b6a-b47b-1de3e6fc1710 + */ + DEFINE_ACFUID(acfUID, ACFTypeID_Point, 0xddf6e71d, 0xf596, 0x3b6a, 0xb4, 0x7b, 0x1d, 0xe3, 0xe6, 0xfc, 0x17, 0x10); + + /*! + \remarks Used to define a value of type acfRect + \n type: acfRect \n method: IACFValue; \n context: global \n + \n UID String: 6c64c82c-3941-36c4-a8bb-c6c1caa15313 + */ + DEFINE_ACFUID(acfUID, ACFTypeID_Rect, 0x6c64c82c, 0x3941, 0x36c4, 0xa8, 0xbb, 0xc6, 0xc1, 0xca, 0xa1, 0x53, 0x13); + + /*! + \remarks Used to define a value of type acfSize + \n type: acfSize \n method: IACFValue; \n context: global \n + \n UID String: abc15b28-60fa-371e-a9ea-95edbe1f9ebd + */ + DEFINE_ACFUID(acfUID, ACFTypeID_Size, 0xabc15b28, 0x60fa, 0x371e, 0xa9, 0xea, 0x95, 0xed, 0xbe, 0x1f, 0x9e, 0xbd); + + /*! + \remarks Used to define a value of type acfRational32 + \n type: acfRational32 \n method: IACFValue; \n context: global \n + \n UID String: a73f3bf4-1d20-3d0e-a328-024e8d5ad043 + */ + DEFINE_ACFUID(acfUID, ACFTypeID_Rational32, 0xa73f3bf4, 0x1d20, 0x3d0e, 0xa3, 0x28, 0x02, 0x4e, 0x8d, 0x5a, 0xd0, 0x43); + + /*! + \remarks Used to define a value of type acfRational64 + \n type: acfRational64 \n method: IACFValue; \n context: global \n + \n UID String: 25eff40a-ec3d-319e-8c53-a21debd06ea9 + */ + DEFINE_ACFUID(acfUID, ACFTypeID_Rational64, 0x25eff40a, 0xec3d, 0x319e, 0x8c, 0x53, 0xa2, 0x1d, 0xeb, 0xd0, 0x6e, 0xa9); + + /*! + \remarks Used to define a parameter of type avx2Point + \n type: UIDS; \n method: IAVXParameterDefinition; \n context: global \n + \n ACFNamespace name: + \n UID String: + */ + DEFINE_ACFUID(acfUID, ACFTypeID_Point2D, 0x79B43006, 0x7971, 0x11D6, 0xB1, 0x42, 0x00, 0x30, 0x65, 0x42, 0xA0, 0x24); + + /*! + \remarks Used to define a parameter of type avx2Rect + \n type: UIDS; \n method: IAVXParameterDefinition; \n context: global \n + \n ACFNamespace name: + \n UID String: + */ + DEFINE_ACFUID(acfUID, ACFTypeID_Rect2D, 0x849C0848, 0x7971, 0x11D6, 0xB5, 0x20, 0x00, 0x30, 0x65, 0x42, 0xA0, 0x24); + + /*! + \remarks Used to define a color parameter of type avx2RGB + \n type: UIDS; \n method: IAVXParameterDefinition; \n context: global \n + \n ACFNamespace name: + \n UID String: + */ + DEFINE_ACFUID(acfUID, ACFTypeID_ColorRGB, 0xAA3FDAF4, 0x7971, 0x11D6, 0x87, 0x93, 0x00, 0x30, 0x65, 0x42, 0xA0, 0x24); + + /*! + \remarks Used to define a color parameter of type avx2HSV + \n type: UIDS; \n method: IAVXParameterDefinition; \n context: global \n + \n ACFNamespace name: + \n UID String: + */ + DEFINE_ACFUID(acfUID, ACFTypeID_ColorHSV, 0xBB2476BF, 0x7971, 0x11D6, 0xAF, 0xA7, 0x00, 0x30, 0x65, 0x42, 0xA0, 0x24); + + /*! + \remarks Used to define a parameter that is a Unicode list of strings. + \n type: UIDS; \n method: IAVXParameterDefinition; \n context: global \n + \n ACFNamespace name: + \n UID String: + \warning Not supported. + \todo support for UnicodeList Type + */ + DEFINE_ACFUID(acfUID, ACFTypeID_UnicodeList, 0x10BCD509, 0x7972, 0x11D6, 0xA3, 0xA2, 0x00, 0x30, 0x65, 0x42, 0xA0, 0x24); + + /*! + \remarks Used to define a parameter that acts as a trigger to a dialog. This parameter will always + appear as a button. The button launches a modal UI, such as an about box. + \n type: UIDS; \n method: IAVXParameterDefinition; \n context: global \n + \n ACFNamespace name: + \n UID String: + + */ + // This needs a string format - it has not been generated from a string + DEFINE_ACFUID(acfUID, ACFTypeID_DialogTrigger, 0x3f420350, 0x38b, 0x48e7, 0xbe, 0x92, 0x73, 0x5e, 0xe2, 0x60, 0xe8, 0xde); + + /*! + \remarks Used to initialize a acfUID to NULL + \n type: UIDS; \n method: any; \n context: global \n + \n ACFNamespace name: none + */ + DEFINE_ACFUID(acfUID, acfUID_NULL, 0L, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + + //@} end SpecialTypes + +//@} end BaseDatatTypes + + + /* + \defgroup GuidStandardLayerGUIDs UIDS: Layer Attributes + */ +//@{ + + /*! + \remarks Used to define a parameter of type acfUID + \n type: UIDS; \n method: IAVXParameterDefinition; \n context: global \n + \n ACFNamespace name: + \n UID String: + */ + DEFINE_ACFUID(acfUID, ACFLayerID_Input, 0x1867872a, 0xda5c, 0x4192, 0xab, 0xea, 0xac, 0x39, 0xa4, 0x5f, 0x2b, 0x8a); + + /*! + \remarks Used to define a parameter of type acfUID + \n type: UIDS; \n method: IAVXParameterDefinition; \n context: global \n + \n ACFNamespace name: + \n UID String: + */ + DEFINE_ACFUID(acfUID, ACFLayerID_Output, 0x1867872b, 0xda5c, 0x4192, 0xab, 0xea, 0xac, 0x39, 0xa4, 0x5f, 0x2b, 0x8a); + + /*! + \remarks Used to define a parameter of type acfUID + \n type: UIDS; \n method: IAVXParameterDefinition; \n context: global \n + \n ACFNamespace name: + \n UID String: + */ + DEFINE_ACFUID(acfUID, ACFLayerID_Foreground, 0x1867872c, 0xda5c, 0x4192, 0xab, 0xea, 0xac, 0x39, 0xa4, 0x5f, 0x2b, 0x8a); + + /*! + \remarks Used to define a parameter of type acfUID + \n type: UIDS; \n method: IAVXParameterDefinition; \n context: global \n + \n ACFNamespace name: + \n UID String: + */ + DEFINE_ACFUID(acfUID, ACFLayerID_Background, 0x1867872d, 0xda5c, 0x4192, 0xab, 0xea, 0xac, 0x39, 0xa4, 0x5f, 0x2b, 0x8a); + + /*! + \remarks Used to define a parameter of type acfUID + \n type: UIDS; \n method: IAVXParameterDefinition; \n context: global \n + \n ACFNamespace name: + \n UID String: + */ + DEFINE_ACFUID(acfUID, ACFLayerID_Mask, 0x1867872e, 0xda5c, 0x4192, 0xab, 0xea, 0xac, 0x39, 0xa4, 0x5f, 0x2b, 0x8a); + + /*! + \remarks Used to define a parameter of type acfUID + \n type: UIDS; \n method: IAVXParameterDefinition; \n context: global \n + \n ACFNamespace name: + \n UID String: + */ + DEFINE_ACFUID(acfUID, ACFLayerID_Source, 0x1867872f, 0xda5c, 0x4192, 0xab, 0xea, 0xac, 0x39, 0xa4, 0x5f, 0x2b, 0x8a); + + //@} end StandardLayerGUIDs + + + + /* + \defgroup StandardInputOutput UIDS: GUIDs Input and Output data types + */ + //@{ + + /*! + \remarks This identifier Used to access image data from an IAVXEffectContext acfUID + \n type: IAVXImageInput; \n method: IAVXEffectContext::GetInput; \n context: IAVXRenderContext::Render \n + \n ACFNamespace name: + \n UID String: 6B8C6DB2-4B6F-497f-AB9B-AF2635CD7538 + */ + DEFINE_ACFUID(acfUID, AVXInputTypeID_Image, 0x4abd6f8b, 0xf4d6, 0x47ff, 0xa2, 0x13, 0x70, 0x6e, 0x37, 0xa5, 0xe5, 0xec); + + /*! + \remarks This identifier Used to Timecode data + \n type: IAVXTimeCodeInformateion; \n method: IAVXInput::GetInpute; \n context: IAVXRenderContext::Render \n + \n ACFNamespace name: + \n UID String: 04D8E7A8-EE65-4525-BD6D-EF8E9BA28C2A + */ + DEFINE_ACFUID(acfUID, AVXInputTypeID_TimeCode, 0x4d8e7a8, 0xee65, 0x4525, 0xbd, 0x6d, 0xef, 0x8e, 0x9b, 0xa2, 0x8c, 0x2a ); + + /*! + \remarks This identifier Used to BinInformation data + \n type: IAVXBinInformateion; \n method: IAVXInput::GetInput; \n context: IAVXRenderContext::Render \n + \n ACFNamespace name: + \n UID String: // 1C1B7D33-793B-4260-891A-A904F13C2735 + */ + DEFINE_ACFUID(acfUID, AVXInputTypeID_BinInformation, 0x1c1b7d33, 0x793b, 0x4260, 0x89, 0x1a, 0xa9, 0x4, 0xf1, 0x3c, 0x27, 0x35); + + /*! + \remarks This identifier Used to access image data from an IAVXOutput acfUID + \n type: IAVXImage; \n method: IAVXOutput::GetOutput; \n context: IAVXRenderContext::Render \n + \n ACFNamespace name: + \n UID String: A3F7AE7E-4DA7-4c20-851E-4736E86E705E + */ + DEFINE_ACFUID(acfUID, AVXOutputTypeID_Image, 0xa3f7ae7e, 0x4da7, 0x4c20, 0x85, 0x1e, 0x47, 0x36, 0xe8, 0x6e, 0x70, 0x5e); + + + //@} end StandardInputOutputGUIDs + + + +/*! + \defgroup ParameterAttributes UIDS: Parameter Attributes + */ +//@{ + /*! + \remarks This attribute defines the behavior of the keyframe system in use by the parameter. + It Used to specify whether the parameter to be created is animateable or static (non-animatable) + Static will be a non interpolated parameter.default is kAVXKeyFrameBehavior_Animateable. + \n type: avx2KeyFrameBehavior; \n method: IAVXParameterDefinition; \n context: parameter definition \n + \n ACFNamespace name: + \n UID String: {6E10012D-2164-438b-8755-E62EE434040E} + */ + DEFINE_ACFUID(acfUID, AVXTypeID_KeyframeBehavior, 0x6e10012d, 0x2164, 0x438b, 0x87, 0x55, 0xe6, 0x2e, 0xe4, 0x34, 0x4, 0xe); + + + /*! + \remarks iCoordinate behavior Used to define the translation in 2+D space that is required. + \n type: acfUInt32; \n method: IAVXParameterDefinition; \n context: parameter definition \n + \n ACFNamespace name: + \n UID String: + */ + DEFINE_ACFUID(acfUID, AVXTypeID_CoordinateBehavior,0x6961da11, 0x873a, 0x47f2, 0xb9, 0x8a, 0x8a, 0x9c, 0x5e, 0xab, 0x52, 0xb8); + + + /*! + \remarks The guid that explicitly defines the parameters type. + \n type: UIDS; \n method: IAVXParameterDefinition; \n context: parameter definition \n + \n ACFNamespace name: + \n UID String: + \internal \todo rename assure it goes to the date type + */ + DEFINE_ACFUID(acfUID, ACFATTR_ParamDefinition_DataTypeID, 0xa9eec91, 0xab42, 0x45c0, 0x81, 0x24, 0xf0, 0xa6, 0xe6, 0x73, 0x82, 0xb1 ); + + + /*! + \remarks The keyframe behavior. + \n type: UIDS; \n method: IAVXParameterDefinition; \n context: parameter definition \n + \n ACFNamespace name: + \n UID String: + */ + DEFINE_ACFUID(acfUID, ACFATTR_ParamDefinition_KeyframeBehavior, 0xb444d868, 0x706e, 0x47e4, 0xbe, 0xe5, 0xaa, 0xff, 0x77, 0xf4, 0xc1, 0x2d ); + + + DEFINE_ACFUID(acfUID, ACFATTR_ParamDefinition_KeyframeInterpolation, 0xaa341317, 0x3697, 0x4ce1, 0xa6, 0xd6, 0x66, 0xce, 0xdd, 0x41, 0xd3, 0x4e); + // {AA341317-3697-4ce1-A6D6-66CEDD41D34E} + DEFINE_ACFUID(acfUID, ACFATTR_ParamDefinition_KeyframeExtrapolation, 0x4c34a0a6, 0xb29c, 0x49b6, 0xa1, 0xe5, 0xd5, 0x62, 0x84, 0xf, 0xbf, 0xf4); + // {4C34A0A6-B29C-49b6-A1E5-D562840FBFF4} + + + /*! + \remarks The coordinate behavior. + \n type: UIDS; \n method: IAVXParameterDefinition; \n context: parameter definition \n + \n ACFNamespace name: + \n UID String: + */ + DEFINE_ACFUID(acfUID, ACFATTR_ParamDefinition_CoordinateBehavior,0x767eba2d, 0x375d, 0x47c7, 0xba, 0xbd, 0x66, 0x96, 0xa3, 0x3e, 0x6f, 0xb ); + + + /*! + \remarks Used to specify the default value of the parameter + \n type: as defined by ACFATTR_ParamDefinition_DataTypeID \n method: IAVXParameterDefinition; \n context: parameter definition \n + \n AVX Namespace name: com.avid.fx.param.attr.default + \n UID String: + */ + DEFINE_ACFUID(acfUID, ACFATTR_ParamDefinition_Default, 0xbd3bfeeb, 0x042d, 0x3aae, 0xbf, 0x21, 0x70, 0xeb, 0xc7, 0x46, 0x46, 0xa8 ); + +/*! + \remarks specifies the minimum value of the parameter. + \n type: as defined by ACFATTR_ParamDefinition_DataTypeID \n method: IAVXParameterDefinition, IAVXLayoutDefinition. \n context: parameter definition \n + \n AVX Namespace name: com.avid.fx.param.attr.minimum + \n UID String: + \internal \todo The minimum value for a layout and a parameter are independent. The range can vary. + */ +DEFINE_ACFUID(acfUID, ACFATTR_ParamDefinition_Minimum, 0x81864ee2, 0xa3f1, 0x3235, 0x90, 0xc6, 0x1b, 0x16, 0x51, 0xf0, 0x3b, 0xf5 ); + +/*! + \remarks specifies the maximum value of the parameter. + \n type: as defined by ACFATTR_ParamDefinition_DataTypeID \n method: IAVXParameterDefinition; \n context: parameter definition \n + \n ACFNamespace name: com.avid.fx.param.attr.maximum + \n UID String: + \internal \todo The minimum value for a layout and a parameter are independent. The range can vary. + */ +DEFINE_ACFUID(acfUID, ACFATTR_ParamDefinition_Maximum, 0xf41f6e7c, 0x34d5, 0x3f4f, 0xb3, 0xff, 0xab, 0x02, 0xaf, 0x32, 0xae, 0x63 ); + +/*! + \remarks Used to define the step value of a UI widget + \n type: as defined by ACFATTR_ParamDefinition_DataTypeID \n method: IAVXParameterDefinition; \n context: parameter definition \n + \n ACFNamespace name: com.avid.fx.param.attr.increment + \n UID String: + The default is 1.0. It is used to define the stepping value of a slider. You can use it to set the stepping value of a slider or UI widget. + For example a value of 0.1 on a slider with a range from 0-100 will Have slider drag the slider with values 20.1, 20.2 ... as opposed to a default of 1.0 where the values would go 20.0, 21.0, 22.0 .... A value of 2.0 would go 20, 22, 24 etc. + */ +DEFINE_ACFUID(acfUID, ACFATTR_ParamDefinition_Increment, 0xf1faf361, 0x73c1, 0x3129, 0xb3, 0x2b, 0x34, 0x75, 0x7a, 0x23, 0x65, 0xd5 ); + +/*! + \remarks Used to define a multiplier that remaps a UI value. For example a parameter may represent a value that ranges from 0-1. The UI may represent the value different by using this multiplier + \n type: acfDouble \n method: IAVXParameterDefinition; \n context: parameter definition \n + \n AVX Namespace name: com.avid.fx.param.attr.uiremap + \n UID String: 1a47fb2d-ef70-338e-b7bf-e824cee15284 + */ +DEFINE_ACFUID(acfUID, ACFATTR_ParamDefinition_UIRemap, 0x1a47fb2d, 0xef70, 0x338e, 0xb7, 0xbf, 0xe8, 0x24, 0xce, 0xe1, 0x52, 0x84 ); + +/*! + \remarks Used to define the precision to display the UI value. This optional attribute + Used to override the display precision for double parameters. This is valid to 0 to display double parameters as integers. + A special value of -1 (the default) indicates that the host should use its standard precision for displaying doubles. + \n type: acfSInt32 \n method: IAVXParameterDefinition; \n context: parameter definition \n + \n AVX Namespace name: com.avid.fx.param.attr.uiprecision + \n UID String: 83bcd82e-133d-3b08-82b6-cd45ca5f7424 + */ +DEFINE_ACFUID(acfUID, ACFATTR_ParamDefinition_UIPrecision, 0x83bcd82e, 0x133d, 0x0082, 0x82, 0xb6, 0xcd, 0x45, 0xca, 0x5f, 0x74, 0x24 ); + +/*! + \remarks Used to define the mapping of the structure members to the default layout order for built-in Point2D, Rect2D, ColorHSV and ColorRGB. + \note To be compatible with the layouts for AVX 1.x parameters the values for the built-in types are + - Point2D: {0, 1}, + - Rect2D : {1, 0, 3, 2}, + - ColorHSV : {0, 1, 2}, and + - ColorRGB : {0, 1, 2}. + \n type: Int32Array \n method: IAVXParameterDefinition; \n context: parameter definition \n + \n AVX Namespace name: com.avid.fx.param.attr.defaultcomponentorder + \n UID String: 27995d37-50aa-36ec-b458-089602dcb96d + */ +DEFINE_ACFUID(acfUID, ACFATTR_ParamDefinition_DefaultComponentOrder, 0x27995d37, 0x50aa, 0x00b4, 0xb4, 0x58, 0x08, 0x96, 0x02, 0xdc, 0xb9, 0x6d ); + +/*! + \remarks Used to define a silent parameter. Changing such a parameter value will not invalidate an existing render. + \n type: Boolean \n method: IAVXParameterDefinition; \n context: parameter definition \n + \n AVX Namespace name: + \n UID String: C38E4D31-42A1-4d8f-9580-CA8326597EEA + */ +DEFINE_ACFUID(acfUID, ACFATTR_ParamDefinition_Silent, 0xc38e4d31, 0x42a1, 0x4d8f, 0x95, 0x80, 0xca, 0x83, 0x26, 0x59, 0x7e, 0xea ); + +/*! +\remarks Used to define a transient parameter. Transient parameters are non-persistent and silent. +\warning Do not store any pointers in transient parameters. +\n type: Boolean \n method: IAVXParameterDefinition; \n context: parameter definition \n +\n AVX Namespace name: +\n UID String: 72CFF9FA-4EC9-435c-B82A-BEC4B6452E59 +*/ +DEFINE_ACFUID(acfUID, ACFATTR_ParamDefinition_Transient, 0x72cff9fa, 0x4ec9, 0x435c, 0xb8, 0x2a, 0xbe, 0xc4, 0xb6, 0x45, 0x2e, 0x59 ); + +/*! + \remarks A hidden parameter that indicates whether or not an effect internally uses an accumulation buffer so that the results of one frame depend on the results of previous frames. + A True value signifies that the effect must always be fully rendered in one atomic operation, while a False value (the default) means the effect is allowed to be partially rendered. + \note FX should not create this parameter themselves, but only get access to it via a "find" or "get" mechanism instead. + \n type: Boolean \n method: IAVXParameterDefinition; \n context: parameter definition \n + \n AVX Namespace name: + \n UID String: B5D3B187-84A9-46EC-B5D3-D77CE2632873 +*/ +DEFINE_ACFUID(acfUID, ACFATTR_ParamDefinition_NeedAccumulationBuffer, 0xb5d3b187, 0x84a9, 0x46ec, 0xb5, 0xd3, 0xd7, 0x7c, 0xe2, 0x63, 0x28, 0x73 ); + +/*! + \remarks An Attribute, specified by a parameter to use an enabler button with provided by the host. + \n type: acfBoolen or type specificed by ACFATTR_LayoutDefinition_EnablerDefault; \n method: IAVXLayoutDefinition; \n context: layout definition \n + \n AVX Namespace name: com.avid.fx.layout.attr.enabler + \n UID String: D3306718-7B0A-4af3-85D6-CAE0D4F100F3 + */ +DEFINE_ACFUID(acfUID, ACFATTR_LayoutDefinition_Enabler, 0xd9597d01, 0x641f, 0x00b7, 0xb7, 0xcc, 0xf4, 0xe1, 0x4f, 0x5a, 0x82, 0xff ); + +/*! + \remarks An Attribute, specified for a group layout to be be initially open. + \n type: acfBool; \n method: IAVXLayoutDefinition; \n context: layout definition \n + \n AVX Namespace name: com.avid.fx.layout.attr.autoopen + \n UID String: 3ce128c3-4efd-32d8-a282-d678b150f419 + */ +DEFINE_ACFUID(acfUID, ACFATTR_LayoutDefinition_AutoOpen, 0x3ce128c3, 0x4efd, 0x00a2, 0xa2, 0x82, 0xd6, 0x78, 0xb1, 0x50, 0xf4, 0x19 ); + +/*! + \remarks An Attribute, specified for a group layout to be be initially open. + \n type: acfBool; \n method: IAVXLayoutDefinition; \n context: layout definition \n + \n AVX Namespace name: com.avid.fx.layout.attr.textbelow + \n UID String: fc03f25f-39c5-3044-82e7-cbb20245e54e + */ +DEFINE_ACFUID(acfUID, ACFATTR_LayoutDefinition_TextBelow, 0xfc03f25f, 0x39c5, 0x0082, 0x82, 0xe7, 0xcb, 0xb2, 0x02, 0x45, 0xe5, 0x4e ); + +/*! +\remarks An Attribute, specified for a layout to be be initially hidden. +\n type: acfBool; \n method: IAVXLayoutDefinition; \n context: layout definition \n +\n UID String: 1C0D5318-6035-4b4c-831B-DF71E3BD5152 +*/ +DEFINE_ACFUID(acfUID, ACFATTR_LayoutDefinition_Hidden, 0x1c0d5318, 0x6035, 0x4b4c, 0x83, 0x1b, 0xdf, 0x71, 0xe3, 0xbd, 0x51, 0x52 ); + +/* +\remarks Defining this attribute specifies the default for the enabler of this parameter. +\n If a default is not specified for an enabler, it is assumed to false. +\n type: acfBoolean; \n method: IAVXLayoutDefinition; \n context: parameter definition \n +\n UID String: 8FFF1ACF-187B-45cb-85D0-CEDC576CC77B +*/ +DEFINE_ACFUID(acfUID, ACFATTR_LayoutDefinition_EnablerDefault, 0x8fff1acf, 0x187b, 0x45cb, 0x85, 0xd0, 0xce, 0xdc, 0x57, 0x6c, 0xc7, 0x7b); + +//@} end ParameterAttributes + + + +/*! + \defgroup Widgets UIDS: Widgets and User Interface + \brief view ID's for defining the widget used in defining the layout +*/ + +//@{ + +/* + \remarks Used to define a layout that uses the described widget + \n type: UIDS; \n method: IAVXLayoutDefinition; \n context: layout \n + \n AVX Namespace name: com.avid.fx.layout.widget.std.slider + \n UID String: +*/ +DEFINE_ACFUID(acfUID, ACF_WIDGET_SLIDER, 0xb456be51, 0x430d, 0x00a9, 0xa9, 0x0e, 0x02, 0x31, 0xcf, 0x96, 0x42, 0x91); + +/* + \remarks Used to define a layout that uses the described widget + \n type: UIDS; \n method: IAVXLayoutDefinition; \n context: layout \n + \n AVX Namespace name: com.avid.fx.layout.widget.std.angle + \n UID String: +*/ +DEFINE_ACFUID(acfUID, ACF_WIDGET_ANGLE, 0xb637ee40, 0x7a41, 0x009f, 0x9f, 0x8d, 0x01, 0x7d, 0x92, 0x62, 0xe8, 0x05); + +/* + \remarks Used to define a layout that uses the described widget + \n type: UIDS; \n method: IAVXLayoutDefinition; \n context: layout \n + \n AVX Namespace name: com.avid.fx.layout.widget.std.treadmill + \n UID String: +*/ +DEFINE_ACFUID(acfUID, ACF_WIDGET_TREADMILL, 0x0939e237, 0xd8b8, 0x0083, 0x83, 0x57, 0xab, 0x47, 0x49, 0x40, 0xba, 0x18); + +/* + \remarks Used to define a layout that uses the described widget + \n type: UIDS; \n method: IAVXLayoutDefinition; \n context: layout \n + \n ACFNamespace name: com.avid.fx.layout.widget.std.checkbox + \n UID String: +*/ +DEFINE_ACFUID(acfUID, ACF_WIDGET_CHECKBOX, 0xdfdcd5ca, 0x1e9a, 0x00b0, 0xb0, 0x01, 0xdf, 0xed, 0x26, 0xbe, 0xde, 0x85); + +/* + \remarks Used to define a layout that uses the described widget + \n type: UIDS; \n method: IAVXLayoutDefinition; \n context: layout \n + \n AVX Namespace name: com.avid.fx.layout.widget.std.button + \n UID String: +*/ +DEFINE_ACFUID(acfUID, ACF_WIDGET_BUTTON, 0x940d8d3a, 0x730c, 0x00a6, 0xa6, 0x84, 0xb9, 0x14, 0xc5, 0x20, 0xa2, 0xfb); + + +/*! + \remarks Used to define a layout that uses the described widget + \n type: UIDS; \n method: IAVXLayoutDefinition; \n context: layout \n + \n ACFNamespace name: com.avid.fx.layout.widget.std.listbox + \n UID String: f22bc77f-0e0a-34a7-b0a5-3efae9efa7e1 + +*/ +DEFINE_ACFUID(acfUID, ACF_WIDGET_LISTBOX, 0xf22bc77f, 0x0e0a, 0x00b0, 0xb0, 0xa5, 0x3e, 0xfa, 0xe9, 0xef, 0xa7, 0xe1); + +/*! + \remarks Used to define a layout that uses the described widget + \n type: UIDS; \n method: IAVXLayoutDefinition; \n context: layout \n + \n ACFNamespace name: com.avid.fx.layout.widget.std.colorpicker + \n UID String: +*/ +DEFINE_ACFUID(acfUID, ACF_WIDGET_COLORPICKER, 0xb953fb71, 0xc56c, 0x0080, 0x80, 0x0a, 0xb5, 0xa8, 0x2f, 0xc0, 0xcf, 0x53); + +/*! + \remarks Used to define a layout that uses the described widget + \n type: UIDS; \n method: IAVXLayoutDefinition; \n context: layout \n + \n ACFNamespace name: com.avid.fx.layout.widget.std.rgbpicker + \n UID String: 9d2fdae5-cbc5-3ee8-b384-1bbbcefe5bd8 +*/ +DEFINE_ACFUID(acfUID, ACF_WIDGET_RGBPICKER, 0x9d2fdae5, 0xcbc5, 0x00b3, 0xb3, 0x84, 0x1b, 0xbb, 0xce, 0xfe, 0x5b, 0xd8); + +/*! + \remarks Used to define a layout that uses the described widget + \n type: UIDS; \n method: IAVXLayoutDefinition; \n context: layout \n + \n ACFNamespace name: com.avid.fx.layout.widget.std.listitem + \n UID String: 1e2edea8-3314-3a90-b03b-f3c9c211d57a +*/ +DEFINE_ACFUID(acfUID, ACF_WIDGET_LISTITEM, 0x1e2edea8, 0x3314, 0x00b0, 0xb0, 0x3b, 0xf3, 0xc9, 0xc2, 0x11, 0xd5, 0x7a); + +/*! + \remarks Used to define a layout that uses the described widget + \n type: UIDS; \n method: IAVXLayoutDefinition; \n context: layout \n + \n ACFNamespace name: com.avid.fx.layout.widget.std.hsvpicker + \n UID String: dff4738b-272c-3f49-88a1-4490cc657297 +*/ +DEFINE_ACFUID(acfUID, ACF_WIDGET_HSVPICKER, 0xdff4738b, 0x272c, 0x0088, 0x88, 0xa1, 0x44, 0x90, 0xcc, 0x65, 0x72, 0x97); + +/*! + \remarks Used to define a layout that uses the described widget + \n type: UIDS; \n method: IAVXLayoutDefinition; \n context: layout \n + \n ACFNamespace name: com.avid.fx.layout.widget.std.lumaslider + \n UID String: d238ff99-2cd7-370c-9da6-4fda5fd4b3b7 +*/ +DEFINE_ACFUID(acfUID, ACF_WIDGET_LUMASLIDER, 0xd238ff99, 0x2cd7, 0x009d, 0x9d, 0xa6, 0x4f, 0xda, 0x5f, 0xd4, 0xb3, 0xb7); + + +/*! +\remarks Used to define a layout that uses the described widget +\n type: UIDS; \n method: IAVXLayoutDefinition; \n context: layout \n +\n ACFNamespace name: com.avid.fx.layout.widget.std.editbox +\n UID String: 625675dc-eba5-345e-8460-77b262998442 +*/ +DEFINE_ACFUID(acfUID, ACF_WIDGET_EDITBOX, 0x625675dc, 0xeba5, 0x0084, 0x84, 0x60, 0x77, 0xb2, 0x62, 0x99, 0x84, 0x42); + +/*! +\remarks Used to define a layout that uses the keyframe graph for animateable custom data +\n type: UIDS; \n method: IAVXLayoutDefinition; \n context: layout \n +\n ACFNamespace name: com.avid.fx.layout.widget.std.customdatagraph +\n UID Byte Array: +*/ +DEFINE_ACFUID(acfUID, ACF_CUSTOM_DATAGRAPH, 0x46bc527e, 0x02ab, 0x341a, 0x82, 0xac, 0xf9, 0xf5, 0x78, 0x6c, 0xd2, 0xad); + +/*! +\remarks Used to define a layout that uses the described widget +\n type: UIDS; \n method: IAVXLayoutDefinition; \n context: layout \n +\n ACFNamespace name: com.avid.fx.layout.widget.std.numericaleditbox +\n UID String: 1DFFE390-B178-455A-8B3F-08BEEFFF430F +*/ +DEFINE_ACFUID(acfUID, ACF_WIDGET_NUMERICALEDITBOX, 0x1dffe390, 0xb178, 0x455a, 0x8b, 0x3f, 0x8, 0xbe, 0xef, 0xff, 0x43, 0xf); +//@} + +/*! +\defgroup Keyframe_Interpolator_UIDs UIDS: Keyframe Interpolation and Extrapolation UIDs +\brief view ID's for defining the keyframe interpolation and extrapolation behavior +*/ + +//@{ + +/*! +\remarks Used when no keyframe interpolation has been defined. +\n type: UIDS; \n method: IAVXAnimateableParameter; \n context: IAVXAnimateableParameter \n +\n ACFNamespace name: Because these id's match the AAF specification there is no predefined ACFNamespace +\note The UIDS is equivalent to AAF's \e aafUID_tNoInterpolator +*/ +DEFINE_ACFUID( acfUID, AVXInterpID_None, 0x5B6C85A3, 0x0EDE, 0x11d3, 0x80, 0xA9, 0x00, 0x60, 0x08, 0x14, 0x3E, 0x6F ); + +/*! + \remarks used when the parameter value between keyframes is help constant based on the closest key in time. +\ note AVXInterpID_Constant provides the same behavior as a static parameter. +\n type: UIDS; \n method: IAVXAnimateableParameter; \n context: IAVXAnimateableParameter \n +\n ACFNamespace name: Because these id's match the AAF specification there is no predefined ACFNamespace +\note The UIDS is equivalent to AAF's \e aafUID_tConstantInterpolator +*/ +DEFINE_ACFUID( acfUID, AVXInterpID_Constant, 0x5B6C85A5, 0x0EDE, 0x11d3, 0x80, 0xA9, 0x00, 0x60, 0x08, 0x14, 0x3E, 0x6F ); + +/*! +\remarks defines values between keys to be calculated by the equation for a line: y=mx+b +\n type: UIDS; \n method: IAVXAnimateableParameter; \n context: IAVXAnimateableParameter \n +\n ACFNamespace name: Because these id's match the AAF specification there is no predefined ACFNamespace +\note The UIDS is equivalent to AAF's \e aafUID_tLineraInterpolator +*/ +DEFINE_ACFUID( acfUID,AVXInterpID_Linear, 0x5B6C85A4, 0x0EDE, 0x11d3, 0x80, 0xA9, 0x00, 0x60, 0x08, 0x14, 0x3e, 0x6f ); + +/*! +\remarks defines values between two keyframes to be calculated base on a the equation for a cubic spline. +\n type: UIDS; \n method: IAVXAnimateableParameter; \n context: IAVXAnimateableParameter \n +\n ACFNamespace name: Because these id's match the AAF specification there is no predefined ACFNamespace +\note The UIDS is equivalent to AAF's \e aafUID_tAvidCubicInterpolator +*/ +DEFINE_ACFUID(acfUID,AVXInterpID_Cubic, 0xa04a5439, 0x8a0e, 0x4cb7, 0x97, 0x5f, 0xa5, 0xb2, 0x55, 0x86, 0x68, 0x83 ); + +/*! +\remarks defines values between two keyframes to be calculated base on a the equation for a bezier curve. +\n type: UIDS; \n method: IAVXAnimateableParameter; \n context: IAVXAnimateableParameter \n +\n ACFNamespace name: Because these id's match the AAF specification there is no predefined ACFNamespace +\note The UIDS is equivalent to AAF's \e aafUID_tAvidBezierInterpolator +*/ +DEFINE_ACFUID( acfUID,AVXInterpID_Bezier, 0xdf394eda, 0x6ac6, 0x4566, 0x8d, 0xbe, 0xf2, 0x8b, 0x0b, 0xdd, 0x78, 0x1a ); + +/*! +\remarks Used when no keyframe extrapolation has been defined. +\n type: UIDS; \n method: IAVXAnimateableParameter; \n context: IAVXAnimateableParameter \n +\n ACFNamespace name: Because these id's match the AAF specification there is no predefined ACFNamespace +\note The UIDS is equivalent to AAF's \e aafUID_tAvidNullExtrapolator +*/ +DEFINE_ACFUID( acfUID,AVXExtrapID_Null, 0x5d08d9a9, 0x75df, 0x4a34, 0x92, 0x03, 0x1b, 0x8d, 0xd1, 0x2c, 0x43, 0xc3 ); + +/*! +\remarks the value of the youngest keyframe Used and remains constant to -/+ infinity. +\n type: UIDS; \n method: IAVXAnimateableParameter; \n context: IAVXAnimateableParameter \n +\n ACFNamespace name: Because these id's match the AAF specification there is no predefined ACFNamespace +\note The UIDS is equivalent to AAF's \e aafUID_tHoldExtrapolator +*/ +DEFINE_ACFUID( acfUID,AVXExtrapID_Hold, 0x0e24dd54, 0x66cd, 0x4f1a, 0xb0, 0xa0, 0x67, 0x0a, 0xc3, 0xa7, 0xa0, 0xb3 ); + +/*! +\remarks extrapolation of keyframes will be based on the closest, youngest keyframe, who's slope will determine values to +/- infinity +\n type: UIDS; \n method: IAVXAnimateableParameter; \n context: IAVXAnimateableParameter \n +\n ACFNamespace name: Because these id's match the AAF specification there is no predefined ACFNamespace +\note The UIDS is equivalent to AAF's \e aafUID_tLinearExtrapolator +*/ +DEFINE_ACFUID( acfUID,AVXExtrapID_Linear, 0x35c777be, 0x2cd1, 0x4360, 0x96, 0x3d, 0xb5, 0x15, 0x69, 0x39, 0xba, 0x5f ); + +//@} + + + +#endif // acfuids_h diff --git a/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/ACF/acfunknown.h b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/ACF/acfunknown.h new file mode 100644 index 0000000000..349ea6632e --- /dev/null +++ b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/ACF/acfunknown.h @@ -0,0 +1,273 @@ +/*********************************************************************** + This file is part of the Avid AAX SDK. + + The AAX SDK is subject to commercial or open-source licensing. + + By using the AAX SDK, you agree to the terms of both the Avid AAX SDK License + Agreement and Avid Privacy Policy. + + AAX SDK License: https://developer.avid.com/aax + Privacy Policy: https://www.avid.com/legal/privacy-policy-statement + + Or: You may also use this code under the terms of the GPL v3 (see + www.gnu.org/licenses). + + THE AAX SDK IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER + EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE + DISCLAIMED. + +* +* Copyright 2004, 2008, 2010, 2013, 2024 Avid Technology, Inc. +* +************************************************************************/ + +#ifndef acfunknown_h +#define acfunknown_h + +/*! + \file acfunknown.h + \brief Defines the base class, IACFUnknown, for all ACF interfaces. + + \remarks Define common symbols so that each compiler can produce + runtime compatible vtables, methods and function signatures. + */ + + +#include "acfbasetypes.h" +#include "defineacfuid.h" // now includes DEFINE_ACFUID + +/*! + \remarks Define common symbols so that each compiler can produce + runtime compatible vtables, methods and function signatures. +*/ + +#ifndef __cplusplus +#error "ERROR acfunknown.h must be compiled with a C++ compiler!" +#endif + + +/*! + \def ACFBOOL + \brief Define COM compatible BOOL type. + + We need the following definition for a bool type since + the Win32 used BOOL as an int and ActiveX SDK, MacOLE use + unsigned long for OLEBOOL. + + \internal We may have to move this definition to acfbasetypes.h. + */ +#if defined(ACF_MAC) +#define ACFBOOL acfUInt32 +#else +#define ACFBOOL acfSInt32 +#endif + + +#if defined(ACF_PLATFORM_MWERKS_POWERPC_MACOS) + #define ACFMETHODCALLTYPE + #define ACFAPICALLTYPE pascal + #define ACFPLUGINAPI ACFEXTERN_C ACFEXPORT ACFRESULT ACFAPICALLTYPE + #define ACFAPI ACFEXTERN_C ACFAPICALLTYPE ACFRESULT + #define ACFAPI_(type) ACFEXTERN_C ACFAPICALLTYPE type + + #define ACFMETHODVCALLTYPE + #define ACFAPIVCALLTYPE + +#elif defined(ACF_PLATFORM_MWERKS_POWERPC_MACOS10) || defined(ACF_PLATFORM_GCC_POWERPC_MACOS10) || defined(ACF_PLATFORM_GCC_INTEL_MACOS10) || defined(ACF_PLATFORM_INTEL_INTEL_MACOS10) \ + || defined(ACF_OS_LINUX) || defined(ACF_OS_FREEBSD) || defined(ACF_PLATFORM_ARM_IOS) || defined(ACF_PLATFORM_GCC_ARM_MACOS11) + #define ACFMETHODCALLTYPE + #define ACFAPICALLTYPE + #define ACFPLUGINAPI ACFEXTERN_C ACFEXPORT ACFRESULT ACFAPICALLTYPE + #define ACFAPI ACFEXTERN_C ACFRESULT ACFAPICALLTYPE + #define ACFAPI_(type) ACFEXTERN_C type ACFAPICALLTYPE + + #define ACFMETHODVCALLTYPE + #define ACFAPIVCALLTYPE + + +#elif defined(ACF_PLATFORM_MSC_INTEL_WINDOWS) || defined(ACF_PLATFORM_INTEL_INTEL_WINDOWS) || defined(ACF_PLATFORM_MWERKS_INTEL_WINDOWS) +/*! +\brief Specifies the calling convention used for methods. +*/ + #define ACFMETHODCALLTYPE __stdcall + +/*! +\brief Specifies the calling convention used for functions. +*/ + #define ACFAPICALLTYPE __stdcall + +/*! + \brief Specifies the calling convension for a variable argument ACF function. + */ + #define ACFPLUGINAPI ACFEXTERN_C ACFEXPORT ACFRESULT ACFAPICALLTYPE + +/*! +\brief Specifies the a standard ACF function that returns an ACFRESULT. +*/ + #define ACFAPI ACFEXTERN_C ACFRESULT ACFAPICALLTYPE + +/*! +\brief Specifies an ACF function that returns a type result. +*/ + #define ACFAPI_(type) ACFEXTERN_C type ACFAPICALLTYPE + +/*! +\brief Specifies the calling convension for a variable argument ACF method. +*/ + #define ACFMETHODVCALLTYPE __cdecl + +/*! +\brief Specifies the calling convension for a variable argument ACF function. +*/ + #define ACFAPIVCALLTYPE __cdecl + + +#else + #error Unsupported configuration of OS and compiler! +#endif + +/*! +\brief Specifies an ACF virtual method that returns an ACFRESULT. +*/ +#define ACFMETHOD(method) virtual ACFRESULT ACFMETHODCALLTYPE method + +/*! +\brief Specifies an ACF virtual method that returns a type result. +*/ +#define ACFMETHOD_(type,method) virtual type ACFMETHODCALLTYPE method + +/*! +\brief Specifies an ACF method that returns an ACFRESULT for an implementation class. +*/ +#define ACFMETHODIMP ACFRESULT ACFMETHODCALLTYPE + +/*! +\brief Specifies an ACF method that returns a type result in an implementation class. +*/ +#define ACFMETHODIMP_(type) type ACFMETHODCALLTYPE + + +#define acfinterface struct + +#define DECLARE_ACFINTERFACE(iface) acfinterface iface : public IACFUnknown +#define DECLARE_ACFINTERFACE_(iface, baseiface) acfinterface iface : public baseiface + +#if ACF_WIN +#if defined(_MPPC_) && \ + ( (defined(_MSC_VER) || defined(__SC__) || defined(__MWERKS__)) && \ + !defined(NO_NULL_VTABLE_ENTRY) ) + #define BEGIN_ACFINTERFACE virtual void a() {} + #define END_ACFINTERFACE + +#else + #define BEGIN_ACFINTERFACE + #define END_ACFINTERFACE +#endif + +#elif ACF_MACH + #define BEGIN_ACFINTERFACE + #define END_ACFINTERFACE + +#elif ACF_UNIX + #define BEGIN_ACFINTERFACE + #define END_ACFINTERFACE + +#elif ACF_IOS + #define BEGIN_ACFINTERFACE + #define END_ACFINTERFACE + +#else + #error Unsupported configuration of OS and compiler! + +#endif + + +#if defined(ACF_PLATFORM_MWERKS_POWERPC_MACOS) || (defined(ACF_PLATFORM_MWERKS_POWERPC_MACOS10) && (__MWERKS__ <= 0x31FF /* CW 8 or earlier */)) + // jjo For testing with CW9 with __comobject compiler path from Andreas Hommel + + // fyi: comment snatched from the Mac ActiveX SDK (no longer supported by MS). +#define ACFCOMBASE : __comobject +#else +/*! +\def ACFCOMBASE +\brief Specifies the compiler specific base class for IACFUnknown. +*/ +#define ACFCOMBASE +#endif + +/*! + \b IID_IACFUnknown + \remarks + The interface identifier for IACFUnknown. + \note For compatibility with COM IID_IACFUnknown == IID_IUnknown . + \n type: UID + \n context: global + \n ACFNamespace name: none + \n {00000000-0000-0000-C000-000000000046} +*/ +DEFINE_ACFUID(acfIID, IID_IACFUnknown, 0x00000000, 0x0000, 0x0000, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46); + +#ifdef __clang__ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wnon-virtual-dtor" +#endif // __clang__ + +/*! + \interface IACFUnknown + \brief COM compatible IUnknown C++ interface. + \remarks + The methods of the IACFUnknown interface, implemented by all ACF objects, supports + general inter-object protocol negotiation via the QueryInterface method, and object + lifetime management with the AddRef and Release methods. + + \note Because AddRef and Release are not required to return accurate values, callers + of these methods must not use the return values to determine if an object is still + valid or has been destroyed. (Standard M*cr*s*ft disclaimer) + + For further information please refer to the Microsoft documentation for IUnknown. + + \note This class will work only with compilers that can produce COM-compatible object + layouts for C++ classes. egcs can not do this. Metrowerks can do this (if you + subclass from __comobject). + */ +class IACFUnknown ACFCOMBASE +{ +public: + BEGIN_ACFINTERFACE + +// virtual ~IACFUnknown() {} + +/*! + \brief Returns pointers to supported interfaces. + \remarks + The QueryInterface method gives a client access to alternate interfaces implemented by + an object. The returned interface pointer will have already had its reference count + incremented so the caller will be required to call the Release method. + \param iid Identifier of the requested interface + \param ppOut Address of variable that receives the interface pointer associated with iid. + */ + virtual ACFRESULT ACFMETHODCALLTYPE QueryInterface (const acfIID & iid, void ** ppOut) = 0; + +/*! + \brief Increments reference count. + \remarks + The AddRef method should be called every time a new copy of an interface is made. When + this copy is no longer referenced it must be released with the Release method. + */ + virtual acfUInt32 ACFMETHODCALLTYPE AddRef (void) = 0; + +/*! + \brief Decrements reference count. + \remarks + Use this method to decrement the reference count. When the reference count reaches zero the + object that implements the interface will be deleted. + */ + virtual acfUInt32 ACFMETHODCALLTYPE Release (void) = 0; +}; + +#ifdef __clang__ +#pragma clang diagnostic pop +#endif // __clang__ + + +#endif // acfunknown_h diff --git a/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/ACF/defineacfuid.h b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/ACF/defineacfuid.h new file mode 100644 index 0000000000..95c8a7197e --- /dev/null +++ b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/ACF/defineacfuid.h @@ -0,0 +1,62 @@ +/*********************************************************************** + + This file is part of the Avid AAX SDK. + + The AAX SDK is subject to commercial or open-source licensing. + + By using the AAX SDK, you agree to the terms of both the Avid AAX SDK License + Agreement and Avid Privacy Policy. + + AAX SDK License: https://developer.avid.com/aax + Privacy Policy: https://www.avid.com/legal/privacy-policy-statement + + Or: You may also use this code under the terms of the GPL v3 (see + www.gnu.org/licenses). + + THE AAX SDK IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER + EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE + DISCLAIMED. + + Copyright (c) 2004, 2024 Avid Technology, Inc. All rights reserved. + +************************************************************************/ + + +#ifndef defineacfuid_h +#define defineacfuid_h + +/*! + \file defineacfuid.h + \brief Defines DEFINE_ACFUID. + + \remarks This header provides the definition for the DEFINE_ACFUID + macro that is used to either declare a acfUID as a forward declaration + or initializes, defines, the acfUID symbol. + */ + +#include "acfbasetypes.h" + + +/*! + \def DEFINE_ACFUID(type, name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) + \brief Defines a type of acfUID structure. + + This macro is used to both declare and define acfUID constants. If the + symbol INITACFIDS is defined then the constant is fully defined, otherwise the + constant is just declared. + + \note To avoid duplicate symbol definitions the symbol INITACFIDS should only + be defined in one source file of an executable module. +*/ +#ifndef DEFINE_ACFUID +#define DEFINE_ACFUID(type, name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \ + ACFEXTERN_C const type name +#endif // DEFINE_ACFUID + + +#if defined(INITACFIDS) || defined(INITAVXIDS) +#include "initacfuid.h" +#endif + +#endif // defineacfuid_h + diff --git a/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/ACF/initacfuid.h b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/ACF/initacfuid.h new file mode 100644 index 0000000000..e41411945d --- /dev/null +++ b/modules/juce_audio_plugin_client/AAX/SDK/Interfaces/ACF/initacfuid.h @@ -0,0 +1,49 @@ +/*********************************************************************** + + This file is part of the Avid AAX SDK. + + The AAX SDK is subject to commercial or open-source licensing. + + By using the AAX SDK, you agree to the terms of both the Avid AAX SDK License + Agreement and Avid Privacy Policy. + + AAX SDK License: https://developer.avid.com/aax + Privacy Policy: https://www.avid.com/legal/privacy-policy-statement + + Or: You may also use this code under the terms of the GPL v3 (see + www.gnu.org/licenses). + + THE AAX SDK IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER + EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE + DISCLAIMED. + + Copyright (c) 2004, 2024 Avid Technology, Inc. All rights reserved. + +************************************************************************/ + +#ifndef initacfuid_h +#define initacfuid_h + +#include "acfbasetypes.h" + +/*! + \file + \brief Include initacfuid.h to enable acfUID initialization. This must be done + once per exe/dll. After this file, include one or more of the acfUID definition files. +*/ + +#ifdef DEFINE_ACFUID +#undef DEFINE_ACFUID +#endif + +/*! + Defines a uid structure of type \ref acfUID and initializes member data. + Generally you will want to use this macro to define all uid's within a definition. + \warning The uid must be unique. \n + \e Example: \n + \verbatim DEFINE_ACFUID(acfUID, ACF_MyEffectUID, 0x51b30d8a, 0xf54, 0x4092, 0xba, 0x41, 0x46, 0xdc, 0x91, 0xee, 0xf7, 0xf4); \endverbatim + */ +#define DEFINE_ACFUID(type, name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \ + ACFEXTERN_C const type name = { l, w1, w2, {b1, b2, b3, b4, b5, b6, b7, b8} } + +#endif // initacfuid_h diff --git a/modules/juce_audio_plugin_client/AAX/SDK/Libs/AAXLibrary/source/AAX_CACFUnknown.cpp b/modules/juce_audio_plugin_client/AAX/SDK/Libs/AAXLibrary/source/AAX_CACFUnknown.cpp new file mode 100644 index 0000000000..97b56c6870 --- /dev/null +++ b/modules/juce_audio_plugin_client/AAX/SDK/Libs/AAXLibrary/source/AAX_CACFUnknown.cpp @@ -0,0 +1,213 @@ +/*================================================================================================*/ +/* + * Copyright 2004-2016, 2023-2024 Avid Technology, Inc. + * All rights reserved. + * + * This file is part of the Avid AAX SDK. + * + * The AAX SDK is subject to commercial or open-source licensing. + * + * By using the AAX SDK, you agree to the terms of both the Avid AAX SDK License + * Agreement and Avid Privacy Policy. + * + * AAX SDK License: https://developer.avid.com/aax + * Privacy Policy: https://www.avid.com/legal/privacy-policy-statement + * + * Or: You may also use this code under the terms of the GPL v3 (see + * www.gnu.org/licenses). + * + * THE AAX SDK IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER + * EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE + * DISCLAIMED. + * + */ + +/** + * \file AAX_CACFUnknown.cpp + * + * \brief Implementation for various things in the unknown object that supports aggregation. + * + */ +/*================================================================================================*/ + +#include "CACFUnknown.h" +#include "acfextras.h" + +#include + +// AH/RM mod start - using inlined fast atomic operations with no library dependencies. +#include "AAX_Atomic.h" + +// rmajors mod - internal debugging code for acf refcount debugging of aax objects +#if defined AAX_DEBUG_ACF_REFCOUNT +#include "AAX_Assert.h" +#endif + +// Using casts here since ACF uses long and stdint uses int on 32-bit systems. I have +// looked at the assembly for both cast and non-cast approaches and it is identical, so +// this should not incur any performance penalty. -rmajors 10/11 +acfUInt32 ACFInterlockedIncrement (acfUInt32 & value) +{ + return (acfUInt32)AAX_Atomic_IncThenGet_32((uint32_t&)value); +} + +acfUInt32 ACFInterlockedDecrement (acfUInt32 & value) +{ + return (acfUInt32)AAX_Atomic_DecThenGet_32((uint32_t&)value); +} +// mod end + +// Manage total number of outstanding "live" objects. Used by ACFCanUnloadNow. +acfUInt32 CACFUnknown::m_ActiveObjects = 0; + +acfUInt32 CACFUnknown::IncrementActiveObjects(void) +{ + return ::ACFInterlockedIncrement(m_ActiveObjects); +} + +acfUInt32 CACFUnknown::DecrementActiveObjects(void) +{ + return ::ACFInterlockedDecrement(m_ActiveObjects); +} + +acfUInt32 CACFUnknown::GetActiveObjectCount(void) +{ + return m_ActiveObjects; +} + + +/*! + // CACFUnknown::CACFUnknown + // The "outer unknown" is the private non-delegating implementation. + // This method also increments the active ACF object count + // so that ACF Plugin will not attempt to unload (see \ref ACFCanUnloadNow). + */ +CACFUnknown::CACFUnknown() : +m_cRef(0), +m_pUnkOuter(0) +{ + m_UnkPrivate.SetParentUnknown(this); + + m_pUnkOuter = GetPrivateUnknown(); + + IncrementActiveObjects(); +} + +/*! + // CACFUnknown::CACFUnknown + // If the given outer unknown is 0 then use the private non-delegating + // implementation. This method also increments the active ACF object count + // so that ACF Plugin will not attempt to unload (see \ref ACFCanUnloadNow). + */ +CACFUnknown::CACFUnknown +( + IACFUnknown *pUnkOuter // Controlling unknown from IACFClassFactory::CreateInstance, + // may be 0. + ) : +m_cRef(0), +m_pUnkOuter(0) +{ + m_UnkPrivate.SetParentUnknown(this); + + m_pUnkOuter = (pUnkOuter) ? pUnkOuter : GetPrivateUnknown(); + + IncrementActiveObjects(); +} + +/*! + // CACFUnknown::~CACFUnknown + + // Decrements the active ACF object count so that the ACF plugin can unload if + // the count is zero (see \ref ACFCanUnloadNow) + */ +CACFUnknown::~CACFUnknown() +{ + DecrementActiveObjects(); +} + +/*! + */ +ACFMETHODIMP_(void) CACFUnknown::ReclaimMemory(void) +{ + delete this; +} + +/*! + // CACFUnknown::InternalQueryInterface + + // Objects that are aggregated use this to support additional interfaces. + // they should call this method on their parent so that any of it's interfaces + // are queried. + + // Returns one of the following values: + // + // ACF_OK | + // If objects supports the requested interface. + // ACF_E_NOINTERFACE | + // If object does not implement the requeste interface. + */ +ACFRESULT CACFUnknown::InternalQueryInterface +( + const acfIID & riid, // [in] interface they want + void **ppvObjOut // [out] where they want to put the resulting object ptr. + ) +{ + *ppvObjOut = 0; + + // We only support the IID_IACFUnknown (a.k.a. IID_IUnknown) interface + // + if (riid == IID_IACFUnknown ) + { + *ppvObjOut = static_cast(GetPrivateUnknown()); + ( static_cast(*ppvObjOut))->AddRef(); + return ACF_OK; + } + + return ACF_E_NOINTERFACE; +} + + +/*! + Adds a tick to the current reference count. + The new reference count + */ +acfUInt32 CACFUnknown::InternalAddRef +( + void + ) +{ +#if defined AAX_DEBUG_ACF_REFCOUNT + const acfUInt32 cRef = ::ACFInterlockedIncrement(m_cRef); + AAX_TRACEORSTACKTRACE(kAAX_Trace_Priority_Low, kAAX_Trace_Priority_Lowest, "CACFUnknown::InternalAddRef - object: %p, new count: %lu", this, (unsigned long)cRef); + return cRef; +#else + return ::ACFInterlockedIncrement(m_cRef); +#endif +} + +/*! + Removes a tick from the count, and delets the object if necessary + Remaining refs + */ +acfUInt32 CACFUnknown::InternalRelease +( + void + ) +{ + acfUInt32 cRef = ::ACFInterlockedDecrement(m_cRef); + if (0 == cRef) + { + // Give a subclass a chance to cleanup while this object is still valid. + FinalRelease(); + + // Get a subclass a change to reclaim/resuse the object's memory. + ReclaimMemory(); + } + +#if defined AAX_DEBUG_ACF_REFCOUNT + AAX_TRACEORSTACKTRACE(kAAX_Trace_Priority_Low, kAAX_Trace_Priority_Lowest, "CACFUnknown::InternalRelease - object: %p, new count: %lu", this, (unsigned long)cRef); +#endif + + return cRef; +} + diff --git a/modules/juce_audio_plugin_client/AAX/SDK/Libs/AAXLibrary/source/AAX_CAutoreleasePool.Win.cpp b/modules/juce_audio_plugin_client/AAX/SDK/Libs/AAXLibrary/source/AAX_CAutoreleasePool.Win.cpp new file mode 100644 index 0000000000..19b8f59058 --- /dev/null +++ b/modules/juce_audio_plugin_client/AAX/SDK/Libs/AAXLibrary/source/AAX_CAutoreleasePool.Win.cpp @@ -0,0 +1,44 @@ +/*================================================================================================*/ +/* + * Copyright 2013-2015, 2023-2024 Avid Technology, Inc. + * All rights reserved. + * + * This file is part of the Avid AAX SDK. + * + * The AAX SDK is subject to commercial or open-source licensing. + * + * By using the AAX SDK, you agree to the terms of both the Avid AAX SDK License + * Agreement and Avid Privacy Policy. + * + * AAX SDK License: https://developer.avid.com/aax + * Privacy Policy: https://www.avid.com/legal/privacy-policy-statement + * + * Or: You may also use this code under the terms of the GPL v3 (see + * www.gnu.org/licenses). + * + * THE AAX SDK IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER + * EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE + * DISCLAIMED. + * + */ + +/** + * \file AAX_CAutoreleasePool.Win.cpp + * + * \brief Windows implementation of a basic Autorelease pool helper utility + * + */ +/*================================================================================================*/ + +#include "AAX_CAutoreleasePool.h" +#include "stddef.h" + +AAX_CAutoreleasePool::AAX_CAutoreleasePool() : mAutoreleasePool(NULL) +{ + // Nothing to do on Windows yet...maybe someday if Apple ever opens objective-C libs on the Windows platform. +} + +AAX_CAutoreleasePool::~AAX_CAutoreleasePool() +{ + // Nothing to do on Windows yet...maybe someday if Apple ever opens objective-C libs on the Windows platform. +} diff --git a/modules/juce_audio_plugin_client/AAX/SDK/Libs/AAXLibrary/source/AAX_CChunkDataParser.cpp b/modules/juce_audio_plugin_client/AAX/SDK/Libs/AAXLibrary/source/AAX_CChunkDataParser.cpp new file mode 100644 index 0000000000..5ea8d293d4 --- /dev/null +++ b/modules/juce_audio_plugin_client/AAX/SDK/Libs/AAXLibrary/source/AAX_CChunkDataParser.cpp @@ -0,0 +1,494 @@ +/*================================================================================================*/ +/* + * Copyright 2013-2015, 2023-2024 Avid Technology, Inc. + * All rights reserved. + * + * This file is part of the Avid AAX SDK. + * + * The AAX SDK is subject to commercial or open-source licensing. + * + * By using the AAX SDK, you agree to the terms of both the Avid AAX SDK License + * Agreement and Avid Privacy Policy. + * + * AAX SDK License: https://developer.avid.com/aax + * Privacy Policy: https://www.avid.com/legal/privacy-policy-statement + * + * Or: You may also use this code under the terms of the GPL v3 (see + * www.gnu.org/licenses). + * + * THE AAX SDK IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER + * EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE + * DISCLAIMED. + * + */ + +/** + * \file AAX_CChunkDataParser.cpp + * + * \author Steven Massey + * + */ +/*================================================================================================*/ +#include "AAX_CChunkDataParser.h" + +#include + +#include +#include +#include + +#include "AAX_EndianSwap.h" +#include "AAX_Assert.h" + + +AAX_CChunkDataParser::AAX_CChunkDataParser() +: mLastFoundIndex(-1), + mChunkData(NULL), + mChunkVersion(-1) +{ +} + +AAX_CChunkDataParser::~AAX_CChunkDataParser() +{ +} + +int32_t AAX_CChunkDataParser::GetChunkData(AAX_SPlugInChunk *chunk) +{ + uint16_t chunkDataElement16; + uint32_t chunkDataElement32; + int64_t chunkDataElement64; + AAX_CString chunkDataElementStr; + + int32_t signedChunkDataSize = this->GetChunkDataSize(); + size_t chunkDataSize = 0; + if (signedChunkDataSize < AAX_ChunkDataParserDefs::HEADER_SIZE) + { + return AAX_ChunkDataParserDefs::BUILD_DATA_FAILED; + } + else + { + chunkDataSize = static_cast(signedChunkDataSize); + } + + try + { + char *chunkData = reinterpret_cast(chunk->fData); + uint32_t dataIndex = 0; + + //SW - macOS has junk in the chunk + memset(chunkData, 0, chunkDataSize); + + // Set AAX_CChunkDataParser version number: + memcpy(&chunkData[dataIndex], &AAX_ChunkDataParserDefs::VERSION_ID_1, 4); + dataIndex += 4; + + // Go thru chunk elements, and place them into the chunk - byte swap if needed + for (size_t i = 0; i < mDataValues.size(); i++) { + + // Calculate the size of each element in the chunk + const uint32_t elemIdentifierSize = AAX_ChunkDataParserDefs::STRING_IDENTIFIER_SIZE; + const uint32_t elemNameSize = 1+mDataValues[i].mDataName.Length(); + uint32_t elemDataSize(0); + if (mDataValues[i].mDataType == AAX_ChunkDataParserDefs::DOUBLE_TYPE) { + chunkDataElement64 = mDataValues[i].mIntValue; + AAX_BigEndianNativeSwapInPlace(&chunkDataElement64); + elemDataSize = AAX_ChunkDataParserDefs::DOUBLE_TYPE_SIZE; + } else if (mDataValues[i].mDataType == AAX_ChunkDataParserDefs::SHORT_TYPE) { + chunkDataElement16 = uint16_t(mDataValues[i].mIntValue); + AAX_BigEndianNativeSwapInPlace(&chunkDataElement16); + elemDataSize = AAX_ChunkDataParserDefs::SHORT_TYPE_SIZE; + } else if (mDataValues[i].mDataType == AAX_ChunkDataParserDefs::STRING_TYPE) { + chunkDataElementStr = mDataValues[i].mStringValue; + elemDataSize = 1 + chunkDataElementStr.Length(); + } else { + chunkDataElement32 = uint32_t(mDataValues[i].mIntValue); + AAX_BigEndianNativeSwapInPlace(&chunkDataElement32); + elemDataSize = AAX_ChunkDataParserDefs::DEFAULT32BIT_TYPE_SIZE; + } + + // Verify that this item will fit into the buffer + if ((dataIndex + (elemIdentifierSize + elemNameSize + elemDataSize)) > chunkDataSize) + { + throw std::out_of_range("aborting: chunk data will overflow buffer"); + } + + // Put data element's name into chunk + if (mDataValues[i].mDataType == AAX_ChunkDataParserDefs::DOUBLE_TYPE) { + strncpy(&chunkData[dataIndex], AAX_ChunkDataParserDefs::DOUBLE_STRING_IDENTIFIER, elemIdentifierSize); + } else if (mDataValues[i].mDataType == AAX_ChunkDataParserDefs::LONG_TYPE) { + strncpy(&chunkData[dataIndex], AAX_ChunkDataParserDefs::LONG_STRING_IDENTIFIER, elemIdentifierSize); + } else if (mDataValues[i].mDataType == AAX_ChunkDataParserDefs::FLOAT_TYPE) { + strncpy(&chunkData[dataIndex], AAX_ChunkDataParserDefs::FLOAT_STRING_IDENTIFIER, elemIdentifierSize); + } else if (mDataValues[i].mDataType == AAX_ChunkDataParserDefs::SHORT_TYPE) { + strncpy(&chunkData[dataIndex], AAX_ChunkDataParserDefs::SHORT_STRING_IDENTIFIER, elemIdentifierSize); + } else if (mDataValues[i].mDataType == AAX_ChunkDataParserDefs::STRING_TYPE) { + strncpy(&chunkData[dataIndex], AAX_ChunkDataParserDefs::STRING_STRING_IDENTIFIER, elemIdentifierSize); + } + dataIndex += elemIdentifierSize; // Increment past "f_", "d_", etc. id string + + strncpy(&chunkData[dataIndex], mDataValues[i].mDataName.Get(), elemNameSize); + dataIndex += elemNameSize; + WordAlign(dataIndex); + + // Put data element into chunk + if (mDataValues[i].mDataType == AAX_ChunkDataParserDefs::DOUBLE_TYPE) { + memcpy(&chunkData[dataIndex], &chunkDataElement64, elemDataSize); + dataIndex += AAX_ChunkDataParserDefs::DOUBLE_TYPE_INCR; + } else if (mDataValues[i].mDataType == AAX_ChunkDataParserDefs::SHORT_TYPE) { + memcpy(&chunkData[dataIndex], &chunkDataElement16, elemDataSize); + dataIndex += AAX_ChunkDataParserDefs::SHORT_TYPE_INCR; // keep life word aligned + } else if (mDataValues[i].mDataType == AAX_ChunkDataParserDefs::STRING_TYPE) { + memcpy(&chunkData[dataIndex], chunkDataElementStr.Get(), chunkDataElementStr.Length() + 1); + dataIndex += elemDataSize; + WordAlign(dataIndex); + } else { + memcpy(&chunkData[dataIndex], &chunkDataElement32, elemDataSize); + dataIndex += AAX_ChunkDataParserDefs::DEFAULT32BIT_TYPE_INCR; + } + } + } + + + catch(const std::exception& e) + { + AAX_TRACE_RELEASE(kAAX_Trace_Priority_High, "AAX_CChunkDataParser::GetChunkData ERROR: %s", e.what()); + return AAX_ChunkDataParserDefs::BUILD_DATA_FAILED; + } + catch(...) + { + return AAX_ChunkDataParserDefs::BUILD_DATA_FAILED; + } + + chunk->fSize = signedChunkDataSize; + + return 0; +} + +void AAX_CChunkDataParser::LoadChunk(const AAX_SPlugInChunk *chunk) +{ + Clear(); + + mChunkVersion = chunk->fVersion; + const char *chunkData = chunk->fData; // Do not dereference until after verifying that chunkDataSize > 4 + int32_t chunkDataSize; + + int32_t i = 0; + chunkDataSize = chunk->fSize; + + // Check the version number + if (chunkDataSize >= 4) { + if ( *(reinterpret_cast(chunkData)) != AAX_ChunkDataParserDefs::VERSION_ID_1) + return; + else i += 4; + } + + if (chunkDataSize > 4 ) { + //chunkData = chunk->fData; + + uint16_t chunkDataElement16; + uint32_t chunkDataElement32; + int64_t chunkDataElement64; + AAX_CString chunkDataElementStr; + char name[AAX_ChunkDataParserDefs::MAX_NAME_LENGTH+3]; + + do { + if (i < chunkDataSize) { + DataValue newValue; + + size_t length = std::min(AAX_ChunkDataParserDefs::MAX_NAME_LENGTH, static_cast(chunkDataSize - i)); // Just trying to always stay in the buffer + strncpy(name, &chunkData[i], length); + i += (int32_t(strlen(name)) + 1); + WordAlign(i); + // Only comparing first character, leave the 2nd for future + if (strncmp(name, AAX_ChunkDataParserDefs::DOUBLE_STRING_IDENTIFIER, 1) == 0) { + memcpy(&chunkDataElement64, &chunkData[i], 8); + AAX_BigEndianNativeSwapInPlace(&chunkDataElement64); + i+=8; + newValue.mDataType = AAX_ChunkDataParserDefs::DOUBLE_TYPE; + newValue.mIntValue = chunkDataElement64; + } else if (strncmp(name, AAX_ChunkDataParserDefs::FLOAT_STRING_IDENTIFIER, 1) == 0) { + memcpy(&chunkDataElement32, &chunkData[i], 4); + AAX_BigEndianNativeSwapInPlace(&chunkDataElement32); + chunkDataElement64 = chunkDataElement32; + i+=4; + newValue.mDataType = AAX_ChunkDataParserDefs::FLOAT_TYPE; + newValue.mIntValue = chunkDataElement64; + } else if (strncmp(name, AAX_ChunkDataParserDefs::LONG_STRING_IDENTIFIER, 1) == 0) { + memcpy(&chunkDataElement32, &chunkData[i], 4); + AAX_BigEndianNativeSwapInPlace(&chunkDataElement32); + chunkDataElement64 = chunkDataElement32; + i+=4; + newValue.mDataType = AAX_ChunkDataParserDefs::LONG_TYPE; + newValue.mIntValue = chunkDataElement64; + } else if (strncmp(name, AAX_ChunkDataParserDefs::SHORT_STRING_IDENTIFIER, 1) == 0) { + memcpy(&chunkDataElement16, &chunkData[i], 2); + AAX_BigEndianNativeSwapInPlace(&chunkDataElement16); + chunkDataElement64 = chunkDataElement16; + i+=4; // keep things word aligned + newValue.mDataType = AAX_ChunkDataParserDefs::SHORT_TYPE; + newValue.mIntValue = chunkDataElement64; + } else if (strncmp(name, AAX_ChunkDataParserDefs::STRING_STRING_IDENTIFIER, 1) == 0) { + chunkDataElementStr = &chunkData[i]; // just read until we hit null-terminator + i += chunkDataElementStr.Length() + 1; + newValue.mDataType = AAX_ChunkDataParserDefs::STRING_TYPE; + newValue.mStringValue = chunkDataElementStr; + } + + AAX_CString dataName(&name[2]); // chop of first two characters + newValue.mDataName = dataName; + + mDataValues.push_back(newValue); + } + } while (i < chunkDataSize); + } +} + + +int32_t AAX_CChunkDataParser::GetChunkDataSize() +{ + int32_t chunkDataSize = AAX_ChunkDataParserDefs::HEADER_SIZE; + size_t numElements = mDataValues.size(); + for (size_t i = 0; i < numElements; i++) { + uint32_t nameLength = mDataValues[i].mDataName.Length() + 3; // 2+1=3; two char id + null termination = 3 + WordAlign(nameLength); + chunkDataSize += nameLength; + + if (mDataValues[i].mDataType == AAX_ChunkDataParserDefs::DOUBLE_TYPE) chunkDataSize += 8; + else if (mDataValues[i].mDataType == AAX_ChunkDataParserDefs::FLOAT_TYPE) chunkDataSize += 4; + else if (mDataValues[i].mDataType == AAX_ChunkDataParserDefs::LONG_TYPE) chunkDataSize += 4; + else if (mDataValues[i].mDataType == AAX_ChunkDataParserDefs::SHORT_TYPE) chunkDataSize += 4; // we keep things word aligned + else if (mDataValues[i].mDataType == AAX_ChunkDataParserDefs::STRING_TYPE) + { + nameLength = (mDataValues[i].mStringValue.Length() + 1); + WordAlign(nameLength); + chunkDataSize += nameLength; + } + } + + return chunkDataSize; +} + +void AAX_CChunkDataParser::WordAlign(uint32_t &index) +{ + uint32_t align = index%4; + if (align != 0) { + index -= align; + index += 4; + } +} + +void AAX_CChunkDataParser::WordAlign(int32_t &index) +{ + int32_t align = index%4; + if (align != 0) { + index -= align; + index += 4; + } +} + +bool AAX_CChunkDataParser::ReplaceDouble(const char *name, double value) //SW added for fela +{ + int32_t i; + int64_t data; + + AAX_CString doubleName(name); + + i = FindName(doubleName); + + if (i == AAX_ChunkDataParserDefs::NAME_NOT_FOUND || 0 > i) return false; + if (mDataValues[static_cast(i)].mDataType != AAX_ChunkDataParserDefs::DOUBLE_TYPE) return false; + + memcpy(&data, &value, 8); + mDataValues[static_cast(i)].mIntValue = data; + return true; +} + + + +void AAX_CChunkDataParser::AddFloat(const char *name, float value) +{ + uint32_t data = 0; + memcpy(&data, &value, 4); + + DataValue dataValue; + dataValue.mDataName = name; + dataValue.mIntValue = static_cast(data); + dataValue.mDataType = AAX_ChunkDataParserDefs::FLOAT_TYPE; + mDataValues.push_back(dataValue); +} + +void AAX_CChunkDataParser::AddDouble(const char *name, double value) +{ + int64_t data = 0; + memcpy(&data, &value, 8); + + DataValue dataValue; + dataValue.mDataName = name; + dataValue.mIntValue = data; + dataValue.mDataType = AAX_ChunkDataParserDefs::DOUBLE_TYPE; + mDataValues.push_back(dataValue); +} + +void AAX_CChunkDataParser::AddString(const char *name, AAX_CString value) +{ + DataValue dataValue; + dataValue.mDataName = name; + dataValue.mStringValue = value; + dataValue.mDataType = AAX_ChunkDataParserDefs::STRING_TYPE; + mDataValues.push_back(dataValue); +} + +void AAX_CChunkDataParser::AddInt32(const char *name, int32_t value) +{ + DataValue dataValue; + dataValue.mDataName = name; + dataValue.mIntValue = static_cast(value); + dataValue.mDataType = AAX_ChunkDataParserDefs::LONG_TYPE; + mDataValues.push_back(dataValue); +} + +void AAX_CChunkDataParser::AddInt16(const char *name, int16_t value) +{ + DataValue dataValue; + dataValue.mDataName = name; + dataValue.mIntValue = static_cast(value); + dataValue.mDataType = AAX_ChunkDataParserDefs::SHORT_TYPE; + mDataValues.push_back(dataValue); +} + +bool AAX_CChunkDataParser::FindDouble(const char *name, double *value) +{ + int32_t i; + int64_t data; + + AAX_CString doubleName(name); + + i = FindName(doubleName); + + if (i == AAX_ChunkDataParserDefs::NAME_NOT_FOUND || 0 > i) return false; + if (mDataValues.size() > 0 && mDataValues[static_cast(i)].mDataType != AAX_ChunkDataParserDefs::DOUBLE_TYPE) return false; + + data = mDataValues[static_cast(i)].mIntValue; + memcpy(value, &data, 8); + return true; +} + + +bool AAX_CChunkDataParser::FindFloat (const char *name, float *value) +{ + int32_t i; + int32_t data; + + AAX_CString floatName(name); + + i = FindName(floatName); + + if (i == AAX_ChunkDataParserDefs::NAME_NOT_FOUND || 0 > i) return false; + if (mDataValues.size() > 0 && mDataValues[static_cast(i)].mDataType != AAX_ChunkDataParserDefs::FLOAT_TYPE) return false; + + data = static_cast(mDataValues[static_cast(i)].mIntValue); + memcpy(value, &data, 4); + return true; +} + + +bool AAX_CChunkDataParser::FindString (const char *name, AAX_CString *value) +{ + int32_t i; + AAX_CString stringName(name); + + i = FindName(stringName); + + if (i == AAX_ChunkDataParserDefs::NAME_NOT_FOUND || 0 > i) return false; + if (mDataValues.size() > 0 && mDataValues[static_cast(i)].mDataType != AAX_ChunkDataParserDefs::STRING_TYPE) return false; + + value->Set(mDataValues[static_cast(i)].mStringValue.Get()); + + return true; +} + + +bool AAX_CChunkDataParser::FindInt32(const char *name, int32_t *value) +{ + int32_t i; + + AAX_CString longName(name); + + i = FindName(longName); + + if (i == AAX_ChunkDataParserDefs::NAME_NOT_FOUND || 0 > i) return false; + if (mDataValues.size() > 0 && mDataValues[static_cast(i)].mDataType != AAX_ChunkDataParserDefs::LONG_TYPE) return false; + + *value = static_cast(mDataValues[static_cast(i)].mIntValue); + //memcpy(value, &data, 8); + return true; +} + + +bool AAX_CChunkDataParser::FindInt16(const char *name, int16_t *value) +{ + int32_t i; + + AAX_CString longName(name); + + i = FindName(longName); + + if (i == AAX_ChunkDataParserDefs::NAME_NOT_FOUND || 0 > i) return false; + if (mDataValues.size() > 0 && mDataValues[static_cast(i)].mDataType != AAX_ChunkDataParserDefs::SHORT_TYPE) return false; + + *value = static_cast(mDataValues[static_cast(i)].mIntValue); + //memcpy(value, &data, 8); + return true; +} + +int32_t AAX_CChunkDataParser::FindName(const AAX_CString &Name) +// I keep track of the last found index to speed up searching since chunk values +// will tend to be extracted in the same order every time. +{ + size_t numDatum = mDataValues.size(); + if (mLastFoundIndex >= (static_cast(numDatum)-1)) + mLastFoundIndex = -1; + + if (-1 > mLastFoundIndex) + { + return AAX_ChunkDataParserDefs::NAME_NOT_FOUND; + } + else + { + uint32_t i = static_cast(mLastFoundIndex + 1); + + while(i < numDatum ) { + if (mDataValues[i].mDataName == Name) { + mLastFoundIndex = static_cast(i); + return mLastFoundIndex; + } + i++; + } + + if (0 <= mLastFoundIndex) + { + uint32_t j = 0; + while(j <= static_cast(mLastFoundIndex)) { + if (mDataValues[j].mDataName == Name) { + mLastFoundIndex = static_cast(j); + return mLastFoundIndex; + } + j++; + } + } + } + + return AAX_ChunkDataParserDefs::NAME_NOT_FOUND; +} + +bool AAX_CChunkDataParser::IsEmpty() +{ + return mDataValues.empty(); +} + +void AAX_CChunkDataParser::Clear() +{ + mLastFoundIndex = -1; + mChunkVersion = -1; + mDataValues.clear(); +} diff --git a/modules/juce_audio_plugin_client/AAX/SDK/Libs/AAXLibrary/source/AAX_CEffectDirectData.cpp b/modules/juce_audio_plugin_client/AAX/SDK/Libs/AAXLibrary/source/AAX_CEffectDirectData.cpp new file mode 100644 index 0000000000..5d9f0132c7 --- /dev/null +++ b/modules/juce_audio_plugin_client/AAX/SDK/Libs/AAXLibrary/source/AAX_CEffectDirectData.cpp @@ -0,0 +1,114 @@ +/*================================================================================================*/ +/* + * Copyright 2013-2015, 2023-2024 Avid Technology, Inc. + * All rights reserved. + * + * This file is part of the Avid AAX SDK. + * + * The AAX SDK is subject to commercial or open-source licensing. + * + * By using the AAX SDK, you agree to the terms of both the Avid AAX SDK License + * Agreement and Avid Privacy Policy. + * + * AAX SDK License: https://developer.avid.com/aax + * Privacy Policy: https://www.avid.com/legal/privacy-policy-statement + * + * Or: You may also use this code under the terms of the GPL v3 (see + * www.gnu.org/licenses). + * + * THE AAX SDK IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER + * EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE + * DISCLAIMED. + * + */ +/*================================================================================================*/ + +#include "AAX_CEffectDirectData.h" + +#include "AAX_IEffectParameters.h" +#include "AAX_VPrivateDataAccess.h" +#include "AAX_VController.h" +#include "AAX_UIDs.h" + +AAX_CEffectDirectData::AAX_CEffectDirectData() : + mController(NULL), + mEffectParameters(NULL) +{ + +} + +AAX_CEffectDirectData::~AAX_CEffectDirectData() +{ + // Double check to make sure it was uninited. + this->Uninitialize(); +} + +AAX_Result AAX_CEffectDirectData::Initialize ( IACFUnknown * iController ) +{ + mController = new AAX_VController(iController); + if (iController == 0 || mController == 0) + return AAX_ERROR_NOT_INITIALIZED; + + if ( iController ) + { + iController->QueryInterface(IID_IAAXEffectParametersV1, (void **)&mEffectParameters); + } + + return Initialize_PrivateDataAccess(); +} + +AAX_Result AAX_CEffectDirectData::Uninitialize (void) +{ + if (mEffectParameters) + { + mEffectParameters->Release(); // Is this the correct way to handle this member? + mEffectParameters = NULL; + } + + if ( mController ) + { + delete ( mController ); // Is this the correct way to handle this member? + mController = NULL; + } + return AAX_SUCCESS; +} + +AAX_Result AAX_CEffectDirectData::TimerWakeup (IACFUnknown * inDataAccessInterface ) +{ + AAX_Result result = AAX_SUCCESS; + + AAX_VPrivateDataAccess dataAccess( inDataAccessInterface ); + result = TimerWakeup_PrivateDataAccess (&dataAccess); + + return result; +} + +AAX_IController* AAX_CEffectDirectData::Controller(void) +{ + return mController; +} + +AAX_IEffectParameters* AAX_CEffectDirectData::EffectParameters(void) +{ + return mEffectParameters; +} + +AAX_Result AAX_CEffectDirectData::Initialize_PrivateDataAccess() +{ + return AAX_SUCCESS; +} + +AAX_Result AAX_CEffectDirectData::TimerWakeup_PrivateDataAccess(AAX_IPrivateDataAccess*) +{ + return AAX_SUCCESS; +} + +AAX_Result AAX_CEffectDirectData::NotificationReceived( AAX_CTypeID ,const void * ,uint32_t ) +{ + return AAX_SUCCESS; +} + + + + + diff --git a/modules/juce_audio_plugin_client/AAX/SDK/Libs/AAXLibrary/source/AAX_CEffectGUI.cpp b/modules/juce_audio_plugin_client/AAX/SDK/Libs/AAXLibrary/source/AAX_CEffectGUI.cpp new file mode 100644 index 0000000000..b59cbe0931 --- /dev/null +++ b/modules/juce_audio_plugin_client/AAX/SDK/Libs/AAXLibrary/source/AAX_CEffectGUI.cpp @@ -0,0 +1,248 @@ +/*================================================================================================*/ +/* + * Copyright 2013-2017, 2019, 2021, 2023-2024 Avid Technology, Inc. + * All rights reserved. + * + * This file is part of the Avid AAX SDK. + * + * The AAX SDK is subject to commercial or open-source licensing. + * + * By using the AAX SDK, you agree to the terms of both the Avid AAX SDK License + * Agreement and Avid Privacy Policy. + * + * AAX SDK License: https://developer.avid.com/aax + * Privacy Policy: https://www.avid.com/legal/privacy-policy-statement + * + * Or: You may also use this code under the terms of the GPL v3 (see + * www.gnu.org/licenses). + * + * THE AAX SDK IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER + * EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE + * DISCLAIMED. + * + */ +/*================================================================================================*/ + +#include "AAX_CEffectGUI.h" +#include "AAX_VController.h" +#include "AAX_VTransport.h" +#include "AAX_VViewContainer.h" +#include "AAX_IEffectParameters.h" +#include "AAX_IParameter.h" +#include "AAX_UIDs.h" +#include "AAX_CString.h" +#include "AAX_Assert.h" + +// ******************************************************************************* +// METHOD: AAX_CEffectGUI +// ******************************************************************************* +AAX_CEffectGUI::AAX_CEffectGUI() : + mController(NULL), + mEffectParameters(NULL), + mViewContainer(), + mTransport(NULL) +{ + +} + +// ******************************************************************************* +// METHOD: ~AAX_CEffectGUI +// ******************************************************************************* +AAX_CEffectGUI::~AAX_CEffectGUI() +{ + this->Uninitialize(); // Just to guarantee that all these things get broken down... +} + +// ******************************************************************************* +// METHOD: Initialize +// ******************************************************************************* +AAX_Result AAX_CEffectGUI::Initialize ( IACFUnknown * iController ) +{ + mController = new AAX_VController(iController); + if (iController == 0 || mController == 0) + return AAX_ERROR_NOT_INITIALIZED; + + if ( iController ) + { + iController->QueryInterface(IID_IAAXEffectParametersV1, (void **)&mEffectParameters); + } + + mTransport = new AAX_VTransport(iController); + + this->CreateViewContents (); + return AAX_SUCCESS; +} + +// ******************************************************************************* +// METHOD: Uninitialize +// ******************************************************************************* +AAX_Result AAX_CEffectGUI::Uninitialize (void) +{ + if ( nullptr != this->GetViewContainer() ) + { + this->SetViewContainer(nullptr); + } + + if (mEffectParameters) + { + mEffectParameters->Release(); + mEffectParameters = 0; + } + + if ( mController ) + { + delete ( mController ); + mController = 0; + } + if ( mTransport ) + { + delete mTransport; + mTransport = NULL; + } + + return AAX_SUCCESS; +} + +// ******************************************************************************* +// METHOD: NotificationReceived +// ******************************************************************************* +AAX_Result AAX_CEffectGUI::NotificationReceived(AAX_CTypeID /*inNotificationType*/, const void * /*inNotificationData*/, uint32_t /*inNotificationDataSize*/) +{ + //Base implementation doesn't need to know any of these right now. + return AAX_SUCCESS; +} + + + +// ******************************************************************************* +// METHOD: SetViewContainer +// ******************************************************************************* +AAX_Result AAX_CEffectGUI::SetViewContainer ( IACFUnknown * inViewContainer ) +{ + if ( !inViewContainer ) + { + this->DeleteViewContainer (); + mViewContainer.reset(); + } + else + { + mViewContainer.reset(new AAX_VViewContainer ( inViewContainer )); + this->CreateViewContainer (); + this->UpdateAllParameters (); + } + + return AAX_SUCCESS; +} + +// ******************************************************************************* +// METHOD: GetViewContainerType +// ******************************************************************************* +AAX_EViewContainer_Type AAX_CEffectGUI::GetViewContainerType () +{ + AAX_EViewContainer_Type result = AAX_eViewContainer_Type_NULL; + if ( AAX_IViewContainer* const viewContainer = this->GetViewContainer() ) { + result = static_cast(viewContainer->GetType()); + } + + return result; +} + +// ******************************************************************************* +// METHOD: GetViewContainerPtr +// ******************************************************************************* +void * AAX_CEffectGUI::GetViewContainerPtr () +{ + void * result = nullptr; + if ( AAX_IViewContainer* const viewContainer = this->GetViewContainer() ) { + result = viewContainer->GetPtr (); + } + + return result; +} + +// ******************************************************************************* +// METHOD: ParameterUpdated (Called from Host on main thread) +// ******************************************************************************* +AAX_Result AAX_CEffectGUI::ParameterUpdated(AAX_CParamID /*inParamID*/) +{ + return AAX_SUCCESS; +} + +// ******************************************************************************* +// METHOD: UpdateAllParameters +// ******************************************************************************* +void AAX_CEffectGUI::UpdateAllParameters () +{ + if ( mEffectParameters ) { + int32_t numControls = 0; + if ( AAX_SUCCESS == mEffectParameters->GetNumberOfParameters( &numControls ) ) { + for ( int32_t index = 0; index < numControls; ++index ) + { + AAX_CString paramID; + if ( AAX_SUCCESS == mEffectParameters->GetParameterIDFromIndex( index, ¶mID ) ) { + this->ParameterUpdated( (AAX_CParamID)paramID.CString() ); + } + } + } + else { + AAX_TRACE_RELEASE(kAAX_Trace_Priority_Critical, "AAX_CEffectGUI::UpdateAllParameters - error getting the number of parameters"); + } + } +} + +// ******************************************************************************* +// METHOD: GetPlugInString +// ******************************************************************************* +AAX_Result AAX_CEffectGUI::GetCustomLabel ( AAX_EPlugInStrings /*inSelector*/, AAX_IString * /*outString*/ ) const +{ + return AAX_ERROR_NULL_OBJECT; +} + +// ******************************************************************************* +// METHOD: GetController +// ******************************************************************************* +AAX_IController* AAX_CEffectGUI::GetController (void) +{ + return mController; +} +const AAX_IController* AAX_CEffectGUI::GetController (void) const +{ + return mController; +} + +// ******************************************************************************* +// METHOD: GetEffectParameters +// ******************************************************************************* +AAX_IEffectParameters* AAX_CEffectGUI::GetEffectParameters (void) +{ + return mEffectParameters; +} +const AAX_IEffectParameters* AAX_CEffectGUI::GetEffectParameters (void) const +{ + return mEffectParameters; +} + +// ******************************************************************************* +// METHOD: GetViewContainer +// ******************************************************************************* +AAX_IViewContainer* AAX_CEffectGUI::GetViewContainer (void) +{ + return mViewContainer.get(); +} +const AAX_IViewContainer* AAX_CEffectGUI::GetViewContainer (void) const +{ + return mViewContainer.get(); +} + + +// ******************************************************************************* +// METHOD: Transport +// ******************************************************************************* +AAX_ITransport* AAX_CEffectGUI::Transport() +{ + return mTransport; +} +const AAX_ITransport* AAX_CEffectGUI::Transport() const +{ + return mTransport; +} diff --git a/modules/juce_audio_plugin_client/AAX/SDK/Libs/AAXLibrary/source/AAX_CEffectParameters.cpp b/modules/juce_audio_plugin_client/AAX/SDK/Libs/AAXLibrary/source/AAX_CEffectParameters.cpp new file mode 100644 index 0000000000..cee703c3d6 --- /dev/null +++ b/modules/juce_audio_plugin_client/AAX/SDK/Libs/AAXLibrary/source/AAX_CEffectParameters.cpp @@ -0,0 +1,1040 @@ +/*================================================================================================*/ +/* + * Copyright 2013-2017, 2019, 2023-2024 Avid Technology, Inc. + * All rights reserved. + * + * This file is part of the Avid AAX SDK. + * + * The AAX SDK is subject to commercial or open-source licensing. + * + * By using the AAX SDK, you agree to the terms of both the Avid AAX SDK License + * Agreement and Avid Privacy Policy. + * + * AAX SDK License: https://developer.avid.com/aax + * Privacy Policy: https://www.avid.com/legal/privacy-policy-statement + * + * Or: You may also use this code under the terms of the GPL v3 (see + * www.gnu.org/licenses). + * + * THE AAX SDK IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER + * EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE + * DISCLAIMED. + * + */ +/*================================================================================================*/ + +#include "AAX_CEffectParameters.h" +#include "AAX_VController.h" +#include "AAX_VAutomationDelegate.h" +#include "AAX_VTransport.h" +#include "AAX_VPageTable.h" +#include "AAX_Assert.h" +#include "AAX_CParameterManager.h" +#include "AAX_CPacketDispatcher.h" +#include +#include + + +AAX_CParamID cPreviewID = "PreviewID"; +AAX_CParamID cDefaultMasterBypassID = "MasterBypassID"; + +const AAX_CTypeID CONTROLS_CHUNK_ID = 'elck'; +const char CONTROLS_CHUNK_DESCRIPTION[] = "Complete Controls State"; + +/*! +* \internal Converts four character AAX_CTypeID to a string. Used by chunk methods. +*/ +inline void ConvertOSTypeToCString(AAX_CTypeID osType, char *outStr) +{ + char *source = (char *)&osType; + outStr[4] = 0; +#if defined(__BIG_ENDIAN__) && (0 != __BIG_ENDIAN__) + outStr[0] = source[0]; + outStr[1] = source[1]; + outStr[2] = source[2]; + outStr[3] = source[3]; +#else + outStr[3] = source[0]; + outStr[2] = source[1]; + outStr[1] = source[2]; + outStr[0] = source[3]; +#endif +} + +int32_t NormalizedToInt32(double normalizedValue) +{ + //clamp the normalized value, just to make sure... + if (normalizedValue > 1) + normalizedValue = 1; + if (normalizedValue < 0) + normalizedValue = 0; + + //Convert the double [0 to 1] to a full range int. + return (int32_t)(std::floor(double(AAX_INT32_MIN) + normalizedValue * (double(AAX_INT32_MAX) - double(AAX_INT32_MIN)) + 0.5)); +} + +double Int32ToNormalized(int32_t value) +{ + double normalizedValue = double(value) - double(AAX_INT32_MIN); + normalizedValue = normalizedValue / (double(AAX_INT32_MAX) - double(AAX_INT32_MIN)); + return normalizedValue; +} + +double BoolToNormalized (bool value ) +{ + if ( value ) + return 1.0; + return 0.0; +} + + +/*===================================================================================================*/ +AAX_CEffectParameters::AAX_CEffectParameters (void) +: mNumPlugInChanges(0) +, mChunkSize(0) +, mChunkParser() +, mNumChunkedParameters(0) +, mPacketDispatcher() +, mParameterManager() +, mFilteredParameters() +, mController(NULL) +, mTransport(NULL) +, mAutomationDelegate(NULL) +{ +} + +AAX_CEffectParameters::~AAX_CEffectParameters(void) +{ +} + +AAX_Result AAX_CEffectParameters::Initialize(IACFUnknown* inController) +{ + AAX_Result err = AAX_SUCCESS; + mController = new AAX_VController(inController); + mAutomationDelegate = new AAX_VAutomationDelegate(inController); + mTransport = new AAX_VTransport(inController); + + mParameterManager.Initialize(mAutomationDelegate); + mPacketDispatcher.Initialize(mController, this); + + //Call into EffectInit() which is a pure virtual hook for 3Ps to override, where they add parameters and meters. + err = EffectInit(); + if (err != AAX_SUCCESS) + { + return err; + } + + //Filter out the MasterBypass control as the effect layer used to do. + AAX_CString bypassID; + GetMasterBypassParameter(&bypassID); + FilterParameterIDOnSave((AAX_CParamID)bypassID.Get()); + + // Subtract any controls that have been eliminated from the chunk with a FilterControlIdOnSave(). + int32_t numControls = 0; + if (AAX_SUCCESS == GetNumberOfParameters(&numControls)) { + if (numControls > 0) { + mNumChunkedParameters = numControls - int32_t(mFilteredParameters.size()); + AAX_ASSERT(mNumChunkedParameters >= 0); + } + } + else { + AAX_TRACE_RELEASE(kAAX_Trace_Priority_Critical, "AAX_CEffectParameters::Initialize - error getting the number of parameters"); + } + + return err; +} + +AAX_Result AAX_CEffectParameters::Uninitialize() +{ + mParameterManager.RemoveAllParameters(); + + if ( mController ) + { + delete mController; + mController = NULL; + } + if ( mAutomationDelegate ) + { + delete mAutomationDelegate; + mAutomationDelegate = NULL; + } + if ( mTransport ) + { + delete mTransport; + mTransport = NULL; + } + + return AAX_SUCCESS; +} + +AAX_Result AAX_CEffectParameters::NotificationReceived(AAX_CTypeID inNotificationType, const void * inNotificationData, uint32_t /*inNotificationDataSize*/) +{ + switch (inNotificationType) { + case AAX_eNotificationEvent_ASPreviewState: + { + AAX_IParameter* parameter = mParameterManager.GetParameterByID(cPreviewID); + if (parameter != 0) + { + int32_t previewState = *reinterpret_cast(inNotificationData); + parameter->SetValueWithBool((previewState == 0) ? false : true); + } + return AAX_SUCCESS; + } + } + + return AAX_SUCCESS; +} + + +AAX_IController* AAX_CEffectParameters::Controller() +{ + return mController; +} + +const AAX_IController* AAX_CEffectParameters::Controller() const +{ + return mController; +} + +AAX_IAutomationDelegate* AAX_CEffectParameters::AutomationDelegate() +{ + return mAutomationDelegate; +} + +const AAX_IAutomationDelegate* AAX_CEffectParameters::AutomationDelegate() const +{ + return mAutomationDelegate; +} + +AAX_Result AAX_CEffectParameters::GetNumberOfParameters(int32_t* aNumControls) const +{ + *aNumControls = mParameterManager.NumParameters(); + return AAX_SUCCESS; +} + +AAX_Result AAX_CEffectParameters::GetMasterBypassParameter( AAX_IString * oMasterBypassControl ) const +{ + // Having this return a default value when this class doesn't actually create this parameter cause all sorts of bugs. This needs to return NULL. However, if the default master bypass ID is used and that parameter exists, we will return that value. Mainly this is to preserve behavior for people who've already ported their plug-ins using the older code. When adding a parameter, please use cDefaultMasterBypassID instead calling this function. + if (mParameterManager.GetParameterByID(cDefaultMasterBypassID) != 0) + *oMasterBypassControl = AAX_CString(cDefaultMasterBypassID); + else + *oMasterBypassControl = AAX_CString(""); + + return AAX_SUCCESS; +} + +AAX_Result AAX_CEffectParameters::GetParameterIsAutomatable( AAX_CParamID iParameterID, AAX_CBoolean * itIs ) const +{ + *itIs = false; + const AAX_IParameter* parameter = mParameterManager.GetParameterByID(iParameterID); + if (parameter == 0) + return AAX_ERROR_INVALID_PARAMETER_ID; + + *itIs = static_cast(parameter->Automatable()); + return AAX_SUCCESS; +} + +AAX_Result AAX_CEffectParameters::GetParameterNumberOfSteps( AAX_CParamID iParameterID, int32_t * aNumSteps ) const +{ + const AAX_IParameter* parameter = mParameterManager.GetParameterByID( iParameterID ); + if (parameter == 0) + return AAX_ERROR_INVALID_PARAMETER_ID; + + const uint32_t numSteps = parameter->GetNumberOfSteps(); + if (numSteps > 0x7FFFFFFF) + return AAX_ERROR_SIGNED_INT_OVERFLOW; + + *aNumSteps = static_cast(numSteps); + return AAX_SUCCESS; +} + + +AAX_Result AAX_CEffectParameters::GetParameterValueString ( AAX_CParamID iParameterID, AAX_IString * oValueString, int32_t iMaxLength ) const +{ + // Right now, this one isn't called from DAE. It instead calls GetParameterStringFromValue(). + const AAX_IParameter* parameter = mParameterManager.GetParameterByID(iParameterID); + AAX_CString str; + + if (parameter == 0) + return AAX_ERROR_INVALID_PARAMETER_ID; + + parameter->GetValueString(iMaxLength, &str); + *oValueString = str; + return AAX_SUCCESS; +} + + +AAX_Result AAX_CEffectParameters::GetParameterValueFromString ( AAX_CParamID iParameterID, double * oValuePtr, const AAX_IString & iValueString ) const +{ + const AAX_IParameter* parameter = mParameterManager.GetParameterByID(iParameterID); + const AAX_CString valueStr(iValueString); + double normValue; + + if (parameter == 0) + return AAX_ERROR_INVALID_PARAMETER_ID; + + if (!parameter->GetNormalizedValueFromString(valueStr, &normValue)) + return AAX_ERROR_INVALID_STRING_CONVERSION; + + *oValuePtr = normValue; + return AAX_SUCCESS; +} + +AAX_Result AAX_CEffectParameters::GetParameterStringFromValue ( AAX_CParamID iParameterID, double value, AAX_IString * valueString, int32_t maxLength ) const +{ + const AAX_IParameter * parameter = mParameterManager.GetParameterByID(iParameterID); + AAX_CString valueStr; + + if (parameter == 0) + return AAX_ERROR_INVALID_PARAMETER_ID; + + if (!parameter->GetStringFromNormalizedValue(value, maxLength, valueStr)) + return AAX_ERROR_INVALID_STRING_CONVERSION; + + *valueString = valueStr; + return AAX_SUCCESS; +} + +AAX_Result AAX_CEffectParameters::GetParameterName( AAX_CParamID iParameterID, AAX_IString * oName ) const +{ + const AAX_IParameter* parameter = mParameterManager.GetParameterByID( iParameterID ); + if (parameter != 0) + { + *oName = parameter->Name(); + } + else + *oName = ""; + + return AAX_SUCCESS; +} + + +AAX_Result AAX_CEffectParameters::GetParameterNameOfLength ( AAX_CParamID iParameterID, AAX_IString * oName, int32_t iNameLength ) const +{ + AAX_Result aResult = AAX_ERROR_INVALID_STRING_CONVERSION; + + if (NULL != oName) + { + aResult = AAX_SUCCESS; + + const AAX_IParameter* parameter = mParameterManager.GetParameterByID( iParameterID ); + if (parameter != 0) + { + // Try to get a shortened name from the parameter first. (If there aren't any short names, this function will return the full name to be shortened here.) + const AAX_CString& shortName = parameter->ShortenedName(iNameLength); + + // Legacy name shortening algorithm kept here to keep similar behavior with ported plug-ins. + std::vector controlNameStrings; + char aTempName[256]; + aTempName[0] = 0; + strncpy ( aTempName, shortName.CString(), 255 ); + int tempLength = int(strlen ( aTempName )); + char * curLoc = aTempName; + char * endLoc = curLoc + tempLength; + while ( curLoc < endLoc ) + { + controlNameStrings.push_back( curLoc ); + char *returnLoc = strchr( curLoc, '\n' ); + if ( returnLoc ) + { + *returnLoc = 0; + curLoc = returnLoc + 1; + } + else curLoc = endLoc; + } + + int32_t maxSize = 0; + std::vector::iterator iter = controlNameStrings.begin(); + for ( ; iter != controlNameStrings.end(); ++iter ) + { + if ( (int32_t) iter->size() > maxSize && (int32_t) iter->size() <= iNameLength ) + { + maxSize = int32_t(iter->size()); + oName->Set(iter->c_str()); + } + } + + if ( maxSize == 0 && controlNameStrings.size () > 0 ) + { + if (0 < iNameLength) + { + shortName.SubString(0, static_cast(iNameLength), oName); + } + else + { + oName->Set(""); + } + } + } + else + { + oName->Set(""); + } + } + + return aResult; +} + + +AAX_Result AAX_CEffectParameters::GetParameterNormalizedValue ( AAX_CParamID iParameterID, double * oValuePtr ) const +{ + const AAX_IParameter* parameter = mParameterManager.GetParameterByID( iParameterID ); + if (parameter == 0) + return AAX_ERROR_INVALID_PARAMETER_ID; + + *oValuePtr = parameter->GetNormalizedValue(); + return AAX_SUCCESS; +} + + +AAX_Result AAX_CEffectParameters::GetParameterDefaultNormalizedValue( AAX_CParamID iParameterID, double * aValuePtr ) const +{ + const AAX_IParameter* parameter = mParameterManager.GetParameterByID( iParameterID ); + if (parameter == 0) + return AAX_ERROR_INVALID_PARAMETER_ID; + + *aValuePtr = parameter->GetNormalizedDefaultValue(); + return AAX_SUCCESS; +} + +AAX_Result AAX_CEffectParameters::SetParameterDefaultNormalizedValue(AAX_CParamID iParameterID, double theDefaultValue) +{ + AAX_IParameter* parameter = mParameterManager.GetParameterByID( iParameterID ); + if (parameter == 0) + return AAX_ERROR_INVALID_PARAMETER_ID; + + parameter->SetNormalizedDefaultValue(theDefaultValue); + return AAX_SUCCESS; +} + + +AAX_Result AAX_CEffectParameters::SetParameterNormalizedValue (AAX_CParamID iParameterID, double aValue) +{ + // Right now, let's try calling SetNormalizedValue() and see how the automated parameter + // wrapper works out. This basically forwards this call into the parameter manager's + // SetValue() call, which should then do the token dispatching. That may call back into + // this object for now, but eventually, it should all be self contained in the parameter manager + // so we can remove this wrapper in the future. + AAX_IParameter* parameter = mParameterManager.GetParameterByID(iParameterID); + if (parameter == 0) + return AAX_ERROR_INVALID_PARAMETER_ID; + + parameter->SetNormalizedValue ( aValue ); + return AAX_SUCCESS; +} + + +AAX_Result AAX_CEffectParameters::SetParameterNormalizedRelative(AAX_CParamID iParameterID, double aValue) +{ + // This assumes that controls are NOT meant to wrap. + // If that's the desired action, then override this puppy. + + double oldValue; + double newValue; + + AAX_Result result = this->GetParameterNormalizedValue(iParameterID, &oldValue); + if (result != AAX_SUCCESS) + return result; + + newValue = aValue+oldValue; + + //Clamp the value. + if (newValue > 1.0) + newValue = 1.0; + if (newValue < 0.0) + newValue = 0.0; + + return this->SetParameterNormalizedValue(iParameterID, newValue); +} + + +AAX_Result AAX_CEffectParameters::TouchParameter(AAX_CParamID iParameterID) +{ + AAX_IParameter * parameter = mParameterManager.GetParameterByID( iParameterID ); + if ( parameter ) + parameter->Touch (); + else return AAX_ERROR_INVALID_PARAMETER_ID; + + return AAX_SUCCESS; +} + + +AAX_Result AAX_CEffectParameters::ReleaseParameter(AAX_CParamID iParameterID) +{ + AAX_IParameter * parameter = mParameterManager.GetParameterByID( iParameterID ); + if ( parameter ) + parameter->Release (); + else return AAX_ERROR_INVALID_PARAMETER_ID; + + return AAX_SUCCESS; +} + + +AAX_Result AAX_CEffectParameters::UpdateParameterTouch ( AAX_CParamID /*iParameterID*/, AAX_CBoolean /*iTouchState*/ ) +{ + return AAX_SUCCESS; +} + + + +AAX_Result AAX_CEffectParameters::UpdateParameterNormalizedValue(AAX_CParamID iParameterID, double aValue, AAX_EUpdateSource /*iSource*/ ) +{ + AAX_Result result = AAX_SUCCESS; + + // We will be using a custom entry point in AAX_IParameter. + AAX_IParameter* parameter = mParameterManager.GetParameterByID( iParameterID ); + if (parameter == 0) + return AAX_ERROR_INVALID_PARAMETER_ID; + + const double prevValue = parameter->GetNormalizedValue(); + + // Store the value into the parameter. + parameter->UpdateNormalizedValue(aValue); + + // Now the control has changed + result = mPacketDispatcher.SetDirty(iParameterID); + + if (prevValue != aValue) + ++mNumPlugInChanges; + + return result; +} + +AAX_Result AAX_CEffectParameters::GenerateCoefficients() +{ + AAX_Result result = AAX_SUCCESS; + + result = mPacketDispatcher.Dispatch(); + + return result; +} + +AAX_Result AAX_CEffectParameters::ResetFieldData (AAX_CFieldIndex /*inFieldIndex*/, void* oData, uint32_t inDataSize) const +{ + //Default implementation is just to zero out all data. + memset(oData, 0, inDataSize); + return AAX_SUCCESS; +} + + +AAX_Result AAX_CEffectParameters::UpdateParameterNormalizedRelative(AAX_CParamID iParameterID, double aValue) +{ + // This assumes that controls are NOT meant to wrap. + // If that's the desired action, then override this puppy. + double oldValue; + double newValue; + + AAX_Result result = this->GetParameterNormalizedValue( iParameterID, &oldValue ); + if (result != AAX_SUCCESS) + return result; + + newValue = aValue + oldValue; + + //Clamp the value to the normalized range. + if (newValue > 1.0) + newValue = 1.0; + if (newValue < 0.0) + newValue = 0.0; + + return this->UpdateParameterNormalizedValue( iParameterID, newValue, AAX_eUpdateSource_Unspecified ); +} + +AAX_Result AAX_CEffectParameters::GetNumberOfChunks ( int32_t * numChunks ) const +{ + *numChunks = 1; //just the standard control chunk. + return AAX_SUCCESS; +} + + +AAX_Result AAX_CEffectParameters::GetChunkIDFromIndex ( int32_t index, AAX_CTypeID * chunkID ) const +{ + if (index != 0) + { + *chunkID = AAX_CTypeID(0); + return AAX_ERROR_INVALID_CHUNK_INDEX; + } + + *chunkID = CONTROLS_CHUNK_ID; + return AAX_SUCCESS; +} + + +AAX_Result AAX_CEffectParameters::GetChunkSize ( AAX_CTypeID chunkID, uint32_t * oSize ) const +{ + if (chunkID != CONTROLS_CHUNK_ID) + { + *oSize = 0; + return AAX_ERROR_INVALID_CHUNK_ID; + } + + BuildChunkData(); + mChunkSize = mChunkParser.GetChunkDataSize(); + + if (mChunkSize < 0) + { + return AAX_ERROR_INCORRECT_CHUNK_SIZE; + } + + *oSize = static_cast(mChunkSize); + return AAX_SUCCESS; +} + + +AAX_Result AAX_CEffectParameters::GetChunk ( AAX_CTypeID chunkID, AAX_SPlugInChunk * chunk ) const +{ + //Check the chunkID + if (chunkID != CONTROLS_CHUNK_ID) + return AAX_ERROR_INVALID_CHUNK_ID; + + //Build the chunk. + BuildChunkData(); + int32_t currentChunkSize = mChunkParser.GetChunkDataSize(); //Verify that the chunk data size hasn't changed since the last GetChunkSize call. + if (mChunkSize != currentChunkSize || mChunkSize == 0) + { + return AAX_ERROR_INCORRECT_CHUNK_SIZE; //If mChunkSize doesn't match the currently built chunk, then its likely that the previous call to GetChunkSize() didn't return the correct size. + } + + //Set the version on the chunk data structure. The other manID, prodID, PlugID, and fSize are populated already, coming from AAXCollection. + chunk->fVersion = mChunkParser.GetChunkVersion(); + memset(chunk->fName, 0, 32); //Just in case, lets make sure unused chars are null. + strncpy(reinterpret_cast(chunk->fName), CONTROLS_CHUNK_DESCRIPTION, 31); + return mChunkParser.GetChunkData(chunk); +} + + +AAX_Result AAX_CEffectParameters::SetChunk ( AAX_CTypeID chunkID, const AAX_SPlugInChunk * chunk ) +{ + if (chunkID != CONTROLS_CHUNK_ID) + return AAX_ERROR_INVALID_CHUNK_ID; + + mChunkParser.LoadChunk(chunk); + + int32_t numControls = 0, controlIndex = 0; + AAX_Result err = AAX_SUCCESS; + err = this->GetNumberOfParameters(&numControls); + if (AAX_SUCCESS != err) { + AAX_TRACE_RELEASE(kAAX_Trace_Priority_Critical, "AAX_CEffectParameters::SetChunk - error getting the number of parameters"); + return err; + } + + for (controlIndex = 0; controlIndex < numControls; controlIndex++) + { + AAX_IParameter* parameter; + parameter = mParameterManager.GetParameter(controlIndex); + if (parameter != 0) + { + AAX_CParamID parameterID = parameter->Identifier(); + if (mFilteredParameters.find(parameterID) == mFilteredParameters.end()) + { + bool boolValue; + int32_t intValue; + float floatValue; + double doubleValue; + AAX_CString stringValue; + + if (parameter->GetValueAsFloat(&floatValue)) + { + if (mChunkParser.FindDouble(parameterID, &doubleValue)) + parameter->SetValueWithFloat((float)doubleValue); + } + else if (parameter->GetValueAsInt32(&intValue)) + { + if (mChunkParser.FindInt32(parameterID, &intValue)) + parameter->SetValueWithInt32(intValue); + } + else if (parameter->GetValueAsBool(&boolValue)) + { + if (mChunkParser.FindInt32(parameterID, &intValue)) + parameter->SetValueWithBool(intValue != 0); + } + else if (parameter->GetValueAsDouble(&doubleValue)) + { + if (mChunkParser.FindDouble(parameterID, &doubleValue)) + parameter->SetValueWithDouble(doubleValue); + } + else if (parameter->GetValueAsString(&stringValue)) + { + if (mChunkParser.FindString(parameterID, &stringValue)) + parameter->SetValueWithString(stringValue); + } + } + } + } + + return AAX_SUCCESS; +} + + +AAX_Result AAX_CEffectParameters::CompareActiveChunk ( const AAX_SPlugInChunk * aChunkP, AAX_CBoolean * aIsEqualP ) const +{ + if (aChunkP->fChunkID != CONTROLS_CHUNK_ID) + { + // If we don't know what the chunk is then we don't want to be turning on the compare light unnecessarily. + *aIsEqualP = true; + return AAX_SUCCESS; + } + + // Now we assume they aren't equal until we make it through all the controls. + *aIsEqualP = false; + + mChunkParser.LoadChunk(aChunkP); + int32_t numControls = 0; + AAX_Result err = AAX_SUCCESS; + err = this->GetNumberOfParameters(&numControls); + if (AAX_SUCCESS != err) { + AAX_TRACE_RELEASE(kAAX_Trace_Priority_Critical, "AAX_CEffectParameters::CompareActiveChunk - error getting the number of parameters"); + return err; + } + + for (int32_t controlIndex = 0; controlIndex < numControls; controlIndex++) + { + const AAX_IParameter* parameter = mParameterManager.GetParameter(controlIndex); + AAX_ASSERT(NULL != parameter); + if (!parameter) + continue; + + AAX_CParamID parameterID = parameter->Identifier(); + + if (mFilteredParameters.find(parameterID) == mFilteredParameters.end()) + { + bool boolValue; + int32_t intValue, chunkIntValue; + float floatValue; + double doubleValue, chunkDoubleValue; + AAX_CString stringValue, chunkStringValue; + + if (parameter->GetValueAsFloat(&floatValue)) + { + // It seems like float parameters stores their value in chunks as double. Do we really need this behavior? + if ( !mChunkParser.FindDouble(parameterID, &chunkDoubleValue) || + floatValue != static_cast(chunkDoubleValue) ) + return AAX_SUCCESS; + } + else if (parameter->GetValueAsInt32(&intValue)) + { + if ( !mChunkParser.FindInt32(parameterID, &chunkIntValue) || + intValue != chunkIntValue ) + return AAX_SUCCESS; + } + else if (parameter->GetValueAsBool(&boolValue)) + { + if ( !mChunkParser.FindInt32(parameterID, &chunkIntValue) ) + return AAX_SUCCESS; + + if ( (chunkIntValue != 0) != boolValue ) + return AAX_SUCCESS; + } + else if (parameter->GetValueAsDouble(&doubleValue)) + { + if ( !mChunkParser.FindDouble(parameterID, &chunkDoubleValue) || + (float)doubleValue != (float)chunkDoubleValue ) + return AAX_SUCCESS; + } + else if (parameter->GetValueAsString(&stringValue)) + { + if ( !mChunkParser.FindString(parameterID, &chunkStringValue) || + stringValue != chunkStringValue ) + return AAX_SUCCESS; + } + } + } + + //[8/3/2005, Bobby Lombardi, Impact: 8, Staley, x315] + //After speaking with Chris T some more about the proposed fixes, Product Marketing + //would like to support the fix that bases the compare light activity on quantizing + //to the specific plug-in's control value units. For example, if a Gain control is + //in .1 increments of dB, the compare light activity should be triggered each change + //of a .1 dB, regardless of whether the control value skips over .1/tenth dB values. + + // 1/17/2011. This can be done by correct using the Precision parameter in + // TaperDelegate and DisplayDelegate templates. + + *aIsEqualP = true; + return AAX_SUCCESS; +} + + +AAX_Result AAX_CEffectParameters::GetNumberOfChanges ( int32_t * aValueP ) const +{ + if(mNumPlugInChanges >= 0) + { + *aValueP = mNumPlugInChanges; + } + + return (AAX_SUCCESS); +} + + +AAX_Result AAX_CEffectParameters::GetParameterType ( AAX_CParamID iParameterID, AAX_EParameterType * aControlType ) const +{ + const AAX_IParameter* parameter = mParameterManager.GetParameterByID( iParameterID ); + if (parameter == 0) + return AAX_ERROR_INVALID_PARAMETER_ID; + + *aControlType = parameter->GetType(); + return AAX_SUCCESS; +} + + +AAX_Result AAX_CEffectParameters::GetParameterOrientation( AAX_CParamID iParameterID, AAX_EParameterOrientation * aControlOrientation ) const +{ + const AAX_IParameter* parameter = mParameterManager.GetParameterByID( iParameterID ); + if (parameter == 0) + return AAX_ERROR_INVALID_PARAMETER_ID; + + *aControlOrientation = parameter->GetOrientation(); + return AAX_SUCCESS; +} + +AAX_Result AAX_CEffectParameters::GetParameter(AAX_CParamID iParameterID, AAX_IParameter** parameter) +{ + *parameter = mParameterManager.GetParameterByID( iParameterID ); + if (*parameter == 0) + return AAX_ERROR_INVALID_PARAMETER_ID; + return AAX_SUCCESS; +} + +AAX_Result AAX_CEffectParameters::GetParameterIndex( AAX_CParamID iParameterID, int32_t * oControlIndex ) const +{ + *oControlIndex = mParameterManager.GetParameterIndex( iParameterID ); + if (*oControlIndex < 0) + return AAX_ERROR_INVALID_PARAMETER_ID; + + return AAX_SUCCESS; +} + +AAX_Result AAX_CEffectParameters::GetParameterIDFromIndex( int32_t iControlIndex, AAX_IString * oParameterID ) const +{ + const AAX_IParameter * parameter = mParameterManager.GetParameter( iControlIndex ); + if ( parameter ) + *oParameterID = parameter->Identifier(); + else + { + *oParameterID = ""; + return AAX_ERROR_INVALID_PARAMETER_ID; + } + + return AAX_SUCCESS; +} + +AAX_Result AAX_CEffectParameters::GetParameterValueInfo ( AAX_CParamID /*iParameterID*/, int32_t /*iSelector*/, int32_t* oValue) const +{ + // plugins should override this method if they wish to use + // the parameter properties + *oValue = 0; + return AAX_ERROR_UNIMPLEMENTED; +} + +////////////////////////////////////Internal Functions, no longer the interface. + + +void AAX_CEffectParameters::BuildChunkData() const +{ + mChunkParser.Clear(); + + int32_t numControls = 0; + if (AAX_SUCCESS != this->GetNumberOfParameters(&numControls)) { + AAX_TRACE_RELEASE(kAAX_Trace_Priority_Critical, "AAX_CEffectParameters::BuildChunkData - error getting the number of parameters"); + return; + } + + for (int32_t controlIndex = 0; controlIndex < numControls; controlIndex++) + { + const AAX_IParameter* parameter = mParameterManager.GetParameter(controlIndex); + AAX_ASSERT(NULL != parameter); + if (!parameter) + continue; + + const char* parameterID = parameter->Identifier(); + + if (mFilteredParameters.find(parameterID) == mFilteredParameters.end()) + { + bool boolValue; + int32_t intValue; + float floatValue; + double doubleValue; + AAX_CString stringValue; + + if (parameter->GetValueAsFloat(&floatValue)) + { + mChunkParser.AddDouble(parameterID, floatValue); + } + else if (parameter->GetValueAsInt32(&intValue)) + { + mChunkParser.AddInt32(parameterID, intValue); + } + else if (parameter->GetValueAsBool(&boolValue)) + { + mChunkParser.AddInt32(parameterID, int32_t(boolValue)); + } + else if (parameter->GetValueAsDouble(&doubleValue)) + { + mChunkParser.AddDouble(parameterID, doubleValue); + } + else if (parameter->GetValueAsString(&stringValue)) + { + mChunkParser.AddString(parameterID, stringValue); + } + } + } +} + +//---------------------------------------------------------------------------------------------- +void AAX_CEffectParameters::FilterParameterIDOnSave( AAX_CParamID parameterID ) +{ + if (parameterID != 0) + mFilteredParameters.insert(parameterID); +} + +//---------------------------------------------------------------------------------------------- +// METHOD: TimerWakeup +//---------------------------------------------------------------------------------------------- +AAX_Result AAX_CEffectParameters::TimerWakeup( ) +{ + return AAX_SUCCESS; //Default implementation doesn't do anything. +} + +//---------------------------------------------------------------------------------------------- +// METHOD: GetCurveData +//---------------------------------------------------------------------------------------------- +AAX_Result AAX_CEffectParameters::GetCurveData( /* AAX_ECurveType */ AAX_CTypeID /*iCurveType*/, const float * /*iValues*/, uint32_t /*iNumValues*/, float * /*oValues*/ ) const +{ + // Default implementation doesn't do anything. Just returns unimplemented. + // Could clear these values, but that takes up unnecessary cycles and there isn't an obvious clear state for every curve type. + return AAX_ERROR_UNIMPLEMENTED; +} + +//---------------------------------------------------------------------------------------------- +// METHOD: GetCurveDataMeterIds +//---------------------------------------------------------------------------------------------- +AAX_Result AAX_CEffectParameters::GetCurveDataMeterIds( /* AAX_ECurveType */ AAX_CTypeID /*iCurveType*/, uint32_t* /*oXMeterId*/, uint32_t* /*oYMeterId*/ ) const +{ + // Default implementation doesn't do anything. Just returns unimplemented. + return AAX_ERROR_UNIMPLEMENTED; +} + +//---------------------------------------------------------------------------------------------- +// METHOD: GetCurveDataDisplayRange +//---------------------------------------------------------------------------------------------- +AAX_Result AAX_CEffectParameters::GetCurveDataDisplayRange( /* AAX_ECurveType */ AAX_CTypeID /*iCurveType*/, float* /*oXMin*/, float* /*oXMax*/, float* /*oYMin*/, float* /*oYMax*/ ) const +{ + // Default implementation doesn't do anything. Just returns unimplemented. + return AAX_ERROR_UNIMPLEMENTED; +} + +//---------------------------------------------------------------------------------------------- +// METHOD: UpdatePageTable +//---------------------------------------------------------------------------------------------- +AAX_Result AAX_CEffectParameters::UpdatePageTable(uint32_t inTableType, int32_t inTablePageSize, IACFUnknown* /*iHostUnknown*/, IACFUnknown* ioPageTableUnknown) const +{ + AAX_Result result = AAX_SUCCESS; + AAX_VPageTable hostPageTable(ioPageTableUnknown); + if (hostPageTable.IsSupported()) + { + result = this->UpdatePageTable(inTableType, inTablePageSize, hostPageTable); + } + return result; // success result is fine here if the host did not provide valid IACFUnknowns - in that case we just assume that the host does not support this feature +} + +//---------------------------------------------------------------------------------------------- +// METHOD: GetCustomData +//---------------------------------------------------------------------------------------------- +AAX_Result AAX_CEffectParameters::GetCustomData( AAX_CTypeID /*iDataBlockID*/, uint32_t /*inDataSize*/, void* /*oData*/, uint32_t* oDataWritten) const +{ + *oDataWritten = 0; + return AAX_SUCCESS; +} + + +//---------------------------------------------------------------------------------------------- +// METHOD: SetCustomData +//---------------------------------------------------------------------------------------------- +AAX_Result AAX_CEffectParameters::SetCustomData( AAX_CTypeID /*iDataBlockID*/, uint32_t /*inDataSize*/, const void* /*iData*/ ) +{ + return AAX_SUCCESS; +} + +//---------------------------------------------------------------------------------------------- +// METHOD: RenderAudio_Hybrid +//---------------------------------------------------------------------------------------------- +AAX_Result AAX_CEffectParameters::RenderAudio_Hybrid(AAX_SHybridRenderInfo* /*ioRenderInfo*/) +{ + return AAX_ERROR_UNIMPLEMENTED; +} + +//---------------------------------------------------------------------------------------------- +// METHOD: AAX_UpdateMIDINodes +//---------------------------------------------------------------------------------------------- +AAX_Result AAX_CEffectParameters::UpdateMIDINodes( AAX_CFieldIndex /*inFieldIndex*/, AAX_CMidiPacket& /*iPacket*/ ) +{ + return AAX_SUCCESS; +} + +AAX_Result AAX_CEffectParameters::UpdateControlMIDINodes( AAX_CTypeID /*nodeID*/, AAX_CMidiPacket& /*iPacket*/ ) +{ + return AAX_SUCCESS; +} + +AAX_ITransport* AAX_CEffectParameters::Transport() +{ + return mTransport; +} + +const AAX_ITransport* AAX_CEffectParameters::Transport() const +{ + return mTransport; +} + +bool AAX_CEffectParameters::IsParameterTouched ( AAX_CParamID inParameterID ) const +{ + AAX_CBoolean touched = false; + if ( mAutomationDelegate ) + { + if ( mAutomationDelegate->GetTouchState ( inParameterID, &touched ) != AAX_SUCCESS ) + touched = false; + } + + return (touched != false); +} + +bool AAX_CEffectParameters::IsParameterLinkReady ( AAX_CParamID inParameterID, AAX_EUpdateSource inSource ) const +{ + AAX_CBoolean linkReady = false; + if ( inSource != AAX_eUpdateSource_Parameter && + inSource != AAX_eUpdateSource_Chunk && + inSource != AAX_eUpdateSource_Delay ) + { + if ( mAutomationDelegate ) + { + if ( mAutomationDelegate->GetTouchState ( inParameterID, &linkReady ) != AAX_SUCCESS ) + linkReady = false; + } + } + + return (linkReady != false); +} + + +AAX_Result AAX_CEffectParameters::SetTaperDelegate ( AAX_CParamID iParameterID, AAX_ITaperDelegateBase & inTaperDelegate, bool inPreserveValue ) +{ + AAX_IParameter * parameter = mParameterManager.GetParameterByID ( iParameterID ); + if ( parameter == 0 ) + return AAX_ERROR_INVALID_PARAMETER_ID; + + parameter->SetTaperDelegate ( inTaperDelegate, inPreserveValue ); + + if ( ! inPreserveValue ) + mPacketDispatcher.SetDirty ( iParameterID ); + + return AAX_SUCCESS; +} + +AAX_Result AAX_CEffectParameters::SetDisplayDelegate ( AAX_CParamID iParameterID, AAX_IDisplayDelegateBase & inDisplayDelegate ) +{ + AAX_IParameter * parameter = mParameterManager.GetParameterByID ( iParameterID ); + if ( parameter == 0 ) + return AAX_ERROR_INVALID_PARAMETER_ID; + + parameter->SetDisplayDelegate ( inDisplayDelegate ); + return AAX_SUCCESS; +} diff --git a/modules/juce_audio_plugin_client/AAX/SDK/Libs/AAXLibrary/source/AAX_CHostProcessor.cpp b/modules/juce_audio_plugin_client/AAX/SDK/Libs/AAXLibrary/source/AAX_CHostProcessor.cpp new file mode 100644 index 0000000000..e4f198a09c --- /dev/null +++ b/modules/juce_audio_plugin_client/AAX/SDK/Libs/AAXLibrary/source/AAX_CHostProcessor.cpp @@ -0,0 +1,216 @@ +/*================================================================================================*/ +/* + * Copyright 2010-2017, 2023-2024 Avid Technology, Inc. + * All rights reserved. + * + * This file is part of the Avid AAX SDK. + * + * The AAX SDK is subject to commercial or open-source licensing. + * + * By using the AAX SDK, you agree to the terms of both the Avid AAX SDK License + * Agreement and Avid Privacy Policy. + * + * AAX SDK License: https://developer.avid.com/aax + * Privacy Policy: https://www.avid.com/legal/privacy-policy-statement + * + * Or: You may also use this code under the terms of the GPL v3 (see + * www.gnu.org/licenses). + * + * THE AAX SDK IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER + * EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE + * DISCLAIMED. + * + */ +/*================================================================================================*/ + +#include "AAX_CHostProcessor.h" +#include "AAX_IEffectParameters.h" +#include "AAX_VHostProcessorDelegate.h" +#include "AAX_VController.h" +#include "AAX_IEffectParameters.h" +#include "AAX_UIDs.h" + +// *************************************************************************** +// METHOD: AAX_CHostProcessor +// *************************************************************************** +AAX_CHostProcessor::AAX_CHostProcessor (void) : + mController( NULL ), + mHostProcessingDelegate ( NULL ), + mEffectParameters( NULL ) +{ + mSrcStart = 0; + mSrcEnd = 0; + mDstStart = 0; + mDstEnd = 0; + mLocation = 0; +} + +// *************************************************************************** +// METHOD: ~AAX_CHostProcessor +// *************************************************************************** +AAX_CHostProcessor::~AAX_CHostProcessor () +{ + Uninitialize(); // Just try to double check that this was all torn down. +} + +// *************************************************************************** +// METHOD: Initialize +// *************************************************************************** +AAX_Result AAX_CHostProcessor::Initialize(IACFUnknown* iController) +{ + mController = new AAX_VController(iController); + if (iController == 0 || mController == 0) + return AAX_ERROR_NOT_INITIALIZED; + + mHostProcessingDelegate = new AAX_VHostProcessorDelegate(iController); + if (iController == 0 || mHostProcessingDelegate == 0) + return AAX_ERROR_NOT_INITIALIZED; + + if ( iController ) + { + iController->QueryInterface(IID_IAAXEffectParametersV1, (void **)&mEffectParameters); + } + + return AAX_SUCCESS; +} + +// ******************************************************************************* +// METHOD: Uninitialize +// ******************************************************************************* +AAX_Result AAX_CHostProcessor::Uninitialize ( ) +{ + if (mEffectParameters) + { + mEffectParameters->Release(); + mEffectParameters = 0; + } + + if ( mHostProcessingDelegate ) + { + delete ( mHostProcessingDelegate ); + mHostProcessingDelegate = 0; + } + + if ( mController ) + { + delete ( mController ); + mController = 0; + } + return AAX_SUCCESS; +} + + +// *************************************************************************** +// METHOD: InitOutputBounds +// *************************************************************************** +AAX_Result AAX_CHostProcessor::InitOutputBounds ( int64_t iSrcStart, int64_t iSrcEnd, int64_t * oDstStart, int64_t * oDstEnd ) +{ + AAX_Result result = AAX_SUCCESS; + if (oDstStart && oDstEnd) + { + mSrcStart = iSrcStart; + mSrcEnd = iSrcEnd; + + this->TranslateOutputBounds( mSrcStart, mSrcEnd, *oDstStart, *oDstEnd ); + + mDstStart = *oDstStart; + mDstEnd = *oDstEnd; + } + else + { + result = AAX_ERROR_PLUGIN_NULL_PARAMETER; + } + + return result; +} + +// *************************************************************************** +// METHOD: TranslateOutputBounds +// *************************************************************************** +AAX_Result AAX_CHostProcessor::TranslateOutputBounds ( int64_t iSrcStart, int64_t iSrcEnd, int64_t& oDstStart, int64_t& oDstEnd ) +{ + oDstStart = iSrcStart; + oDstEnd = iSrcEnd; + return AAX_SUCCESS; +} + +// *************************************************************************** +// METHOD: SetLocation +// *************************************************************************** +AAX_Result AAX_CHostProcessor::SetLocation ( int64_t iSample ) +{ + mLocation = iSample; + return AAX_SUCCESS; +} + +// *************************************************************************** +// METHOD: RenderAudio +// *************************************************************************** +AAX_Result AAX_CHostProcessor::RenderAudio ( const float * const /*inAudioIns*/ [], int32_t /*inAudioInCount*/, float * const /*iAudioOuts*/ [], int32_t /*iAudioOutCount*/, int32_t * /*ioWindowSize*/ ) +{ + return AAX_ERROR_UNIMPLEMENTED; +} + +// *************************************************************************** +// METHOD: PreRender +// *************************************************************************** +AAX_Result AAX_CHostProcessor::PreRender ( int32_t /*inAudioInCount*/, int32_t /*iAudioOutCount*/, int32_t /*iWindowSize*/ ) +{ + return AAX_SUCCESS; +} + +// *************************************************************************** +// METHOD: PostRender +// *************************************************************************** +AAX_Result AAX_CHostProcessor::PostRender () +{ + return AAX_SUCCESS; +} + +// *************************************************************************** +// METHOD: AnalyzeAudio +// *************************************************************************** +AAX_Result AAX_CHostProcessor::AnalyzeAudio ( const float * const /*inAudioIns*/ [], int32_t /*inAudioInCount*/, int32_t * /*ioWindowSize*/ ) +{ + return AAX_ERROR_UNIMPLEMENTED; +} + +// *************************************************************************** +// METHOD: PreAnalyze +// *************************************************************************** +AAX_Result AAX_CHostProcessor::PreAnalyze ( int32_t /*inAudioInCount*/, int32_t /*iWindowSize*/ ) +{ + return AAX_SUCCESS; +} + +// *************************************************************************** +// METHOD: PostAnalyze +// *************************************************************************** +AAX_Result AAX_CHostProcessor::PostAnalyze () +{ + return AAX_SUCCESS; +} + +// *************************************************************************** +// METHOD: GetClipNameSuffix +// *************************************************************************** +AAX_Result AAX_CHostProcessor::GetClipNameSuffix ( int32_t /*inMaxLength*/, AAX_IString* /*outString*/ ) const +{ + return AAX_ERROR_UNIMPLEMENTED; +} + +// *************************************************************************** +// METHOD: GetAudio +// *************************************************************************** +AAX_Result AAX_CHostProcessor::GetAudio ( const float * const inAudioIns [], int32_t inAudioInCount, int64_t inLocation, int32_t * ioNumSamples ) +{ + return mHostProcessingDelegate->GetAudio( inAudioIns, inAudioInCount, inLocation, ioNumSamples ); +} + +// *************************************************************************** +// METHOD: GetSideChainInputNum +// *************************************************************************** +int32_t AAX_CHostProcessor::GetSideChainInputNum () +{ + return mHostProcessingDelegate->GetSideChainInputNum(); +} diff --git a/modules/juce_audio_plugin_client/AAX/SDK/Libs/AAXLibrary/source/AAX_CHostServices.cpp b/modules/juce_audio_plugin_client/AAX/SDK/Libs/AAXLibrary/source/AAX_CHostServices.cpp new file mode 100644 index 0000000000..6e765a938b --- /dev/null +++ b/modules/juce_audio_plugin_client/AAX/SDK/Libs/AAXLibrary/source/AAX_CHostServices.cpp @@ -0,0 +1,104 @@ +/*================================================================================================*/ +/* + * Copyright 2013-2015, 2018, 2023-2024 Avid Technology, Inc. + * All rights reserved. + * + * This file is part of the Avid AAX SDK. + * + * The AAX SDK is subject to commercial or open-source licensing. + * + * By using the AAX SDK, you agree to the terms of both the Avid AAX SDK License + * Agreement and Avid Privacy Policy. + * + * AAX SDK License: https://developer.avid.com/aax + * Privacy Policy: https://www.avid.com/legal/privacy-policy-statement + * + * Or: You may also use this code under the terms of the GPL v3 (see + * www.gnu.org/licenses). + * + * THE AAX SDK IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER + * EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE + * DISCLAIMED. + * + */ +/*================================================================================================*/ + + +#include "AAX.h" +#include "AAX_CHostServices.h" +#include "AAX_VHostServices.h" +#include +#include + +static AAX_VHostServices* sHostServices = NULL; + +// *************************************************************************** +// METHOD: Set +// *************************************************************************** +void AAX_CHostServices::Set ( IACFUnknown * pUnkHost ) +{ + if ( !sHostServices && pUnkHost ) + { + sHostServices = new AAX_VHostServices(pUnkHost); + } + else if ( sHostServices && !pUnkHost ) + { + delete sHostServices; + sHostServices = NULL; + } +} + +// *************************************************************************** +// METHOD: HandleAssertFailure +// *************************************************************************** +/* static */ +AAX_Result AAX_CHostServices::HandleAssertFailure ( const char * inFile, int32_t inLine, const char * inNote, int32_t /* AAX_EAssertFlags */ inFlags ) +{ + //Bail if the host does not support host services (e.g. unit tests) + if (sHostServices == 0) + return AAX_SUCCESS; + + return sHostServices->HandleAssertFailure ( inFile, inLine, inNote, inFlags ); +} + +// *************************************************************************** +// METHOD: Trace +// *************************************************************************** +/* static */ +AAX_Result AAX_CHostServices::Trace ( AAX_ETracePriorityHost inPriority, const char * inFormat, ... ) +{ + //Bail if the host does not support host services (e.g. unit tests) + if (sHostServices == 0) + return AAX_SUCCESS; + + va_list vargs; + AAX_CONSTEXPR std::size_t bufferSize{512}; + char message [ bufferSize ]; + + va_start ( vargs, inFormat ); + auto const printReturn = vsnprintf( message, bufferSize, inFormat, vargs ); + va_end ( vargs ); + + return 0 <= printReturn ? sHostServices->Trace ( (int32_t)inPriority, message ) : AAX_ERROR_PRINT_FAILURE; +} + +// *************************************************************************** +// METHOD: StackTrace +// *************************************************************************** +/* static */ +AAX_Result AAX_CHostServices::StackTrace ( AAX_ETracePriorityHost inTracePriority, AAX_ETracePriorityHost inStackTracePriority, const char * inFormat, ... ) +{ + //Bail if the host does not support host services (e.g. unit tests) + if (sHostServices == 0) + return AAX_SUCCESS; + + va_list vargs; + AAX_CONSTEXPR std::size_t bufferSize{512}; + char message [ bufferSize ]; + + va_start ( vargs, inFormat ); + auto const printReturn = vsnprintf( message, bufferSize, inFormat, vargs ); + va_end ( vargs ); + + return 0 <= printReturn ? sHostServices->StackTrace ( (int32_t)inTracePriority, (int32_t)inStackTracePriority, message ) : AAX_ERROR_PRINT_FAILURE; +} diff --git a/modules/juce_audio_plugin_client/AAX/SDK/Libs/AAXLibrary/source/AAX_CMutex.cpp b/modules/juce_audio_plugin_client/AAX/SDK/Libs/AAXLibrary/source/AAX_CMutex.cpp new file mode 100644 index 0000000000..700aab2a20 --- /dev/null +++ b/modules/juce_audio_plugin_client/AAX/SDK/Libs/AAXLibrary/source/AAX_CMutex.cpp @@ -0,0 +1,210 @@ +/*================================================================================================*/ +/* + * Copyright 2011-2015, 2019, 2023-2024 Avid Technology, Inc. + * All rights reserved. + * + * This file is part of the Avid AAX SDK. + * + * The AAX SDK is subject to commercial or open-source licensing. + * + * By using the AAX SDK, you agree to the terms of both the Avid AAX SDK License + * Agreement and Avid Privacy Policy. + * + * AAX SDK License: https://developer.avid.com/aax + * Privacy Policy: https://www.avid.com/legal/privacy-policy-statement + * + * Or: You may also use this code under the terms of the GPL v3 (see + * www.gnu.org/licenses). + * + * THE AAX SDK IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER + * EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE + * DISCLAIMED. + * + */ + +/** + * \file AAX_CMutex.cpp + * + * \author Viktor Iarovyi + * + */ +/*================================================================================================*/ + +#include "AAX_CMutex.h" + +#if defined(__GNUC__) +#include +#include +#elif defined(WIN32) +#include +#else +#error AAX_CMutex not implemented +#endif + +struct opaque_aax_mutex_t +{ +#if defined(__GNUC__) + pthread_t mOwner; + pthread_mutex_t mSysMutex; +#elif defined(WIN32) + DWORD mOwner; + HANDLE mSysMutex; +#endif +}; + +// ****************************************************************************************** +// METHOD: AAX_CMutex +// ****************************************************************************************** +AAX_CMutex::AAX_CMutex() +{ + mMutex = new opaque_aax_mutex_t; + mMutex->mOwner = 0; +#if defined(__GNUC__) + if (::pthread_mutex_init(&mMutex->mSysMutex, NULL) != 0) +#elif defined(WIN32) + mMutex->mSysMutex = ::CreateMutex(NULL, false, NULL); + if (0 == mMutex->mSysMutex) +#endif + { + delete mMutex; + mMutex = 0; + } +} + +// ****************************************************************************************** +// METHOD: ~AAX_CMutex +// ****************************************************************************************** +AAX_CMutex::~AAX_CMutex() +{ + if (mMutex) + { +#if defined(__GNUC__) + ::pthread_mutex_destroy(&mMutex->mSysMutex); +#elif defined(WIN32) + ::CloseHandle(mMutex->mSysMutex); +#endif + delete mMutex; + mMutex = 0; + } +} + +// ****************************************************************************************** +// METHOD: Lock +// ****************************************************************************************** +bool AAX_CMutex::Lock() +{ + bool result = false; + if (mMutex) + { +#if defined(__GNUC__) + pthread_t curThread = ::pthread_self(); + if(! ::pthread_equal(curThread, mMutex->mOwner)) + { + ::pthread_mutex_lock(&mMutex->mSysMutex); + mMutex->mOwner = curThread; + result = true; + } +#elif defined(WIN32) + DWORD curThread = ::GetCurrentThreadId(); + if(mMutex->mOwner != curThread) + { + ::WaitForSingleObject(mMutex->mSysMutex, INFINITE); + mMutex->mOwner = curThread; + result = true; + } +#endif + } + return result; +} + +// ****************************************************************************************** +// METHOD: Unlock +// ****************************************************************************************** +void AAX_CMutex::Unlock() +{ + if (mMutex) + { +#if defined(__GNUC__) + if(::pthread_equal(::pthread_self(), mMutex->mOwner)) + { + mMutex->mOwner = 0; + ::pthread_mutex_unlock(&mMutex->mSysMutex); + } +#elif defined(WIN32) + if(mMutex->mOwner == ::GetCurrentThreadId()) + { + mMutex->mOwner = 0; + ::ReleaseMutex(mMutex->mSysMutex); + } +#endif + } +} + +// ****************************************************************************************** +// METHOD: Try_Lock +// ****************************************************************************************** +bool AAX_CMutex::Try_Lock() +{ + bool result = false; + + if (mMutex) + { +#if defined(__GNUC__) + pthread_t curThread = ::pthread_self(); + if(! ::pthread_equal(curThread, mMutex->mOwner)) + { + // current thread doesn't own the Lock - try lock to see if we can lock it + int err = ::pthread_mutex_trylock(&mMutex->mSysMutex); + if (0 == err) + { + // we locked the lock + mMutex->mOwner = curThread; + result = true; + } + else if (EBUSY == err) + { + // the Lock was already locked by another thread + result = false; + } + else + { + // it's bad + result = false; + } + } + else + { + // current thread already owns the lock + result = true; + } +#elif defined(WIN32) + if(mMutex->mOwner != ::GetCurrentThreadId()) + { + // try to acquire the mutex + DWORD err = ::WaitForSingleObject(mMutex->mSysMutex, 0); + if (WAIT_OBJECT_0 == err) + { + // we locked the lock + mMutex->mOwner = ::GetCurrentThreadId(); + result = true; + } + else if (WAIT_TIMEOUT == err) + { + // lock was already locked by another thread + result = false; + } + else + { + // it's bad + result = false; + } + } + else + { + // current thread already owns the lock + result = true; + } +#endif + } + return result; +} diff --git a/modules/juce_audio_plugin_client/AAX/SDK/Libs/AAXLibrary/source/AAX_CPacketDispatcher.cpp b/modules/juce_audio_plugin_client/AAX/SDK/Libs/AAXLibrary/source/AAX_CPacketDispatcher.cpp new file mode 100644 index 0000000000..537a4da83d --- /dev/null +++ b/modules/juce_audio_plugin_client/AAX/SDK/Libs/AAXLibrary/source/AAX_CPacketDispatcher.cpp @@ -0,0 +1,236 @@ +/*================================================================================================*/ +/* + * Copyright 2011-2015, 2018, 2023-2024 Avid Technology, Inc. + * All rights reserved. + * + * This file is part of the Avid AAX SDK. + * + * The AAX SDK is subject to commercial or open-source licensing. + * + * By using the AAX SDK, you agree to the terms of both the Avid AAX SDK License + * Agreement and Avid Privacy Policy. + * + * AAX SDK License: https://developer.avid.com/aax + * Privacy Policy: https://www.avid.com/legal/privacy-policy-statement + * + * Or: You may also use this code under the terms of the GPL v3 (see + * www.gnu.org/licenses). + * + * THE AAX SDK IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER + * EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE + * DISCLAIMED. + * + */ + +/** + * \file AAX_CPacketDispatcher.cpp + * + * \author Viktor Iarovyi + * + */ +/*================================================================================================*/ +#include "AAX_CPacketDispatcher.h" +#include "AAX_IEffectParameters.h" +#include "AAX_IParameter.h" + +#include + +//////////////////////////////////////////////////////////////////////////////// +// class AAX_CPacket implementation + +const size_t kDefaultPacketSize = 8; + +AAX_CPacket::SPacketData::SPacketData() +{ + mData = new std::vector(kDefaultPacketSize); +} + +AAX_CPacket::SPacketData::~SPacketData() +{ + std::vector* storage = static_cast*>(mData); + delete storage; +} + +const void* +AAX_CPacket::SPacketData::Get() const +{ + std::vector* storage = static_cast*>(mData); + return &storage->at(0); +} + +void* +AAX_CPacket::SPacketData::Get(size_t maxSize) const +{ + std::vector* storage = static_cast*>(mData); + storage->resize(maxSize); + return &storage->at(0); +} + + +//////////////////////////////////////////////////////////////////////////////// +// class AAX_CPacketHandler + +// ******************************************************************************* +// METHOD: AAX_CPacketDispatcher +// ******************************************************************************* +AAX_CPacketDispatcher::AAX_CPacketDispatcher() +: mPacketsHolder(), + mPacketsHandlers(), + mController(NULL), + mEffectParameters(NULL), + mLockGuard() +{ +} + +// ******************************************************************************* +// METHOD: ~AAX_CPacketDispatcher +// ******************************************************************************* +AAX_CPacketDispatcher::~AAX_CPacketDispatcher() +{ + AAX_StLock_Guard guard(this->mLockGuard); + + // delete registered packets + for (PacketsHolder::iterator each = mPacketsHolder.begin(); each != mPacketsHolder.end (); each++) + { + AAX_CPacket* packet = each->second; + delete packet; + } + + // delete registered handlers + for (PacketsHandlersMap::iterator each = mPacketsHandlers.begin(); each != mPacketsHandlers.end (); each++) + { + AAX_IPacketHandler* handler = each->second.second; + delete handler; + } +} + +// ******************************************************************************* +// METHOD: Initialize +// ******************************************************************************* +void AAX_CPacketDispatcher::Initialize( AAX_IController* inController, AAX_IEffectParameters* inEffectParameters) +{ + mController = inController; + mEffectParameters = inEffectParameters; +} + +// ******************************************************************************* +// METHOD: RegisterTarget +// ******************************************************************************* +AAX_Result AAX_CPacketDispatcher::RegisterPacket( AAX_CParamID paramID, AAX_CFieldIndex portID, const AAX_IPacketHandler* inHandler) +{ + AAX_StLock_Guard guard(this->mLockGuard); + + AAX_CPacket* packet = NULL; + + // find whether the packet was registered + if (0 <= portID) + { + PacketsHolder::iterator found (mPacketsHolder.find (portID)); + if (found == mPacketsHolder.end()) + { + packet = new AAX_CPacket(portID); + mPacketsHolder.insert(std::make_pair(portID, packet)); + } + else + { + packet = found->second; + } + } + + // register handler for parameter + std::pair myPair( packet, inHandler->Clone() ); + mPacketsHandlers.insert(std::make_pair(std::string(paramID), myPair)); + + return AAX_SUCCESS; +} + +// ******************************************************************************* +// METHOD: SetDirty +// ******************************************************************************* +AAX_Result AAX_CPacketDispatcher::SetDirty(AAX_CParamID paramID, bool inDirty) +{ + AAX_StLock_Guard guard(this->mLockGuard); + + PacketsHandlersMap::iterator found (mPacketsHandlers.find (paramID)); + for (PacketsHandlersMap::iterator each = found; each != mPacketsHandlers.end (); each++) + { + if (each->first != paramID) + break; + + AAX_CPacket* packet = each->second.first; + packet->SetDirty(inDirty); + } + + return AAX_SUCCESS; +} + +// ******************************************************************************* +// METHOD: Dispatch +// ******************************************************************************* +AAX_Result AAX_CPacketDispatcher::Dispatch() +{ + AAX_StLock_Guard guard(this->mLockGuard); + + AAX_Result result = AAX_SUCCESS; + + for (PacketsHandlersMap::iterator each = mPacketsHandlers.begin(); each != mPacketsHandlers.end (); each++) + { + AAX_CPacket* packet = each->second.first; + if ( packet->IsDirty() ) + { + AAX_IPacketHandler* handler = each->second.second; + if (AAX_SUCCESS == handler->Call( each->first.c_str(), *packet )) + { + result = mController->PostPacket( packet->GetID(), packet->GetPtr(), packet->GetSize() ); + } + + packet->SetDirty(false); + } + } + + return result; +} + + +// ******************************************************************************* +// METHOD: GenerateSingleValuePacket (simple convenience for single values packets) +// ******************************************************************************* +AAX_Result AAX_CPacketDispatcher::GenerateSingleValuePacket( AAX_CParamID inParam, AAX_CPacket& ioPacket) +{ + AAX_IParameter* parameter; + AAX_Result result = mEffectParameters->GetParameter ( inParam, ¶meter ); + + if ((result == AAX_SUCCESS) && (parameter != 0)) + { + bool boolValue; + if(parameter->GetValueAsBool(&boolValue)) + { + *ioPacket.GetPtr() = int32_t(boolValue); + return AAX_SUCCESS; + } + + float floatValue; + if (parameter->GetValueAsFloat(&floatValue)) + { + *ioPacket.GetPtr() = floatValue; + return AAX_SUCCESS; + } + + int32_t intValue; + if(parameter->GetValueAsInt32(&intValue)) + { + *ioPacket.GetPtr() = intValue; + return AAX_SUCCESS; + } + + double doubleValue; + if(parameter->GetValueAsDouble(&doubleValue)) + { + *ioPacket.GetPtr() = doubleValue; + return AAX_SUCCESS; + } + } + + return AAX_ERROR_NULL_OBJECT; +} + diff --git a/modules/juce_audio_plugin_client/AAX/SDK/Libs/AAXLibrary/source/AAX_CParameter.cpp b/modules/juce_audio_plugin_client/AAX/SDK/Libs/AAXLibrary/source/AAX_CParameter.cpp new file mode 100644 index 0000000000..e995700d8b --- /dev/null +++ b/modules/juce_audio_plugin_client/AAX/SDK/Libs/AAXLibrary/source/AAX_CParameter.cpp @@ -0,0 +1,172 @@ +/*================================================================================================*/ +/* + * Copyright 2010-2015, 2018, 2023-2024 Avid Technology, Inc. + * All rights reserved. + * + * This file is part of the Avid AAX SDK. + * + * The AAX SDK is subject to commercial or open-source licensing. + * + * By using the AAX SDK, you agree to the terms of both the Avid AAX SDK License + * Agreement and Avid Privacy Policy. + * + * AAX SDK License: https://developer.avid.com/aax + * Privacy Policy: https://www.avid.com/legal/privacy-policy-statement + * + * Or: You may also use this code under the terms of the GPL v3 (see + * www.gnu.org/licenses). + * + * THE AAX SDK IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER + * EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE + * DISCLAIMED. + * + */ + +/** + * \author David Tremblay + * + */ +/*================================================================================================*/ +#include "AAX_CParameter.h" + + +//---------------------------------------------------------------- +// AAX_CParameterValue + + +template <> +bool AAX_CParameterValue::GetValueAsBool(bool* value) const +{ + *value = mValue; + return true; +} + +template<> +bool AAX_CParameterValue::GetValueAsInt32(int32_t* value) const +{ + *value = mValue; + return true; +} + +template<> +bool AAX_CParameterValue::GetValueAsFloat(float* value) const +{ + *value = mValue; + return true; +} + +template<> +bool AAX_CParameterValue::GetValueAsDouble(double* value) const +{ + *value = mValue; + return true; +} + +template<> +bool AAX_CParameterValue::GetValueAsString(AAX_IString* value) const +{ + *value = mValue; + return true; +} + + + +//---------------------------------------------------------------- +// AAX_CParameter + +template <> +bool AAX_CParameter::GetNormalizedValueFromBool(bool value, double *normalizedValue) const +{ + *normalizedValue = mTaperDelegate->RealToNormalized(value); + return true; +} + +template <> +bool AAX_CParameter::GetNormalizedValueFromInt32(int32_t value, double *normalizedValue) const +{ + *normalizedValue = mTaperDelegate->RealToNormalized(value); + return true; +} + +template <> +bool AAX_CParameter::GetNormalizedValueFromFloat(float value, double *normalizedValue) const +{ + *normalizedValue = mTaperDelegate->RealToNormalized(value); + return true; +} + +template <> +bool AAX_CParameter::GetNormalizedValueFromDouble(double value, double *normalizedValue) const +{ + *normalizedValue = mTaperDelegate->RealToNormalized(value); + return true; +} + +template <> +bool AAX_CParameter::GetBoolFromNormalizedValue(double inNormalizedValue, bool* value) const +{ + *value = mTaperDelegate->NormalizedToReal(inNormalizedValue); + return true; +} + +template<> +bool AAX_CParameter::GetInt32FromNormalizedValue(double inNormalizedValue, int32_t* value) const +{ + *value = mTaperDelegate->NormalizedToReal(inNormalizedValue); + return true; +} + +template<> +bool AAX_CParameter::GetFloatFromNormalizedValue(double inNormalizedValue, float* value) const +{ + *value = mTaperDelegate->NormalizedToReal(inNormalizedValue); + return true; +} + +template<> +bool AAX_CParameter::GetDoubleFromNormalizedValue(double inNormalizedValue, double* value) const +{ + *value = mTaperDelegate->NormalizedToReal(inNormalizedValue); + return true; +} + +template<> +bool AAX_CParameter::GetValueAsString(AAX_IString *value) const +{ + return mValue.GetValueAsString(value); +} + +template<> +bool AAX_CParameter::SetValueWithBool(bool value) +{ + SetValue(value); + return true; +} + +template<> +bool AAX_CParameter::SetValueWithInt32(int32_t value) +{ + SetValue(value); + return true; +} + +template<> +bool AAX_CParameter::SetValueWithFloat(float value) +{ + SetValue(value); + return true; +} + +template<> +bool AAX_CParameter::SetValueWithDouble(double value) +{ + SetValue(value); + return true; +} + +template<> +bool AAX_CParameter::SetValueWithString(const AAX_IString& value) +{ + SetValue(value); + return true; +} diff --git a/modules/juce_audio_plugin_client/AAX/SDK/Libs/AAXLibrary/source/AAX_CParameterManager.cpp b/modules/juce_audio_plugin_client/AAX/SDK/Libs/AAXLibrary/source/AAX_CParameterManager.cpp new file mode 100644 index 0000000000..541651b345 --- /dev/null +++ b/modules/juce_audio_plugin_client/AAX/SDK/Libs/AAXLibrary/source/AAX_CParameterManager.cpp @@ -0,0 +1,188 @@ +/*================================================================================================*/ +/* + * Copyright 2009-2015, 2018, 2021, 2023-2024 Avid Technology, Inc. + * All rights reserved. + * + * This file is part of the Avid AAX SDK. + * + * The AAX SDK is subject to commercial or open-source licensing. + * + * By using the AAX SDK, you agree to the terms of both the Avid AAX SDK License + * Agreement and Avid Privacy Policy. + * + * AAX SDK License: https://developer.avid.com/aax + * Privacy Policy: https://www.avid.com/legal/privacy-policy-statement + * + * Or: You may also use this code under the terms of the GPL v3 (see + * www.gnu.org/licenses). + * + * THE AAX SDK IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER + * EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE + * DISCLAIMED. + * + */ + +/** + * \author David Tremblay + * + */ +/*================================================================================================*/ + +#include "AAX_CParameterManager.h" +#include "AAX_IAutomationDelegate.h" +#include "AAX_CParameter.h" +#include "AAX_Assert.h" + + +AAX_CParameterManager::AAX_CParameterManager() : + mAutomationDelegate(nullptr), + mParameters(), + mParametersMap() +{ + +} + +AAX_CParameterManager::~AAX_CParameterManager() +{ + RemoveAllParameters(); +} + +void AAX_CParameterManager::Initialize(AAX_IAutomationDelegate* inAutomationDelegate) +{ + mAutomationDelegate = inAutomationDelegate; +} + +int32_t AAX_CParameterManager::NumParameters() const +{ + return int32_t(mParameters.size()); +} + +void AAX_CParameterManager::AddParameter(AAX_IParameter* param) +{ + //If the parameter is null, just return. + if (param == 0) + { + AAX_TRACE(kAAX_Trace_Priority_Normal, "AAX_CParameterManager::AddParameter() - Attempt to add a null parameter into AAX_CParameterManager"); + return; + } + + //Make sure that unique identifier is not already being used. + if (GetParameterByID(param->Identifier()) != 0) + { + AAX_TRACE(kAAX_Trace_Priority_Normal, "AAX_CParameterManager::AddParameter() - Duplicate AAX_IParameter ID Inserted into AAX_CParameterManager"); + return; + } + + //Setup the automation delegate. + param->SetAutomationDelegate( mAutomationDelegate ); + + //Add the parameter. + mParameters.push_back(param); + mParametersMap.insert(std::map::value_type(param->Identifier(), param)); +} + +void AAX_CParameterManager::RemoveParameterByID(AAX_CParamID identifier) +{ + int32_t parameterIndex = GetParameterIndex(identifier); + if (parameterIndex < 0 || parameterIndex >= NumParameters()) + return; + + AAX_IParameter* param = mParameters[static_cast(parameterIndex)]; + mParameters.erase(mParameters.begin() + parameterIndex); //remove it from the vector. + mParametersMap.erase(identifier); + delete param; //make sure to actually delete it. +} + +void AAX_CParameterManager::RemoveParameter(AAX_IParameter* param) +{ + if (param) + RemoveParameterByID(param->Identifier()); +} + +void AAX_CParameterManager::RemoveAllParameters() +{ + int32_t numParameters = NumParameters(); + for(int32_t index=0; index < numParameters; index++) + { + delete mParameters[static_cast(index)]; + } + mParameters.clear(); + mParametersMap.clear(); +} + +AAX_IParameter* AAX_CParameterManager::GetParameterByID(AAX_CParamID identifier) +{ + if ( identifier ) + { + std::map::const_iterator iter = mParametersMap.find(identifier); + if ( iter != mParametersMap.end() ) + return iter->second; + } + + return NULL; +} + +const AAX_IParameter* AAX_CParameterManager::GetParameterByID(AAX_CParamID identifier) const +{ + if ( identifier ) + { + std::map::const_iterator iter = mParametersMap.find(identifier); + if ( iter != mParametersMap.end() ) + return iter->second; + } + + return NULL; +} + +AAX_IParameter* AAX_CParameterManager::GetParameterByName(const char* name) +{ + return const_cast(const_cast(this)->GetParameterByName(name)); +} + +const AAX_IParameter* AAX_CParameterManager::GetParameterByName(const char* name) const +{ + AAX_IParameter* foundParam = 0; + for (std::vector::const_iterator iter = mParameters.begin(); (0 == foundParam) && (iter != mParameters.end()); ++iter) + { + if ((*iter) && (AAX_CString(name) == (*iter)->Name())) + foundParam = *iter; + } + return foundParam; +} + +AAX_IParameter* AAX_CParameterManager::GetParameter(int32_t index) +{ + if (index < 0 || index >= NumParameters()) + return 0; + + AAX_IParameter* param = mParameters[static_cast(index)]; + return param; +} + +const AAX_IParameter* AAX_CParameterManager::GetParameter(int32_t index) const +{ + if (index < 0 || index >= NumParameters()) + return 0; + + AAX_IParameter* param = mParameters[static_cast(index)]; + return param; +} + +int32_t AAX_CParameterManager::GetParameterIndex(AAX_CParamID identifier) const +{ + if (identifier == 0) + return -1; + + int32_t numParameters = NumParameters(); + for (int32_t i=0; i < numParameters; i++) + { + AAX_IParameter* param = mParameters[static_cast(i)]; + if (strcmp(param->Identifier(), identifier) == 0) + return i; + } + return -1; +} + + + + diff --git a/modules/juce_audio_plugin_client/AAX/SDK/Libs/AAXLibrary/source/AAX_CString.cpp b/modules/juce_audio_plugin_client/AAX/SDK/Libs/AAXLibrary/source/AAX_CString.cpp new file mode 100644 index 0000000000..7ac93ff511 --- /dev/null +++ b/modules/juce_audio_plugin_client/AAX/SDK/Libs/AAXLibrary/source/AAX_CString.cpp @@ -0,0 +1,406 @@ +/*================================================================================================*/ +/* + * Copyright 2009-2015, 2023-2024 Avid Technology, Inc. + * All rights reserved. + * + * This file is part of the Avid AAX SDK. + * + * The AAX SDK is subject to commercial or open-source licensing. + * + * By using the AAX SDK, you agree to the terms of both the Avid AAX SDK License + * Agreement and Avid Privacy Policy. + * + * AAX SDK License: https://developer.avid.com/aax + * Privacy Policy: https://www.avid.com/legal/privacy-policy-statement + * + * Or: You may also use this code under the terms of the GPL v3 (see + * www.gnu.org/licenses). + * + * THE AAX SDK IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER + * EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE + * DISCLAIMED. + * + */ + +/** + * \file AAX_CString.cpp + * + * \author Dave Tremblay + * + */ +/*================================================================================================*/ +#include "AAX_CString.h" +#include +#include + +AAX_CString::AAX_CString() : + mString("") +{ + +} + + +AAX_CString::AAX_CString ( const char * inString ) : +mString(inString ? inString : "") +{ +} + +AAX_CString::AAX_CString(const std::string& other) : +mString(other) +{ +} + +AAX_CString::AAX_CString(const AAX_CString& other) : + mString(other.mString) +{ + +} + +AAX_CString::AAX_CString(const AAX_IString& other) : + mString(other.Get()) +{ +} + +AAX_CString& AAX_CString::operator=(const AAX_CString& other) +{ + mString = other.mString; + return *this; +} + +AAX_CString& AAX_CString::operator=(const std::string& other) +{ + mString = other; + return *this; +} + +AAX_CString& AAX_CString::operator=(AAX_CString&& other) +{ + std::swap(mString, other.mString); + return *this; +} + +std::ostream& operator<< (std::ostream& os, const AAX_CString& str) +{ + os << str.mString; + return os; +} + +std::istream& operator>> (std::istream& is, AAX_CString& str) +{ + is >> str.mString; + return is; +} + + +/* Virtual Overrides ******************************************************************************************/ +uint32_t AAX_CString::Length() const +{ + return uint32_t(mString.length()); +} + +uint32_t AAX_CString::MaxLength() const +{ + return kMaxStringLength; +} + +const char * AAX_CString::Get () const +{ + return mString.c_str(); +} + +void AAX_CString::Set ( const char * inString ) +{ + mString = inString; +} + + +void AAX_CString::Clear() +{ + mString.clear(); +} + +bool AAX_CString::Empty() const +{ + return mString.empty(); +} + + +AAX_CString& AAX_CString::Erase(uint32_t pos, uint32_t n) +{ + // bounds check + uint32_t strlen = this->Length(); + if ( strlen - pos < n ) + n = n - (strlen - pos); + mString.erase(pos, n); + return *this; +} + +AAX_CString& AAX_CString::Append(const AAX_CString& str) +{ + mString.append(str.CString()); + return *this; +} + +AAX_CString& AAX_CString::Append(const char* str) +{ + mString.append(str); + return *this; +} + +AAX_CString& AAX_CString::AppendNumber(double number, int32_t precision) +{ + std::ostringstream outStringStream; + outStringStream.setf(std::ios::fixed, std::ios::floatfield); + outStringStream.precision(precision); + outStringStream << number; + mString += outStringStream.str(); + return *this; +} + +AAX_CString& AAX_CString::AppendNumber(int32_t number) +{ + std::ostringstream outStringStream; + outStringStream << number; + mString += outStringStream.str(); + return *this; +} + +AAX_CString& AAX_CString::AppendHex(int32_t number, int32_t width) +{ + std::ostringstream outStringStream; + outStringStream.setf(std::ios::hex, std::ios::basefield); + outStringStream.setf(std::ios::right, std::ios::adjustfield); + outStringStream.fill('0'); + outStringStream << "0x"; + const std::streamsize resetWidth = outStringStream.width(width); + outStringStream << number; + outStringStream.width(resetWidth); + + mString += outStringStream.str(); + return *this; +} + +AAX_CString& AAX_CString::Insert(uint32_t pos, const AAX_CString& str) +{ + mString.insert(pos, str.CString()); + return *this; +} + +AAX_CString& AAX_CString::Insert(uint32_t pos, const char* str) +{ + mString.insert(pos, str); + return *this; +} + +AAX_CString& AAX_CString::InsertNumber(uint32_t pos, double number, int32_t precision) +{ + std::ostringstream outStringStream; + outStringStream.setf(std::ios::fixed, std::ios::floatfield); + outStringStream.precision(precision); + outStringStream << number; + mString.insert(pos, outStringStream.str()); + return *this; +} + +AAX_CString& AAX_CString::InsertNumber(uint32_t pos, int32_t number) +{ + std::ostringstream outStringStream; + outStringStream << number; + mString.insert(pos, outStringStream.str()); + return *this; +} + +AAX_CString& AAX_CString::InsertHex(uint32_t pos, int32_t number, int32_t width) +{ + std::ostringstream outStringStream; + outStringStream.setf(std::ios::hex, std::ios::basefield); + outStringStream.setf(std::ios::right, std::ios::adjustfield); + outStringStream.fill('0'); + outStringStream << "0x"; + const std::streamsize resetWidth = outStringStream.width(width); + outStringStream << number; + outStringStream.width(resetWidth); + + mString.insert(pos, outStringStream.str()); + return *this; +} + +AAX_CString& AAX_CString::Replace(uint32_t pos, uint32_t n, const AAX_CString& str) +{ + mString.replace(pos, n, str.CString()); + return *this; +} + +AAX_CString& AAX_CString::Replace(uint32_t pos, uint32_t n, const char* str) +{ + mString.replace(pos, n, str); + return *this; +} + +uint32_t AAX_CString::FindFirst(const AAX_CString& ) const +{ + return kInvalidIndex; +} + +uint32_t AAX_CString::FindFirst(const char* ) const +{ + return kInvalidIndex; +} + +uint32_t AAX_CString::FindFirst(char ) const +{ + return kInvalidIndex; +} + +uint32_t AAX_CString::FindLast(const AAX_CString& ) const +{ + return kInvalidIndex; +} + +uint32_t AAX_CString::FindLast(const char* ) const +{ + return kInvalidIndex; +} + +uint32_t AAX_CString::FindLast(char ) const +{ + return kInvalidIndex; +} + +/** Direct access to a std::string. */ +std::string& AAX_CString::StdString() +{ + return mString; +} + +/** Direct access to a const std::string. */ +const std::string& AAX_CString::StdString() const +{ + return mString; +} + +const char* AAX_CString::CString() const +{ + return mString.c_str(); +} + +bool AAX_CString::ToDouble(double* outValue) const +{ + std::istringstream inStringStream(mString, std::istream::in); + inStringStream >> *outValue; + if (inStringStream.fail()) + { + *outValue = 0; + return false; + } + return true; +} + +bool AAX_CString::ToInteger(int32_t* outValue) const +{ + std::istringstream inStringStream(mString, std::istream::in); + inStringStream >> *outValue; + if (inStringStream.fail()) + { + *outValue = 0; + return false; + } + return true; +} + +void AAX_CString::SubString(uint32_t pos, uint32_t n, AAX_IString* outputStr) const +{ + outputStr->Set(mString.substr(pos, n).c_str()); +} + + +/* Virtual overriden operators *************************************************************************/ + +AAX_IString& AAX_CString::operator=(const AAX_IString& other) +{ + mString = other.Get(); + return *this; +} + +AAX_IString& AAX_CString::operator=(const char* str) +{ + mString = str; + return *this; +} + +bool AAX_CString::operator==(const AAX_CString& other) const +{ + return !strcmp(CString(), other.CString()); +} + +bool AAX_CString::operator==(const std::string& other) const +{ + return (mString == other); +} + +bool AAX_CString::operator==(const char* otherStr) const +{ + return !strcmp(CString(), otherStr); +} + +bool AAX_CString::operator!=(const AAX_CString& other) const +{ + return strcmp(CString(), other.CString()) != 0; +} + +bool AAX_CString::operator!=(const std::string& other) const +{ + return (mString != other); +} + +bool AAX_CString::operator!=(const char* otherStr) const +{ + return strcmp(CString(), otherStr) != 0; +} + +bool AAX_CString::operator<(const AAX_CString& other) const +{ + return (strcmp(CString(), other.CString()) < 0); +} + +bool AAX_CString::operator>(const AAX_CString& other) const +{ + return (strcmp(CString(), other.CString()) > 0); +} + +const char& AAX_CString::operator[](uint32_t index) const +{ + return mString[index]; +} + +char& AAX_CString::operator[](uint32_t index) +{ + return mString[index]; +} + +AAX_CString& AAX_CString::operator+=(const AAX_CString& str) +{ + mString += str.CString(); + return *this; +} + +AAX_CString& AAX_CString::operator+=(const std::string& str) +{ + mString += str.c_str(); + return *this; +} + +AAX_CString& AAX_CString::operator+=(const char* str) +{ + mString += str; + return *this; +} + + + + + + + + + diff --git a/modules/juce_audio_plugin_client/AAX/SDK/Libs/AAXLibrary/source/AAX_CUIDs.cpp b/modules/juce_audio_plugin_client/AAX/SDK/Libs/AAXLibrary/source/AAX_CUIDs.cpp new file mode 100644 index 0000000000..43f0bd0ea7 --- /dev/null +++ b/modules/juce_audio_plugin_client/AAX/SDK/Libs/AAXLibrary/source/AAX_CUIDs.cpp @@ -0,0 +1,40 @@ +/*================================================================================================*/ +/* + * Copyright 2013-2015, 2023-2024 Avid Technology, Inc. + * All rights reserved. + * + * This file is part of the Avid AAX SDK. + * + * The AAX SDK is subject to commercial or open-source licensing. + * + * By using the AAX SDK, you agree to the terms of both the Avid AAX SDK License + * Agreement and Avid Privacy Policy. + * + * AAX SDK License: https://developer.avid.com/aax + * Privacy Policy: https://www.avid.com/legal/privacy-policy-statement + * + * Or: You may also use this code under the terms of the GPL v3 (see + * www.gnu.org/licenses). + * + * THE AAX SDK IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER + * EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE + * DISCLAIMED. + * + */ +/*================================================================================================*/ +#define INITACFIDS // Make sure all of the AVX2 uids are defined. + +#ifdef __clang__ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wself-assign" +#pragma clang diagnostic ignored "-Wnon-virtual-dtor" +#endif + +#include "acfunknown.h" +#include "acfbaseapi.h" +#include "AAX_UIDs.h" + + +#ifdef __clang__ +#pragma clang diagnostic pop +#endif diff --git a/modules/juce_audio_plugin_client/AAX/SDK/Libs/AAXLibrary/source/AAX_CommonConversions.cpp b/modules/juce_audio_plugin_client/AAX/SDK/Libs/AAXLibrary/source/AAX_CommonConversions.cpp new file mode 100644 index 0000000000..b44c9c9eec --- /dev/null +++ b/modules/juce_audio_plugin_client/AAX/SDK/Libs/AAXLibrary/source/AAX_CommonConversions.cpp @@ -0,0 +1,31 @@ +/*================================================================================================*/ +/* + * Copyright 1992-2015, 2018, 2023-2024 Avid Technology, Inc. + * All rights reserved. + * + * This file is part of the Avid AAX SDK. + * + * The AAX SDK is subject to commercial or open-source licensing. + * + * By using the AAX SDK, you agree to the terms of both the Avid AAX SDK License + * Agreement and Avid Privacy Policy. + * + * AAX SDK License: https://developer.avid.com/aax + * Privacy Policy: https://www.avid.com/legal/privacy-policy-statement + * + * Or: You may also use this code under the terms of the GPL v3 (see + * www.gnu.org/licenses). + * + * THE AAX SDK IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER + * EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE + * DISCLAIMED. + * + */ + +/** + * \file CommonConversions.cpp + * + */ +/*================================================================================================*/ + +// placeholder file diff --git a/modules/juce_audio_plugin_client/AAX/SDK/Libs/AAXLibrary/source/AAX_IEffectDirectData.cpp b/modules/juce_audio_plugin_client/AAX/SDK/Libs/AAXLibrary/source/AAX_IEffectDirectData.cpp new file mode 100644 index 0000000000..e6aa4742e9 --- /dev/null +++ b/modules/juce_audio_plugin_client/AAX/SDK/Libs/AAXLibrary/source/AAX_IEffectDirectData.cpp @@ -0,0 +1,41 @@ +/*================================================================================================*/ +/* + * Copyright 2011-2015, 2023-2024 Avid Technology, Inc. + * All rights reserved. + * + * This file is part of the Avid AAX SDK. + * + * The AAX SDK is subject to commercial or open-source licensing. + * + * By using the AAX SDK, you agree to the terms of both the Avid AAX SDK License + * Agreement and Avid Privacy Policy. + * + * AAX SDK License: https://developer.avid.com/aax + * Privacy Policy: https://www.avid.com/legal/privacy-policy-statement + * + * Or: You may also use this code under the terms of the GPL v3 (see + * www.gnu.org/licenses). + * + * THE AAX SDK IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER + * EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE + * DISCLAIMED. + * + */ +/*================================================================================================*/ + +#include "AAX_IEffectDirectData.h" +#include "AAX_UIDs.h" +#include "acfextras.h" + +ACFMETHODIMP AAX_IEffectDirectData::InternalQueryInterface(const acfIID & riid, void **ppvObjOut) +{ + if (riid == IID_IAAXEffectDirectDataV1 || + riid == IID_IAAXEffectDirectDataV2) + { + *ppvObjOut = static_cast(this); + ( static_cast(*ppvObjOut))->AddRef(); + return ACF_OK; + } + + return this->CACFUnknown::InternalQueryInterface(riid, ppvObjOut); +} diff --git a/modules/juce_audio_plugin_client/AAX/SDK/Libs/AAXLibrary/source/AAX_IEffectGUI.cpp b/modules/juce_audio_plugin_client/AAX/SDK/Libs/AAXLibrary/source/AAX_IEffectGUI.cpp new file mode 100644 index 0000000000..62344ae028 --- /dev/null +++ b/modules/juce_audio_plugin_client/AAX/SDK/Libs/AAXLibrary/source/AAX_IEffectGUI.cpp @@ -0,0 +1,40 @@ +/*================================================================================================*/ +/* + * Copyright 1993-2015, 2023-2024 Avid Technology, Inc. + * All rights reserved. + * + * This file is part of the Avid AAX SDK. + * + * The AAX SDK is subject to commercial or open-source licensing. + * + * By using the AAX SDK, you agree to the terms of both the Avid AAX SDK License + * Agreement and Avid Privacy Policy. + * + * AAX SDK License: https://developer.avid.com/aax + * Privacy Policy: https://www.avid.com/legal/privacy-policy-statement + * + * Or: You may also use this code under the terms of the GPL v3 (see + * www.gnu.org/licenses). + * + * THE AAX SDK IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER + * EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE + * DISCLAIMED. + * + */ +/*================================================================================================*/ + +#include "AAX_IEffectGUI.h" +#include "AAX_UIDs.h" +#include "acfextras.h" + +ACFMETHODIMP AAX_IEffectGUI::InternalQueryInterface(const acfIID & riid, void **ppvObjOut) +{ + if (riid == IID_IAAXEffectGUIV1 ) + { + *ppvObjOut = static_cast(this); + ( static_cast(*ppvObjOut))->AddRef(); + return ACF_OK; + } + + return this->CACFUnknown::InternalQueryInterface(riid, ppvObjOut); +} diff --git a/modules/juce_audio_plugin_client/AAX/SDK/Libs/AAXLibrary/source/AAX_IEffectParameters.cpp b/modules/juce_audio_plugin_client/AAX/SDK/Libs/AAXLibrary/source/AAX_IEffectParameters.cpp new file mode 100644 index 0000000000..988434af93 --- /dev/null +++ b/modules/juce_audio_plugin_client/AAX/SDK/Libs/AAXLibrary/source/AAX_IEffectParameters.cpp @@ -0,0 +1,43 @@ +/*================================================================================================*/ +/* + * Copyright 2014-2017, 2023-2024 Avid Technology, Inc. + * All rights reserved. + * + * This file is part of the Avid AAX SDK. + * + * The AAX SDK is subject to commercial or open-source licensing. + * + * By using the AAX SDK, you agree to the terms of both the Avid AAX SDK License + * Agreement and Avid Privacy Policy. + * + * AAX SDK License: https://developer.avid.com/aax + * Privacy Policy: https://www.avid.com/legal/privacy-policy-statement + * + * Or: You may also use this code under the terms of the GPL v3 (see + * www.gnu.org/licenses). + * + * THE AAX SDK IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER + * EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE + * DISCLAIMED. + * + */ +/*================================================================================================*/ + +#include "AAX_IEffectParameters.h" +#include "AAX_UIDs.h" +#include "acfextras.h" + +ACFMETHODIMP AAX_IEffectParameters::InternalQueryInterface(const acfIID & riid, void **ppvObjOut) +{ + if (riid == IID_IAAXEffectParametersV1 || + riid == IID_IAAXEffectParametersV2 || + riid == IID_IAAXEffectParametersV3 || + riid == IID_IAAXEffectParametersV4) + { + *ppvObjOut = static_cast(this); + ( static_cast(*ppvObjOut))->AddRef(); + return ACF_OK; + } + + return this->CACFUnknown::InternalQueryInterface(riid, ppvObjOut); +} diff --git a/modules/juce_audio_plugin_client/AAX/SDK/Libs/AAXLibrary/source/AAX_IHostProcessor.cpp b/modules/juce_audio_plugin_client/AAX/SDK/Libs/AAXLibrary/source/AAX_IHostProcessor.cpp new file mode 100644 index 0000000000..a5ac91b6cc --- /dev/null +++ b/modules/juce_audio_plugin_client/AAX/SDK/Libs/AAXLibrary/source/AAX_IHostProcessor.cpp @@ -0,0 +1,40 @@ +/*================================================================================================*/ +/* + * Copyright 2010-2015, 2023-2024 Avid Technology, Inc. + * All rights reserved. + * + * This file is part of the Avid AAX SDK. + * + * The AAX SDK is subject to commercial or open-source licensing. + * + * By using the AAX SDK, you agree to the terms of both the Avid AAX SDK License + * Agreement and Avid Privacy Policy. + * + * AAX SDK License: https://developer.avid.com/aax + * Privacy Policy: https://www.avid.com/legal/privacy-policy-statement + * + * Or: You may also use this code under the terms of the GPL v3 (see + * www.gnu.org/licenses). + * + * THE AAX SDK IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER + * EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE + * DISCLAIMED. + * + */ +/*================================================================================================*/ + +#include "AAX_IHostProcessor.h" +#include "AAX_UIDs.h" +#include "acfextras.h" + +ACFMETHODIMP AAX_IHostProcessor::InternalQueryInterface(const acfIID & riid, void **ppvObjOut) +{ + if ((riid == IID_IAAXHostProcessorV2) || (riid == IID_IAAXHostProcessorV1)) + { + *ppvObjOut = static_cast(this); + ( static_cast(*ppvObjOut))->AddRef(); + return ACF_OK; + } + + return this->CACFUnknown::InternalQueryInterface(riid, ppvObjOut); +} diff --git a/modules/juce_audio_plugin_client/AAX/SDK/Libs/AAXLibrary/source/AAX_Init.cpp b/modules/juce_audio_plugin_client/AAX/SDK/Libs/AAXLibrary/source/AAX_Init.cpp new file mode 100644 index 0000000000..b69457ceb0 --- /dev/null +++ b/modules/juce_audio_plugin_client/AAX/SDK/Libs/AAXLibrary/source/AAX_Init.cpp @@ -0,0 +1,114 @@ +/*================================================================================================*/ +/* + * Copyright 2013-2017, 2023-2024 Avid Technology, Inc. + * All rights reserved. + * + * This file is part of the Avid AAX SDK. + * + * The AAX SDK is subject to commercial or open-source licensing. + * + * By using the AAX SDK, you agree to the terms of both the Avid AAX SDK License + * Agreement and Avid Privacy Policy. + * + * AAX SDK License: https://developer.avid.com/aax + * Privacy Policy: https://www.avid.com/legal/privacy-policy-statement + * + * Or: You may also use this code under the terms of the GPL v3 (see + * www.gnu.org/licenses). + * + * THE AAX SDK IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER + * EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE + * DISCLAIMED. + * + */ +/*================================================================================================*/ + +#include "AAX_Init.h" +#include "AAX_VCollection.h" +#include "AAX_CHostServices.h" + +#include "AAX_Exception.h" +#include "AAX_Assert.h" +#include "AAX_Version.h" +#include "ACFPtr.h" +#include "CACFClassFactory.h" + +// this function must be implemented somewhere in your plug-in +// inCollection: The host-provided collection interface for describing this plug-in. Never NULL. +extern AAX_Result GetEffectDescriptions( AAX_ICollection * outCollection ); + +AAX_Result AAXRegisterPlugin(IACFUnknown * pUnkHost, IACFPluginDefinition **ppPluginDefinition) +{ + AAX_Result result = AAX_SUCCESS; + + try + { + AAX_VCollection collection ( pUnkHost ); + AAX_CheckedResult checkedResult(GetEffectDescriptions ( &collection )); + + *ppPluginDefinition = 0; + if ( collection.GetIUnknown()->QueryInterface(IID_IACFPluginDefinition, (void**)ppPluginDefinition) != ACF_OK ) + checkedResult = AAX_ERROR_NULL_OBJECT; + } + catch (const AAX::Exception::ResultError& ex) + { + result = ex.Result(); + AAX_TRACE_RELEASE(kAAX_Trace_Priority_High, "AAXRegisterPlugin exception caught: %s", ex.What().c_str()); + } + catch (const AAX::Exception::Any& ex) + { + result = AAX_ERROR_UNKNOWN_EXCEPTION; + AAX_TRACE_RELEASE(kAAX_Trace_Priority_High, "AAXRegisterPlugin exception caught: %s", ex.What().c_str()); + } + catch (const std::exception& ex) + { + result = AAX_ERROR_UNKNOWN_EXCEPTION; + AAX_TRACE_RELEASE(kAAX_Trace_Priority_High, "AAXRegisterPlugin exception caught: %s", ex.what()); + } + catch (...) + { + result = AAX_ERROR_UNKNOWN_EXCEPTION; + AAX_TRACE_RELEASE(kAAX_Trace_Priority_High, "AAXRegisterPlugin exception caught: unknown"); + } + + return result; +} + +AAX_Result AAXRegisterComponent (IACFUnknown * /*pUnkHost*/, acfUInt32 /*index*/, IACFComponentDefinition **ppComponentDefinition) +{ + *ppComponentDefinition = NULL; + return AAX_SUCCESS; +} + +AAX_Result AAXGetClassFactory (IACFUnknown * /*pUnkHost*/, const acfCLSID& /*clsid*/, const acfIID& /*iid*/, void** ppOut) +{ + *ppOut = NULL; + return AAX_ERROR_UNIMPLEMENTED; +} + +AAX_Result AAXCanUnloadNow(IACFUnknown* /*pUnkHost*/) +{ + return static_cast(CACFUnknown::GetActiveObjectCount()); +} + +AAX_Result AAXStartup(IACFUnknown* pUnkHost) +{ + AAX_CHostServices::Set ( pUnkHost ); + return AAX_SUCCESS; +} + +AAX_Result AAXShutdown(IACFUnknown* /*pUnkHost*/) +{ + AAX_CHostServices::Set(NULL); + return AAX_SUCCESS; +} + +AAX_Result AAXGetSDKVersion( acfUInt64* oSDKVersion ) +{ + //Upper 32 bit uint is for SDK Version + *oSDKVersion = acfUInt64(AAX_SDK_VERSION) << 32; + + //Lower 32 bit uint is for revision number. + *oSDKVersion += acfUInt64(AAX_SDK_CURRENT_REVISION); + return AAX_SUCCESS; +} diff --git a/modules/juce_audio_plugin_client/AAX/SDK/Libs/AAXLibrary/source/AAX_Properties.cpp b/modules/juce_audio_plugin_client/AAX/SDK/Libs/AAXLibrary/source/AAX_Properties.cpp new file mode 100644 index 0000000000..3e019b20d6 --- /dev/null +++ b/modules/juce_audio_plugin_client/AAX/SDK/Libs/AAXLibrary/source/AAX_Properties.cpp @@ -0,0 +1,33 @@ +/*================================================================================================*/ +/* + * Copyright 2010-2015, 2023-2024 Avid Technology, Inc. + * All rights reserved. + * + * This file is part of the Avid AAX SDK. + * + * The AAX SDK is subject to commercial or open-source licensing. + * + * By using the AAX SDK, you agree to the terms of both the Avid AAX SDK License + * Agreement and Avid Privacy Policy. + * + * AAX SDK License: https://developer.avid.com/aax + * Privacy Policy: https://www.avid.com/legal/privacy-policy-statement + * + * Or: You may also use this code under the terms of the GPL v3 (see + * www.gnu.org/licenses). + * + * THE AAX SDK IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER + * EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE + * DISCLAIMED. + * + */ + +/** + * \author Paul Vercellotti + * +*/ +/*================================================================================================*/ + +#ifndef AAX_PROPERTIES_H +#include "AAX_Properties.h" +#endif diff --git a/modules/juce_audio_plugin_client/AAX/SDK/Libs/AAXLibrary/source/AAX_SliderConversions.cpp b/modules/juce_audio_plugin_client/AAX/SDK/Libs/AAXLibrary/source/AAX_SliderConversions.cpp new file mode 100644 index 0000000000..3e483ed44d --- /dev/null +++ b/modules/juce_audio_plugin_client/AAX/SDK/Libs/AAXLibrary/source/AAX_SliderConversions.cpp @@ -0,0 +1,203 @@ +/*================================================================================================*/ +/* + * Copyright 2007-2015, 2023-2024 Avid Technology, Inc. + * All rights reserved. + * + * This file is part of the Avid AAX SDK. + * + * The AAX SDK is subject to commercial or open-source licensing. + * + * By using the AAX SDK, you agree to the terms of both the Avid AAX SDK License + * Agreement and Avid Privacy Policy. + * + * AAX SDK License: https://developer.avid.com/aax + * Privacy Policy: https://www.avid.com/legal/privacy-policy-statement + * + * Or: You may also use this code under the terms of the GPL v3 (see + * www.gnu.org/licenses). + * + * THE AAX SDK IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER + * EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE + * DISCLAIMED. + * + */ +/*================================================================================================*/ +#include "AAX_SliderConversions.h" + +#include "AAX_UtilsNative.h" +#include "AAX.h" + +// Standard headers +#include +#include + + +using namespace std; + + +static const double kControlMin = -2147483648.0; +static const double kControlMax = 2147483647.0; +/*===================================================================================================*/ +int32_t LongControlToNewRange (int32_t aValue, int32_t rangeMin, int32_t rangeMax) +{ + double controlPartial = ((double)aValue - kControlMin) / (kControlMax - kControlMin); + return int32_t(floor(rangeMin + controlPartial*((double)(rangeMax) - (double)(rangeMin)) + 0.5)); +} + +/*===================================================================================================*/ +int32_t LongToLongControl (int32_t aValue, int32_t rangeMin, int32_t rangeMax) +{ + double controlMin = -2147483648.0; + double controlMax = 2147483647.0; + + if (aValue > rangeMax) + aValue = rangeMax; + else if (aValue < rangeMin) + aValue = rangeMin; + + double controlFraction = ((double)aValue - (double)rangeMin) / ((double)rangeMax - (double)rangeMin); + double control = controlFraction * (controlMax - controlMin) + controlMin; + return (int32_t)control; +} + + +/*=================================================================================================== + - 8/15/07 - Changed optimization level to -O0 (no optimization) in XCode project file to fix bug + 96679 in LongControlToDouble. - MJH +===================================================================================================*/ +double LongControlToDouble(int32_t aValue, double firstVal, double secondVal) +{ + // convert from int32_t control value 0x80000000...0x7FFFFFFF + // to an double ranging from firstVal to secondVal (linear) + + double controlPartial = ((double)aValue - kControlMin) / (kControlMax - kControlMin); + return firstVal + controlPartial*(secondVal - firstVal); +} + + +/*===================================================================================================*/ +int32_t DoubleToLongControl(double aValue, double firstVal, double secondVal) +{ + // convert from an double ranging from firstVal to secondVal (linear) + // to int32_t control value 0x80000000...0x7FFFFFFF + + aValue = AAX_LIMIT(aValue,firstVal,secondVal); + + double controlPartial = (aValue - firstVal) / (secondVal - firstVal); + return int32_t(floor(kControlMin + controlPartial*(kControlMax - kControlMin)+0.5)); +} + + +// The 2 following routines map between piecewise linear ranges of floating point values +// and a 32-bit control value. You must pass in a pointer to an array of range endpoints that +// define the linear ranges and a pointer to an array of 'percents' that indicate the percentage +// used by each range relative to the entire range taken by all the linear pieces. Here is example code: +/* + // This example shows a control that ranges from .10 to 20.0 with three ranges. + + const int32_t cNumControlRanges = 3; + + double mControlRangePoints[cNumControlRanges + 1] = {.10, 1.0, 10.0, 20.0}; + double mControlRangePercents[cNumControlRanges]; + + const double cNumStepsControlRange1 90.0 + const double cNumStepsControlRange2 90.0 + const double cNumStepsControlRange3 10.0 + + const double cNumStepsControl = cNumStepsControlRange1 + cNumStepsControlRange2 + cNumStepsControlRange3; + + mControlRangePercents[0] = cNumStepsControlRange1/cNumStepsControl; + mControlRangePercents[1] = cNumStepsControlRange2/cNumStepsControl; + mControlRangePercents[2] = cNumStepsControlRange3/cNumStepsControl; + + double controlValue = 1.5; + + int32_t longValue = ExtToLongControlNonlinear(controlValue, mControlRangePoints, mControlRangePercents, kNumControlRanges); + + controlValue = LongControlToExtNonlinear(longValue, mControlRangePoints, mControlRangePercents, kNumControlRanges); +*/ + +/*===================================================================================================*/ +int32_t DoubleToLongControlNonlinear(double aValue, double* range, double* rangePercent, int32_t numRanges) +{ + int32_t extSt; + int32_t i = 0; + double percentTotal = 0.0; + + aValue = AAX_LIMIT(aValue,range[0],range[numRanges]); //limit input to lowest range and highest range + + while (i < numRanges) + { + if ((aValue >= range[i]) && (aValue < range[i+1])) + break; + percentTotal += rangePercent[i]; + i++; + } + + if (i == numRanges) // if aValue == range[numRanges] = maximum possible value + percentTotal = 1.0; // our control is 100% of maximum + else + percentTotal += (aValue - range[i])/(range[i+1] - range[i]) * rangePercent[i]; + + double val = (double)AAX_INT32_MIN + ((double)AAX_INT32_MAX - (double)AAX_INT32_MIN) * percentTotal; + extSt = (int32_t)val; + return(extSt); +} + + +/*===================================================================================================*/ +double LongControlToDoubleNonlinear(int32_t aValue, double* range, double* rangePercent, int32_t numRanges) +{ + int32_t i = 0; + double percentTotal = ((double)AAX_INT32_MIN - (double)aValue)/((double)AAX_INT32_MIN)/2.0; + double percent = 0.0; + double extValue; + + while (i < numRanges) + { + if ((percentTotal >= percent) && (percentTotal < (percent+rangePercent[i]))) + break; + percent += rangePercent[i]; + i++; + } + + // percentTotal will always be slightly < 1.0, even when aValue == LONG_MAX // YS: use INT32_MAX; sizeof(long) == 64 on x64 mac! + // Therefore this check is not strictly necessary, but is provided for consistency + + if (i == numRanges) // if percentTotal == 1.0 = maximum possible value + extValue = AAX_INT32_MAX; // our control is 100% of maximum + else + extValue = range[i] + (range[i+1] - range[i]) * (percentTotal - percent)/(rangePercent[i]); + + return(extValue); +} + +/*===================================================================================================*/ +double LongControlToLogDouble(int32_t aValue, double minVal, double maxVal) +{ + // convert from int32_t control value 0x80000000...0x7FFFFFFF + // to an double ranging from minVal to maxVal (logarithmic) + // NOTE!!!! This is LOGARITHMIC, so minVal & maxVal have to be > zero! + + double extSt; + extSt = exp(LongControlToDouble(aValue, AAX::SafeLog(minVal), AAX::SafeLog(maxVal))); + // Guard against numerical inaccuracies + if(extSt < minVal) extSt = minVal; + if(extSt > maxVal) extSt = maxVal; + return(extSt); +} + + +/*===================================================================================================*/ +int32_t LogDoubleToLongControl(double aValue, double minVal, double maxVal) +{ + // convert from an double ranging from minVal to maxVal (logarithmic) + // to int32_t control value 0x80000000...0x7FFFFFFF + // NOTE!!!! This is LOGARITHMIC, so minVal & maxVal have to be > zero! + + int32_t extSt; + + aValue = AAX_LIMIT(aValue,minVal,maxVal); + extSt = DoubleToLongControl(AAX::SafeLog(aValue),AAX::SafeLog(minVal),AAX::SafeLog(maxVal)); + return(extSt); +} diff --git a/modules/juce_audio_plugin_client/AAX/SDK/Libs/AAXLibrary/source/AAX_VAutomationDelegate.cpp b/modules/juce_audio_plugin_client/AAX/SDK/Libs/AAXLibrary/source/AAX_VAutomationDelegate.cpp new file mode 100644 index 0000000000..9eac29ae4e --- /dev/null +++ b/modules/juce_audio_plugin_client/AAX/SDK/Libs/AAXLibrary/source/AAX_VAutomationDelegate.cpp @@ -0,0 +1,146 @@ +/*================================================================================================*/ +/* + * Copyright 2013-2015, 2023-2024 Avid Technology, Inc. + * All rights reserved. + * + * This file is part of the Avid AAX SDK. + * + * The AAX SDK is subject to commercial or open-source licensing. + * + * By using the AAX SDK, you agree to the terms of both the Avid AAX SDK License + * Agreement and Avid Privacy Policy. + * + * AAX SDK License: https://developer.avid.com/aax + * Privacy Policy: https://www.avid.com/legal/privacy-policy-statement + * + * Or: You may also use this code under the terms of the GPL v3 (see + * www.gnu.org/licenses). + * + * THE AAX SDK IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER + * EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE + * DISCLAIMED. + * + */ +/*================================================================================================*/ + +#include "AAX_VAutomationDelegate.h" +#include "AAX_IACFController.h" +#include "AAX_UIDs.h" +#include +#include + +// ****************************************************************************************** +// METHOD: AAX_VAutomationDelegate +// ****************************************************************************************** +AAX_VAutomationDelegate::AAX_VAutomationDelegate( IACFUnknown * pUnknown ) +{ + if ( pUnknown ) + { + pUnknown->QueryInterface(IID_IAAXAutomationDelegateV1, (void **)&mIAutomationDelegate); + pUnknown->QueryInterface(IID_IAAXControllerV2, (void**)&mIController); + } +} + +// ****************************************************************************************** +// METHOD: ~AAX_VAutomationDelegate +// ****************************************************************************************** +AAX_VAutomationDelegate::~AAX_VAutomationDelegate() +{ +} + +// ****************************************************************************************** +// METHOD: RegisterControl +// ****************************************************************************************** +AAX_Result AAX_VAutomationDelegate::RegisterParameter ( AAX_CParamID iParameterID ) +{ + if ( mIAutomationDelegate ) + return mIAutomationDelegate->RegisterParameter ( iParameterID ); + + return AAX_ERROR_NULL_OBJECT; +} + +// ****************************************************************************************** +// METHOD: UnregisterControl +// ****************************************************************************************** +AAX_Result AAX_VAutomationDelegate::UnregisterParameter ( AAX_CParamID iParameterID ) +{ + if ( mIAutomationDelegate ) + return mIAutomationDelegate->UnregisterParameter ( iParameterID ); + + return AAX_ERROR_NULL_OBJECT; +} + +// ****************************************************************************************** +// METHOD: PostSetValueRequest +// ****************************************************************************************** +AAX_Result AAX_VAutomationDelegate::PostSetValueRequest ( AAX_CParamID iParameterID, double iNormalizedValue ) const +{ + if ( mIAutomationDelegate ) + return mIAutomationDelegate->PostSetValueRequest ( iParameterID, iNormalizedValue ); + + return AAX_ERROR_NULL_OBJECT; +} + +// ****************************************************************************************** +// METHOD: PostCurrentValue +// ****************************************************************************************** +AAX_Result AAX_VAutomationDelegate::PostCurrentValue ( AAX_CParamID iParameterID, double iNormalizedValue ) const +{ + if ( mIAutomationDelegate ) + return mIAutomationDelegate->PostCurrentValue ( iParameterID, iNormalizedValue ); + + return AAX_ERROR_NULL_OBJECT; +} + +// ****************************************************************************************** +// METHOD: PostTouchRequest +// ****************************************************************************************** +AAX_Result AAX_VAutomationDelegate::PostTouchRequest ( AAX_CParamID iParameterID ) +{ + if ( mIAutomationDelegate ) + return mIAutomationDelegate->PostTouchRequest ( iParameterID ); + + return AAX_ERROR_NULL_OBJECT; +} + +// ****************************************************************************************** +// METHOD: PostReleaseRequest +// ****************************************************************************************** +AAX_Result AAX_VAutomationDelegate::PostReleaseRequest ( AAX_CParamID iParameterID ) +{ + if ( mIAutomationDelegate ) + return mIAutomationDelegate->PostReleaseRequest ( iParameterID ); + + return AAX_ERROR_NULL_OBJECT; +} + +// ****************************************************************************************** +// METHOD: GetTouchState +// ****************************************************************************************** +AAX_Result AAX_VAutomationDelegate::GetTouchState ( AAX_CParamID iParameterID, AAX_CBoolean * outTouched ) +{ + if ( mIAutomationDelegate ) + return mIAutomationDelegate->GetTouchState ( iParameterID, outTouched ); + + return AAX_ERROR_NULL_OBJECT; +} + +// ****************************************************************************************** +// METHOD: ParameterNameChanged +// ****************************************************************************************** +AAX_Result AAX_VAutomationDelegate::ParameterNameChanged ( AAX_CParamID iParameterID ) +{ + if ( mIController ) { + auto const end = iParameterID + kAAX_ParameterIdentifierMaxSize; + auto const found = std::find(iParameterID, end, '\0'); + if (end != found) { + auto const len = std::distance(iParameterID, found); + if (len > 0) { + return mIController->SendNotification (AAX_eNotificationEvent_ParameterNameChanged, iParameterID, sizeof(char) * (static_cast(len)+1)); + } + } + return AAX_ERROR_INVALID_PARAMETER_ID; + } + + return AAX_ERROR_UNIMPLEMENTED; +} diff --git a/modules/juce_audio_plugin_client/AAX/SDK/Libs/AAXLibrary/source/AAX_VCollection.cpp b/modules/juce_audio_plugin_client/AAX/SDK/Libs/AAXLibrary/source/AAX_VCollection.cpp new file mode 100644 index 0000000000..e9468e33cd --- /dev/null +++ b/modules/juce_audio_plugin_client/AAX/SDK/Libs/AAXLibrary/source/AAX_VCollection.cpp @@ -0,0 +1,197 @@ +/*================================================================================================*/ +/* + * Copyright 2013-2017, 2023-2024 Avid Technology, Inc. + * All rights reserved. + * + * This file is part of the Avid AAX SDK. + * + * The AAX SDK is subject to commercial or open-source licensing. + * + * By using the AAX SDK, you agree to the terms of both the Avid AAX SDK License + * Agreement and Avid Privacy Policy. + * + * AAX SDK License: https://developer.avid.com/aax + * Privacy Policy: https://www.avid.com/legal/privacy-policy-statement + * + * Or: You may also use this code under the terms of the GPL v3 (see + * www.gnu.org/licenses). + * + * THE AAX SDK IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER + * EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE + * DISCLAIMED. + * + */ +/*================================================================================================*/ + +#include "AAX_VCollection.h" +#include "AAX_VEffectDescriptor.h" +#include "AAX_VPropertyMap.h" + +#include "AAX_UIDs.h" +#include "acfbaseapi.h" + +// ****************************************************************************************** +// METHOD: AAX_VCollection +// ****************************************************************************************** +AAX_VCollection::AAX_VCollection (IACFUnknown * pUnkHost) : + mUnkHost( pUnkHost ), + mIACFCollection(NULL), + mDescriptionHost(pUnkHost) +{ + if ( mUnkHost ) + { + // Get the component factory service from the host so we can create the + // built-in plug-in definition. + ACFPtr pFactory; + if ( pUnkHost->QueryInterface(IID_IACFComponentFactory, (void **)&pFactory) == ACF_OK ) + { + // Create the object and get the base interface for it. + pFactory->CreateComponent(AAXCompID_AAXCollection, 0, IID_IAAXCollectionV1, (void **)&mIACFCollection); + } + } +} + +// ****************************************************************************************** +// METHOD: ~AAX_VCollection +// ****************************************************************************************** +AAX_VCollection::~AAX_VCollection () +{ + for (std::set::iterator iter = mEffectDescriptors.begin (); iter != mEffectDescriptors.end (); ++iter ) + delete *iter; + + for (std::set::iterator iter = mPropertyMaps.begin (); iter != mPropertyMaps.end (); ++iter) + delete *iter; +} + +// ****************************************************************************************** +// METHOD: GetIUnknown +// ****************************************************************************************** +IACFPluginDefinition* +AAX_VCollection::GetIUnknown(void) const +{ + return mIACFCollection; +} + +// ****************************************************************************************** +// METHOD: NewDescriptor +// ****************************************************************************************** +AAX_IEffectDescriptor * AAX_VCollection::NewDescriptor () +{ + AAX_VEffectDescriptor * plugInDescriptor = new AAX_VEffectDescriptor( mUnkHost ); + mEffectDescriptors.insert( plugInDescriptor ); + return plugInDescriptor; +} + + +// ****************************************************************************************** +// METHOD: AddEffect +// ****************************************************************************************** +AAX_Result AAX_VCollection::AddEffect ( const char * inEffectID, AAX_IEffectDescriptor * inEffectDescriptor ) +{ + if ( mIACFCollection && inEffectDescriptor ) + return mIACFCollection->AddEffect( inEffectID, static_cast(inEffectDescriptor)->GetIUnknown() ); + + return AAX_ERROR_NULL_OBJECT; +} + +// ****************************************************************************************** +// METHOD: SetManufacturerName +// ****************************************************************************************** +AAX_Result AAX_VCollection::SetManufacturerName( const char * iManufacturerName ) +{ + if ( mIACFCollection ) + return mIACFCollection->SetManufacturerName( iManufacturerName ); + + return AAX_ERROR_NULL_OBJECT; +} + +// ****************************************************************************************** +// METHOD: AddPackageName +// ****************************************************************************************** +AAX_Result AAX_VCollection::AddPackageName( const char * iPackageName ) +{ + if ( mIACFCollection ) + return mIACFCollection->AddPackageName( iPackageName ); + + return AAX_ERROR_NULL_OBJECT; +} + +// ****************************************************************************************** +// METHOD: SetPackageVersion +// ****************************************************************************************** +AAX_Result AAX_VCollection::SetPackageVersion( uint32_t iPackageVersion ) +{ + if ( mIACFCollection ) + return mIACFCollection->SetPackageVersion( iPackageVersion ); + + return AAX_ERROR_NULL_OBJECT; +} + +// ****************************************************************************************** +// METHOD: NewPropertyMap +// ****************************************************************************************** +AAX_IPropertyMap * AAX_VCollection::NewPropertyMap () +{ + AAX_VPropertyMap * propertyMap = AAX_VPropertyMap::Create( mUnkHost ); + mPropertyMaps.insert( propertyMap ); + return propertyMap; +} + +// ****************************************************************************************** +// METHOD: SetProperties +// ****************************************************************************************** +AAX_Result AAX_VCollection::SetProperties ( AAX_IPropertyMap * inProperties ) +{ + if ( mIACFCollection ) + return mIACFCollection->SetProperties( inProperties ? inProperties->GetIUnknown() : NULL); + + return AAX_ERROR_NULL_OBJECT; +} + +// ****************************************************************************************** +// METHOD: DescriptionHost +// ****************************************************************************************** +AAX_IDescriptionHost* AAX_VCollection::DescriptionHost() +{ + return mDescriptionHost.Supported() ? &mDescriptionHost : NULL; +} +const AAX_IDescriptionHost* AAX_VCollection::DescriptionHost() const +{ + return mDescriptionHost.Supported() ? &mDescriptionHost : NULL; +} + +// ****************************************************************************************** +// METHOD: HostDefinition +// ****************************************************************************************** +IACFDefinition* AAX_VCollection::HostDefinition() const +{ + return mDescriptionHost.HostDefinition(); +} + +AAX_Result AAX_VCollection::GetHostVersion(uint32_t* outVersion) const +{ + if (!outVersion) + return AAX_ERROR_NULL_ARGUMENT; + + if (IACFDefinition* hostDefinition = mDescriptionHost.HostDefinition()) + { + ACFRESULT acfErr; + acfUID typeID = acfUID_NULL; + acfUInt32 attrDataSize = 0; + acfErr = hostDefinition->GetAttributeInfo(AAXATTR_Client_Version, &typeID, &attrDataSize); + if (acfErr != ACF_OK) + return acfErr; + + uint32_t version; + if (attrDataSize != sizeof(version)) + return AAX_ERROR_INVALID_ARGUMENT; + + acfErr = hostDefinition->CopyAttribute(AAXATTR_Client_Version, typeID, &version, attrDataSize); + if (acfErr != ACF_OK) + return acfErr; + + *outVersion = version; + return AAX_SUCCESS; + } + return AAX_ERROR_NULL_OBJECT; +} diff --git a/modules/juce_audio_plugin_client/AAX/SDK/Libs/AAXLibrary/source/AAX_VComponentDescriptor.cpp b/modules/juce_audio_plugin_client/AAX/SDK/Libs/AAXLibrary/source/AAX_VComponentDescriptor.cpp new file mode 100644 index 0000000000..505b43e73f --- /dev/null +++ b/modules/juce_audio_plugin_client/AAX/SDK/Libs/AAXLibrary/source/AAX_VComponentDescriptor.cpp @@ -0,0 +1,543 @@ +/*================================================================================================*/ +/* + * Copyright 2013-2017, 2019, 2023-2024 Avid Technology, Inc. + * All rights reserved. + * + * This file is part of the Avid AAX SDK. + * + * The AAX SDK is subject to commercial or open-source licensing. + * + * By using the AAX SDK, you agree to the terms of both the Avid AAX SDK License + * Agreement and Avid Privacy Policy. + * + * AAX SDK License: https://developer.avid.com/aax + * Privacy Policy: https://www.avid.com/legal/privacy-policy-statement + * + * Or: You may also use this code under the terms of the GPL v3 (see + * www.gnu.org/licenses). + * + * THE AAX SDK IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER + * EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE + * DISCLAIMED. + * + */ +/*================================================================================================*/ + +// Self Include +#include "AAX_VComponentDescriptor.h" + +// AAX Includes +#include "AAX_VPropertyMap.h" +#include "AAX_UIDs.h" +#include "AAX_Assert.h" + +// ACF Includes +#include "acfbaseapi.h" +#include "ACFPtr.h" + +// Standard Includes +#include + + +// Disable warnings about unused variables to fix issues with result variables +// only being used in AAX_ASSERT checks (AAX_ASSERT is a no-op in release builds) +#ifdef __clang__ +# pragma clang diagnostic push +# pragma clang diagnostic ignored "-Wunused-variable" +#elif defined _MSC_VER +# pragma warning(push) +# pragma warning(disable : 4189) +#endif + +// Helper methods +namespace +{ + // Add ProcessProcs manually based on a property map - for backwards compatibility with + // hosts that do not support the generic AddProcessProc() method + // + // IMPORTANT: If any new pointer properties are queried by this method then they must be + // added to AAX_VComponentDescriptor::PointerPropertiesUsedByAddProcessProc() + AAX_Result ManuallyAddProcessProcs(AAX_VComponentDescriptor& inComponentDescriptor, + AAX_IPropertyMap* inProperties, + AAX_CSelector* outProcIDs, + int32_t inProcIDsSize) + { + AAX_CPropertyValue nativeID = 0, asID = 0, tiID = 0; + const AAX_CBoolean hasNative = inProperties->GetProperty(AAX_eProperty_PlugInID_Native, &nativeID); + const AAX_CBoolean hasAS = inProperties->GetProperty(AAX_eProperty_PlugInID_AudioSuite, &asID); + const AAX_CBoolean hasTI = inProperties->GetProperty(AAX_eProperty_PlugInID_TI, &tiID); + + std::vector procIDs; + AAX_Result result = AAX_SUCCESS; + + if ((AAX_SUCCESS == result) && (hasNative || hasAS)) + { + const void* processProc = 0; + if (false == inProperties->GetPointerProperty(AAX_eProperty_NativeProcessProc, &processProc)) + { + AAX_TRACE_RELEASE(kAAX_Trace_Priority_High, "AAX_VComponentDescriptor.cpp: ManuallyAddProcessProcs() - no value found for AAX_eProperty_NativeProcessProc"); + } + + const void* initProc = 0; + inProperties->GetPointerProperty(AAX_eProperty_NativeInstanceInitProc, &initProc); + + const void* backgroundProc = 0; + inProperties->GetPointerProperty(AAX_eProperty_NativeBackgroundProc, &backgroundProc); + + // Strip out AAX_eProperty_AudioBufferLength, which should only be used for DSP types + AAX_IPropertyMap* nativeProps = inProperties; + AAX_CPropertyValue bufferLengthProperty = 0; + if (0 != inProperties->GetProperty(AAX_eProperty_AudioBufferLength, &bufferLengthProperty)) + { + // this object's lifetime is managed by the component descriptor + AAX_IPropertyMap* const tempProps = inComponentDescriptor.DuplicatePropertyMap(inProperties); + + // Verify that the duplicate map object is valid + if (NULL != tempProps && NULL != tempProps->GetIUnknown()) + { + const AAX_CBoolean gotPropertySuccess = tempProps->GetProperty(AAX_eProperty_AudioBufferLength, &bufferLengthProperty); + AAX_ASSERT(0 != gotPropertySuccess); + if (gotPropertySuccess) + { + const AAX_Result removeNativeAudioBufferLengthResult = tempProps->RemoveProperty(AAX_eProperty_AudioBufferLength); + AAX_ASSERT(AAX_SUCCESS == removeNativeAudioBufferLengthResult); + nativeProps = tempProps; + } + } + } + + // Do the Native ProcessProc registration call (includes both Native and AudioSuite) + AAX_CSelector nativeProcID = 0; + result = inComponentDescriptor.AddProcessProc_Native( + reinterpret_cast(const_cast(processProc)), + nativeProps, + reinterpret_cast(const_cast(initProc)), + reinterpret_cast(const_cast(backgroundProc)), + &nativeProcID); + + if (AAX_SUCCESS == result) + { + procIDs.push_back(nativeProcID); + } + } + + if ((AAX_SUCCESS == result) && hasTI) + { + const char* fileName = NULL; + if (false == inProperties->GetPointerProperty(AAX_eProperty_TIDLLFileName, reinterpret_cast(&fileName))) + { + AAX_TRACE_RELEASE(kAAX_Trace_Priority_High, "AAX_VComponentDescriptor.cpp: ManuallyAddProcessProcs() - no value found for AAX_eProperty_TIDLLFileName"); + } + + const char* processProcSymbol = NULL; + if (false == inProperties->GetPointerProperty(AAX_eProperty_TIProcessProc, reinterpret_cast(&processProcSymbol))) + { + AAX_TRACE_RELEASE(kAAX_Trace_Priority_High, "AAX_VComponentDescriptor.cpp: ManuallyAddProcessProcs() - no value found for AAX_eProperty_TIProcessProc"); + } + + const char* initProcSymbol = NULL; + inProperties->GetPointerProperty(AAX_eProperty_TIInstanceInitProc, reinterpret_cast(&initProcSymbol)); + + const char* backgroundProcSymbol = NULL; + inProperties->GetPointerProperty(AAX_eProperty_TIBackgroundProc, reinterpret_cast(&backgroundProcSymbol)); + + AAX_CSelector tiProcID = 0; + result = inComponentDescriptor.AddProcessProc_TI( + reinterpret_cast(fileName), + reinterpret_cast(processProcSymbol), + inProperties, + reinterpret_cast(initProcSymbol), + reinterpret_cast(backgroundProcSymbol), + &tiProcID); + + if (AAX_SUCCESS == result) + { + procIDs.push_back(tiProcID); + } + } + + if (AAX_SUCCESS == result && NULL != outProcIDs) + { + const size_t numProcIDs = procIDs.size(); + if (numProcIDs < INT32_MAX && inProcIDsSize > (int32_t)numProcIDs) + { + for (size_t i = 0; i < numProcIDs; ++i) + { + outProcIDs[i] = procIDs.at(i); + } + outProcIDs[numProcIDs] = 0; + } + else + { + result = AAX_ERROR_ARGUMENT_BUFFER_OVERFLOW; + } + } + + return result; + } +} + +// Re-enable unused variable warnings +#ifdef __clang__ +# pragma clang diagnostic pop +#elif defined _MSC_VER +# pragma warning(pop) +#endif + + +// ****************************************************************************************** +// METHOD: AAX_VComponentDescriptor +// ****************************************************************************************** +AAX_VComponentDescriptor::AAX_VComponentDescriptor( IACFUnknown * pUnkHost ) : + mUnkHost( pUnkHost ), + mIACFComponentDescriptor( NULL ), + mIACFComponentDescriptorV2( NULL ), + mIACFComponentDescriptorV3( NULL ) +{ + if ( mUnkHost ) + { + // Get the component factory service from the host so we can create the + // built-in plug-in definition. + ACFPtr pFactory; + if ( pUnkHost->QueryInterface(IID_IACFComponentFactory, (void **)&pFactory) == ACF_OK ) + { + // Create the object and get the base interface for it. + pFactory->CreateComponent(AAXCompID_AAXComponentDescriptor, 0, IID_IAAXComponentDescriptorV1, (void **)&mIACFComponentDescriptor); + + // Get the V2 interface + if (mIACFComponentDescriptor) + mIACFComponentDescriptor->QueryInterface(IID_IAAXComponentDescriptorV2, (void**)&mIACFComponentDescriptorV2); + + // Get the V3 interface + if (mIACFComponentDescriptor) + mIACFComponentDescriptor->QueryInterface(IID_IAAXComponentDescriptorV3, (void**)&mIACFComponentDescriptorV3); + } + } +} + +// ****************************************************************************************** +// METHOD: ~AAX_VComponentDescriptor +// ****************************************************************************************** +AAX_VComponentDescriptor::~AAX_VComponentDescriptor () +{ + std::set::iterator iter = mPropertyMaps.begin (); + for ( ; iter != mPropertyMaps.end (); ++iter ) + delete *iter; +} + + +// ****************************************************************************************** +// METHOD: GetIUnknown +// ****************************************************************************************** +IACFUnknown* +AAX_VComponentDescriptor::GetIUnknown(void) const +{ + return mIACFComponentDescriptor; +} + +// ****************************************************************************************** +// METHOD: Clear +// ****************************************************************************************** +AAX_Result AAX_VComponentDescriptor::Clear () +{ + if ( mIACFComponentDescriptor ) + return mIACFComponentDescriptor->Clear(); + + return AAX_ERROR_NULL_OBJECT; +} + +// ****************************************************************************************** +// METHOD: AddReservedField +// ****************************************************************************************** +AAX_Result AAX_VComponentDescriptor::AddReservedField ( AAX_CFieldIndex inPortID, uint32_t inFieldType ) +{ + if ( mIACFComponentDescriptor ) + return mIACFComponentDescriptor->AddReservedField ( inPortID, inFieldType ); + + return AAX_ERROR_NULL_OBJECT; +} + +// ****************************************************************************************** +// METHOD: AddAudioIn +// ****************************************************************************************** +AAX_Result AAX_VComponentDescriptor::AddAudioIn ( AAX_CFieldIndex inPortID ) +{ + if ( mIACFComponentDescriptor ) + return mIACFComponentDescriptor->AddAudioIn ( inPortID ); + + return AAX_ERROR_NULL_OBJECT; +} + +// ****************************************************************************************** +// METHOD: AddAudioOut +// ****************************************************************************************** +AAX_Result AAX_VComponentDescriptor::AddAudioOut ( AAX_CFieldIndex inPortID ) +{ + if ( mIACFComponentDescriptor ) + return mIACFComponentDescriptor->AddAudioOut ( inPortID ); + + return AAX_ERROR_NULL_OBJECT; +} + +// ****************************************************************************************** +// METHOD: AddAudioBufferLength +// ****************************************************************************************** +AAX_Result AAX_VComponentDescriptor::AddAudioBufferLength ( AAX_CFieldIndex inPortID ) +{ + if ( mIACFComponentDescriptor ) + return mIACFComponentDescriptor->AddAudioBufferLength ( inPortID ); + + return AAX_ERROR_NULL_OBJECT; +} + +// ****************************************************************************************** +// METHOD: AddSampleRate +// ****************************************************************************************** +AAX_Result AAX_VComponentDescriptor::AddSampleRate ( AAX_CFieldIndex inPortID ) +{ + if ( mIACFComponentDescriptor ) + return mIACFComponentDescriptor->AddSampleRate ( inPortID ); + + return AAX_ERROR_NULL_OBJECT; +} + +// ****************************************************************************************** +// METHOD: AddClock +// ****************************************************************************************** +AAX_Result AAX_VComponentDescriptor::AddClock ( AAX_CFieldIndex inPortID ) +{ + if ( mIACFComponentDescriptor ) + return mIACFComponentDescriptor->AddClock ( inPortID ); + + return AAX_ERROR_NULL_OBJECT; +} + +// ****************************************************************************************** +// METHOD: AddSideChainIn +// ****************************************************************************************** +AAX_Result AAX_VComponentDescriptor::AddSideChainIn ( AAX_CFieldIndex inPortID ) +{ + if ( mIACFComponentDescriptor ) + return mIACFComponentDescriptor->AddSideChainIn ( inPortID ); + + return AAX_ERROR_NULL_OBJECT; +} + +// ****************************************************************************************** +// METHOD: AddDataInPort +// ****************************************************************************************** +AAX_Result AAX_VComponentDescriptor::AddDataInPort ( AAX_CFieldIndex inPortID, uint32_t inPacketSize, AAX_EDataInPortType inPortType ) +{ + if ( mIACFComponentDescriptor ) + return mIACFComponentDescriptor->AddDataInPort ( inPortID, inPacketSize, inPortType); + + return AAX_ERROR_NULL_OBJECT; +} + +// ****************************************************************************************** +// METHOD: AddAuxOutputStem +// ****************************************************************************************** +AAX_Result AAX_VComponentDescriptor::AddAuxOutputStem ( AAX_CFieldIndex inPortID, int32_t inStemFormat, const char inNameUTF8[] ) +{ + if ( mIACFComponentDescriptor ) + return mIACFComponentDescriptor->AddAuxOutputStem ( inPortID, inStemFormat, inNameUTF8 ); + + return AAX_ERROR_NULL_OBJECT; +} + +// ****************************************************************************************** +// METHOD: AddPrivateData +// ****************************************************************************************** +AAX_Result AAX_VComponentDescriptor::AddPrivateData ( AAX_CFieldIndex inPortID, int32_t inDataSize, uint32_t /* AAX_EPrivateDataOptions */ inOptions /* = AAX_ePrivateDataOptions_DefaultOptions */ ) +{ + if ( mIACFComponentDescriptor ) + return mIACFComponentDescriptor->AddPrivateData ( inPortID, inDataSize, inOptions ); + + return AAX_ERROR_NULL_OBJECT; +} + +// ****************************************************************************************** +// METHOD: AddDmaInstance +// ****************************************************************************************** +AAX_Result AAX_VComponentDescriptor::AddDmaInstance ( AAX_CFieldIndex inPortID, AAX_IDma::EMode inDmaMode ) +{ + if ( mIACFComponentDescriptor ) + return mIACFComponentDescriptor->AddDmaInstance ( inPortID, inDmaMode ); + + return AAX_ERROR_NULL_OBJECT; +} + +// ****************************************************************************************** +// ****************************************************************************************** +// METHOD: AddMeter +// ****************************************************************************************** +AAX_Result AAX_VComponentDescriptor::AddMeters ( + AAX_CFieldIndex inPortID, + const AAX_CTypeID* inMeterIDs, + const uint32_t inMeterCount) +{ + if ( mIACFComponentDescriptor ) + return mIACFComponentDescriptor->AddMeters ( inPortID, inMeterIDs, inMeterCount ); + + return AAX_ERROR_NULL_OBJECT; +} + +// METHOD: NewPropertyMap +// ****************************************************************************************** +AAX_IPropertyMap * AAX_VComponentDescriptor::NewPropertyMap () const +{ + AAX_VPropertyMap * propertyMap = AAX_VPropertyMap::Create( mUnkHost ); + const_cast(this)->mPropertyMaps.insert( propertyMap ); + return propertyMap; +} + +// METHOD: ClonePropertyMap +// ****************************************************************************************** +AAX_IPropertyMap * AAX_VComponentDescriptor::DuplicatePropertyMap (AAX_IPropertyMap* inPropertyMap) const +{ + AAX_IPropertyMap * newPropertyMap = this->NewPropertyMap(); + for (AAX_EProperty curPropertyID = AAX_eProperty_MinProp; + curPropertyID < AAX_eProperty_MaxProp; + curPropertyID = (AAX_EProperty((int32_t)curPropertyID + 1))) + { + AAX_CPropertyValue curPropertyValue = 0; + const void* curPointerPropertyValue = 0; + if (inPropertyMap->GetProperty(curPropertyID, &curPropertyValue)) + { + newPropertyMap->AddProperty(curPropertyID, curPropertyValue); + } + else if (inPropertyMap->GetPointerProperty(curPropertyID, &curPointerPropertyValue)) + { + newPropertyMap->AddPointerProperty(curPropertyID, curPointerPropertyValue); + } + } + + return newPropertyMap; +} + +// ****************************************************************************************** +// METHOD: AddProcessProc_Native +// ****************************************************************************************** +AAX_Result AAX_VComponentDescriptor::AddProcessProc_Native( + AAX_CProcessProc inProcessProc, + AAX_IPropertyMap * inProperties /*= NULL*/, + AAX_CInstanceInitProc inInstanceInitProc /*= NULL*/, + AAX_CBackgroundProc inBackgroundProc /*= NULL*/, + AAX_CSelector * outProcID /*= NULL */ ) +{ + if ( mIACFComponentDescriptor ) + return mIACFComponentDescriptor->AddProcessProc_Native( + inProcessProc, + inProperties ? inProperties->GetIUnknown() : NULL, + inInstanceInitProc, + inBackgroundProc, + outProcID ); + + return AAX_ERROR_NULL_OBJECT; +} + +// ****************************************************************************************** +// METHOD: AddProcessProc_TI +// ****************************************************************************************** +AAX_Result AAX_VComponentDescriptor::AddProcessProc_TI( + const char inDLLFileNameUTF8[], + const char inProcessProcSymbol[], + AAX_IPropertyMap * inProperties /*= NULL*/, + const char inInstanceInitProcSymbol [] /*= NULL*/, + const char inBackgroundProcSymbol [] /*= NULL*/, + AAX_CSelector * outProcID /*= NULL */ ) +{ + if ( mIACFComponentDescriptor ) + return mIACFComponentDescriptor->AddProcessProc_TI( + inDLLFileNameUTF8, + inProcessProcSymbol, + inProperties ? inProperties->GetIUnknown() : NULL, + inInstanceInitProcSymbol, + inBackgroundProcSymbol, + outProcID ); + + return AAX_ERROR_NULL_OBJECT; +} + +// ****************************************************************************************** +// METHOD: AddProcessProc +// ****************************************************************************************** +AAX_Result AAX_VComponentDescriptor::AddProcessProc( + AAX_IPropertyMap* inProperties, + AAX_CSelector* outProcIDs /*= NULL*/, + int32_t inProcIDsSize /*= 0*/) +{ + if ( mIACFComponentDescriptorV3 ) + { + return mIACFComponentDescriptorV3->AddProcessProc( + inProperties ? inProperties->GetIUnknown() : NULL, + outProcIDs, + inProcIDsSize); + } + else if ( mIACFComponentDescriptor && inProperties ) + { + // If the full AddProcessProc routine is not supported by the host then + // attempt to register each ProcessProc separately using the available + // registration methods in the V1 interface. + return ManuallyAddProcessProcs(*this, inProperties, outProcIDs, inProcIDsSize); + } + + return AAX_ERROR_NULL_OBJECT; +} + +// ****************************************************************************************** +// METHOD: AddMIDINode +// ****************************************************************************************** +AAX_Result AAX_VComponentDescriptor::AddMIDINode ( AAX_CFieldIndex inPortID, AAX_EMIDINodeType inNodeType, const char inNodeName[], uint32_t channelMask ) +{ + if ( mIACFComponentDescriptor ) + return mIACFComponentDescriptor->AddMIDINode ( inPortID, inNodeType, inNodeName, channelMask ); + + return AAX_ERROR_NULL_OBJECT; +} + +// ****************************************************************************************** +// METHOD: AddTemporaryData +// ****************************************************************************************** +AAX_Result AAX_VComponentDescriptor::AddTemporaryData( AAX_CFieldIndex inFieldIndex, uint32_t inDataElementSize) +{ + if (mIACFComponentDescriptorV2) + return mIACFComponentDescriptorV2->AddTemporaryData(inFieldIndex, inDataElementSize); + return AAX_ERROR_UNIMPLEMENTED; +} + +// ****************************************************************************************** +// METHOD: PointerPropertiesUsedByAddProcessProc +// ****************************************************************************************** + +/* static */ +const std::set& AAX_VComponentDescriptor::PointerPropertiesUsedByAddProcessProc() +{ +// we don't care that the destructor for this set runs at exit +#ifdef __clang__ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wexit-time-destructors" +#elif defined(_MSC_VER) +#pragma warning(push) +#pragma warning(disable : 4640) // disable warning C4640: construction of local static object is not thread-safe +#endif + static std::set props; +#ifdef __clang__ +#pragma clang diagnostic pop +#elif defined(_MSC_VER) +#pragma warning(pop) +#endif + + if (props.empty()) // assume single-threaded + { + props.insert(AAX_eProperty_NativeProcessProc); + props.insert(AAX_eProperty_NativeInstanceInitProc); + props.insert(AAX_eProperty_NativeBackgroundProc); + props.insert(AAX_eProperty_TIDLLFileName); + props.insert(AAX_eProperty_TIProcessProc); + props.insert(AAX_eProperty_TIInstanceInitProc); + props.insert(AAX_eProperty_TIBackgroundProc); + } + + return props; +} diff --git a/modules/juce_audio_plugin_client/AAX/SDK/Libs/AAXLibrary/source/AAX_VController.cpp b/modules/juce_audio_plugin_client/AAX/SDK/Libs/AAXLibrary/source/AAX_VController.cpp new file mode 100644 index 0000000000..961331302d --- /dev/null +++ b/modules/juce_audio_plugin_client/AAX/SDK/Libs/AAXLibrary/source/AAX_VController.cpp @@ -0,0 +1,430 @@ +/*================================================================================================*/ +/* + * Copyright 2013-2017, 2019, 2021, 2023-2024 Avid Technology, Inc. + * All rights reserved. + * + * This file is part of the Avid AAX SDK. + * + * The AAX SDK is subject to commercial or open-source licensing. + * + * By using the AAX SDK, you agree to the terms of both the Avid AAX SDK License + * Agreement and Avid Privacy Policy. + * + * AAX SDK License: https://developer.avid.com/aax + * Privacy Policy: https://www.avid.com/legal/privacy-policy-statement + * + * Or: You may also use this code under the terms of the GPL v3 (see + * www.gnu.org/licenses). + * + * THE AAX SDK IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER + * EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE + * DISCLAIMED. + * + */ +/*================================================================================================*/ + +#include "AAX_VController.h" +#include "AAX_VPageTable.h" +#include "AAX_IACFPageTableController.h" +#include "AAX_UIDs.h" +#include "AAX_Assert.h" + +#include "acfbaseapi.h" + +#include + +// ****************************************************************************************** +// METHOD: AAX_VController +// ****************************************************************************************** +AAX_VController::AAX_VController( IACFUnknown* pUnknown ) +{ + if ( pUnknown ) + { + pUnknown->QueryInterface(IID_IAAXControllerV1, (void **)&mIController); + pUnknown->QueryInterface(IID_IAAXControllerV2, (void **)&mIControllerV2); + pUnknown->QueryInterface(IID_IAAXControllerV3, (void **)&mIControllerV3); + pUnknown->QueryInterface(IID_IAAXPageTableController, (void **)&mIPageTableController); + pUnknown->QueryInterface(IID_IAAXPageTableControllerV2, (void **)&mIPageTableControllerV2); + + try + { + mComponentFactory = ACFPtr(IID_IACFComponentFactory, pUnknown); + } + catch (const ACFRESULT& /*ex*/) + { + // swallow any failure here - just clear the smart pointer + mComponentFactory = NULL; + } + } +} + +// ****************************************************************************************** +// METHOD: ~AAX_VController +// ****************************************************************************************** +AAX_VController::~AAX_VController() +{ +} + +// ****************************************************************************************** +// METHOD: PostPacket +// ****************************************************************************************** +AAX_Result AAX_VController::PostPacket ( AAX_CFieldIndex inFieldIndex, const void * inPayloadP, uint32_t inPayloadSize ) +{ + if ( mIController ) + return mIController->PostPacket ( inFieldIndex, inPayloadP, inPayloadSize ); + + return AAX_ERROR_NULL_OBJECT; +} + +// ****************************************************************************************** +// METHOD: SendNotification +// ****************************************************************************************** +AAX_Result AAX_VController::SendNotification (AAX_CTypeID inNotificationType, const void* inNotificationData, uint32_t inNotificationDataSize) +{ + if (mIControllerV2) + return mIControllerV2->SendNotification(inNotificationType, inNotificationData, inNotificationDataSize); + + return AAX_ERROR_UNIMPLEMENTED; +} + +// ****************************************************************************************** +// METHOD: SendNotification +// ****************************************************************************************** +AAX_Result AAX_VController::SendNotification (AAX_CTypeID inNotificationType) +{ + if (mIControllerV2) + return mIControllerV2->SendNotification(inNotificationType, NULL, 0); + + return AAX_ERROR_UNIMPLEMENTED; +} + +// ****************************************************************************************** +// METHOD: GetEffectID +// ****************************************************************************************** +AAX_Result AAX_VController::GetEffectID ( AAX_IString * outEffectID) const +{ + if (mIController) + return mIController->GetEffectID(outEffectID); + + return AAX_ERROR_NULL_OBJECT; +} + + +// ****************************************************************************************** +// METHOD: GetEffectSampleRate +// ****************************************************************************************** +AAX_Result AAX_VController::GetSampleRate ( AAX_CSampleRate * outSampleRate ) const +{ + if ( mIController ) + return mIController->GetSampleRate ( outSampleRate ); + + return AAX_ERROR_NULL_OBJECT; +} + +// ****************************************************************************************** +// METHOD: GetEffectInputStemFormat +// ****************************************************************************************** +AAX_Result AAX_VController::GetInputStemFormat ( AAX_EStemFormat * outStemFormat ) const +{ + if ( mIController ) + return mIController->GetInputStemFormat ( outStemFormat ); + + return AAX_ERROR_NULL_OBJECT; +} + +// ****************************************************************************************** +// METHOD: GetEffectOutputStemFormat +// ****************************************************************************************** +AAX_Result AAX_VController::GetOutputStemFormat ( AAX_EStemFormat * outStemFormat ) const +{ + if ( mIController ) + return mIController->GetOutputStemFormat ( outStemFormat ); + + return AAX_ERROR_NULL_OBJECT; +} + +// ****************************************************************************************** +// METHOD: GetTODLocation +// ****************************************************************************************** +AAX_Result AAX_VController::GetTODLocation ( AAX_CTimeOfDay* outTODLocation ) const +{ + if ( mIController ) + return mIController->GetTODLocation ( outTODLocation ); + + return AAX_ERROR_NULL_OBJECT; +} + +// ****************************************************************************************** +// METHOD: GetCurrentAutomationTimestamp +// ****************************************************************************************** +AAX_Result AAX_VController::GetCurrentAutomationTimestamp(AAX_CTransportCounter* outTimestamp) const +{ + if (mIControllerV2) + return mIControllerV2->GetCurrentAutomationTimestamp(outTimestamp); + + *outTimestamp = 0; + return AAX_ERROR_UNIMPLEMENTED; +} + + +// ****************************************************************************************** +// METHOD: GetSignalLatency +// ****************************************************************************************** +AAX_Result AAX_VController::GetSignalLatency( int32_t* outSamples) const +{ + if (mIController ) + return mIController->GetSignalLatency( outSamples ); + + return AAX_ERROR_NULL_OBJECT; +} + +// ****************************************************************************************** +// METHOD: GetHybridSignalLatency +// ****************************************************************************************** +AAX_Result AAX_VController::GetHybridSignalLatency(int32_t* outSamples) const +{ + if (mIControllerV2 ) + return mIControllerV2->GetHybridSignalLatency( outSamples ); + + return AAX_ERROR_UNIMPLEMENTED; +} + +// ****************************************************************************************** +// METHOD: SetSignalLatency +// ****************************************************************************************** +AAX_Result AAX_VController::SetSignalLatency(int32_t numSamples) +{ + if (mIController ) + return mIController->SetSignalLatency( numSamples ); + + return AAX_ERROR_NULL_OBJECT; +} + +// ****************************************************************************************** +// METHOD: GetCycleCount +// ****************************************************************************************** +AAX_Result AAX_VController::GetCycleCount( AAX_EProperty inWhichCycleCount, AAX_CPropertyValue* outNumCycles) const +{ + if (mIController ) + return mIController->GetCycleCount( inWhichCycleCount, outNumCycles ); + + return AAX_ERROR_NULL_OBJECT; +} + +// ****************************************************************************************** +// METHOD: SetCycleCount +// ****************************************************************************************** +AAX_Result AAX_VController::SetCycleCount( AAX_EProperty* inWhichCycleCounts, AAX_CPropertyValue* inValues, int32_t inNumValues) +{ + if (mIController ) + return mIController->SetCycleCount( inWhichCycleCounts, inValues, inNumValues ); + + return AAX_ERROR_NULL_OBJECT; +} + +// ****************************************************************************************** +// METHOD: GetCurrentMeterValue +// ****************************************************************************************** +AAX_Result AAX_VController::GetCurrentMeterValue( AAX_CTypeID inMeterID, float * outMeterValue ) const +{ + if ( mIController ) + return mIController->GetCurrentMeterValue ( inMeterID, outMeterValue ); + + return AAX_ERROR_NULL_OBJECT; +} + +// ****************************************************************************************** +// METHOD: GetMeterPeakValue +// ****************************************************************************************** +AAX_Result AAX_VController::GetMeterPeakValue( AAX_CTypeID inMeterID, float * outMeterPeakValue ) const +{ + if ( mIController ) + return mIController->GetMeterPeakValue ( inMeterID, outMeterPeakValue ); + + return AAX_ERROR_NULL_OBJECT; +} + +// ****************************************************************************************** +// METHOD: ClearMeterPeakValue +// ****************************************************************************************** +AAX_Result AAX_VController::ClearMeterPeakValue( AAX_CTypeID inMeterID ) const +{ + if ( mIController ) + return mIController->ClearMeterPeakValue ( inMeterID ); + + return AAX_ERROR_NULL_OBJECT; +} + +// ****************************************************************************************** +// METHOD: GetMeterClipped +// ****************************************************************************************** +AAX_Result AAX_VController::GetMeterClipped( AAX_CTypeID inMeterID, AAX_CBoolean * outClipped ) const +{ + if ( mIController ) + return mIController->GetMeterClipped ( inMeterID, outClipped ); + + return AAX_ERROR_NULL_OBJECT; +} + +// ****************************************************************************************** +// METHOD: ClearMeterClipped +// ****************************************************************************************** +AAX_Result AAX_VController::ClearMeterClipped( AAX_CTypeID inMeterID ) const +{ + if ( mIController ) + return mIController->ClearMeterClipped ( inMeterID ); + + return AAX_ERROR_NULL_OBJECT; +} + + +// ****************************************************************************************** +// METHOD: GetMeterCount +// ****************************************************************************************** +AAX_Result AAX_VController::GetMeterCount( uint32_t * outMeterCount ) const +{ + if ( mIController ) + return mIController->GetMeterCount ( outMeterCount ); + + return AAX_ERROR_NULL_OBJECT; +} + +// ****************************************************************************************** +// METHOD: GetNextMIDIPacket +// ****************************************************************************************** +AAX_Result AAX_VController::GetNextMIDIPacket( AAX_CFieldIndex* outPort, AAX_CMidiPacket* outPacket ) +{ + if ( mIController ) + return mIController->GetNextMIDIPacket( outPort, outPacket ); + + return AAX_ERROR_NULL_OBJECT; +} + +// ****************************************************************************************** +// METHOD: GetPlugInTargetPlatform +// ****************************************************************************************** +AAX_Result AAX_VController::GetPlugInTargetPlatform(AAX_CTargetPlatform* outTargetPlatform) const +{ + if (mIControllerV3) + return mIControllerV3->GetPlugInTargetPlatform(outTargetPlatform); + + return AAX_ERROR_UNIMPLEMENTED; +} + +// ****************************************************************************************** +// METHOD: GetIsAudioSuite +// ****************************************************************************************** +AAX_Result AAX_VController::GetIsAudioSuite(AAX_CBoolean* outIsAudioSuite) const +{ + if (mIControllerV3) + return mIControllerV3->GetIsAudioSuite(outIsAudioSuite); + + return AAX_ERROR_UNIMPLEMENTED; +} + +// ****************************************************************************************** +// METHOD: GetHostName +// ****************************************************************************************** +AAX_Result AAX_VController::GetHostName(AAX_IString* outHostNameString) const +{ + if (mIControllerV2) + return mIControllerV2->GetHostName(outHostNameString); + + return AAX_ERROR_UNIMPLEMENTED; +} + +// ****************************************************************************************** +// METHOD: CreateTableCopyForEffect +// ****************************************************************************************** +AAX_IPageTable* AAX_VController::CreateTableCopyForEffect(AAX_CPropertyValue inManufacturerID, + AAX_CPropertyValue inProductID, + AAX_CPropertyValue inPlugInID, + uint32_t inTableType, + int32_t inTablePageSize) const +{ + if (!mIPageTableController) { return NULL; } + ACFPtr oPageTable(this->CreatePageTable()); + if (AAX_SUCCESS != mIPageTableController->CopyTableForEffect(inManufacturerID, inProductID, inPlugInID, inTableType, inTablePageSize, oPageTable.inArg())) + { + oPageTable = NULL; + } + return oPageTable.isNull() ? NULL : new AAX_VPageTable(oPageTable.inArg()); +} + +// ****************************************************************************************** +// METHOD: CreateTableCopyForLayout +// ****************************************************************************************** +AAX_IPageTable* AAX_VController::CreateTableCopyForLayout(const char * inEffectID, + const char * inLayoutName, + uint32_t inTableType, + int32_t inTablePageSize) const +{ + if (!mIPageTableController) { return NULL; } + ACFPtr oPageTable(this->CreatePageTable()); + if (AAX_SUCCESS != mIPageTableController->CopyTableOfLayoutForEffect(inEffectID, inLayoutName, inTableType, inTablePageSize, oPageTable.inArg())) + { + oPageTable = NULL; + } + return oPageTable.isNull() ? NULL : new AAX_VPageTable(oPageTable.inArg()); +} + +// ****************************************************************************************** +// METHOD: CreateTableCopyForEffectFromFile +// ****************************************************************************************** +AAX_IPageTable* AAX_VController::CreateTableCopyForEffectFromFile(const char* inPageTableFilePath, + AAX_ETextEncoding inFilePathEncoding, + AAX_CPropertyValue inManufacturerID, + AAX_CPropertyValue inProductID, + AAX_CPropertyValue inPlugInID, + uint32_t inTableType, + int32_t inTablePageSize) const +{ + if (!mIPageTableControllerV2) { return NULL; } + ACFPtr oPageTable(this->CreatePageTable()); + if (AAX_SUCCESS != mIPageTableControllerV2->CopyTableForEffectFromFile(inPageTableFilePath, inFilePathEncoding, inManufacturerID, inProductID, inPlugInID, inTableType, inTablePageSize, oPageTable.inArg())) + { + oPageTable = NULL; + } + return oPageTable.isNull() ? NULL : new AAX_VPageTable(oPageTable.inArg()); +} + +// ****************************************************************************************** +// METHOD: CreateTableCopyForLayoutFromFile +// ****************************************************************************************** +AAX_IPageTable* AAX_VController::CreateTableCopyForLayoutFromFile(const char* inPageTableFilePath, + AAX_ETextEncoding inFilePathEncoding, + const char* inLayoutName, + uint32_t inTableType, + int32_t inTablePageSize) const +{ + if (!mIPageTableControllerV2) { return NULL; } + ACFPtr oPageTable(this->CreatePageTable()); + if (AAX_SUCCESS != mIPageTableControllerV2->CopyTableOfLayoutFromFile(inPageTableFilePath, inFilePathEncoding, inLayoutName, inTableType, inTablePageSize, oPageTable.inArg())) + { + oPageTable = NULL; + } + return oPageTable.isNull() ? NULL : new AAX_VPageTable(oPageTable.inArg()); +} + +// ****************************************************************************************** +// METHOD: CreatePageTable +// ****************************************************************************************** +ACFPtr AAX_VController::CreatePageTable() const +{ + ACFPtr mIPageTable; + + // If this unknown does not support query of an existing page table then check to + // see if it supports creation of a new, empty page table object + if ( mComponentFactory ) + { + // Create the object and get the base interface for it + const AAX_Result result = static_cast(const_cast(*mComponentFactory).CreateComponent(AAXCompID_PageTable, 0, IID_IAAXPageTableV2, (void **)&mIPageTable)); + if (ACF_OK != result) + { + mIPageTable = NULL; + } + } + + return mIPageTable; +} + diff --git a/modules/juce_audio_plugin_client/AAX/SDK/Libs/AAXLibrary/source/AAX_VDescriptionHost.cpp b/modules/juce_audio_plugin_client/AAX/SDK/Libs/AAXLibrary/source/AAX_VDescriptionHost.cpp new file mode 100644 index 0000000000..f594520b5e --- /dev/null +++ b/modules/juce_audio_plugin_client/AAX/SDK/Libs/AAXLibrary/source/AAX_VDescriptionHost.cpp @@ -0,0 +1,73 @@ +/*================================================================================================*/ +/* + * Copyright 2016-2017, 2019, 2023-2024 Avid Technology, Inc. + * All rights reserved. + * + * This file is part of the Avid AAX SDK. + * + * The AAX SDK is subject to commercial or open-source licensing. + * + * By using the AAX SDK, you agree to the terms of both the Avid AAX SDK License + * Agreement and Avid Privacy Policy. + * + * AAX SDK License: https://developer.avid.com/aax + * Privacy Policy: https://www.avid.com/legal/privacy-policy-statement + * + * Or: You may also use this code under the terms of the GPL v3 (see + * www.gnu.org/licenses). + * + * THE AAX SDK IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER + * EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE + * DISCLAIMED. + */ + +// Self include +#include "AAX_VDescriptionHost.h" + +// AAX includes +#include "AAX_VFeatureInfo.h" +#include "AAX_IACFDescriptionHost.h" +#include "AAX_UIDs.h" + +// ACF includes +#include "acfbaseapi.h" + +// Standard includes +#include + + +AAX_VDescriptionHost::AAX_VDescriptionHost( IACFUnknown* pUnknown ) +{ + if ( pUnknown ) + { + pUnknown->QueryInterface(IID_IAAXDescriptionHostV1, (void **)&mDescriptionHost); + pUnknown->QueryInterface(IID_IACFDefinition, (void**)&mHostInformation); + } +} + +AAX_VDescriptionHost::~AAX_VDescriptionHost() +{ +} + +const AAX_IFeatureInfo* AAX_VDescriptionHost::AcquireFeatureProperties(const AAX_Feature_UID& inFeatureID) const +{ + AAX_UNIQUE_PTR(const AAX_IFeatureInfo) acquiredFeatureProperties; + + if ( mDescriptionHost ) + { + IACFUnknown* featureInfo = NULL; + + // const cast is OK here because we are ultimately storing the result of the non-const acquire call in a const object + AAX_IACFDescriptionHost* descHost = const_cast(mDescriptionHost.inArg()); + if (AAX_SUCCESS == descHost->AcquireFeatureProperties(inFeatureID, &featureInfo) && (NULL != featureInfo)) + { + acquiredFeatureProperties.reset(new AAX_VFeatureInfo(featureInfo, inFeatureID)); + } + } + + return acquiredFeatureProperties.release(); +} + + + + diff --git a/modules/juce_audio_plugin_client/AAX/SDK/Libs/AAXLibrary/source/AAX_VEffectDescriptor.cpp b/modules/juce_audio_plugin_client/AAX/SDK/Libs/AAXLibrary/source/AAX_VEffectDescriptor.cpp new file mode 100644 index 0000000000..85f3cb8fb0 --- /dev/null +++ b/modules/juce_audio_plugin_client/AAX/SDK/Libs/AAXLibrary/source/AAX_VEffectDescriptor.cpp @@ -0,0 +1,200 @@ +/*================================================================================================*/ +/* + * Copyright 2013-2017, 2023-2024 Avid Technology, Inc. + * All rights reserved. + * + * This file is part of the Avid AAX SDK. + * + * The AAX SDK is subject to commercial or open-source licensing. + * + * By using the AAX SDK, you agree to the terms of both the Avid AAX SDK License + * Agreement and Avid Privacy Policy. + * + * AAX SDK License: https://developer.avid.com/aax + * Privacy Policy: https://www.avid.com/legal/privacy-policy-statement + * + * Or: You may also use this code under the terms of the GPL v3 (see + * www.gnu.org/licenses). + * + * THE AAX SDK IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER + * EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE + * DISCLAIMED. + * + */ +/*================================================================================================*/ + +#include "AAX_VEffectDescriptor.h" +#include "AAX_VComponentDescriptor.h" +#include "AAX_VPropertyMap.h" + +#include "AAX_UIDs.h" +#include "acfbaseapi.h" + +// ****************************************************************************************** +// METHOD: AAX_VEffectDescriptor +// ****************************************************************************************** +AAX_VEffectDescriptor::AAX_VEffectDescriptor ( IACFUnknown * pUnkHost ) : + mUnkHost( pUnkHost ), + mIACFEffectDescriptor( NULL ), + mIACFEffectDescriptorV2( NULL ) +{ + if ( mUnkHost ) + { + // Get the component factory service from the host so we can create the + // built-in plug-in definition. + ACFPtr pFactory; + if ( pUnkHost->QueryInterface(IID_IACFComponentFactory, (void **)&pFactory) == ACF_OK ) + { + // Create the object and get the base interface for it. + pFactory->CreateComponent(AAXCompID_AAXEffectDescriptor, 0, IID_IAAXEffectDescriptorV1, (void **)&mIACFEffectDescriptor); + if (mIACFEffectDescriptor) + mIACFEffectDescriptor->QueryInterface(IID_IAAXEffectDescriptorV2, (void**)&mIACFEffectDescriptorV2); + } + } +} + +// ****************************************************************************************** +// METHOD: ~AAX_VEffectDescriptor +// ****************************************************************************************** +AAX_VEffectDescriptor::~AAX_VEffectDescriptor () +{ + std::set::iterator iterComponentDescriptor = mComponentDescriptors.begin (); + for ( ; iterComponentDescriptor != mComponentDescriptors.end (); ++iterComponentDescriptor ) + delete *iterComponentDescriptor; + + std::set::iterator iterPropertyMap = mPropertyMaps.begin (); + for ( ; iterPropertyMap != mPropertyMaps.end (); ++iterPropertyMap ) + delete *iterPropertyMap; +} + + +// ****************************************************************************************** +// METHOD: GetIUnknown +// ****************************************************************************************** +IACFUnknown* +AAX_VEffectDescriptor::GetIUnknown(void) const +{ + return mIACFEffectDescriptor; +} + +// ****************************************************************************************** +// METHOD: NewComponentDescriptor +// ****************************************************************************************** +AAX_IComponentDescriptor * AAX_VEffectDescriptor::NewComponentDescriptor () +{ + AAX_VComponentDescriptor * componentDescriptor = new AAX_VComponentDescriptor( mUnkHost ); + mComponentDescriptors.insert( componentDescriptor ); + return componentDescriptor; +} + +// ****************************************************************************************** +// METHOD: AddComponent +// ****************************************************************************************** +AAX_Result AAX_VEffectDescriptor::AddComponent ( AAX_IComponentDescriptor * inComponentDescriptor ) +{ + if ( mIACFEffectDescriptor ) + return mIACFEffectDescriptor->AddComponent( inComponentDescriptor ? static_cast(inComponentDescriptor)->GetIUnknown() : NULL ); + + return AAX_ERROR_NULL_OBJECT; +} + +// ****************************************************************************************** +// METHOD: AddName +// ****************************************************************************************** +AAX_Result AAX_VEffectDescriptor::AddName( const char * inPlugInName ) +{ + if ( mIACFEffectDescriptor ) + return mIACFEffectDescriptor->AddName( inPlugInName ); + + return AAX_ERROR_NULL_OBJECT; +} + +// ****************************************************************************************** +// METHOD: AddCategory +// ****************************************************************************************** +AAX_Result AAX_VEffectDescriptor::AddCategory( uint32_t inCategory ) +{ + if ( mIACFEffectDescriptor ) + return mIACFEffectDescriptor->AddCategory( inCategory ); + + return AAX_ERROR_NULL_OBJECT; +} + +// ****************************************************************************************** +// METHOD: AddCategoryBypassParameter +// ****************************************************************************************** +AAX_Result AAX_VEffectDescriptor::AddCategoryBypassParameter ( uint32_t inCategory, AAX_CParamID inParamID ) +{ + if ( mIACFEffectDescriptor ) + return mIACFEffectDescriptor->AddCategoryBypassParameter ( inCategory, inParamID ); + + return AAX_ERROR_NULL_OBJECT; +} + +// ****************************************************************************************** +// METHOD: AddProcPtr +// ****************************************************************************************** +AAX_Result AAX_VEffectDescriptor::AddProcPtr( void * inProcPtr, AAX_CProcPtrID inProcID ) +{ + if ( mIACFEffectDescriptor ) + return mIACFEffectDescriptor->AddProcPtr( inProcPtr, inProcID ); + + return AAX_ERROR_NULL_OBJECT; +} + +// ****************************************************************************************** +// METHOD: NewPropertyMap +// ****************************************************************************************** +AAX_IPropertyMap * AAX_VEffectDescriptor::NewPropertyMap () +{ + AAX_VPropertyMap * propertyMap = AAX_VPropertyMap::Create( mUnkHost ); + mPropertyMaps.insert( propertyMap ); + return propertyMap; +} + +// ****************************************************************************************** +// METHOD: SetProperties +// ****************************************************************************************** +AAX_Result AAX_VEffectDescriptor::SetProperties ( AAX_IPropertyMap * inProperties ) +{ + if ( mIACFEffectDescriptor ) + return mIACFEffectDescriptor->SetProperties( inProperties ? inProperties->GetIUnknown() : NULL); + + return AAX_ERROR_NULL_OBJECT; +} + +// ****************************************************************************************** +// METHOD: AddResourceInfo +// ****************************************************************************************** +AAX_Result AAX_VEffectDescriptor::AddResourceInfo ( AAX_EResourceType inResourceType, const char * inFileName ) +{ + if ( mIACFEffectDescriptor ) + return mIACFEffectDescriptor->AddResourceInfo ( inResourceType, inFileName ); + + return AAX_ERROR_NULL_OBJECT; +} + +// ****************************************************************************************** +// METHOD: AddMeterDescription +// ****************************************************************************************** +AAX_Result AAX_VEffectDescriptor::AddMeterDescription( AAX_CTypeID inMeterID, const char * inMeterName, AAX_IPropertyMap * inProperties ) +{ + if ( mIACFEffectDescriptor ) + { + IACFUnknown* propMap = inProperties ? inProperties->GetIUnknown() : NULL; + return mIACFEffectDescriptor->AddMeterDescription( inMeterID, inMeterName, propMap ); + } + + return AAX_ERROR_NULL_OBJECT; +} + +// ****************************************************************************************** +// METHOD: AddControlMIDINode +// ****************************************************************************************** +AAX_Result AAX_VEffectDescriptor::AddControlMIDINode ( AAX_CTypeID inNodeID, AAX_EMIDINodeType inNodeType, const char inNodeName[], uint32_t channelMask ) +{ + if ( mIACFEffectDescriptorV2 ) + return mIACFEffectDescriptorV2->AddControlMIDINode( inNodeID, inNodeType, inNodeName, channelMask ); + + return AAX_ERROR_UNIMPLEMENTED; +} diff --git a/modules/juce_audio_plugin_client/AAX/SDK/Libs/AAXLibrary/source/AAX_VFeatureInfo.cpp b/modules/juce_audio_plugin_client/AAX/SDK/Libs/AAXLibrary/source/AAX_VFeatureInfo.cpp new file mode 100644 index 0000000000..304e6b3a0f --- /dev/null +++ b/modules/juce_audio_plugin_client/AAX/SDK/Libs/AAXLibrary/source/AAX_VFeatureInfo.cpp @@ -0,0 +1,81 @@ +/*================================================================================================*/ +/* + * Copyright 2016-2017, 2019, 2023-2024 Avid Technology, Inc. + * All rights reserved. + * + * This file is part of the Avid AAX SDK. + * + * The AAX SDK is subject to commercial or open-source licensing. + * + * By using the AAX SDK, you agree to the terms of both the Avid AAX SDK License + * Agreement and Avid Privacy Policy. + * + * AAX SDK License: https://developer.avid.com/aax + * Privacy Policy: https://www.avid.com/legal/privacy-policy-statement + * + * Or: You may also use this code under the terms of the GPL v3 (see + * www.gnu.org/licenses). + * + * THE AAX SDK IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER + * EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE + * DISCLAIMED. + */ + +// Self include +#include "AAX_VFeatureInfo.h" + +// AAX includes +#include "AAX_IACFFeatureInfo.h" +#include "AAX_VPropertyMap.h" +#include "AAX_UIDs.h" + +// Standard includes +#include + + +AAX_VFeatureInfo::AAX_VFeatureInfo( IACFUnknown* pUnknown, const acfUID& inFeatureID ) +{ + mFeatureID = inFeatureID; + + if ( pUnknown ) + { + pUnknown->QueryInterface(IID_IAAXFeatureInfoV1, (void **)&mIFeature); + } +} + +AAX_VFeatureInfo::~AAX_VFeatureInfo() +{ +} + +AAX_Result AAX_VFeatureInfo::SupportLevel(AAX_ESupportLevel& oSupportLevel) const +{ + if ( mIFeature ) + return mIFeature->SupportLevel(&oSupportLevel); + + return AAX_ERROR_NULL_OBJECT; +} + +const AAX_IPropertyMap* AAX_VFeatureInfo::AcquireProperties() const +{ + AAX_UNIQUE_PTR(const AAX_IPropertyMap) acquiredMap; + + if ( mIFeature ) + { + IACFUnknown* properties = NULL; + + // const cast is OK here because we are ultimately storing the result of the non-const acquire call in a const object + AAX_IACFFeatureInfo* feature = const_cast(mIFeature.inArg()); + if (AAX_SUCCESS == feature->AcquireProperties(&properties) && (NULL != properties)) + { + // Move the ACF interface reference to an AAX_VPropertyMap object owned by the plug-in + acquiredMap.reset(AAX_VPropertyMap::Acquire(properties)); + } + } + + return acquiredMap.release(); +} + +const acfUID& AAX_VFeatureInfo::ID() const +{ + return mFeatureID; +} diff --git a/modules/juce_audio_plugin_client/AAX/SDK/Libs/AAXLibrary/source/AAX_VHostProcessorDelegate.cpp b/modules/juce_audio_plugin_client/AAX/SDK/Libs/AAXLibrary/source/AAX_VHostProcessorDelegate.cpp new file mode 100644 index 0000000000..537df513db --- /dev/null +++ b/modules/juce_audio_plugin_client/AAX/SDK/Libs/AAXLibrary/source/AAX_VHostProcessorDelegate.cpp @@ -0,0 +1,101 @@ +/*================================================================================================*/ +/* + * Copyright 2010-2017, 2023-2024 Avid Technology, Inc. + * All rights reserved. + * + * This file is part of the Avid AAX SDK. + * + * The AAX SDK is subject to commercial or open-source licensing. + * + * By using the AAX SDK, you agree to the terms of both the Avid AAX SDK License + * Agreement and Avid Privacy Policy. + * + * AAX SDK License: https://developer.avid.com/aax + * Privacy Policy: https://www.avid.com/legal/privacy-policy-statement + * + * Or: You may also use this code under the terms of the GPL v3 (see + * www.gnu.org/licenses). + * + * THE AAX SDK IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER + * EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE + * DISCLAIMED. + * + */ +/*================================================================================================*/ + +#include "AAX_VHostProcessorDelegate.h" + +#include "AAX_UIDs.h" + +// ****************************************************************************************** +// METHOD: AAX_VHostProcessorDelegate +// ****************************************************************************************** +AAX_VHostProcessorDelegate::AAX_VHostProcessorDelegate( IACFUnknown* pUnknown ) + : mIHostProcessorDelegate(NULL) + , mIHostProcessorDelegateV2(NULL) + , mIHostProcessorDelegateV3(NULL) +{ + if ( pUnknown ) + { + pUnknown->QueryInterface(IID_IAAXHostProcessorDelegateV3, (void **)&mIHostProcessorDelegateV3); + if (mIHostProcessorDelegateV3) + { + mIHostProcessorDelegate = mIHostProcessorDelegateV2 = mIHostProcessorDelegateV3; + } + else { + pUnknown->QueryInterface(IID_IAAXHostProcessorDelegateV2, (void **)&mIHostProcessorDelegateV2); + if (mIHostProcessorDelegateV2) + { + mIHostProcessorDelegate = mIHostProcessorDelegateV2; + } + else { + pUnknown->QueryInterface(IID_IAAXHostProcessorDelegateV1, (void **)&mIHostProcessorDelegate); + } + } + } +} + +// ****************************************************************************************** +// METHOD: GetAudio +// ****************************************************************************************** +AAX_Result AAX_VHostProcessorDelegate::GetAudio ( const float * const inAudioIns [], int32_t inAudioInCount, int64_t inLocation, int32_t * ioNumSamples ) +{ + if ( mIHostProcessorDelegate ) + return mIHostProcessorDelegate->GetAudio( inAudioIns, inAudioInCount, inLocation, ioNumSamples ); + + return AAX_ERROR_NULL_OBJECT; +} + +// ****************************************************************************************** +// METHOD: GetSideChainInputNum +// ****************************************************************************************** +int32_t AAX_VHostProcessorDelegate::GetSideChainInputNum () +{ + int32_t result = 0; + if ( mIHostProcessorDelegate ) + return mIHostProcessorDelegate->GetSideChainInputNum(); + + return result; +} + +// ****************************************************************************************** +// METHOD: ForceAnalyze +// ****************************************************************************************** +AAX_Result AAX_VHostProcessorDelegate::ForceAnalyze () +{ + if ( mIHostProcessorDelegateV2 ) + return mIHostProcessorDelegateV2->ForceAnalyze(); + + return AAX_ERROR_UNIMPLEMENTED; +} + +// ****************************************************************************************** +// METHOD: ForceProcess +// ****************************************************************************************** +AAX_Result AAX_VHostProcessorDelegate::ForceProcess () +{ + if ( mIHostProcessorDelegateV3 ) + return mIHostProcessorDelegateV3->ForceProcess(); + + return AAX_ERROR_UNIMPLEMENTED; +} diff --git a/modules/juce_audio_plugin_client/AAX/SDK/Libs/AAXLibrary/source/AAX_VHostServices.cpp b/modules/juce_audio_plugin_client/AAX/SDK/Libs/AAXLibrary/source/AAX_VHostServices.cpp new file mode 100644 index 0000000000..211e11bf59 --- /dev/null +++ b/modules/juce_audio_plugin_client/AAX/SDK/Libs/AAXLibrary/source/AAX_VHostServices.cpp @@ -0,0 +1,98 @@ +/*================================================================================================*/ +/* + * Copyright 2013-2015, 2018, 2023-2024 Avid Technology, Inc. + * All rights reserved. + * + * This file is part of the Avid AAX SDK. + * + * The AAX SDK is subject to commercial or open-source licensing. + * + * By using the AAX SDK, you agree to the terms of both the Avid AAX SDK License + * Agreement and Avid Privacy Policy. + * + * AAX SDK License: https://developer.avid.com/aax + * Privacy Policy: https://www.avid.com/legal/privacy-policy-statement + * + * Or: You may also use this code under the terms of the GPL v3 (see + * www.gnu.org/licenses). + * + * THE AAX SDK IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER + * EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE + * DISCLAIMED. + * + */ +/*================================================================================================*/ + +#include "AAX_VHostServices.h" +#include "AAX_UIDs.h" +#include "acfbaseapi.h" +#include "ACFPtr.h" + +// ****************************************************************************************** +// METHOD: AAX_VHostServices +// ****************************************************************************************** +AAX_VHostServices::AAX_VHostServices( IACFUnknown * pUnkHost ) : + mIACFHostServices( NULL ), + mIACFHostServices2( NULL ) +{ + if ( pUnkHost ) + { + // Get the component factory service from the host so we can create the + // built-in plug-in definition. + ACFPtr pFactory; + if ( pUnkHost->QueryInterface(IID_IACFComponentFactory, (void **)&pFactory) == ACF_OK ) + { + // Create the object and get the base interface for it. + pFactory->CreateComponent(AAXCompID_HostServices, 0, IID_IAAXHostServicesV1, (void **)&mIACFHostServices); + pFactory->CreateComponent(AAXCompID_HostServices, 0, IID_IAAXHostServicesV2, (void **)&mIACFHostServices2); + pFactory->CreateComponent(AAXCompID_HostServices, 0, IID_IAAXHostServicesV3, (void **)&mIACFHostServices3); + } + } +} + +// ****************************************************************************************** +// METHOD: ~AAX_VHostServices +// ****************************************************************************************** +AAX_VHostServices::~AAX_VHostServices( ) +{ +} + +// ****************************************************************************************** +// METHOD: HandleAssertFailure +// ****************************************************************************************** +AAX_Result AAX_VHostServices::HandleAssertFailure ( const char * iFile, int32_t iLine, const char * iNote, int32_t iFlags ) const +{ + if (mIACFHostServices3) { + return mIACFHostServices3->HandleAssertFailure( iFile, iLine, iNote, iFlags ); + } +// See comment at AAX_IACFHostServices::Assert() +#if defined _DEBUG + else if (mIACFHostServices) { + return const_cast(this)->mIACFHostServices->Assert( iFile, iLine, iNote ); + } +#endif + + return AAX_ERROR_NULL_OBJECT; +} + +// ****************************************************************************************** +// METHOD: Trace +// ****************************************************************************************** +AAX_Result AAX_VHostServices::Trace ( int32_t iPriority, const char * iMessage ) const +{ + if ( mIACFHostServices ) + return const_cast(this)->mIACFHostServices->Trace( iPriority, iMessage ); + + return AAX_ERROR_NULL_OBJECT; +} + +// ****************************************************************************************** +// METHOD: StackTrace +// ****************************************************************************************** +AAX_Result AAX_VHostServices::StackTrace ( int32_t iTracePriority, int32_t iStackTracePriority, const char * iMessage ) const +{ + if ( mIACFHostServices2 ) + return const_cast(this)->mIACFHostServices2->StackTrace( iTracePriority, iStackTracePriority, iMessage ); + + return AAX_ERROR_UNIMPLEMENTED; +} diff --git a/modules/juce_audio_plugin_client/AAX/SDK/Libs/AAXLibrary/source/AAX_VPageTable.cpp b/modules/juce_audio_plugin_client/AAX/SDK/Libs/AAXLibrary/source/AAX_VPageTable.cpp new file mode 100644 index 0000000000..06d4f512bf --- /dev/null +++ b/modules/juce_audio_plugin_client/AAX/SDK/Libs/AAXLibrary/source/AAX_VPageTable.cpp @@ -0,0 +1,237 @@ +/*================================================================================================*/ +/* + * Copyright 2016-2017, 2023-2024 Avid Technology, Inc. + * All rights reserved. + * + * This file is part of the Avid AAX SDK. + * + * The AAX SDK is subject to commercial or open-source licensing. + * + * By using the AAX SDK, you agree to the terms of both the Avid AAX SDK License + * Agreement and Avid Privacy Policy. + * + * AAX SDK License: https://developer.avid.com/aax + * Privacy Policy: https://www.avid.com/legal/privacy-policy-statement + * + * Or: You may also use this code under the terms of the GPL v3 (see + * www.gnu.org/licenses). + * + * THE AAX SDK IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER + * EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE + * DISCLAIMED. + * + */ +/*================================================================================================*/ + +#include "AAX_VPageTable.h" +#include "AAX_UIDs.h" + + +// ****************************************************************************************** +// METHOD: AAX_VPageTable +// ****************************************************************************************** +AAX_VPageTable::AAX_VPageTable( IACFUnknown* pUnknown ) +: mIPageTable() +{ + if ( pUnknown ) + { + // If this unknown supports query of an existing page table then the AAX_VPageTable + // object will use the existing page table + pUnknown->QueryInterface(IID_IAAXPageTableV1, (void **)&mIPageTable); + pUnknown->QueryInterface(IID_IAAXPageTableV2, (void **)&mIPageTable2); + } +} + +// ****************************************************************************************** +// METHOD: ~AAX_VPageTable +// ****************************************************************************************** +AAX_VPageTable::~AAX_VPageTable() +{ +} + +// ****************************************************************************************** +// METHOD: Clear +// ****************************************************************************************** +AAX_Result AAX_VPageTable::Clear() +{ + if (mIPageTable) + return mIPageTable->Clear(); + + return AAX_ERROR_UNIMPLEMENTED; +} + +// ****************************************************************************************** +// METHOD: Empty +// ****************************************************************************************** +AAX_Result AAX_VPageTable::Empty(AAX_CBoolean& oEmpty) const +{ + if (mIPageTable) + return mIPageTable->Empty(oEmpty); + + return AAX_ERROR_UNIMPLEMENTED; +} + +// ****************************************************************************************** +// METHOD: GetNumPages +// ****************************************************************************************** +AAX_Result AAX_VPageTable::GetNumPages(int32_t& oNumPages) const +{ + if (mIPageTable) + return mIPageTable->GetNumPages(oNumPages); + + return AAX_ERROR_UNIMPLEMENTED; +} + +// ****************************************************************************************** +// METHOD: InsertPage +// ****************************************************************************************** +AAX_Result AAX_VPageTable::InsertPage(int32_t iPage) +{ + if (mIPageTable) + return mIPageTable->InsertPage(iPage); + + return AAX_ERROR_UNIMPLEMENTED; +} + +// ****************************************************************************************** +// METHOD: RemovePage +// ****************************************************************************************** +AAX_Result AAX_VPageTable::RemovePage(int32_t iPage) +{ + if (mIPageTable) + return mIPageTable->RemovePage(iPage); + + return AAX_ERROR_UNIMPLEMENTED; +} + +// ****************************************************************************************** +// METHOD: GetNumMappedParameterIDs +// ****************************************************************************************** +AAX_Result AAX_VPageTable::GetNumMappedParameterIDs(int32_t iPage, int32_t& oNumParameterIdentifiers) const +{ + if (mIPageTable) + return mIPageTable->GetNumMappedParameterIDs(iPage, oNumParameterIdentifiers); + + return AAX_ERROR_UNIMPLEMENTED; +} + +// ****************************************************************************************** +// METHOD: ClearMappedParameter +// ****************************************************************************************** +AAX_Result AAX_VPageTable::ClearMappedParameter(int32_t iPage, int32_t iIndex) +{ + if (mIPageTable) + return mIPageTable->ClearMappedParameter(iPage, iIndex); + + return AAX_ERROR_UNIMPLEMENTED; +} + +// ****************************************************************************************** +// METHOD: GetMappedParameterID +// ****************************************************************************************** +AAX_Result AAX_VPageTable::GetMappedParameterID(int32_t iPage, int32_t iIndex, AAX_IString& oParameterIdentifier) const +{ + if (mIPageTable) + return mIPageTable->GetMappedParameterID(iPage, iIndex, oParameterIdentifier); + + return AAX_ERROR_UNIMPLEMENTED; +} + +// ****************************************************************************************** +// METHOD: MapParameterID +// ****************************************************************************************** +AAX_Result AAX_VPageTable::MapParameterID(AAX_CParamID iParameterIdentifier, int32_t iPage, int32_t iIndex) +{ + if (mIPageTable) + return mIPageTable->MapParameterID(iParameterIdentifier, iPage, iIndex); + + return AAX_ERROR_UNIMPLEMENTED; +} + +// ****************************************************************************************** +// METHOD: GetNumParametersWithNameVariations +// ****************************************************************************************** +AAX_Result AAX_VPageTable::GetNumParametersWithNameVariations(int32_t& oNumParameterIdentifiers) const +{ + if (mIPageTable2) + return mIPageTable2->GetNumParametersWithNameVariations(oNumParameterIdentifiers); + + return AAX_ERROR_UNIMPLEMENTED; +} + +// ****************************************************************************************** +// METHOD: GetNameVariationParameterIDAtIndex +// ****************************************************************************************** +AAX_Result AAX_VPageTable::GetNameVariationParameterIDAtIndex(int32_t iIndex, AAX_IString& oParameterIdentifier) const +{ + if (mIPageTable2) + return mIPageTable2->GetNameVariationParameterIDAtIndex(iIndex, oParameterIdentifier); + + return AAX_ERROR_UNIMPLEMENTED; +} + +// ****************************************************************************************** +// METHOD: GetNumNameVariationsForParameter +// ****************************************************************************************** +AAX_Result AAX_VPageTable::GetNumNameVariationsForParameter(AAX_CPageTableParamID iParameterIdentifier, int32_t& oNumVariations) const +{ + if (mIPageTable2) + return mIPageTable2->GetNumNameVariationsForParameter(iParameterIdentifier, oNumVariations); + + return AAX_ERROR_UNIMPLEMENTED; +} + +// ****************************************************************************************** +// METHOD: GetParameterNameVariationAtIndex +// ****************************************************************************************** +AAX_Result AAX_VPageTable::GetParameterNameVariationAtIndex(AAX_CPageTableParamID iParameterIdentifier, int32_t iIndex, AAX_IString& oNameVariation, int32_t& oLength) const +{ + if (mIPageTable2) + return mIPageTable2->GetParameterNameVariationAtIndex(iParameterIdentifier, iIndex, oNameVariation, oLength); + + return AAX_ERROR_UNIMPLEMENTED; +} + +// ****************************************************************************************** +// METHOD: GetParameterNameVariationOfLength +// ****************************************************************************************** +AAX_Result AAX_VPageTable::GetParameterNameVariationOfLength(AAX_CPageTableParamID iParameterIdentifier, int32_t iLength, AAX_IString& oNameVariation) const +{ + if (mIPageTable2) + return mIPageTable2->GetParameterNameVariationOfLength(iParameterIdentifier, iLength, oNameVariation); + + return AAX_ERROR_UNIMPLEMENTED; +} + +// ****************************************************************************************** +// METHOD: ClearParameterNameVariations +// ****************************************************************************************** +AAX_Result AAX_VPageTable::ClearParameterNameVariations() +{ + if (mIPageTable2) + return mIPageTable2->ClearParameterNameVariations(); + + return AAX_ERROR_UNIMPLEMENTED; +} + +// ****************************************************************************************** +// METHOD: ClearNameVariationsForParameter +// ****************************************************************************************** +AAX_Result AAX_VPageTable::ClearNameVariationsForParameter(AAX_CPageTableParamID iParameterIdentifier) +{ + if (mIPageTable2) + return mIPageTable2->ClearNameVariationsForParameter(iParameterIdentifier); + + return AAX_ERROR_UNIMPLEMENTED; +} + +// ****************************************************************************************** +// METHOD: SetParameterNameVariation +// ****************************************************************************************** +AAX_Result AAX_VPageTable::SetParameterNameVariation(AAX_CPageTableParamID iParameterIdentifier, const AAX_IString& iNameVariation, int32_t iLength) +{ + if (mIPageTable2) + return mIPageTable2->SetParameterNameVariation(iParameterIdentifier, iNameVariation, iLength); + + return AAX_ERROR_UNIMPLEMENTED; +} diff --git a/modules/juce_audio_plugin_client/AAX/SDK/Libs/AAXLibrary/source/AAX_VPrivateDataAccess.cpp b/modules/juce_audio_plugin_client/AAX/SDK/Libs/AAXLibrary/source/AAX_VPrivateDataAccess.cpp new file mode 100644 index 0000000000..45980d7728 --- /dev/null +++ b/modules/juce_audio_plugin_client/AAX/SDK/Libs/AAXLibrary/source/AAX_VPrivateDataAccess.cpp @@ -0,0 +1,75 @@ +/*================================================================================================*/ +/* + * Copyright 2013-2015, 2023-2024 Avid Technology, Inc. + * All rights reserved. + * + * This file is part of the Avid AAX SDK. + * + * The AAX SDK is subject to commercial or open-source licensing. + * + * By using the AAX SDK, you agree to the terms of both the Avid AAX SDK License + * Agreement and Avid Privacy Policy. + * + * AAX SDK License: https://developer.avid.com/aax + * Privacy Policy: https://www.avid.com/legal/privacy-policy-statement + * + * Or: You may also use this code under the terms of the GPL v3 (see + * www.gnu.org/licenses). + * + * THE AAX SDK IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER + * EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE + * DISCLAIMED. + * + */ +/*================================================================================================*/ + +#include "AAX_VPrivateDataAccess.h" +#include "AAX_UIDs.h" + +// ****************************************************************************************** +// METHOD: AAX_VPrivateDataAccess +// ****************************************************************************************** +AAX_VPrivateDataAccess::AAX_VPrivateDataAccess( IACFUnknown* pUnknown ) +: mIPrivateDataAccess(NULL) +{ + if ( pUnknown ) + { + pUnknown->QueryInterface(IID_IAAXPrivateDataAccessV1, (void **)&mIPrivateDataAccess); + } +} + +// ****************************************************************************************** +// METHOD: ~AAX_VPrivateDataAccess +// ****************************************************************************************** +AAX_VPrivateDataAccess::~AAX_VPrivateDataAccess() +{ +} + +// ****************************************************************************************** +// METHOD: ReadPortDirect +// ****************************************************************************************** +AAX_Result AAX_VPrivateDataAccess::ReadPortDirect( AAX_CFieldIndex inFieldIndex, const uint32_t inOffset, const uint32_t inSize, void* outBuffer ) +{ + if ( mIPrivateDataAccess ) + return mIPrivateDataAccess->ReadPortDirect ( inFieldIndex, inOffset, inSize, outBuffer ); + + return AAX_ERROR_NULL_OBJECT; +} + +// ****************************************************************************************** +// METHOD: WritePortDirect +// ****************************************************************************************** +AAX_Result AAX_VPrivateDataAccess::WritePortDirect( AAX_CFieldIndex inFieldIndex, const uint32_t inOffset, const uint32_t inSize, const void* inBuffer ) +{ + if ( mIPrivateDataAccess ) + return mIPrivateDataAccess->WritePortDirect ( inFieldIndex, inOffset, inSize, inBuffer ); + + return AAX_ERROR_NULL_OBJECT; +} + + + + + + + diff --git a/modules/juce_audio_plugin_client/AAX/SDK/Libs/AAXLibrary/source/AAX_VPropertyMap.cpp b/modules/juce_audio_plugin_client/AAX/SDK/Libs/AAXLibrary/source/AAX_VPropertyMap.cpp new file mode 100644 index 0000000000..5d442677a1 --- /dev/null +++ b/modules/juce_audio_plugin_client/AAX/SDK/Libs/AAXLibrary/source/AAX_VPropertyMap.cpp @@ -0,0 +1,340 @@ +/*================================================================================================*/ +/* + * Copyright 2013-2017, 2019, 2023-2024 Avid Technology, Inc. + * All rights reserved. + * + * This file is part of the Avid AAX SDK. + * + * The AAX SDK is subject to commercial or open-source licensing. + * + * By using the AAX SDK, you agree to the terms of both the Avid AAX SDK License + * Agreement and Avid Privacy Policy. + * + * AAX SDK License: https://developer.avid.com/aax + * Privacy Policy: https://www.avid.com/legal/privacy-policy-statement + * + * Or: You may also use this code under the terms of the GPL v3 (see + * www.gnu.org/licenses). + * + * THE AAX SDK IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER + * EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE + * DISCLAIMED. + * + */ +/*================================================================================================*/ + +// Self Include +#include "AAX_VPropertyMap.h" + +// AAX Includes +#include "AAX_VDescriptionHost.h" +#include "AAX_VComponentDescriptor.h" +#include "AAX_IACFDescriptionHost.h" +#include "AAX_UIDs.h" + +// ACF Includes +#include "acfbaseapi.h" + +// Standard Includes +#include + + +// ****************************************************************************************** +// METHOD: Create +// ****************************************************************************************** +/* static */ +AAX_VPropertyMap* AAX_VPropertyMap::Create( IACFUnknown * inComponentFactory ) +{ + AAX_UNIQUE_PTR(AAX_VPropertyMap) newMap; + if ( inComponentFactory ) + { + // Get the component factory service from the host so we can create the + // built-in plug-in definition. + ACFPtr pFactory; + if ( inComponentFactory->QueryInterface(IID_IACFComponentFactory, (void **)&pFactory) == ACF_OK ) + { + newMap.reset(new AAX_VPropertyMap); + newMap->InitWithFactory(pFactory.inArg(), inComponentFactory); + } + } + return newMap.release(); +} + +// ****************************************************************************************** +// METHOD: Acquire +// ****************************************************************************************** +/* static */ +AAX_VPropertyMap* AAX_VPropertyMap::Acquire( IACFUnknown * inPropertyMapUnknown ) +{ + AAX_UNIQUE_PTR(AAX_VPropertyMap) newMap(new AAX_VPropertyMap); + + // We don't actually expect the property map to support IID_IAAXDescriptionHostV1, but we pass it in + // as the auxiliary unknown here to avoid a recompile requirement if we ever find we need to support + // the description host interface (see the note in AAX_VPropertyMap::AddProperty() ) + newMap->InitWithPropertyMap(inPropertyMapUnknown, inPropertyMapUnknown); + + return newMap.release(); +} + +// ****************************************************************************************** +// METHOD: AAX_VPropertyMap +// ****************************************************************************************** +AAX_VPropertyMap::AAX_VPropertyMap() : + mIACFPropertyMap( NULL ), + mIACFPropertyMapV2( NULL ), + mIACFPropertyMapV3( NULL ), + mIACFDescriptionHost( NULL ) +{ +} + +// ****************************************************************************************** +// METHOD: InitWithFactory +// ****************************************************************************************** +void AAX_VPropertyMap::InitWithFactory(IACFComponentFactory *inComponentFactory, IACFUnknown* inAuxiliaryUnknown) +{ + if (inComponentFactory) + { + // Create the object and get the base interface for it. + inComponentFactory->CreateComponent(AAXCompID_AAXPropertyMap, 0, IID_IAAXPropertyMapV1, (void **)&mIACFPropertyMap); + + if (mIACFPropertyMap) + { + mIACFPropertyMap->QueryInterface(IID_IAAXPropertyMapV2, (void **)&mIACFPropertyMapV2); + mIACFPropertyMap->QueryInterface(IID_IAAXPropertyMapV3, (void **)&mIACFPropertyMapV3); + } + + // Get the AAX_IACFDescriptionHost, if supported + // + // It's possible that any of the accessible interfaces could serve the description host; we start + // with the auxiliary as the most likely. + if (inAuxiliaryUnknown) + { + inAuxiliaryUnknown->QueryInterface(IID_IAAXDescriptionHostV1, (void**)&mIACFDescriptionHost); + } + if (mIACFDescriptionHost.isNull()) + { + inComponentFactory->QueryInterface(IID_IAAXDescriptionHostV1, (void**)&mIACFDescriptionHost); + } + if (mIACFPropertyMapV2 && mIACFDescriptionHost.isNull()) + { + mIACFPropertyMapV2->QueryInterface(IID_IAAXDescriptionHostV1, (void**)&mIACFDescriptionHost); + } + if (mIACFPropertyMapV3 && mIACFDescriptionHost.isNull()) + { + mIACFPropertyMapV3->QueryInterface(IID_IAAXDescriptionHostV1, (void**)&mIACFDescriptionHost); + } + if (mIACFPropertyMap && mIACFDescriptionHost.isNull()) + { + mIACFPropertyMap->QueryInterface(IID_IAAXDescriptionHostV1, (void**)&mIACFDescriptionHost); + } + } +} + +// ****************************************************************************************** +// METHOD: InitWithPropertyMap +// ****************************************************************************************** +void AAX_VPropertyMap::InitWithPropertyMap(IACFUnknown *inPropertyMapUnknown, IACFUnknown* inAuxiliaryUnknown) +{ + if (inPropertyMapUnknown) + { + inPropertyMapUnknown->QueryInterface(IID_IAAXPropertyMapV1, (void **)&mIACFPropertyMap); + inPropertyMapUnknown->QueryInterface(IID_IAAXPropertyMapV2, (void **)&mIACFPropertyMapV2); + inPropertyMapUnknown->QueryInterface(IID_IAAXPropertyMapV3, (void **)&mIACFPropertyMapV3); + + // Get the AAX_IACFDescriptionHost, if supported + // + // It's possible that any of the accessible interfaces could serve the description host; we start + // with the auxiliary as the most likely. + if (inAuxiliaryUnknown) + { + inAuxiliaryUnknown->QueryInterface(IID_IAAXDescriptionHostV1, (void**)&mIACFDescriptionHost); + } + if (mIACFDescriptionHost.isNull()) + { + inPropertyMapUnknown->QueryInterface(IID_IAAXDescriptionHostV1, (void**)&mIACFDescriptionHost); + } + } +} + +// ****************************************************************************************** +// METHOD: ~AAX_VPropertyMap +// ****************************************************************************************** +AAX_VPropertyMap::~AAX_VPropertyMap(void) +{ +} + +// ****************************************************************************************** +// METHOD: GetIUnknown +// ****************************************************************************************** +IACFUnknown * AAX_VPropertyMap::GetIUnknown () +{ + if (!mIACFPropertyMapV3.isNull()) { return mIACFPropertyMapV3; } + if (!mIACFPropertyMapV2.isNull()) { return mIACFPropertyMapV2; } + if (!mIACFPropertyMap.isNull()) { return mIACFPropertyMap; } + return NULL; +} + +// ****************************************************************************************** +// METHOD: GetProperty +// ****************************************************************************************** +AAX_CBoolean AAX_VPropertyMap::GetProperty ( AAX_EProperty inProperty, AAX_CPropertyValue * outValue ) const +{ + if ( mIACFPropertyMap ) + return mIACFPropertyMap->GetProperty ( inProperty, outValue ); + + return 0; +} + +// ****************************************************************************************** +// METHOD: GetProperty +// ****************************************************************************************** +AAX_CBoolean AAX_VPropertyMap::GetPointerProperty ( AAX_EProperty inProperty, const void** outValue ) const +{ + AAX_CBoolean result = 0; + +#if (AAX_PointerSize == AAXPointer_32bit) + if ( mIACFPropertyMap ) + { + result = mIACFPropertyMap->GetProperty ( inProperty, reinterpret_cast(outValue) ); + } +#elif (AAX_PointerSize == AAXPointer_64bit) + if ( mIACFPropertyMapV3 ) + { + result = mIACFPropertyMapV3->GetProperty64 ( inProperty, reinterpret_cast(outValue) ); + } + else + { + // See note in AddPointerProperty() + if ((NULL != outValue) && (0 < mLocalPointerPropertyCache.count(inProperty))) + { + *outValue = const_cast(this)->mLocalPointerPropertyCache[inProperty]; // we still want to support some STL versions that don't have std::map::at() + result = 1; + } + else + { + result = 0; + } + } +#else + #error unexpected pointer size +#endif + + return result; +} + +// ****************************************************************************************** +// METHOD: AddProperty +// ****************************************************************************************** +AAX_Result AAX_VPropertyMap::AddProperty ( AAX_EProperty inProperty, AAX_CPropertyValue inValue ) +{ + // PT-223581: Pro Tools removes plug-ins from the insert menu if unsupported stem formats are detected + if ( (AAX_eProperty_InputStemFormat == inProperty) || (AAX_eProperty_OutputStemFormat == inProperty)) + { + // HACK: using support for AAX_IACFDescriptionHost as an indication of whether this bug has been addressed in the host + // + // IMPORTANT NOTE: This can fire with a false positive (i.e. return an error code) for AAX_VPropertyMap objects which + // were intentionally created without a description host. Currently we only expect this in the case of property maps + // generated from AAX_IFeatureInfo objects, and those property maps are const so this method will never be called. + if (!mIACFDescriptionHost) + { + if (( (AAX_STEM_FORMAT_INDEX(inValue) < AAX_STEM_FORMAT_INDEX(AAX_eStemFormat_Mono)) || (AAX_STEM_FORMAT_INDEX(inValue) > AAX_STEM_FORMAT_INDEX(AAX_eStemFormat_7_1_DTS)) ) && + ( (inValue != static_cast(AAX_eStemFormat_Any)) ) && + ( (inValue != static_cast(AAX_eStemFormat_None)) )) + { + return AAX_ERROR_PROPERTY_UNDEFINED; + } + } + // otherwise, it is fine to register stem formats which are unknown to the host + } + + if ( mIACFPropertyMap ) + { + return mIACFPropertyMap->AddProperty ( inProperty, inValue ); + } + + return AAX_ERROR_NULL_OBJECT; +} + +// ****************************************************************************************** +// METHOD: AddPointerProperty +// ****************************************************************************************** +AAX_Result AAX_VPropertyMap::AddPointerProperty ( AAX_EProperty inProperty, const void* inValue ) +{ + AAX_Result err = AAX_ERROR_NULL_OBJECT; + +#if (AAX_PointerSize == AAXPointer_32bit) + if ( mIACFPropertyMap ) + { + err = mIACFPropertyMap->AddProperty ( inProperty, reinterpret_cast(inValue) ); + } +#elif (AAX_PointerSize == AAXPointer_64bit) + if ( mIACFPropertyMapV3 ) + { + err = mIACFPropertyMapV3->AddProperty64 ( inProperty, reinterpret_cast(inValue) ); + } + else + { + // Hack: To support the AddProcessProc() emulation in AAX_VComponentDescriptor::AddProcessProc() we + // cache the pointer property values here which we know will be queried by that emulation without + // actually setting them on the property map (of course this would all go away if we would just + // use a property map object implemented and allocated on the AAX Library side, but oh well.) + const std::set& pointerPropertiesToCache = AAX_VComponentDescriptor::PointerPropertiesUsedByAddProcessProc(); + if (0 < pointerPropertiesToCache.count(inProperty)) + { + mLocalPointerPropertyCache[inProperty] = inValue; + err = AAX_SUCCESS; + } + else + { + // use unimplemented for interface versions > 1 + err = AAX_ERROR_UNIMPLEMENTED; + } + } +#else + #error unexpected pointer size +#endif + + return err; +} + +// ****************************************************************************************** +// METHOD: AddPointerProperty +// ****************************************************************************************** +AAX_Result AAX_VPropertyMap::AddPointerProperty ( AAX_EProperty inProperty, const char* inValue ) +{ + return this->AddPointerProperty(inProperty, reinterpret_cast(inValue)); +} + +// ****************************************************************************************** +// METHOD: RemoveProperty +// ****************************************************************************************** +AAX_Result AAX_VPropertyMap::RemoveProperty ( AAX_EProperty inProperty ) +{ + if ( mIACFPropertyMap ) + return mIACFPropertyMap->RemoveProperty ( inProperty ); + return AAX_ERROR_NULL_OBJECT; +} + +// ****************************************************************************************** +// METHOD: AddPropertyWithIDArray +// ****************************************************************************************** +AAX_Result AAX_VPropertyMap::AddPropertyWithIDArray ( AAX_EProperty iProperty, const AAX_SPlugInIdentifierTriad* iPluginIDs, uint32_t iNumPluginIDs) +{ + if (mIACFPropertyMapV2) + return mIACFPropertyMapV2->AddPropertyWithIDArray(iProperty, iPluginIDs, iNumPluginIDs); + return AAX_ERROR_UNIMPLEMENTED; +} + +// ****************************************************************************************** +// METHOD: GetPropertyWithIDArray +// ****************************************************************************************** +AAX_CBoolean AAX_VPropertyMap::GetPropertyWithIDArray ( AAX_EProperty iProperty, const AAX_SPlugInIdentifierTriad** oPluginIDs, uint32_t* oNumPluginIDs) const +{ + AAX_CBoolean result = 0; + + if (mIACFPropertyMapV2) + return mIACFPropertyMapV2->GetPropertyWithIDArray(iProperty, oPluginIDs, oNumPluginIDs); + + return result; +} + diff --git a/modules/juce_audio_plugin_client/AAX/SDK/Libs/AAXLibrary/source/AAX_VTransport.cpp b/modules/juce_audio_plugin_client/AAX/SDK/Libs/AAXLibrary/source/AAX_VTransport.cpp new file mode 100644 index 0000000000..0c5817f515 --- /dev/null +++ b/modules/juce_audio_plugin_client/AAX/SDK/Libs/AAXLibrary/source/AAX_VTransport.cpp @@ -0,0 +1,196 @@ +/*================================================================================================*/ +/* + * Copyright 2013-2015, 2019-2021, 2023-2024 Avid Technology, Inc. + * All rights reserved. + * + * This file is part of the Avid AAX SDK. + * + * The AAX SDK is subject to commercial or open-source licensing. + * + * By using the AAX SDK, you agree to the terms of both the Avid AAX SDK License + * Agreement and Avid Privacy Policy. + * + * AAX SDK License: https://developer.avid.com/aax + * Privacy Policy: https://www.avid.com/legal/privacy-policy-statement + * + * Or: You may also use this code under the terms of the GPL v3 (see + * www.gnu.org/licenses). + * + * THE AAX SDK IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER + * EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE + * DISCLAIMED. + * + */ +/*================================================================================================*/ + +#include "AAX_VTransport.h" +#include "AAX_UIDs.h" + +AAX_VTransport::AAX_VTransport( IACFUnknown* pUnknown ) +{ + if ( pUnknown ) + { + pUnknown->QueryInterface(IID_IAAXTransportV1, (void **)&mITransport); + pUnknown->QueryInterface(IID_IAAXTransportV2, (void **)&mITransportV2); + pUnknown->QueryInterface(IID_IAAXTransportV3, (void **)&mITransportV3); + pUnknown->QueryInterface(IID_IAAXTransportV4, (void **)&mITransportV4); + pUnknown->QueryInterface(IID_IAAXTransportV5, (void **)&mITransportV5); + pUnknown->QueryInterface(IID_IAAXTransportControlV1, (void **)&mITransportControl); + } +} + +AAX_VTransport::~AAX_VTransport() +{ +} + +AAX_Result AAX_VTransport::GetCurrentTempo ( double* TempoBPM ) const +{ + if ( mITransport ) + return mITransport->GetCurrentTempo( TempoBPM ); + + return AAX_ERROR_NULL_OBJECT; +} + +AAX_Result AAX_VTransport::GetCurrentMeter ( int32_t* MeterNumerator, int32_t* MeterDenominator ) const +{ + if ( mITransport ) + return mITransport->GetCurrentMeter ( MeterNumerator, MeterDenominator ); + + return AAX_ERROR_NULL_OBJECT; +} + +AAX_Result AAX_VTransport::IsTransportPlaying ( bool* isPlaying ) const +{ + if ( mITransport ) + return mITransport->IsTransportPlaying ( isPlaying ); + + return AAX_ERROR_NULL_OBJECT; +} + +AAX_Result AAX_VTransport::GetCurrentTickPosition ( int64_t* TickPosition ) const +{ + if ( mITransport ) + return mITransport->GetCurrentTickPosition ( TickPosition ); + + return AAX_ERROR_NULL_OBJECT; +} + +AAX_Result AAX_VTransport::GetCurrentLoopPosition ( bool* bLooping, int64_t* LoopStartTick, int64_t* LoopEndTick ) const +{ + if ( mITransport ) + return mITransport->GetCurrentLoopPosition ( bLooping, LoopStartTick, LoopEndTick ); + + return AAX_ERROR_NULL_OBJECT; +} + +AAX_Result AAX_VTransport::GetCurrentNativeSampleLocation ( int64_t* SampleLocation ) const +{ + if ( mITransport ) + return mITransport->GetCurrentNativeSampleLocation ( SampleLocation ); + + return AAX_ERROR_NULL_OBJECT; +} + +AAX_Result AAX_VTransport::GetCustomTickPosition( int64_t* oTickPosition, int64_t iSampleLocation) const +{ + if ( mITransport ) + return mITransport->GetCustomTickPosition( oTickPosition, iSampleLocation); + + return AAX_ERROR_NULL_OBJECT; +} + +AAX_Result AAX_VTransport::GetBarBeatPosition(int32_t* Bars, int32_t* Beats, int64_t* DisplayTicks, int64_t SampleLocation) const +{ + if ( mITransport ) + return mITransport->GetBarBeatPosition( Bars, Beats, DisplayTicks, SampleLocation); + + return AAX_ERROR_NULL_OBJECT; +} + +AAX_Result AAX_VTransport::GetTicksPerQuarter ( uint32_t* ticks ) const +{ + if ( mITransport ) + return mITransport->GetTicksPerQuarter ( ticks ); + + return AAX_ERROR_NULL_OBJECT; +} + +AAX_Result AAX_VTransport::GetCurrentTicksPerBeat ( uint32_t* ticks ) const +{ + if ( mITransport ) + return mITransport->GetCurrentTicksPerBeat ( ticks ); + + return AAX_ERROR_NULL_OBJECT; +} + +AAX_Result AAX_VTransport::GetTimelineSelectionStartPosition ( int64_t* oSampleLocation ) const +{ + if ( mITransportV2 ) + return mITransportV2->GetTimelineSelectionStartPosition ( oSampleLocation ); + + return AAX_ERROR_UNIMPLEMENTED; +} + +AAX_Result AAX_VTransport::GetTimeCodeInfo( AAX_EFrameRate* oFrameRate, int32_t* oOffset ) const +{ + if ( mITransportV2 ) + return mITransportV2->GetTimeCodeInfo( oFrameRate, oOffset ); + + return AAX_ERROR_UNIMPLEMENTED; +} + +AAX_Result AAX_VTransport::GetFeetFramesInfo( AAX_EFeetFramesRate* oFeetFramesRate, int64_t* oOffset ) const +{ + if ( mITransportV2 ) + return mITransportV2->GetFeetFramesInfo( oFeetFramesRate, oOffset ); + + return AAX_ERROR_UNIMPLEMENTED; +} + +AAX_Result AAX_VTransport::IsMetronomeEnabled ( int32_t* isEnabled ) const +{ + if ( mITransportV2 ) + return mITransportV2->IsMetronomeEnabled( isEnabled ); + + return AAX_ERROR_UNIMPLEMENTED; +} + +AAX_Result AAX_VTransport::GetHDTimeCodeInfo( AAX_EFrameRate* oHDFrameRate, int64_t* oHDOffset ) const +{ + if ( mITransportV3 ) + return mITransportV3->GetHDTimeCodeInfo( oHDFrameRate, oHDOffset ); + + return AAX_ERROR_UNIMPLEMENTED; +} + +AAX_Result AAX_VTransport::GetTimelineSelectionEndPosition( int64_t* oSampleLocation ) const +{ + if ( mITransportV4 ) + return mITransportV4->GetTimelineSelectionEndPosition ( oSampleLocation ); + + return AAX_ERROR_UNIMPLEMENTED; +} + +AAX_Result AAX_VTransport::GetKeySignature( int64_t iSampleLocation, uint32_t* oKeySignature ) const +{ + if ( mITransportV5 ) + return mITransportV5->GetKeySignature( iSampleLocation, oKeySignature ); + + return AAX_ERROR_UNIMPLEMENTED; +} + +AAX_Result AAX_VTransport::RequestTransportStart() +{ + if ( mITransportControl ) + return mITransportControl->RequestTransportStart(); + + return AAX_ERROR_UNIMPLEMENTED; +} + +AAX_Result AAX_VTransport::RequestTransportStop() +{ + if ( mITransportControl ) + return mITransportControl->RequestTransportStop(); + + return AAX_ERROR_UNIMPLEMENTED; +} diff --git a/modules/juce_audio_plugin_client/AAX/SDK/Libs/AAXLibrary/source/AAX_VViewContainer.cpp b/modules/juce_audio_plugin_client/AAX/SDK/Libs/AAXLibrary/source/AAX_VViewContainer.cpp new file mode 100644 index 0000000000..bf3e3bc02f --- /dev/null +++ b/modules/juce_audio_plugin_client/AAX/SDK/Libs/AAXLibrary/source/AAX_VViewContainer.cpp @@ -0,0 +1,233 @@ +/*================================================================================================*/ +/* + * Copyright 2013-2019, 2021, 2023-2024 Avid Technology, Inc. + * All rights reserved. + * + * This file is part of the Avid AAX SDK. + * + * The AAX SDK is subject to commercial or open-source licensing. + * + * By using the AAX SDK, you agree to the terms of both the Avid AAX SDK License + * Agreement and Avid Privacy Policy. + * + * AAX SDK License: https://developer.avid.com/aax + * Privacy Policy: https://www.avid.com/legal/privacy-policy-statement + * + * Or: You may also use this code under the terms of the GPL v3 (see + * www.gnu.org/licenses). + * + * THE AAX SDK IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER + * EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE + * DISCLAIMED. + * + */ +/*================================================================================================*/ + +#include "AAX_VViewContainer.h" +#include "AAX_UIDs.h" +#include "AAX_Assert.h" + +// ****************************************************************************************** +// METHOD: AAX_VViewContainer +// ****************************************************************************************** +AAX_VViewContainer::AAX_VViewContainer( IACFUnknown* pUnknown ) +{ + if ( pUnknown ) + { + pUnknown->QueryInterface ( IID_IAAXViewContainerV1, (void **) &mIViewContainer ); + pUnknown->QueryInterface ( IID_IAAXViewContainerV2, (void **) &mIViewContainerV2 ); + pUnknown->QueryInterface ( IID_IAAXViewContainerV3, (void **) &mIViewContainerV3 ); + } +} + +// ****************************************************************************************** +// METHOD: ~AAX_VViewContainer +// ****************************************************************************************** +AAX_VViewContainer::~AAX_VViewContainer() +{ + // HACK - Some hosts contain multiple overlapping systems for destroying + // the underlying view object(s). Allowing the ACF refcount to go to zero + // in these hosts will result in a crash due to multiple deletion. This is + // tracked as PT-243211. + // + // If we are ever confident that the host-side fix has propagated to all + // hosts in use then we can remove this "leak" and allow the ACF count to + // decrement correctly. + try { + if (mIViewContainer) { mIViewContainer.detach(); } + } + catch (ACFRESULT r) { + AAX_TRACE_RELEASE(kAAX_Trace_Priority_High, "AAX_VViewContainer error when detaching mIViewContainer: %d", (int)r); + } + try { + if (mIViewContainerV2) { mIViewContainerV2.detach(); } + } + catch (ACFRESULT r) { + AAX_TRACE_RELEASE(kAAX_Trace_Priority_High, "AAX_VViewContainer error when detaching mIViewContainerV2: %d", (int)r); + } + try { + if (mIViewContainerV3) { mIViewContainerV3.detach(); } + } + catch (ACFRESULT r) { + AAX_TRACE_RELEASE(kAAX_Trace_Priority_High, "AAX_VViewContainer error when detaching mIViewContainerV3: %d", (int)r); + } +} + +// ****************************************************************************************** +// METHOD: GetType +// ****************************************************************************************** +int32_t AAX_VViewContainer::GetType () +{ + int32_t result = AAX_eViewContainer_Type_NULL; + + if ( mIViewContainer ) + result = mIViewContainer->GetType (); + + return result; +} + +// ****************************************************************************************** +// METHOD: GetPtr +// ****************************************************************************************** +void * AAX_VViewContainer::GetPtr () +{ + void * result = 0; + + if ( mIViewContainer ) + result = mIViewContainer->GetPtr (); + + return result; +} + +// ****************************************************************************************** +// METHOD: GetModifiers +// ****************************************************************************************** +AAX_Result AAX_VViewContainer::GetModifiers ( uint32_t * outModifiers ) +{ + AAX_Result result = AAX_ERROR_UNIMPLEMENTED; + + if ( mIViewContainer ) + result = mIViewContainer->GetModifiers ( outModifiers ); + + return result; +} + +// ****************************************************************************************** +// METHOD: HandleParameterMouseDown +// ****************************************************************************************** +AAX_Result AAX_VViewContainer::HandleParameterMouseDown ( AAX_CParamID inParamID, uint32_t inModifiers ) +{ + AAX_Result result = AAX_ERROR_UNIMPLEMENTED; + + if ( mIViewContainer ) + result = mIViewContainer->HandleParameterMouseDown ( inParamID, inModifiers ); + + return result; +} + +// ****************************************************************************************** +// METHOD: HandleParameterMouseDrag +// ****************************************************************************************** +AAX_Result AAX_VViewContainer::HandleParameterMouseDrag ( AAX_CParamID inParamID, uint32_t inModifiers ) +{ + AAX_Result result = AAX_ERROR_UNIMPLEMENTED; + + if ( mIViewContainer ) + result = mIViewContainer->HandleParameterMouseDrag ( inParamID, inModifiers ); + + return result; +} + +// ****************************************************************************************** +// METHOD: HandleParameterMouseUp +// ****************************************************************************************** +AAX_Result AAX_VViewContainer::HandleParameterMouseUp ( AAX_CParamID inParamID, uint32_t inModifiers ) +{ + AAX_Result result = AAX_ERROR_UNIMPLEMENTED; + + if ( mIViewContainer ) + result = mIViewContainer->HandleParameterMouseUp ( inParamID, inModifiers ); + + return result; +} + + +// ****************************************************************************************** +// METHOD: HandleParameterMouseEnter +// ****************************************************************************************** +AAX_Result AAX_VViewContainer::HandleParameterMouseEnter(AAX_CParamID inParamID, uint32_t inModifiers) +{ + AAX_Result result = AAX_ERROR_UNIMPLEMENTED; + + if (mIViewContainerV3) + result = mIViewContainerV3->HandleParameterMouseEnter(inParamID, inModifiers); + + return result; +} + + +// ****************************************************************************************** +// METHOD: HandleParameterMouseExit +// ****************************************************************************************** +AAX_Result AAX_VViewContainer::HandleParameterMouseExit(AAX_CParamID inParamID, uint32_t inModifiers) +{ + AAX_Result result = AAX_ERROR_UNIMPLEMENTED; + + if (mIViewContainerV3) + result = mIViewContainerV3->HandleParameterMouseExit(inParamID, inModifiers); + + return result; +} + + +// ****************************************************************************************** +// METHOD: SetViewSize +// ****************************************************************************************** +AAX_Result AAX_VViewContainer::SetViewSize ( AAX_Point & inSize ) +{ + AAX_Result result = AAX_SUCCESS; + + if ( mIViewContainer ) + result = mIViewContainer->SetViewSize ( inSize ); + + return result; +} + +// ****************************************************************************************** +// METHOD: HandleMultipleParametersMouseDown +// ****************************************************************************************** +AAX_Result AAX_VViewContainer::HandleMultipleParametersMouseDown ( const AAX_CParamID* inParamIDs, uint32_t iNumOfParams, uint32_t inModifiers ) +{ + AAX_Result result = AAX_ERROR_UNIMPLEMENTED; + + if ( mIViewContainerV2 ) + result = mIViewContainerV2->HandleMultipleParametersMouseDown ( inParamIDs, iNumOfParams, inModifiers ); + + return result; +} + +// ****************************************************************************************** +// METHOD: HandleMultipleParametersMouseDrag +// ****************************************************************************************** +AAX_Result AAX_VViewContainer::HandleMultipleParametersMouseDrag ( const AAX_CParamID* inParamIDs, uint32_t iNumOfParams, uint32_t inModifiers ) +{ + AAX_Result result = AAX_ERROR_UNIMPLEMENTED; + + if ( mIViewContainerV2 ) + result = mIViewContainerV2->HandleMultipleParametersMouseDrag ( inParamIDs, iNumOfParams, inModifiers ); + + return result; +} + +// ****************************************************************************************** +// METHOD: HandleMultipleParametersMouseUp +// ****************************************************************************************** +AAX_Result AAX_VViewContainer::HandleMultipleParametersMouseUp ( const AAX_CParamID* inParamIDs, uint32_t iNumOfParams, uint32_t inModifiers ) +{ + AAX_Result result = AAX_ERROR_UNIMPLEMENTED; + + if ( mIViewContainerV2 ) + result = mIViewContainerV2->HandleMultipleParametersMouseUp ( inParamIDs, iNumOfParams, inModifiers ); + + return result; +} diff --git a/modules/juce_audio_plugin_client/AAX/SDK/Utilities/CreatePackage.bat b/modules/juce_audio_plugin_client/AAX/SDK/Utilities/CreatePackage.bat new file mode 100755 index 0000000000..74b46c3352 --- /dev/null +++ b/modules/juce_audio_plugin_client/AAX/SDK/Utilities/CreatePackage.bat @@ -0,0 +1,57 @@ +REM Copyright 2017, 2019-2021, 2023-2024 Avid Technology, Inc. +REM All rights reserved. +REM +REM This file is part of the Avid AAX SDK. +REM +REM The AAX SDK is subject to commercial or open-source licensing. +REM +REM By using the AAX SDK, you agree to the terms of both the Avid AAX SDK License +REM Agreement and Avid Privacy Policy. +REM +REM AAX SDK License: https://developer.avid.com/aax +REM Privacy Policy: https://www.avid.com/legal/privacy-policy-statement +REM +REM Or: You may also use this code under the terms of the GPL v3 (see +REM www.gnu.org/licenses). +REM +REM THE AAX SDK IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER +REM EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE +REM DISCLAIMED. + +set OutDir="%~fn1" +set IconSource="%~fn2" + +echo Create Package Directories + +IF EXIST %OutDir% GOTO OUTDIR_EXISTS +mkdir %OutDir% +:OUTDIR_EXISTS + +IF EXIST %OutDir%\..\Win32 GOTO Win32_EXISTS +mkdir %OutDir%\..\Win32 +:Win32_EXISTS + +IF EXIST %OutDir%\..\x64 GOTO X64_EXISTS +mkdir %OutDir%\..\x64 +:X64_EXISTS + +IF EXIST %OutDir%\..\Resources GOTO RESOURCES_EXISTS +mkdir %OutDir%\..\Resources +:RESOURCES_EXISTS + +echo Set Folder Icon + +IF EXIST %OutDir%\..\..\PlugIn.ico GOTO ICON_EXISTS +copy /Y %IconSource% %OutDir%\..\..\PlugIn.ico > NUL +:ICON_EXISTS + +attrib -r %OutDir%\..\.. +attrib -h -r -s %OutDir%\..\..\desktop.ini +echo [.ShellClassInfo] > %OutDir%\..\..\desktop.ini +echo IconResource=PlugIn.ico,0 >> %OutDir%\..\..\desktop.ini +echo ;For compatibility with Windows XP >> %OutDir%\..\..\desktop.ini +echo IconFile=PlugIn.ico >> %OutDir%\..\..\desktop.ini +echo IconIndex=0 >> %OutDir%\..\..\desktop.ini +attrib +h +r +s %OutDir%\..\..\PlugIn.ico +attrib +h +r +s %OutDir%\..\..\desktop.ini +attrib %OutDir%\..\.. diff --git a/modules/juce_audio_plugin_client/AAX/SDK/Utilities/PlugIn.ico b/modules/juce_audio_plugin_client/AAX/SDK/Utilities/PlugIn.ico new file mode 100644 index 0000000000..f2d3816d89 Binary files /dev/null and b/modules/juce_audio_plugin_client/AAX/SDK/Utilities/PlugIn.ico differ