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:
@@ -150,7 +150,7 @@ impl Plugin for Sine {
|
||||
let gain = self.params.gain.smoothed.next();
|
||||
|
||||
// This plugin can be either triggered by MIDI or controleld by a parameter
|
||||
let sine = if self.params.use_midi.value {
|
||||
let sine = if self.params.use_midi.value() {
|
||||
// Act on the next MIDI event
|
||||
while let Some(event) = next_event {
|
||||
if event.timing() > sample_id as u32 {
|
||||
|
||||
Reference in New Issue
Block a user