13
0

Prepare AutomationTimeAxisView for non-route (VCA) automation

This commit is contained in:
Robin Gareus 2017-06-08 23:45:07 +02:00
parent d08b81d33d
commit b0f68a0f5c
3 changed files with 26 additions and 26 deletions

View File

@ -75,7 +75,7 @@ bool AutomationTimeAxisView::have_name_font = false;
*/ */
AutomationTimeAxisView::AutomationTimeAxisView ( AutomationTimeAxisView::AutomationTimeAxisView (
Session* s, Session* s,
boost::shared_ptr<Route> r, boost::shared_ptr<Stripable> strip,
boost::shared_ptr<Automatable> a, boost::shared_ptr<Automatable> a,
boost::shared_ptr<AutomationControl> c, boost::shared_ptr<AutomationControl> c,
Evoral::Parameter p, Evoral::Parameter p,
@ -88,7 +88,7 @@ AutomationTimeAxisView::AutomationTimeAxisView (
) )
: SessionHandlePtr (s) : SessionHandlePtr (s)
, TimeAxisView (s, e, &parent, canvas) , TimeAxisView (s, e, &parent, canvas)
, _route (r) , _stripable (strip)
, _control (c) , _control (c)
, _automatable (a) , _automatable (a)
, _parameter (p) , _parameter (p)
@ -113,9 +113,9 @@ AutomationTimeAxisView::AutomationTimeAxisView (
tipname += nom; tipname += nom;
_name = tipname; _name = tipname;
CANVAS_DEBUG_NAME (_canvas_display, string_compose ("main 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, r->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, r->name())); CANVAS_DEBUG_NAME (_ghost_group, string_compose ("ghosts for auto %2/%1", _name, strip->name()));
if (!have_name_font) { if (!have_name_font) {
name_font = get_font_for_style (X_("AutomationTrackName")); name_font = get_font_for_style (X_("AutomationTrackName"));
@ -297,8 +297,8 @@ AutomationTimeAxisView::AutomationTimeAxisView (
automation_state_changed (); automation_state_changed ();
UIConfiguration::instance().ColorsChanged.connect (sigc::mem_fun (*this, &AutomationTimeAxisView::color_handler)); UIConfiguration::instance().ColorsChanged.connect (sigc::mem_fun (*this, &AutomationTimeAxisView::color_handler));
_route->DropReferences.connect ( _stripable->DropReferences.connect (
_route_connections, invalidator (*this), boost::bind (&AutomationTimeAxisView::route_going_away, this), gui_context () _stripable_connections, invalidator (*this), boost::bind (&AutomationTimeAxisView::route_going_away, this), gui_context ()
); );
} }
@ -311,7 +311,7 @@ AutomationTimeAxisView::~AutomationTimeAxisView ()
void void
AutomationTimeAxisView::route_going_away () AutomationTimeAxisView::route_going_away ()
{ {
_route.reset (); _stripable.reset ();
} }
void void
@ -490,9 +490,9 @@ AutomationTimeAxisView::set_height (uint32_t h, TrackHeightMode m)
} }
if (changed) { 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 */ /* 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 string
AutomationTimeAxisView::state_id() const AutomationTimeAxisView::state_id() const
{ {
if (_automatable != _route && _control) { if (_automatable != _stripable && _control) {
return string("automation ") + _control->id().to_s(); return string("automation ") + _control->id().to_s();
} else if (_parameter) { } else if (_parameter) {
const string parameter_str = PBD::to_string (_parameter.type()) + "/" + const string parameter_str = PBD::to_string (_parameter.type()) + "/" +
PBD::to_string (_parameter.id()) + "/" + PBD::to_string (_parameter.id()) + "/" +
PBD::to_string (_parameter.channel ()); 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 { } else {
error << "Automation time axis has no state ID" << endmsg; error << "Automation time axis has no state ID" << endmsg;
return ""; return "";
@ -1048,18 +1048,18 @@ AutomationTimeAxisView::cut_copy_clear_one (AutomationLine& line, Selection& sel
PresentationInfo const & PresentationInfo const &
AutomationTimeAxisView::presentation_info () const AutomationTimeAxisView::presentation_info () const
{ {
return _route->presentation_info(); return _stripable->presentation_info();
} }
boost::shared_ptr<Stripable> boost::shared_ptr<Stripable>
AutomationTimeAxisView::stripable () const AutomationTimeAxisView::stripable () const
{ {
return _route; return _stripable;
} }
Gdk::Color Gdk::Color
AutomationTimeAxisView::color () const AutomationTimeAxisView::color () const
{ {
return gdk_color_from_rgb (_route->presentation_info().color()); return gdk_color_from_rgb (_stripable->presentation_info().color());
} }

View File

@ -39,7 +39,7 @@
namespace ARDOUR { namespace ARDOUR {
class Session; class Session;
class Route; class Stripable;
class AutomationControl; class AutomationControl;
} }
@ -57,7 +57,7 @@ class ItemCounts;
class AutomationTimeAxisView : public TimeAxisView { class AutomationTimeAxisView : public TimeAxisView {
public: public:
AutomationTimeAxisView (ARDOUR::Session*, AutomationTimeAxisView (ARDOUR::Session*,
boost::shared_ptr<ARDOUR::Route>, boost::shared_ptr<ARDOUR::Stripable>,
boost::shared_ptr<ARDOUR::Automatable>, boost::shared_ptr<ARDOUR::Automatable>,
boost::shared_ptr<ARDOUR::AutomationControl>, boost::shared_ptr<ARDOUR::AutomationControl>,
Evoral::Parameter, Evoral::Parameter,
@ -117,8 +117,8 @@ class AutomationTimeAxisView : public TimeAxisView {
bool has_automation () const; bool has_automation () const;
boost::shared_ptr<ARDOUR::Route> parent_route () { boost::shared_ptr<ARDOUR::Stripable> parent_stripable () {
return _route; return _stripable;
} }
bool show_regions () const { bool show_regions () const {
@ -132,11 +132,11 @@ class AutomationTimeAxisView : public TimeAxisView {
may be set. In this case, _automatable is likely _route so the may be set. In this case, _automatable is likely _route so the
controller will send immediate events out the route's MIDI port. */ controller will send immediate events out the route's MIDI port. */
/** parent route */ /** parent strip */
boost::shared_ptr<ARDOUR::Route> _route; boost::shared_ptr<ARDOUR::Stripable> _stripable;
/** control */ /** control */
boost::shared_ptr<ARDOUR::AutomationControl> _control; boost::shared_ptr<ARDOUR::AutomationControl> _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<ARDOUR::Automatable> _automatable; boost::shared_ptr<ARDOUR::Automatable> _automatable;
/** controller owner */ /** controller owner */
boost::shared_ptr<AutomationController> _controller; boost::shared_ptr<AutomationController> _controller;
@ -190,7 +190,7 @@ class AutomationTimeAxisView : public TimeAxisView {
void interpolation_changed (ARDOUR::AutomationList::InterpolationStyle); void interpolation_changed (ARDOUR::AutomationList::InterpolationStyle);
PBD::ScopedConnectionList _list_connections; PBD::ScopedConnectionList _list_connections;
PBD::ScopedConnectionList _route_connections; PBD::ScopedConnectionList _stripable_connections;
void entered (); void entered ();
void exited (); void exited ();

View File

@ -1145,7 +1145,7 @@ Selection::get_state () const
t->set_property (X_("id"), rtv->route()->id ()); t->set_property (X_("id"), rtv->route()->id ());
} else if (atv) { } else if (atv) {
XMLNode* t = node->add_child (X_("AutomationView")); 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 ())); 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")); XMLNode* r = node->add_child (X_("ControlPoint"));
r->set_property (X_("type"), "track"); 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_("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_("parameter"), EventTypeMap::instance().to_symbol ((*i)->line().the_list()->parameter ()));
r->set_property (X_("view-index"), (*i)->view_index()); r->set_property (X_("view-index"), (*i)->view_index());
@ -1305,7 +1305,7 @@ Selection::set_state (XMLNode const & node, int)
assert(false); 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 <ControlPoint *> cps; vector <ControlPoint *> cps;
if (rtv) { if (rtv) {