summaryrefslogtreecommitdiff
path: root/gtk2_ardour/canvas-note-event.cc
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2009-05-05 00:08:30 +0000
committerDavid Robillard <d@drobilla.net>2009-05-05 00:08:30 +0000
commit7863c03cfc6c116dbef73ffc2f096ed50699cfb4 (patch)
treee555c234c84bb8c1ffb5be930167abc20b927529 /gtk2_ardour/canvas-note-event.cc
parent61169434eaf9e106f42c9254de53a57f98773754 (diff)
Make MIDI note editing work somewhat again...
Only show note velocity text when the user is actually editing velocity. git-svn-id: svn://localhost/ardour2/branches/3.0@5047 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/canvas-note-event.cc')
-rw-r--r--gtk2_ardour/canvas-note-event.cc19
1 files changed, 9 insertions, 10 deletions
diff --git a/gtk2_ardour/canvas-note-event.cc b/gtk2_ardour/canvas-note-event.cc
index a81692d01e..88b6633dd3 100644
--- a/gtk2_ardour/canvas-note-event.cc
+++ b/gtk2_ardour/canvas-note-event.cc
@@ -74,8 +74,9 @@ CanvasNoteEvent::move_event(double dx, double dy)
void
CanvasNoteEvent::show_velocity()
{
- hide_velocity();
- _text = new InteractiveText(*(_item->property_parent()), this);
+ if (!_text) {
+ _text = new InteractiveText(*(_item->property_parent()), this);
+ }
_text->property_x() = (x1() + x2()) /2;
_text->property_y() = (y1() + y2()) /2;
ostringstream velo(ios::ate);
@@ -93,8 +94,8 @@ CanvasNoteEvent::hide_velocity()
if (_text) {
_text->hide();
delete _text;
+ _text = 0;
}
- _text = 0;
}
void
@@ -166,11 +167,9 @@ CanvasNoteEvent::selected(bool selected)
ARDOUR_UI::config()->canvasvar_MidiNoteSelected.get(), 0.5));
set_outline_color(calculate_outline(
ARDOUR_UI::config()->canvasvar_MidiNoteSelected.get()));
- show_velocity();
} else {
set_fill_color(base_color());
set_outline_color(calculate_outline(base_color()));
- hide_velocity();
}
_selected = selected;
@@ -260,17 +259,17 @@ CanvasNoteEvent::on_event(GdkEvent* ev)
case GDK_ENTER_NOTIFY:
_region.note_entered(this);
- _item->grab_focus();
- show_velocity();
- Keyboard::magic_widget_grab_focus();
+ //_item->grab_focus();
+ //show_velocity();
+ //Keyboard::magic_widget_grab_focus();
break;
case GDK_LEAVE_NOTIFY:
- Keyboard::magic_widget_drop_focus();
+ //Keyboard::magic_widget_drop_focus();
if (! selected()) {
hide_velocity();
}
- _region.get_canvas_group()->grab_focus();
+ //_region.get_canvas_group()->grab_focus();
break;
case GDK_BUTTON_PRESS: