2022-03-13 13:31:28 +01:00
|
|
|
//! Widgets and utilities for making widgets to integrate iced with NIH-plug.
|
2022-03-14 00:53:22 +01:00
|
|
|
//!
|
|
|
|
//! # Note
|
|
|
|
//!
|
|
|
|
//! None of these widgets are finalized, and their sizes or looks can change at any point. Feel free
|
|
|
|
//! to copy the widgets and modify them to your personal taste.
|
2022-03-13 13:31:28 +01:00
|
|
|
|
2022-03-23 12:46:46 +01:00
|
|
|
use nih_plug::prelude::ParamPtr;
|
2022-03-13 13:31:28 +01:00
|
|
|
|
2022-03-16 01:17:12 +01:00
|
|
|
pub mod generic_ui;
|
2022-03-14 14:16:47 +01:00
|
|
|
pub mod param_slider;
|
2022-03-15 17:06:47 +01:00
|
|
|
pub mod peak_meter;
|
2022-03-14 13:17:19 +01:00
|
|
|
pub mod util;
|
2022-03-14 00:53:22 +01:00
|
|
|
|
|
|
|
pub use param_slider::ParamSlider;
|
2022-03-15 17:06:47 +01:00
|
|
|
pub use peak_meter::PeakMeter;
|
2022-03-14 00:53:22 +01:00
|
|
|
|
2022-03-13 13:31:28 +01:00
|
|
|
/// 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),
|
|
|
|
/// End an automation gesture for a parameter.
|
|
|
|
EndSetParameter(ParamPtr),
|
|
|
|
}
|