13
0

Fix Thread & Lock issues when adding Triggerbox w/sidechain

Track::init() must not call `add_processor` directly.
The track is not in the process graph, yet and hence various
calls (e.g. lock graph, update latency etc) are not applicable.

Furthermore ::add_midi_sidechain() calls IO::add_port()
which takes the process-lock.

The solution is to create the Triggerbox early on and let Route::init
deal with it like any other internal processors.
This commit is contained in:
Robin Gareus 2022-01-22 04:20:32 +01:00
parent 687149d8d2
commit 0e6561b009
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04

View File

@ -87,6 +87,12 @@ Track::~Track ()
int
Track::init ()
{
if (!is_auditioner()) {
_triggerbox = boost::shared_ptr<TriggerBox> (new TriggerBox (_session, data_type ()));
_triggerbox->set_owner (this);
_triggerbox->add_midi_sidechain ();
}
if (Route::init ()) {
return -1;
}
@ -105,13 +111,6 @@ Track::init ()
* patchbays and elsewhere (or special-case code in those places)
*/
if (!is_auditioner()) {
boost::shared_ptr<TriggerBox> tb (new TriggerBox (_session, data_type ()));
tb->set_owner (this);
add_processor (tb, _polarity);
tb->add_midi_sidechain ();
}
set_align_choice_from_io ();
boost::shared_ptr<Route> rp (boost::dynamic_pointer_cast<Route> (shared_from_this()));