From b0f68a0f5c8ee0cba1c9c2b2319c3369d5650a87 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Thu, 8 Jun 2017 23:45:07 +0200 Subject: Prepare AutomationTimeAxisView for non-route (VCA) automation --- gtk2_ardour/automation_time_axis.cc | 30 +++++++++++++++--------------- gtk2_ardour/automation_time_axis.h | 16 ++++++++-------- gtk2_ardour/selection.cc | 6 +++--- 3 files changed, 26 insertions(+), 26 deletions(-) diff --git a/gtk2_ardour/automation_time_axis.cc b/gtk2_ardour/automation_time_axis.cc index 3028fdaefd..f245cf74e5 100644 --- a/gtk2_ardour/automation_time_axis.cc +++ b/gtk2_ardour/automation_time_axis.cc @@ -75,7 +75,7 @@ bool AutomationTimeAxisView::have_name_font = false; */ AutomationTimeAxisView::AutomationTimeAxisView ( Session* s, - boost::shared_ptr r, + boost::shared_ptr strip, boost::shared_ptr a, boost::shared_ptr c, Evoral::Parameter p, @@ -88,7 +88,7 @@ AutomationTimeAxisView::AutomationTimeAxisView ( ) : SessionHandlePtr (s) , TimeAxisView (s, e, &parent, canvas) - , _route (r) + , _stripable (strip) , _control (c) , _automatable (a) , _parameter (p) @@ -113,9 +113,9 @@ AutomationTimeAxisView::AutomationTimeAxisView ( tipname += nom; _name = tipname; - CANVAS_DEBUG_NAME (_canvas_display, string_compose ("main for auto %2/%1", _name, r->name())); - CANVAS_DEBUG_NAME (selection_group, string_compose ("selections for auto %2/%1", _name, r->name())); - CANVAS_DEBUG_NAME (_ghost_group, string_compose ("ghosts for auto %2/%1", _name, r->name())); + CANVAS_DEBUG_NAME (_canvas_display, string_compose ("main for auto %2/%1", _name, strip->name())); + CANVAS_DEBUG_NAME (selection_group, string_compose ("selections for auto %2/%1", _name, strip->name())); + CANVAS_DEBUG_NAME (_ghost_group, string_compose ("ghosts for auto %2/%1", _name, strip->name())); if (!have_name_font) { name_font = get_font_for_style (X_("AutomationTrackName")); @@ -297,8 +297,8 @@ AutomationTimeAxisView::AutomationTimeAxisView ( automation_state_changed (); UIConfiguration::instance().ColorsChanged.connect (sigc::mem_fun (*this, &AutomationTimeAxisView::color_handler)); - _route->DropReferences.connect ( - _route_connections, invalidator (*this), boost::bind (&AutomationTimeAxisView::route_going_away, this), gui_context () + _stripable->DropReferences.connect ( + _stripable_connections, invalidator (*this), boost::bind (&AutomationTimeAxisView::route_going_away, this), gui_context () ); } @@ -311,7 +311,7 @@ AutomationTimeAxisView::~AutomationTimeAxisView () void AutomationTimeAxisView::route_going_away () { - _route.reset (); + _stripable.reset (); } void @@ -490,9 +490,9 @@ AutomationTimeAxisView::set_height (uint32_t h, TrackHeightMode m) } if (changed) { - if (_canvas_display->visible() && _route) { + if (_canvas_display->visible() && _stripable) { /* only emit the signal if the height really changed and we were visible */ - _route->gui_changed ("visible_tracks", (void *) 0); /* EMIT_SIGNAL */ + _stripable->gui_changed ("visible_tracks", (void *) 0); /* EMIT_SIGNAL */ } } } @@ -916,14 +916,14 @@ AutomationTimeAxisView::lines () const string AutomationTimeAxisView::state_id() const { - if (_automatable != _route && _control) { + if (_automatable != _stripable && _control) { return string("automation ") + _control->id().to_s(); } else if (_parameter) { const string parameter_str = PBD::to_string (_parameter.type()) + "/" + PBD::to_string (_parameter.id()) + "/" + PBD::to_string (_parameter.channel ()); - return string("automation ") + PBD::to_string(_route->id()) + " " + parameter_str; + return string("automation ") + PBD::to_string(_stripable->id()) + " " + parameter_str; } else { error << "Automation time axis has no state ID" << endmsg; return ""; @@ -1048,18 +1048,18 @@ AutomationTimeAxisView::cut_copy_clear_one (AutomationLine& line, Selection& sel PresentationInfo const & AutomationTimeAxisView::presentation_info () const { - return _route->presentation_info(); + return _stripable->presentation_info(); } boost::shared_ptr AutomationTimeAxisView::stripable () const { - return _route; + return _stripable; } Gdk::Color AutomationTimeAxisView::color () const { - return gdk_color_from_rgb (_route->presentation_info().color()); + return gdk_color_from_rgb (_stripable->presentation_info().color()); } diff --git a/gtk2_ardour/automation_time_axis.h b/gtk2_ardour/automation_time_axis.h index c298ac325b..74dce4f377 100644 --- a/gtk2_ardour/automation_time_axis.h +++ b/gtk2_ardour/automation_time_axis.h @@ -39,7 +39,7 @@ namespace ARDOUR { class Session; - class Route; + class Stripable; class AutomationControl; } @@ -57,7 +57,7 @@ class ItemCounts; class AutomationTimeAxisView : public TimeAxisView { public: AutomationTimeAxisView (ARDOUR::Session*, - boost::shared_ptr, + boost::shared_ptr, boost::shared_ptr, boost::shared_ptr, Evoral::Parameter, @@ -117,8 +117,8 @@ class AutomationTimeAxisView : public TimeAxisView { bool has_automation () const; - boost::shared_ptr parent_route () { - return _route; + boost::shared_ptr parent_stripable () { + return _stripable; } bool show_regions () const { @@ -132,11 +132,11 @@ class AutomationTimeAxisView : public TimeAxisView { may be set. In this case, _automatable is likely _route so the controller will send immediate events out the route's MIDI port. */ - /** parent route */ - boost::shared_ptr _route; + /** parent strip */ + boost::shared_ptr _stripable; /** control */ boost::shared_ptr _control; - /** control owner; may be _route, something else (e.g. a pan control), or NULL */ + /** control owner; may be _stripable, something else (e.g. a pan control), or NULL */ boost::shared_ptr _automatable; /** controller owner */ boost::shared_ptr _controller; @@ -190,7 +190,7 @@ class AutomationTimeAxisView : public TimeAxisView { void interpolation_changed (ARDOUR::AutomationList::InterpolationStyle); PBD::ScopedConnectionList _list_connections; - PBD::ScopedConnectionList _route_connections; + PBD::ScopedConnectionList _stripable_connections; void entered (); void exited (); diff --git a/gtk2_ardour/selection.cc b/gtk2_ardour/selection.cc index 7639d47dbc..18ae75b386 100644 --- a/gtk2_ardour/selection.cc +++ b/gtk2_ardour/selection.cc @@ -1145,7 +1145,7 @@ Selection::get_state () const t->set_property (X_("id"), rtv->route()->id ()); } else if (atv) { XMLNode* t = node->add_child (X_("AutomationView")); - t->set_property (X_("id"), atv->parent_route()->id ()); + t->set_property (X_("id"), atv->parent_stripable()->id ()); t->set_property (X_("parameter"), EventTypeMap::instance().to_symbol (atv->parameter ())); } } @@ -1176,7 +1176,7 @@ Selection::get_state () const XMLNode* r = node->add_child (X_("ControlPoint")); r->set_property (X_("type"), "track"); - r->set_property (X_("route-id"), atv->parent_route()->id ()); + r->set_property (X_("route-id"), atv->parent_stripable()->id ()); r->set_property (X_("automation-list-id"), (*i)->line().the_list()->id ()); r->set_property (X_("parameter"), EventTypeMap::instance().to_symbol ((*i)->line().the_list()->parameter ())); r->set_property (X_("view-index"), (*i)->view_index()); @@ -1305,7 +1305,7 @@ Selection::set_state (XMLNode const & node, int) assert(false); } - RouteTimeAxisView* rtv = editor->get_route_view_by_route_id (route_id); + RouteTimeAxisView* rtv = editor->get_route_view_by_route_id (route_id); // XXX may also be VCA vector cps; if (rtv) { -- cgit v1.2.3