I’m trying to adapt external library which write data as customized format. It’s start from initilzation part / Write / Finallizer. The expected format is consists of all tracks in session, so I have to figure out which track(plug-in instance) is first taker and last taker.
I tried to use simple way which uses static bool flag, but processBlock in instances enter the scope almost simultaneously. Sometimes, those are all set as first taker.
I am considering make their own ciritical senction for updating status one by one saefly. Surely, it is lock, and it can makes trouble in processBlock. But it is so short and the function is only work in offline bounce (render).
static bool isFirstTaker = false;
static bool isLastTaker = false;
static TrackManager trackManager;
isFirstTaker = true;