Convert polarity invert state from v2 sessions

This commit is contained in:
Robin Gareus 2020-03-25 23:56:31 +01:00
parent 51165aec0b
commit 84f8b8beae
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04

View File

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