TracktionEngine
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
PlaybackRegionAndSource Class Reference

#include <tracktion_ARAWrapperInterfaces.h>

Public Member Functions

 PlaybackRegionAndSource (ARADocument &doc, AudioClipBase &audioClip, const ARAFactory &f, const ARAPlugInExtensionInstance &pluginExtensionInstance, const juce::String &itemID, PlaybackRegionAndSource *instanceToClone)
 
 ~PlaybackRegionAndSource ()
 
void enable ()
 
void disable ()
 
bool playbackRegionLayoutMatches (bool isLooping, double clipLengthSecs, double loopLengthSecs) const
 Returns true if the current set of playback regions still matches the given clip state, i.e.
 
void rebuildPlaybackRegions ()
 Rebuilds all playback regions based on whether the clip is looping.
 
PlaybackRegionWrappergetFirstPlaybackRegion () const
 Returns the first playback region, or nullptr if none exist.
 
bool hasPlaybackRegions () const
 Returns true if there is at least one playback region.
 

Static Public Member Functions

static size_t getNumLoopRegions (double clipLengthSecs, double loopLengthSecs)
 Returns the number of playback regions a looping clip of the given length needs.
 

Public Attributes

std::vector< std::unique_ptr< PlaybackRegionWrapper > > playbackRegions
 
std::shared_ptr< AudioSourceWrapperaudioSource
 
std::unique_ptr< AudioModificationWrapperaudioModification
 
juce::String audioSourceKey
 

Constructor & Destructor Documentation

◆ PlaybackRegionAndSource()

PlaybackRegionAndSource::PlaybackRegionAndSource ( ARADocument doc,
AudioClipBase &  audioClip,
const ARAFactory &  f,
const ARAPlugInExtensionInstance &  pluginExtensionInstance,
const juce::String &  itemID,
PlaybackRegionAndSource instanceToClone 
)

◆ ~PlaybackRegionAndSource()

PlaybackRegionAndSource::~PlaybackRegionAndSource ( )

Member Function Documentation

◆ enable()

void PlaybackRegionAndSource::enable ( )

References audioSource, and CRASH_TRACER.

Referenced by PlaybackRegionAndSource().

◆ disable()

void PlaybackRegionAndSource::disable ( )

References audioSource, and CRASH_TRACER.

Referenced by ~PlaybackRegionAndSource().

◆ getNumLoopRegions()

static size_t PlaybackRegionAndSource::getNumLoopRegions ( double  clipLengthSecs,
double  loopLengthSecs 
)
static

Returns the number of playback regions a looping clip of the given length needs.

Uses a small tolerance so a length sitting on a loop boundary always produces a stable count - deriving it any other way (e.g. repeated subtraction) can disagree with ceil() by one and make the layout check rebuild the regions endlessly.

Referenced by playbackRegionLayoutMatches(), and rebuildPlaybackRegions().

◆ playbackRegionLayoutMatches()

bool PlaybackRegionAndSource::playbackRegionLayoutMatches ( bool  isLooping,
double  clipLengthSecs,
double  loopLengthSecs 
) const

Returns true if the current set of playback regions still matches the given clip state, i.e.

no rebuild is needed and updateRange() suffices.

References getNumLoopRegions(), and playbackRegions.

◆ rebuildPlaybackRegions()

void PlaybackRegionAndSource::rebuildPlaybackRegions ( )

Rebuilds all playback regions based on whether the clip is looping.

If looping, creates one PlaybackRegionWrapper per loop iteration. If not looping, creates a single region covering the whole clip.

References audioModification, CRASH_TRACER, getNumLoopRegions(), and playbackRegions.

Referenced by PlaybackRegionAndSource().

◆ getFirstPlaybackRegion()

PlaybackRegionWrapper * PlaybackRegionAndSource::getFirstPlaybackRegion ( ) const

Returns the first playback region, or nullptr if none exist.

References playbackRegions.

◆ hasPlaybackRegions()

bool PlaybackRegionAndSource::hasPlaybackRegions ( ) const

Returns true if there is at least one playback region.

References playbackRegions.

Member Data Documentation

◆ playbackRegions

std::vector<std::unique_ptr<PlaybackRegionWrapper> > PlaybackRegionAndSource::playbackRegions

◆ audioSource

std::shared_ptr<AudioSourceWrapper> PlaybackRegionAndSource::audioSource

◆ audioModification

std::unique_ptr<AudioModificationWrapper> PlaybackRegionAndSource::audioModification

◆ audioSourceKey

juce::String PlaybackRegionAndSource::audioSourceKey

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