actually paste MIDI at the right spot
git-svn-id: svn://localhost/ardour2/branches/3.0@5521 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
parent
02e3f7c769
commit
84fb6ae9ba
@ -1722,22 +1722,17 @@ MidiRegionView::paste (nframes64_t pos, const MidiCutBuffer& mcb)
|
|||||||
{
|
{
|
||||||
MidiModel::DeltaCommand* cmd = _model->new_delta_command("paste");
|
MidiModel::DeltaCommand* cmd = _model->new_delta_command("paste");
|
||||||
MidiModel::TimeType beat_delta;
|
MidiModel::TimeType beat_delta;
|
||||||
nframes64_t paste_pos_beats;
|
MidiModel::TimeType paste_pos_beats;
|
||||||
|
|
||||||
paste_pos_beats = frames_to_beats (pos);
|
paste_pos_beats = frames_to_beats (pos);
|
||||||
beat_delta = mcb.notes().front()->time() - paste_pos_beats;
|
beat_delta = mcb.notes().front()->time() - paste_pos_beats;
|
||||||
|
|
||||||
cerr << "For paste @ " << pos << " beats = " << paste_pos_beats
|
|
||||||
<< " first pasted note @ " << mcb.notes().front()->time()
|
|
||||||
<< " ... delta = " << beat_delta << endl;
|
|
||||||
|
|
||||||
for (Evoral::Sequence<MidiModel::TimeType>::Notes::const_iterator i = mcb.notes().begin(); i != mcb.notes().end(); ++i) {
|
for (Evoral::Sequence<MidiModel::TimeType>::Notes::const_iterator i = mcb.notes().begin(); i != mcb.notes().end(); ++i) {
|
||||||
|
|
||||||
boost::shared_ptr<NoteType> copied_note (new NoteType (*((*i).get())));
|
boost::shared_ptr<NoteType> copied_note (new NoteType (*((*i).get())));
|
||||||
copied_note->set_time (copied_note->time() - beat_delta);
|
copied_note->set_time (copied_note->time() - beat_delta);
|
||||||
cmd->add (copied_note);
|
cmd->add (copied_note);
|
||||||
}
|
}
|
||||||
_model->apply_command(trackview.session(), cmd);
|
|
||||||
|
|
||||||
|
|
||||||
|
_model->apply_command(trackview.session(), cmd);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user