23 lines
1.2 KiB
Rust
23 lines
1.2 KiB
Rust
|
//! Widgets and utilities for making widgets to integrate iced with NIH-plug.
|
||
|
|
||
|
use nih_plug::param::internals::ParamPtr;
|
||
|
|
||
|
/// A message to update a parameter value. Since NIH-plug manages the parameters, interacting with
|
||
|
/// parameter values with iced works a little different from updating any other state. This main
|
||
|
/// [`IcedEditor`][super::IcedEditor] should have a [`Message`][super::IcedEditor::Message] variant
|
||
|
/// containing this `ParamMessage`. When it receives one of those messages, it can pass it through
|
||
|
/// to [`self.handle_param_message()`][super::IcedEditor::handle_param_message].
|
||
|
#[derive(Debug, Clone, Copy)]
|
||
|
pub enum ParamMessage {
|
||
|
/// Begin an automation gesture for a parameter.
|
||
|
BeginSetParameter(ParamPtr),
|
||
|
/// Set a parameter to a new normalized value. This needs to be surrounded by a matching
|
||
|
/// `BeginSetParameter` and `EndSetParameter`.
|
||
|
SetParameterNormalized(ParamPtr, f32),
|
||
|
/// Reset a parameter to its default value. This needs to be surrounded by a matching
|
||
|
/// `BeginSetParameter` and `EndSetParameter`.
|
||
|
ResetParameter(ParamPtr),
|
||
|
/// End an automation gesture for a parameter.
|
||
|
EndSetParameter(ParamPtr),
|
||
|
}
|