Skip to content

Change of the mutability oif PluginAudioProcessor.activate for main_thread #96

Description

@anton-k

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions