|
TracktionEngine
|
#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. | |
| PlaybackRegionWrapper * | getFirstPlaybackRegion () 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< AudioSourceWrapper > | audioSource |
| std::unique_ptr< AudioModificationWrapper > | audioModification |
| juce::String | audioSourceKey |
| PlaybackRegionAndSource::PlaybackRegionAndSource | ( | ARADocument & | doc, |
| AudioClipBase & | audioClip, | ||
| const ARAFactory & | f, | ||
| const ARAPlugInExtensionInstance & | pluginExtensionInstance, | ||
| const juce::String & | itemID, | ||
| PlaybackRegionAndSource * | instanceToClone | ||
| ) |
| PlaybackRegionAndSource::~PlaybackRegionAndSource | ( | ) |
References audioModification, audioSource, audioSourceKey, CRASH_TRACER, disable(), playbackRegions, and ARADocument::releaseAudioSource().
| void PlaybackRegionAndSource::enable | ( | ) |
References audioSource, and CRASH_TRACER.
Referenced by PlaybackRegionAndSource().
| void PlaybackRegionAndSource::disable | ( | ) |
References audioSource, and CRASH_TRACER.
Referenced by ~PlaybackRegionAndSource().
|
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().
| 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.
| 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().
| PlaybackRegionWrapper * PlaybackRegionAndSource::getFirstPlaybackRegion | ( | ) | const |
Returns the first playback region, or nullptr if none exist.
References playbackRegions.
| bool PlaybackRegionAndSource::hasPlaybackRegions | ( | ) | const |
Returns true if there is at least one playback region.
References playbackRegions.
| std::vector<std::unique_ptr<PlaybackRegionWrapper> > PlaybackRegionAndSource::playbackRegions |
| std::shared_ptr<AudioSourceWrapper> PlaybackRegionAndSource::audioSource |
Referenced by disable(), enable(), PlaybackRegionAndSource(), and ~PlaybackRegionAndSource().
| std::unique_ptr<AudioModificationWrapper> PlaybackRegionAndSource::audioModification |
Referenced by PlaybackRegionAndSource(), rebuildPlaybackRegions(), and ~PlaybackRegionAndSource().
| juce::String PlaybackRegionAndSource::audioSourceKey |
Referenced by PlaybackRegionAndSource(), and ~PlaybackRegionAndSource().