JUCE

- Main Page
- Related Pages
- Topics
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

Loading...
Searching...
No Matches
Public Member Functions | List of all members
ARAHostModel::PlaybackRegionRegistry< RendererRef, Interface > Class Template Reference
juce_audio_processors » format_types

Base class used by the PlaybackRendererInterface and EditorRendererInterface plugin extension interfaces. More...

`#include <juce_ARAHosting.h>`

## Public Member Functions
| PlaybackRegionRegistry ()=default
| PlaybackRegionRegistry (RendererRef rendererRefIn, const Interface *interfaceIn)
void | add (PlaybackRegion &region)
| Adds a PlaybackRegion to the corresponding PlaybackRendererInterface or EditorRendererInterface.
void | remove (PlaybackRegion &region)
| Removes a PlaybackRegion from the corresponding PlaybackRendererInterface or EditorRendererInterface.
bool | isValid ()
| Returns true if the underlying ARA plugin extension instance fulfills the corresponding role.

## Detailed Description

template<typename RendererRef, typename Interface>
class ARAHostModel::PlaybackRegionRegistry< RendererRef, Interface >

Base class used by the PlaybackRendererInterface and EditorRendererInterface plugin extension interfaces.

Hosts will want to create one or typically more ARA plugin extension instances per plugin for the purpose of playback and editor rendering. The PlaybackRegions created by the host then have to be assigned to these instances through the appropriate interfaces.

Whether a PlaybackRegion or an assigned RendererInterface is deleted first depends on the host implementation and exact use case.

By using these helper classes you can ensure that the ARA DocumentController remains in a valid state in both situations. In order to use them acquire an object from PlugInExtensionInstance::getPlaybackRendererInterface() or PlugInExtensionInstance::getEditorRendererInterface().

Then call add() to register a PlaybackRegion with that particular PlugInExtensionInstance's interface.

Now when you delete that PlaybackRegion it will be deregistered from that extension instance. If however you want to delete the plugin extension instance before the PlaybackRegion, you can delete the PlaybackRegionRegistry instance before deleting the plugin extension instance, which takes care of deregistering all PlaybackRegions.

When adding or removing PlaybackRegions the plugin instance must be in an unprepared state i.e. before AudioProcessor::prepareToPlay() or after AudioProcessor::releaseResources().

auto playbackRenderer = std::make_unique<PlaybackRendererInterface> (plugInExtensionInstance.getPlaybackRendererInterface());
auto playbackRegion = std::make_unique<PlaybackRegion> (documentController, regionSequence, audioModification, audioSource);
// Either of the following three code variations are valid
// (1) ===================================================
playbackRenderer.add (playbackRegion);
playbackRenderer.remove (playbackRegion);
// (2) ===================================================
playbackRenderer.add (playbackRegion);
playbackRegion.reset();
// (3) ===================================================
playbackRenderer.add (playbackRegion);
playbackRenderer.reset();

See also
  PluginExtensionInstance

## Constructor & Destructor Documentation

## ◆ PlaybackRegionRegistry() [1/2]

template<typename RendererRef , typename Interface >

ARAHostModel::PlaybackRegionRegistry< RendererRef, Interface >::PlaybackRegionRegistry | ( |  | ) |
| default

## ◆ PlaybackRegionRegistry() [2/2]

template<typename RendererRef , typename Interface >

ARAHostModel::PlaybackRegionRegistry< RendererRef, Interface >::PlaybackRegionRegistry | ( | RendererRef | rendererRefIn,
|  | const Interface * | interfaceIn )

## Member Function Documentation

## ◆ add()

template<typename RendererRef , typename Interface >

void ARAHostModel::PlaybackRegionRegistry< RendererRef, Interface >::add | ( | PlaybackRegion & | region | ) |

Adds a PlaybackRegion to the corresponding PlaybackRendererInterface or EditorRendererInterface.

The plugin instance must be in an unprepared state i.e. before AudioProcessor::prepareToPlay() or after AudioProcessor::releaseResources().

## ◆ remove()

template<typename RendererRef , typename Interface >

void ARAHostModel::PlaybackRegionRegistry< RendererRef, Interface >::remove | ( | PlaybackRegion & | region | ) |

Removes a PlaybackRegion from the corresponding PlaybackRendererInterface or EditorRendererInterface.

The plugin instance must be in an unprepared state i.e. before AudioProcessor::prepareToPlay() or after AudioProcessor::releaseResources().

## ◆ isValid()

template<typename RendererRef , typename Interface >

bool ARAHostModel::PlaybackRegionRegistry< RendererRef, Interface >::isValid | ( |  | ) |

Returns true if the underlying ARA plugin extension instance fulfills the corresponding role.

The documentation for this class was generated from the following file:

- juce_ARAHosting.h