diff options
author | Hans Baier <hansfbaier@googlemail.com> | 2008-05-09 11:28:14 +0000 |
---|---|---|
committer | Hans Baier <hansfbaier@googlemail.com> | 2008-05-09 11:28:14 +0000 |
commit | 8d44391f4ba571c4dbcec0a87033c83414f515e8 (patch) | |
tree | 8875e32f275f027fbbd790f90fdd09fe01d235de /gtk2_ardour/canvas-note-event.cc | |
parent | f65119016207d9c413437227bd5117fef7dc31b1 (diff) |
* adjusted formatting a bit to style guide
* fixed: velocity value left on canvas
* fixed: end-of-track problem still showed up sometimes
* enabled heaps of debugging output in order to debug MidiModel corruption
git-svn-id: svn://localhost/ardour2/branches/3.0@3329 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/canvas-note-event.cc')
-rw-r--r-- | gtk2_ardour/canvas-note-event.cc | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/gtk2_ardour/canvas-note-event.cc b/gtk2_ardour/canvas-note-event.cc index 149ad755ac..bd402f8c08 100644 --- a/gtk2_ardour/canvas-note-event.cc +++ b/gtk2_ardour/canvas-note-event.cc @@ -45,8 +45,11 @@ CanvasNoteEvent::CanvasNoteEvent(MidiRegionView& region, Item* item, CanvasNoteEvent::~CanvasNoteEvent() { - if (_text) + cerr << "CanvasNoteEvent::~CanvasNoteEvent() " << int(_note->note()) << " velo " << int(_note->velocity()) << endl; + if (_text) { + _text->hide(); delete _text; + } if (_channel_selector_widget) delete _channel_selector_widget; @@ -56,13 +59,17 @@ void CanvasNoteEvent::move_event(double dx, double dy) { _item->move(dx, dy); - if (_text) + if (_text) { + _text->hide(); _text->move(dx, dy); + _text->show(); + } } void CanvasNoteEvent::show_velocity(void) { + hide_velocity(); _text = new Text(*(_item->property_parent())); _text->property_x() = (x1() + x2()) /2; _text->property_y() = (y1() + y2()) /2; @@ -79,8 +86,11 @@ CanvasNoteEvent::show_velocity(void) void CanvasNoteEvent::hide_velocity(void) { - delete _text; - _text = NULL; + if(_text) { + _text->hide(); + delete _text; + } + _text = 0; } void @@ -91,8 +101,8 @@ CanvasNoteEvent::on_channel_selection_change(uint16_t selection) set_fill_color(ARDOUR_UI::config()->canvasvar_MidiNoteFillInactiveChannel.get()); set_outline_color(ARDOUR_UI::config()->canvasvar_MidiNoteOutlineInactiveChannel.get()); } else { - set_fill_color(note_fill_color(_note->velocity())); - set_outline_color(note_outline_color(_note->velocity())); + // set the color according to the notes selection state + selected(_selected); } // this forces the item to update..... maybe slow... _item->hide(); |