From d836c05622da7ae8c72f48ac6df8b792960bc776 Mon Sep 17 00:00:00 2001 From: carlh Date: Wed, 26 May 2010 11:54:49 +0000 Subject: [PATCH] Show the verbose canvas cursor with the ghost note. git-svn-id: svn+ssh://ardour.org/ardour2/branches/3.0@7165 d708f5d6-7413-0410-9779-e7cbd77b26cf --- gtk2_ardour/midi_region_view.cc | 18 ++++++++++++++---- gtk2_ardour/midi_region_view.h | 2 ++ 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/gtk2_ardour/midi_region_view.cc b/gtk2_ardour/midi_region_view.cc index c1c7f650..aa46d410 100644 --- a/gtk2_ardour/midi_region_view.cc +++ b/gtk2_ardour/midi_region_view.cc @@ -382,6 +382,7 @@ MidiRegionView::canvas_event(GdkEvent* ev) case GDK_LEAVE_NOTIFY: { + trackview.editor().hide_verbose_canvas_cursor (); delete _ghost_note; _ghost_note = 0; break; @@ -2443,10 +2444,7 @@ MidiRegionView::note_entered(ArdourCanvas::CanvasNoteEvent* ev) note_selected(ev, true); } - char buf[12]; - snprintf (buf, sizeof (buf), "%s (%d)", Evoral::midi_note_name (ev->note()->note()).c_str(), (int) ev->note()->note()); - PublicEditor& editor (trackview.editor()); - editor.show_verbose_canvas_cursor_with (buf); + show_verbose_canvas_cursor (ev->note ()); } void @@ -2739,6 +2737,8 @@ MidiRegionView::update_ghost_note (double x, double y) _ghost_note->note()->set_note (midi_stream_view()->y_to_note (y)); update_note (_ghost_note); + + show_verbose_canvas_cursor (_ghost_note->note ()); } void @@ -2754,6 +2754,8 @@ MidiRegionView::create_ghost_note (double x, double y) _last_ghost_x = x; _last_ghost_y = y; + + show_verbose_canvas_cursor (_ghost_note->note ()); } void @@ -2765,3 +2767,11 @@ MidiRegionView::snap_changed () create_ghost_note (_last_ghost_x, _last_ghost_y); } + +void +MidiRegionView::show_verbose_canvas_cursor (boost::shared_ptr n) const +{ + char buf[12]; + snprintf (buf, sizeof (buf), "%s (%d)", Evoral::midi_note_name (n->note()).c_str(), (int) n->note ()); + trackview.editor().show_verbose_canvas_cursor_with (buf); +} diff --git a/gtk2_ardour/midi_region_view.h b/gtk2_ardour/midi_region_view.h index 3fb3cfd1..9950c03f 100644 --- a/gtk2_ardour/midi_region_view.h +++ b/gtk2_ardour/midi_region_view.h @@ -414,6 +414,8 @@ class MidiRegionView : public RegionView void snap_changed (); PBD::ScopedConnection snap_changed_connection; + + void show_verbose_canvas_cursor (boost::shared_ptr) const; }; -- 2.11.4.GIT