From 4e745fc17c22ade138bc7decc93df2e3d8cd354f Mon Sep 17 00:00:00 2001 From: Hans Baier Date: Fri, 9 May 2008 16:10:36 +0000 Subject: * formatting/style guide * bugfix: midi_util.h only considered channel events up to E0, but had to be EF * bugfix: parameter.h operator == should also compare channel (drobilla, correct me if I am wrong) * added some assert() guards git-svn-id: svn://localhost/ardour2/branches/3.0@3330 d708f5d6-7413-0410-9779-e7cbd77b26cf --- gtk2_ardour/midi_region_view.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'gtk2_ardour/midi_region_view.cc') diff --git a/gtk2_ardour/midi_region_view.cc b/gtk2_ardour/midi_region_view.cc index 69f756f3ca..bc492b0e71 100644 --- a/gtk2_ardour/midi_region_view.cc +++ b/gtk2_ardour/midi_region_view.cc @@ -672,8 +672,9 @@ MidiRegionView::begin_write() { assert(!_active_notes); _active_notes = new CanvasNote*[128]; - for (unsigned i=0; i < 128; ++i) + for (unsigned i=0; i < 128; ++i) { _active_notes[i] = NULL; + } } @@ -765,6 +766,8 @@ MidiRegionView::add_note(const boost::shared_ptr note) ev_rect->property_y2() = y1 + floor(midi_stream_view()->note_height()); if (note->duration() == 0) { + assert(_active_notes); + assert(note->note() < 128); _active_notes[note->note()] = ev_rect; /* outline all but right edge */ ev_rect->property_outline_what() = (guint32) (0x1 & 0x4 & 0x8); -- cgit v1.2.3