TracktionEngine
|
Base class for Clips that produce some kind of audio e.g. More...
#include <tracktion_AudioClipBase.h>
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 > |
![]() | |
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 > |
![]() | |
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... | |
![]() | |
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. | |
void | setLeftChannelActive (bool) |
Enables the left channel of the clip. | |
bool | isLeftChannelActive () const |
Returns whether the left channel of the clip is enabled. | |
void | setRightChannelActive (bool) |
Enables the right channel of the clip. | |
bool | isRightChannelActive () const |
Returns whether the right channel of the clip is enabled. | |
juce::AudioChannelSet | getActiveChannels () const |
Returns the layout of the active channels. | |
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 LoopInfo & | getLoopInfo () const |
Returns the LoopInfo being used to describe this clip. | |
LoopInfo & | getLoopInfo () |
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. | |
WarpTimeManager & | getWarpTimeManager () 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 ¤t, 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. | |
ClipEffects * | getClipEffects () 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< ProjectItemID > | getTakes () const |
Returns the ProjectItemID 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< ProxyRenderingInfo > | createProxyRenderingInfo () |
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 AudioSegmentList & | getAudioSegmentList () |
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. | |
AudioClipBase * | getOverlappingClip (ClipDirection) const |
Returns the previous/next overlapping clip if one exists. | |
bool | isUsingMelodyne () const |
Returns true if this clip is using Melodyne. | |
void | showMelodyneWindow () |
Shows the Melodyne window if this clip is using Melodyne. | |
void | hideMelodyneWindow () |
Hides the Melodyne window if this clip is using Melodyne. | |
void | melodyneConvertToMIDI () |
If this clip is using Melodyne, this will create a new MIDI clip based on the Melodyne analysis. | |
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 |
PatternGenerator * | getPatternGenerator () 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< ReferencedItem > | getReferencedItems () override |
void | reassignReferencedItem (const ReferencedItem &, ProjectItemID newID, double newStartTime) override |
std::shared_ptr< LaunchHandle > | getLaunchHandle () override |
void | setUsesGlobalLaunchQuatisation (bool useGlobal) override |
bool | usesGlobalLaunchQuatisation () override |
LaunchQuantisation * | getLaunchQuantisation () override |
FollowActions * | getFollowActions () override |
bool | addClipPlugin (const Plugin::Ptr &, SelectionManager &) override |
Plugin::Array | getAllPlugins () override |
void | sendMirrorUpdateToAllPlugins (Plugin &) const override |
PluginList * | getPluginList () override |
![]() | |
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. | |
SourceFileReference & | getSourceFileReference () |
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< ReferencedItem > | getReferencedItems () override |
Returns an array of any ReferencedItem[s] e.g. | |
void | reassignReferencedItem (const ReferencedItem &, ProjectItemID, double) override |
Should be implemented to change the underlying source to a new ProjectItemID. | |
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< TimePosition > | getInterestingTimes () |
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. | |
TrackItem * | getGroupParent () 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. | |
CollectionClip * | getGroupClip () 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. | |
ClipOwner * | getParent () const |
Returns the parent ClipOwner this clip is on. | |
ClipTrack * | getClipTrack () const |
Returns the parent ClipTrack this clip is on (if any). | |
Track * | getTrack () const override |
Returns the parent Track this clip is on (if any). | |
ClipSlot * | getClipSlot () 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 col) |
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. | |
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. | |
![]() | |
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. | |
![]() | |
EditItem (EditItemID, Edit &) | |
EditItem (Edit &, const juce::ValueTree &) | |
virtual | ~EditItem ()=default |
![]() | |
Selectable () | |
virtual | ~Selectable () |
virtual juce::String | getSelectableDescription ()=0 |
Subclasses must return a description of what they are. | |
virtual void | selectionStatusChanged (bool isNowSelected) |
Can be overridden to tell this object that it has just been selected or deselected. | |
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 () |
![]() | |
virtual | ~Exportable ()=default |
![]() | |
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 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 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 void | initialise () |
static bool | isSelectableValid (const Selectable *) noexcept |
checks whether this object has been deleted. | |
![]() | |
static juce::Array< Exportable * > | addAllExportables (Edit &) |
Returns all the Exportables contained in an Edit. | |
Public Attributes | |
juce::ReferenceCountedObjectPtr< MelodyneFileReader > | melodyneProxy |
The MelodyneFileReader proxy if this clip is using Melodyne. | |
juce::CachedValue< TimeStretcher::ElastiqueProOptions > | elastiqueProOptions |
The ElastiqueProOptions for fine tuning Elastique (if available). | |
![]() | |
juce::CachedValue< FollowActionDurationType > | followActionDurationType |
The type of duration to use for when to trigger the follow action. | |
juce::CachedValue< BeatDuration > | followActionBeats |
Determines the time for which a launched clip will play before a follow action is taken. | |
juce::CachedValue< double > | followActionNumLoops |
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< bool > | disabled |
Whether the Clip is disabled or not. | |
![]() | |
const Type | type |
The type of this item. | |
![]() | |
Edit & | edit |
const EditItemID | itemID |
Every EditItem has an ID which is unique within the edit. | |
![]() | |
WeakRef::Master | masterReference |
Protected Member Functions | |
void | updateLeftRightChannelActivenessFlags () |
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 |
![]() | |
void | setCurrentSourceFile (const juce::File &) |
Sets a new source file for this clip. | |
void | valueTreePropertyChanged (juce::ValueTree &, const juce::Identifier &) override |
void | valueTreeParentChanged (juce::ValueTree &) override |
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.
using tracktion::engine::AudioClipBase::Ptr = juce::ReferenceCountedObjectPtr<AudioClipBase> |
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. |
tracktion::engine::AudioClipBase::AudioClipBase | ( | const juce::ValueTree & | , |
EditItemID | , | ||
Type | , | ||
ClipOwner & | |||
) |
Creates a basic AudioClip.
|
override |
Destructor.
|
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.
|
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::ContainerClip, tracktion::engine::EditClip, and tracktion::engine::WaveAudioClip.
Returns the file used to play back the source and will get proxied etc.
Reimplemented in tracktion::engine::EditClip.
References tracktion::engine::TrackItem::edit, and tracktion::engine::Clip::getCurrentSourceFile().
AudioFile tracktion::engine::AudioClipBase::getPlaybackFile | ( | ) |
|
pure virtual |
Must return the file that the source ProjectItemID refers to.
Implemented in tracktion::engine::ContainerClip, tracktion::engine::EditClip, and tracktion::engine::WaveAudioClip.
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::ContainerClip, tracktion::engine::EditClip, and tracktion::engine::WaveAudioClip.
|
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.
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.
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.
Subclasses can override this to indicate that they need to render their source file, irrespective of their canUseProxy property.
Reimplemented in tracktion::engine::EditClip.
Subclasses should override this to return true if they need the rest of the render callbacks.
Reimplemented in tracktion::engine::EditClip, and tracktion::engine::WaveAudioClip.
|
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::EditClip, and tracktion::engine::WaveAudioClip.
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::EditClip, and tracktion::engine::WaveAudioClip.
|
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::EditClip, and tracktion::engine::WaveAudioClip.
|
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.
void tracktion::engine::AudioClipBase::cancelCurrentRender | ( | ) |
If a render is in progress, this will cancel it.
|
noexcept |
Returns the gain of the clip in dB.
References level.
|
noexcept |
Returns the gain of the clip.
References tracktion::engine::dbToGain(), and level.
Sets the pan of the clip.
pan | -1 = full left, 0 = centre, 1 = full right |
|
noexcept |
Reimplemented from tracktion::engine::Clip.
References level.
|
overridevirtual |
Implements tracktion::engine::Clip.
References level.
LiveClipLevel tracktion::engine::AudioClipBase::getLiveClipLevel | ( | ) |
Returns a LiveClipLevel which can be used to read the gain, pan and mute statuses.
Enables the left channel of the clip.
bool tracktion::engine::AudioClipBase::isLeftChannelActive | ( | ) | const |
Returns whether the left channel of the clip is enabled.
Enables the right channel of the clip.
bool tracktion::engine::AudioClipBase::isRightChannelActive | ( | ) | const |
Returns whether the right channel of the clip is enabled.
juce::AudioChannelSet tracktion::engine::AudioClipBase::getActiveChannels | ( | ) | const |
Returns the layout of the active channels.
References activeChannels.
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.
TimeDuration tracktion::engine::AudioClipBase::getFadeIn | ( | ) | const |
Returns the fade in duration in seconds.
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.
TimeDuration tracktion::engine::AudioClipBase::getFadeOut | ( | ) | const |
Returns the fade out duration in seconds.
void tracktion::engine::AudioClipBase::setFadeInType | ( | AudioFadeCurve::Type | ) |
Sets the curve shape for the fade in to use.
AudioFadeCurve::Type tracktion::engine::AudioClipBase::getFadeInType | ( | ) | const |
Returns the curve shape for the fade in to use.
References fadeInType.
void tracktion::engine::AudioClipBase::setFadeOutType | ( | AudioFadeCurve::Type | newType | ) |
Sets the curve shape for the fade out to use.
AudioFadeCurve::Type tracktion::engine::AudioClipBase::getFadeOutType | ( | ) | const |
Returns the curve shape for the fade out to use.
References fadeOutType.
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.
|
noexcept |
Returns whether auto-crossfade is enabled.
References autoCrossfade.
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.
updateOverlapped | If true, this will also update any other clips that overlap this one. |
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.
Copies the fade in curve to a volume automation curve.
fadeIn | If true, this copies the fade-in, if false, the fade-out |
removeClipFade | If true, the fade in will be set to 0 |
void tracktion::engine::AudioClipBase::setFadeInBehaviour | ( | FadeBehaviour | newBehaviour | ) |
Sets the fade in behaviour.
References fadeInBehaviour.
FadeBehaviour tracktion::engine::AudioClipBase::getFadeInBehaviour | ( | ) | const |
Returns the fade in behaviour.
References fadeInBehaviour.
void tracktion::engine::AudioClipBase::setFadeOutBehaviour | ( | FadeBehaviour | newBehaviour | ) |
Sets the fade out behaviour.
References fadeOutBehaviour.
FadeBehaviour tracktion::engine::AudioClipBase::getFadeOutBehaviour | ( | ) | const |
Returns the fade out behaviour.
References fadeOutBehaviour.
Override this to fill in the LoopInfo structure as best fits the source.
Implemented in tracktion::engine::ContainerClip, tracktion::engine::EditClip, and tracktion::engine::WaveAudioClip.
Sets a LoopInfo to describe this clip's tempo, time sig etc.
which is used when syncing to the TempoSequence and PitchSequence.
LoopInfo & tracktion::engine::AudioClipBase::getLoopInfo | ( | ) |
TimeRange tracktion::engine::AudioClipBase::getLoopRange | ( | ) | const |
Returns the loop range in seconds.
|
overridevirtual |
Reimplemented from tracktion::engine::Clip.
|
overridevirtual |
Reimplemented from tracktion::engine::Clip.
References getAutoTempo(), loopLength, and loopLengthBeats.
Referenced by beatBasedLooping().
|
overridevirtual |
Reimplemented from tracktion::engine::Clip.
References getAutoTempo(), and isLooping().
Reimplemented from tracktion::engine::Clip.
|
overridevirtual |
Reimplemented from tracktion::engine::Clip.
|
overridevirtual |
Reimplemented from tracktion::engine::Clip.
|
overridevirtual |
Reimplemented from tracktion::engine::Clip.
|
overridevirtual |
Reimplemented from tracktion::engine::Clip.
|
overridevirtual |
Reimplemented from tracktion::engine::Clip.
Reimplemented from tracktion::engine::Clip.
Reimplemented from tracktion::engine::Clip.
Reimplemented in tracktion::engine::ContainerClip.
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
bool tracktion::engine::AudioClipBase::getAutoDetectBeats | ( | ) | const |
Returns true if auto-detect of beats is enabled.
References autoDetectBeats.
Sets the beat sensitivity, triggering a LoopInfo update if auto-detect is enabled.
float tracktion::engine::AudioClipBase::getBeatSensitivity | ( | ) | const |
Returns the beat sensitivity.
References beatSensitivity.
|
overridevirtual |
Reimplemented from tracktion::engine::Clip.
Reimplemented in tracktion::engine::ContainerClip.
Reimplemented from tracktion::engine::Clip.
void tracktion::engine::AudioClipBase::setTimeStretchMode | ( | TimeStretcher::Mode | mode | ) |
Sets a time-stretch mode to use.
|
noexcept |
Returns the time-stretch mode that has been set.
|
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.
Enables/disables auto-tempo.
If enabled, this clip will adjust its playback speed to stay in sync with the Edit's TempoSequence.
References autoTempo.
bool tracktion::engine::AudioClipBase::getAutoTempo | ( | ) | const |
Returns true if auto-tempo has been set.
References autoTempo.
Referenced by beatBasedLooping(), and isLooping().
Enables/disables auto-pitch.
If enabled, this clip will adjust its playback pitch to stay in sync with the Edit's PitchSequence.
References autoPitch.
bool tracktion::engine::AudioClipBase::getAutoPitch | ( | ) | const |
Returns true if auto-pitch has been set.
References autoPitch.
void tracktion::engine::AudioClipBase::setAutoPitchMode | ( | AutoPitchMode | m | ) |
Sets the AutoPitchMode to use.
References autoPitchMode.
AutoPitchMode tracktion::engine::AudioClipBase::getAutoPitchMode | ( | ) |
Returns the AutoPitchMode in use.
References autoPitchMode.
Enables/disables warp time.
Warp Time enables segmented warping of the audio.
References warpTime.
bool tracktion::engine::AudioClipBase::getWarpTime | ( | ) | const |
Returns true if warp time is enabled.
References warpTime.
WarpTimeManager & tracktion::engine::AudioClipBase::getWarpTimeManager | ( | ) | const |
Returns the WarpTimeManager for this clip used to maipluate warp markers.
Sets the number of semitones to transpose the clip by.
References transpose.
Returns the number of semitones this clip will be changed by.
N.B. this is used if auto-pitch is enabled.
includeAutoPitch | If true, this will include the changes defined by auto-pitch. If false, this will only be the number explicitly set in setTranspose |
Sets the number of semitones to transpose the clip by.
N.B. this is only used if auto-pitch is disabled.
References pitchChange.
float tracktion::engine::AudioClipBase::getPitchChange | ( | ) | const |
Returns the number of semitones to transpose the clip by.
References pitchChange.
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.
Enables reversing of the clip's source material.
References isReversed.
|
noexcept |
Returns true if the clip's source material is reversed.
References isReversed.
bool tracktion::engine::AudioClipBase::performTempoDetect | ( | ) |
Performs a tempo-detection task and if successful sets the clip's LoopInfo tempo to this.
Returns an array of the root note choices e.g.
"C#" etc.
juce::StringArray tracktion::engine::AudioClipBase::getPitchChoices | ( | ) |
Returns an array describng what pitch each semitone change will be.
Returns true if this clip can have ClipEffects added to it.
Reimplemented in tracktion::engine::EditClip.
References isReversed, and warpTime.
Enables/disables ClipEffects for this clip.
enable | Whether to turn on/off clip FX for this clip |
warn | If true and clip FX are enabled, this will show a confirmation dialog to the user first |
bool tracktion::engine::AudioClipBase::effectsEnabled | ( | ) | const |
Returns true if ClipEffects are enabled.
References clipEffects.
Adds a ClipEffect to this clip.
Sets the effectsVisible flag for this clip.
References clipEffectsVisible.
bool tracktion::engine::AudioClipBase::getEffectsVisible | ( | ) | const |
Returns true if the effectsVisible flag is set for this clip.
References clipEffectsVisible.
|
noexcept |
Returns the ClipEffects for this clip if it has been enabled.
References clipEffects.
bool tracktion::engine::AudioClipBase::canSnapToOriginalBWavTime | ( | ) |
Returns true if source file has a bwav time reference metadata property.
void tracktion::engine::AudioClipBase::snapToOriginalBWavTime | ( | ) |
Moves the clip to the bwav time reference metadata property time.
|
virtual |
Returns the ProjectItemID of the clip's takes.
Reimplemented in tracktion::engine::WaveAudioClip.
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.
Should return true if the clip is referencing the file in any way.
Reimplemented in tracktion::engine::ContainerClip, tracktion::engine::WaveAudioClip, and tracktion::engine::EditClip.
Returns the AudioFile to create to play this clip back.
renderTimestretched | If true, this should be a time-stretched version of the clip |
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.
|
noexcept |
Retuns true if this clip can use a proxy file.
References tracktion::engine::TrackItem::edit, and proxyAllowed.
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.
std::unique_ptr< ProxyRenderingInfo > tracktion::engine::AudioClipBase::createProxyRenderingInfo | ( | ) |
Creates a ProxyRenderingInfo object to decribe the stretch segements of this clip.
HashCode tracktion::engine::AudioClipBase::getProxyHash | ( | ) |
Returns a hash identifying the proxy settings.
void tracktion::engine::AudioClipBase::beginRenderingNewProxyIfNeeded | ( | ) |
Triggers creation of a new proxy file if one is required.
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 ]]
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.
ResamplingQuality tracktion::engine::AudioClipBase::getResamplingQuality | ( | ) | const |
Returns the resampling quality to the be used.
void tracktion::engine::AudioClipBase::reverseLoopPoints | ( | ) |
Reverses the loop points to expose the same section of the source file but reversed.
void tracktion::engine::AudioClipBase::checkFadeLengthsForOverrun | ( | ) |
Trims the fade in out lengths to avoid any overlap between them.
AudioClipBase * tracktion::engine::AudioClipBase::getOverlappingClip | ( | ClipDirection | ) | const |
Returns the previous/next overlapping clip if one exists.
bool tracktion::engine::AudioClipBase::isUsingMelodyne | ( | ) | const |
Returns true if this clip is using Melodyne.
void tracktion::engine::AudioClipBase::showMelodyneWindow | ( | ) |
Shows the Melodyne window if this clip is using Melodyne.
void tracktion::engine::AudioClipBase::hideMelodyneWindow | ( | ) |
Hides the Melodyne window if this clip is using Melodyne.
void tracktion::engine::AudioClipBase::melodyneConvertToMIDI | ( | ) |
If this clip is using Melodyne, this will create a new MIDI clip based on the Melodyne analysis.
void tracktion::engine::AudioClipBase::loadMelodyneState | ( | ) |
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.
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!
|
overridevirtual |
Reimplemented from tracktion::engine::Clip.
Reimplemented in tracktion::engine::ContainerClip, tracktion::engine::EditClip, and tracktion::engine::WaveAudioClip.
Reimplemented from tracktion::engine::Clip.
Reimplemented in tracktion::engine::ContainerClip, tracktion::engine::EditClip, and tracktion::engine::WaveAudioClip.
|
overridevirtual |
Reimplemented from tracktion::engine::Clip.
Reimplemented in tracktion::engine::ContainerClip.
Reimplemented from tracktion::engine::Clip.
Implements tracktion::engine::Clip.
|
overridevirtual |
Reimplemented from tracktion::engine::Selectable.
Reimplemented in tracktion::engine::EditClip.
|
overridevirtual |
Implements tracktion::engine::Clip.
|
overridevirtual |
Reimplemented from tracktion::engine::Clip.
void tracktion::engine::AudioClipBase::addMark | ( | TimePosition | relCursorPos | ) |
void tracktion::engine::AudioClipBase::moveMarkTo | ( | TimePosition | relCursorPos | ) |
void tracktion::engine::AudioClipBase::deleteMark | ( | TimePosition | relCursorPos | ) |
void tracktion::engine::AudioClipBase::getRescaledMarkPoints | ( | juce::Array< TimePosition > & | rescaled, |
juce::Array< int > & | orig | ||
) | const |
|
overridevirtual |
Reimplemented from tracktion::engine::Clip.
|
overridevirtual |
Implements tracktion::engine::Exportable.
|
overridevirtual |
Implements tracktion::engine::Exportable.
Reimplemented in tracktion::engine::WaveAudioClip.
|
overridevirtual |
Reimplemented from tracktion::engine::Clip.
|
overridevirtual |
Reimplemented from tracktion::engine::Clip.
|
overridevirtual |
Reimplemented from tracktion::engine::Clip.
|
overridevirtual |
Reimplemented from tracktion::engine::Clip.
|
overridevirtual |
Reimplemented from tracktion::engine::Clip.
|
overridevirtual |
Reimplemented from tracktion::engine::Clip.
|
overridevirtual |
Reimplemented from tracktion::engine::Clip.
|
overridevirtual |
Reimplemented from tracktion::engine::Clip.
|
overridevirtual |
Reimplemented from tracktion::engine::Clip.
References pluginList.
|
protected |
|
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.
|
overrideprotected |
|
overrideprotected |
|
overrideprotected |
|
overrideprotected |
|
overrideprotected |
juce::ReferenceCountedObjectPtr<MelodyneFileReader> tracktion::engine::AudioClipBase::melodyneProxy |
The MelodyneFileReader proxy if this clip is using Melodyne.
juce::CachedValue<TimeStretcher::ElastiqueProOptions> tracktion::engine::AudioClipBase::elastiqueProOptions |
The ElastiqueProOptions for fine tuning Elastique (if available).
|
protected |
Referenced by getGain(), getGainDB(), getPan(), isMuted(), and setMuted().
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
Referenced by getFadeInType().
|
protected |
Referenced by getFadeOutType().
|
protected |
Referenced by getAutoCrossfade(), and setAutoCrossfade().
|
protected |
Referenced by getFadeInBehaviour(), and setFadeInBehaviour().
|
protected |
Referenced by getFadeOutBehaviour(), and setFadeOutBehaviour().
|
protected |
|
protected |
|
protected |
Referenced by isLooping().
|
protected |
|
protected |
Referenced by isLooping().
|
protected |
Referenced by canUseProxy().
|
protected |
Referenced by setTranspose().
|
protected |
Referenced by getPitchChange(), getPitchRatio(), and setPitchChange().
|
protected |
Referenced by getLoopInfo(), and getLoopInfo().
|
protected |
Referenced by getBeatSensitivity().
|
protected |
|
protected |
Referenced by getAutoPitch(), and setAutoPitch().
|
protected |
Referenced by getAutoTempo(), and setAutoTempo().
|
protected |
Referenced by canHaveEffects(), getIsReversed(), and setIsReversed().
|
protected |
Referenced by getAutoDetectBeats().
|
protected |
Referenced by canHaveEffects(), getWarpTime(), and setWarpTime().
|
protected |
Referenced by getEffectsVisible(), and setEffectsVisible().
|
protected |
Referenced by getAutoPitchMode(), and setAutoPitchMode().
|
mutableprotected |
|
mutableprotected |
|
protected |
Referenced by effectsEnabled(), and getClipEffects().
|
mutableprotected |
|
protected |
Referenced by getActiveChannels().
|
protected |
Referenced by getPluginList().
|
protected |
|
protected |