From 14dcc3f0170f8c723bcef0a59562adce0e8e7596 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sun, 14 Oct 2007 05:45:31 +0000 Subject: Fix displaying of notes in auto-created MIDI region when it's the first region in the track. Fix crash after recording long phrases of MIDI. Fix MIDI looping (kinda). Add note-off exposure to MidiModel::iterator. Fix first-note-is-stuck-note problem. Fix resolving long notes while recording. Fix several other things I forget now. MIDI works pretty well..... git-svn-id: svn://localhost/ardour2/trunk@2555 d708f5d6-7413-0410-9779-e7cbd77b26cf --- libs/ardour/quantize.cc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'libs/ardour/quantize.cc') diff --git a/libs/ardour/quantize.cc b/libs/ardour/quantize.cc index 5da30e8466..c29144996c 100644 --- a/libs/ardour/quantize.cc +++ b/libs/ardour/quantize.cc @@ -70,13 +70,13 @@ Quantize::run (boost::shared_ptr r) double q_frames = _q * (m.frames_per_bar(t, session.frame_rate()) / (double)m.beats_per_bar()); for (MidiModel::Notes::iterator i = model->notes().begin(); i != model->notes().end(); ++i) { - const double new_time = lrint(i->time() / q_frames) * q_frames; - const double new_dur = ((i->time() != 0 && new_dur < (q_frames * 1.5)) + const double new_time = lrint((*i)->time() / q_frames) * q_frames; + const double new_dur = (((*i)->time() != 0 && new_dur < (q_frames * 1.5)) ? q_frames - : lrint(i->duration() / q_frames) * q_frames); + : lrint((*i)->duration() / q_frames) * q_frames); - i->set_time(new_time); - i->set_duration(new_dur); + (*i)->set_time(new_time); + (*i)->set_duration(new_dur); } model->set_edited(true); -- cgit v1.2.3