summaryrefslogtreecommitdiff
path: root/gtk2_ardour
diff options
context:
space:
mode:
authorHans Baier <hansfbaier@googlemail.com>2008-05-09 16:10:36 +0000
committerHans Baier <hansfbaier@googlemail.com>2008-05-09 16:10:36 +0000
commit4e745fc17c22ade138bc7decc93df2e3d8cd354f (patch)
tree1ec759922ea6095edfd9258a322724995f9a3f20 /gtk2_ardour
parent8d44391f4ba571c4dbcec0a87033c83414f515e8 (diff)
* 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
Diffstat (limited to 'gtk2_ardour')
-rw-r--r--gtk2_ardour/canvas-program-change.cc1
-rw-r--r--gtk2_ardour/midi_region_view.cc5
2 files changed, 5 insertions, 1 deletions
diff --git a/gtk2_ardour/canvas-program-change.cc b/gtk2_ardour/canvas-program-change.cc
index 103bd7bb8d..ccaf333ef5 100644
--- a/gtk2_ardour/canvas-program-change.cc
+++ b/gtk2_ardour/canvas-program-change.cc
@@ -21,6 +21,7 @@ CanvasProgramChange::CanvasProgramChange(
_widget(0)
{
_text = new Text(*this);
+ assert(_text);
ostringstream pgm(ios::ate);
pgm << int(event->pgm_number());
_text->property_text() = pgm.str();
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> 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);