|
tracktion-engine 3.0-10-g034fdde4aa5
Tracktion Engine — High level data model for audio applications
« « « Anklang Documentation |
An instance of an InputDevice that's available to an Edit. More...
#include "tracktion_InputDevice.h"
Classes | |
| struct | Consumer |
| Base class for classes that want to listen to an InputDevice and get a callback for each block of input. More... | |
| struct | Destination |
| struct | DestinationList |
| struct | MidiInputDestination |
| class | RecordingContext |
| Base class for RecordingContexts. More... | |
| struct | RecordingParameters |
| struct | StopRecordingParameters |
| The params passed to stopRecording. More... | |
| struct | VirtualMidiInputDestination |
| struct | WaveInputDestination |
Public Types | |
| using | PreparedContext = std::vector< tl::expected< std::unique_ptr< RecordingContext >, juce::String > > |
| An array of either valid RecordingContexts or an error message if the recording couldn't be started. | |
Public Member Functions | |
| InputDeviceInstance (InputDevice &, EditPlaybackContext &) | |
| ~InputDeviceInstance () override | |
| Destructor. | |
| InputDevice & | getInputDevice () noexcept |
| Returns the InputDevice this instance belongs to. | |
| juce::Array< EditItemID > | getTargets () const |
| Returns the targets this instance is assigned to. | |
| tl::expected< Destination *, juce::String > | setTarget (EditItemID targetID, bool moveToTrack, juce::UndoManager *, std::optional< int > index=std::nullopt) |
| Assigns this input to either an AudioTrack or a ClipSlot. | |
| juce::Result | removeTarget (EditItemID targetID, juce::UndoManager *) |
| Removes the destination with the given targetID. | |
| virtual bool | isLivePlayEnabled (const Track &) const |
| Whether the track should monitor the input or not. | |
| virtual bool | isRecordingActive () const |
| Returns true if recording is enabled and the input is connected to any target. | |
| virtual bool | isRecordingActive (EditItemID) const |
| Returns true if recording is enabled and the input is connected the given target. | |
| virtual bool | isRecordingQueuedToStop (EditItemID)=0 |
| Returns true if the async stopRecording function has been used and this target is waiting to stop. | |
| bool | isRecordingEnabled (EditItemID) const |
| Returns true if recording is enabled for the given target. | |
| void | setRecordingEnabled (EditItemID, bool) |
| Enabled/disables recording for a given target. | |
| virtual bool | shouldTrackContentsBeMuted (const Track &) |
| Should return true if this input is currently actively recording into a track and it wants the existing track contents to be muted. | |
| virtual PreparedContext | prepareToRecord (RecordingParameters)=0 |
| Prepares a recording operation. | |
| virtual std::vector< std::unique_ptr< RecordingContext > > | startRecording (std::vector< std::unique_ptr< RecordingContext > >)=0 |
| Starts a recording. | |
| virtual tl::expected< Clip::Array, juce::String > | stopRecording (StopRecordingParameters)=0 |
| Stops a recording. | |
| virtual void | stopRecording (StopRecordingParameters, std::function< void(tl::expected< Clip::Array, juce::String >)>)=0 |
| Stops a recording asyncronously. | |
| virtual bool | isRecording (EditItemID)=0 |
| Returns true if there are any active recordings for this device. | |
| virtual bool | isRecording ()=0 |
| Returns true if there are any active recordings for this device. | |
| virtual juce::File | getRecordingFile (EditItemID) const |
| Returns the File that the given target is currently recording to. | |
| virtual std::shared_ptr< choc::fifo::SingleReaderSingleWriterFIFO< juce::MidiMessage > > | getRecordingNotes (EditItemID) const |
| Returns a fifo of recorded MIDInotes that can be used for drawing UI components. | |
| virtual TimePosition | getPunchInTime (EditItemID)=0 |
| Returns the time that a given target started recording. | |
| virtual juce::Array< Clip * > | applyRetrospectiveRecord (bool armedOnly)=0 |
| Takes the retrospective buffer and creates clips from it, as if recording had been triggered in the past and stopped at the time of calling this function. | |
| virtual void | addConsumer (Consumer *)=0 |
| Base classes should override this to add any Consumers internally. | |
| virtual void | removeConsumer (Consumer *)=0 |
| Base classes should override this to remove the Consumer internally. | |
Public Attributes | |
| juce::ValueTree | state |
| InputDevice & | owner |
| The state of this instance. | |
| EditPlaybackContext & | context |
| The EditPlaybackContext this instance belongs to. | |
| Edit & | edit |
| The Edit this instance belongs to. | |
| DestinationList | destinations |
| The list of assigned destinations. | |
Protected Member Functions | |
| void | valueTreePropertyChanged (juce::ValueTree &, const juce::Identifier &) override |
| void | valueTreeChildAdded (juce::ValueTree &, juce::ValueTree &) override |
| void | valueTreeChildRemoved (juce::ValueTree &, juce::ValueTree &, int) override |
| ClipSlot * | getFreeSlot (AudioTrack &) |
Protected Member Functions inherited from juce::ValueTree::Listener | |
| virtual void | valueTreeChildOrderChanged (ValueTree &parentTreeWhoseChildrenHaveMoved, int oldIndex, int newIndex) |
| virtual void | valueTreeParentChanged (ValueTree &treeWhoseParentHasChanged) |
| virtual void | valueTreeRedirected (ValueTree &treeWhichHasBeenChanged) |
An instance of an InputDevice that's available to an Edit.
Whereas InputDevice[s] are Engine level objects, instances apply to an Edit and can therefore be assigned to slots/tracks etc.
Definition at line 108 of file tracktion_InputDevice.h.
| struct tracktion::engine::InputDeviceInstance::RecordingParameters |
Definition at line 161 of file tracktion_InputDevice.h.
| Class Members | ||
|---|---|---|
| TimeRange | punchRange | The transport time range at which the recording should happen. |
| vector< EditItemID > | targets | The targets to record to, if this is empty, all armed targets will be added. |
| struct tracktion::engine::InputDeviceInstance::StopRecordingParameters |
The params passed to stopRecording.
Definition at line 208 of file tracktion_InputDevice.h.
| Class Members | ||
|---|---|---|
| bool | discardRecordings | Whether to discard recordings or keep them. |
| bool | isLooping | Whether to treat the stopped recordings as looped or not. |
| TimeRange | markedRange | The marked range used for either loop or punch times. |
| vector< EditItemID > | targetsToStop |
The targets to stop, others will continue allowing you to punch out only specific targets. If this is empty, all active recordings will be stopped. |
| TimePosition | unloopedTimeToEndRecording |
The TimePosition this recording should be stopped at.
|
| using tracktion::engine::InputDeviceInstance::PreparedContext = std::vector<tl::expected<std::unique_ptr<RecordingContext>, juce::String> > |
An array of either valid RecordingContexts or an error message if the recording couldn't be started.
Definition at line 189 of file tracktion_InputDevice.h.
| tracktion::engine::InputDeviceInstance::InputDeviceInstance | ( | InputDevice & | d, |
| EditPlaybackContext & | c | ||
| ) |
Definition at line 89 of file tracktion_InputDevice.cpp.
|
override |
Destructor.
Definition at line 110 of file tracktion_InputDevice.cpp.
|
pure virtual |
Base classes should override this to add any Consumers internally.
Implemented in tracktion::engine::WaveInputDeviceInstance.
|
pure virtual |
Takes the retrospective buffer and creates clips from it, as if recording had been triggered in the past and stopped at the time of calling this function.
Implemented in tracktion::engine::MidiInputDeviceInstanceBase, and tracktion::engine::WaveInputDeviceInstance.
|
protected |
Definition at line 291 of file tracktion_InputDevice.cpp.
|
noexcept |
Returns the InputDevice this instance belongs to.
Definition at line 122 of file tracktion_InputDevice.h.
|
pure virtual |
Returns the time that a given target started recording.
Implemented in tracktion::engine::MidiInputDeviceInstanceBase, and tracktion::engine::WaveInputDeviceInstance.
|
virtual |
Returns the File that the given target is currently recording to.
Reimplemented in tracktion::engine::WaveInputDeviceInstance.
Definition at line 240 of file tracktion_InputDevice.h.
|
virtual |
Returns a fifo of recorded MIDInotes that can be used for drawing UI components.
Reimplemented in tracktion::engine::MidiInputDeviceInstanceBase.
Definition at line 243 of file tracktion_InputDevice.h.
| juce::Array< EditItemID > tracktion::engine::InputDeviceInstance::getTargets | ( | ) | const |
Returns the targets this instance is assigned to.
Definition at line 115 of file tracktion_InputDevice.cpp.
|
virtual |
Whether the track should monitor the input or not.
Definition at line 224 of file tracktion_InputDevice.cpp.
|
pure virtual |
Returns true if there are any active recordings for this device.
Implemented in tracktion::engine::MidiInputDeviceInstanceBase, and tracktion::engine::WaveInputDeviceInstance.
|
pure virtual |
Returns true if there are any active recordings for this device.
Implemented in tracktion::engine::MidiInputDeviceInstanceBase, and tracktion::engine::WaveInputDeviceInstance.
|
virtual |
Returns true if recording is enabled and the input is connected to any target.
Reimplemented in tracktion::engine::MidiInputDeviceInstanceBase, and tracktion::engine::WaveInputDeviceInstance.
Definition at line 189 of file tracktion_InputDevice.cpp.
|
virtual |
Returns true if recording is enabled and the input is connected the given target.
Reimplemented in tracktion::engine::MidiInputDeviceInstanceBase, and tracktion::engine::WaveInputDeviceInstance.
Definition at line 198 of file tracktion_InputDevice.cpp.
| bool tracktion::engine::InputDeviceInstance::isRecordingEnabled | ( | EditItemID | targetID | ) | const |
Returns true if recording is enabled for the given target.
Definition at line 207 of file tracktion_InputDevice.cpp.
|
pure virtual |
Returns true if the async stopRecording function has been used and this target is waiting to stop.
Implemented in tracktion::engine::MidiInputDeviceInstanceBase, and tracktion::engine::WaveInputDeviceInstance.
|
pure virtual |
Prepares a recording operation.
| RecordingParameters | Determines the destinations and punch ranges |
Implemented in tracktion::engine::MidiInputDeviceInstanceBase, tracktion::engine::PhysicalMidiInputDeviceInstance, and tracktion::engine::WaveInputDeviceInstance.
|
pure virtual |
Base classes should override this to remove the Consumer internally.
Implemented in tracktion::engine::WaveInputDeviceInstance.
| juce::Result tracktion::engine::InputDeviceInstance::removeTarget | ( | EditItemID | targetID, |
| juce::UndoManager * | um | ||
| ) |
Removes the destination with the given targetID.
Definition at line 173 of file tracktion_InputDevice.cpp.
| void tracktion::engine::InputDeviceInstance::setRecordingEnabled | ( | EditItemID | targetID, |
| bool | b | ||
| ) |
Enabled/disables recording for a given target.
If the transport is currently recording, this will start a punch-in recording.
Definition at line 217 of file tracktion_InputDevice.cpp.
| tl::expected< InputDeviceInstance::Destination *, juce::String > tracktion::engine::InputDeviceInstance::setTarget | ( | EditItemID | targetID, |
| bool | moveToTrack, | ||
| juce::UndoManager * | um, | ||
| std::optional< int > | index = std::nullopt |
||
| ) |
Assigns this input to either an AudioTrack or a ClipSlot.
Definition at line 136 of file tracktion_InputDevice.cpp.
|
virtual |
Should return true if this input is currently actively recording into a track and it wants the existing track contents to be muted.
Reimplemented in tracktion::engine::MidiInputDeviceInstanceBase, and tracktion::engine::WaveInputDeviceInstance.
Definition at line 157 of file tracktion_InputDevice.h.
|
pure virtual |
Starts a recording.
| The | prepared recording contexts to start. |
Implemented in tracktion::engine::MidiInputDeviceInstanceBase, and tracktion::engine::WaveInputDeviceInstance.
|
pure virtual |
Stops a recording.
| StopRecordingParameters | determines how stopped recordings are treated. |
Implemented in tracktion::engine::MidiInputDeviceInstanceBase, and tracktion::engine::WaveInputDeviceInstance.
|
pure virtual |
Stops a recording asyncronously.
This can be used to trigger a recording to stop at a time in the future. This function will return immidiately and call the provided callback when the recording actually stops.
| StopRecordingParameters | Determines how stopped recordings are treated. |
| recordingStoppedCallback | A callback to call when the recording stops. |
Implemented in tracktion::engine::MidiInputDeviceInstanceBase, and tracktion::engine::WaveInputDeviceInstance.
|
overrideprotectedvirtual |
Reimplemented from juce::ValueTree::Listener.
Definition at line 263 of file tracktion_InputDevice.cpp.
|
overrideprotectedvirtual |
Reimplemented from juce::ValueTree::Listener.
Definition at line 277 of file tracktion_InputDevice.cpp.
|
overrideprotectedvirtual |
Reimplemented from juce::ValueTree::Listener.
Definition at line 245 of file tracktion_InputDevice.cpp.
| EditPlaybackContext& tracktion::engine::InputDeviceInstance::context |
The EditPlaybackContext this instance belongs to.
Definition at line 256 of file tracktion_InputDevice.h.
| DestinationList tracktion::engine::InputDeviceInstance::destinations |
The list of assigned destinations.
Definition at line 364 of file tracktion_InputDevice.h.
| Edit& tracktion::engine::InputDeviceInstance::edit |
The Edit this instance belongs to.
Definition at line 257 of file tracktion_InputDevice.h.
| InputDevice& tracktion::engine::InputDeviceInstance::owner |
The state of this instance.
The InputDevice this is an instance of.
Definition at line 255 of file tracktion_InputDevice.h.
| juce::ValueTree tracktion::engine::InputDeviceInstance::state |
Definition at line 254 of file tracktion_InputDevice.h.