💥 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:
Robbert van der Helm
2022-09-06 21:55:14 +02:00
parent 5966e353da
commit c566888fa3
17 changed files with 262 additions and 238 deletions

View File

@@ -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,
),
}