11namespace tracktion {
inline namespace engine
52template<
typename TrackType>
101template<
typename TrackItemType>
155 CloseGap,
bool moveAllSubsequentClipsOnTrack);
158SelectableList
splitClips (
const SelectableList& clips, TimePosition time);
203Plugin::Array
getAllPlugins (
const Edit&,
bool includeMasterVolume);
229void midiPanic (Edit&,
bool resetPlugins);
233template<
typename PluginType>
257template<
typename ModifierType>
290 TimePosition playStart,
291 TimePosition punchIn);
309template<
typename PluginType>
312 if (
auto p = track.edit.getPluginCache().createNewPlugin (PluginType::create()))
314 if (
auto pluginAsType =
dynamic_cast<PluginType*
> (p.get()))
316 track.pluginList.insertPlugin (*p, index, {});
325template<
typename TrackType>
333 if (
auto type =
dynamic_cast<TrackType*
> (&t))
343template<
typename TrackItemType>
347 const int numItems = track.getNumTrackItems();
349 for (
int i = 0; i < numItems; ++i)
350 if (
auto ti =
dynamic_cast<TrackItemType*
> (track.getTrackItem (i)))
357template<
typename ModifierType>
361 if (modifier->itemID ==
id)
362 if (
auto asType =
dynamic_cast<ModifierType*
> (modifier))
363 return typename ModifierType::Ptr (asType);
void ensureStorageAllocated(int minNumElements)
void add(const ElementType &newElement)
The Tracktion Edit class!
void visitAllTracks(std::function< bool(Track &)>, bool recursive) const
Visits all tracks in the Edit with the given function.
Base class for tracks which contain clips and plugins and can be added to Edit[s].
juce::File getEditFileFromProjectManager(Edit &edit)
Uses the ProjectManager to look up the file for an Edit.
juce::Array< MacroParameterElement * > getAllMacroParameterElements(const Edit &edit)
Returns all the MacroParameterElement in an Edit.
bool referencesProjectItem(Edit &edit, ProjectItemID itemID)
Returns true if the ProjectItemID is being used for any of the Edit's elements.
AudioTrack * getFirstAudioTrack(const Edit &edit)
Returns the first audio track in an Edit.
void insertSpaceIntoEdit(Edit &edit, TimeRange timeRange)
Inserts blank space in to an Edit, splitting clips if necessary.
TrackOutput * getTrackOutput(Track &track)
Returns the TrackOutput if the given track has one.
SelectableList splitClips(const SelectableList &clips, TimePosition time)
Splits the clips at a given time.
juce::Array< TrackType * > getTracksOfType(const Edit &, bool recursive)
Returns the tracks of a given type in an Edit.
SelectableList getClipSelectionWithCollectionClipContents(const SelectableList &in)
Returns a list of clips.
Track * findTrackForState(const Edit &edit, const juce::ValueTree &v)
Returns the Track with a given state if contained in the Edit.
void deleteAutomation(const SelectableList &selectedClips)
Deletes the automation covered by the selected clips.
Clip * findClipForState(ClipOwner &co, const juce::ValueTree &v)
Returns a clip with the given state if the ClipOwner contains it.
juce::Array< Track * > toTrackArray(Edit &edit, const juce::BigInteger &tracksToAdd)
Returns an Array of Track[s] corresponding to the set bits of all tracks in an Edit.
juce::Array< Track * > getTopLevelTracks(const Edit &edit)
Returns all of the non-foldered tracks in an Edit.
void insertSpaceIntoEditFromBeatRange(Edit &edit, BeatRange beatRange)
Inserts a number of blank beats in to the Edit.
juce::Result mergeMidiClips(juce::Array< MidiClip * > clips, SelectionManager *sm)
Merges a set of MIDI clips in to one new one.
TimeRange getTimeRangeForSelectedItems(const SelectableList &selected)
Returns the time range covered by the given items.
Clip::Ptr duplicateClip(const Clip &c)
Creates a unique copy of this clip with a new EditItemID.
Clip * findClipForID(ClipOwner &co, EditItemID id)
Returns a clip with the given ID if the ClipOwner contains it.
CloseGap
An enum to specify if gaps deleted should be closed or not.
ClipTrack * findFirstClipTrackFromSelection(const SelectableList &items)
Returns the first ClipTrack from the selected tracks or clips.
bool areAnyPluginsMissing(const Edit &edit)
Returns true if any plugins couldn't be loaded beacuse their files are missing.
juce::Array< MacroParameterList * > getAllMacroParameterLists(const Edit &edit)
Returns all the MacroParameterLists in an Edit.
juce::Array< Track * > getAllTracks(const Edit &edit)
Returns all the tracks in an Edit.
int findClipSlotIndex(ClipSlot &slot)
Returns the index of the ClipSlot in the list it is owned by.
ClipOwner * findClipOwnerForID(const Edit &edit, EditItemID id)
Returns the ClipOwner with a given ID if it can be found in the Edit.
bool containsTrack(const Edit &edit, const Track &track)
Returns true if the Edit contains this Track.
juce::Array< Track * > findTracksForIDs(const Edit &edit, const juce::Array< EditItemID > &ids)
Returns the Tracks for the given IDs in the Edit.
tl::expected< Clip::Array, juce::String > punchOutRecording(InputDeviceInstance &instance)
If the instance is currently recording, this will stop it and return any created clips or an error me...
juce::Array< AudioTrack * > getAudioTracks(const Edit &edit)
Returns all the AudioTracks in an Edit.
ModifierType::Ptr findModifierTypeForID(const Edit &, EditItemID)
Returns the Modifier with a given type and ID.
void visitAllTrackItems(const Edit &edit, std::function< bool(TrackItem &)> f)
Calls a function for all TrackItems in an Edit.
Track * getTrackContainingPlugin(const Edit &edit, const Plugin *p)
Returns the track for the track which the plugin is located on.
juce::BigInteger toBitSet(const juce::Array< Track * > &tracks)
Returns the set of tracks as a BigInteger with each bit corresponding to the array of all tracks in a...
juce::Array< AutomatableParameter::ModifierSource * > getAllModifierSources(const Edit &edit)
Returns all the ModifierSources in an Edit.
MidiNote * findNoteForState(const Edit &edit, const juce::ValueTree &v)
Returns the MidiNote with a given state.
Plugin::Ptr findPluginForState(const Edit &edit, const juce::ValueTree &v)
Returns the plugin with given state.
ClipSlot * findClipSlotForID(const Edit &edit, EditItemID id)
Returns the ClipSlot for the given ID.
void deleteRegionOfClip(Clip &c, TimeRange timeRangeToDelete)
Deletes a time range of a Clip.
ProjectItem::Ptr getProjectItemForEdit(const Edit &e)
Tries to find the project item that refers to this edit (but may return nullptr!)
juce::Array< ClipTrack * > getClipTracks(const Edit &edit)
Returns all the ClipTracks in an Edit.
juce::ReferenceCountedArray< Modifier > getAllModifiers(const Edit &edit)
Returns all the Modifiers in an Edit.
Plugin::Ptr findPluginForID(const Edit &edit, EditItemID id)
Returns the plugin with given EditItemID.
void deleteRegionOfTracks(Edit &edit, TimeRange rangeToDelete, bool onlySelected, CloseGap closeGap, SelectionManager *selectionManager)
Deletes a time range of an Edit, optionally closing the gap.
juce::Array< RackInstance * > getRackInstancesInEditForType(const RackType &rt)
Returns all of the instances of a specific RackType in an Edit.
Modifier::Ptr findModifierForID(ModifierList &ml, EditItemID modifierID)
Returns a Modifier if it can be found in the list.
int getTotalNumTracks(const Edit &edit)
Returns the total number of Tracks in an Edit.
juce::Array< AutomatableEditItem * > getAllAutomatableEditItems(const Edit &edit)
Returns all AutomatableEditItems in an Edit.
void deleteRegionOfSelectedClips(SelectionManager &selectionManager, TimeRange rangeToDelete, CloseGap closeGap, bool moveAllSubsequentClipsOnTrack)
Deletes a time range of a Clip selection, optionally closing the gap.
juce::Result prepareAndPunchRecord(InputDeviceInstance &instance, EditItemID targetID)
Starts an InputDeviceInstance recording to the given target without any count-in etc.
Track * getTrackContainingModifier(const Edit &edit, const Modifier::Ptr &m)
Returns the Track containing a Modifier.
juce::OwnedArray< MidiList > readFileToMidiList(juce::File midiFile, bool importAsNoteExpression)
Helper function to read a file to a number of MidiLists.
void injectMIDIToAllPlugins(const Edit &edit, const std::span< juce::MidiMessage > &messages)
Sends a list of MIDI messages to all the plugins in this edit.
Track * findTrackForID(const Edit &edit, EditItemID id)
Returns the Track with a given ID if contained in the Edit.
void muteOrUnmuteAllPlugins(const Edit &edit)
Toggles the enabled state of all plugins in an Edit.
Project::Ptr getProjectForEdit(const Edit &e)
Tries to find the project that contains this edit (but may return nullptr!)
juce::ReferenceCountedObjectPtr< PluginType > insertNewPlugin(Track &, int index=0)
Adds a new instance of the given plugin to the track's plugin list at the specified index.
void moveSelectedClips(const SelectableList &selectedObjectsIn, Edit &edit, MoveClipAction mode, bool automationLocked)
Moves the selected clips within their track.
juce::Array< Track * > findAllTracksContainingSelectedItems(const SelectableList &items)
Returns all the tracks containing the selected tracks or TrackItems.
bool isRecording(EditPlaybackContext &epc)
Returns true if any inputs are currently recording.
void midiPanic(Edit &edit, bool resetPlugins)
Performs a "MIDI panic" on the edit, by resetting playback, and sending some all-note-off messages to...
InputDeviceInstance::RecordingParameters getDefaultRecordingParameters(const EditPlaybackContext &context, TimePosition playStart, TimePosition punchIn)
Returns the default set of recording parameters.
AudioTrack * findAudioTrackForID(const Edit &edit, EditItemID id)
Returns the AudioTrack with a given ID if contained in the Edit.
MoveClipAction
Enum to dictate move clip behaviour.
MidiClip::Ptr createClipFromFile(juce::File midiFile, ClipOwner &owner, bool importAsNoteExpression)
Helper function to read a MIDI file and create a MidiClip from it.
bool containsClip(const Edit &edit, Clip *clip)
Returns true if an Edit contains a given clip.
Plugin::Array getAllPlugins(const Edit &edit, bool includeMasterVolume)
Returns all the plugins in a given Edit.
juce::Array< ClipEffect * > getAllClipEffects(Edit &edit)
Returns all clip effects.
RangeType< TimePosition > TimeRange
A RangeType based on real time (i.e.
ID for objects of type EditElement - e.g.