summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2020-03-25 23:56:31 +0100
committerRobin Gareus <robin@gareus.org>2020-03-25 23:58:15 +0100
commit84f8b8beae752bed053b555579b04397d1785cee (patch)
tree90374fbeb41b2e694b7e8ee961673a0dcb5c8379
parent51165aec0be59c2a2429a0022c53e6c39d383fc8 (diff)
Convert polarity invert state from v2 sessions
-rw-r--r--libs/ardour/route.cc14
1 files changed, 14 insertions, 0 deletions
diff --git a/libs/ardour/route.cc b/libs/ardour/route.cc
index 622ec7cd1a..cbe8830692 100644
--- a/libs/ardour/route.cc
+++ b/libs/ardour/route.cc
@@ -2962,6 +2962,20 @@ Route::set_state_2X (const XMLNode& node, int version)
}
}
+ bool phase_invert; /* yes / no - apply to all channels */
+ if (node.get_property (X_("phase-invert"), phase_invert)) {
+ /* phase_control is not usually configured at this point in time
+ * _phase_control->count() == 0. However in v2, polarity invert
+ * is directly after the input, so the input channel count can be used.
+ * NB. v2 busses: polarity invert was only applied to inputs. Aux-return
+ * was not affected. This is no longer the case (and may break sessions).
+ */
+ uint64_t pol_cnt = std::max ((uint64_t)_input->n_ports().n_audio (), _phase_control->count ());
+ for (uint64_t c = 0; c < pol_cnt; ++c) {
+ _phase_control->set_phase_invert (c, phase_invert);
+ }
+ }
+
return 0;
}