TracktionEngine
Classes | Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | List of all members
tracktion::engine::AudioClipBase Class Referenceabstract

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

Inheritance diagram for tracktion::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 tracktion::engine::Clip
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 tracktion::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 tracktion::engine::Selectable
using WeakRef = juce::WeakReference< Selectable >
 

Public Member Functions

 AudioClipBase (const juce::ValueTree &, EditItemID, Type, ClipOwner &)
 Creates a basic AudioClip. More...
 
 ~AudioClipBase () override
 Destructor. More...
 
TimeDuration getMaximumLength () override
 Returns the maximum length for this clip. More...
 
virtual TimeDuration getSourceLength () const =0
 Must return the length in seconds of the source material e.g. More...
 
virtual AudioFile getAudioFile () const
 Returns the file used to play back the source and will get proxied etc. More...
 
AudioFile getPlaybackFile ()
 Returns the current AudioFile being used by the Clip, either the original source or a proxy. More...
 
virtual juce::File getOriginalFile () const =0
 Must return the file that the source ProjectItemID refers to. More...
 
virtual HashCode getHash () const =0
 Must return a unique hash for this clip's source. More...
 
virtual AudioFileInfo getWaveInfo ()
 Returns the WaveInfo for a clip. More...
 
void markAsDirty ()
 Resets the dirty flag so that a new render will be attempted. More...
 
void updateSourceFile ()
 Checks the current source file to see if it's up to date and then triggers a source render if needed. More...
 
virtual bool needsRender () const
 Subclasses should override this to return true if they need the rest of the render callbacks. More...
 
virtual RenderManager::Job::Ptr getRenderJob (const AudioFile &)
 Subclasses should override this to return a RenderJob suitable for rendering its source file. More...
 
virtual void renderComplete ()
 Callback to indicate that the render has completed. More...
 
virtual juce::String getRenderMessage ()
 Override this to return a custom message to be displayed over waveforms during rendering. More...
 
virtual juce::String getClipMessage ()
 Override this to return a custom message to display over the clip where the "file missing" text usually goes. More...
 
void cancelCurrentRender ()
 If a render is in progress, this will cancel it. More...
 
void setGainDB (float dB)
 Sets the gain of the clip in dB. More...
 
float getGainDB () const noexcept
 Returns the gain of the clip in dB. More...
 
float getGain () const noexcept
 Returns the gain of the clip. More...
 
void setPan (float pan)
 Sets the pan of the clip. More...
 
float getPan () const noexcept
 Returns the pan of the clip from -1 to 1. More...
 
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. More...
 
void setLeftChannelActive (bool)
 Enables the left channel of the clip. More...
 
bool isLeftChannelActive () const
 Returns whether the left channel of the clip is enabled. More...
 
void setRightChannelActive (bool)
 Enables the right channel of the clip. More...
 
bool isRightChannelActive () const
 Returns whether the right channel of the clip is enabled. More...
 
juce::AudioChannelSet getActiveChannels () const
 Returns the layout of the active channels. More...
 
bool setFadeIn (TimeDuration length)
 Sets the fade in duration in seconds. More...
 
TimeDuration getFadeIn () const
 Returns the fade in duration in seconds. More...
 
bool setFadeOut (TimeDuration length)
 Sets the fade out duration in seconds. More...
 
TimeDuration getFadeOut () const
 Returns the fade out duration in seconds. More...
 
void setFadeInType (AudioFadeCurve::Type)
 Sets the curve shape for the fade in to use. More...
 
AudioFadeCurve::Type getFadeInType () const
 Returns the curve shape for the fade in to use. More...
 
void setFadeOutType (AudioFadeCurve::Type newType)
 Sets the curve shape for the fade out to use. More...
 
AudioFadeCurve::Type getFadeOutType () const
 Returns the curve shape for the fade out to use. More...
 
void setAutoCrossfade (bool shouldAutoCrossfade)
 Enables/disables auto-crossfading. More...
 
bool getAutoCrossfade () const noexcept
 Returns whether auto-crossfade is enabled. More...
 
void updateAutoCrossfadesAsync (bool updateOverlapped)
 Triggers an update of the auto-crossfades. More...
 
void applyEdgeFades ()
 Sets the fade in/out lengths to be 0.03s to avoid any clicks at the start/end of th clip. More...
 
void copyFadeToAutomation (bool fadeIn, bool removeClipFade)
 Copies the fade in curve to a volume automation curve. More...
 
void setFadeInBehaviour (FadeBehaviour newBehaviour)
 Sets the fade in behaviour. More...
 
FadeBehaviour getFadeInBehaviour () const
 Returns the fade in behaviour. More...
 
void setFadeOutBehaviour (FadeBehaviour newBehaviour)
 Sets the fade out behaviour. More...
 
FadeBehaviour getFadeOutBehaviour () const
 Returns the fade out behaviour. More...
 
virtual void setLoopDefaults ()=0
 Override this to fill in the LoopInfo structure as best fits the source. More...
 
void setLoopInfo (const LoopInfo &)
 Sets a LoopInfo to describe this clip's tempo, time sig etc. More...
 
const LoopInfogetLoopInfo () const
 Returns the LoopInfo being used to describe this clip. More...
 
LoopInfogetLoopInfo ()
 Returns the LoopInfo being used to describe this clip. More...
 
TimeRange getLoopRange () const
 Returns the loop range in seconds. More...
 
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. More...
 
bool getAutoDetectBeats () const
 Returns true if auto-detect of beats is enabled. More...
 
void setBeatSensitivity (float s)
 Sets the beat sensitivity, triggering a LoopInfo update if auto-detect is enabled. More...
 
float getBeatSensitivity () const
 Returns the beat sensitivity. More...
 
void pitchTempoTrackChanged () override
 
void setSpeedRatio (double newSpeed) override
 
void setTimeStretchMode (TimeStretcher::Mode mode)
 Sets a time-stretch mode to use. More...
 
TimeStretcher::Mode getTimeStretchMode () const noexcept
 Returns the time-stretch mode that has been set. More...
 
TimeStretcher::Mode getActualTimeStretchMode () const noexcept
 Returns the time-stretch mode that is in use. More...
 
void setAutoTempo (bool shouldUseAutoTempo)
 Enables/disables auto-tempo. More...
 
bool getAutoTempo () const
 Returns true if auto-tempo has been set. More...
 
void setAutoPitch (bool shouldUseAutoPitch)
 Enables/disables auto-pitch. More...
 
bool getAutoPitch () const
 Returns true if auto-pitch has been set. More...
 
void setAutoPitchMode (AutoPitchMode m)
 Sets the AutoPitchMode to use. More...
 
AutoPitchMode getAutoPitchMode ()
 Returns the AutoPitchMode in use. More...
 
void setWarpTime (bool shouldUseWarpTime)
 Enables/disables warp time. More...
 
bool getWarpTime () const
 Returns true if warp time is enabled. More...
 
WarpTimeManagergetWarpTimeManager () const
 Returns the WarpTimeManager for this clip used to maipluate warp markers. More...
 
void setTranspose (int numSemitones)
 Sets the number of semitones to transpose the clip by. More...
 
int getTransposeSemiTones (bool includeAutoPitch) const
 Returns the number of semitones this clip will be changed by. More...
 
void setPitchChange (float semitones)
 Sets the number of semitones to transpose the clip by. More...
 
float getPitchChange () const
 Returns the number of semitones to transpose the clip by. More...
 
float getPitchRatio () const
 Returns the pitch change as a normalised ratio. More...
 
void setIsReversed (bool shouldBeReversed)
 Enables reversing of the clip's source material. More...
 
bool getIsReversed () const noexcept
 Returns true if the clip's source material is reversed. More...
 
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. More...
 
bool performTempoDetect ()
 Performs a tempo-detection task and if successful sets the clip's LoopInfo tempo to this. More...
 
juce::StringArray getPitchChoices ()
 Returns an array describng what pitch each semitone change will be. More...
 
virtual bool canHaveEffects () const
 Returns true if this clip can have ClipEffects added to it. More...
 
void enableEffects (bool enable, bool warn)
 Enables/disables ClipEffects for this clip. More...
 
bool effectsEnabled () const
 Returns true if ClipEffects are enabled. More...
 
void addEffect (const juce::ValueTree &effectsTree)
 Adds a ClipEffect to this clip. More...
 
void setEffectsVisible (bool b)
 Sets the effectsVisible flag for this clip. More...
 
bool getEffectsVisible () const
 Returns true if the effectsVisible flag is set for this clip. More...
 
ClipEffectsgetClipEffects () const noexcept
 Returns the ClipEffects for this clip if it has been enabled. More...
 
bool canSnapToOriginalBWavTime ()
 Returns true if source file has a bwav time reference metadata property. More...
 
void snapToOriginalBWavTime ()
 Moves the clip to the bwav time reference metadata property time. More...
 
virtual juce::Array< ProjectItemIDgetTakes () const
 Returns the ProjectItemID of the clip's takes. More...
 
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. More...
 
virtual bool isUsingFile (const AudioFile &)
 Should return true if the clip is referencing the file in any way. More...
 
AudioFile getProxyFileToCreate (bool renderTimestretched)
 Returns the AudioFile to create to play this clip back. More...
 
void setUsesProxy (bool canUseProxy) noexcept
 Can be used to disable proxy file generation for this clip. More...
 
bool canUseProxy () const noexcept
 Retuns true if this clip can use a proxy file. More...
 
bool usesTimeStretchedProxy () const
 Retuns true if this clip use a proxy file due to timestretching. More...
 
std::unique_ptr< ProxyRenderingInfocreateProxyRenderingInfo ()
 Creates a ProxyRenderingInfo object to decribe the stretch segements of this clip. More...
 
HashCode getProxyHash ()
 Returns a hash identifying the proxy settings. More...
 
void beginRenderingNewProxyIfNeeded ()
 Triggers creation of a new proxy file if one is required. More...
 
const AudioSegmentListgetAudioSegmentList ()
 Returns an AudioSegmentList describing this file if it is using auto-tempo. More...
 
void setResamplingQuality (ResamplingQuality)
 Sets the resampling qulity to use. More...
 
ResamplingQuality getResamplingQuality () const
 Returns the resampling quality to the be used. More...
 
void reverseLoopPoints ()
 Reverses the loop points to expose the same section of the source file but reversed. More...
 
void checkFadeLengthsForOverrun ()
 Trims the fade in out lengths to avoid any overlap between them. More...
 
AudioClipBasegetOverlappingClip (ClipDirection) const
 Returns the previous/next overlapping clip if one exists. More...
 
bool isUsingMelodyne () const
 Returns true if this clip is using Melodyne. More...
 
void showMelodyneWindow ()
 Shows the Melodyne window if this clip is using Melodyne. More...
 
void hideMelodyneWindow ()
 Hides the Melodyne window if this clip is using Melodyne. More...
 
void melodyneConvertToMIDI ()
 If this clip is using Melodyne, this will create a new MIDI clip based on the Melodyne analysis. More...
 
void loadMelodyneState ()
 
bool setupARA (bool dontPopupErrorMessages)
 This internal method is used solely to find out if createAudioNode() should return nullptr or not. More...
 
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< TimePosition > getRescaledMarkPoints () const override
 
juce::Array< ReferencedItemgetReferencedItems () override
 
void reassignReferencedItem (const ReferencedItem &, ProjectItemID newID, double newStartTime) override
 
bool addClipPlugin (const Plugin::Ptr &, SelectionManager &) override
 
Plugin::Array getAllPlugins () override
 
void sendMirrorUpdateToAllPlugins (Plugin &) const override
 
PluginListgetPluginList () override
 
- Public Member Functions inherited from tracktion::engine::Clip
 Clip (const juce::ValueTree &, ClipOwner &, EditItemID, Type)
 Creates a clip of a given type from a ValueTree state. More...
 
 ~Clip () override
 Destructor. More...
 
virtual void sourceMediaChanged ()
 Called when the source media file reference (attribute "source") has changed - i.e. More...
 
virtual juce::String getName () const override
 Returns the name of the clip. More...
 
void setName (const juce::String &newName)
 Sets a new name for a clip. More...
 
virtual bool isMidi () const =0
 Returns true if this is a MidiClip. More...
 
virtual bool usesSourceFile () const
 True if it references a source file - i.e. More...
 
SourceFileReferencegetSourceFileReference ()
 Returns the SourceFileReference of the Clip. More...
 
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. More...
 
juce::Array< ReferencedItemgetReferencedItems () override
 Returns an array of any ReferencedItem[s] e.g. More...
 
void reassignReferencedItem (const ReferencedItem &, ProjectItemID, double) override
 Should be implemented to change the underlying source to a new ProjectItemID. More...
 
ClipPosition getPosition () const override
 Returns the ClipPosition on the parent Track. More...
 
BeatPosition getContentBeatAtTime (TimePosition) const
 Returns the beat number (with offset) at the given time. More...
 
TimePosition getTimeOfContentBeat (BeatPosition) const
 Returns time of a beat number. More...
 
virtual juce::Array< TimePosition > getInterestingTimes ()
 Returns times for snapping to, relative to the Edit. More...
 
TimePosition getSpottingPoint () const
 Returns the first marked time in the source file which can be used for syncronising newly added clips. More...
 
TimeRange getLoopRange () const
 Returns the loop range in seconds. More...
 
BeatRange getLoopRangeBeats () const
 Returns the loop range in beats. More...
 
virtual void setSyncType (SyncType sync)
 Sets the sync type for the clip. More...
 
SyncType getSyncType () const
 Returns the sync type clip is using. More...
 
void setPosition (ClipPosition newPosition)
 Sets the position of the clip. More...
 
void setStart (TimePosition newStart, bool preserveSync, bool keepLength)
 Sets the start time of the clip. More...
 
void setLength (TimeDuration newLength, bool preserveSync)
 Sets the length of the clip. More...
 
void setEnd (TimePosition newEnd, bool preserveSync)
 Sets the end of the clip. More...
 
void setOffset (TimeDuration newOffset)
 Sets the offset of the clip, i.e. More...
 
void trimAwayOverlap (TimeRange editRangeToTrim)
 Trims away any part of the clip that overlaps this region. More...
 
void removeFromParent ()
 Removes this clip from the parent track or container clip. More...
 
bool moveTo (ClipOwner &)
 Moves the clip to a new parent (if possible). More...
 
double getSpeedRatio () const noexcept
 Returns the speed ratio i.e. More...
 
virtual void rescale (TimePosition pivotTimeInEdit, double factor)
 stretches and scales this clip relative to a fixed point in the edit. More...
 
bool isGrouped () const override
 Returns true if the clip is part of a group. More...
 
TrackItemgetGroupParent () const override
 Returns the parent TrackItem if part of a group. More...
 
void setGroup (EditItemID newGroupID)
 Sets the clip to be part of a group. More...
 
EditItemID getGroupID () const noexcept
 Returns the ID of the group. More...
 
CollectionClipgetGroupClip () const
 Returns this as a CollectionClip if it is one. More...
 
bool isLinked () const
 Returns true if this clip is linked with any others. More...
 
void setLinkGroupID (juce::String newLinkID)
 Sets the link ID to link this clip with others. More...
 
juce::String getLinkGroupID () const
 Returns the link ID of this clip. More...
 
ClipOwnergetParent () const
 Returns the parent ClipOwner this clip is on. More...
 
ClipTrackgetClipTrack () const
 Returns the parent ClipTrack this clip is on (if any). More...
 
TrackgetTrack () const override
 Returns the parent Track this clip is on (if any). More...
 
virtual juce::Colour getColour () const
 Returns the colour property of this clip. More...
 
void setColour (juce::Colour col)
 Sets the colour property of this clip. More...
 
virtual void removePlugin (const Plugin::Ptr &)
 Removes the given plugin from the clip if the clip supports plugins. More...
 
virtual void clearTakes ()
 Clears any takes this clip has. More...
 
virtual bool hasAnyTakes () const
 Returns true if this clip has any takes. More...
 
virtual juce::StringArray getTakeDescriptions () const
 Returns the descriptions of any takes. More...
 
virtual void setCurrentTake (int)
 Sets a given take index to be the current take. More...
 
virtual int getCurrentTake () const
 Returns the current take index. More...
 
virtual int getNumTakes (bool)
 Returns the total number of takes. More...
 
virtual bool isCurrentTakeComp ()
 Returns true if the current take is a comp. More...
 
virtual void setShowingTakes (bool shouldShow)
 Sets whether the clip should be showing takes. More...
 
virtual bool isShowingTakes () const
 Returns true if the clip is showing takes. More...
 
virtual Clip::Array unpackTakes (bool)
 Attempts to unpack the takes to new clips. More...
 
void updateLinkedClips ()
 Triggers a call to cloneFrom for all clips with the same linkID. More...
 
void addListener (Listener *)
 Adds a Listener. More...
 
void removeListener (Listener *)
 Removes a Listener. More...
 
juce::ListenerList< Listener > & getListeners ()
 Returns the listener list so Nodes can manually call them. More...
 
void changed () override
 
juce::UndoManager * getUndoManager () const
 Returns the UndoManager. More...
 
- Public Member Functions inherited from tracktion::engine::TrackItem
 TrackItem (Edit &, EditItemID, Type)
 Creates a TrackItem with an ID and type. More...
 
 ~TrackItem ()
 Destructor. More...
 
TimeRange getEditTimeRange () const
 Returns the time range of this item. More...
 
BeatRange getEditBeatRange () const
 Returns the beat range of this item. More...
 
BeatPosition getStartBeat () const
 Returns the start beat in the Edit of this item. More...
 
BeatPosition getContentStartBeat () const
 Returns the start beat of the content in the Edit of this item. More...
 
BeatPosition getEndBeat () const
 Returns the end beat in the Edit of this item. More...
 
BeatDuration getLengthInBeats () const
 Returns the duration in beats the of this item. More...
 
TimePosition getTimeOfRelativeBeat (BeatDuration) const
 Returns an Edit time point for a given number of beats from the start of this item. More...
 
BeatPosition getBeatOfRelativeTime (TimeDuration) const
 Returns an Edit beat point for a given number of seconds from the start of this item. More...
 
BeatDuration getOffsetInBeats () const
 Returns an the offset of this item in beats. More...
 
EditItemID getTrackID () const
 Returns the ID of the Track this item lives on. More...
 
- Public Member Functions inherited from tracktion::engine::EditItem
 EditItem (EditItemID, Edit &)
 
virtual ~EditItem ()=default
 
- Public Member Functions inherited from tracktion::engine::Selectable
 Selectable ()
 
virtual ~Selectable ()
 
virtual juce::String getSelectableDescription ()=0
 Subclasses must return a description of what they are. More...
 
virtual void selectionStatusChanged (bool isNowSelected)
 Can be overridden to tell this object that it has just been selected or deselected. More...
 
virtual void selectableAboutToBeDeleted ()
 Called just before the selectable is about to be deleted so any subclasses should still be valid at this point. More...
 
void addSelectableListener (SelectableListener *)
 
void removeSelectableListener (SelectableListener *)
 
void cancelAnyPendingUpdates ()
 If changed() has been called, this will cancel any pending async change notificaions. More...
 
void deselect ()
 
void propertiesChanged ()
 
void notifyListenersOfDeletion ()
 
WeakRef getWeakRef ()
 
- Public Member Functions inherited from tracktion::engine::Exportable
virtual ~Exportable ()=default
 
- Public Member Functions inherited from tracktion::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. More...
 
- Static Public Member Functions inherited from tracktion::engine::Clip
static bool isClipState (const juce::ValueTree &)
 Checks whether a ValueTree is some kind of clip state. More...
 
static bool isClipState (const juce::Identifier &)
 Checks whether a ValueTree type is some kind of clip state. More...
 
static Ptr createClipForState (const juce::ValueTree &, ClipOwner &targetParent)
 Creates a clip for a given ValueTree representation. More...
 
- Static Public Member Functions inherited from tracktion::engine::TrackItem
static const char * typeToString (Type)
 Returns the string version of a TrackItem::Type. More...
 
static juce::Identifier clipTypeToXMLType (Type)
 Returns an Identifier version of a TrackItem::Type. More...
 
static TrackItem::Type xmlTagToType (juce::StringRef)
 Returns the TrackItem::Type of a type string. More...
 
static TrackItem::Type stringToType (const juce::String &)
 Returns the TrackItem::Type of a type string. More...
 
static juce::String getSuggestedNameForNewItem (Type)
 Returns a text string for a new clip of the given type. More...
 
template<typename ArrayType >
static void sortByTime (ArrayType &items)
 Helper function to sort an array of TrackItem[s] by their start time. More...
 
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. More...
 
- Static Public Member Functions inherited from tracktion::engine::Selectable
static void initialise ()
 
static bool isSelectableValid (const Selectable *) noexcept
 checks whether this object has been deleted. More...
 
- Static Public Member Functions inherited from tracktion::engine::Exportable
static juce::Array< Exportable * > addAllExportables (Edit &)
 Returns all the Exportables contained in an Edit. More...
 

Public Attributes

juce::ReferenceCountedObjectPtr< MelodyneFileReadermelodyneProxy
 The MelodyneFileReader proxy if this clip is using Melodyne. More...
 
juce::CachedValue< TimeStretcher::ElastiqueProOptionselastiqueProOptions
 The ElastiqueProOptions for fine tuning Elastique (if available). More...
 
- Public Attributes inherited from tracktion::engine::Clip
juce::ValueTree state
 The ValueTree of the Clip state. More...
 
juce::CachedValue< juce::Colour > colour
 The colour property. More...
 
- Public Attributes inherited from tracktion::engine::TrackItem
const Type type
 The type of this item. More...
 
- Public Attributes inherited from tracktion::engine::EditItem
Editedit
 
const EditItemID itemID
 Every EditItem has an ID which is unique within the edit. More...
 
- Public Attributes inherited from tracktion::engine::Selectable
WeakRef::Master masterReference
 

Protected Member Functions

void updateLeftRightChannelActivenessFlags ()
 
void createNewProxyAsync ()
 Triggers a source or proxy render after a timeout. More...
 
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 tracktion::engine::Clip
void setCurrentSourceFile (const juce::File &)
 Sets a new source file for this clip. More...
 
void valueTreePropertyChanged (juce::ValueTree &, const juce::Identifier &) override
 
void valueTreeParentChanged (juce::ValueTree &) override
 

Protected Attributes

std::shared_ptr< ClipLevellevel { std::make_shared<ClipLevel>() }
 
juce::CachedValue< juce::String > channels
 
juce::CachedValue< TimeDuration > fadeIn
 
juce::CachedValue< TimeDuration > fadeOut
 
TimeDuration autoFadeIn
 
TimeDuration autoFadeOut
 
juce::CachedValue< AudioFadeCurve::TypefadeInType
 
juce::CachedValue< AudioFadeCurve::TypefadeOutType
 
juce::CachedValue< bool > autoCrossfade
 
juce::CachedValue< FadeBehaviourfadeInBehaviour
 
juce::CachedValue< FadeBehaviourfadeOutBehaviour
 
juce::CachedValue< ResamplingQualityresamplingQuality
 
juce::CachedValue< TimePosition > loopStart
 
juce::CachedValue< TimeDuration > loopLength
 
juce::CachedValue< BeatPosition > loopStartBeats
 
juce::CachedValue< BeatDuration > loopLengthBeats
 
juce::CachedValue< int > proxyAllowed
 
juce::CachedValue< int > transpose
 
juce::CachedValue< float > pitchChange
 
LoopInfo loopInfo
 
juce::CachedValue< float > beatSensitivity
 
juce::CachedValue< TimeStretcher::ModetimeStretchMode
 
juce::CachedValue< bool > autoPitch
 
juce::CachedValue< bool > autoTempo
 
juce::CachedValue< bool > isReversed
 
juce::CachedValue< bool > autoDetectBeats
 
juce::CachedValue< bool > warpTime
 
juce::CachedValue< bool > clipEffectsVisible
 
juce::CachedValue< AutoPitchModeautoPitchMode
 
WarpTimeManager::Ptr warpTimeManager
 
std::unique_ptr< AudioSegmentListaudioSegmentList
 
std::unique_ptr< ClipEffectsclipEffects
 
AsyncFunctionCaller asyncFunctionCaller
 
juce::AudioChannelSet activeChannels
 
PluginList pluginList
 
bool lastRenderJobFailed = false
 
RenderManager::Job::Ptr renderJob
 
AudioFile lastProxy
 
- Protected Attributes inherited from tracktion::engine::Clip
bool isInitialised = false
 
bool cloneInProgress = false
 
juce::CachedValue< juce::String > clipName
 
ClipOwnerparent = nullptr
 
juce::CachedValue< TimePosition > clipStart
 
juce::CachedValue< TimeDuration > length
 
juce::CachedValue< TimeDuration > offset
 
juce::CachedValue< double > speedRatio
 
SourceFileReference sourceFileReference
 
juce::CachedValue< EditItemIDgroupID
 
juce::CachedValue< juce::String > linkID
 
juce::File currentSourceFile
 
juce::CachedValue< SyncTypesyncType
 
juce::CachedValue< bool > showingTakes
 
std::unique_ptr< PatternGeneratorpatternGenerator
 
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 tracktion::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()

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

Creates a basic AudioClip.

◆ ~AudioClipBase()

tracktion::engine::AudioClipBase::~AudioClipBase ( )
override

Destructor.

Member Function Documentation

◆ getMaximumLength()

TimeDuration tracktion::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 tracktion::engine::Clip.

◆ getSourceLength()

virtual TimeDuration tracktion::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 tracktion::engine::WaveAudioClip, tracktion::engine::EditClip, and tracktion::engine::ContainerClip.

◆ getAudioFile()

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

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

Reimplemented in tracktion::engine::EditClip.

References tracktion::engine::EditItem::edit, tracktion::engine::Edit::engine, and tracktion::engine::Clip::getCurrentSourceFile().

◆ getPlaybackFile()

AudioFile tracktion::engine::AudioClipBase::getPlaybackFile ( )

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

◆ getOriginalFile()

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

Must return the file that the source ProjectItemID refers to.

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

◆ getHash()

virtual HashCode tracktion::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 tracktion::engine::WaveAudioClip, tracktion::engine::EditClip, and tracktion::engine::ContainerClip.

◆ getWaveInfo()

virtual AudioFileInfo tracktion::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 tracktion::engine::EditClip.

◆ markAsDirty()

void tracktion::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 tracktion::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.

◆ needsRender()

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

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

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

◆ getRenderJob()

virtual RenderManager::Job::Ptr tracktion::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 tracktion::engine::WaveAudioClip, and tracktion::engine::EditClip.

◆ renderComplete()

virtual void tracktion::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 tracktion::engine::WaveAudioClip, and tracktion::engine::EditClip.

◆ getRenderMessage()

virtual juce::String tracktion::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 tracktion::engine::WaveAudioClip, and tracktion::engine::EditClip.

◆ getClipMessage()

virtual juce::String tracktion::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 tracktion::engine::EditClip.

◆ cancelCurrentRender()

void tracktion::engine::AudioClipBase::cancelCurrentRender ( )

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

◆ setGainDB()

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

Sets the gain of the clip in dB.

◆ getGainDB()

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

Returns the gain of the clip in dB.

References level.

◆ getGain()

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

Returns the gain of the clip.

References tracktion::engine::dbToGain(), and level.

◆ setPan()

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

Sets the pan of the clip.

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

◆ getPan()

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

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

See also
setPan.

References level.

◆ setMuted()

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

Reimplemented from tracktion::engine::Clip.

References level.

◆ isMuted()

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

Implements tracktion::engine::Clip.

References level.

◆ getLiveClipLevel()

LiveClipLevel tracktion::engine::AudioClipBase::getLiveClipLevel ( )

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

◆ setLeftChannelActive()

void tracktion::engine::AudioClipBase::setLeftChannelActive ( bool  )

Enables the left channel of the clip.

◆ isLeftChannelActive()

bool tracktion::engine::AudioClipBase::isLeftChannelActive ( ) const

Returns whether the left channel of the clip is enabled.

◆ setRightChannelActive()

void tracktion::engine::AudioClipBase::setRightChannelActive ( bool  )

Enables the right channel of the clip.

◆ isRightChannelActive()

bool tracktion::engine::AudioClipBase::isRightChannelActive ( ) const

Returns whether the right channel of the clip is enabled.

◆ getActiveChannels()

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

Returns the layout of the active channels.

References activeChannels.

◆ setFadeIn()

bool tracktion::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 tracktion::engine::AudioClipBase::getFadeIn ( ) const

Returns the fade in duration in seconds.

◆ setFadeOut()

bool tracktion::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 tracktion::engine::AudioClipBase::getFadeOut ( ) const

Returns the fade out duration in seconds.

◆ setFadeInType()

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

Sets the curve shape for the fade in to use.

◆ getFadeInType()

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

Returns the curve shape for the fade in to use.

References fadeInType.

◆ setFadeOutType()

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

Sets the curve shape for the fade out to use.

◆ getFadeOutType()

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

Returns the curve shape for the fade out to use.

References fadeOutType.

◆ setAutoCrossfade()

void tracktion::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.

References autoCrossfade.

◆ getAutoCrossfade()

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

Returns whether auto-crossfade is enabled.

References autoCrossfade.

◆ updateAutoCrossfadesAsync()

void tracktion::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 tracktion::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 tracktion::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 tracktion::engine::AudioClipBase::setFadeInBehaviour ( FadeBehaviour  newBehaviour)

Sets the fade in behaviour.

References fadeInBehaviour.

◆ getFadeInBehaviour()

FadeBehaviour tracktion::engine::AudioClipBase::getFadeInBehaviour ( ) const

Returns the fade in behaviour.

References fadeInBehaviour.

◆ setFadeOutBehaviour()

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

Sets the fade out behaviour.

References fadeOutBehaviour.

◆ getFadeOutBehaviour()

FadeBehaviour tracktion::engine::AudioClipBase::getFadeOutBehaviour ( ) const

Returns the fade out behaviour.

References fadeOutBehaviour.

◆ setLoopDefaults()

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

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

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

◆ setLoopInfo()

void tracktion::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& tracktion::engine::AudioClipBase::getLoopInfo ( ) const

Returns the LoopInfo being used to describe this clip.

References loopInfo.

◆ getLoopInfo() [2/2]

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

Returns the LoopInfo being used to describe this clip.

References loopInfo.

◆ getLoopRange()

TimeRange tracktion::engine::AudioClipBase::getLoopRange ( ) const

Returns the loop range in seconds.

◆ canLoop()

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

Reimplemented from tracktion::engine::Clip.

References isUsingMelodyne().

◆ isLooping()

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

Reimplemented from tracktion::engine::Clip.

References getAutoTempo(), loopLength, and loopLengthBeats.

Referenced by beatBasedLooping().

◆ beatBasedLooping()

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

Reimplemented from tracktion::engine::Clip.

References getAutoTempo(), and isLooping().

◆ setNumberOfLoops()

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

Reimplemented from tracktion::engine::Clip.

◆ disableLooping()

void tracktion::engine::AudioClipBase::disableLooping ( )
overridevirtual

Reimplemented from tracktion::engine::Clip.

◆ getLoopStartBeats()

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

Reimplemented from tracktion::engine::Clip.

◆ getLoopStart()

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

Reimplemented from tracktion::engine::Clip.

◆ getLoopLengthBeats()

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

Reimplemented from tracktion::engine::Clip.

◆ getLoopLength()

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

Reimplemented from tracktion::engine::Clip.

◆ setLoopRange()

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

Reimplemented from tracktion::engine::Clip.

◆ setLoopRangeBeats()

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

Reimplemented from tracktion::engine::Clip.

Reimplemented in tracktion::engine::ContainerClip.

◆ setAutoDetectBeats()

void tracktion::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 tracktion::engine::AudioClipBase::getAutoDetectBeats ( ) const

Returns true if auto-detect of beats is enabled.

References autoDetectBeats.

◆ setBeatSensitivity()

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

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

See also
setAutoDetectBeats

◆ getBeatSensitivity()

float tracktion::engine::AudioClipBase::getBeatSensitivity ( ) const

Returns the beat sensitivity.

References beatSensitivity.

◆ pitchTempoTrackChanged()

void tracktion::engine::AudioClipBase::pitchTempoTrackChanged ( )
overridevirtual

Reimplemented from tracktion::engine::Clip.

Reimplemented in tracktion::engine::ContainerClip.

◆ setSpeedRatio()

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

Reimplemented from tracktion::engine::Clip.

◆ setTimeStretchMode()

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

Sets a time-stretch mode to use.

◆ getTimeStretchMode()

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

Returns the time-stretch mode that has been set.

◆ getActualTimeStretchMode()

TimeStretcher::Mode tracktion::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 tracktion::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.

References autoTempo.

◆ getAutoTempo()

bool tracktion::engine::AudioClipBase::getAutoTempo ( ) const

Returns true if auto-tempo has been set.

References autoTempo.

Referenced by beatBasedLooping(), and isLooping().

◆ setAutoPitch()

void tracktion::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.

References autoPitch.

◆ getAutoPitch()

bool tracktion::engine::AudioClipBase::getAutoPitch ( ) const

Returns true if auto-pitch has been set.

References autoPitch.

◆ setAutoPitchMode()

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

Sets the AutoPitchMode to use.

References autoPitchMode.

◆ getAutoPitchMode()

AutoPitchMode tracktion::engine::AudioClipBase::getAutoPitchMode ( )

Returns the AutoPitchMode in use.

References autoPitchMode.

◆ setWarpTime()

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

Enables/disables warp time.

Warp Time enables segmented warping of the audio.

See also
WarpTimeManager

References warpTime.

◆ getWarpTime()

bool tracktion::engine::AudioClipBase::getWarpTime ( ) const

Returns true if warp time is enabled.

References warpTime.

◆ getWarpTimeManager()

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

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

◆ setTranspose()

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

Sets the number of semitones to transpose the clip by.

References transpose.

◆ getTransposeSemiTones()

int tracktion::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 tracktion::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.

References pitchChange.

◆ getPitchChange()

float tracktion::engine::AudioClipBase::getPitchChange ( ) const

Returns the number of semitones to transpose the clip by.

References pitchChange.

◆ getPitchRatio()

float tracktion::engine::AudioClipBase::getPitchRatio ( ) const

Returns the pitch change as a normalised ratio.

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

References pitchChange.

◆ setIsReversed()

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

Enables reversing of the clip's source material.

References isReversed.

◆ getIsReversed()

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

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

References isReversed.

◆ autoDetectBeatMarkers()

LoopInfo tracktion::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 tracktion::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 tracktion::engine::AudioClipBase::getRootNoteChoices ( Engine )
static

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

"C#" etc.

◆ getPitchChoices()

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

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

◆ canHaveEffects()

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

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

Reimplemented in tracktion::engine::EditClip.

References isReversed, and warpTime.

◆ enableEffects()

void tracktion::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 tracktion::engine::AudioClipBase::effectsEnabled ( ) const

Returns true if ClipEffects are enabled.

References clipEffects.

◆ addEffect()

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

Adds a ClipEffect to this clip.

◆ setEffectsVisible()

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

Sets the effectsVisible flag for this clip.

References clipEffectsVisible.

◆ getEffectsVisible()

bool tracktion::engine::AudioClipBase::getEffectsVisible ( ) const

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

References clipEffectsVisible.

◆ getClipEffects()

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

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

References clipEffects.

◆ canSnapToOriginalBWavTime()

bool tracktion::engine::AudioClipBase::canSnapToOriginalBWavTime ( )

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

◆ snapToOriginalBWavTime()

void tracktion::engine::AudioClipBase::snapToOriginalBWavTime ( )

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

◆ getTakes()

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

Returns the ProjectItemID of the clip's takes.

Reimplemented in tracktion::engine::WaveAudioClip.

◆ canAddClipPlugin()

juce::String tracktion::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 tracktion::engine::AudioClipBase::isUsingFile ( const AudioFile )
virtual

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

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

◆ getProxyFileToCreate()

AudioFile tracktion::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 tracktion::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 tracktion::engine::AudioClipBase::canUseProxy ( ) const
noexcept

Retuns true if this clip can use a proxy file.

References tracktion::engine::Edit::canRenderProxies(), tracktion::engine::EditItem::edit, and proxyAllowed.

◆ usesTimeStretchedProxy()

bool tracktion::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> tracktion::engine::AudioClipBase::createProxyRenderingInfo ( )

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

◆ getProxyHash()

HashCode tracktion::engine::AudioClipBase::getProxyHash ( )

Returns a hash identifying the proxy settings.

◆ beginRenderingNewProxyIfNeeded()

void tracktion::engine::AudioClipBase::beginRenderingNewProxyIfNeeded ( )

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

◆ getAudioSegmentList()

const AudioSegmentList& tracktion::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 tracktion::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 tracktion::engine::AudioClipBase::getResamplingQuality ( ) const

Returns the resampling quality to the be used.

◆ reverseLoopPoints()

void tracktion::engine::AudioClipBase::reverseLoopPoints ( )

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

◆ checkFadeLengthsForOverrun()

void tracktion::engine::AudioClipBase::checkFadeLengthsForOverrun ( )

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

◆ getOverlappingClip()

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

Returns the previous/next overlapping clip if one exists.

◆ isUsingMelodyne()

bool tracktion::engine::AudioClipBase::isUsingMelodyne ( ) const

Returns true if this clip is using Melodyne.

Referenced by canLoop().

◆ showMelodyneWindow()

void tracktion::engine::AudioClipBase::showMelodyneWindow ( )

Shows the Melodyne window if this clip is using Melodyne.

◆ hideMelodyneWindow()

void tracktion::engine::AudioClipBase::hideMelodyneWindow ( )

Hides the Melodyne window if this clip is using Melodyne.

◆ melodyneConvertToMIDI()

void tracktion::engine::AudioClipBase::melodyneConvertToMIDI ( )

If this clip is using Melodyne, this will create a new MIDI clip based on the Melodyne analysis.

◆ loadMelodyneState()

void tracktion::engine::AudioClipBase::loadMelodyneState ( )

◆ setupARA()

bool tracktion::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.
     Celemony's ARA is really flaky and touchy, so the latter
     is most likely!

◆ initialise()

void tracktion::engine::AudioClipBase::initialise ( )
overridevirtual

◆ cloneFrom()

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

◆ flushStateToValueTree()

void tracktion::engine::AudioClipBase::flushStateToValueTree ( )
overridevirtual

Reimplemented from tracktion::engine::Clip.

Reimplemented in tracktion::engine::ContainerClip.

◆ setParent()

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

Reimplemented from tracktion::engine::Clip.

◆ canBeAddedTo()

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

◆ changed()

void tracktion::engine::AudioClipBase::changed ( )
overridevirtual

Reimplemented from tracktion::engine::Selectable.

Reimplemented in tracktion::engine::EditClip.

◆ getDefaultColour()

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

◆ getPatternGenerator()

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

Reimplemented from tracktion::engine::Clip.

◆ addMark()

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

◆ moveMarkTo()

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

◆ deleteMark()

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

◆ getRescaledMarkPoints() [1/2]

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

◆ getRescaledMarkPoints() [2/2]

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

Reimplemented from tracktion::engine::Clip.

◆ getReferencedItems()

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

◆ reassignReferencedItem()

void tracktion::engine::AudioClipBase::reassignReferencedItem ( const ReferencedItem ,
ProjectItemID  newID,
double  newStartTime 
)
overridevirtual

◆ addClipPlugin()

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

Reimplemented from tracktion::engine::Clip.

◆ getAllPlugins()

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

Reimplemented from tracktion::engine::Clip.

◆ sendMirrorUpdateToAllPlugins()

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

Reimplemented from tracktion::engine::Clip.

◆ getPluginList()

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

Reimplemented from tracktion::engine::Clip.

References pluginList.

◆ updateLeftRightChannelActivenessFlags()

void tracktion::engine::AudioClipBase::updateLeftRightChannelActivenessFlags ( )
protected

◆ createNewProxyAsync()

void tracktion::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 tracktion::engine::AudioClipBase::valueTreePropertyChanged ( juce::ValueTree &  ,
const juce::Identifier &   
)
overrideprotected

◆ valueTreeChildAdded()

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

◆ valueTreeChildRemoved()

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

◆ valueTreeChildOrderChanged()

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

◆ valueTreeParentChanged()

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

Member Data Documentation

◆ melodyneProxy

juce::ReferenceCountedObjectPtr<MelodyneFileReader> tracktion::engine::AudioClipBase::melodyneProxy

The MelodyneFileReader proxy if this clip is using Melodyne.

◆ elastiqueProOptions

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

The ElastiqueProOptions for fine tuning Elastique (if available).

◆ level

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

◆ channels

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

◆ fadeIn

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

◆ fadeOut

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

◆ autoFadeIn

TimeDuration tracktion::engine::AudioClipBase::autoFadeIn
protected

◆ autoFadeOut

TimeDuration tracktion::engine::AudioClipBase::autoFadeOut
protected

◆ fadeInType

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

Referenced by getFadeInType().

◆ fadeOutType

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

Referenced by getFadeOutType().

◆ autoCrossfade

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

◆ fadeInBehaviour

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

◆ fadeOutBehaviour

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

◆ resamplingQuality

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

◆ loopStart

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

◆ loopLength

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

Referenced by isLooping().

◆ loopStartBeats

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

◆ loopLengthBeats

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

Referenced by isLooping().

◆ proxyAllowed

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

Referenced by canUseProxy().

◆ transpose

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

Referenced by setTranspose().

◆ pitchChange

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

◆ loopInfo

LoopInfo tracktion::engine::AudioClipBase::loopInfo
protected

Referenced by getLoopInfo().

◆ beatSensitivity

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

Referenced by getBeatSensitivity().

◆ timeStretchMode

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

◆ autoPitch

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

Referenced by getAutoPitch(), and setAutoPitch().

◆ autoTempo

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

Referenced by getAutoTempo(), and setAutoTempo().

◆ isReversed

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

◆ autoDetectBeats

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

Referenced by getAutoDetectBeats().

◆ warpTime

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

◆ clipEffectsVisible

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

◆ autoPitchMode

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

◆ warpTimeManager

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

◆ audioSegmentList

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

◆ clipEffects

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

Referenced by effectsEnabled(), and getClipEffects().

◆ asyncFunctionCaller

AsyncFunctionCaller tracktion::engine::AudioClipBase::asyncFunctionCaller
mutableprotected

◆ activeChannels

juce::AudioChannelSet tracktion::engine::AudioClipBase::activeChannels
protected

Referenced by getActiveChannels().

◆ pluginList

PluginList tracktion::engine::AudioClipBase::pluginList
protected

Referenced by getPluginList().

◆ lastRenderJobFailed

bool tracktion::engine::AudioClipBase::lastRenderJobFailed = false
protected

◆ renderJob

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

◆ lastProxy

AudioFile tracktion::engine::AudioClipBase::lastProxy
protected

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