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