Moved note height/range/etc stuff from MidiRegionView to MidiStreamView, since it's all shared anyway.

Fixed positioning of percussion hits.
Note row separator lines (ie a "piano roll".. if it counts as a piano roll without an actual piano on the side of it, anyway).


git-svn-id: svn://localhost/ardour2/trunk@2237 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
David Robillard 2007-08-04 04:18:34 +00:00
parent 93dbcbd606
commit 604a0079ce
6 changed files with 93 additions and 43 deletions

View file

@ -115,16 +115,16 @@ CanvasMidiEvent::on_event(GdkEvent* ev)
drag_delta_x += dx;
// Snap to note rows
if (abs(dy) < _region.note_height()) {
if (abs(dy) < _region.midi_stream_view()->note_height()) {
dy = 0.0;
} else {
int8_t this_delta_note;
if (dy > 0)
this_delta_note = (int8_t)ceil(dy / _region.note_height());
this_delta_note = (int8_t)ceil(dy / _region.midi_stream_view()->note_height());
else
this_delta_note = (int8_t)floor(dy / _region.note_height());
this_delta_note = (int8_t)floor(dy / _region.midi_stream_view()->note_height());
drag_delta_note -= this_delta_note;
dy = _region.note_height() * this_delta_note;
dy = _region.midi_stream_view()->note_height() * this_delta_note;
last_y = last_y + dy;
}