mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-06 14:54:56 +01:00
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
1 changed files with 2 additions and 7 deletions
|
|
@ -1722,22 +1722,17 @@ MidiRegionView::paste (nframes64_t pos, const MidiCutBuffer& mcb)
|
|||
{
|
||||
MidiModel::DeltaCommand* cmd = _model->new_delta_command("paste");
|
||||
MidiModel::TimeType beat_delta;
|
||||
nframes64_t paste_pos_beats;
|
||||
MidiModel::TimeType paste_pos_beats;
|
||||
|
||||
paste_pos_beats = frames_to_beats (pos);
|
||||
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) {
|
||||
|
||||
boost::shared_ptr<NoteType> copied_note (new NoteType (*((*i).get())));
|
||||
copied_note->set_time (copied_note->time() - beat_delta);
|
||||
cmd->add (copied_note);
|
||||
}
|
||||
_model->apply_command(trackview.session(), cmd);
|
||||
|
||||
|
||||
_model->apply_command(trackview.session(), cmd);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue