diff --git a/gtk2_ardour/editor.cc b/gtk2_ardour/editor.cc index 5080636db2..a9e2b1d6ac 100644 --- a/gtk2_ardour/editor.cc +++ b/gtk2_ardour/editor.cc @@ -5027,12 +5027,10 @@ Editor::timeaxisview_deleted (TimeAxisView *tv) entered_track = 0; } - if (rtav) { - TimeAxisView::Children c = rtav->get_child_list (); - for (TimeAxisView::Children::const_iterator i = c.begin(); i != c.end(); ++i) { - if (entered_track == i->get()) { - entered_track = 0; - } + TimeAxisView::Children c = tv->get_child_list (); + for (TimeAxisView::Children::const_iterator i = c.begin(); i != c.end(); ++i) { + if (entered_track == i->get()) { + entered_track = 0; } } diff --git a/gtk2_ardour/route_time_axis.cc b/gtk2_ardour/route_time_axis.cc index fd528a4dbf..e2de13aba7 100644 --- a/gtk2_ardour/route_time_axis.cc +++ b/gtk2_ardour/route_time_axis.cc @@ -1390,20 +1390,6 @@ RouteTimeAxisView::paste (framepos_t pos, float times, Selection& selection, siz } -TimeAxisView::Children -RouteTimeAxisView::get_child_list() -{ - TimeAxisView::Children redirect_children; - - for (Children::iterator i = children.begin(); i != children.end(); ++i) { - if (!(*i)->hidden()) { - redirect_children.push_back(*i); - } - } - return redirect_children; -} - - struct PlaylistSorter { bool operator() (boost::shared_ptr a, boost::shared_ptr b) const { return a->sort_id() < b->sort_id(); diff --git a/gtk2_ardour/route_time_axis.h b/gtk2_ardour/route_time_axis.h index 189035bf17..7d65fcc69a 100644 --- a/gtk2_ardour/route_time_axis.h +++ b/gtk2_ardour/route_time_axis.h @@ -95,8 +95,6 @@ public: void cut_copy_clear (Selection&, Editing::CutCopyOp); bool paste (ARDOUR::framepos_t, float times, Selection&, size_t nth); - TimeAxisView::Children get_child_list(); - void toggle_automation_track (const Evoral::Parameter& param); /* The editor calls these when mapping an operation across multiple tracks */ diff --git a/gtk2_ardour/time_axis_view.cc b/gtk2_ardour/time_axis_view.cc index 631f6428e5..66eb6dbc89 100644 --- a/gtk2_ardour/time_axis_view.cc +++ b/gtk2_ardour/time_axis_view.cc @@ -1320,3 +1320,20 @@ TimeAxisView::preset_height (Height h) /* NOTREACHED */ return 0; } + +/** @return Child time axis views that are not hidden */ +TimeAxisView::Children +TimeAxisView::get_child_list () +{ + Children c; + + for (Children::iterator i = children.begin(); i != children.end(); ++i) { + if (!(*i)->hidden()) { + c.push_back(*i); + } + } + + return c; +} + + diff --git a/gtk2_ardour/time_axis_view.h b/gtk2_ardour/time_axis_view.h index 031b4e26f2..f8a30d5778 100644 --- a/gtk2_ardour/time_axis_view.h +++ b/gtk2_ardour/time_axis_view.h @@ -212,6 +212,7 @@ class TimeAxisView : public virtual AxisView, public PBD::Stateful virtual StreamView* view () const { return 0; } typedef std::vector > Children; + Children get_child_list (); SelectionRect* get_selection_rect(uint32_t id);