mirror of
https://github.com/robbert-vdh/nih-plug.git
synced 2026-07-01 02:36:54 +00:00
💥 Use interior mutability for parameters
Instead of the previous technically-unsound approach. While it wouldn't cause any issues in practice, it did break Rust's guarantees. That was a design choice after adding support for editors in NIH-plug, but this is probably the better long term solution. The downside is that all uses of `param.value` now need to be changed to `param.value()`.
This commit is contained in:
@@ -291,7 +291,7 @@ impl Crossover {
|
||||
}
|
||||
|
||||
self.iir_crossover.process(
|
||||
self.params.num_bands.value as usize,
|
||||
self.params.num_bands.value() as usize,
|
||||
&main_channel_samples,
|
||||
bands,
|
||||
);
|
||||
@@ -331,7 +331,7 @@ impl Crossover {
|
||||
];
|
||||
|
||||
self.fir_crossover.process(
|
||||
self.params.num_bands.value as usize,
|
||||
self.params.num_bands.value() as usize,
|
||||
main_io,
|
||||
band_outputs,
|
||||
channel_idx,
|
||||
@@ -371,12 +371,12 @@ impl Crossover {
|
||||
match self.params.crossover_type.value() {
|
||||
CrossoverType::LinkwitzRiley24 => self.iir_crossover.update(
|
||||
self.buffer_config.sample_rate,
|
||||
self.params.num_bands.value as usize,
|
||||
self.params.num_bands.value() as usize,
|
||||
crossover_frequencies,
|
||||
),
|
||||
CrossoverType::LinkwitzRiley24LinearPhase => self.fir_crossover.update(
|
||||
self.buffer_config.sample_rate,
|
||||
self.params.num_bands.value as usize,
|
||||
self.params.num_bands.value() as usize,
|
||||
crossover_frequencies,
|
||||
),
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user