summaryrefslogtreecommitdiff
path: root/gtk2_ardour/midi_region_view.cc
diff options
context:
space:
mode:
authorCarl Hetherington <carl@carlh.net>2010-10-18 19:59:41 +0000
committerCarl Hetherington <carl@carlh.net>2010-10-18 19:59:41 +0000
commit471ca9b1f5323df6c5510fab4eb512e8735ef5d5 (patch)
treeb1b80551ed6b1590f822b01d33fc8fe57d7a9176 /gtk2_ardour/midi_region_view.cc
parent269590e1bfead5def1902798c7809ac5b2eb6f07 (diff)
Slightly clean up and fix unwanted display of percussive notes outside the note range. Should fix #3500.
git-svn-id: svn://localhost/ardour2/branches/3.0@7904 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/midi_region_view.cc')
-rw-r--r--gtk2_ardour/midi_region_view.cc12
1 files changed, 4 insertions, 8 deletions
diff --git a/gtk2_ardour/midi_region_view.cc b/gtk2_ardour/midi_region_view.cc
index 0b0140ab8a..6fd96f3481 100644
--- a/gtk2_ardour/midi_region_view.cc
+++ b/gtk2_ardour/midi_region_view.cc
@@ -1226,15 +1226,9 @@ MidiRegionView::apply_note_range (uint8_t min, uint8_t max, bool force)
} else if (CanvasHit* chit = dynamic_cast<CanvasHit*>(event)) {
- double x = trackview.editor().frame_to_pixel(
- beats_to_frames(note->time()) - _region->start());
- const double diamond_size = midi_stream_view()->note_height() / 2.0;
- double y = midi_stream_view()->note_to_y(event->note()->note())
- + ((diamond_size-2.0) / 4.0);
+ const double diamond_size = update_hit (chit);
chit->set_height (diamond_size);
- chit->move (x - chit->x1(), y - chit->y1());
- chit->show ();
}
}
}
@@ -1432,7 +1426,7 @@ MidiRegionView::update_note (CanvasNote* ev)
}
}
-void
+double
MidiRegionView::update_hit (CanvasHit* ev)
{
boost::shared_ptr<NoteType> note = ev->note();
@@ -1443,6 +1437,8 @@ MidiRegionView::update_hit (CanvasHit* ev)
const double y = midi_stream_view()->note_to_y(note->note()) + ((diamond_size-2) / 4.0);
ev->move_to (x, y);
+
+ return diamond_size;
}
/** Add a MIDI note to the view (with length).