1 #include "canvas-program-change.h"
5 using namespace Gnome::Canvas;
8 CanvasProgramChange::CanvasProgramChange(
9 MidiRegionView& region,
11 boost::shared_ptr<Evoral::Event> event,
23 snprintf(pgm_str, 4, "%d", (int)event->pgm_number());
24 _text = new Text(*this, 0.0, 0.0, pgm_str);
25 _text->property_justification() = Gtk::JUSTIFY_CENTER;
26 _text->property_fill_color_rgba() = ARDOUR_UI::config()->canvasvar_MidiProgramChangeOutline.get();
27 double flagwidth = _text->property_text_width() + 10.0;
28 double flagheight = _text->property_text_height() + 3.0;
29 _text->property_x() = flagwidth / 2.0;
30 _text->property_y() = flagheight / 2.0;
32 _line = new SimpleLine(*this, 0.0, 0.0, 0.0, height);
33 _line->property_color_rgba() = ARDOUR_UI::config()->canvasvar_MidiProgramChangeOutline.get();
34 _rect = new SimpleRect(*this, 0.0, 0.0, flagwidth, flagheight);
35 _rect->property_outline_color_rgba() = ARDOUR_UI::config()->canvasvar_MidiProgramChangeOutline.get();
36 _rect->property_fill_color_rgba() = ARDOUR_UI::config()->canvasvar_MidiProgramChangeFill.get();
37 _text->lower_to_bottom();
41 CanvasProgramChange::~CanvasProgramChange()