Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | List of all members
ARAHostModel::AudioSource Class Reference

Helper class for the host side implementation of the ARA AudioSource model object. More...

#include <juce_ARAHosting.h>

Inheritance diagram for ARAHostModel::AudioSource:

Public Member Functions

 AudioSource (ARA::ARAAudioSourceHostRef hostRef, ARA::Host::DocumentController &dc, const ARA::ARAAudioSourceProperties &props)
 Creates an AudioSource object.
 
 ~AudioSource ()=default
 Destructor.
 
void update (const ARA::ARAAudioSourceProperties &props)
 Updates the state of the corresponding ARA model object.
 
void enableAudioSourceSamplesAccess (bool)
 Changes the plugin's access to the AudioSource samples through the DocumentController.
 
- Public Member Functions inherited from ARAHostModel::ManagedARAHandle< AudioSource, ARA::ARAAudioSourceRef >
 ManagedARAHandle (ARA::Host::DocumentController &dc, Ptr ptr) noexcept
 Constructor.
 
auto & getDocumentController () const
 Returns the host side DocumentController reference.
 
Ptr getPluginRef () const
 Returns the plugin side reference to the model object.
 

Static Public Member Functions

static constexpr auto getEmptyProperties ()
 Returns an ARA versioned struct with the structSize correctly set for the currently used SDK version.
 
static void destroy (ARA::Host::DocumentController &, Ptr)
 Called by ManagedARAHandle to deregister the model object during the destruction of AudioSource.
 

Additional Inherited Members

- Public Types inherited from ARAHostModel::ManagedARAHandle< AudioSource, ARA::ARAAudioSourceRef >
using Ptr
 

Detailed Description

Helper class for the host side implementation of the ARA AudioSource model object.

Its intended use is to add a member variable of this type to your host side AudioSource implementation. Then it provides a RAII approach to managing the lifetime of the corresponding objects created inside the DocumentController. When the host side object is instantiated an ARA model object is also created in the DocumentController. When the host side object is deleted it will be removed from the DocumentController as well.

The class will automatically put the DocumentController into editable state for operations that mandate this e.g. creation, deletion or updating.

You can encapsulate multiple such operations into a scope with an ARAEditGuard in order to invoke the editable state of the DocumentController only once.

Constructor & Destructor Documentation

◆ AudioSource()

ARAHostModel::AudioSource::AudioSource ( ARA::ARAAudioSourceHostRef hostRef,
ARA::Host::DocumentController & dc,
const ARA::ARAAudioSourceProperties & props )

Creates an AudioSource object.

During construction it registers an ARA AudioSource model object with the DocumentController that refers to the provided hostRef. When this object is deleted the corresponding DocumentController model object will also be deregistered.

You can acquire a correctly versioned ARA::ARAAudioSourceProperties struct by calling getEmptyProperties().

Places the DocumentController in editable state.

See also
ARAEditGuard

◆ ~AudioSource()

ARAHostModel::AudioSource::~AudioSource ( )
default

Destructor.

Temporarily places the DocumentController in an editable state.

Member Function Documentation

◆ getEmptyProperties()

static constexpr auto ARAHostModel::AudioSource::getEmptyProperties ( )
staticconstexpr

Returns an ARA versioned struct with the structSize correctly set for the currently used SDK version.

You should leave structSize unchanged, and fill out the rest of the fields appropriately for the host implementation of the ARA model object.

References makeARASizedStruct().

◆ update()

void ARAHostModel::AudioSource::update ( const ARA::ARAAudioSourceProperties & props)

Updates the state of the corresponding ARA model object.

Places the DocumentController in editable state.

You can use getEmptyProperties() to acquire a properties struct where the structSize field has already been correctly set.

◆ enableAudioSourceSamplesAccess()

void ARAHostModel::AudioSource::enableAudioSourceSamplesAccess ( bool )

Changes the plugin's access to the AudioSource samples through the DocumentController.

Places the DocumentController in editable state.

◆ destroy()

static void ARAHostModel::AudioSource::destroy ( ARA::Host::DocumentController & ,
Ptr  )
static

Called by ManagedARAHandle to deregister the model object during the destruction of AudioSource.

You shouldn't call this function manually.


The documentation for this class was generated from the following file:
linkedin facebook pinterest youtube rss twitter instagram facebook-blank rss-blank linkedin-blank pinterest youtube twitter instagram