diff --git a/libs/ardour/ardour/panner_shell.h b/libs/ardour/ardour/panner_shell.h index 68e0928ed7..2399b85990 100644 --- a/libs/ardour/ardour/panner_shell.h +++ b/libs/ardour/ardour/panner_shell.h @@ -70,6 +70,7 @@ public: boost::shared_ptr panner() const { return _panner; } boost::shared_ptr pannable() const { return _panlinked ? _pannable_route : _pannable_internal; } + boost::shared_ptr unlinked_pannable () const { return _pannable_internal; } bool bypassed () const; void set_bypassed (bool); diff --git a/libs/ardour/delivery.cc b/libs/ardour/delivery.cc index 5407f0e78b..d8534edd2c 100644 --- a/libs/ardour/delivery.cc +++ b/libs/ardour/delivery.cc @@ -375,8 +375,8 @@ Delivery::state () if (_panshell) { node.add_child_nocopy (_panshell->get_state ()); - if (_panshell->pannable()) { - node.add_child_nocopy (_panshell->pannable()->get_state ()); + if (_panshell->unlinked_pannable ()) { + node.add_child_nocopy (_panshell->unlinked_pannable()->get_state ()); } } @@ -405,8 +405,9 @@ Delivery::set_state (const XMLNode& node, int version) reset_panner (); XMLNode* pannnode = node.child (X_("Pannable")); + if (_panshell && _panshell->panner() && pannnode) { - _panshell->pannable()->set_state (*pannnode, version); + _panshell->unlinked_pannable()->set_state (*pannnode, version); } return 0; diff --git a/libs/ardour/internal_send.cc b/libs/ardour/internal_send.cc index e92dbf972d..56970eca14 100644 --- a/libs/ardour/internal_send.cc +++ b/libs/ardour/internal_send.cc @@ -395,6 +395,15 @@ InternalSend::set_state (const XMLNode& node, int version) { init_gain (); + /* Allow Delivery::set_state() to restore pannable state when + * copy/pasting Aux sends. + * + * At this point in time there is no target-bus. So when + * Delivery::set_state() calls reset_panner(), the pannable + * is dropped, before the panner state can be restored. + */ + defer_pan_reset (); + Send::set_state (node, version); if (node.get_property ("target", _send_to_id)) { @@ -409,6 +418,7 @@ InternalSend::set_state (const XMLNode& node, int version) connect_when_legal (); } } + allow_pan_reset (); if (!is_foldback ()) { node.get_property (X_("allow-feedback"), _allow_feedback);