From 2797ea966694572d7136afabc2a3f368b1a18ce3 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Mon, 26 Dec 2022 20:56:13 -0700 Subject: [PATCH] remove unusued "MIDI underlay" cruft --- gtk2_ardour/editor.cc | 4 -- gtk2_ardour/ghostregion.cc | 23 ------ gtk2_ardour/ghostregion.h | 6 -- gtk2_ardour/midi_region_view.cc | 8 +-- gtk2_ardour/midi_streamview.cc | 5 -- gtk2_ardour/midi_streamview.h | 2 - gtk2_ardour/midi_time_axis.cc | 1 + gtk2_ardour/route_time_axis.cc | 120 -------------------------------- gtk2_ardour/route_time_axis.h | 12 ---- 9 files changed, 5 insertions(+), 176 deletions(-) diff --git a/gtk2_ardour/editor.cc b/gtk2_ardour/editor.cc index f4a66be338..f618a057e3 100644 --- a/gtk2_ardour/editor.cc +++ b/gtk2_ardour/editor.cc @@ -1651,10 +1651,6 @@ Editor::popup_track_context_menu (int button, int32_t time, ItemType item_type, } - if (item_type == StreamItem && clicked_routeview) { - clicked_routeview->build_underlay_menu(menu); - } - /* When the region menu is opened, we setup the actions so that they look right in the menu. */ diff --git a/gtk2_ardour/ghostregion.cc b/gtk2_ardour/ghostregion.cc index f9cf876817..9f5a5cca0f 100644 --- a/gtk2_ardour/ghostregion.cc +++ b/gtk2_ardour/ghostregion.cc @@ -197,29 +197,6 @@ MidiGhostRegion::MidiGhostRegion(MidiRegionView& rv, base_rect->lower_to_bottom(); } -/** - * @param rv The parent RegionView being ghosted. - * @param msv MidiStreamView that this ghost region is on. - * @param source_tv TimeAxisView that we are the ghost for. - */ -MidiGhostRegion::MidiGhostRegion(MidiRegionView& rv, - MidiStreamView& msv, - TimeAxisView& source_tv, - double initial_unit_pos) - : GhostRegion (rv, - msv.midi_underlay(), - msv.trackview(), - source_tv, - initial_unit_pos) - , _note_group (new ArdourCanvas::Container (group)) - , parent_mrv (rv) - , _optimization_iterator(events.end()) -{ - _outline = UIConfiguration::instance().color ("ghost track midi outline"); - - base_rect->lower_to_bottom(); -} - MidiGhostRegion::~MidiGhostRegion() { clear_events (); diff --git a/gtk2_ardour/ghostregion.h b/gtk2_ardour/ghostregion.h index d5ea845448..c1d05d5e52 100644 --- a/gtk2_ardour/ghostregion.h +++ b/gtk2_ardour/ghostregion.h @@ -102,13 +102,7 @@ public: TimeAxisView& source_tv, double initial_unit_pos); - MidiGhostRegion(MidiRegionView& rv, - MidiStreamView& msv, - TimeAxisView& source_tv, - double initial_unit_pos); - ~MidiGhostRegion(); - MidiStreamView* midi_view(); void set_height(); diff --git a/gtk2_ardour/midi_region_view.cc b/gtk2_ardour/midi_region_view.cc index 4dcde8fea7..f9cf483222 100644 --- a/gtk2_ardour/midi_region_view.cc +++ b/gtk2_ardour/midi_region_view.cc @@ -1625,11 +1625,11 @@ MidiRegionView::add_ghost (TimeAxisView& tv) MidiGhostRegion* ghost; if (mtv && mtv->midi_view()) { - /* if ghost is inserted into midi track, use a dedicated midi ghost canvas group - to allow having midi notes on top of note lines and waveforms. - */ - ghost = new MidiGhostRegion (*this, *mtv->midi_view(), trackview, unit_position); + std::cerr << "AG#1\n"; + return 0; } else { + std::cerr << "AG#2\n"; + PBD::stacktrace (std::cerr, 35); ghost = new MidiGhostRegion (*this, tv, trackview, unit_position); } diff --git a/gtk2_ardour/midi_streamview.cc b/gtk2_ardour/midi_streamview.cc index 7478f52784..5d4438df99 100644 --- a/gtk2_ardour/midi_streamview.cc +++ b/gtk2_ardour/midi_streamview.cc @@ -74,11 +74,6 @@ MidiStreamView::MidiStreamView (MidiTimeAxisView& tv) , _note_lines (0) , _updates_suspended (false) { - - /* use a group dedicated to MIDI underlays. Audio underlays are not in this group. */ - _midi_underlay = new ArdourCanvas::Container (_canvas_group); - _midi_underlay->lower_to_bottom(); - /* use a dedicated group for MIDI regions (on top of the grid and lines) */ _region_group = new ArdourCanvas::Container (_canvas_group); _region_group->raise_to_top (); diff --git a/gtk2_ardour/midi_streamview.h b/gtk2_ardour/midi_streamview.h index d844007f57..6151bd06b5 100644 --- a/gtk2_ardour/midi_streamview.h +++ b/gtk2_ardour/midi_streamview.h @@ -113,7 +113,6 @@ public: void suspend_updates (); void resume_updates (); - ArdourCanvas::Container* midi_underlay () const { return _midi_underlay; } ArdourCanvas::Container* region_canvas () const { return _region_group; } void parameter_changed (std::string const &); @@ -122,7 +121,6 @@ protected: void setup_rec_box (); void update_rec_box (); - ArdourCanvas::Container* _midi_underlay; ArdourCanvas::Container* _region_group; private: diff --git a/gtk2_ardour/midi_time_axis.cc b/gtk2_ardour/midi_time_axis.cc index 064b98614a..9ca66c1f57 100644 --- a/gtk2_ardour/midi_time_axis.cc +++ b/gtk2_ardour/midi_time_axis.cc @@ -1400,6 +1400,7 @@ MidiTimeAxisView::create_automation_child (const Evoral::Parameter& param, bool _route->describe_parameter(param))); if (_view) { + std::cerr << "Adding ghosts of each MIDI region\n"; _view->foreach_regionview (sigc::mem_fun (*track.get(), &TimeAxisView::add_ghost)); } diff --git a/gtk2_ardour/route_time_axis.cc b/gtk2_ardour/route_time_axis.cc index 5d9427d33d..5e13350afe 100644 --- a/gtk2_ardour/route_time_axis.cc +++ b/gtk2_ardour/route_time_axis.cc @@ -1704,10 +1704,6 @@ RouteTimeAxisView::region_view_added (RegionView* rv) atv->add_ghost(rv); } } - - for (UnderlayMirrorList::iterator i = _underlay_mirrors.begin(); i != _underlay_mirrors.end(); ++i) { - (*i)->add_ghost(rv); - } } RouteTimeAxisView::ProcessorAutomationInfo::~ProcessorAutomationInfo () @@ -2297,122 +2293,6 @@ RouteTimeAxisView::chan_count_changed () } } -void -RouteTimeAxisView::build_underlay_menu(Gtk::Menu* parent_menu) -{ - using namespace Menu_Helpers; - - if (!_underlay_streams.empty()) { - MenuList& parent_items = parent_menu->items(); - Menu* gs_menu = manage (new Menu); - gs_menu->set_name ("ArdourContextMenu"); - MenuList& gs_items = gs_menu->items(); - - parent_items.push_back (MenuElem (_("Underlays"), *gs_menu)); - - for(UnderlayList::iterator it = _underlay_streams.begin(); it != _underlay_streams.end(); ++it) { - gs_items.push_back(MenuElem(string_compose(_("Remove \"%1\""), (*it)->trackview().name()), - sigc::bind(sigc::mem_fun(*this, &RouteTimeAxisView::remove_underlay), *it))); - } - } -} - -bool -RouteTimeAxisView::set_underlay_state() -{ - if (!underlay_xml_node) { - return false; - } - - XMLNodeList nlist = underlay_xml_node->children(); - XMLNodeConstIterator niter; - XMLNode *child_node; - - for (niter = nlist.begin(); niter != nlist.end(); ++niter) { - child_node = *niter; - - if (child_node->name() != "Underlay") { - continue; - } - - XMLProperty const * prop = child_node->property ("id"); - if (prop) { - PBD::ID id (prop->value()); - - StripableTimeAxisView* v = _editor.get_stripable_time_axis_by_id (id); - - if (v) { - add_underlay(v->view(), false); - } - } - } - - return false; -} - -void -RouteTimeAxisView::add_underlay (StreamView* v, bool /*update_xml*/) -{ - if (!v) { - return; - } - - RouteTimeAxisView& other = v->trackview(); - - if (find(_underlay_streams.begin(), _underlay_streams.end(), v) == _underlay_streams.end()) { - if (find(other._underlay_mirrors.begin(), other._underlay_mirrors.end(), this) != other._underlay_mirrors.end()) { - fatal << _("programming error: underlay reference pointer pairs are inconsistent!") << endmsg; - abort(); /*NOTREACHED*/ - } - - _underlay_streams.push_back(v); - other._underlay_mirrors.push_back(this); - - v->foreach_regionview(sigc::mem_fun(*this, &RouteTimeAxisView::add_ghost)); - -#ifdef GUI_OBJECT_STATE_FIX_REQUIRED - if (update_xml) { - if (!underlay_xml_node) { - underlay_xml_node = xml_node->add_child("Underlays"); - } - - XMLNode* node = underlay_xml_node->add_child("Underlay"); - XMLProperty const * prop = node->add_property("id"); - prop->set_value(v->trackview().route()->id().to_s()); - } -#endif - } -} - -void -RouteTimeAxisView::remove_underlay (StreamView* v) -{ - if (!v) { - return; - } - - UnderlayList::iterator it = find(_underlay_streams.begin(), _underlay_streams.end(), v); - RouteTimeAxisView& other = v->trackview(); - - if (it != _underlay_streams.end()) { - UnderlayMirrorList::iterator gm = find(other._underlay_mirrors.begin(), other._underlay_mirrors.end(), this); - - if (gm == other._underlay_mirrors.end()) { - fatal << _("programming error: underlay reference pointer pairs are inconsistent!") << endmsg; - abort(); /*NOTREACHED*/ - } - - v->foreach_regionview(sigc::mem_fun(*this, &RouteTimeAxisView::remove_ghost)); - - _underlay_streams.erase(it); - other._underlay_mirrors.erase(gm); - - if (underlay_xml_node) { - underlay_xml_node->remove_nodes_and_delete("id", v->trackview().route()->id().to_s()); - } - } -} - void RouteTimeAxisView::set_button_names () { diff --git a/gtk2_ardour/route_time_axis.h b/gtk2_ardour/route_time_axis.h index 39727bda67..d6583a7141 100644 --- a/gtk2_ardour/route_time_axis.h +++ b/gtk2_ardour/route_time_axis.h @@ -119,10 +119,6 @@ public: void toggle_automation_track (const Evoral::Parameter& param); void fade_range (TimeSelection&); - void add_underlay (StreamView*, bool update_xml = true); - void remove_underlay (StreamView*); - void build_underlay_menu(Gtk::Menu*); - int set_state (const XMLNode&, int version); virtual Gtk::CheckMenuItem* automation_child_menu_item (Evoral::Parameter); @@ -283,14 +279,6 @@ protected: GainMeterBase gm; - XMLNode* underlay_xml_node; - bool set_underlay_state(); - - typedef std::list UnderlayList; - UnderlayList _underlay_streams; - typedef std::list UnderlayMirrorList; - UnderlayMirrorList _underlay_mirrors; - bool _ignore_set_layer_display; void layer_display_menu_change (Gtk::MenuItem* item);