From b72e240a2b2d00b8a5327e84be98a442c334b9e2 Mon Sep 17 00:00:00 2001 From: Micah Johnston Date: Sun, 17 Mar 2024 22:25:42 -0500 Subject: [PATCH] Plugin::processor/editor take &mut self --- examples/gain/src/lib.rs | 4 ++-- src/plugin.rs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/gain/src/lib.rs b/examples/gain/src/lib.rs index a75dc7b..80deebc 100644 --- a/examples/gain/src/lib.rs +++ b/examples/gain/src/lib.rs @@ -76,13 +76,13 @@ impl Plugin for Gain { Ok(()) } - fn processor(&self, _config: Config) -> Self::Processor { + fn processor(&mut self, _config: Config) -> Self::Processor { GainProcessor { params: self.params.clone(), } } - fn editor(&self, _parent: Parent) -> Self::Editor { + fn editor(&mut self, _parent: Parent) -> Self::Editor { NoEditor } } diff --git a/src/plugin.rs b/src/plugin.rs index 7e388dd..363b7f6 100644 --- a/src/plugin.rs +++ b/src/plugin.rs @@ -57,8 +57,8 @@ pub trait Plugin: Send + Sized + 'static { fn get_param(&self, id: ParamId) -> ParamValue; fn save(&self, output: &mut impl Write) -> io::Result<()>; fn load(&mut self, input: &mut impl Read) -> io::Result<()>; - fn processor(&self, config: Config) -> Self::Processor; - fn editor(&self, parent: Parent) -> Self::Editor; + fn processor(&mut self, config: Config) -> Self::Processor; + fn editor(&mut self, parent: Parent) -> Self::Editor; #[allow(unused_variables)] fn latency(&self, config: &Config) -> u64 {