ardour
Public Types | Public Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
ARDOUR::NoteFixer Class Reference

#include <note_fixer.h>

Inheritance diagram for ARDOUR::NoteFixer:

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_tEvent
 
typedef std::list< Event * > Events
 

Private Member Functions

Eventcopy_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
 

Detailed Description

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.

Member Typedef Documentation

Definition at line 84 of file note_fixer.h.

typedef std::list<Event*> ARDOUR::NoteFixer::Events
private

Definition at line 85 of file note_fixer.h.

Definition at line 49 of file note_fixer.h.

Constructor & Destructor Documentation

ARDOUR::NoteFixer::~NoteFixer ( )

Definition at line 29 of file note_fixer.cc.

Member Function Documentation

void ARDOUR::NoteFixer::clear ( )

Clear all internal state.

Definition at line 35 of file note_fixer.cc.

NoteFixer::Event * ARDOUR::NoteFixer::copy_event ( framepos_t  time,
const Evoral::Event< Evoral::Beats > &  ev 
)
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.

Parameters
dstDestination for events.
posTimestamp to be used for every event, should be the start of the read block immediately following any calls to prepare().
trackerTracker to update with emitted events.

Definition at line 116 of file note_fixer.cc.

bool ARDOUR::NoteFixer::note_is_active ( const BeatsFramesConverter converter,
boost::shared_ptr< Note note,
framepos_t  pos 
)
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.

Parameters
cmdCommand to compensate for.
originTimeline position of edited source.
posCurrent read position (last read end).

Definition at line 43 of file note_fixer.cc.

Member Data Documentation

Events ARDOUR::NoteFixer::_events
private

Definition at line 95 of file note_fixer.h.


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