1 #include "canvas-program-change.h"
5 using namespace Gnome::Canvas;
8 CanvasProgramChange::CanvasProgramChange(
9 MidiRegionView& region,
11 boost::shared_ptr<MIDI::Event> event,
15 : Group(parent, x, y),
23 _text = new Text(*this);
25 ostringstream pgm(ios::ate);
26 pgm << int(event->pgm_number());
27 _text->property_text() = pgm.str();
28 _text->property_justification() = Gtk::JUSTIFY_CENTER;
29 _text->property_fill_color_rgba() = ARDOUR_UI::config()->canvasvar_MidiProgramChangeOutline.get();
30 double flagwidth = _text->property_text_width() + 10.0;
31 double flagheight = _text->property_text_height() + 3.0;
32 _text->property_x() = flagwidth / 2.0;
33 _text->property_y() = flagheight / 2.0;
35 _line = new SimpleLine(*this, 0.0, 0.0, 0.0, height);
36 _line->property_color_rgba() = ARDOUR_UI::config()->canvasvar_MidiProgramChangeOutline.get();
37 _rect = new SimpleRect(*this, 0.0, 0.0, flagwidth, flagheight);
38 _rect->property_outline_color_rgba() = ARDOUR_UI::config()->canvasvar_MidiProgramChangeOutline.get();
39 _rect->property_fill_color_rgba() = ARDOUR_UI::config()->canvasvar_MidiProgramChangeFill.get();
40 _text->lower_to_bottom();
48 CanvasProgramChange::~CanvasProgramChange()