diff --git a/gtk2_ardour/midi_region_view.cc b/gtk2_ardour/midi_region_view.cc index b87011daa7..ad6a7f60bc 100644 --- a/gtk2_ardour/midi_region_view.cc +++ b/gtk2_ardour/midi_region_view.cc @@ -1339,7 +1339,7 @@ MidiRegionView::display_patch_changes_on_channel (uint8_t channel, bool active_c const double x = trackview.editor().sample_to_pixel (region_frames); const string patch_name = instrument_info().get_patch_name ((*i)->bank(), (*i)->program(), channel); p->canvas_item()->set_position (ArdourCanvas::Duple (x, 1.0)); - p->flag()->set_text (patch_name); + p->set_text (patch_name); p->show(); } @@ -1419,7 +1419,7 @@ MidiRegionView::display_sysexes() new SysEx (*this, _note_group, text, height, x, 1.0, sysex_ptr)); _sys_exes.insert (make_pair (sysex_ptr, sysex)); } else { - sysex->flag()->set_height (height); + sysex->set_height (height); sysex->item().set_position (ArdourCanvas::Duple (x, 1.0)); } @@ -1491,7 +1491,7 @@ MidiRegionView::reset_width_dependent_items (double pixel_width) bool hide_all = false; PatchChanges::iterator x = _patch_changes.begin(); if (x != _patch_changes.end()) { - hide_all = x->second->flag()->width() >= _pixel_width; + hide_all = x->second->width() >= _pixel_width; } if (hide_all) { diff --git a/gtk2_ardour/patch_change.h b/gtk2_ardour/patch_change.h index 8902eb426e..791252e7ae 100644 --- a/gtk2_ardour/patch_change.h +++ b/gtk2_ardour/patch_change.h @@ -56,10 +56,12 @@ public: void hide (); void show (); + double width() const { return _flag->width(); } + void set_text (std::string const & s) { _flag->set_text (s); } + ARDOUR::MidiModel::PatchChangePtr patch() const { return _patch; } ArdourCanvas::Item* canvas_item() const { return _flag; } ArdourCanvas::Item& item() const { return *_flag; } - ArdourCanvas::Flag* flag() const { return _flag; } private: bool event_handler (GdkEvent *); diff --git a/gtk2_ardour/sys_ex.h b/gtk2_ardour/sys_ex.h index 47ad523a53..4efcc1f5bd 100644 --- a/gtk2_ardour/sys_ex.h +++ b/gtk2_ardour/sys_ex.h @@ -43,8 +43,9 @@ public: void hide (); void show (); - ArdourCanvas::Item& item() const { return *_flag; } - ArdourCanvas::Flag* flag() const { return _flag; } + void set_height (ArdourCanvas::Distance h) { _flag->set_height (h); } + + ArdourCanvas::Item& item() const { return *_flag; } private: bool event_handler (GdkEvent* ev);