Plug-In Dispatch

Detailed Description

Classes and interfaces designed to ease ARA plug-in implementations.
Requires linking ARAPlugInDispatch.cpp with your binary.

Subpages

 Plug-In Interfaces
 Interfaces to be implemented by ARA plug-ins.
 
 Host Interface Wrappers
 Wrappers for the interfaces used to communicate with and control the ARA host.
 

Macros

#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.
 

Typedefs

template<typename StructType >
using ARA::PlugIn::PropertiesPtr = SizedStructPtr< StructType >
 Template to conveniently evaluate pointers to ARA variable-sized properties structs.
 

Macro Definition Documentation

◆ 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:

// declare the conversion in the appropriate header
class MyAudioSource;
// whenever exporting refs to the host, use toRef ()
MyAudioSource* audioSource = ...;
ARAAudioSourceRef audioSourceRef = toRef (audioSource);
// whenever the host passes a plug-in ref back to you, use fromRef<> ()
ARAAudioSourceRef audioSourceRef; // usually provided as argument to a function call
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