In recent version there is an API change. main_thread argument became immutable.
This makes it impossible to pass channels from main to audio thread. I used to create rtrb channels
for communication between UI and audio threads. And &mut main_thread on activation of the audio thread
allows to give ownership of the Producer or Consumer channel with this pattern:
struct PluginMainThread {
...
audio_channel: Option<FromUiConsumer>
...
}
And inside the activate if main_thread is mutable I can give ownership of the consumer to the audio thread:
fn activate(main_thread: &mut PluginMainThread, ...) {
...
AudioThread {
fro_ui_consumer: main_thread.audio_channel.take()
}
}
and with the new version it's not possible. And I don't know how to pass the consumers/producers to audio thread.
Is it possible to do it in some another way?
In recent version there is an API change. main_thread argument became immutable.
This makes it impossible to pass channels from main to audio thread. I used to create
rtrbchannelsfor communication between UI and audio threads. And &mut main_thread on activation of the audio thread
allows to give ownership of the Producer or Consumer channel with this pattern:
And inside the activate if main_thread is mutable I can give ownership of the consumer to the audio thread:
and with the new version it's not possible. And I don't know how to pass the consumers/producers to audio thread.
Is it possible to do it in some another way?