mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
AAX: Bundle files from the AAX SDK
This commit is contained in:
parent
345356b99d
commit
6bd300fe78
189 changed files with 39261 additions and 0 deletions
695
modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX.h
Normal file
695
modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX.h
Normal file
|
|
@ -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 <stdint.h>
|
||||
#include <stddef.h>
|
||||
|
||||
#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 <tt>AAX_CPP11_SUPPORT 0</tt>
|
||||
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<X>
|
||||
#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<X>
|
||||
#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: <TT>\#pragma ms_struct can not be used with dynamic classes or structures</TT>
|
||||
\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:<BR>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<AAX_CBoolean>(
|
||||
(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.
|
||||
* <BR>
|
||||
* <BR>
|
||||
* 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.
|
||||
* <BR>
|
||||
* <BR>
|
||||
* 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 <BR>
|
||||
* - 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 <BR>
|
||||
* - 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
|
||||
|
||||
|
||||
//<DMT> For historical compatibility with PT10, we have to make the MIDI structures DEFAULT aligned instead of ALG aligned. With PT11 and 64 bit, these will now be ALG aligned.
|
||||
#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 <tt>mTimestamp == 0</tt> 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
|
||||
298
modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_Assert.h
Normal file
298
modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_Assert.h
Normal file
|
|
@ -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 <TT>DTF_AAXPLUGINS</TT> 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.
|
||||
|
||||
<B>Notes </B>
|
||||
- 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
|
||||
|
||||
<B>Usage </B>
|
||||
Each invocation of this macro takes a trace priority and a <TT>printf</TT>-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.
|
||||
|
||||
<B>Notes </B>
|
||||
- This macro is compatible with bost host and embedded (AAX DSP) environments
|
||||
- Subject to a total line limit of 256 chars
|
||||
|
||||
<B>Usage </B>
|
||||
Each invocation of this macro takes a trace priority and a <TT>printf</TT>-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:
|
||||
|
||||
<DIV CLASS="TextInd1"><TT>[Manufacturer name] [Plug-in name] [Plug-in version][logging text (indented)] </TT></DIV>
|
||||
|
||||
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
|
||||
<B>Notes </B>
|
||||
- This macro will be compiled out of release builds.
|
||||
- This macro is compatible with bost host and embedded (AAX DSP) environments.
|
||||
|
||||
<B>Usage </B>
|
||||
Each invocation of this macro takes a single argument, which is interpreted as a <TT>bool</TT>.
|
||||
|
||||
\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
|
||||
294
modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_Atomic.h
Normal file
294
modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_Atomic.h
Normal file
|
|
@ -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 <stdint.h>
|
||||
|
||||
#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<typename TPointer> 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<typename TPointer> 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<typename TPointer> 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<typename TPointer>
|
||||
inline TPointer*
|
||||
AAX_Atomic_Load_Pointer(TPointer const * const volatile * inValue)
|
||||
{
|
||||
TPointer* value;
|
||||
__atomic_load(const_cast<TPointer * volatile *>(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 <intrin.h>
|
||||
#endif
|
||||
|
||||
#pragma intrinsic( _InterlockedIncrement, \
|
||||
_InterlockedDecrement, \
|
||||
_InterlockedExchange, \
|
||||
_InterlockedCompareExchange, \
|
||||
_InterlockedCompareExchange64)
|
||||
|
||||
inline uint32_t AAX_CALLBACK
|
||||
AAX_Atomic_IncThenGet_32(register uint32_t& ioData)
|
||||
{
|
||||
return static_cast<uint32_t>(_InterlockedIncrement((volatile long*)&ioData));
|
||||
}
|
||||
|
||||
inline uint32_t AAX_CALLBACK
|
||||
AAX_Atomic_DecThenGet_32(register uint32_t& ioData)
|
||||
{
|
||||
return static_cast<uint32_t>(_InterlockedDecrement((volatile long*)&ioData));
|
||||
}
|
||||
|
||||
inline uint32_t
|
||||
AAX_Atomic_Exchange_32(
|
||||
volatile uint32_t& ioDestination,
|
||||
uint32_t inExchangeValue)
|
||||
{
|
||||
return static_cast<uint32_t>(_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<uint64_t>(_InterlockedExchange64((volatile __int64*)&ioValue, (__int64)inExchangeValue));
|
||||
}
|
||||
|
||||
template<typename TPointer>
|
||||
inline TPointer*
|
||||
AAX_Atomic_Load_Pointer(TPointer const * const volatile * inValue)
|
||||
{
|
||||
// Itanium supports acquire semantics
|
||||
#if (_M_IA64)
|
||||
return reinterpret_cast<TPointer*>(_InterlockedOr64_acq(const_cast<__int64 volatile *>(reinterpret_cast<const __int64 volatile *>(inValue)), 0x0000000000000000));
|
||||
#else
|
||||
return reinterpret_cast<TPointer*>(_InterlockedOr64(const_cast<__int64 volatile *>(reinterpret_cast<const __int64 volatile *>(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<typename TPointer>
|
||||
inline TPointer*
|
||||
AAX_Atomic_Load_Pointer(TPointer const * const volatile * inValue)
|
||||
{
|
||||
return reinterpret_cast<TPointer*>(_InterlockedOr(const_cast<long volatile *>(reinterpret_cast<const long volatile *>(inValue)), 0x00000000));
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
inline bool
|
||||
AAX_Atomic_CompareAndExchange_32(
|
||||
uint32_t volatile & ioValue,
|
||||
uint32_t inCompareValue,
|
||||
uint32_t inExchangeValue)
|
||||
{
|
||||
return static_cast<uint32_t>(_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<uint64_t>(_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_
|
||||
|
|
@ -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 <string>
|
||||
#include <limits>
|
||||
#include <type_traits>
|
||||
|
||||
|
||||
/**
|
||||
* \brief A convenience class for array data buffers
|
||||
*
|
||||
* The data payload is an array of \c D
|
||||
*/
|
||||
template <AAX_CTypeID T, class D>
|
||||
class AAX_CArrayDataBufferOfType : public AAX_IDataBuffer
|
||||
{
|
||||
public:
|
||||
explicit AAX_CArrayDataBufferOfType (std::vector<D> const & inData) : mData{inData} {}
|
||||
explicit AAX_CArrayDataBufferOfType (std::vector<D> && 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<decltype(size)>::max() >= std::numeric_limits<std::remove_pointer<decltype(oSize)>::type>::max(),
|
||||
"size variable may not represent all positive values of oSize");
|
||||
if (size > std::numeric_limits<std::remove_pointer<decltype(oSize)>::type>::max()) {
|
||||
return AAX_ERROR_SIGNED_INT_OVERFLOW;
|
||||
}
|
||||
*oSize = static_cast<std::remove_pointer<decltype(oSize)>::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<D> const mData;
|
||||
};
|
||||
|
||||
/**
|
||||
* \copydoc AAX_CArrayDataBufferOfType
|
||||
*/
|
||||
template <class D>
|
||||
class AAX_CArrayDataBuffer : public AAX_IDataBuffer
|
||||
{
|
||||
public:
|
||||
AAX_CArrayDataBuffer (AAX_CTypeID inType, std::vector<D> const & inData) : mType{inType}, mData{inData} {}
|
||||
AAX_CArrayDataBuffer (AAX_CTypeID inType, std::vector<D> && 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<decltype(size)>::max() >= std::numeric_limits<std::remove_pointer<decltype(oSize)>::type>::max(),
|
||||
"size variable may not represent all positive values of oSize");
|
||||
if (size > std::numeric_limits<std::remove_pointer<decltype(oSize)>::type>::max()) {
|
||||
return AAX_ERROR_SIGNED_INT_OVERFLOW;
|
||||
}
|
||||
*oSize = static_cast<std::remove_pointer<decltype(oSize)>::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<D> const mData;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
@ -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 <cstring>
|
||||
|
||||
|
||||
/** 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 <typename T, size_t S>
|
||||
class AAX_CAtomicQueue : public AAX_IPointerQueue<T>
|
||||
{
|
||||
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<T>::template_type template_type; ///< @copydoc AAX_IPointerQueue::template_type
|
||||
typedef typename AAX_IPointerQueue<T>::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 <typename T, size_t S>
|
||||
inline AAX_CAtomicQueue<T, S>::AAX_CAtomicQueue()
|
||||
: AAX_IPointerQueue<T>()
|
||||
, mMutex()
|
||||
, mReadIdx(0)
|
||||
, mWriteIdx(0)
|
||||
{
|
||||
Clear();
|
||||
}
|
||||
|
||||
template <typename T, size_t S>
|
||||
inline void AAX_CAtomicQueue<T, S>::Clear()
|
||||
{
|
||||
std::memset((void*)mRingBuffer, 0x0, sizeof(mRingBuffer));
|
||||
}
|
||||
|
||||
template <typename T, size_t S>
|
||||
inline AAX_IContainer::EStatus AAX_CAtomicQueue<T, S>::Push(typename AAX_CAtomicQueue<T, S>::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 <typename T, size_t S>
|
||||
inline typename AAX_CAtomicQueue<T, S>::value_type AAX_CAtomicQueue<T, S>::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 <typename T, size_t S>
|
||||
inline typename AAX_CAtomicQueue<T, S>::value_type AAX_CAtomicQueue<T, S>::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 <typename T, size_t S>
|
||||
inline typename AAX_CAtomicQueue<T, S>::value_type AAX_CAtomicQueue<T, S>::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
|
||||
|
|
@ -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_
|
||||
|
|
@ -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 <vector>
|
||||
#ifdef WINDOWS_VERSION
|
||||
#include <algorithm>
|
||||
#endif
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
|
||||
/** \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 <typename T>
|
||||
class AAX_CBinaryDisplayDelegate : public AAX_IDisplayDelegate<T>
|
||||
{
|
||||
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<T>* 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<struct StringTable> mShortenedStrings;
|
||||
};
|
||||
|
||||
|
||||
template <typename T>
|
||||
AAX_CBinaryDisplayDelegate<T>::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 <typename T>
|
||||
AAX_CBinaryDisplayDelegate<T>::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 <typename T>
|
||||
void AAX_CBinaryDisplayDelegate<T>::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 <typename T>
|
||||
AAX_IDisplayDelegate<T>* AAX_CBinaryDisplayDelegate<T>::Clone() const
|
||||
{
|
||||
return new AAX_CBinaryDisplayDelegate(*this);
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
bool AAX_CBinaryDisplayDelegate<T>::ValueToString(T value, AAX_CString* valueString) const
|
||||
{
|
||||
if (value)
|
||||
*valueString = mTrueString;
|
||||
else
|
||||
*valueString = mFalseString;
|
||||
return true;
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
bool AAX_CBinaryDisplayDelegate<T>::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<uint32_t>(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<int>(mShortenedStrings.size())-1; i >= 0; i-- )
|
||||
{
|
||||
struct StringTable shortStrings = mShortenedStrings.at(static_cast<unsigned int>(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 <typename T>
|
||||
bool AAX_CBinaryDisplayDelegate<T>::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
|
||||
|
|
@ -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 <typename T>
|
||||
class AAX_CBinaryTaperDelegate : public AAX_ITaperDelegate<T>
|
||||
{
|
||||
public:
|
||||
|
||||
/** \brief Constructs a Binary Taper
|
||||
*
|
||||
*/
|
||||
AAX_CBinaryTaperDelegate( );
|
||||
|
||||
//Virtual Overrides
|
||||
AAX_ITaperDelegate<T>* 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 <typename T>
|
||||
AAX_CBinaryTaperDelegate<T>::AAX_CBinaryTaperDelegate( ) :
|
||||
AAX_ITaperDelegate<T>()
|
||||
{
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
AAX_ITaperDelegate<T>* AAX_CBinaryTaperDelegate<T>::Clone() const
|
||||
{
|
||||
return new AAX_CBinaryTaperDelegate(*this);
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
T AAX_CBinaryTaperDelegate<T>::GetMinimumValue() const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
T AAX_CBinaryTaperDelegate<T>::GetMaximumValue() const
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
T AAX_CBinaryTaperDelegate<T>::ConstrainRealValue(T value) const
|
||||
{
|
||||
return value;
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
T AAX_CBinaryTaperDelegate<T>::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 <typename T>
|
||||
double AAX_CBinaryTaperDelegate<T>::RealToNormalized(T realValue) const
|
||||
{
|
||||
if (realValue > (T)(0))
|
||||
return 1.0f;
|
||||
return 0.0f;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
#endif //AAX_CBINARYTAPERDELEGATE_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 <vector>
|
||||
|
||||
//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<DataValue> mDataValues;
|
||||
};
|
||||
|
||||
#endif //AAX_CHUNKDATAPARSER_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 <cmath>
|
||||
|
||||
|
||||
|
||||
/** \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 <typename T>
|
||||
class AAX_CDecibelDisplayDelegateDecorator : public AAX_IDisplayDelegateDecorator<T>
|
||||
{
|
||||
public:
|
||||
AAX_CDecibelDisplayDelegateDecorator(const AAX_IDisplayDelegate<T>& displayDelegate);
|
||||
|
||||
//Virtual Overrides
|
||||
AAX_CDecibelDisplayDelegateDecorator<T>* 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 <typename T>
|
||||
AAX_CDecibelDisplayDelegateDecorator<T>::AAX_CDecibelDisplayDelegateDecorator(const AAX_IDisplayDelegate<T>& displayDelegate) :
|
||||
AAX_IDisplayDelegateDecorator<T>(displayDelegate)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
AAX_CDecibelDisplayDelegateDecorator<T>* AAX_CDecibelDisplayDelegateDecorator<T>::Clone() const
|
||||
{
|
||||
return new AAX_CDecibelDisplayDelegateDecorator(*this);
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
bool AAX_CDecibelDisplayDelegateDecorator<T>::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<T>::ValueToString(value, valueString);
|
||||
}
|
||||
|
||||
*valueString += AAX_CString("dB");
|
||||
return succeeded;
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
bool AAX_CDecibelDisplayDelegateDecorator<T>::ValueToString(T value, int32_t maxNumChars, AAX_CString* valueString) const
|
||||
{
|
||||
if (value <= 0)
|
||||
{
|
||||
*valueString = AAX_CString("-INF");
|
||||
if (maxNumChars >= 7)
|
||||
valueString->Append(" dB"); //<DMT> 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<T>::ValueToString(value, maxNumChars, valueString);
|
||||
|
||||
|
||||
//<DMT> 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<uint32_t>(maxNumChars) : 0;
|
||||
if (maxNumCharsUnsigned >= (strlen + 2)) //length of string plus 2 for the "dB"
|
||||
*valueString += AAX_CString("dB");
|
||||
return succeeded;
|
||||
}
|
||||
|
||||
|
||||
template <typename T>
|
||||
bool AAX_CDecibelDisplayDelegateDecorator<T>::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<T>::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<T>::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<T>::StringToValue(valueSubString, value);
|
||||
*value = (T)pow((T)10.0, *value / (T)20.0);
|
||||
return success;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
#endif //AAX_CDECIBELDISPLAYDELEGATEDECORATOR_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
|
||||
|
|
@ -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 <string>
|
||||
#include <vector>
|
||||
#include <map>
|
||||
#include <memory>
|
||||
|
||||
|
||||
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
|
||||
|
|
@ -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 <set>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
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<std::string> 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
|
||||
|
|
@ -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
|
||||
|
|
@ -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
|
||||
|
|
@ -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 <cmath> //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 <typename T, int32_t RealPrecision=0>
|
||||
class AAX_CLinearTaperDelegate : public AAX_ITaperDelegate<T>
|
||||
{
|
||||
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<T, RealPrecision>* 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 <typename T, int32_t RealPrecision>
|
||||
T AAX_CLinearTaperDelegate<T, RealPrecision>::Round(double iValue) const
|
||||
{
|
||||
double precision = RealPrecision;
|
||||
if (precision > 0)
|
||||
return static_cast<T>(floor(iValue * precision + 0.5) / precision);
|
||||
return static_cast<T>(iValue);
|
||||
}
|
||||
|
||||
template <typename T, int32_t RealPrecision>
|
||||
AAX_CLinearTaperDelegate<T, RealPrecision>::AAX_CLinearTaperDelegate(T minValue, T maxValue) : AAX_ITaperDelegate<T>(),
|
||||
mMinValue(minValue),
|
||||
mMaxValue(maxValue)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
template <typename T, int32_t RealPrecision>
|
||||
AAX_CLinearTaperDelegate<T, RealPrecision>* AAX_CLinearTaperDelegate<T, RealPrecision>::Clone() const
|
||||
{
|
||||
return new AAX_CLinearTaperDelegate(*this);
|
||||
}
|
||||
|
||||
template <typename T, int32_t RealPrecision>
|
||||
T AAX_CLinearTaperDelegate<T, RealPrecision>::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 <typename T, int32_t RealPrecision>
|
||||
T AAX_CLinearTaperDelegate<T, RealPrecision>::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<T>(doubleRealValue);
|
||||
|
||||
return ConstrainRealValue(realValue);
|
||||
}
|
||||
|
||||
template <typename T, int32_t RealPrecision>
|
||||
double AAX_CLinearTaperDelegate<T, RealPrecision>::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
|
||||
|
|
@ -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 <cmath> //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 <typename T, int32_t RealPrecision=1000>
|
||||
class AAX_CLogTaperDelegate : public AAX_ITaperDelegate<T>
|
||||
{
|
||||
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<T, RealPrecision>* 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 <typename T, int32_t RealPrecision>
|
||||
T AAX_CLogTaperDelegate<T, RealPrecision>::Round(double iValue) const
|
||||
{
|
||||
double precision = RealPrecision;
|
||||
if (precision > 0)
|
||||
return static_cast<T>(floor(iValue * precision + 0.5) / precision);
|
||||
return static_cast<T>(iValue);
|
||||
}
|
||||
|
||||
template <typename T, int32_t RealPrecision>
|
||||
AAX_CLogTaperDelegate<T, RealPrecision>::AAX_CLogTaperDelegate(T minValue, T maxValue) : AAX_ITaperDelegate<T>(),
|
||||
mMinValue(minValue),
|
||||
mMaxValue(maxValue)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
template <typename T, int32_t RealPrecision>
|
||||
AAX_CLogTaperDelegate<T, RealPrecision>* AAX_CLogTaperDelegate<T, RealPrecision>::Clone() const
|
||||
{
|
||||
return new AAX_CLogTaperDelegate(*this);
|
||||
}
|
||||
|
||||
template <typename T, int32_t RealPrecision>
|
||||
T AAX_CLogTaperDelegate<T, RealPrecision>::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 <typename T, int32_t RealPrecision>
|
||||
T AAX_CLogTaperDelegate<T, RealPrecision>::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 <typename T, int32_t RealPrecision>
|
||||
double AAX_CLogTaperDelegate<T, RealPrecision>::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
|
||||
|
|
@ -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
|
||||
|
||||
|
|
@ -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 <typename T, uint32_t Precision=2, uint32_t SpaceAfter=0>
|
||||
class AAX_CNumberDisplayDelegate : public AAX_IDisplayDelegate<T>
|
||||
{
|
||||
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 <typename T, uint32_t Precision, uint32_t SpaceAfter>
|
||||
AAX_CNumberDisplayDelegate<T,Precision,SpaceAfter>* AAX_CNumberDisplayDelegate<T,Precision,SpaceAfter>::Clone() const
|
||||
{
|
||||
return new AAX_CNumberDisplayDelegate(*this);
|
||||
}
|
||||
|
||||
template <typename T, uint32_t Precision, uint32_t SpaceAfter>
|
||||
bool AAX_CNumberDisplayDelegate<T,Precision,SpaceAfter>::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 <typename T, uint32_t Precision, uint32_t SpaceAfter>
|
||||
bool AAX_CNumberDisplayDelegate<T,Precision,SpaceAfter>::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<uint32_t>(maxNumChars) : 0;
|
||||
if (strlen > maxNumCharsUnsigned)
|
||||
{
|
||||
valueString->Erase(maxNumCharsUnsigned, strlen-maxNumCharsUnsigned);
|
||||
strlen = valueString->Length();
|
||||
}
|
||||
|
||||
if ( 0 < maxNumCharsUnsigned && strlen == maxNumCharsUnsigned && (*valueString)[maxNumCharsUnsigned-1] == '.') //<DMT> 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)) //<DMT> 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 <typename T, uint32_t Precision, uint32_t SpaceAfter>
|
||||
bool AAX_CNumberDisplayDelegate<T,Precision,SpaceAfter>::StringToValue(const AAX_CString& valueString, T* value) const
|
||||
{
|
||||
double dValue;
|
||||
if (valueString.ToDouble(&dValue))
|
||||
{
|
||||
*value = static_cast<T> (dValue);
|
||||
return true;
|
||||
}
|
||||
*value = 0;
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
#endif //AAX_CNUMBERDISPLAYDELEGATE_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 <string>
|
||||
#include <map>
|
||||
|
||||
|
||||
/** \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<typename DataType>
|
||||
DataType* GetPtr()
|
||||
{
|
||||
mDataSize = sizeof(DataType);
|
||||
void * data = mPacketData.Get(mDataSize);
|
||||
return reinterpret_cast<DataType*> (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<const void>()
|
||||
{
|
||||
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 TWorker>
|
||||
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<AAX_CFieldIndex, AAX_CPacket*> PacketsHolder;
|
||||
typedef std::multimap<std::string, std::pair<AAX_CPacket*, AAX_IPacketHandler*> > 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 <class TWorker, typename Func>
|
||||
AAX_Result RegisterPacket( AAX_CParamID paramID, AAX_CFieldIndex portID,
|
||||
TWorker* iPt2Object, Func infPt)
|
||||
{
|
||||
AAX_CPacketHandler<TWorker> handler(iPt2Object, infPt);
|
||||
return RegisterPacket(paramID, portID, &handler);
|
||||
}
|
||||
|
||||
AAX_Result RegisterPacket( AAX_CParamID paramID, AAX_CFieldIndex portID)
|
||||
{
|
||||
AAX_CPacketHandler<AAX_CPacketDispatcher> 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
|
||||
1309
modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_CParameter.h
Normal file
1309
modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_CParameter.h
Normal file
File diff suppressed because it is too large
Load diff
|
|
@ -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 <vector>
|
||||
#include <map>
|
||||
|
||||
|
||||
|
||||
|
||||
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<AAX_IParameter*> mParameters;
|
||||
std::map<std::string, AAX_IParameter*> mParametersMap;
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // AAX_CPARAMETERMANAGER_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 <cmath>
|
||||
|
||||
|
||||
/** \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 <typename T>
|
||||
class AAX_CPercentDisplayDelegateDecorator : public AAX_IDisplayDelegateDecorator<T>
|
||||
{
|
||||
public:
|
||||
AAX_CPercentDisplayDelegateDecorator(const AAX_IDisplayDelegate<T>& displayDelegate);
|
||||
|
||||
//Virtual Overrides
|
||||
AAX_CPercentDisplayDelegateDecorator<T>* 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 <typename T>
|
||||
AAX_CPercentDisplayDelegateDecorator<T>::AAX_CPercentDisplayDelegateDecorator(const AAX_IDisplayDelegate<T>& displayDelegate) :
|
||||
AAX_IDisplayDelegateDecorator<T>(displayDelegate)
|
||||
{
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
AAX_CPercentDisplayDelegateDecorator<T>* AAX_CPercentDisplayDelegateDecorator<T>::Clone() const
|
||||
{
|
||||
return new AAX_CPercentDisplayDelegateDecorator(*this);
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
bool AAX_CPercentDisplayDelegateDecorator<T>::ValueToString(T value, AAX_CString* valueString) const
|
||||
{
|
||||
value *= 100;
|
||||
bool succeeded = AAX_IDisplayDelegateDecorator<T>::ValueToString(value, valueString);
|
||||
*valueString += AAX_CString("%");
|
||||
return succeeded;
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
bool AAX_CPercentDisplayDelegateDecorator<T>::ValueToString(T value, int32_t maxNumChars, AAX_CString* valueString) const
|
||||
{
|
||||
value *= 100;
|
||||
bool succeeded = AAX_IDisplayDelegateDecorator<T>::ValueToString(value, maxNumChars-1, valueString); //<DMT> Make room for percentage symbol.
|
||||
*valueString += AAX_CString("%");
|
||||
return succeeded;
|
||||
}
|
||||
|
||||
|
||||
template <typename T>
|
||||
bool AAX_CPercentDisplayDelegateDecorator<T>::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<T>::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<T>::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<T>::StringToValue(valueSubString, value);
|
||||
*value /= 100.0f;
|
||||
return success;
|
||||
}
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
|
@ -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 <cmath> //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 <typename T, int32_t RealPrecision=100>
|
||||
class AAX_CPieceWiseLinearTaperDelegate : public AAX_ITaperDelegate<T>
|
||||
{
|
||||
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<T, RealPrecision>* 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 <typename T, int32_t RealPrecision>
|
||||
T AAX_CPieceWiseLinearTaperDelegate<T, RealPrecision>::Round(double iValue) const
|
||||
{
|
||||
if (RealPrecision > 0)
|
||||
return static_cast<T>(floor(iValue * RealPrecision + 0.5) / RealPrecision);
|
||||
else
|
||||
return static_cast<T>(iValue);
|
||||
}
|
||||
|
||||
template <typename T, int32_t RealPrecision>
|
||||
AAX_CPieceWiseLinearTaperDelegate<T, RealPrecision>::AAX_CPieceWiseLinearTaperDelegate(const double* normalizedValues, const T* realValues, int32_t numValues) : AAX_ITaperDelegate<T>(),
|
||||
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 <typename T, int32_t RealPrecision>
|
||||
AAX_CPieceWiseLinearTaperDelegate<T, RealPrecision>::AAX_CPieceWiseLinearTaperDelegate(const AAX_CPieceWiseLinearTaperDelegate& other) : AAX_ITaperDelegate<T>(),
|
||||
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 <typename T, int32_t RealPrecision>
|
||||
AAX_CPieceWiseLinearTaperDelegate<T, RealPrecision>::~AAX_CPieceWiseLinearTaperDelegate()
|
||||
{
|
||||
mNumValues = 0;
|
||||
delete [] mNormalizedValues;
|
||||
delete [] mRealValues;
|
||||
}
|
||||
|
||||
|
||||
template <typename T, int32_t RealPrecision>
|
||||
AAX_CPieceWiseLinearTaperDelegate<T, RealPrecision>* AAX_CPieceWiseLinearTaperDelegate<T, RealPrecision>::Clone() const
|
||||
{
|
||||
return new AAX_CPieceWiseLinearTaperDelegate(*this);
|
||||
}
|
||||
|
||||
template <typename T, int32_t RealPrecision>
|
||||
T AAX_CPieceWiseLinearTaperDelegate<T, RealPrecision>::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 <typename T, int32_t RealPrecision>
|
||||
T AAX_CPieceWiseLinearTaperDelegate<T, RealPrecision>::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<mNumValues;i++)
|
||||
{
|
||||
mUpperIndex++;
|
||||
if (mNormalizedValues[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<T>(interpolatedValue));
|
||||
}
|
||||
|
||||
template <typename T, int32_t RealPrecision>
|
||||
double AAX_CPieceWiseLinearTaperDelegate<T, RealPrecision>::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<mNumValues;i++)
|
||||
{
|
||||
mUpperIndex++;
|
||||
if (mRealValues[i] >= realValue)
|
||||
break;
|
||||
mLowerIndex++;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
//Decreasing real values (negative slope)
|
||||
for (int32_t i=1;i<mNumValues;i++)
|
||||
{
|
||||
mUpperIndex++;
|
||||
if (mRealValues[i] <= realValue)
|
||||
break;
|
||||
mLowerIndex++;
|
||||
}
|
||||
}
|
||||
|
||||
// Do the interpolation.
|
||||
double delta = realValue - mRealValues[mLowerIndex];
|
||||
double slope = (mRealValues[mUpperIndex] == mRealValues[mLowerIndex]) ? 0.5 : double(mNormalizedValues[mUpperIndex] - mNormalizedValues[mLowerIndex]) / (mRealValues[mUpperIndex] - mRealValues[mLowerIndex]);
|
||||
double interpolatedValue = mNormalizedValues[mLowerIndex] + (delta * slope);
|
||||
return static_cast<T>(interpolatedValue);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
#endif //AAX_CPIECEWISELINEARTAPERDELEGATE_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 <cmath> //for floor()
|
||||
#include <vector>
|
||||
|
||||
|
||||
/** \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<float> 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 <typename T, int32_t RealPrecision=1000>
|
||||
class AAX_CRangeTaperDelegate : public AAX_ITaperDelegate<T>
|
||||
{
|
||||
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<T, RealPrecision>* 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<T> mRanges;
|
||||
std::vector<double> mRangesSteps; ///< \todo Document
|
||||
std::vector<double> mRangesPercents; ///< \todo Document
|
||||
std::vector<double> mRangesStepsCount; ///< \todo Document
|
||||
bool mUseSmartRounding;
|
||||
};
|
||||
|
||||
template <typename T, int32_t RealPrecision>
|
||||
AAX_CRangeTaperDelegate<T, RealPrecision>::AAX_CRangeTaperDelegate(T* ranges, double* rangesSteps, unsigned long numRanges, bool useSmartRounding) :
|
||||
AAX_ITaperDelegate<T>(),
|
||||
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 <typename T, int32_t RealPrecision>
|
||||
AAX_CRangeTaperDelegate<T, RealPrecision>::AAX_CRangeTaperDelegate( const AAX_CRangeTaperDelegate<T, RealPrecision>& 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 <typename T, int32_t RealPrecision>
|
||||
AAX_CRangeTaperDelegate<T, RealPrecision>& AAX_CRangeTaperDelegate<T, RealPrecision>::operator=( AAX_CRangeTaperDelegate<T, RealPrecision>& 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 <typename T, int32_t RealPrecision>
|
||||
T AAX_CRangeTaperDelegate<T, RealPrecision>::Round(double iValue) const
|
||||
{
|
||||
return ((0 >= RealPrecision) ? static_cast<T>(iValue) :
|
||||
(0 <= iValue) ? static_cast<T>(floor( iValue*RealPrecision + 0.5f ) / RealPrecision) :
|
||||
static_cast<T>(ceil( iValue*RealPrecision - 0.5f ) / RealPrecision)
|
||||
);
|
||||
}
|
||||
|
||||
template <typename T, int32_t RealPrecision>
|
||||
AAX_CRangeTaperDelegate<T, RealPrecision>* AAX_CRangeTaperDelegate<T, RealPrecision>::Clone() const
|
||||
{
|
||||
return new AAX_CRangeTaperDelegate<T, RealPrecision>(*this);
|
||||
}
|
||||
|
||||
template <typename T, int32_t RealPrecision>
|
||||
T AAX_CRangeTaperDelegate<T, RealPrecision>::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 <typename T, int32_t RealPrecision>
|
||||
T AAX_CRangeTaperDelegate<T, RealPrecision>::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 <typename T, int32_t RealPrecision>
|
||||
double AAX_CRangeTaperDelegate<T, RealPrecision>::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<double>(mRanges.at(i + 1) - mRanges.at(i)) * mRangesPercents.at(i);
|
||||
|
||||
double normalizedValue = percentTotal;
|
||||
return normalizedValue;
|
||||
}
|
||||
|
||||
template <typename T, int32_t RealPrecision>
|
||||
T AAX_CRangeTaperDelegate<T, RealPrecision>::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<T>(static_cast<double>(longVal) * mRangesSteps.at(i));
|
||||
}
|
||||
|
||||
|
||||
#endif
|
||||
|
|
@ -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 <memory>
|
||||
|
||||
#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<AAX_ISessionDocument> GetSessionDocument (void);
|
||||
std::shared_ptr<const AAX_ISessionDocument> 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<AAX_VSessionDocument> mSessionDocument;
|
||||
};
|
||||
|
||||
#ifdef __clang__
|
||||
#pragma clang diagnostic pop
|
||||
#endif
|
||||
|
||||
#endif // AAX_CSessionDocumentClient
|
||||
|
|
@ -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 <vector>
|
||||
#if defined(WINDOWS_VERSION) || defined(LINUX_VERSION)
|
||||
#include <algorithm>
|
||||
#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 <typename T>
|
||||
class AAX_CStateDisplayDelegate : public AAX_IDisplayDelegate<T>
|
||||
{
|
||||
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<AAX_IString*>& iStateStrings, T iMinState = 0 );
|
||||
|
||||
AAX_CStateDisplayDelegate(const AAX_CStateDisplayDelegate& other);
|
||||
|
||||
//Virtual Overrides
|
||||
AAX_IDisplayDelegate<T>* 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<AAX_CString> mStateStrings;
|
||||
|
||||
struct StringTable
|
||||
{
|
||||
int mStrLength;
|
||||
std::vector<AAX_CString> mStateStrings;
|
||||
};
|
||||
static bool StringTableSortFunc(struct StringTable i, struct StringTable j)
|
||||
{
|
||||
return (i.mStrLength < j.mStrLength);
|
||||
}
|
||||
|
||||
std::vector<struct StringTable> mShortenedStrings;
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
AAX_CStateDisplayDelegate<T>::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 <typename T>
|
||||
AAX_CStateDisplayDelegate<T>::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 <typename T>
|
||||
AAX_CStateDisplayDelegate<T>::AAX_CStateDisplayDelegate( const std::vector<AAX_IString*>& iStateStrings, T iMinState /* = 0 */ )
|
||||
{
|
||||
mMinState = iMinState;
|
||||
for ( std::vector<AAX_IString*>::const_iterator iter = iStateStrings.begin(); iter != iStateStrings.end(); ++iter )
|
||||
{
|
||||
if (*iter)
|
||||
{
|
||||
mStateStrings.push_back( *(*iter) );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
AAX_CStateDisplayDelegate<T>::AAX_CStateDisplayDelegate( const AAX_CStateDisplayDelegate & iOther )
|
||||
{
|
||||
mMinState = iOther.mMinState;
|
||||
|
||||
std::vector<AAX_CString>::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 <typename T>
|
||||
void AAX_CStateDisplayDelegate<T>::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 <typename T>
|
||||
AAX_IDisplayDelegate<T>* AAX_CStateDisplayDelegate<T>::Clone() const
|
||||
{
|
||||
return new AAX_CStateDisplayDelegate(*this);
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
bool AAX_CStateDisplayDelegate<T>::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 <typename T>
|
||||
bool AAX_CStateDisplayDelegate<T>::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 <typename T>
|
||||
bool AAX_CStateDisplayDelegate<T>::StringToValue(const AAX_CString& valueString, T* value) const
|
||||
{
|
||||
std::vector<AAX_CString>::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 <typename T>
|
||||
bool AAX_CStateDisplayDelegate<T>::Compare( const AAX_CString& valueString, const AAX_CString& stateString ) const
|
||||
{
|
||||
return valueString==stateString;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif //AAX_CSTATEDISPLAYDELEGATE_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 <cmath> //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 <typename T>
|
||||
class AAX_CStateTaperDelegate : public AAX_ITaperDelegate<T>
|
||||
{
|
||||
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<T>* 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 <typename T>
|
||||
AAX_CStateTaperDelegate<T>::AAX_CStateTaperDelegate(T minValue, T maxValue) : AAX_ITaperDelegate<T>(),
|
||||
mMinValue(minValue),
|
||||
mMaxValue(maxValue)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
AAX_CStateTaperDelegate<T>* AAX_CStateTaperDelegate<T>::Clone() const
|
||||
{
|
||||
return new AAX_CStateTaperDelegate(*this);
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
T AAX_CStateTaperDelegate<T>::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 <typename T>
|
||||
T AAX_CStateTaperDelegate<T>::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<T>(doubleRealValue));
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
double AAX_CStateTaperDelegate<T>::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
|
||||
|
|
@ -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 <string>
|
||||
#include <map>
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////
|
||||
#if 0
|
||||
#pragma mark -
|
||||
#endif
|
||||
///////////////////////////////////////////////////////////////
|
||||
|
||||
/**
|
||||
* \brief A generic %AAX string class with similar functionality to <tt>std::string</tt>
|
||||
*/
|
||||
class AAX_CString : public AAX_IString
|
||||
{
|
||||
public:
|
||||
static const uint32_t kInvalidIndex = static_cast<uint32_t>(-1);
|
||||
static const uint32_t kMaxStringLength = static_cast<uint32_t>(-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<uint32_t, AAX_CString>::const_iterator iter = mAbbreviations.upper_bound(static_cast<uint32_t>(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<uint32_t, AAX_CString> mAbbreviations;
|
||||
};
|
||||
|
||||
#endif //AAX_CSTRING_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 <string>
|
||||
#include <limits>
|
||||
#include <type_traits>
|
||||
|
||||
|
||||
/**
|
||||
* \brief A convenience class for string data buffers
|
||||
*
|
||||
* The data payload is a \c char* C string
|
||||
*/
|
||||
template <AAX_CTypeID T>
|
||||
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<decltype(size)>::max() >= std::numeric_limits<std::remove_pointer<decltype(oSize)>::type>::max(),
|
||||
"size variable may not represent all positive values of oSize");
|
||||
if (size > std::numeric_limits<std::remove_pointer<decltype(oSize)>::type>::max()) {
|
||||
return AAX_ERROR_SIGNED_INT_OVERFLOW;
|
||||
}
|
||||
*oSize = static_cast<std::remove_pointer<decltype(oSize)>::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<decltype(size)>::max() >= std::numeric_limits<std::remove_pointer<decltype(oSize)>::type>::max(),
|
||||
"size variable may not represent all positive values of oSize");
|
||||
if (size > std::numeric_limits<std::remove_pointer<decltype(oSize)>::type>::max()) {
|
||||
return AAX_ERROR_SIGNED_INT_OVERFLOW;
|
||||
}
|
||||
*oSize = static_cast<std::remove_pointer<decltype(oSize)>::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
|
||||
|
|
@ -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 <sstream>
|
||||
#include <map>
|
||||
|
||||
|
||||
/** \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 <typename T>
|
||||
class AAX_CStringDisplayDelegate : public AAX_IDisplayDelegate<T>
|
||||
{
|
||||
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<T,AAX_CString>& stringMap);
|
||||
|
||||
//Virtual Overrides
|
||||
AAX_CStringDisplayDelegate<T>* 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<T, AAX_CString> mStringMap;
|
||||
std::map<AAX_CString, T> mInverseStringMap;
|
||||
};
|
||||
|
||||
|
||||
|
||||
template <typename T>
|
||||
AAX_CStringDisplayDelegate<T>::AAX_CStringDisplayDelegate(const std::map<T,AAX_CString>& stringMap) :
|
||||
AAX_IDisplayDelegate<T>(),
|
||||
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<T,AAX_CString>::iterator valueStringIterator = mStringMap.begin();
|
||||
while ( valueStringIterator != mStringMap.end() )
|
||||
{
|
||||
mInverseStringMap.insert(std::pair<AAX_CString, T>(valueStringIterator->second, valueStringIterator->first));
|
||||
valueStringIterator++;
|
||||
}
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
AAX_CStringDisplayDelegate<T>* AAX_CStringDisplayDelegate<T>::Clone() const
|
||||
{
|
||||
return new AAX_CStringDisplayDelegate(*this);
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
bool AAX_CStringDisplayDelegate<T>::ValueToString(T value, AAX_CString* valueString) const
|
||||
{
|
||||
typename std::map<T,AAX_CString>::const_iterator mapPairIterator = mStringMap.find(value);
|
||||
if( mapPairIterator != mStringMap.end() )
|
||||
{
|
||||
*valueString = mapPairIterator->second;
|
||||
return true;
|
||||
}
|
||||
*valueString = AAX_CString("String Not Found");
|
||||
return false;
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
bool AAX_CStringDisplayDelegate<T>::ValueToString(T value, int32_t /*maxNumChars*/, AAX_CString* valueString) const
|
||||
{
|
||||
// First, get the full length string.
|
||||
bool result = this->ValueToString(value, valueString);
|
||||
|
||||
//<DMT> TODO: Shorten the string based on the number of characters...
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
bool AAX_CStringDisplayDelegate<T>::StringToValue(const AAX_CString& valueString, T* value) const
|
||||
{
|
||||
typename std::map<AAX_CString, T>::const_iterator mapPairIterator = mInverseStringMap.find(valueString);
|
||||
if( mapPairIterator != mInverseStringMap.end() )
|
||||
{
|
||||
*value = mapPairIterator->second;
|
||||
return true;
|
||||
}
|
||||
*value = 0;
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
#endif //AAX_CSTRINGDISPLAYDELEGATE_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 <memory>
|
||||
|
||||
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<AAX_ITask> iTask);
|
||||
|
||||
/**
|
||||
* \brief Convenience method for adding versioned tasks
|
||||
*/
|
||||
virtual AAX_Result ReceiveTask(std::unique_ptr<AAX_ITask> 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
|
||||
|
|
@ -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 <typename T>
|
||||
class AAX_CUnitDisplayDelegateDecorator : public AAX_IDisplayDelegateDecorator<T>
|
||||
{
|
||||
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<T>& displayDelegate, const AAX_CString& unitString);
|
||||
|
||||
//Virtual Overrides
|
||||
AAX_CUnitDisplayDelegateDecorator<T>* 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 <typename T>
|
||||
AAX_CUnitDisplayDelegateDecorator<T>::AAX_CUnitDisplayDelegateDecorator(const AAX_IDisplayDelegate<T>& displayDelegate, const AAX_CString& unitString) :
|
||||
AAX_IDisplayDelegateDecorator<T>(displayDelegate),
|
||||
mUnitString(unitString)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
AAX_CUnitDisplayDelegateDecorator<T>* AAX_CUnitDisplayDelegateDecorator<T>::Clone() const
|
||||
{
|
||||
return new AAX_CUnitDisplayDelegateDecorator(*this);
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
bool AAX_CUnitDisplayDelegateDecorator<T>::ValueToString(T value, AAX_CString* valueString) const
|
||||
{
|
||||
bool succeeded = AAX_IDisplayDelegateDecorator<T>::ValueToString(value, valueString);
|
||||
*valueString += mUnitString;
|
||||
return succeeded;
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
bool AAX_CUnitDisplayDelegateDecorator<T>::ValueToString(T value, int32_t maxNumChars, AAX_CString* valueString) const
|
||||
{
|
||||
bool succeeded = AAX_IDisplayDelegateDecorator<T>::ValueToString(value, maxNumChars, valueString);
|
||||
uint32_t strlen = valueString->Length();
|
||||
const uint32_t maxNumCharsUnsigned = (0 <= maxNumChars) ? static_cast<uint32_t>(maxNumChars) : 0;
|
||||
if (maxNumCharsUnsigned > strlen && (maxNumCharsUnsigned-strlen >= mUnitString.Length()))
|
||||
*valueString += mUnitString;
|
||||
return succeeded;
|
||||
}
|
||||
|
||||
|
||||
template <typename T>
|
||||
bool AAX_CUnitDisplayDelegateDecorator<T>::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<T>::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<T>::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<T>::StringToValue(valueSubString, value);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif //AAX_CUNITDISPLAYDELEGATEDECORATOR_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 <typename T>
|
||||
class AAX_CUnitPrefixDisplayDelegateDecorator : public AAX_IDisplayDelegateDecorator<T>
|
||||
{
|
||||
public:
|
||||
AAX_CUnitPrefixDisplayDelegateDecorator(const AAX_IDisplayDelegate<T>& displayDelegate);
|
||||
|
||||
//Virtual overrides
|
||||
AAX_CUnitPrefixDisplayDelegateDecorator<T>* 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 <typename T>
|
||||
AAX_CUnitPrefixDisplayDelegateDecorator<T>::AAX_CUnitPrefixDisplayDelegateDecorator(const AAX_IDisplayDelegate<T>& displayDelegate) :
|
||||
AAX_IDisplayDelegateDecorator<T>(displayDelegate)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
template <typename T>
|
||||
AAX_CUnitPrefixDisplayDelegateDecorator<T>* AAX_CUnitPrefixDisplayDelegateDecorator<T>::Clone() const
|
||||
{
|
||||
return new AAX_CUnitPrefixDisplayDelegateDecorator(*this);
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
bool AAX_CUnitPrefixDisplayDelegateDecorator<T>::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<T>::ValueToString(value, valueString);
|
||||
*valueString += AAX_CString("M");
|
||||
return succeeded;
|
||||
}
|
||||
if (absValue >= ((T) 1000.0))
|
||||
{
|
||||
value = value / ((T) 1000.0);
|
||||
bool succeeded = AAX_IDisplayDelegateDecorator<T>::ValueToString(value, valueString);
|
||||
*valueString += AAX_CString("k");
|
||||
return succeeded;
|
||||
}
|
||||
if (absValue >= ((T) 1.0))
|
||||
{
|
||||
return AAX_IDisplayDelegateDecorator<T>::ValueToString(value, valueString);
|
||||
}
|
||||
if (absValue >= ((T) 0.001))
|
||||
{
|
||||
value = value / ((T) 0.001);
|
||||
bool succeeded = AAX_IDisplayDelegateDecorator<T>::ValueToString(value, valueString);
|
||||
*valueString += AAX_CString("m");
|
||||
return succeeded;
|
||||
}
|
||||
if (absValue >= ((T) 0.000001))
|
||||
{
|
||||
value = value / ((T) 0.000001);
|
||||
bool succeeded = AAX_IDisplayDelegateDecorator<T>::ValueToString(value, valueString);
|
||||
*valueString += AAX_CString("u");
|
||||
return succeeded;
|
||||
}
|
||||
return AAX_IDisplayDelegateDecorator<T>::ValueToString(value, valueString);
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
bool AAX_CUnitPrefixDisplayDelegateDecorator<T>::ValueToString(T value, int32_t maxNumChars, AAX_CString* valueString) const
|
||||
{
|
||||
//Find the proper unit prefix.
|
||||
//<DMT> 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<T>::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<T>::ValueToString(value, maxNumChars-1, valueString);
|
||||
*valueString += AAX_CString("k");
|
||||
return succeeded;
|
||||
}
|
||||
if (absValue >= ((T) 1.0))
|
||||
{
|
||||
return AAX_IDisplayDelegateDecorator<T>::ValueToString(value, maxNumChars, valueString);
|
||||
}
|
||||
if (absValue >= ((T) 0.001))
|
||||
{
|
||||
value = value / ((T) 0.001);
|
||||
bool succeeded = AAX_IDisplayDelegateDecorator<T>::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<T>::ValueToString(value, maxNumChars-1, valueString);
|
||||
*valueString += AAX_CString("u");
|
||||
return succeeded;
|
||||
}
|
||||
return AAX_IDisplayDelegateDecorator<T>::ValueToString(value, maxNumChars, valueString);
|
||||
}
|
||||
|
||||
|
||||
template <typename T>
|
||||
bool AAX_CUnitPrefixDisplayDelegateDecorator<T>::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<T>::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<T>::StringToValue(valueStringCopy, value);
|
||||
*value = valueScalar * (*value);
|
||||
*value = (*value) / valueDivScalar;
|
||||
return success;
|
||||
}
|
||||
|
||||
|
||||
|
||||
#endif //AAX_CUNITPREFIXDISPLAYDELEGATEDECORATOR
|
||||
|
|
@ -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 <typename aContextType>
|
||||
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 <tt>(inContextPtrsEnd -
|
||||
inContextPtrsBegin)</tt> gives the count.
|
||||
|
||||
\par iContextPtrsEnd
|
||||
The upper bound of the vector at @p iContextPtrsBegin.
|
||||
<tt>(inContextPtrsEnd - iContextPtrsBegin)</tt> 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 <void>::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 <void>::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 <void>::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 <void>::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 <void>::CInitPrivateDataProc AAX_CInitPrivateDataProc; ///< \deprecated
|
||||
|
||||
/// @cond ignore
|
||||
#endif // AAX_CALLBACKS_H_
|
||||
/// @endcond
|
||||
|
|
@ -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 <math.h>
|
||||
#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<int32_t>(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
|
||||
|
|
@ -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 <algorithm>
|
||||
|
||||
//! \brief Byte swap data in-place.
|
||||
template<class T> void AAX_EndianSwapInPlace(T* theDataP);
|
||||
|
||||
//! \brief Make a byte-swapped copy of data.
|
||||
template<class T> T AAX_EndianSwap(T theData);
|
||||
|
||||
|
||||
//! \brief Convert data in-place between Big Endian and native byte ordering.
|
||||
template<class T> void AAX_BigEndianNativeSwapInPlace(T* theDataP);
|
||||
|
||||
//! \brief Copy and convert data between Big Endian and native byte ordering.
|
||||
template<class T> T AAX_BigEndianNativeSwap(T theData);
|
||||
|
||||
//! \brief Convert data in-place from the native byte ordering to Little Endian byte ordering.
|
||||
template<class T> void AAX_LittleEndianNativeSwapInPlace(T* theDataP);
|
||||
|
||||
//! \brief Copy and convert data from the native byte ordering to Little Endian byte ordering.
|
||||
template<class T> T AAX_LittleEndianNativeSwap(T theData);
|
||||
|
||||
|
||||
|
||||
//! \brief Byte swap a sequence of data in-place.
|
||||
template<class Iter> void AAX_EndianSwapSequenceInPlace(Iter beginI, Iter endI);
|
||||
|
||||
|
||||
//! \brief Convert an sequence of data in-place between Big Endian and native byte ordering.
|
||||
template<class Iter> 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<class Iter> void AAX_LittleEndianNativeSwapSequenceInPlace(Iter beginI, Iter endI);
|
||||
|
||||
|
||||
//
|
||||
// Implementations
|
||||
//
|
||||
|
||||
template<class T>
|
||||
inline
|
||||
void
|
||||
AAX_EndianSwapInPlace(T* theDataP)
|
||||
{
|
||||
char *begin, *end;
|
||||
|
||||
begin = reinterpret_cast<char*>(theDataP);
|
||||
end = begin + sizeof( T );
|
||||
std::reverse( begin, end );
|
||||
}
|
||||
|
||||
|
||||
template<class T>
|
||||
inline
|
||||
T AAX_EndianSwap(T theData)
|
||||
{
|
||||
AAX_EndianSwapInPlace(&theData);
|
||||
return theData;
|
||||
}
|
||||
|
||||
|
||||
template<class T>
|
||||
inline
|
||||
void AAX_BigEndianNativeSwapInPlace(T* theDataP)
|
||||
{
|
||||
#if (!defined __BIG_ENDIAN__) || (0 == __BIG_ENDIAN__)
|
||||
AAX_EndianSwapInPlace(theDataP);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
template<class T>
|
||||
inline
|
||||
T AAX_BigEndianNativeSwap(T theData)
|
||||
{
|
||||
AAX_BigEndianNativeSwapInPlace(&theData);
|
||||
return theData;
|
||||
}
|
||||
|
||||
|
||||
template<class T>
|
||||
inline
|
||||
void AAX_LittleEndianNativeSwapInPlace(T* theDataP)
|
||||
{
|
||||
#if (defined __BIG_ENDIAN__) && (0 != __BIG_ENDIAN__)
|
||||
AAX_EndianSwapInPlace(theDataP);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
template<class T>
|
||||
inline
|
||||
T AAX_LittleEndianNativeSwap(T theData)
|
||||
{
|
||||
AAX_LittleEndianNativeSwapInPlace(&theData);
|
||||
return theData;
|
||||
}
|
||||
|
||||
|
||||
template<class Iter>
|
||||
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<class Iter>
|
||||
inline
|
||||
void AAX_BigEndianNativeSwapSequenceInPlace(Iter beginI, Iter endI)
|
||||
{
|
||||
#if (!defined __BIG_ENDIAN__) || (0 == __BIG_ENDIAN__)
|
||||
AAX_EndianSwapSequenceInPlace(beginI, endI);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
template<class Iter>
|
||||
inline
|
||||
void AAX_LittleEndianNativeSwapSequenceInPlace(Iter beginI, Iter endI)
|
||||
{
|
||||
#if (defined __BIG_ENDIAN__) && (0 != __BIG_ENDIAN__)
|
||||
AAX_EndianSwapSequenceInPlace(beginI, endI);
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif
|
||||
1430
modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_Enums.h
Normal file
1430
modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_Enums.h
Normal file
File diff suppressed because it is too large
Load diff
|
|
@ -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 <cstdlib>
|
||||
|
||||
#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_
|
||||
695
modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_Errors.h
Normal file
695
modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_Errors.h
Normal file
|
|
@ -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
|
||||
|
|
@ -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 <exception>
|
||||
#include <string>
|
||||
#include <set>
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////
|
||||
#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 <class C>
|
||||
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 <class C1, class C2, class C3>
|
||||
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 <class C>
|
||||
explicit ResultError(AAX_Result inWhatResult, const C& inFunction)
|
||||
: Any(ResultError::FormatResult(inWhatResult), inFunction, (const char*)NULL)
|
||||
, mResult(inWhatResult)
|
||||
{
|
||||
}
|
||||
|
||||
template <class C1, class C2>
|
||||
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<AAX_Result> 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 <TT>agg</TT> 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 <TT>agg</TT> 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 <TT>operator=()</TT> 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
|
||||
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
@ -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
|
||||
|
|
@ -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
|
||||
|
|
@ -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
|
||||
|
|
@ -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_
|
||||
|
|
@ -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_
|
||||
|
|
@ -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
|
||||
|
|
@ -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
|
||||
|
|
@ -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
|
||||
|
|
@ -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
|
||||
|
|
@ -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
|
||||
File diff suppressed because it is too large
Load diff
|
|
@ -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
|
||||
|
|
@ -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
|
||||
|
|
@ -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
|
||||
|
|
@ -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
|
||||
|
|
@ -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
|
||||
|
|
@ -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
|
||||
|
|
@ -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_
|
||||
|
|
@ -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
|
||||
|
|
@ -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
|
||||
|
|
@ -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
|
||||
|
|
@ -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
|
||||
|
|
@ -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
|
||||
|
|
@ -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
|
||||
|
||||
|
|
@ -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
|
||||
|
||||
|
|
@ -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
|
||||
|
|
@ -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
|
||||
|
|
@ -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
|
||||
|
|
@ -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)
|
||||
* - <tt>const char inDLLFileNameUTF8[]</tt>: \ref AAX_eProperty_TIDLLFileName (required)
|
||||
* - <tt>const char iProcessProcSymbol[]</tt>: \ref AAX_eProperty_TIProcessProc (required)
|
||||
* - <tt>const char iInstanceInitProcSymbol[]</tt>: \ref AAX_eProperty_TIInstanceInitProc (optional)
|
||||
* - <tt>const char iBackgroundProcSymbol[]</tt>: \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 <typename aContextType>
|
||||
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 <typename aContextType>
|
||||
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 <AAX_CProcessProc>( inProcessProc ),
|
||||
inProperties,
|
||||
reinterpret_cast<AAX_CInstanceInitProc>( inInstanceInitProc ),
|
||||
reinterpret_cast<AAX_CBackgroundProc>( inBackgroundProc ) );
|
||||
}
|
||||
|
||||
#endif // #ifndef _AAX_ICOMPONENTDESCRIPTOR_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
|
||||
|
|
@ -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 <memory>
|
||||
|
||||
// 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_
|
||||
|
|
@ -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<IACFUnknown *>(this);
|
||||
( static_cast<IACFUnknown *>(*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
|
||||
|
|
@ -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
|
||||
|
|
@ -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<const AAX_IFeatureInfo> 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
|
||||
|
|
@ -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 <typename T>
|
||||
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 <typename T>
|
||||
AAX_CSubclassDisplayDelegate<T>* AAX_CSubclassDisplayDelegate<T>::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
|
||||
|
|
@ -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 <typename T>
|
||||
class AAX_IDisplayDelegateDecorator : public AAX_IDisplayDelegate<T>
|
||||
{
|
||||
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<T>& 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 <typename T>
|
||||
AAX_CSubclassDisplayDelegate<T>* AAX_CSubclassDisplayDelegate<T>::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<T>* 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<T>* mWrappedDisplayDelegate;
|
||||
|
||||
/** Default constructor not allowed. */
|
||||
AAX_IDisplayDelegateDecorator() { }
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
AAX_IDisplayDelegateDecorator<T>::AAX_IDisplayDelegateDecorator(const AAX_IDisplayDelegate<T>& displayDelegate) :
|
||||
AAX_IDisplayDelegate<T>(),
|
||||
mWrappedDisplayDelegate(displayDelegate.Clone())
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
AAX_IDisplayDelegateDecorator<T>::AAX_IDisplayDelegateDecorator(const AAX_IDisplayDelegateDecorator& other) :
|
||||
mWrappedDisplayDelegate(other.mWrappedDisplayDelegate->Clone())
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
AAX_IDisplayDelegateDecorator<T>::~AAX_IDisplayDelegateDecorator()
|
||||
{
|
||||
delete mWrappedDisplayDelegate;
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
AAX_IDisplayDelegateDecorator<T>* AAX_IDisplayDelegateDecorator<T>::Clone() const
|
||||
{
|
||||
return new AAX_IDisplayDelegateDecorator(*this);
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
bool AAX_IDisplayDelegateDecorator<T>::ValueToString(T value, AAX_CString* valueString) const
|
||||
{
|
||||
return mWrappedDisplayDelegate->ValueToString(value, valueString);
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
bool AAX_IDisplayDelegateDecorator<T>::ValueToString(T value, int32_t maxNumChars, AAX_CString* valueString) const
|
||||
{
|
||||
return mWrappedDisplayDelegate->ValueToString(value, maxNumChars, valueString);
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
bool AAX_IDisplayDelegateDecorator<T>::StringToValue(const AAX_CString& valueString, T* value) const
|
||||
{
|
||||
return mWrappedDisplayDelegate->StringToValue(valueString, value);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
#endif //AAX_IDISPLAYDELEGATEDECORATOR_H
|
||||
|
||||
|
||||
|
||||
294
modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_IDma.h
Normal file
294
modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_IDma.h
Normal file
|
|
@ -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
|
||||
|
|
@ -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
|
||||
|
|
@ -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
|
||||
|
|
@ -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
|
||||
|
|
@ -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
|
||||
|
|
@ -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<const AAX_IPropertyMap> 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
|
||||
|
|
@ -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
|
||||
|
|
@ -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_
|
||||
|
|
@ -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
|
||||
|
|
@ -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
|
||||
|
|
@ -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 <TT>%lt;ControlNameVariations%lt;</TT> which are explicitly
|
||||
defined for the current page table type.
|
||||
|
||||
\note Normally parameter name variations are only used with the <TT>'PgTL'</TT> 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 <TT>'PgTL'</TT> 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 <TT>%lt;ControlNameVariations%lt;</TT> 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 <TT>'PgTL'</TT> 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 <TT>%lt;ControlNameVariations%lt;</TT> 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 <TT>'PgTL'</TT> 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 <TT>sz</TT> 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 <TT>%lt;ControlNameVariations%lt;</TT> 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 <TT>'PgTL'</TT> 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 <TT>'PgTL'</TT> 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 <TT>'PgTL'</TT> 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 <TT>'PgTL'</TT> 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 <TT>sz</TT> 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
|
||||
|
|
@ -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
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -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 <typename T>
|
||||
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
|
||||
|
|
@ -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
|
||||
|
|
@ -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
|
||||
|
|
@ -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 <memory>
|
||||
|
||||
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<TempoMap const> 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<MyType> ptr;
|
||||
* IACFUnknown * docDataPtr{nullptr};
|
||||
* if (AAX_SUCCESS == doc->GetDocumentData(dataUID, &docDataPtr) && docDataPtr) {
|
||||
* ptr.attach(std::static_cast<MyType*>(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
|
||||
|
|
@ -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
|
||||
|
|
@ -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
|
||||
|
|
@ -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 <typename T>
|
||||
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 <typename T>
|
||||
AAX_CSubclassTaperDelegate<T>* AAX_CSubclassTaperDelegate<T>::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
|
||||
142
modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_ITask.h
Normal file
142
modules/juce_audio_plugin_client/AAX/SDK/Interfaces/AAX_ITask.h
Normal file
|
|
@ -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
|
||||
|
|
@ -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
|
||||
|
|
@ -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 <b>output</b> 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
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue