diff --git a/gtk2_ardour/pianoroll_midi_view.cc b/gtk2_ardour/pianoroll_midi_view.cc index b2111f0518..9f51ad1ceb 100644 --- a/gtk2_ardour/pianoroll_midi_view.cc +++ b/gtk2_ardour/pianoroll_midi_view.cc @@ -28,6 +28,7 @@ #include "canvas/button.h" #include "canvas/canvas.h" #include "canvas/debug.h" +#include "canvas/text.h" #include "editing_context.h" #include "editor_drag.h" @@ -723,3 +724,33 @@ PianorollMidiView::clear_selection () } } } + +void +PianorollMidiView::set_overlay_text (std::string const & str) +{ + if (!overlay_text) { + overlay_text = new ArdourCanvas::Text (_note_group->parent()); + Pango::FontDescription font ("Sans 18"); + overlay_text->set_font_description (font); + overlay_text->set_color (0xff0000ff); + } + + overlay_text->set (str); + show_overlay_text (); +} + +void +PianorollMidiView::show_overlay_text () +{ + if (overlay_text) { + overlay_text->show (); + } +} + +void +PianorollMidiView::hide_overlay_text () +{ + if (overlay_text) { + overlay_text->hide (); + } +} diff --git a/gtk2_ardour/pianoroll_midi_view.h b/gtk2_ardour/pianoroll_midi_view.h index 9896e1a6dc..c3bd7123fe 100644 --- a/gtk2_ardour/pianoroll_midi_view.h +++ b/gtk2_ardour/pianoroll_midi_view.h @@ -86,10 +86,15 @@ class PianorollMidiView : public MidiView sigc::signal AutomationStateChange; + void set_overlay_text (std::string const &); + void hide_overlay_text (); + void show_overlay_text (); + protected: bool scroll (GdkEventScroll* ev); ArdourCanvas::Rectangle* automation_group; + ArdourCanvas::Text* overlay_text; typedef std::shared_ptr CueAutomationLine; typedef std::shared_ptr CueAutomationControl;