Update Selection API to include all Stripables
authorRobin Gareus <robin@gareus.org>
Sun, 6 Aug 2017 20:16:36 +0000 (22:16 +0200)
committerRobin Gareus <robin@gareus.org>
Sun, 6 Aug 2017 20:17:58 +0000 (22:17 +0200)
gtk2_ardour/editor.cc
gtk2_ardour/editor.h
gtk2_ardour/luainstance.cc
gtk2_ardour/mixer_strip.cc
gtk2_ardour/public_editor.h
gtk2_ardour/route_time_axis.cc
gtk2_ardour/selection.cc

index d84d92267ddee72720589bcdc9d1d72abaffc017..38fad22ddf9cc2f6e297562d49120e1ea9d80f11 100644 (file)
@@ -5552,15 +5552,15 @@ Editor::foreach_time_axis_view (sigc::slot<void,TimeAxisView&> theslot)
        }
 }
 
-/** Find a RouteTimeAxisView by the ID of its route */
-RouteTimeAxisView*
-Editor::get_route_view_by_route_id (const PBD::ID& id) const
+/** Find a StripableTimeAxisView by the ID of its stripable */
+StripableTimeAxisView*
+Editor::get_stripable_time_axis_by_id (const PBD::ID& id) const
 {
-       RouteTimeAxisView* v;
+       StripableTimeAxisView* v;
 
        for (TrackViewList::const_iterator i = track_views.begin(); i != track_views.end(); ++i) {
-               if((v = dynamic_cast<RouteTimeAxisView*>(*i)) != 0) {
-                       if(v->route()->id() == id) {
+               if((v = dynamic_cast<StripableTimeAxisView*>(*i)) != 0) {
+                       if(v->stripable()->id() == id) {
                                return v;
                        }
                }
index a2e3aacfa2cd0e99ae134f9674287a4b627d2573..dfc0ab2cb5e3ef280a8c134be6b63d911427860e 100644 (file)
@@ -192,7 +192,7 @@ public:
        void foreach_time_axis_view (sigc::slot<void,TimeAxisView&>);
        void add_to_idle_resize (TimeAxisView*, int32_t);
 
-       RouteTimeAxisView* get_route_view_by_route_id (const PBD::ID& id) const;
+       StripableTimeAxisView* get_stripable_time_axis_by_id (const PBD::ID& id) const;
 
        void consider_auditioning (boost::shared_ptr<ARDOUR::Region>);
        void hide_a_region (boost::shared_ptr<ARDOUR::Region>);
index f708e21decede941ef0f5c0978601812a5f46e59..f8dbbc3e2a2e2b0bb25c9a00b6a00d09c2269be2 100644 (file)
@@ -813,7 +813,7 @@ LuaInstance::register_classes (lua_State* L)
                .addFunction ("drags", &PublicEditor::drags)
 #endif
 
-               .addFunction ("get_route_view_by_route_id", &PublicEditor::get_route_view_by_route_id)
+               .addFunction ("get_stripable_time_axis_by_id", &PublicEditor::get_stripable_time_axis_by_id)
                .addFunction ("get_track_views", &PublicEditor::get_track_views)
                .addFunction ("rtav_from_route", &PublicEditor::rtav_from_route)
                .addFunction ("axis_views_from_routes", &PublicEditor::axis_views_from_routes)
index 343ddf99b6970b56d59d51d7caf914e7011122ad..f17468ea65f36742eb0eea0d1e05b04de80ad687 100644 (file)
@@ -1750,11 +1750,11 @@ MixerStrip::build_route_ops_menu ()
                   sane thing for users anyway.
                */
 
-               RouteTimeAxisView* rtav = PublicEditor::instance().get_route_view_by_route_id (_route->id());
-               if (rtav) {
+               StripableTimeAxisView* stav = PublicEditor::instance().get_stripable_time_axis_by_id (_route->id());
+               if (stav) {
                        Selection& selection (PublicEditor::instance().get_selection());
-                       if (!selection.selected (rtav)) {
-                               selection.set (rtav);
+                       if (!selection.selected (stav)) {
+                               selection.set (stav);
                        }
 
                        if (!_route->is_master()) {
index 37bf6b89b5632d97814928c27bfdc0f7b9b9226e..f7c20ea9835a5d6ed5d695d17a0f23bbb13319dd 100644 (file)
@@ -84,6 +84,7 @@ class PluginUIWindow;
 class RegionView;
 class RouteTimeAxisView;
 class Selection;
+class StripableTimeAxisView;
 class TempoCurve;
 class TempoMarker;
 class TimeAxisView;
@@ -354,7 +355,7 @@ public:
 
        virtual bool track_selection_change_without_scroll () const = 0;
 
-       virtual RouteTimeAxisView* get_route_view_by_route_id (const PBD::ID& id) const = 0;
+       virtual StripableTimeAxisView* get_stripable_time_axis_by_id (const PBD::ID& id) const = 0;
 
        virtual TimeAxisView* time_axis_view_from_stripable (boost::shared_ptr<ARDOUR::Stripable> s) const = 0;
 
index b0651a9dfbbb6e7e6501f1c3fd17476514c2adfc..8b5b17739fb7eed57c4634fffed397c5a7f2f555 100644 (file)
@@ -2479,7 +2479,7 @@ RouteTimeAxisView::set_underlay_state()
                if (prop) {
                        PBD::ID id (prop->value());
 
-                       RouteTimeAxisView* v = _editor.get_route_view_by_route_id (id);
+                       StripableTimeAxisView* v = _editor.get_stripable_time_axis_by_id (id);
 
                        if (v) {
                                add_underlay(v->view(), false);
index 1e89e0887983d2812fcd52a92439f14c674a5a5c..a75574bb196bd932d809dd23ed569cbfd203b0b1 100644 (file)
@@ -1138,11 +1138,11 @@ Selection::get_state () const
        XMLNode* node = new XMLNode (X_("Selection"));
 
        for (TrackSelection::const_iterator i = tracks.begin(); i != tracks.end(); ++i) {
-               RouteTimeAxisView* rtv = dynamic_cast<RouteTimeAxisView*> (*i);
+               StripableTimeAxisView* stv = dynamic_cast<StripableTimeAxisView*> (*i);
                AutomationTimeAxisView* atv = dynamic_cast<AutomationTimeAxisView*> (*i);
-               if (rtv) {
-                       XMLNode* t = node->add_child (X_("RouteView"));
-                       t->set_property (X_("id"), rtv->route()->id ());
+               if (stv) {
+                       XMLNode* t = node->add_child (X_("StripableView"));
+                       t->set_property (X_("id"), stv->stripable()->id ());
                } else if (atv) {
                        XMLNode* t = node->add_child (X_("AutomationView"));
                        t->set_property (X_("id"), atv->parent_stripable()->id ());
@@ -1317,11 +1317,11 @@ Selection::set_state (XMLNode const & node, int)
                                        assert(false);
                                }
 
-                               RouteTimeAxisView* rtv = editor->get_route_view_by_route_id (route_id); // XXX may also be VCA
+                               StripableTimeAxisView* stv = editor->get_stripable_time_axis_by_id (route_id);
                                vector <ControlPoint *> cps;
 
-                               if (rtv) {
-                                       boost::shared_ptr<AutomationTimeAxisView> atv = rtv->automation_child (EventTypeMap::instance().from_symbol (param));
+                               if (stv) {
+                                       boost::shared_ptr<AutomationTimeAxisView> atv = stv->automation_child (EventTypeMap::instance().from_symbol (param));
                                        if (atv) {
                                                list<boost::shared_ptr<AutomationLine> > lines = atv->lines();
                                                for (list<boost::shared_ptr<AutomationLine> > ::iterator li = lines.begin(); li != lines.end(); ++li) {
@@ -1387,10 +1387,10 @@ Selection::set_state (XMLNode const & node, int)
                                assert (false);
                        }
 
-                       RouteTimeAxisView* rtv = editor->get_route_view_by_route_id (id);
+                       StripableTimeAxisView* stv = editor->get_stripable_time_axis_by_id (id);
 
-                       if (rtv) {
-                               boost::shared_ptr<AutomationTimeAxisView> atv = rtv->automation_child (EventTypeMap::instance().from_symbol (param));
+                       if (stv) {
+                               boost::shared_ptr<AutomationTimeAxisView> atv = stv->automation_child (EventTypeMap::instance().from_symbol (param));
 
                                /* the automation could be for an entity that was never saved
                                   in the session file. Don't freak out if we can't find