Fix send panner when copying sends

* Unlinked panners now retain their state during copy/paste.
 * Linked send panners can no longer override parent route panning
 * Unlinked panner state is retained across link/unlink.
This commit is contained in:
Robin Gareus 2021-01-18 18:57:37 +01:00
parent 9c06f693e9
commit 983c577945
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04
3 changed files with 15 additions and 3 deletions

View File

@ -70,6 +70,7 @@ public:
boost::shared_ptr<Panner> panner() const { return _panner; }
boost::shared_ptr<Pannable> pannable() const { return _panlinked ? _pannable_route : _pannable_internal; }
boost::shared_ptr<Pannable> unlinked_pannable () const { return _pannable_internal; }
bool bypassed () const;
void set_bypassed (bool);

View File

@ -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;

View File

@ -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);