tracktion-engine 3.0-10-g034fdde4aa5
Tracktion Engine — High level data model for audio applications

« « « Anklang Documentation
Loading...
Searching...
No Matches
tracktion_AudioClipBase.h
Go to the documentation of this file.
1 /*
2 ,--. ,--. ,--. ,--.
3 ,-' '-.,--.--.,--,--.,---.| |,-.,-' '-.`--' ,---. ,--,--, Copyright 2024
4 '-. .-'| .--' ,-. | .--'| /'-. .-',--.| .-. || \ Tracktion Software
5 | | | | \ '-' \ `--.| \ \ | | | |' '-' '| || | Corporation
6 `---' `--' `--`--'`---'`--'`--' `---' `--' `---' `--''--' www.tracktion.com
7
8 Tracktion Engine uses a GPL/commercial licence - see LICENCE.md for details.
9*/
10
11namespace tracktion { inline namespace engine
12{
13
14//==============================================================================
31class AudioClipBase : public Clip,
33 private juce::Timer
34{
35public:
36 //==============================================================================
39
41 ~AudioClipBase() override;
42
44
45 //==============================================================================
52
56 virtual TimeDuration getSourceLength() const = 0;
57
59 virtual AudioFile getAudioFile() const { return AudioFile (edit.engine, getCurrentSourceFile()); }
60
65
67 virtual juce::File getOriginalFile() const = 0;
68
73 virtual HashCode getHash() const = 0;
74
79 virtual AudioFileInfo getWaveInfo();
80
81 //==============================================================================
86 void markAsDirty();
87
92 void updateSourceFile();
93
95 virtual bool needsRender() const { return false; }
96
103 virtual RenderManager::Job::Ptr getRenderJob (const AudioFile&) { return {}; }
104
108 virtual void renderComplete();
109
115 virtual juce::String getRenderMessage() { return {}; }
116
118 virtual juce::String getClipMessage() { return {}; }
119
121 void cancelCurrentRender();
122
123 //==============================================================================
125 void setGainDB (float dB);
127 float getGainDB() const noexcept { return level->dbGain.get(); }
129 float getGain() const noexcept { return dbToGain (level->dbGain.get()); }
130
134 void setPan (float pan);
136 float getPan() const noexcept { return level->pan.get(); }
137
139 void setMuted (bool shouldBeMuted) override { level->mute = shouldBeMuted; }
141 bool isMuted() const override { return level->mute.get(); }
142
145
146 //==============================================================================
148 void setLeftChannelActive (bool);
150 bool isLeftChannelActive() const;
151
153 void setRightChannelActive (bool);
155 bool isRightChannelActive() const;
156
158 juce::AudioChannelSet getActiveChannels() const { return activeChannels; }
159
160 //==============================================================================
165 bool setFadeIn (TimeDuration length);
167 TimeDuration getFadeIn() const;
168
173 bool setFadeOut (TimeDuration length);
175 TimeDuration getFadeOut() const;
176
180 AudioFadeCurve::Type getFadeInType() const { return fadeInType; }
181
185 AudioFadeCurve::Type getFadeOutType() const { return fadeOutType; }
186
191 void setAutoCrossfade (bool shouldAutoCrossfade) { autoCrossfade = shouldAutoCrossfade; }
193 bool getAutoCrossfade() const noexcept { return autoCrossfade; }
194
200 void updateAutoCrossfadesAsync (bool updateOverlapped);
202 void applyEdgeFades();
203
208 void copyFadeToAutomation (bool fadeIn, bool removeClipFade);
209
210 //==============================================================================
217
219 void setFadeInBehaviour (FadeBehaviour newBehaviour) { fadeInBehaviour = newBehaviour; }
221 FadeBehaviour getFadeInBehaviour() const { return fadeInBehaviour; }
222
224 void setFadeOutBehaviour (FadeBehaviour newBehaviour) { fadeOutBehaviour = newBehaviour; }
226 FadeBehaviour getFadeOutBehaviour() const { return fadeOutBehaviour; }
227
228 //==============================================================================
230 virtual void setLoopDefaults() = 0;
231
235 void setLoopInfo (const LoopInfo&);
237 const LoopInfo& getLoopInfo() const { return loopInfo; }
239 LoopInfo& getLoopInfo() { return loopInfo; }
240
242 TimeRange getLoopRange() const;
243
245 bool canLoop() const override;
247 bool isLooping() const override { return getAutoTempo() ? (loopLengthBeats > BeatDuration()) : (loopLength > TimeDuration()); }
249 bool beatBasedLooping() const override { return isLooping() && getAutoTempo(); }
251 void setNumberOfLoops (int num) override;
253 void disableLooping() override;
255 BeatPosition getLoopStartBeats() const override;
257 TimePosition getLoopStart() const override;
259 BeatDuration getLoopLengthBeats() const override;
261 TimeDuration getLoopLength() const override;
263 void setLoopRange (TimeRange) override;
265 void setLoopRangeBeats (BeatRange) override;
266
272 void setAutoDetectBeats (bool);
274 bool getAutoDetectBeats() const { return autoDetectBeats; }
275
279 void setBeatSensitivity (float s);
281 float getBeatSensitivity() const { return beatSensitivity; }
282
284 void pitchTempoTrackChanged() override;
285
286 //==============================================================================
288 void setSpeedRatio (double newSpeed) override;
289
292
295
301 TimeStretcher::Mode getActualTimeStretchMode() const noexcept;
302
303 //==============================================================================
311
315 void setAutoTempo (bool shouldUseAutoTempo) { autoTempo = shouldUseAutoTempo; }
316
318 bool getAutoTempo() const { return autoTempo; }
319
323 void setAutoPitch (bool shouldUseAutoPitch) { autoPitch = shouldUseAutoPitch; }
324
326 bool getAutoPitch() const { return autoPitch; }
327
329 void setAutoPitchMode (AutoPitchMode m) { autoPitchMode = m; }
330
332 AutoPitchMode getAutoPitchMode() { return autoPitchMode; }
333
337 void setWarpTime (bool shouldUseWarpTime) { warpTime = shouldUseWarpTime; }
338
340 bool getWarpTime() const { return warpTime; }
341
344
346 void setTranspose (int numSemitones) { transpose = juce::jlimit (-24, 24, numSemitones); }
347
353 int getTransposeSemiTones (bool includeAutoPitch) const;
354
358 void setPitchChange (float semitones) { pitchChange = juce::jlimit (-48.0f, 48.0f, semitones); }
359
361 float getPitchChange() const { return pitchChange; }
362
364 float getPitchRatio() const { return juce::jlimit (0.1f, 10.0f, std::pow (2.0f, pitchChange / 12.0f)); }
365
367 void setIsReversed (bool shouldBeReversed) { isReversed = shouldBeReversed; }
368
370 bool getIsReversed() const noexcept { return isReversed; }
371
378 LoopInfo autoDetectBeatMarkers (const LoopInfo& current, bool autoBeat, float sensitivity) const;
379
384 bool performTempoDetect();
385
388
391
392 //==============================================================================
394 virtual bool canHaveEffects() const { return ! (warpTime || isReversed); }
395
400 void enableEffects (bool enable, bool warn);
401
403 bool effectsEnabled() const { return clipEffects != nullptr; }
404
406 void addEffect (const juce::ValueTree& effectsTree);
407
409 void setEffectsVisible (bool b) { clipEffectsVisible = b; }
410
412 bool getEffectsVisible() const { return clipEffectsVisible; }
413
415 ClipEffects* getClipEffects() const noexcept { return clipEffects.get(); }
416
417 //==============================================================================
420
423
424 //==============================================================================
426 virtual juce::Array<ProjectItemID> getTakes() const;
427
428 //==============================================================================
433
434 //==============================================================================
437 {
442
443 std::unique_ptr<AudioSegmentList> audioSegmentList;
444 TimeRange clipTime;
445 double speedRatio;
448
450 bool render (Engine&, const AudioFile&, AudioFileWriter&, juce::ThreadPoolJob* const&, std::atomic<float>& progress) const;
451
452 private:
454 };
455
457 virtual bool isUsingFile (const AudioFile&);
458
462 AudioFile getProxyFileToCreate (bool renderTimestretched);
463
467 void setUsesProxy (bool canUseProxy) noexcept;
468
470 bool canUseProxy() const noexcept { return proxyAllowed && edit.canRenderProxies(); }
471
475 bool usesTimeStretchedProxy() const;
476
479
481 HashCode getProxyHash();
482
485
491
498
501
502 //==============================================================================
504 void reverseLoopPoints();
505
508
510 enum class ClipDirection { previous, next, none };
511
514
515 //==============================================================================
518
520 bool isUsingMelodyne() const;
521
523 void showMelodyneWindow();
524
526 void hideMelodyneWindow();
527
532
534 void loadMelodyneState();
535
550 bool setupARA (bool dontPopupErrorMessages);
551
554
555 //==============================================================================
557 void initialise() override;
559 void cloneFrom (Clip*) override;
561 void flushStateToValueTree() override;
562
563 //==============================================================================
565 void setParent (ClipOwner*) override;
567 bool canBeAddedTo (ClipOwner&) override;
569 void changed() override;
570
571 //==============================================================================
573 juce::Colour getDefaultColour() const override;
576
577 //==============================================================================
579 void addMark (TimePosition relCursorPos);
581 void moveMarkTo (TimePosition relCursorPos);
583 void deleteMark (TimePosition relCursorPos);
588
590 juce::Array<ReferencedItem> getReferencedItems() override;
592 void reassignReferencedItem (const ReferencedItem&, ProjectItemID newID, double newStartTime) override;
593
594 //==============================================================================
598 void setUsesGlobalLaunchQuatisation (bool useGlobal) override { useClipLaunchQuantisation = ! useGlobal; }
600 bool usesGlobalLaunchQuatisation() override { return ! useClipLaunchQuantisation; }
604 FollowActions* getFollowActions() override;
605
606 //==============================================================================
608 bool addClipPlugin (const Plugin::Ptr&, SelectionManager&) override;
610 Plugin::Array getAllPlugins() override;
612 void sendMirrorUpdateToAllPlugins (Plugin&) const override;
614 PluginList* getPluginList() override { return &pluginList; }
615
616protected:
617 //==============================================================================
618 friend class WaveCompManager;
619
620 //==============================================================================
623
624 juce::CachedValue<TimeDuration> fadeIn, fadeOut;
625 TimeDuration autoFadeIn, autoFadeOut;
626 juce::CachedValue<AudioFadeCurve::Type> fadeInType, fadeOutType;
627 juce::CachedValue<bool> autoCrossfade;
628 juce::CachedValue<FadeBehaviour> fadeInBehaviour, fadeOutBehaviour;
629 juce::CachedValue<ResamplingQuality> resamplingQuality;
630
633 juce::CachedValue<BeatPosition> loopStartBeats;
634 juce::CachedValue<BeatDuration> loopLengthBeats;
635
636 juce::CachedValue<int> proxyAllowed;
637 juce::CachedValue<int> transpose;
638 juce::CachedValue<float> pitchChange;
639 LoopInfo loopInfo;
640
641 juce::CachedValue<float> beatSensitivity;
643 juce::CachedValue<bool> autoPitch, autoTempo, isReversed, autoDetectBeats, warpTime, clipEffectsVisible;
645
646 mutable WarpTimeManager::Ptr warpTimeManager;
647 mutable std::unique_ptr<AudioSegmentList> audioSegmentList;
649 mutable AsyncFunctionCaller asyncFunctionCaller;
650
651 juce::AudioChannelSet activeChannels;
652 void updateLeftRightChannelActivenessFlags();
653
654 PluginList pluginList;
655
656 bool lastRenderJobFailed = false;
657
658 RenderManager::Job::Ptr renderJob;
659 AudioFile lastProxy;
660
661 //==============================================================================
665 void createNewProxyAsync();
666
668 void valueTreePropertyChanged (juce::ValueTree&, const juce::Identifier&) override;
670 void valueTreeChildAdded (juce::ValueTree& parent, juce::ValueTree&) override;
672 void valueTreeChildRemoved (juce::ValueTree& parent, juce::ValueTree&, int) override;
674 void valueTreeChildOrderChanged (juce::ValueTree&, int, int) override;
676 void valueTreeParentChanged (juce::ValueTree&) override;
677
678private:
679 //==============================================================================
680 class TempoDetectTask;
681 class BeatSensitivityComp;
682
684 juce::CachedValue<bool> useClipLaunchQuantisation;
685 std::unique_ptr<LaunchQuantisation> launchQuantisation;
686 std::unique_ptr<FollowActions> followActions;
687
688 void updateReversedState();
689 void updateAutoTempoState();
690 void updateClipEffectsState();
691
692 enum { updateCrossfadesFlag = 0, updateCrossfadesOverlappedFlag = 1 };
693 void updateAutoCrossfades (bool updateOverlapped);
694
698 void renderSource();
699 bool shouldAttemptRender() const { return (! lastRenderJobFailed) && needsRender(); }
700
701 void clearCachedAudioSegmentList();
702
703 //==============================================================================
704 void jobFinished (RenderManager::Job& job, bool completedOk) override;
705 void timerCallback() override;
706
707 TimePosition clipTimeToSourceFileTime (TimePosition clipTime);
708
709 //==============================================================================
711};
712
713}} // namespace tracktion { inline namespace engine
714
715namespace juce
716{
717 template <>
718 struct VariantConverter<tracktion::engine::AudioClipBase::FadeBehaviour>
719 {
720 static tracktion::engine::AudioClipBase::FadeBehaviour fromVar (const var& v) { return (tracktion::engine::AudioClipBase::FadeBehaviour) static_cast<int> (v); }
721 static var toVar (tracktion::engine::AudioClipBase::FadeBehaviour v) { return static_cast<int> (v); }
722 };
723
724 template <>
725 struct VariantConverter<tracktion::engine::AudioClipBase::AutoPitchMode>
726 {
727 static tracktion::engine::AudioClipBase::AutoPitchMode fromVar (const var& v) { return (tracktion::engine::AudioClipBase::AutoPitchMode) static_cast<int> (v); }
728 static var toVar (tracktion::engine::AudioClipBase::AutoPitchMode v) { return static_cast<int> (v); }
729 };
730}
Base class for Clips that produce some kind of audio e.g.
FadeBehaviour
Describes the fade behaviour.
@ gainFade
Fade is a volume/gain ramp.
@ speedRamp
Fade is a change of playback speed for tape start/stop effects.
virtual bool needsRender() const
Subclasses should override this to return true if they need the rest of the render callbacks.
void sendMirrorUpdateToAllPlugins(Plugin &) const override
Sends an update to all plugins mirroing the one passed in.
WarpTimeManager & getWarpTimeManager() const
Returns the WarpTimeManager for this clip used to maipluate warp markers.
std::unique_ptr< ProxyRenderingInfo > createProxyRenderingInfo()
Creates a ProxyRenderingInfo object to decribe the stretch segements of this clip.
void setTimeStretchMode(TimeStretcher::Mode mode)
Sets a time-stretch mode to use.
void reverseLoopPoints()
Reverses the loop points to expose the same section of the source file but reversed.
bool usesGlobalLaunchQuatisation() override
Some clip types can be launched, if that's possible, this returns whether the clip's quantisation or ...
void setIsReversed(bool shouldBeReversed)
Enables reversing of the clip's source material.
virtual juce::File getOriginalFile() const =0
Must return the file that the source ProjectItemID refers to.
const LoopInfo & getLoopInfo() const
Returns the LoopInfo being used to describe this clip.
void setAutoCrossfade(bool shouldAutoCrossfade)
Enables/disables auto-crossfading.
float getPitchRatio() const
Returns the pitch change as a normalised ratio.
bool getEffectsVisible() const
Returns true if the effectsVisible flag is set for this clip.
TimeDuration getFadeOut() const
Returns the fade out duration in seconds.
void setWarpTime(bool shouldUseWarpTime)
Enables/disables warp time.
bool performTempoDetect()
Performs a tempo-detection task and if successful sets the clip's LoopInfo tempo to this.
virtual TimeDuration getSourceLength() const =0
Must return the length in seconds of the source material e.g.
virtual bool canHaveEffects() const
Returns true if this clip can have ClipEffects added to it.
AutoPitchMode getAutoPitchMode()
Returns the AutoPitchMode in use.
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.
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 isUsingFile(const AudioFile &)
Should return true if the clip is referencing the file in any way.
virtual void renderComplete()
Callback to indicate that the render has completed.
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 plugi...
bool isRightChannelActive() const
Returns whether the right channel of the clip is enabled.
ClipEffects * getClipEffects() const noexcept
Returns the ClipEffects for this clip if it has been enabled.
const AudioSegmentList & getAudioSegmentList()
Returns an AudioSegmentList describing this file if it is using auto-tempo.
void setAutoPitchMode(AutoPitchMode m)
Sets the AutoPitchMode to use.
float getBeatSensitivity() const
Returns the beat sensitivity.
juce::Colour getDefaultColour() const override
Returns the default colour for this clip.
void setLeftChannelActive(bool)
Enables the left channel of the clip.
bool addClipPlugin(const Plugin::Ptr &, SelectionManager &) override
Adds a plugin to the clip.
ResamplingQuality getResamplingQuality() const
Returns the resampling quality to the be used.
void beginRenderingNewProxyIfNeeded()
Triggers creation of a new proxy file if one is required.
bool getAutoCrossfade() const noexcept
Returns whether auto-crossfade is enabled.
void setGainDB(float dB)
Sets the gain of the clip in dB.
TimeDuration getFadeIn() const
Returns the fade in duration in seconds.
AudioClipBase * getOverlappingClip(ClipDirection) const
Returns the previous/next overlapping clip if one exists.
LaunchQuantisation * getLaunchQuantisation() override
Some clip types can be launched, if that's possible, this returns a quantisation that can be used for...
void updateAutoCrossfadesAsync(bool updateOverlapped)
Triggers an update of the auto-crossfades.
void setRightChannelActive(bool)
Enables the right channel of the clip.
void setFadeInBehaviour(FadeBehaviour newBehaviour)
Sets the fade in behaviour.
void setPan(float pan)
Sets the pan of the clip.
FadeBehaviour getFadeInBehaviour() const
Returns the fade in behaviour.
virtual AudioFile getAudioFile() const
Returns the file used to play back the source and will get proxied etc.
TimeStretcher::Mode getActualTimeStretchMode() const noexcept
Returns the time-stretch mode that is in use.
int getTransposeSemiTones(bool includeAutoPitch) const
Returns the number of semitones this clip will be changed by.
bool isMuted() const override
Returns true if the clip is muted.
BeatDuration getLoopLengthBeats() const override
Returns the length of loop in beats.
Plugin::Array getAllPlugins() override
Returns all the plugins on the clip.
TimePosition getLoopStart() const override
Returns the start time of the loop start point.
bool setFadeIn(TimeDuration length)
Sets the fade in duration in seconds.
void setLoopRangeBeats(BeatRange) override
Sets the loop range the clip should use in beats.
float getPan() const noexcept
Returns the pan of the clip from -1 to 1.
FollowActions * getFollowActions() override
Some clip types can be launched, if that's possible, this can be used to determine the action to perf...
void setPitchChange(float semitones)
Sets the number of semitones to transpose the clip by.
void disableLooping() override
Disables all looping.
TimeDuration getLoopLength() const override
Returns the length of loop in seconds.
void setFadeOutBehaviour(FadeBehaviour newBehaviour)
Sets the fade out behaviour.
void showMelodyneWindow()
Shows the Melodyne window if this clip is using Melodyne.
PluginList * getPluginList() override
Returns the PluginList for this clip if it has one.
void enableEffects(bool enable, bool warn)
Enables/disables ClipEffects for this clip.
void pitchTempoTrackChanged() override
Called when there are pitch or tempo changes made which might require clips to adjust timing informat...
void cancelCurrentRender()
If a render is in progress, this will cancel it.
virtual HashCode getHash() const =0
Must return a unique hash for this clip's source.
bool canLoop() const override
Returns true if this clip is capable of looping.
void setFadeInType(AudioFadeCurve::Type)
Sets the curve shape for the fade in to use.
void flushStateToValueTree() override
Can be overridden to ensure any state (e.g.
AudioFile getProxyFileToCreate(bool renderTimestretched)
Returns the AudioFile to create to play this clip back.
void setBeatSensitivity(float s)
Sets the beat sensitivity, triggering a LoopInfo update if auto-detect is enabled.
virtual void setLoopDefaults()=0
Override this to fill in the LoopInfo structure as best fits the source.
void setNumberOfLoops(int num) override
Sets the clip looping a number of times.
void setLoopRange(TimeRange) override
Sets the loop range the clip should use in seconds.
float getPitchChange() const
Returns the number of semitones to transpose the clip by.
FadeBehaviour getFadeOutBehaviour() const
Returns the fade out behaviour.
bool getWarpTime() const
Returns true if warp time is enabled.
virtual juce::Array< ProjectItemID > getTakes() const
Returns the ProjectItemID of the clip's takes.
bool isLooping() const override
Returns true if this clip is currently looping.
bool getAutoTempo() const
Returns true if auto-tempo has been set.
LiveClipLevel getLiveClipLevel()
Returns a LiveClipLevel which can be used to read the gain, pan and mute statuses.
bool isUsingMelodyne() const
Returns true if this clip is using Melodyne.
juce::StringArray getPitchChoices()
Returns an array describng what pitch each semitone change will be.
void setFadeOutType(AudioFadeCurve::Type newType)
Sets the curve shape for the fade out to use.
TimeRange getLoopRange() const
Returns the loop range in seconds.
float getGainDB() const noexcept
Returns the gain of the clip in dB.
void setMuted(bool shouldBeMuted) override
Mutes or unmutes the clip.
virtual juce::String getClipMessage()
Override this to return a custom message to display over the clip where the "file missing" text usual...
void createNewProxyAsync()
Triggers a source or proxy render after a timeout.
void checkFadeLengthsForOverrun()
Trims the fade in out lengths to avoid any overlap between them.
TimeStretcher::Mode getTimeStretchMode() const noexcept
Returns the time-stretch mode that has been set.
virtual AudioFileInfo getWaveInfo()
Returns the WaveInfo for a clip.
AudioFadeCurve::Type getFadeOutType() const
Returns the curve shape for the fade out to use.
LoopInfo & getLoopInfo()
Returns the LoopInfo being used to describe this clip.
void setAutoPitch(bool shouldUseAutoPitch)
Enables/disables auto-pitch.
bool usesTimeStretchedProxy() const
Retuns true if this clip use a proxy file due to timestretching.
void setSpeedRatio(double newSpeed) override
Sets a speed ratio i.e.
bool isLeftChannelActive() const
Returns whether the left channel of the clip is enabled.
void copyFadeToAutomation(bool fadeIn, bool removeClipFade)
Copies the fade in curve to a volume automation curve.
bool setFadeOut(TimeDuration length)
Sets the fade out duration in seconds.
void initialise() override
Initialises the Clip.
void setTranspose(int numSemitones)
Sets the number of semitones to transpose the clip by.
bool getIsReversed() const noexcept
Returns true if the clip's source material is reversed.
bool beatBasedLooping() const override
Returns true if this clip's looping is based on beats or false if absolute time.
void setEffectsVisible(bool b)
Sets the effectsVisible flag for this clip.
AudioFadeCurve::Type getFadeInType() const
Returns the curve shape for the fade in to use.
bool getAutoPitch() const
Returns true if auto-pitch has been set.
void snapToOriginalBWavTime()
Moves the clip to the bwav time reference metadata property time.
bool setupARA(bool dontPopupErrorMessages)
This internal method is used solely to find out if createAudioNode() should return nullptr or not.
static juce::StringArray getRootNoteChoices(Engine &)
Returns an array of the root note choices e.g.
void setAutoDetectBeats(bool)
Enables auto-detection of beats.
virtual juce::String getRenderMessage()
Override this to return a custom message to be displayed over waveforms during rendering.
float getGain() const noexcept
Returns the gain of the clip.
void markAsDirty()
Resets the dirty flag so that a new render will be attempted.
bool getAutoDetectBeats() const
Returns true if auto-detect of beats is enabled.
TimeDuration getMaximumLength() override
Returns the maximum length for this clip.
void setLoopInfo(const LoopInfo &)
Sets a LoopInfo to describe this clip's tempo, time sig etc.
void applyEdgeFades()
Sets the fade in/out lengths to be 0.03s to avoid any clicks at the start/end of th clip.
std::shared_ptr< LaunchHandle > getLaunchHandle() override
Some clip types can be launched, if that's possible, this returns a handle to trigger starting/stoppi...
juce::ReferenceCountedObjectPtr< MelodyneFileReader > melodyneProxy
The MelodyneFileReader proxy if this clip is using Melodyne.
void setUsesGlobalLaunchQuatisation(bool useGlobal) override
Some clip types can be launched, if that's possible, this sets whether the clip's quantisation or the...
virtual RenderManager::Job::Ptr getRenderJob(const AudioFile &)
Subclasses should override this to return a RenderJob suitable for rendering its source file.
ClipDirection
Defines a prevous/next direction.
bool effectsEnabled() const
Returns true if ClipEffects are enabled.
bool canUseProxy() const noexcept
Retuns true if this clip can use a proxy file.
bool canBeAddedTo(ClipOwner &) override
Tests whether this clip can go on the given parent.
void melodyneConvertToMIDI()
If this clip is using Melodyne, this will create a new MIDI clip based on the Melodyne analysis.
HashCode getProxyHash()
Returns a hash identifying the proxy settings.
void changed() override
This should be called to send a change notification to any SelectableListeners that are registered wi...
AutoPitchMode
Defines the auto pitch mode.
@ chordTrackMono
Clip tracks the chord track with a monophonic pitch change.
@ chordTrackPoly
Clip tracks the pitch track with a polyphonic pitch change.
@ pitchTrack
Clip tracks the Edit's PitchSequence.
void cloneFrom(Clip *) override
Clones the given clip to this clip.
void setResamplingQuality(ResamplingQuality)
Sets the resampling qulity to use.
bool canSnapToOriginalBWavTime()
Returns true if source file has a bwav time reference metadata property.
juce::AudioChannelSet getActiveChannels() const
Returns the layout of the active channels.
void setUsesProxy(bool canUseProxy) noexcept
Can be used to disable proxy file generation for this clip.
void addEffect(const juce::ValueTree &effectsTree)
Adds a ClipEffect to this clip.
AudioFile getPlaybackFile()
Returns the current AudioFile being used by the Clip, either the original source or a proxy.
void hideMelodyneWindow()
Hides the Melodyne window if this clip is using Melodyne.
PatternGenerator * getPatternGenerator() override
Returns the PatternGenerator for this clip if it has one.
void setAutoTempo(bool shouldUseAutoTempo)
Enables/disables auto-tempo.
BeatPosition getLoopStartBeats() const override
Returns the beat position of the loop start point.
juce::CachedValue< TimeStretcher::ElastiqueProOptions > elastiqueProOptions
The ElastiqueProOptions for fine tuning Elastique (if available).
juce::Array< TimePosition > getRescaledMarkPoints() const override
Returns the mark points relative to the start of the clip, rescaled to the current speed.
Smart wrapper for writing to an audio file.
Holds a list of audio regions for playback of things like warp time.
Base class for items that can contain clips.
A clip in an edit.
juce::File getCurrentSourceFile() const
Returns the current source file, this is different to the SourceFileReference as it could be a tempor...
The Engine is the central class for all tracktion sessions.
Holds tempo/beat information about an audio file.
Holds a sequence of plugins.
An ID representing one of the items in a Project.
Manages a list of items that are currently selected.
Handles time/pitch stretching using various supported libraries.
Mode
Holds the various algorithms to which can be used (if enabled).
Type
Defines the types of item that can live on Track[s].
A WarpTimeManager contains a list of WarpMarkers and some source material and maps times from a linea...
T is_pointer_v
#define JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(className)
Type jlimit(Type lowerLimit, Type upperLimit, Type valueToConstrain) noexcept
ResamplingQuality
Specifies a number of resampling qualities that can be used.
T pow(T... args)
Represents a duration in beats.
Represents a position in beats.
Represents a duration in real-life time.
Represents a position in real-life time.
Holds a list of function objects and enables you to call them asyncronously.
Holds information about how to render a proxy for this clip.
bool render(Engine &, const AudioFile &, AudioFileWriter &, juce::ThreadPoolJob *const &, std::atomic< float > &progress) const
Renders this audio segment list to an AudioFile.
Type
A enumeration of the curve classes available.
ID for objects of type EditElement - e.g.
Provides a thread-safe way to share a clip's levels with an audio engine without worrying about the C...
A set of options that can be used in conjunction with the elastiquePro Mode to fine tune the algorith...