TracktionEngine
Loading...
Searching...
No Matches
Classes | Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | List of all members
engine::AudioClipBase Class Referenceabstract

Base class for Clips that produce some kind of audio e.g. More...

#include <tracktion_AudioClipBase.h>

Inheritance diagram for engine::AudioClipBase:

Classes

struct  ProxyRenderingInfo
 Holds information about how to render a proxy for this clip. More...
 

Public Types

enum  FadeBehaviour { gainFade = 0 , speedRamp }
 Describes the fade behaviour. More...
 
enum  AutoPitchMode { pitchTrack = 0 , chordTrackMono , chordTrackPoly }
 Defines the auto pitch mode. More...
 
enum class  ClipDirection { previous , next , none }
 Defines a prevous/next direction. More...
 
using Ptr = juce::ReferenceCountedObjectPtr< AudioClipBase >
 
- Public Types inherited from engine::Clip
enum class  FollowActionDurationType { beats , loops }
 Defines the types of duration follow actions can use. More...
 
enum  SyncType { syncBarsBeats = 0 , syncAbsolute }
 Determines the clip sync type. More...
 
using Ptr = juce::ReferenceCountedObjectPtr< Clip >
 
using Array = juce::ReferenceCountedArray< Clip >
 
- Public Types inherited from engine::TrackItem
enum class  Type {
  unknown , wave , midi , edit ,
  step , marker , pitch , timeSig ,
  collection , video , recording , chord ,
  arranger , container
}
 Defines the types of item that can live on Track[s]. More...
 
- Public Types inherited from engine::Selectable
using WeakRef = juce::WeakReference< Selectable >
 

Public Member Functions

 AudioClipBase (const juce::ValueTree &, EditItemID, Type, ClipOwner &)
 Creates a basic AudioClip.
 
 ~AudioClipBase () override
 Destructor.
 
TimeDuration getMaximumLength () override
 Returns the maximum length for this clip.
 
virtual TimeDuration getSourceLength () const =0
 Must return the length in seconds of the source material e.g.
 
virtual AudioFile getAudioFile () const
 Returns the file used to play back the source and will get proxied etc.
 
AudioFile getPlaybackFile ()
 Returns the current AudioFile being used by the Clip, either the original source or a proxy.
 
virtual juce::File getOriginalFile () const =0
 Must return the file that the source ProjectItemID refers to.
 
virtual HashCode getHash () const =0
 Must return a unique hash for this clip's source.
 
virtual AudioFileInfo getWaveInfo ()
 Returns the WaveInfo for a clip.
 
void markAsDirty ()
 Resets the dirty flag so that a new render will be attempted.
 
void updateSourceFile ()
 Checks the current source file to see if it's up to date and then triggers a source render if needed.
 
virtual bool requiresRenderingSource () const
 Subclasses can override this to indicate that they need to render their source file, irrespective of their canUseProxy property.
 
virtual bool needsRender () const
 Subclasses should override this to return true if they need the rest of the render callbacks.
 
virtual RenderManager::Job::Ptr getRenderJob (const AudioFile &)
 Subclasses should override this to return a RenderJob suitable for rendering its source file.
 
virtual void renderComplete ()
 Callback to indicate that the render has completed.
 
virtual juce::String getRenderMessage ()
 Override this to return a custom message to be displayed over waveforms during rendering.
 
virtual juce::String getClipMessage ()
 Override this to return a custom message to display over the clip where the "file missing" text usually goes.
 
void cancelCurrentRender ()
 If a render is in progress, this will cancel it.
 
void setGainDB (float dB)
 Sets the gain of the clip in dB.
 
float getGainDB () const noexcept
 Returns the gain of the clip in dB.
 
float getGain () const noexcept
 Returns the gain of the clip.
 
void setPan (float pan)
 Sets the pan of the clip.
 
float getPan () const noexcept
 Returns the pan of the clip from -1 to 1.
 
void setMuted (bool shouldBeMuted) override
 
bool isMuted () const override
 
LiveClipLevel getLiveClipLevel ()
 Returns a LiveClipLevel which can be used to read the gain, pan and mute statuses.
 
std::shared_ptr< AudioClipPlayheadgetPlayhead () const noexcept
 Returns a shared playhead which is updated by the playback graph to track the current position being played within the clip's source file.
 
ChannelConfiguration getSourceChannelConfiguration ()
 Returns the source file's channel configuration.
 
ChannelConfiguration getActiveChannelConfiguration ()
 Returns which channels are active (selected for playback).
 
void setActiveChannelConfiguration (const ChannelConfiguration &config)
 Sets which channels are active for playback.
 
ChannelConfiguration getOutputChannelConfiguration ()
 Returns the channel configuration output by this clip.
 
juce::AudioChannelSet getActiveChannels ()
 Returns the layout of the active channels as a JUCE AudioChannelSet.
 
bool setFadeIn (TimeDuration length)
 Sets the fade in duration in seconds.
 
TimeDuration getFadeIn () const
 Returns the fade in duration in seconds.
 
bool setFadeOut (TimeDuration length)
 Sets the fade out duration in seconds.
 
TimeDuration getFadeOut () const
 Returns the fade out duration in seconds.
 
void setFadeInType (AudioFadeCurve::Type)
 Sets the curve shape for the fade in to use.
 
AudioFadeCurve::Type getFadeInType () const
 Returns the curve shape for the fade in to use.
 
void setFadeOutType (AudioFadeCurve::Type newType)
 Sets the curve shape for the fade out to use.
 
AudioFadeCurve::Type getFadeOutType () const
 Returns the curve shape for the fade out to use.
 
void setAutoCrossfade (bool shouldAutoCrossfade)
 Enables/disables auto-crossfading.
 
bool getAutoCrossfade () const noexcept
 Returns whether auto-crossfade is enabled.
 
void updateAutoCrossfadesAsync (bool updateOverlapped)
 Triggers an update of the auto-crossfades.
 
void applyEdgeFades ()
 Sets the fade in/out lengths to be 0.03s to avoid any clicks at the start/end of th clip.
 
void copyFadeToAutomation (bool fadeIn, bool removeClipFade)
 Copies the fade in curve to a volume automation curve.
 
void setFadeInBehaviour (FadeBehaviour newBehaviour)
 Sets the fade in behaviour.
 
FadeBehaviour getFadeInBehaviour () const
 Returns the fade in behaviour.
 
void setFadeOutBehaviour (FadeBehaviour newBehaviour)
 Sets the fade out behaviour.
 
FadeBehaviour getFadeOutBehaviour () const
 Returns the fade out behaviour.
 
virtual void setLoopDefaults ()=0
 Override this to fill in the LoopInfo structure as best fits the source.
 
void setLoopInfo (const LoopInfo &)
 Sets a LoopInfo to describe this clip's tempo, time sig etc.
 
const LoopInfogetLoopInfo () const
 Returns the LoopInfo being used to describe this clip.
 
LoopInfogetLoopInfo ()
 Returns the LoopInfo being used to describe this clip.
 
TimeRange getLoopRange () const
 Returns the loop range in seconds.
 
bool canLoop () const override
 
bool isLooping () const override
 
bool beatBasedLooping () const override
 
void setNumberOfLoops (int num) override
 
void disableLooping () override
 
BeatPosition getLoopStartBeats () const override
 
TimePosition getLoopStart () const override
 
BeatDuration getLoopLengthBeats () const override
 
TimeDuration getLoopLength () const override
 
void setLoopRange (TimeRange) override
 
void setLoopRangeBeats (BeatRange) override
 
void setAutoDetectBeats (bool)
 Enables auto-detection of beats.
 
bool getAutoDetectBeats () const
 Returns true if auto-detect of beats is enabled.
 
void setBeatSensitivity (float s)
 Sets the beat sensitivity, triggering a LoopInfo update if auto-detect is enabled.
 
float getBeatSensitivity () const
 Returns the beat sensitivity.
 
void pitchTempoTrackChanged () override
 
void setSpeedRatio (double newSpeed) override
 
void setTimeStretchMode (TimeStretcher::Mode mode)
 Sets a time-stretch mode to use.
 
TimeStretcher::Mode getTimeStretchMode () const noexcept
 Returns the time-stretch mode that has been set.
 
TimeStretcher::Mode getActualTimeStretchMode () const noexcept
 Returns the time-stretch mode that is in use.
 
void setAutoTempo (bool shouldUseAutoTempo)
 Enables/disables auto-tempo.
 
bool getAutoTempo () const
 Returns true if auto-tempo has been set.
 
void setAutoPitch (bool shouldUseAutoPitch)
 Enables/disables auto-pitch.
 
bool getAutoPitch () const
 Returns true if auto-pitch has been set.
 
void setAutoPitchMode (AutoPitchMode m)
 Sets the AutoPitchMode to use.
 
AutoPitchMode getAutoPitchMode ()
 Returns the AutoPitchMode in use.
 
void setWarpTime (bool shouldUseWarpTime)
 Enables/disables warp time.
 
bool getWarpTime () const
 Returns true if warp time is enabled.
 
WarpTimeManagergetWarpTimeManager () const
 Returns the WarpTimeManager for this clip used to maipluate warp markers.
 
void setTranspose (int numSemitones)
 Sets the number of semitones to transpose the clip by.
 
int getTransposeSemiTones (bool includeAutoPitch) const
 Returns the number of semitones this clip will be changed by.
 
void setPitchChange (float semitones)
 Sets the number of semitones to transpose the clip by.
 
float getPitchChange () const
 Returns the number of semitones to transpose the clip by.
 
float getPitchRatio () const
 Returns the pitch change as a normalised ratio.
 
void setIsReversed (bool shouldBeReversed)
 Enables reversing of the clip's source material.
 
bool getIsReversed () const noexcept
 Returns true if the clip's source material is reversed.
 
LoopInfo autoDetectBeatMarkers (const LoopInfo &current, bool autoBeat, float sensitivity) const
 Scans the current source file for any beats and adds them to the LoopInfo returned.
 
bool performTempoDetect ()
 Performs a tempo-detection task and if successful sets the clip's LoopInfo tempo to this.
 
juce::StringArray getPitchChoices ()
 Returns an array describng what pitch each semitone change will be.
 
virtual bool canHaveEffects () const
 Returns true if this clip can have ClipEffects added to it.
 
void enableEffects (bool enable, bool warn)
 Enables/disables ClipEffects for this clip.
 
bool effectsEnabled () const
 Returns true if ClipEffects are enabled.
 
void addEffect (const juce::ValueTree &effectsTree)
 Adds a ClipEffect to this clip.
 
void setEffectsVisible (bool b)
 Sets the effectsVisible flag for this clip.
 
bool getEffectsVisible () const
 Returns true if the effectsVisible flag is set for this clip.
 
ClipEffectsgetClipEffects () const noexcept
 Returns the ClipEffects for this clip if it has been enabled.
 
bool canSnapToOriginalBWavTime ()
 Returns true if source file has a bwav time reference metadata property.
 
void snapToOriginalBWavTime ()
 Moves the clip to the bwav time reference metadata property time.
 
virtual juce::Array< ProjectItemRefgetTakes () const
 Returns the ProjectItemRefs of the clip's takes.
 
juce::String canAddClipPlugin (const Plugin::Ptr &) const
 Returns an empty string if this plugin can be added, otherwise an error message due to the clip plugin being an incorrect type (e.g.
 
virtual bool isUsingFile (const AudioFile &)
 Should return true if the clip is referencing the file in any way.
 
AudioFile getProxyFileToCreate (bool renderTimestretched)
 Returns the AudioFile to create to play this clip back.
 
void setUsesProxy (bool canUseProxy) noexcept
 Can be used to disable proxy file generation for this clip.
 
bool canUseProxy () const noexcept
 Retuns true if this clip can use a proxy file.
 
bool usesTimeStretchedProxy () const
 Retuns true if this clip use a proxy file due to timestretching.
 
std::unique_ptr< ProxyRenderingInfocreateProxyRenderingInfo ()
 Creates a ProxyRenderingInfo object to decribe the stretch segements of this clip.
 
HashCode getProxyHash ()
 Returns a hash identifying the proxy settings.
 
void beginRenderingNewProxyIfNeeded ()
 Triggers creation of a new proxy file if one is required.
 
const AudioSegmentListgetAudioSegmentList ()
 Returns an AudioSegmentList describing this file if it is using auto-tempo.
 
void setResamplingQuality (ResamplingQuality)
 Sets the resampling qulity to use.
 
ResamplingQuality getResamplingQuality () const
 Returns the resampling quality to the be used.
 
void reverseLoopPoints ()
 Reverses the loop points to expose the same section of the source file but reversed.
 
void checkFadeLengthsForOverrun ()
 Trims the fade in out lengths to avoid any overlap between them.
 
AudioClipBasegetOverlappingClip (ClipDirection) const
 Returns the previous/next overlapping clip if one exists.
 
void captureARAStateToValueTree ()
 Stores the ARA plugin's current edits (e.g.
 
void tearDownARA ()
 Releases the ARA proxy.
 
juce::ReferenceCountedObjectPtr< ARAFileReadergetARAProxy () const
 Returns the ARAFileReader proxy if this clip is using an ARA plugin (e.g.
 
juce::ReferenceCountedObjectPtr< ARAFileReadergetMelodyneProxy () const
 
bool isUsingARA () const
 Returns true if this clip is using an ARA plugin.
 
void selectionStatusChanged (bool isNowSelected) override
 
TimeDuration getHead () const override
 Returns extra time before the clip start that needs processing (e.g., ARA head time).
 
TimeDuration getTail () const override
 Returns extra time after the clip end that needs processing (e.g., ARA tail time).
 
bool isUsingMelodyne () const
 
void loadARAState ()
 
void loadMelodyneState ()
 
bool setupARA (bool dontPopupErrorMessages)
 This internal method is used solely to find out if createAudioNode() should return nullptr or not.
 
void initialise () override
 
void cloneFrom (Clip *) override
 
void flushStateToValueTree () override
 
void setParent (ClipOwner *) override
 
bool canBeAddedTo (ClipOwner &) override
 
void changed () override
 
juce::Colour getDefaultColour () const override
 
PatternGeneratorgetPatternGenerator () override
 
void addMark (TimePosition relCursorPos)
 
void moveMarkTo (TimePosition relCursorPos)
 
void deleteMark (TimePosition relCursorPos)
 
void getRescaledMarkPoints (juce::Array< TimePosition > &rescaled, juce::Array< int > &orig) const
 
juce::Array< TimePositiongetRescaledMarkPoints () const override
 
juce::Array< ReferencedItemgetReferencedItems () override
 
void reassignReferencedItem (const ReferencedItem &, ProjectItemRef newRef, double newStartTime) override
 
std::shared_ptr< LaunchHandlegetLaunchHandle () override
 
void setUsesGlobalLaunchQuatisation (bool useGlobal) override
 
bool usesGlobalLaunchQuatisation () override
 
LaunchQuantisationgetLaunchQuantisation () override
 
FollowActionsgetFollowActions () override
 
bool addClipPlugin (const Plugin::Ptr &, SelectionManager &) override
 
Plugin::Array getAllPlugins () override
 
void sendMirrorUpdateToAllPlugins (Plugin &) const override
 
PluginListgetPluginList () override
 
- Public Member Functions inherited from engine::Clip
 Clip (const juce::ValueTree &, ClipOwner &, EditItemID, Type)
 Creates a clip of a given type from a ValueTree state.
 
 ~Clip () override
 Destructor.
 
virtual void sourceMediaChanged ()
 Called when the source media file reference (attribute "source") has changed - i.e.
 
virtual juce::String getName () const override
 Returns the name of the clip.
 
void setName (const juce::String &newName)
 Sets a new name for a clip.
 
virtual bool isMidi () const =0
 Returns true if this is a MidiClip.
 
virtual bool usesSourceFile () const
 True if it references a source file - i.e.
 
SourceFileReferencegetSourceFileReference ()
 Returns the SourceFileReference of the Clip.
 
juce::File getCurrentSourceFile () const
 Returns the current source file, this is different to the SourceFileReference as it could be a temporary comp file, clipFX, reverse render etc.
 
juce::Array< ReferencedItemgetReferencedItems () override
 Returns an array of any ReferencedItem[s] e.g.
 
void reassignReferencedItem (const ReferencedItem &, ProjectItemRef newRef, double newStartTime) override
 Should be implemented to change the underlying source to a new ProjectItemRef.
 
ClipPosition getPosition () const override
 Returns the ClipPosition on the parent Track.
 
BeatPosition getContentBeatAtTime (TimePosition) const
 Returns the beat number (with offset) at the given time.
 
TimePosition getTimeOfContentBeat (BeatPosition) const
 Returns time of a beat number.
 
virtual juce::Array< TimePositiongetInterestingTimes ()
 Returns times for snapping to, relative to the Edit.
 
TimePosition getSpottingPoint () const
 Returns the first marked time in the source file which can be used for syncronising newly added clips.
 
TimeRange getLoopRange () const
 Returns the loop range in seconds.
 
BeatRange getLoopRangeBeats () const
 Returns the loop range in beats.
 
virtual void setSyncType (SyncType sync)
 Sets the sync type for the clip.
 
SyncType getSyncType () const
 Returns the sync type clip is using.
 
void setPosition (ClipPosition newPosition)
 Sets the position of the clip.
 
void setStart (TimePosition newStart, bool preserveSync, bool keepLength)
 Sets the start time of the clip.
 
void setLength (TimeDuration newLength, bool preserveSync)
 Sets the length of the clip.
 
void setEnd (TimePosition newEnd, bool preserveSync)
 Sets the end of the clip.
 
void setOffset (TimeDuration newOffset)
 Sets the offset of the clip, i.e.
 
void trimAwayOverlap (TimeRange editRangeToTrim)
 Trims away any part of the clip that overlaps this region.
 
void removeFromParent ()
 Removes this clip from the parent track or container clip.
 
bool moveTo (ClipOwner &)
 Moves the clip to a new parent (if possible).
 
double getSpeedRatio () const noexcept
 Returns the speed ratio i.e.
 
virtual void rescale (TimePosition pivotTimeInEdit, double factor)
 stretches and scales this clip relative to a fixed point in the edit.
 
bool isGrouped () const override
 Returns true if the clip is part of a group.
 
TrackItemgetGroupParent () const override
 Returns the parent TrackItem if part of a group.
 
void setGroup (EditItemID newGroupID)
 Sets the clip to be part of a group.
 
EditItemID getGroupID () const noexcept
 Returns the ID of the group.
 
CollectionClipgetGroupClip () const
 Returns this as a CollectionClip if it is one.
 
bool isLinked () const
 Returns true if this clip is linked with any others.
 
void setLinkGroupID (juce::String newLinkID)
 Sets the link ID to link this clip with others.
 
juce::String getLinkGroupID () const
 Returns the link ID of this clip.
 
ClipOwnergetParent () const
 Returns the parent ClipOwner this clip is on.
 
ClipTrackgetClipTrack () const
 Returns the parent ClipTrack this clip is on (if any).
 
TrackgetTrack () const override
 Returns the parent Track this clip is on (if any).
 
ClipSlotgetClipSlot () const
 Returns the parent ClipSlot this clip is on (if any).
 
virtual juce::Colour getColour () const
 Returns the colour property of this clip.
 
void setColour (juce::Colour)
 Sets the colour property of this clip.
 
virtual void removePlugin (const Plugin::Ptr &)
 Removes the given plugin from the clip if the clip supports plugins.
 
virtual void clearTakes ()
 Clears any takes this clip has.
 
virtual bool hasAnyTakes () const
 Returns true if this clip has any takes.
 
virtual juce::StringArray getTakeDescriptions () const
 Returns the descriptions of any takes.
 
virtual void setCurrentTake (int)
 Sets a given take index to be the current take.
 
virtual int getCurrentTake () const
 Returns the current take index.
 
virtual int getNumTakes (bool)
 Returns the total number of takes.
 
virtual bool isCurrentTakeComp ()
 Returns true if the current take is a comp.
 
virtual void setShowingTakes (bool shouldShow)
 Sets whether the clip should be showing takes.
 
virtual bool isShowingTakes () const
 Returns true if the clip is showing takes.
 
virtual Clip::Array unpackTakes (bool)
 Attempts to unpack the takes to new clips.
 
void updateLinkedClips ()
 Triggers a call to cloneFrom for all clips with the same linkID.
 
AutomationCurveListgetAutomationCurveList (bool createIfNoItems)
 Returns an AutomationCurveList if this clip type supports it.
 
void addListener (Listener *)
 Adds a Listener.
 
void removeListener (Listener *)
 Removes a Listener.
 
juce::ListenerList< Listener > & getListeners ()
 Returns the listener list so Nodes can manually call them.
 
void changed () override
 
juce::UndoManager * getUndoManager () const
 Returns the UndoManager.
 
void updateAutomationCurveListDestinations ()
 
- Public Member Functions inherited from engine::TrackItem
 TrackItem (Edit &, EditItemID, Type)
 Creates a TrackItem with an ID and type.
 
 ~TrackItem ()
 Destructor.
 
TimeRange getEditTimeRange () const
 Returns the time range of this item.
 
BeatRange getEditBeatRange () const
 Returns the beat range of this item.
 
BeatPosition getStartBeat () const
 Returns the start beat in the Edit of this item.
 
BeatPosition getContentStartBeat () const
 Returns the start beat of the content in the Edit of this item.
 
BeatPosition getEndBeat () const
 Returns the end beat in the Edit of this item.
 
BeatDuration getLengthInBeats () const
 Returns the duration in beats the of this item.
 
TimePosition getTimeOfRelativeBeat (BeatDuration) const
 Returns an Edit time point for a given number of beats from the start of this item.
 
BeatPosition getBeatOfRelativeTime (TimeDuration) const
 Returns an Edit beat point for a given number of seconds from the start of this item.
 
BeatDuration getOffsetInBeats () const
 Returns an the offset of this item in beats.
 
EditItemID getTrackID () const
 Returns the ID of the Track this item lives on.
 
- Public Member Functions inherited from engine::EditItem
 EditItem (EditItemID, Edit &)
 
 EditItem (Edit &, const juce::ValueTree &)
 
virtual ~EditItem ()=default
 
- Public Member Functions inherited from engine::Selectable
 Selectable ()
 
virtual ~Selectable ()
 
virtual juce::String getSelectableDescription ()=0
 Subclasses must return a description of what they are.
 
virtual void selectableAboutToBeDeleted ()
 Called just before the selectable is about to be deleted so any subclasses should still be valid at this point.
 
void addListener (SelectableListener *)
 
void removeListener (SelectableListener *)
 
void addSelectableListener (SelectableListener *)
 
void removeSelectableListener (SelectableListener *)
 
void cancelAnyPendingUpdates ()
 If changed() has been called, this will cancel any pending async change notificaions.
 
void deselect ()
 
void propertiesChanged ()
 
void notifyListenersOfDeletion ()
 
WeakRef getWeakRef ()
 
- Public Member Functions inherited from engine::Exportable
virtual ~Exportable ()=default
 
- Public Member Functions inherited from engine::RenderManager::Job::Listener
virtual ~Listener ()
 
virtual void jobStarted (RenderManager::Job &)
 

Static Public Member Functions

static juce::StringArray getRootNoteChoices (Engine &)
 Returns an array of the root note choices e.g.
 
- Static Public Member Functions inherited from engine::Clip
static bool isClipState (const juce::ValueTree &)
 Checks whether a ValueTree is some kind of clip state.
 
static bool isClipState (const juce::Identifier &)
 Checks whether a ValueTree type is some kind of clip state.
 
static Ptr createClipForState (const juce::ValueTree &, ClipOwner &targetParent)
 Creates a clip for a given ValueTree representation.
 
- Static Public Member Functions inherited from engine::TrackItem
static const char * typeToString (Type)
 Returns the string version of a TrackItem::Type.
 
static juce::Identifier clipTypeToXMLType (Type)
 Returns an Identifier version of a TrackItem::Type.
 
static TrackItem::Type xmlTagToType (juce::StringRef)
 Returns the TrackItem::Type of a type string.
 
static TrackItem::Type stringToType (const juce::String &)
 Returns the TrackItem::Type of a type string.
 
static juce::String getSuggestedNameForNewItem (Type)
 Returns a text string for a new clip of the given type.
 
template<typename ArrayType >
static void sortByTime (ArrayType &items)
 Helper function to sort an array of TrackItem[s] by their start time.
 
template<typename ArrayType >
static void stableSortByTime (ArrayType &items)
 Helper function to sort an array of TrackItem[s] by their start time without changing the order of items at the same time.
 
- Static Public Member Functions inherited from engine::Selectable
static void initialise ()
 
static bool isSelectableValid (const Selectable *) noexcept
 checks whether this object has been deleted.
 
- Static Public Member Functions inherited from engine::Exportable
static juce::Array< Exportable * > addAllExportables (Edit &)
 Returns all the Exportables contained in an Edit.
 

Public Attributes

juce::CachedValue< TimeStretcher::ElastiqueProOptionselastiqueProOptions
 The ElastiqueProOptions for fine tuning Elastique (if available).
 
juce::CachedValue< juce::PluginDescription > araPluginDescription
 Stores the PluginDescription of the ARA plugin to use for this clip.
 
- Public Attributes inherited from engine::Clip
juce::CachedValue< FollowActionDurationTypefollowActionDurationType
 The type of duration to use for when to trigger the follow action.
 
juce::CachedValue< BeatDurationfollowActionBeats
 Determines the time for which a launched clip will play before a follow action is taken.
 
juce::CachedValue< doublefollowActionNumLoops
 Determines the number of loops for which a launched clip will play before a follow action is taken.
 
juce::ValueTree state
 The ValueTree of the Clip state.
 
juce::CachedValue< juce::Colour > colour
 The colour property.
 
juce::CachedValue< booldisabled
 Whether the Clip is disabled or not.
 
- Public Attributes inherited from engine::TrackItem
const Type type
 The type of this item.
 
- Public Attributes inherited from engine::EditItem
Editedit
 
const EditItemID itemID
 Every EditItem has an ID which is unique within the edit.
 
- Public Attributes inherited from engine::Selectable
WeakRef::Master masterReference
 

Protected Member Functions

void createNewProxyAsync ()
 Triggers a source or proxy render after a timeout.
 
void valueTreePropertyChanged (juce::ValueTree &, const juce::Identifier &) override
 
void valueTreeChildAdded (juce::ValueTree &parent, juce::ValueTree &) override
 
void valueTreeChildRemoved (juce::ValueTree &parent, juce::ValueTree &, int) override
 
void valueTreeChildOrderChanged (juce::ValueTree &, int, int) override
 
void valueTreeParentChanged (juce::ValueTree &) override
 
- Protected Member Functions inherited from engine::Clip
void setCurrentSourceFile (const juce::File &)
 Sets a new source file for this clip.
 
void valueTreePropertyChanged (juce::ValueTree &, const juce::Identifier &) override
 
void valueTreeChildRemoved (juce::ValueTree &, juce::ValueTree &, int) override
 
void valueTreeParentChanged (juce::ValueTree &) override
 

Protected Attributes

std::shared_ptr< ClipLevellevel { std::make_shared<ClipLevel>() }
 
std::shared_ptr< AudioClipPlayheadplayhead { std::make_shared<AudioClipPlayhead>() }
 
juce::CachedValue< juce::String > channels
 
juce::CachedValue< TimeDurationfadeIn
 
juce::CachedValue< TimeDurationfadeOut
 
TimeDuration autoFadeIn
 
TimeDuration autoFadeOut
 
juce::CachedValue< AudioFadeCurve::TypefadeInType
 
juce::CachedValue< AudioFadeCurve::TypefadeOutType
 
juce::CachedValue< boolautoCrossfade
 
juce::CachedValue< FadeBehaviourfadeInBehaviour
 
juce::CachedValue< FadeBehaviourfadeOutBehaviour
 
juce::CachedValue< ResamplingQualityresamplingQuality
 
juce::CachedValue< TimePositionloopStart
 
juce::CachedValue< TimeDurationloopLength
 
juce::CachedValue< BeatPositionloopStartBeats
 
juce::CachedValue< BeatDurationloopLengthBeats
 
juce::CachedValue< intproxyAllowed
 
juce::CachedValue< inttranspose
 
juce::CachedValue< floatpitchChange
 
LoopInfo loopInfo
 
juce::CachedValue< floatbeatSensitivity
 
juce::CachedValue< TimeStretcher::ModetimeStretchMode
 
juce::CachedValue< boolautoPitch
 
juce::CachedValue< boolautoTempo
 
juce::CachedValue< boolisReversed
 
juce::CachedValue< boolautoDetectBeats
 
juce::CachedValue< boolwarpTime
 
juce::CachedValue< boolclipEffectsVisible
 
juce::CachedValue< AutoPitchModeautoPitchMode
 
WarpTimeManager::Ptr warpTimeManager
 
std::unique_ptr< AudioSegmentListaudioSegmentList
 
std::unique_ptr< ClipEffectsclipEffects
 
AsyncFunctionCaller asyncFunctionCaller
 
PluginList pluginList
 
bool lastRenderJobFailed = false
 
RenderManager::Job::Ptr renderJob
 
AudioFile lastProxy
 
- Protected Attributes inherited from engine::Clip
bool isInitialised = false
 
bool cloneInProgress = false
 
juce::CachedValue< juce::String > clipName
 
ClipOwnerparent = nullptr
 
juce::CachedValue< TimePositionclipStart
 
juce::CachedValue< TimeDurationlength
 
juce::CachedValue< TimeDurationoffset
 
juce::CachedValue< doublespeedRatio
 
SourceFileReference sourceFileReference
 
juce::CachedValue< EditItemIDgroupID
 
juce::CachedValue< juce::String > linkID
 
juce::File currentSourceFile
 
juce::CachedValue< SyncTypesyncType
 
juce::CachedValue< boolshowingTakes
 
std::unique_ptr< PatternGeneratorpatternGenerator
 
std::unique_ptr< AutomationCurveListautomationCurveList
 
AsyncCaller updateLinkedClipsCaller
 
juce::ListenerList< Listenerlisteners
 

Detailed Description

Base class for Clips that produce some kind of audio e.g.

WaveAudioClip or EditClip. This class contains the common functionality such as gains, fades, plugins etc.

If your source if dynamically generated override needsRender to return true. This will then trigger the rest of the render callbacks which should be used to generate the source and fill in any update messages etc.

If your source is static override getAudioFile to return the source file. Note that this may be changed by the UI so it is a good idea to also overrride sourceMediaChanged and getSourceLength to update properties accordingly when the source ProjectItemID is re-assigned.

Either way you must override getHash which should return a hash of the current source e.g. an AudioFile hash or hash describing the current render set-up of an Edit.

Member Typedef Documentation

◆ Ptr

using engine::AudioClipBase::Ptr = juce::ReferenceCountedObjectPtr<AudioClipBase>

Member Enumeration Documentation

◆ FadeBehaviour

Describes the fade behaviour.

Enumerator
gainFade 

Fade is a volume/gain ramp.

speedRamp 

Fade is a change of playback speed for tape start/stop effects.

◆ AutoPitchMode

Defines the auto pitch mode.

Enumerator
pitchTrack 

Clip tracks the Edit's PitchSequence.

chordTrackMono 

Clip tracks the chord track with a monophonic pitch change.

chordTrackPoly 

Clip tracks the pitch track with a polyphonic pitch change.

◆ ClipDirection

Defines a prevous/next direction.

See also
getOverlappingClip
Enumerator
previous 
next 
none 

Constructor & Destructor Documentation

◆ AudioClipBase()

engine::AudioClipBase::AudioClipBase ( const juce::ValueTree &  ,
EditItemID  ,
Type  ,
ClipOwner  
)

Creates a basic AudioClip.

◆ ~AudioClipBase()

engine::AudioClipBase::~AudioClipBase ( )
override

Destructor.

Member Function Documentation

◆ getMaximumLength()

TimeDuration engine::AudioClipBase::getMaximumLength ( )
overridevirtual

Returns the maximum length for this clip.

This can change depending on the clips properties e.g. if the clip is timestretched then this will return a proportion of getSourceLength, if it is looped this will return infinite.

Reimplemented from engine::Clip.

◆ getSourceLength()

virtual TimeDuration engine::AudioClipBase::getSourceLength ( ) const
pure virtual

Must return the length in seconds of the source material e.g.

the length of the audio file or edit.

Implemented in engine::ContainerClip, engine::EditClip, and engine::WaveAudioClip.

◆ getAudioFile()

virtual AudioFile engine::AudioClipBase::getAudioFile ( ) const
virtual

Returns the file used to play back the source and will get proxied etc.

Reimplemented in engine::EditClip.

◆ getPlaybackFile()

AudioFile engine::AudioClipBase::getPlaybackFile ( )

Returns the current AudioFile being used by the Clip, either the original source or a proxy.

◆ getOriginalFile()

virtual juce::File engine::AudioClipBase::getOriginalFile ( ) const
pure virtual

Must return the file that the source ProjectItemID refers to.

Implemented in engine::ContainerClip, engine::EditClip, and engine::WaveAudioClip.

◆ getHash()

virtual HashCode engine::AudioClipBase::getHash ( ) const
pure virtual

Must return a unique hash for this clip's source.

This should be the same until the clip changes as it is used to determine if the proxy needs regenerating.

Implemented in engine::ContainerClip, engine::EditClip, and engine::WaveAudioClip.

◆ getWaveInfo()

virtual AudioFileInfo engine::AudioClipBase::getWaveInfo ( )
virtual

Returns the WaveInfo for a clip.

By default this just looks in the AudioSegmentList cache but subclasses can override this to return a custom WaveInfo if they don't reference source files..

Reimplemented in engine::EditClip.

◆ markAsDirty()

void engine::AudioClipBase::markAsDirty ( )

Resets the dirty flag so that a new render will be attempted.

Call this whenever one of your clips properties that will change the source file change. This flag is used to avoid constantly re-rendering failed sources.

◆ updateSourceFile()

void engine::AudioClipBase::updateSourceFile ( )

Checks the current source file to see if it's up to date and then triggers a source render if needed.

This uses the needsRender and getHash methods to determine the source file to be used. Call this if something changes that will affect the render e.g. tracks in an EditClip.

◆ requiresRenderingSource()

virtual bool engine::AudioClipBase::requiresRenderingSource ( ) const
virtual

Subclasses can override this to indicate that they need to render their source file, irrespective of their canUseProxy property.

Reimplemented in engine::EditClip.

◆ needsRender()

virtual bool engine::AudioClipBase::needsRender ( ) const
virtual

Subclasses should override this to return true if they need the rest of the render callbacks.

Reimplemented in engine::EditClip, and engine::WaveAudioClip.

◆ getRenderJob()

virtual RenderManager::Job::Ptr engine::AudioClipBase::getRenderJob ( const AudioFile )
virtual

Subclasses should override this to return a RenderJob suitable for rendering its source file.

Note that because we can only render one source this should also check to see if the source should be reversed and do so accordingly. This will be called on the message thread so should complete quickly, if your source needs some time consuming setup (e.g. loading Edits) then make sure your render job does this in its render thread.

Reimplemented in engine::EditClip, and engine::WaveAudioClip.

◆ renderComplete()

virtual void engine::AudioClipBase::renderComplete ( )
virtual

Callback to indicate that the render has completed.

If you override this, make sure to call the base class implementation first.

Reimplemented in engine::EditClip, and engine::WaveAudioClip.

◆ getRenderMessage()

virtual juce::String engine::AudioClipBase::getRenderMessage ( )
virtual

Override this to return a custom message to be displayed over waveforms during rendering.

This is called periodically once a render has started. Once you are done, this should return an empty string to let the AudioStripBase know to stop updating.

Reimplemented in engine::EditClip, and engine::WaveAudioClip.

◆ getClipMessage()

virtual juce::String engine::AudioClipBase::getClipMessage ( )
virtual

Override this to return a custom message to display over the clip where the "file missing" text usually goes.

Reimplemented in engine::EditClip.

◆ cancelCurrentRender()

void engine::AudioClipBase::cancelCurrentRender ( )

If a render is in progress, this will cancel it.

◆ setGainDB()

void engine::AudioClipBase::setGainDB ( float  dB)

Sets the gain of the clip in dB.

◆ getGainDB()

float engine::AudioClipBase::getGainDB ( ) const
noexcept

Returns the gain of the clip in dB.

◆ getGain()

float engine::AudioClipBase::getGain ( ) const
noexcept

Returns the gain of the clip.

References engine::dbToGain().

◆ setPan()

void engine::AudioClipBase::setPan ( float  pan)

Sets the pan of the clip.

Parameters
pan-1 = full left, 0 = centre, 1 = full right

◆ getPan()

float engine::AudioClipBase::getPan ( ) const
noexcept

Returns the pan of the clip from -1 to 1.

See also
setPan.

◆ setMuted()

void engine::AudioClipBase::setMuted ( bool  shouldBeMuted)
overridevirtual

Reimplemented from engine::Clip.

◆ isMuted()

bool engine::AudioClipBase::isMuted ( ) const
overridevirtual

Implements engine::Clip.

◆ getLiveClipLevel()

LiveClipLevel engine::AudioClipBase::getLiveClipLevel ( )

Returns a LiveClipLevel which can be used to read the gain, pan and mute statuses.

◆ getPlayhead()

std::shared_ptr< AudioClipPlayhead > engine::AudioClipBase::getPlayhead ( ) const
noexcept

Returns a shared playhead which is updated by the playback graph to track the current position being played within the clip's source file.

This can be used by the UI to draw a transport indicator over the clip's waveform.

◆ getSourceChannelConfiguration()

ChannelConfiguration engine::AudioClipBase::getSourceChannelConfiguration ( )

Returns the source file's channel configuration.

This represents all available channels in the source audio file.

◆ getActiveChannelConfiguration()

ChannelConfiguration engine::AudioClipBase::getActiveChannelConfiguration ( )

Returns which channels are active (selected for playback).

Only active channels will be played back.

◆ setActiveChannelConfiguration()

void engine::AudioClipBase::setActiveChannelConfiguration ( const ChannelConfiguration &  config)

Sets which channels are active for playback.

Parameters
configThe channel configuration to use for playback

◆ getOutputChannelConfiguration()

ChannelConfiguration engine::AudioClipBase::getOutputChannelConfiguration ( )

Returns the channel configuration output by this clip.

This considers clip effects and returns the final output channel layout. For now, this returns the same as getActiveChannelConfiguration().

◆ getActiveChannels()

juce::AudioChannelSet engine::AudioClipBase::getActiveChannels ( )

Returns the layout of the active channels as a JUCE AudioChannelSet.

Deprecated:
Use getActiveChannelConfiguration() instead.

◆ setFadeIn()

bool engine::AudioClipBase::setFadeIn ( TimeDuration  length)

Sets the fade in duration in seconds.

If the duration is longer than the clip or overlaps the fade out, this will reduce the fade out accordingly.

◆ getFadeIn()

TimeDuration engine::AudioClipBase::getFadeIn ( ) const

Returns the fade in duration in seconds.

◆ setFadeOut()

bool engine::AudioClipBase::setFadeOut ( TimeDuration  length)

Sets the fade out duration in seconds.

If the duration is longer than the clip or overlaps the fade in, this will reduce the fade in accordingly.

◆ getFadeOut()

TimeDuration engine::AudioClipBase::getFadeOut ( ) const

Returns the fade out duration in seconds.

◆ setFadeInType()

void engine::AudioClipBase::setFadeInType ( AudioFadeCurve::Type  )

Sets the curve shape for the fade in to use.

◆ getFadeInType()

AudioFadeCurve::Type engine::AudioClipBase::getFadeInType ( ) const

Returns the curve shape for the fade in to use.

◆ setFadeOutType()

void engine::AudioClipBase::setFadeOutType ( AudioFadeCurve::Type  newType)

Sets the curve shape for the fade out to use.

◆ getFadeOutType()

AudioFadeCurve::Type engine::AudioClipBase::getFadeOutType ( ) const

Returns the curve shape for the fade out to use.

◆ setAutoCrossfade()

void engine::AudioClipBase::setAutoCrossfade ( bool  shouldAutoCrossfade)

Enables/disables auto-crossfading.

When enabled, the fade in/out length will automatically be set to the length of any overlapping clip regions.

◆ getAutoCrossfade()

bool engine::AudioClipBase::getAutoCrossfade ( ) const
noexcept

Returns whether auto-crossfade is enabled.

◆ updateAutoCrossfadesAsync()

void engine::AudioClipBase::updateAutoCrossfadesAsync ( bool  updateOverlapped)

Triggers an update of the auto-crossfades.

N.B. you shouldn't normally need to call this, it's called by the AudioTrack when clips are moved.

Parameters
updateOverlappedIf true, this will also update any other clips that overlap this one.

◆ applyEdgeFades()

void engine::AudioClipBase::applyEdgeFades ( )

Sets the fade in/out lengths to be 0.03s to avoid any clicks at the start/end of th clip.

◆ copyFadeToAutomation()

void engine::AudioClipBase::copyFadeToAutomation ( bool  fadeIn,
bool  removeClipFade 
)

Copies the fade in curve to a volume automation curve.

Parameters
fadeInIf true, this copies the fade-in, if false, the fade-out
removeClipFadeIf true, the fade in will be set to 0
See also
setFadeIn

◆ setFadeInBehaviour()

void engine::AudioClipBase::setFadeInBehaviour ( FadeBehaviour  newBehaviour)

Sets the fade in behaviour.

◆ getFadeInBehaviour()

FadeBehaviour engine::AudioClipBase::getFadeInBehaviour ( ) const

Returns the fade in behaviour.

◆ setFadeOutBehaviour()

void engine::AudioClipBase::setFadeOutBehaviour ( FadeBehaviour  newBehaviour)

Sets the fade out behaviour.

◆ getFadeOutBehaviour()

FadeBehaviour engine::AudioClipBase::getFadeOutBehaviour ( ) const

Returns the fade out behaviour.

◆ setLoopDefaults()

virtual void engine::AudioClipBase::setLoopDefaults ( )
pure virtual

Override this to fill in the LoopInfo structure as best fits the source.

Implemented in engine::ContainerClip, engine::EditClip, and engine::WaveAudioClip.

◆ setLoopInfo()

void engine::AudioClipBase::setLoopInfo ( const LoopInfo )

Sets a LoopInfo to describe this clip's tempo, time sig etc.

which is used when syncing to the TempoSequence and PitchSequence.

See also
LoopInfo.

◆ getLoopInfo() [1/2]

const LoopInfo & engine::AudioClipBase::getLoopInfo ( ) const

Returns the LoopInfo being used to describe this clip.

◆ getLoopInfo() [2/2]

LoopInfo & engine::AudioClipBase::getLoopInfo ( )

Returns the LoopInfo being used to describe this clip.

◆ getLoopRange()

TimeRange engine::AudioClipBase::getLoopRange ( ) const

Returns the loop range in seconds.

◆ canLoop()

bool engine::AudioClipBase::canLoop ( ) const
overridevirtual

Reimplemented from engine::Clip.

◆ isLooping()

bool engine::AudioClipBase::isLooping ( ) const
overridevirtual

Reimplemented from engine::Clip.

◆ beatBasedLooping()

bool engine::AudioClipBase::beatBasedLooping ( ) const
overridevirtual

Reimplemented from engine::Clip.

◆ setNumberOfLoops()

void engine::AudioClipBase::setNumberOfLoops ( int  num)
overridevirtual

Reimplemented from engine::Clip.

◆ disableLooping()

void engine::AudioClipBase::disableLooping ( )
overridevirtual

Reimplemented from engine::Clip.

◆ getLoopStartBeats()

BeatPosition engine::AudioClipBase::getLoopStartBeats ( ) const
overridevirtual

Reimplemented from engine::Clip.

◆ getLoopStart()

TimePosition engine::AudioClipBase::getLoopStart ( ) const
overridevirtual

Reimplemented from engine::Clip.

◆ getLoopLengthBeats()

BeatDuration engine::AudioClipBase::getLoopLengthBeats ( ) const
overridevirtual

Reimplemented from engine::Clip.

◆ getLoopLength()

TimeDuration engine::AudioClipBase::getLoopLength ( ) const
overridevirtual

Reimplemented from engine::Clip.

◆ setLoopRange()

void engine::AudioClipBase::setLoopRange ( TimeRange  )
overridevirtual

Reimplemented from engine::Clip.

◆ setLoopRangeBeats()

void engine::AudioClipBase::setLoopRangeBeats ( BeatRange  )
overridevirtual

Reimplemented from engine::Clip.

Reimplemented in engine::ContainerClip.

◆ setAutoDetectBeats()

void engine::AudioClipBase::setAutoDetectBeats ( bool  )

Enables auto-detection of beats.

If this is true the LoopInfo will be set based on what beats were detected. This will aso updat eif the sensitivity is changed

See also
setBeatSensitivity. [[ blocks ]]

◆ getAutoDetectBeats()

bool engine::AudioClipBase::getAutoDetectBeats ( ) const

Returns true if auto-detect of beats is enabled.

◆ setBeatSensitivity()

void engine::AudioClipBase::setBeatSensitivity ( float  s)

Sets the beat sensitivity, triggering a LoopInfo update if auto-detect is enabled.

See also
setAutoDetectBeats

◆ getBeatSensitivity()

float engine::AudioClipBase::getBeatSensitivity ( ) const

Returns the beat sensitivity.

◆ pitchTempoTrackChanged()

void engine::AudioClipBase::pitchTempoTrackChanged ( )
overridevirtual

Reimplemented from engine::Clip.

Reimplemented in engine::ContainerClip.

◆ setSpeedRatio()

void engine::AudioClipBase::setSpeedRatio ( double  newSpeed)
overridevirtual

Reimplemented from engine::Clip.

◆ setTimeStretchMode()

void engine::AudioClipBase::setTimeStretchMode ( TimeStretcher::Mode  mode)

Sets a time-stretch mode to use.

◆ getTimeStretchMode()

TimeStretcher::Mode engine::AudioClipBase::getTimeStretchMode ( ) const
noexcept

Returns the time-stretch mode that has been set.

◆ getActualTimeStretchMode()

TimeStretcher::Mode engine::AudioClipBase::getActualTimeStretchMode ( ) const
noexcept

Returns the time-stretch mode that is in use.

Note that even if not time-stretch mode has been set e.g. for speed changes, if auto-pitch or auto-tempo is enabled, a time-stretch mode will have to be used and this returns it.

◆ setAutoTempo()

void engine::AudioClipBase::setAutoTempo ( bool  shouldUseAutoTempo)

Enables/disables auto-tempo.

If enabled, this clip will adjust its playback speed to stay in sync with the Edit's TempoSequence.

◆ getAutoTempo()

bool engine::AudioClipBase::getAutoTempo ( ) const

Returns true if auto-tempo has been set.

◆ setAutoPitch()

void engine::AudioClipBase::setAutoPitch ( bool  shouldUseAutoPitch)

Enables/disables auto-pitch.

If enabled, this clip will adjust its playback pitch to stay in sync with the Edit's PitchSequence.

◆ getAutoPitch()

bool engine::AudioClipBase::getAutoPitch ( ) const

Returns true if auto-pitch has been set.

◆ setAutoPitchMode()

void engine::AudioClipBase::setAutoPitchMode ( AutoPitchMode  m)

Sets the AutoPitchMode to use.

◆ getAutoPitchMode()

AutoPitchMode engine::AudioClipBase::getAutoPitchMode ( )

Returns the AutoPitchMode in use.

◆ setWarpTime()

void engine::AudioClipBase::setWarpTime ( bool  shouldUseWarpTime)

Enables/disables warp time.

Warp Time enables segmented warping of the audio.

See also
WarpTimeManager

◆ getWarpTime()

bool engine::AudioClipBase::getWarpTime ( ) const

Returns true if warp time is enabled.

◆ getWarpTimeManager()

WarpTimeManager & engine::AudioClipBase::getWarpTimeManager ( ) const

Returns the WarpTimeManager for this clip used to maipluate warp markers.

◆ setTranspose()

void engine::AudioClipBase::setTranspose ( int  numSemitones)

Sets the number of semitones to transpose the clip by.

◆ getTransposeSemiTones()

int engine::AudioClipBase::getTransposeSemiTones ( bool  includeAutoPitch) const

Returns the number of semitones this clip will be changed by.

N.B. this is used if auto-pitch is enabled.

Parameters
includeAutoPitchIf true, this will include the changes defined by auto-pitch. If false, this will only be the number explicitly set in setTranspose

◆ setPitchChange()

void engine::AudioClipBase::setPitchChange ( float  semitones)

Sets the number of semitones to transpose the clip by.

N.B. this is only used if auto-pitch is disabled.

◆ getPitchChange()

float engine::AudioClipBase::getPitchChange ( ) const

Returns the number of semitones to transpose the clip by.

◆ getPitchRatio()

float engine::AudioClipBase::getPitchRatio ( ) const

Returns the pitch change as a normalised ratio.

0 = no change, <0 = pitched down, >0 = pitched up.

◆ setIsReversed()

void engine::AudioClipBase::setIsReversed ( bool  shouldBeReversed)

Enables reversing of the clip's source material.

◆ getIsReversed()

bool engine::AudioClipBase::getIsReversed ( ) const
noexcept

Returns true if the clip's source material is reversed.

◆ autoDetectBeatMarkers()

LoopInfo engine::AudioClipBase::autoDetectBeatMarkers ( const LoopInfo current,
bool  autoBeat,
float  sensitivity 
) const

Scans the current source file for any beats and adds them to the LoopInfo returned.

Parameters
currentA LoopInfo to initialise the result from
autoBeatWhether to auto detect the beats from the source file
sensitivityThe sensitivity to use 0-1 [[ blocks ]]

◆ performTempoDetect()

bool engine::AudioClipBase::performTempoDetect ( )

Performs a tempo-detection task and if successful sets the clip's LoopInfo tempo to this.

Returns
true if the tempo was sensibly detected [[ blocks ]]

◆ getRootNoteChoices()

static juce::StringArray engine::AudioClipBase::getRootNoteChoices ( Engine )
static

Returns an array of the root note choices e.g.

"C#" etc.

◆ getPitchChoices()

juce::StringArray engine::AudioClipBase::getPitchChoices ( )

Returns an array describng what pitch each semitone change will be.

◆ canHaveEffects()

virtual bool engine::AudioClipBase::canHaveEffects ( ) const
virtual

Returns true if this clip can have ClipEffects added to it.

Reimplemented in engine::EditClip.

◆ enableEffects()

void engine::AudioClipBase::enableEffects ( bool  enable,
bool  warn 
)

Enables/disables ClipEffects for this clip.

Parameters
enableWhether to turn on/off clip FX for this clip
warnIf true and clip FX are enabled, this will show a confirmation dialog to the user first

◆ effectsEnabled()

bool engine::AudioClipBase::effectsEnabled ( ) const

Returns true if ClipEffects are enabled.

◆ addEffect()

void engine::AudioClipBase::addEffect ( const juce::ValueTree &  effectsTree)

Adds a ClipEffect to this clip.

◆ setEffectsVisible()

void engine::AudioClipBase::setEffectsVisible ( bool  b)

Sets the effectsVisible flag for this clip.

◆ getEffectsVisible()

bool engine::AudioClipBase::getEffectsVisible ( ) const

Returns true if the effectsVisible flag is set for this clip.

◆ getClipEffects()

ClipEffects * engine::AudioClipBase::getClipEffects ( ) const
noexcept

Returns the ClipEffects for this clip if it has been enabled.

◆ canSnapToOriginalBWavTime()

bool engine::AudioClipBase::canSnapToOriginalBWavTime ( )

Returns true if source file has a bwav time reference metadata property.

◆ snapToOriginalBWavTime()

void engine::AudioClipBase::snapToOriginalBWavTime ( )

Moves the clip to the bwav time reference metadata property time.

◆ getTakes()

virtual juce::Array< ProjectItemRef > engine::AudioClipBase::getTakes ( ) const
virtual

Returns the ProjectItemRefs of the clip's takes.

Reimplemented in engine::WaveAudioClip.

◆ canAddClipPlugin()

juce::String engine::AudioClipBase::canAddClipPlugin ( const Plugin::Ptr ) const

Returns an empty string if this plugin can be added, otherwise an error message due to the clip plugin being an incorrect type (e.g.

MIDI) or the list is full.

◆ isUsingFile()

virtual bool engine::AudioClipBase::isUsingFile ( const AudioFile )
virtual

Should return true if the clip is referencing the file in any way.

Reimplemented in engine::ContainerClip, engine::WaveAudioClip, and engine::EditClip.

◆ getProxyFileToCreate()

AudioFile engine::AudioClipBase::getProxyFileToCreate ( bool  renderTimestretched)

Returns the AudioFile to create to play this clip back.

Parameters
renderTimestretchedIf true, this should be a time-stretched version of the clip
See also
setAutoTempo

◆ setUsesProxy()

void engine::AudioClipBase::setUsesProxy ( bool  canUseProxy)
noexcept

Can be used to disable proxy file generation for this clip.

If disabled, the audio engine will time-stretch the file in real time which may use more CPU.

◆ canUseProxy()

bool engine::AudioClipBase::canUseProxy ( ) const
noexcept

Retuns true if this clip can use a proxy file.

◆ usesTimeStretchedProxy()

bool engine::AudioClipBase::usesTimeStretchedProxy ( ) const

Retuns true if this clip use a proxy file due to timestretching.

This can be because auto-tempo, auto-pitch or a pitch change has been set.

◆ createProxyRenderingInfo()

std::unique_ptr< ProxyRenderingInfo > engine::AudioClipBase::createProxyRenderingInfo ( )

Creates a ProxyRenderingInfo object to decribe the stretch segements of this clip.

◆ getProxyHash()

HashCode engine::AudioClipBase::getProxyHash ( )

Returns a hash identifying the proxy settings.

◆ beginRenderingNewProxyIfNeeded()

void engine::AudioClipBase::beginRenderingNewProxyIfNeeded ( )

Triggers creation of a new proxy file if one is required.

◆ getAudioSegmentList()

const AudioSegmentList & engine::AudioClipBase::getAudioSegmentList ( )

Returns an AudioSegmentList describing this file if it is using auto-tempo.

This can be useful for drawing waveforms. [[ message_thread ]]

◆ setResamplingQuality()

void engine::AudioClipBase::setResamplingQuality ( ResamplingQuality  )

Sets the resampling qulity to use.

This is only applicable if setUsesProxy has been set to false. If a proxy is used, Lagrange interpolation will be used. N.B. the higher the quality, the more higher the CPU usage during playback.

◆ getResamplingQuality()

ResamplingQuality engine::AudioClipBase::getResamplingQuality ( ) const

Returns the resampling quality to the be used.

◆ reverseLoopPoints()

void engine::AudioClipBase::reverseLoopPoints ( )

Reverses the loop points to expose the same section of the source file but reversed.

◆ checkFadeLengthsForOverrun()

void engine::AudioClipBase::checkFadeLengthsForOverrun ( )

Trims the fade in out lengths to avoid any overlap between them.

◆ getOverlappingClip()

AudioClipBase * engine::AudioClipBase::getOverlappingClip ( ClipDirection  ) const

Returns the previous/next overlapping clip if one exists.

◆ captureARAStateToValueTree()

void engine::AudioClipBase::captureARAStateToValueTree ( )

Stores the ARA plugin's current edits (e.g.

Melodyne notes) as an archive in the clip's state tree, so they can be restored by setupARA() after the clip is re-created (undo of a deletion, switching ARA mode off and on, etc).

◆ tearDownARA()

void engine::AudioClipBase::tearDownARA ( )

Releases the ARA proxy.

Called during track destruction to ensure ARA cleanup happens while the track is still alive.

◆ getARAProxy()

juce::ReferenceCountedObjectPtr< ARAFileReader > engine::AudioClipBase::getARAProxy ( ) const

Returns the ARAFileReader proxy if this clip is using an ARA plugin (e.g.

Melodyne).

◆ getMelodyneProxy()

juce::ReferenceCountedObjectPtr< ARAFileReader > engine::AudioClipBase::getMelodyneProxy ( ) const

◆ isUsingARA()

bool engine::AudioClipBase::isUsingARA ( ) const

Returns true if this clip is using an ARA plugin.

◆ selectionStatusChanged()

void engine::AudioClipBase::selectionStatusChanged ( bool  isNowSelected)
overridevirtual

Keeps the ARA plugin's editor view following the arrangement selection.

Reimplemented from engine::Selectable.

◆ getHead()

TimeDuration engine::AudioClipBase::getHead ( ) const
overridevirtual

Returns extra time before the clip start that needs processing (e.g., ARA head time).

Reimplemented from engine::Clip.

◆ getTail()

TimeDuration engine::AudioClipBase::getTail ( ) const
overridevirtual

Returns extra time after the clip end that needs processing (e.g., ARA tail time).

Reimplemented from engine::Clip.

◆ isUsingMelodyne()

bool engine::AudioClipBase::isUsingMelodyne ( ) const

◆ loadARAState()

void engine::AudioClipBase::loadARAState ( )

◆ loadMelodyneState()

void engine::AudioClipBase::loadMelodyneState ( )

◆ setupARA()

bool engine::AudioClipBase::setupARA ( bool  dontPopupErrorMessages)

This internal method is used solely to find out if createAudioNode() should return nullptr or not.

Though a bit spaghetti, the ARA node generation will be handled elsewhere, the parent AudioTrack, for the sake of live-play.

Returns
False if something went wrong!
     It's possible no ARA-compatible plugins were found,
     or that ARA complained about something resulting
     in failure to set it up accordingly.

◆ initialise()

void engine::AudioClipBase::initialise ( )
overridevirtual

Reimplemented from engine::Clip.

Reimplemented in engine::ContainerClip, engine::EditClip, and engine::WaveAudioClip.

◆ cloneFrom()

void engine::AudioClipBase::cloneFrom ( Clip )
overridevirtual

Reimplemented from engine::Clip.

Reimplemented in engine::ContainerClip, engine::EditClip, and engine::WaveAudioClip.

◆ flushStateToValueTree()

void engine::AudioClipBase::flushStateToValueTree ( )
overridevirtual

Reimplemented from engine::Clip.

Reimplemented in engine::ContainerClip.

◆ setParent()

void engine::AudioClipBase::setParent ( ClipOwner )
overridevirtual

Reimplemented from engine::Clip.

◆ canBeAddedTo()

bool engine::AudioClipBase::canBeAddedTo ( ClipOwner )
overridevirtual

Implements engine::Clip.

◆ changed()

void engine::AudioClipBase::changed ( )
overridevirtual

Reimplemented from engine::Selectable.

Reimplemented in engine::EditClip.

◆ getDefaultColour()

juce::Colour engine::AudioClipBase::getDefaultColour ( ) const
overridevirtual

Implements engine::Clip.

◆ getPatternGenerator()

PatternGenerator * engine::AudioClipBase::getPatternGenerator ( )
overridevirtual

Reimplemented from engine::Clip.

◆ addMark()

void engine::AudioClipBase::addMark ( TimePosition  relCursorPos)

◆ moveMarkTo()

void engine::AudioClipBase::moveMarkTo ( TimePosition  relCursorPos)

◆ deleteMark()

void engine::AudioClipBase::deleteMark ( TimePosition  relCursorPos)

◆ getRescaledMarkPoints() [1/2]

void engine::AudioClipBase::getRescaledMarkPoints ( juce::Array< TimePosition > &  rescaled,
juce::Array< int > &  orig 
) const

◆ getRescaledMarkPoints() [2/2]

juce::Array< TimePosition > engine::AudioClipBase::getRescaledMarkPoints ( ) const
overridevirtual

Reimplemented from engine::Clip.

◆ getReferencedItems()

juce::Array< ReferencedItem > engine::AudioClipBase::getReferencedItems ( )
overridevirtual

Implements engine::Exportable.

◆ reassignReferencedItem()

void engine::AudioClipBase::reassignReferencedItem ( const ReferencedItem ,
ProjectItemRef  newRef,
double  newStartTime 
)
overridevirtual

Implements engine::Exportable.

Reimplemented in engine::WaveAudioClip.

◆ getLaunchHandle()

std::shared_ptr< LaunchHandle > engine::AudioClipBase::getLaunchHandle ( )
overridevirtual

Reimplemented from engine::Clip.

◆ setUsesGlobalLaunchQuatisation()

void engine::AudioClipBase::setUsesGlobalLaunchQuatisation ( bool  useGlobal)
overridevirtual

Reimplemented from engine::Clip.

◆ usesGlobalLaunchQuatisation()

bool engine::AudioClipBase::usesGlobalLaunchQuatisation ( )
overridevirtual

Reimplemented from engine::Clip.

◆ getLaunchQuantisation()

LaunchQuantisation * engine::AudioClipBase::getLaunchQuantisation ( )
overridevirtual

Reimplemented from engine::Clip.

◆ getFollowActions()

FollowActions * engine::AudioClipBase::getFollowActions ( )
overridevirtual

Reimplemented from engine::Clip.

◆ addClipPlugin()

bool engine::AudioClipBase::addClipPlugin ( const Plugin::Ptr ,
SelectionManager  
)
overridevirtual

Reimplemented from engine::Clip.

◆ getAllPlugins()

Plugin::Array engine::AudioClipBase::getAllPlugins ( )
overridevirtual

Reimplemented from engine::Clip.

◆ sendMirrorUpdateToAllPlugins()

void engine::AudioClipBase::sendMirrorUpdateToAllPlugins ( Plugin ) const
overridevirtual

Reimplemented from engine::Clip.

◆ getPluginList()

PluginList * engine::AudioClipBase::getPluginList ( )
overridevirtual

Reimplemented from engine::Clip.

◆ createNewProxyAsync()

void engine::AudioClipBase::createNewProxyAsync ( )
protected

Triggers a source or proxy render after a timeout.

Call this if something changes that may affect either the source or the proxy e.g. Edit clip tracks or tempo sequence.

◆ valueTreePropertyChanged()

void engine::AudioClipBase::valueTreePropertyChanged ( juce::ValueTree &  ,
const juce::Identifier &   
)
overrideprotected

◆ valueTreeChildAdded()

void engine::AudioClipBase::valueTreeChildAdded ( juce::ValueTree &  parent,
juce::ValueTree &   
)
overrideprotected

◆ valueTreeChildRemoved()

void engine::AudioClipBase::valueTreeChildRemoved ( juce::ValueTree &  parent,
juce::ValueTree &  ,
int   
)
overrideprotected

◆ valueTreeChildOrderChanged()

void engine::AudioClipBase::valueTreeChildOrderChanged ( juce::ValueTree &  ,
int  ,
int   
)
overrideprotected

◆ valueTreeParentChanged()

void engine::AudioClipBase::valueTreeParentChanged ( juce::ValueTree &  )
overrideprotected

Member Data Documentation

◆ elastiqueProOptions

juce::CachedValue<TimeStretcher::ElastiqueProOptions> engine::AudioClipBase::elastiqueProOptions

The ElastiqueProOptions for fine tuning Elastique (if available).

◆ araPluginDescription

juce::CachedValue<juce::PluginDescription> engine::AudioClipBase::araPluginDescription

Stores the PluginDescription of the ARA plugin to use for this clip.

◆ level

std::shared_ptr<ClipLevel> engine::AudioClipBase::level { std::make_shared<ClipLevel>() }
protected

◆ playhead

std::shared_ptr<AudioClipPlayhead> engine::AudioClipBase::playhead { std::make_shared<AudioClipPlayhead>() }
protected

◆ channels

juce::CachedValue<juce::String> engine::AudioClipBase::channels
protected

◆ fadeIn

juce::CachedValue<TimeDuration> engine::AudioClipBase::fadeIn
protected

◆ fadeOut

juce::CachedValue<TimeDuration> engine::AudioClipBase::fadeOut
protected

◆ autoFadeIn

TimeDuration engine::AudioClipBase::autoFadeIn
protected

◆ autoFadeOut

TimeDuration engine::AudioClipBase::autoFadeOut
protected

◆ fadeInType

juce::CachedValue<AudioFadeCurve::Type> engine::AudioClipBase::fadeInType
protected

◆ fadeOutType

juce::CachedValue<AudioFadeCurve::Type> engine::AudioClipBase::fadeOutType
protected

◆ autoCrossfade

juce::CachedValue<bool> engine::AudioClipBase::autoCrossfade
protected

◆ fadeInBehaviour

juce::CachedValue<FadeBehaviour> engine::AudioClipBase::fadeInBehaviour
protected

◆ fadeOutBehaviour

juce::CachedValue<FadeBehaviour> engine::AudioClipBase::fadeOutBehaviour
protected

◆ resamplingQuality

juce::CachedValue<ResamplingQuality> engine::AudioClipBase::resamplingQuality
protected

◆ loopStart

juce::CachedValue<TimePosition> engine::AudioClipBase::loopStart
protected

◆ loopLength

juce::CachedValue<TimeDuration> engine::AudioClipBase::loopLength
protected

◆ loopStartBeats

juce::CachedValue<BeatPosition> engine::AudioClipBase::loopStartBeats
protected

◆ loopLengthBeats

juce::CachedValue<BeatDuration> engine::AudioClipBase::loopLengthBeats
protected

◆ proxyAllowed

juce::CachedValue<int> engine::AudioClipBase::proxyAllowed
protected

◆ transpose

juce::CachedValue<int> engine::AudioClipBase::transpose
protected

◆ pitchChange

juce::CachedValue<float> engine::AudioClipBase::pitchChange
protected

◆ loopInfo

LoopInfo engine::AudioClipBase::loopInfo
protected

◆ beatSensitivity

juce::CachedValue<float> engine::AudioClipBase::beatSensitivity
protected

◆ timeStretchMode

juce::CachedValue<TimeStretcher::Mode> engine::AudioClipBase::timeStretchMode
protected

◆ autoPitch

juce::CachedValue<bool> engine::AudioClipBase::autoPitch
protected

◆ autoTempo

juce::CachedValue<bool> engine::AudioClipBase::autoTempo
protected

◆ isReversed

juce::CachedValue<bool> engine::AudioClipBase::isReversed
protected

◆ autoDetectBeats

juce::CachedValue<bool> engine::AudioClipBase::autoDetectBeats
protected

◆ warpTime

juce::CachedValue<bool> engine::AudioClipBase::warpTime
protected

◆ clipEffectsVisible

juce::CachedValue<bool> engine::AudioClipBase::clipEffectsVisible
protected

◆ autoPitchMode

juce::CachedValue<AutoPitchMode> engine::AudioClipBase::autoPitchMode
protected

◆ warpTimeManager

WarpTimeManager::Ptr engine::AudioClipBase::warpTimeManager
mutableprotected

◆ audioSegmentList

std::unique_ptr<AudioSegmentList> engine::AudioClipBase::audioSegmentList
mutableprotected

◆ clipEffects

std::unique_ptr<ClipEffects> engine::AudioClipBase::clipEffects
protected

◆ asyncFunctionCaller

AsyncFunctionCaller engine::AudioClipBase::asyncFunctionCaller
mutableprotected

◆ pluginList

PluginList engine::AudioClipBase::pluginList
protected

◆ lastRenderJobFailed

bool engine::AudioClipBase::lastRenderJobFailed = false
protected

◆ renderJob

RenderManager::Job::Ptr engine::AudioClipBase::renderJob
protected

◆ lastProxy

AudioFile engine::AudioClipBase::lastProxy
protected

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