Classes and interfaces designed to ease ARA plug-in implementations.
Requires linking ARAPlugInDispatch.cpp with your binary.
|
| #define | ARA_MAP_REF(ClassType, FirstRefType, ...) |
| | Type safe conversions to/from ref: toRef () and fromRef<> (). More...
|
| |
|
#define | ARA_HOST_MANAGED_OBJECT ARA_DISABLE_COPY_AND_MOVE |
| | Tag objects maintained by the host to prevent accidentally copying/moving them.
|
| |
◆ ARA_MAP_REF
| #define ARA_MAP_REF |
( |
|
ClassType, |
|
|
|
FirstRefType, |
|
|
|
... |
|
) |
| |
Value: static inline ARA::ToRefConversionHelper<ClassType, FirstRefType, ##__VA_ARGS__> toRef (const ClassType* ptr) noexcept { return ARA::ToRefConversionHelper<ClassType, FirstRefType, ##__VA_ARGS__> { ptr }; } \
template <typename DesiredClassType = ClassType, typename RefType, typename std::enable_if<std::is_constructible<ARA::FromRefConversionHelper<ClassType, FirstRefType, ##__VA_ARGS__>, RefType>::value, bool>::type = true> \
static inline DesiredClassType* fromRef (RefType ref) noexcept { ClassType* object { ARA::FromRefConversionHelper<ClassType, FirstRefType, ##__VA_ARGS__> (ref) }; return static_cast<DesiredClassType*> (object); }
Type safe conversions to/from ref: toRef () and fromRef<> ().
This macro defines custom overloads of the toRef () and fromRef<> () conversion functions which act as type safe casts between your implementation class pointers and the opaque refs that the ARA API uses. fromRef<>() additionally allows for optional up-casting from base to derived classes if needed. The first macro argument is your implementation class, followed by all ref types that you want this class to comply with.
Whenever using your C++ object pointers as plug-in refs, you should apply the conversion macros like so:
class MyAudioSource;
MyAudioSource* audioSource = ...;
MyAudioSource* audioSource = fromRef (audioSourceRef);
#define ARA_MAP_REF(ClassType, FirstRefType,...)
Type safe conversions to/from ref: toRef () and fromRef<> ().
Definition: ARAPlugInDispatch.h:57
struct ARAAudioSourceRefMarkupType * ARAAudioSourceRef
Reference to the plug-in side representation of an audio source (opaque to the host).
Definition: ARAInterface.h:790