37 for (Events::iterator i =
_events.begin(); i !=
_events.end(); ++i) {
53 for (Command::NoteList::const_iterator i = cmd->
removed_notes().begin();
59 active_notes.erase(*i);
63 for (Command::NoteList::const_iterator i = cmd->
added_notes().begin();
69 active_notes.insert(*i);
73 for (Command::ChangeList::const_iterator i = cmd->
changes().begin();
74 i != cmd->
changes().end(); ++i) {
81 if (i->property == Command::NoteNumber) {
88 on->
buffer()[1] = (uint8_t)i->new_value.get_int();
90 }
else if (i->property == Command::StartTime &&
91 converter.
to(i->new_value.get_beats()) >= pos) {
95 active_notes.erase(i->note);
96 }
else if (i->property == Command::Length &&
97 converter.
to(i->note->time() + i->new_value.get_beats()) < pos) {
101 active_notes.erase(i->note);
102 }
else if (i->property == Command::Channel) {
109 on->
buffer()[0] |= (uint8_t)i->new_value.get_int();
120 for (Events::iterator i =
_events.begin(); i !=
_events.end(); ++i) {
121 dst.
write(pos, (*i)->event_type(), (*i)->size(), (*i)->buffer());
142 return (start_time < pos && end_time >= pos);
Evoral::Event< framepos_t > Event
EventType event_type() const
virtual uint32_t write(Time time, EventType type, uint32_t size, const uint8_t *buf)=0
const NoteList & removed_notes() const
void prepare(TempoMap &tempo_map, const MidiModel::NoteDiffCommand *cmd, framepos_t origin, framepos_t pos, std::set< boost::weak_ptr< Note > > &active_notes)
const NoteList & added_notes() const
void track(const MidiBuffer::const_iterator &from, const MidiBuffer::const_iterator &to)
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)
void emit(Evoral::EventSink< framepos_t > &dst, framepos_t pos, MidiStateTracker &tracker)
const ChangeList & changes() const
const uint8_t * buffer() const
framepos_t to(Evoral::Beats beats) const