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

« « « Anklang Documentation
Loading...
Searching...
No Matches
Classes | Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
tracktion::engine::MidiInputDeviceInstanceBase Class Reference
Inheritance diagram for tracktion::engine::MidiInputDeviceInstanceBase:
tracktion::engine::InputDeviceInstance juce::ValueTree::Listener tracktion::engine::PhysicalMidiInputDeviceInstance tracktion::engine::VirtualMidiInputDeviceInstance

Classes

class  MidiRecordingContext
 

Public Member Functions

 MidiInputDeviceInstanceBase (MidiInputDevice &d, EditPlaybackContext &c)
 
bool isRecordingActive () const override
 Returns true if recording is enabled and the input is connected to any target.
 
bool isRecordingActive (EditItemID targetID) const override
 Returns true if recording is enabled and the input is connected the given target.
 
bool isRecordingQueuedToStop (EditItemID targetID) override
 Returns true if the async stopRecording function has been used and this target is waiting to stop.
 
bool shouldTrackContentsBeMuted (const Track &t) override
 Should return true if this input is currently actively recording into a track and it wants the existing track contents to be muted.
 
virtual void handleMMCMessage (const juce::MidiMessage &)
 
virtual bool handleTimecodeMessage (const juce::MidiMessage &)
 
std::shared_ptr< choc::fifo::SingleReaderSingleWriterFIFO< juce::MidiMessage > > getRecordingNotes (EditItemID targetID) const override
 Returns a fifo of recorded MIDInotes that can be used for drawing UI components.
 
std::vector< tl::expected< std::unique_ptr< RecordingContext >, juce::String > > prepareToRecord (RecordingParameters params) override
 Prepares a recording operation.
 
std::vector< std::unique_ptr< RecordingContext > > startRecording (std::vector< std::unique_ptr< RecordingContext > > newContexts) override
 Starts a recording.
 
tl::expected< Clip::Array, juce::StringstopRecording (StopRecordingParameters params) override
 Stops a recording.
 
void stopRecording (StopRecordingParameters params, std::function< void(tl::expected< Clip::Array, juce::String >)> callback) override
 Stops a recording asyncronously.
 
TimePosition getPunchInTime (EditItemID targetID) override
 Returns the time that a given target started recording.
 
bool isRecording (EditItemID targetID) override
 Returns true if there are any active recordings for this device.
 
bool isRecording () override
 Returns true if there are any active recordings for this device.
 
bool handleIncomingMidiMessage (const juce::MidiMessage &message)
 
MidiChannel applyChannel (juce::MidiMessageSequence &sequence, MidiChannel channelToApply)
 
Clip::Array applyRecording (std::unique_ptr< MidiRecordingContext > recContext, TimePosition unloopedEndTime, bool isLooping, TimeRange loopRange, bool discardRecordings)
 
juce::Array< Clip * > applyRetrospectiveRecord (bool armedOnly) override
 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.
 
void masterTimeUpdate (double time)
 
MidiInputDevicegetMidiInput () const
 
- Public Member Functions inherited from tracktion::engine::InputDeviceInstance
 InputDeviceInstance (InputDevice &, EditPlaybackContext &)
 
 ~InputDeviceInstance () override
 Destructor.
 
InputDevicegetInputDevice () noexcept
 Returns the InputDevice this instance belongs to.
 
juce::Array< EditItemIDgetTargets () const
 Returns the targets this instance is assigned to.
 
tl::expected< Destination *, juce::StringsetTarget (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.
 
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 juce::File getRecordingFile (EditItemID) const
 Returns the File that the given target is currently recording to.
 

Static Public Member Functions

static void applyTimeAdjustment (juce::MidiMessageSequence &sequence, double adjustmentMs)
 

Public Attributes

std::shared_mutex contextLock
 
std::vector< std::unique_ptr< MidiRecordingContext > > recordingContexts
 
- Public Attributes inherited from tracktion::engine::InputDeviceInstance
juce::ValueTree state
 
InputDeviceowner
 The state of this instance.
 
EditPlaybackContextcontext
 The EditPlaybackContext this instance belongs to.
 
Editedit
 The Edit this instance belongs to.
 
DestinationList destinations
 The list of assigned destinations.
 

Additional Inherited Members

- Public Types inherited from tracktion::engine::InputDeviceInstance
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.
 
- Protected Member Functions inherited from tracktion::engine::InputDeviceInstance
void valueTreePropertyChanged (juce::ValueTree &, const juce::Identifier &) override
 
void valueTreeChildAdded (juce::ValueTree &, juce::ValueTree &) override
 
ClipSlotgetFreeSlot (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)
 

Detailed Description

Definition at line 780 of file tracktion_MidiInputDevice.cpp.

Constructor & Destructor Documentation

◆ MidiInputDeviceInstanceBase()

tracktion::engine::MidiInputDeviceInstanceBase::MidiInputDeviceInstanceBase ( MidiInputDevice d,
EditPlaybackContext c 
)

Definition at line 783 of file tracktion_MidiInputDevice.cpp.

◆ ~MidiInputDeviceInstanceBase()

tracktion::engine::MidiInputDeviceInstanceBase::~MidiInputDeviceInstanceBase ( )
override

Definition at line 789 of file tracktion_MidiInputDevice.cpp.

Member Function Documentation

◆ applyChannel()

MidiChannel tracktion::engine::MidiInputDeviceInstanceBase::applyChannel ( juce::MidiMessageSequence sequence,
MidiChannel  channelToApply 
)

Definition at line 1060 of file tracktion_MidiInputDevice.cpp.

◆ applyRecording()

Clip::Array tracktion::engine::MidiInputDeviceInstanceBase::applyRecording ( std::unique_ptr< MidiRecordingContext recContext,
TimePosition  unloopedEndTime,
bool  isLooping,
TimeRange  loopRange,
bool  discardRecordings 
)

Definition at line 1089 of file tracktion_MidiInputDevice.cpp.

◆ applyRetrospectiveRecord()

juce::Array< Clip * > tracktion::engine::MidiInputDeviceInstanceBase::applyRetrospectiveRecord ( bool  armedOnly)
overridevirtual

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.

Implements tracktion::engine::InputDeviceInstance.

Definition at line 1366 of file tracktion_MidiInputDevice.cpp.

◆ applyTimeAdjustment()

static void tracktion::engine::MidiInputDeviceInstanceBase::applyTimeAdjustment ( juce::MidiMessageSequence sequence,
double  adjustmentMs 
)
static

Definition at line 1083 of file tracktion_MidiInputDevice.cpp.

◆ getMidiInput()

MidiInputDevice & tracktion::engine::MidiInputDeviceInstanceBase::getMidiInput ( ) const

Definition at line 1485 of file tracktion_MidiInputDevice.cpp.

◆ getPunchInTime()

TimePosition tracktion::engine::MidiInputDeviceInstanceBase::getPunchInTime ( EditItemID  )
overridevirtual

Returns the time that a given target started recording.

Implements tracktion::engine::InputDeviceInstance.

Definition at line 1003 of file tracktion_MidiInputDevice.cpp.

◆ getRecordingNotes()

std::shared_ptr< choc::fifo::SingleReaderSingleWriterFIFO< juce::MidiMessage > > tracktion::engine::MidiInputDeviceInstanceBase::getRecordingNotes ( EditItemID  ) const
overridevirtual

Returns a fifo of recorded MIDInotes that can be used for drawing UI components.

Reimplemented from tracktion::engine::InputDeviceInstance.

Definition at line 818 of file tracktion_MidiInputDevice.cpp.

◆ handleIncomingMidiMessage()

bool tracktion::engine::MidiInputDeviceInstanceBase::handleIncomingMidiMessage ( const juce::MidiMessage message)

Definition at line 1025 of file tracktion_MidiInputDevice.cpp.

◆ handleMMCMessage()

virtual void tracktion::engine::MidiInputDeviceInstanceBase::handleMMCMessage ( const juce::MidiMessage )
virtual

Definition at line 815 of file tracktion_MidiInputDevice.cpp.

◆ handleTimecodeMessage()

virtual bool tracktion::engine::MidiInputDeviceInstanceBase::handleTimecodeMessage ( const juce::MidiMessage )
virtual

Definition at line 816 of file tracktion_MidiInputDevice.cpp.

◆ isRecording() [1/2]

bool tracktion::engine::MidiInputDeviceInstanceBase::isRecording ( )
overridevirtual

Returns true if there are any active recordings for this device.

Implements tracktion::engine::InputDeviceInstance.

Definition at line 1019 of file tracktion_MidiInputDevice.cpp.

◆ isRecording() [2/2]

bool tracktion::engine::MidiInputDeviceInstanceBase::isRecording ( EditItemID  )
overridevirtual

Returns true if there are any active recordings for this device.

Implements tracktion::engine::InputDeviceInstance.

Definition at line 1014 of file tracktion_MidiInputDevice.cpp.

◆ isRecordingActive() [1/2]

bool tracktion::engine::MidiInputDeviceInstanceBase::isRecordingActive ( ) const
overridevirtual

Returns true if recording is enabled and the input is connected to any target.

Reimplemented from tracktion::engine::InputDeviceInstance.

Definition at line 794 of file tracktion_MidiInputDevice.cpp.

◆ isRecordingActive() [2/2]

bool tracktion::engine::MidiInputDeviceInstanceBase::isRecordingActive ( EditItemID  targetID) const
overridevirtual

Returns true if recording is enabled and the input is connected the given target.

Reimplemented from tracktion::engine::InputDeviceInstance.

Definition at line 799 of file tracktion_MidiInputDevice.cpp.

◆ isRecordingQueuedToStop()

bool tracktion::engine::MidiInputDeviceInstanceBase::isRecordingQueuedToStop ( EditItemID  )
overridevirtual

Returns true if the async stopRecording function has been used and this target is waiting to stop.

Implements tracktion::engine::InputDeviceInstance.

Definition at line 804 of file tracktion_MidiInputDevice.cpp.

◆ masterTimeUpdate()

void tracktion::engine::MidiInputDeviceInstanceBase::masterTimeUpdate ( double  time)

Definition at line 1472 of file tracktion_MidiInputDevice.cpp.

◆ prepareToRecord()

std::vector< tl::expected< std::unique_ptr< RecordingContext >, juce::String > > tracktion::engine::MidiInputDeviceInstanceBase::prepareToRecord ( RecordingParameters  )
overridevirtual

Prepares a recording operation.

Parameters
RecordingParametersDetermines the destinations and punch ranges
Returns
An array of either valid RecordingContexts or error messages

Implements tracktion::engine::InputDeviceInstance.

Reimplemented in tracktion::engine::PhysicalMidiInputDeviceInstance.

Definition at line 851 of file tracktion_MidiInputDevice.cpp.

◆ shouldTrackContentsBeMuted()

bool tracktion::engine::MidiInputDeviceInstanceBase::shouldTrackContentsBeMuted ( const Track )
overridevirtual

Should return true if this input is currently actively recording into a track and it wants the existing track contents to be muted.

Reimplemented from tracktion::engine::InputDeviceInstance.

Definition at line 809 of file tracktion_MidiInputDevice.cpp.

◆ startRecording()

std::vector< std::unique_ptr< RecordingContext > > tracktion::engine::MidiInputDeviceInstanceBase::startRecording ( std::vector< std::unique_ptr< RecordingContext > >  )
overridevirtual

Starts a recording.

Parameters
Theprepared recording contexts to start.
Returns
Any recording contexts that couldn't be started by this device. E.g. If the contexts are mixed MIDI and audio and this is an audio device, it will returns the MIDI contexts to pass to a MIDI device.

Implements tracktion::engine::InputDeviceInstance.

Definition at line 872 of file tracktion_MidiInputDevice.cpp.

◆ stopRecording() [1/2]

tl::expected< Clip::Array, juce::String > tracktion::engine::MidiInputDeviceInstanceBase::stopRecording ( StopRecordingParameters  )
overridevirtual

Stops a recording.

Parameters
StopRecordingParametersdetermines how stopped recordings are treated.

Implements tracktion::engine::InputDeviceInstance.

Definition at line 901 of file tracktion_MidiInputDevice.cpp.

◆ stopRecording() [2/2]

void tracktion::engine::MidiInputDeviceInstanceBase::stopRecording ( StopRecordingParameters  ,
std::function< void(tl::expected< Clip::Array, juce::String >)>   
)
overridevirtual

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.

Parameters
StopRecordingParametersDetermines how stopped recordings are treated.
recordingStoppedCallbackA callback to call when the recording stops.

Implements tracktion::engine::InputDeviceInstance.

Definition at line 955 of file tracktion_MidiInputDevice.cpp.

Member Data Documentation

◆ contextLock

std::shared_mutex tracktion::engine::MidiInputDeviceInstanceBase::contextLock
mutable

Definition at line 1487 of file tracktion_MidiInputDevice.cpp.

◆ recordingContexts

std::vector<std::unique_ptr<MidiRecordingContext> > tracktion::engine::MidiInputDeviceInstanceBase::recordingContexts

Definition at line 1488 of file tracktion_MidiInputDevice.cpp.


The documentation for this class was generated from the following file: