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

« « « Anklang Documentation
Loading...
Searching...
No Matches
tracktion_Edit.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
14class ClipEffect;
15
16//==============================================================================
63class Edit : public Selectable,
64 private juce::Timer
65{
66public:
67 //==============================================================================
80
91
92 //==============================================================================
109
111 Edit (Options);
112
114 Edit (Engine&, EditRole);
115
117 ~Edit() override;
118
121
122 //==============================================================================
125
131
142
145
147 ProjectItemID getProjectItemID() const noexcept { return editProjectItemID; }
148
149 //==============================================================================
151 EditRole getEditRole() const noexcept { return editRole; }
152
154 bool shouldPlay() const noexcept { return (editRole & playDisabled) == 0; }
155
157 bool canRenderProxies() const noexcept { return (editRole & proxiesDisabled) == 0; }
158
160 bool shouldLoadPlugins() const noexcept { return (editRole & pluginsDisabled) == 0; }
161
163 bool getIsPreviewEdit() const noexcept { return isPreviewEdit; }
164
165 //==============================================================================
167 static constexpr double maximumLength = 48.0 * 60.0 * 60.0;
168
170 static TimeDuration getMaximumLength() { return TimeDuration::fromSeconds (maximumLength); }
171
173 static TimeRange getMaximumEditTimeRange() { return { TimePosition(), TimePosition::fromSeconds (maximumLength) }; }
174
175 static TimePosition getMaximumEditEnd() { return getMaximumEditTimeRange().getEnd(); }
176
177 static const int ticksPerQuarterNote = 960;
179 //==============================================================================
181 void flushState();
182
185
190
192 void resetChangedStatus();
193
195 bool hasChangedSinceSaved() const;
196
198 bool isLoading() const { return isLoadInProgress; }
199
200 //==============================================================================
202 static std::unique_ptr<Edit> createEdit (Options);
203
205 static std::unique_ptr<Edit> createEditForPreviewingFile (Engine&, const juce::File&, const Edit* editToMatch,
206 bool tryToMatchTempo, bool tryToMatchPitch, bool* couldMatchTempo,
207 juce::ValueTree midiPreviewPlugin,
208 juce::ValueTree midiDrumPreviewPlugin = {},
209 bool forceMidiToDrums = false,
210 std::unique_ptr<Edit> editToUpdate = {});
211
214 bool tryToMatchTempo, bool* couldMatchTempo,
215 juce::ValueTree midiPreviewPlugin,
216 juce::ValueTree midiDrumPreviewPlugin = {},
217 bool forceMidiToDrums = false,
218 std::unique_ptr<Edit> editToUpdate = {});
219
222
225
228
229 //==============================================================================
232
235
238
239 //==============================================================================
242
245
248
249 //==============================================================================
251 TransportControl& getTransport() const noexcept { return *transportControl; }
252
255
256 //==============================================================================
258 ParameterChangeHandler& getParameterChangeHandler() noexcept { return *parameterChangeHandler; }
259
261 ParameterControlMappings& getParameterControlMappings() noexcept { return *parameterControlMappings; }
262
266 AutomationRecordManager& getAutomationRecordManager() noexcept { return *automationRecordManager; }
267
271 AbletonLink& getAbletonLink() const noexcept;
272
273 //==============================================================================
278 {
282 ScopedRenderStatus (Edit&, bool shouldReallocateOnDestruction);
283
288
289 private:
290 Edit& edit;
291 const bool reallocateOnDestruction;
293 };
294
296 bool isRendering() const noexcept { return performingRenderCount.load() > 0; }
297
298 //==============================================================================
301
302 //==============================================================================
304 juce::String getSelectableDescription() override { return TRANS("Edit") + " - \"" + getName() + "\""; }
305
306 //==============================================================================
308 juce::UndoManager& getUndoManager() noexcept { return undoManager; }
309
311 void undo();
312
314 void redo();
315
336
338 static int getDefaultNumUndoLevels() noexcept { return 30; }
339
344 void restartPlayback();
345
346 //==============================================================================
348 TrackList& getTrackList() { return *trackList; }
349
351 void visitAllTracksRecursive (std::function<bool(Track&)>) const;
352
354 void visitAllTopLevelTracks (std::function<bool(Track&)>) const;
355
359 void visitAllTracks (std::function<bool(Track&)>, bool recursive) const;
360
361 //==============================================================================
364
367
370
373
376
384
385 //==============================================================================
388
391
393 void deleteTrack (Track*);
394
396 void ensureNumberOfAudioTracks (int minimumNumTracks);
397
399 void ensureArrangerTrack();
400
402 void ensureTempoTrack();
403
405 void ensureMarkerTrack();
406
408 void ensureChordTrack();
409
411 void ensureMasterTrack();
412
415
418
420 TempoTrack* getTempoTrack() const;
421
423 ChordTrack* getChordTrack() const;
424
427
428 //==============================================================================
430 bool areAnyTracksMuted() const;
431
433 bool areAnyTracksSolo() const;
434
436 bool areAnyTracksSoloIsolate() const;
437
442
443 //==============================================================================
446
449
450 //==============================================================================
453
455 EditItemID createNewItemID (const std::vector<EditItemID>& idsToAvoid) const;
456
457 //==============================================================================
462
463 //==============================================================================
466
469
474
476 PluginList& getMasterPluginList() const noexcept { return *masterPluginList; }
477
478 //==============================================================================
481
484
486 void updateModifierTimers (TimePosition editTime, int numSamples) const;
487
490 {
492 Edit& edit;
493 };
494
496 MacroParameterElement& getGlobalMacros() const { return *globalMacros; }
497
498 //==============================================================================
500 void setLowLatencyMonitoring (bool enabled, const juce::Array<EditItemID>& plugins);
501
503 bool getLowLatencyMonitoring() const noexcept { return lowLatencyMonitoring; }
504
510
512 juce::Array<EditItemID> getLowLatencyDisabledPlugins() { return lowLatencyDisabledPlugins; }
513
514 //==============================================================================
516 RackTypeList& getRackList() const noexcept { jassert (rackTypes != nullptr); return *rackTypes; }
517
519 TrackCompManager& getTrackCompManager() const noexcept { jassert (trackCompManager != nullptr); return *trackCompManager; }
520
521 //==============================================================================
523 juce::String getAuxBusName (int bus) const;
524
526 void setAuxBusName (int bus, const juce::String& name);
527
528 //==============================================================================
532 juce::Array<AutomatableParameter*> getAllAutomatableParams (bool includeTrackParams) const;
533
537 void visitAllAutomatableParams (bool includeTrackParams, const std::function<void(AutomatableParameter&)>&) const;
538
539 //==============================================================================
541 juce::File getVideoFile() const;
542
544 void setVideoFile (const juce::File&, juce::String importDesc);
545
546 //==============================================================================
549
552
553 //==============================================================================
555 PluginCache& getPluginCache() noexcept;
556
559
561 TimeDuration getLength() const;
562
563 //==============================================================================
565 VolumeAndPanPlugin::Ptr getMasterVolumePlugin() const { return masterVolumePlugin; }
566
570 AutomatableParameter::Ptr getMasterSliderPosParameter() const { jassert (masterVolumePlugin != nullptr); return masterVolumePlugin->volParam; }
571
573 AutomatableParameter::Ptr getMasterPanParameter() const { jassert (masterVolumePlugin != nullptr); return masterVolumePlugin->panParam; }
574
578 void setMasterVolumeSliderPos (float);
579
581 void setMasterPanPos (float);
582
584 void pluginChanged (Plugin&) noexcept;
585
586 //==============================================================================
589
592
595
599 void toggleTimecodeMode();
600
605
606 //==============================================================================
609
610 //==============================================================================
613
616
620 void enableTimecodeSync (bool);
621
624
626 TimeDuration getTimecodeOffset() const noexcept { return timecodeOffset; }
627
629 void setTimecodeOffset (TimeDuration newOffset);
630
633
635 void setMidiTimecodeIgnoringHours (bool shouldIgnore);
636
639
642
645
648
654
655 //==============================================================================
657 void setClickTrackRange (TimeRange) noexcept;
658
660 TimeRange getClickTrackRange() const noexcept;
661
663 float getClickTrackVolume() const noexcept { return juce::jlimit (0.2f, 1.0f, clickTrackGain.get()); }
664
667
669 bool isClickTrackDevice (OutputDevice&) const;
670
672 void setClickTrackOutput (const juce::String& deviceName);
673
675 void setClickTrackVolume (float gain);
676
677 //==============================================================================
679 enum class CountIn
680 {
681 none = 0,
682 oneBar = 1,
683 twoBar = 2,
684 twoBeat = 3,
685 oneBeat = 4
686 };
687
689 void setCountInMode (CountIn);
690
692 CountIn getCountInMode() const;
693
695 int getNumCountInBeats() const;
696
697 //==============================================================================
700
701 //==============================================================================
703 void markAsChanged();
704
708 void invalidateStoredLength() noexcept { totalEditLength = {}; }
709
714
715 //==============================================================================
717 bool areAnyClipsUsingFile (const AudioFile&);
718
720 void cancelAllProxyGeneratorJobs() const;
721
723 juce::File getTempDirectory (bool createIfNonExistent) const;
724
726 void setTempDirectory (const juce::File&);
727
728 //==============================================================================
730 struct Metadata
731 {
732 juce::String artist, title, album, date, genre, comment, trackNumber;
733 };
734
737
740
741 //==============================================================================
747
748 //==============================================================================
750 MarkerManager& getMarkerManager() const noexcept { return *markerManager; }
751
754
755 //==============================================================================
757 template<typename OwnerType>
759 {
760 LoadFinishedCallback (OwnerType& o, Edit& e) : owner (o), edit (e)
761 {
762 startTimer (10);
763 }
764
765 void timerCallback() override
766 {
767 if (! edit.isLoading())
768 {
769 stopTimer();
770 owner.editFinishedLoading();
771 }
772 }
773
774 OwnerType& owner;
775 Edit& edit;
776 };
777
778 //==============================================================================
781 {
782 virtual ~WastedMidiMessagesListener() = default;
783
787 };
788
791
794
797
798 //==============================================================================
800 SharedLevelMeasurer::Ptr getPreviewLevelMeasurer() { return previewLevelMeasurer; }
801
803 void setPreviewLevelMeasurer (SharedLevelMeasurer::Ptr p) { previewLevelMeasurer = p; }
804
805 //==============================================================================
807
812
815
824
827
828 juce::ValueTree state { IDs::EDIT };
830
831private:
832 //==============================================================================
833 const int instanceId;
834 std::atomic<ProjectItemID> editProjectItemID { ProjectItemID() };
835
836 // persistent properties (i.e. stuff that gets saved)
837 juce::CachedValue<juce::String> clickTrackDevice;
838 juce::CachedValue<juce::String> midiTimecodeSourceDevice, midiMachineControlSourceDevice, midiMachineControlDestDevice;
840 juce::ValueTree auxBusses, controllerMappings, automapState;
841 std::unique_ptr<ParameterControlMappings> parameterControlMappings;
843 std::unique_ptr<PluginList> masterPluginList;
844 std::unique_ptr<ARADocumentHolder> araDocumentHolder;
845
846 // transient properties (i.e. stuff that doesn't get saved)
847 struct MirroredPluginUpdateTimer;
848 std::unique_ptr<MirroredPluginUpdateTimer> mirroredPluginUpdateTimer;
850 std::unique_ptr<TransportControl> transportControl;
851 mutable std::unique_ptr<AbletonLink> abletonLink;
852 std::unique_ptr<AutomationRecordManager> automationRecordManager;
853 std::unique_ptr<MarkerManager> markerManager;
854 struct UndoTransactionTimer;
855 std::unique_ptr<UndoTransactionTimer> undoTransactionTimer;
856 struct PluginChangeTimer;
857 std::unique_ptr<PluginChangeTimer> pluginChangeTimer;
858 struct FrozenTrackCallback;
859 std::unique_ptr<FrozenTrackCallback> frozenTrackCallback;
860 std::unique_ptr<ParameterChangeHandler> parameterChangeHandler;
862 std::unique_ptr<TrackCompManager> trackCompManager;
865
866 mutable std::optional<TimeDuration> totalEditLength;
867 std::atomic<bool> isLoadInProgress { true };
868 std::atomic<int> performingRenderCount { 0 };
869 bool shouldRestartPlayback = false;
870 bool blinkBright = false;
871 bool lowLatencyMonitoring = false;
872 bool hasChanged = false;
873 bool ignoreLeftViewLimit;
874 LoadContext* loadContext = nullptr;
875 juce::UndoManager undoManager;
876 int numUndoTransactionInhibitors = 0;
877 mutable juce::File tempDirectory;
878 juce::Array<EditItemID> lowLatencyDisabledPlugins;
879 double normalLatencyBufferSizeSeconds = 0.0;
880 bool isPreviewEdit = false;
881 std::atomic<TimePosition> clickMark1Time { TimePosition() }, clickMark2Time { TimePosition() };
882 std::atomic<bool> isFullyConstructed { false };
883 mutable std::atomic<uint64_t> nextID { 0 }; // 0 is used as flag to initialise the next ID count
884
885 #if JUCE_DEBUG
886 mutable std::unordered_set<EditItemID> usedIDs;
887 #endif
888
889 const EditRole editRole;
890
891 struct TreeWatcher;
893
895 std::unique_ptr<EditInputDevices> editInputDevices;
897 std::unique_ptr<LaunchQuantisation> launchQuantisation;
898
899
900 struct ChangedPluginsList;
901 std::unique_ptr<ChangedPluginsList> changedPluginsList;
902
903 struct EditChangeResetterTimer;
905
906 SharedLevelMeasurer::Ptr previewLevelMeasurer;
907 juce::ListenerList<WastedMidiMessagesListener> wastedMidiMessagesListeners;
908
909 //==============================================================================
910 friend struct TrackList;
911
912 Track::Ptr createTrack (const juce::ValueTree&);
913 Track::Ptr loadTrackFrom (juce::ValueTree&);
914 void updateTrackStatuses();
915 void updateTrackStatusesAsync();
916 void moveTrackInternal (Track::Ptr, TrackInsertPoint);
917
918 //==============================================================================
919 void initialise (const Options&);
920 void undoOrRedo (bool isUndo);
921
922 //==============================================================================
923 void initialiseTempoAndPitch();
924 void initialiseTimecode (juce::ValueTree&);
925 void initialiseTransport();
926 void initialiseMasterVolume();
927 void initialiseVideo();
928 void initialiseClickTrack();
929 void initialiseTracks (const Options&);
930 void initialiseAudioDevices();
931 void initialiseRacks();
932 void initialiseMasterPlugins();
933 void initialiseControllerMappings();
934 void initialiseARA();
935 void removeZeroLengthClips();
936 void loadTracks();
937 void loadOldTimeSigInfo();
938 void loadOldVideoInfo (const juce::ValueTree&);
939 void loadOldStyleMarkers();
940
941 void timerCallback() override;
942
943 void readFrozenTracksFiles();
944 void updateFrozenTracks();
945 void needToUpdateFrozenTracks();
946
947 void sanityCheckTrackNames();
948
949 // This constructor has been deprecated - use the other constructor that takes an Options,
950 // or one of the static helper methods for creating an edit
951 Edit (Engine&, juce::ValueTree, EditRole, LoadContext*, int numUndoLevelsToStore);
952
954};
955
956//==============================================================================
959{
960 ~EditDeleter() override;
961
962 void deleteEdit (std::unique_ptr<Edit>);
963
964private:
965 friend class Engine;
966 EditDeleter();
967
968 juce::CriticalSection listLock;
969 juce::OwnedArray<Edit> editsToDelete;
970
971 void handleAsyncUpdate() override;
972
974};
975
976//==============================================================================
979{
980 juce::Array<Edit*> getEdits() const;
981
982private:
983 friend class Engine;
984 friend class Edit;
985 friend class TransportControl;
987 std::atomic<int> numTransportsPlaying { 0 };
988
989 ActiveEdits();
990};
991
992}} // namespace tracktion { inline namespace engine
Type get() const noexcept
void stopTimer() noexcept
void startTimer(int intervalInMilliseconds) noexcept
A track similar to the MarkerTrack but can be used to move sections of an Edit around.
Stores automation data as it's being read in, and writes it back to the edit when recording finishes.
The Tracktion Edit class!
juce::ValueTree inputDeviceState
The ValueTree of the input device states.
ChordTrack * getChordTrack() const
Returns the global ChordTrack.
static std::unique_ptr< Edit > createEditForPreviewingClip(Clip &)
Creates an Edit for previewing a Clip.
InputDeviceInstance * getCurrentInstanceForInputDevice(InputDevice *) const
Returns an InputDeviceInstance for a global InputDevice.
juce::CachedValue< float > clickTrackGain
The gain of the click track.
static std::unique_ptr< Edit > createEdit(Options)
Creates an Edit for the given options.
VolumeAndPanPlugin::Ptr getMasterVolumePlugin() const
Returns the master VolumeAndPanPlugin.
void restartPlayback()
Use this to tell the play engine to rebuild the audio graph if the toplogy has changed.
juce::ValueTree state
The ValueTree of the Edit state.
static TimeRange getMaximumEditTimeRange()
Returns the maximum length an Edit can be.
juce::ValueTree getAutomapState()
Returns the ValueTree used as the Auotmap state.
void ensureMasterTrack()
Creates a MasterTrack if there isn't currently one.
juce::String getClickTrackDevice() const
Returns the name of the device being used as the click track output.
void setTimecodeOffset(TimeDuration newOffset)
Sets the offset to apply to MIDI timecode.
EditPlaybackContext * getCurrentPlaybackContext() const
Returns the active EditPlaybackContext which is what is attached to the DeviceManager.
ARADocumentHolder & getARADocument()
Returns the ARA document handler.
ArrangerTrack * getArrangerTrack() const
Returns the global ArrangerTrack.
void sendMirrorUpdateToAllPlugins(Plugin &) const
Syncronously updates all Plugins[s] mirroring this one.
juce::CachedValue< TimeDuration > videoOffset
The duration in seconds of the video offset.
ParameterControlMappings & getParameterControlMappings() noexcept
Returns the ParameterControlMappings for the Edit.
TimeRange getClickTrackRange() const noexcept
Returns the range the click track will be audible within.
PitchSequence pitchSequence
The global PitchSequence of this Edit.
std::function< juce::File()> editFileRetriever
This callback can be set to return the file for this Edit.
static std::unique_ptr< Edit > createEditForPreviewingFile(Engine &, const juce::File &, const Edit *editToMatch, bool tryToMatchTempo, bool tryToMatchPitch, bool *couldMatchTempo, juce::ValueTree midiPreviewPlugin, juce::ValueTree midiDrumPreviewPlugin={}, bool forceMidiToDrums=false, std::unique_ptr< Edit > editToUpdate={})
Creates an Edit for previewing a file.
void enableTimecodeSync(bool)
Toggles syncing to MIDI timecode.
void setPreviewLevelMeasurer(SharedLevelMeasurer::Ptr p)
Sets a SharedLevelMeasurer to use.
juce::CachedValue< TimeDuration > masterFadeIn
The duration in seconds of the fade in.
void setLowLatencyDisabledPlugins(const juce::Array< EditItemID > &plugins)
First enables all currently disabled latency plugins and then disables the new set.
Track::Ptr insertTrack(TrackInsertPoint, juce::ValueTree, SelectionManager *)
Inserts a new Track with the given state in the Edit.
TimeDuration getTimecodeOffset() const noexcept
Returns the offset to apply to MIDI timecode.
float getClickTrackVolume() const noexcept
Returns the click track volume.
Engine & engine
The Engine to use.
TransportControl & getTransport() const noexcept
Returns the TransportControl which is used to stop/stop/position playback and recording.
SceneList & getSceneList()
Returns a list of Scenes in the Edit.
void warnOfWastedMidiMessages(InputDevice *, Track *)
Triggers a callback to any registered WastedMidiMessagesListener[s].
EditInputDevices & getEditInputDevices() noexcept
Returns the EditInputDevices for the Edit.
juce::CachedValue< juce::String > lastSignificantChange
The last time a change was made to the Edit.
void sendStartStopMessageToPlugins()
Calls Plugin::playStartedOrStopped to handle automation reacording.
void sendSourceFileUpdate()
Sends a 'sourceMediaChanged' call to all the clips.
CountIn getCountInMode() const
Returns the duration of the count in.
std::atomic< float > progress
Progress will be updated as the Edit loads.
void setEditMetadata(Metadata)
Sets the Metadata for the Edit.
juce::File getVideoFile() const
Returns the currently set video file.
EditRole getEditRole() const noexcept
Returns the EditRole.
EditRole
Enum used to determine what an Edit is being used for.
@ forRendering
Creates an Edit for rendering, not output device playback.
@ forExporting
Creates an Edit for exporting/archiving, not playback/rendering.
@ forExamining
Creates an Edit for examining (listing source files etc).
@ proxiesDisabled
Determines if clips and create proxies.
@ pluginsDisabled
Determines if plugins should be loaded.
@ playDisabled
Determines if an EditPlaybackContext is created.
@ forEditing
Creates an Edit for normal use.
void visitAllAutomatableParams(bool includeTrackParams, const std::function< void(AutomatableParameter &)> &) const
Returns all automatable parameters in an Edit.
void ensureTempoTrack()
Creates a TempoTrack if there isn't currently one.
void setMidiTimecodeIgnoringHours(bool shouldIgnore)
Sets whether hours are ignored when syncing to MIDI timecode.
void deleteTrack(Track *)
Deletes a Track.
LaunchQuantisation & getLaunchQuantisation()
Returns the global launch quantisation.
ParameterChangeHandler & getParameterChangeHandler() noexcept
Returns the ParameterChangeHandler for the Edit.
Edit(Options)
Creates an Edit from a set of Options.
Metadata getEditMetadata()
Returns the current Metadata for the Edit.
void setTimecodeFormat(TimecodeDisplayFormat)
Sets the TimecodeDisplayFormat to use.
juce::CachedValue< bool > clickTrackRecordingOnly
Whether the click track should be audible only when recording.
void setClickTrackOutput(const juce::String &deviceName)
Sets the device to use as the click track output.
TimecodeDisplayFormat getTimecodeFormat() const
Returns the current TimecodeDisplayFormat.
void removeWastedMidiMessagesListener(WastedMidiMessagesListener *)
Removes a previously added WastedMidiMessagesListener.
void setClickTrackRange(TimeRange) noexcept
Sets a range for the click track to be audible within.
void sendTempoOrPitchSequenceChangedUpdates()
Sends a message to all the clips to let them know the tempo or pitch sequence has changed.
TimeDuration getLength() const
Returns the end time of last clip.
bool isTimecodeSyncEnabled() const noexcept
Returns true if syncing to MIDI timecode is enabled.
bool areAnyClipsUsingFile(const AudioFile &)
Returns true if any clips are using this file.
CountIn
An enum to determine the duration of the count in.
@ twoBeat
Two beats count in.
@ none
No count in, play starts immidiately.
void ensureMarkerTrack()
Creates a MarkerTrack if there isn't currently one.
void setCurrentMidiMachineControlSource(std::shared_ptr< MidiInputDevice >)
Sets the MidiInputDevice to be used as an MMC source.
void moveTrack(Track::Ptr, TrackInsertPoint)
Moves a track to a new position.
bool areAnyTracksSolo() const
Returns true if any tracks are soloed.
juce::CachedValue< bool > playInStopEnabled
Whether the audio engine should run when playback is stopped.
juce::Array< EditItemID > getLowLatencyDisabledPlugins()
Returns the current set of diabled plugins.
juce::Time getTimeOfLastChange() const
Returns the time the last change occurred.
juce::Array< AutomatableParameter * > getAllAutomatableParams(bool includeTrackParams) const
Returns all automatable parameters in an Edit.
juce::Array< Clip * > findClipsInLinkGroup(juce::String linkGroupID) const
Returns and Clip[s] with the given linkGroupID.
bool shouldPlay() const noexcept
Returns true if this Edit should be played back (or false if it was just opened for inspection).
void removeModifierTimer(ModifierTimer &)
Removes a ModifierTimer previously added.
void setLowLatencyMonitoring(bool enabled, const juce::Array< EditItemID > &plugins)
Toggles low latency monitoring for a set of plugins.
PluginCache & getPluginCache() noexcept
Returns the PluginCache which manages all active Plugin[s] for this Edit.
TrackCompManager & getTrackCompManager() const noexcept
Returns the TrackCompManager for the Edit.
void ensureNumberOfAudioTracks(int minimumNumTracks)
Creates new tracks to ensure the minimum number.
AbletonLink & getAbletonLink() const noexcept
Returns the AbletonLink object.
void setMasterVolumeSliderPos(float)
Sets the master volume level.
juce::String getName()
Returns the name of the Edit if a ProjectItem can be found for it.
juce::ReferenceCountedObjectPtr< FolderTrack > insertNewFolderTrack(TrackInsertPoint, SelectionManager *, bool asSubmix)
Inserts a new FolderTrack in the Edit, optionally as a submix.
void redo()
Redoes the changes undone by the last undo.
juce::CachedValue< ProjectItemID > videoSource
The ProjectItemID of the video source.
AutomationRecordManager & getAutomationRecordManager() noexcept
Returns the AutomationRecordManager for the Edit.
juce::CachedValue< bool > videoMuted
Whether the video source is muted.
void visitAllTopLevelTracks(std::function< bool(Track &)>) const
Visits all top-level tracks (i.e.
std::atomic< bool > shouldExit
Can be set to true to cancel loading the Edit.
juce::ReferenceCountedObjectPtr< AutomationTrack > insertNewAutomationTrack(TrackInsertPoint, SelectionManager *)
Inserts a new AutomationTrack in the Edit.
bool areAnyTracksSoloIsolate() const
Returns true if any tracks are solo isolated.
juce::CachedValue< bool > clickTrackEmphasiseBars
Whether the click track should emphasise bars.
void updateMuteSoloStatuses()
Updates all the tracks and external controller mute/solo statuses.
LoadContext * loadContext
An optional context to be monitor for loading status.
std::shared_ptr< MidiInputDevice > getCurrentMidiMachineControlSource() const
Returns the MidiInputDevice being used as an MMC source.
void cancelAllProxyGeneratorJobs() const
Stops all proxy generator jobs clips may be performing.
juce::CachedValue< TimeDuration > masterFadeOut
The duration in seconds of the fade out.
void setCurrentMidiMachineControlDest(MidiOutputDevice *)
Sets the MidiInputDevice to be used as an MMC destination.
MasterTrack * getMasterTrack() const
Returns the global MasterTrack.
MarkerTrack * getMarkerTrack() const
Returns the global MarkerTrack.
void dispatchPendingUpdatesSynchronously()
If there's a change to send out to the listeners, do it now rather than waiting for the next timer me...
void setProjectItemID(ProjectItemID)
Sets the ProjectItemID of the Edit, this is also stored in the state.
static std::unique_ptr< Edit > createSingleTrackEdit(Engine &, EditRole role=EditRole::forEditing)
Creates an Edit with a single AudioTrack.
juce::CachedValue< bool > midiTimecodeIgnoringHours
Whether the MIDI timecode source ignores hours.
void flushState()
Saves the plugin, automap and ARA states to the state ValueTree.
std::shared_ptr< MidiInputDevice > getCurrentMidiTimecodeSource() const
Returns the MidiInputDevice being used as the MIDI timecode source.
juce::CachedValue< bool > clickTrackEnabled
Whether the click track is enabled.
void setCountInMode(CountIn)
Sets the duration of the count in.
void resetChangedStatus()
Resets the changed status so hasChangedSinceSaved returns false.
int numUndoLevelsToStore
The number of undo levels to use.
void setMasterPanPos(float)
Returns the master pan position.
void pluginChanged(Plugin &) noexcept
Plugins should call this when one of their parameters or state changes to mark the edit as unsaved.
juce::String getSelectableDescription() override
Retuns the description of this Selectable.
MarkerManager & getMarkerManager() const noexcept
Returns the MarkerManager.
SharedLevelMeasurer::Ptr getPreviewLevelMeasurer()
Returns a previously set SharedLevelMeasurer.
void addWastedMidiMessagesListener(WastedMidiMessagesListener *)
Add a WastedMidiMessagesListener to be notified of wasted MIDI messages.
juce::Array< InputDeviceInstance * > getAllInputDevices() const
Returns all the active InputDeviceInstance[s] in the Edit.
bool isRendering() const noexcept
Returns true if the Edit is currently being rendered.
static constexpr double maximumLength
The maximum length an Edit can be.
std::atomic< bool > completed
Set to true once the Edit has loaded.
TrackList & getTrackList()
Returns the TrackList for the Edit which contains all the top level tracks.
TempoSequence tempoSequence
The global TempoSequence of this Edit.
juce::ReferenceCountedObjectPtr< AudioTrack > insertNewAudioTrack(TrackInsertPoint, SelectionManager *)
Inserts a new AudioTrack in the Edit.
void setVideoFile(const juce::File &, juce::String importDesc)
Sets a video file to display.
MacroParameterElement & getGlobalMacros() const
Returns global MacroParameterElement.
bool isLoading() const
Returns true if the Edit's not yet fully loaded.
juce::CachedValue< TimeDuration > timecodeOffset
The duration in seconds of the timecode offset.
void updateMirroredPlugin(Plugin &)
Adds this plugin to a list so mirrored Plugin[s] are updated asyncronously.
void setCurrentMidiTimecodeSource(std::shared_ptr< MidiInputDevice >)
Sets the MidiInputDevice being to be used as the MIDI timecode source.
bool isMidiTimecodeIgnoringHours() const
Returns true if hours are ignored when syncing to MIDI timecode.
ProjectItemID editProjectItemID
The editProjectItemID, must be valid.
void setClickTrackVolume(float gain)
Sets the volume of the click track.
std::function< juce::File(const juce::String &)> filePathResolver
An optional filePathResolver to use.
void ensureArrangerTrack()
Creates an ArrangerTrack if there isn't currently one.
TempoTrack * getTempoTrack() const
Returns the global TempoTrack.
void ensureChordTrack()
Creates a ChordTrack if there isn't currently one.
uint32_t numAudioTracks
If non-zero, will ensure the edit has this many audio tracks.
juce::CachedValue< AudioFadeCurve::Type > masterFadeInType
The curve type of the fade in.
void toggleTimecodeMode()
Toggles the TimecodeDisplayFormat through the available TimecodeType[s].
void invalidateStoredLength() noexcept
Invalidates the stored length so the next call to getLength will update form the Edit contents.
AutomatableParameter::Ptr getMasterSliderPosParameter() const
Returns the master volume AutomatableParameter.
static std::unique_ptr< Edit > createEditForExamining(Engine &, juce::ValueTree, EditRole role=EditRole::forExamining)
Creates an Edit that loads a state, using the role Edit::forExamining.
TimePosition getPreviousTimeOfInterest(TimePosition beforeThisTime)
Finds the previous marker or start/end of a clip after a certain time.
void copyTrack(Track::Ptr, TrackInsertPoint)
Copies a track to a new position.
int getNumCountInBeats() const
Returns the number of beats of the count in.
void visitAllTracksRecursive(std::function< bool(Track &)>) const
Visits all tracks in the Edit with the given function.
void flushPluginStateIfNeeded(Plugin &)
Saves the specified plugin state to the state ValueTree.
void updateMidiTimecodeDevices()
Updates the MIDI timecode/MMC devices.
bool getLowLatencyMonitoring() const noexcept
Returns true if in low latency monitoring mode.
juce::CachedValue< bool > recordingPunchInOut
Whether recoridng only happens within the in/out markers.
static const int ticksPerQuarterNote
The number of ticks per quarter note.
~Edit() override
Destructor.
bool canRenderProxies() const noexcept
Returns true if this Edit can render proxy files.
AutomatableParameter::Ptr getMasterPanParameter() const
Returns the master pan AutomatableParameter.
TimePosition getFirstClipTime() const
Returns the time of first clip.
EditRole role
An optional role to open the Edit with.
EditItemCache< Track > trackCache
Quick way to find and iterate all Track[s] in the Edit.
bool getIsPreviewEdit() const noexcept
Returns true if this Edit is a temporary Edit for previewing files/clips etc.
juce::UndoManager & getUndoManager() noexcept
Returns the juce::UndoManager used for this Edit.
bool hasChangedSinceSaved() const
Returns true if the Edit has changed since it was last saved.
EditItemCache< ClipSlot > clipSlotCache
Quick way to find and iterate all ClipSlot[s] in the Edit.
void setTempDirectory(const juce::File &)
Sets the temp directory for the Edit to use.
static std::unique_ptr< Edit > createEditForPreviewingPreset(Engine &engine, juce::ValueTree, const Edit *editToMatch, bool tryToMatchTempo, bool *couldMatchTempo, juce::ValueTree midiPreviewPlugin, juce::ValueTree midiDrumPreviewPlugin={}, bool forceMidiToDrums=false, std::unique_ptr< Edit > editToUpdate={})
Creates an Edit for previewing a preset.
MidiOutputDevice * getCurrentMidiMachineControlDest() const
Returns the MidiInputDevice being used as an MMC destination.
juce::CachedValue< bool > midiTimecodeSourceDeviceEnabled
Whether a MIDI timecode source is enabled.
EditItemID createNewItemID() const
Returns a new EditItemID to use for a new EditItem.
void undo()
Undoes the most recent changes made.
juce::ValueTree editState
The Edit state.
ProjectItemID getProjectItemID() const noexcept
Returns the ProjectItemID of the Edit.
static int getDefaultNumUndoLevels() noexcept
Returns the default number of undo levels that should be used.
bool shouldLoadPlugins() const noexcept
Returns true if this Edit can load Plugin[s].
bool areAnyTracksMuted() const
Returns true if any tracks are muted.
std::function< juce::File(const juce::String &)> filePathResolver
This callback can be set to resolve file paths.
static TimeDuration getMaximumLength()
Returns the maximum length an Edit can be.
PluginList & getMasterPluginList() const noexcept
Returns the master PluginList.
TimePosition getNextTimeOfInterest(TimePosition afterThisTime)
Finds the next marker or start/end of a clip after a certain time.
void addModifierTimer(ModifierTimer &)
Adds a ModifierTimer to be updated each block.
juce::File getTempDirectory(bool createIfNonExistent) const
Returns the temp directory the Edit it using.
void visitAllTracks(std::function< bool(Track &)>, bool recursive) const
Visits all tracks in the Edit with the given function.
EditItemCache< Clip > clipCache
Quick way to find and iterate all Clip[s] in the Edit.
void initialiseAllPlugins()
Initialises all the plugins.
bool isClickTrackDevice(OutputDevice &) const
Returns true if the given OutputDevice is being used as the click track output.
juce::CachedValue< AudioFadeCurve::Type > masterFadeOutType
The curve type of the fade out.
RackTypeList & getRackList() const noexcept
Returns the RackTypeList which contains all the RackTypes for the Edit.
juce::String getAuxBusName(int bus) const
Returns the name of an aux bus.
void setAuxBusName(int bus, const juce::String &name)
Sets the name of an aux bus.
Track::Ptr insertNewTrack(TrackInsertPoint, const juce::Identifier &xmlType, SelectionManager *)
Inserts a new Track with the given type in the Edit.
void updateModifierTimers(TimePosition editTime, int numSamples) const
Updates all the ModifierTimers with a given edit time and number of samples.
Engine & engine
A reference to the Engine.
std::function< juce::File()> editFileRetriever
An optional editFileRetriever to use.
void markAsChanged()
Marks the edit as being significantly changed and should therefore be saved.
A context passed to the Options struct which will get updated about load process and can be signaled ...
Determines how the Edit will be created.
The Engine is the central class for all tracktion sessions.
An instance of an InputDevice that's available to an Edit.
Represents an input device.
Base class for elements which can contain macro parameters.
A track to represent the master plugins.
Base class for audio or midi output devices, to which a track's output can be sent.
Manages a set of AutomatableParameters for an Edit and notifies controllers and registered listeners ...
Controls the set of midi-controller-to-parameter mappings.
Holds a sequence of plugins.
An ID representing one of the items in a Project.
Holds a pointer to some type of Selectable, which automatically becomes null if the selectable is del...
Represents the Scenes in an Edit.
Base class for things that can be selected, and whose properties can appear in the properties panel.
Manages a list of items that are currently selected.
Holds a list of TempoSetting objects, to form a sequence of tempo changes.
A track to represent the "global" items such as tempo, key changes etc.
Base class for tracks which contain clips and plugins and can be added to Edit[s].
Controls the transport of an Edit's playback.
The built-in Tracktion volume/pan plugin.
#define TRANS(stringLiteral)
#define jassert(expression)
#define JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(className)
T load(T... args)
Type jlimit(Type lowerLimit, Type upperLimit, Type valueToConstrain) noexcept
typedef uint32_t
Represents a duration in real-life time.
Represents a position in real-life time.
A list of all currently open edits.
Deferred Edit object deleter.
ID for objects of type EditElement - e.g.
Holds the global Macros for the Edit.
Calls an editFinishedLoading method on OwnerType once after the Edit has finished loading.
Temporarily removes an Edit from the device manager, optionally re-adding it on destruction.
Disables the creation of a new transaction.
Interface for classes that need to know about unused MIDI messages.
virtual void warnOfWastedMidiMessages(InputDevice *, Track *)=0
Callback to be notified when a MIDI message isn't used by a track because it doesn't have a plugin wh...
Base class for objects which need to know about the global Edit time every block.
Defines the place to insert Track[s].
An iterable list of Track[s] that live either in an Edit or as subtracks of a Track.