mirror of
https://github.com/robbert-vdh/nih-plug.git
synced 2026-07-01 02:36:54 +00:00
Hold the RwLock guard in the process context
This avoids having to constantly acquire a new lock.
This commit is contained in:
@@ -111,7 +111,7 @@ impl Plugin for Gain {
|
||||
&mut self,
|
||||
_bus_config: &BusConfig,
|
||||
_buffer_config: &BufferConfig,
|
||||
_context: &impl ProcessContext,
|
||||
_context: &mut impl ProcessContext,
|
||||
) -> bool {
|
||||
// This plugin doesn't need any special initialization, but if you need to do anything
|
||||
// expensive then this would be the place. State is kept around while when the host
|
||||
@@ -119,7 +119,11 @@ impl Plugin for Gain {
|
||||
true
|
||||
}
|
||||
|
||||
fn process(&mut self, buffer: &mut Buffer, _context: &impl ProcessContext) -> ProcessStatus {
|
||||
fn process(
|
||||
&mut self,
|
||||
buffer: &mut Buffer,
|
||||
_context: &mut impl ProcessContext,
|
||||
) -> ProcessStatus {
|
||||
for samples in buffer.iter_mut() {
|
||||
// Smoothing is optionally built into the parameters themselves
|
||||
let gain = self.params.gain.smoothed.next();
|
||||
|
||||
Reference in New Issue
Block a user