ardour
|
#include <note_fixer.h>
Public Types | |
typedef Evoral::Note < Evoral::Beats > | Note |
Public Member Functions | |
~NoteFixer () | |
void | clear () |
void | prepare (TempoMap &tempo_map, const MidiModel::NoteDiffCommand *cmd, framepos_t origin, framepos_t pos, std::set< boost::weak_ptr< Note > > &active_notes) |
void | emit (Evoral::EventSink< framepos_t > &dst, framepos_t pos, MidiStateTracker &tracker) |
Private Types | |
typedef Evoral::Event< framepos_t > | Event |
typedef std::list< Event * > | Events |
Private Member Functions | |
Event * | copy_event (framepos_t time, const Evoral::Event< Evoral::Beats > &ev) |
bool | note_is_active (const BeatsFramesConverter &converter, boost::shared_ptr< Note > note, framepos_t pos) |
Private Attributes | |
Events | _events |
A tracker and compensator for note edit operations.
This monitors edit operations sent to a model that affect active notes during a read, and maintains a queue of synthetic events that should be sent at the start of the next read to maintain coherent MIDI state.
Definition at line 46 of file note_fixer.h.
|
private |
Definition at line 84 of file note_fixer.h.
|
private |
Definition at line 85 of file note_fixer.h.
Definition at line 49 of file note_fixer.h.
ARDOUR::NoteFixer::~NoteFixer | ( | ) |
Definition at line 29 of file note_fixer.cc.
void ARDOUR::NoteFixer::clear | ( | ) |
Clear all internal state.
Definition at line 35 of file note_fixer.cc.
|
private |
Copy a beats event to a frames event with the given time stamp.
Definition at line 129 of file note_fixer.cc.
void ARDOUR::NoteFixer::emit | ( | Evoral::EventSink< framepos_t > & | dst, |
framepos_t | pos, | ||
MidiStateTracker & | tracker | ||
) |
Emit any pending edit compensation events.
dst | Destination for events. |
pos | Timestamp to be used for every event, should be the start of the read block immediately following any calls to prepare(). |
tracker | Tracker to update with emitted events. |
Definition at line 116 of file note_fixer.cc.
|
private |
Return true iff note
is active at pos
.
Definition at line 135 of file note_fixer.cc.
void ARDOUR::NoteFixer::prepare | ( | TempoMap & | tempo_map, |
const MidiModel::NoteDiffCommand * | cmd, | ||
framepos_t | origin, | ||
framepos_t | pos, | ||
std::set< boost::weak_ptr< Note > > & | active_notes | ||
) |
Handle a region edit during read.
This must be called before the command is applied to the model. Events are enqueued to compensate for edits which should be later sent with emit() at the start of the next read.
cmd | Command to compensate for. |
origin | Timeline position of edited source. |
pos | Current read position (last read end). |
Definition at line 43 of file note_fixer.cc.
|
private |
Definition at line 95 of file note_fixer.h.