From 9acd31276801e6b2d0eaf78360f34ee354d35cbc Mon Sep 17 00:00:00 2001 From: Robbert van der Helm Date: Sun, 24 Apr 2022 18:34:40 +0200 Subject: [PATCH] Parmaeters are not real, they can't hurt you --- nih_plug_derive/src/params.rs | 2 +- nih_plug_iced/src/wrapper.rs | 2 +- nih_plug_vizia/src/widgets/generic_ui.rs | 2 +- plugins/diopser/src/lib.rs | 2 +- plugins/examples/gain/src/lib.rs | 2 +- plugins/examples/gain_gui_egui/src/lib.rs | 2 +- src/param.rs | 2 +- src/param/boolean.rs | 4 ++-- src/param/float.rs | 2 +- src/param/integer.rs | 2 +- src/plugin.rs | 2 +- src/wrapper/clap/wrapper.rs | 6 +++--- src/wrapper/standalone/wrapper.rs | 2 +- src/wrapper/state.rs | 4 ++-- src/wrapper/vst3/param_units.rs | 2 +- src/wrapper/vst3/wrapper.rs | 2 +- 16 files changed, 20 insertions(+), 20 deletions(-) diff --git a/nih_plug_derive/src/params.rs b/nih_plug_derive/src/params.rs index 63737e76..17a39289 100644 --- a/nih_plug_derive/src/params.rs +++ b/nih_plug_derive/src/params.rs @@ -25,7 +25,7 @@ pub fn derive_params(input: TokenStream) -> TokenStream { // We only care about fields with `id`, `persist`, and `nested` attributes. For the `id` fields // we'll build a mapping function that creates a hashmap containing pointers to those - // parmaeters. For the `persist` function we'll create functions that serialize and deserialize + // parameters. For the `persist` function we'll create functions that serialize and deserialize // those fields individually (so they can be added and removed independently of eachother) using // JSON. The `nested` fields should also implement the `Params` trait and their fields will be // inherited and added to this field's lists. diff --git a/nih_plug_iced/src/wrapper.rs b/nih_plug_iced/src/wrapper.rs index 1701d4a0..192f85aa 100644 --- a/nih_plug_iced/src/wrapper.rs +++ b/nih_plug_iced/src/wrapper.rs @@ -22,7 +22,7 @@ pub(crate) struct IcedEditorWrapperApplication { parameter_updates_receiver: Arc>, } -/// This wraps around `E::Message` to add a parmaeter update message which can be handled directly +/// This wraps around `E::Message` to add a parameter update message which can be handled directly /// by this wrapper. That parameter update message simply forces a redraw of the GUI whenever there /// is a parameter update. pub enum Message { diff --git a/nih_plug_vizia/src/widgets/generic_ui.rs b/nih_plug_vizia/src/widgets/generic_ui.rs index f2eab9d4..f186c586 100644 --- a/nih_plug_vizia/src/widgets/generic_ui.rs +++ b/nih_plug_vizia/src/widgets/generic_ui.rs @@ -9,7 +9,7 @@ use super::{ParamSlider, ParamSliderExt, ParamSliderStyle}; /// Shows a generic UI for a [`Params`] object. For additional flexibility you can either use the /// [`new()`][`Self::new()`] method to have the generic UI decide which widget to use for your -/// parmaeters, or you can use the [`new_custom()`][`Self::new_custom()`] method to determine this +/// parameters, or you can use the [`new_custom()`][`Self::new_custom()`] method to determine this /// yourself. pub struct GenericUi; diff --git a/plugins/diopser/src/lib.rs b/plugins/diopser/src/lib.rs index 30c7945e..cdac626e 100644 --- a/plugins/diopser/src/lib.rs +++ b/plugins/diopser/src/lib.rs @@ -37,7 +37,7 @@ mod spectrum; /// How many all-pass filters we can have in series at most. The filter stages parameter determines /// how many filters are actually active. const MAX_NUM_FILTERS: usize = 512; -/// The minimum step size for smoothing the filter parmaeters. +/// The minimum step size for smoothing the filter parameters. const MIN_AUTOMATION_STEP_SIZE: u32 = 1; /// The maximum step size for smoothing the filter parameters. Updating these parameters can be /// expensive, so updating them in larger steps can be useful. diff --git a/plugins/examples/gain/src/lib.rs b/plugins/examples/gain/src/lib.rs index 1b3713e1..600f53f2 100644 --- a/plugins/examples/gain/src/lib.rs +++ b/plugins/examples/gain/src/lib.rs @@ -9,7 +9,7 @@ struct Gain { /// The [`Params`] derive macro gathers all of the information needed for the wrapepr to know about /// the plugin's parameters, persistent serializable fields, and nested parameter groups. You can /// aslo easily implement [`Params`] by hand if you want to, for instance, have multiple instances -/// of a parmaeters struct for multiple identical oscillators/filters/envelopes. +/// of a parameters struct for multiple identical oscillators/filters/envelopes. #[derive(Params)] struct GainParams { /// The parameter's ID is used to identify the parameter in the wrappred plugin API. As long as diff --git a/plugins/examples/gain_gui_egui/src/lib.rs b/plugins/examples/gain_gui_egui/src/lib.rs index 33bcb5de..938bf58c 100644 --- a/plugins/examples/gain_gui_egui/src/lib.rs +++ b/plugins/examples/gain_gui_egui/src/lib.rs @@ -99,7 +99,7 @@ impl Plugin for Gain { "Also gain, but with a lame widget. Can't even render the value correctly!", ); // This is a simple naieve version of a parameter slider that's not aware of how - // the parmaeters work + // the parameters work ui.add( egui::widgets::Slider::from_get_set(-30.0..=30.0, |new_value| { match new_value { diff --git a/src/param.rs b/src/param.rs index 52730632..439c35ba 100644 --- a/src/param.rs +++ b/src/param.rs @@ -1,6 +1,6 @@ //! NIH-plug can handle floating point, integer, boolean, and enum parameters. Parameters are //! managed by creating a struct deriving the [`Params`][internals::Params] trait containing fields -//! for those parmaeter types, and then returning a reference to that object from your +//! for those parameter types, and then returning a reference to that object from your //! [`Plugin::params()`][crate::prelude::Plugin::params()] method. See the `Params` trait for more //! information. diff --git a/src/param/boolean.rs b/src/param/boolean.rs index 13c8e101..8dcda905 100644 --- a/src/param/boolean.rs +++ b/src/param/boolean.rs @@ -6,7 +6,7 @@ use std::sync::Arc; use super::internals::ParamPtr; use super::{Param, ParamFlags}; -/// A simple boolean parmaeter. +/// A simple boolean parameter. #[repr(C, align(4))] pub struct BoolParam { /// The field's current value. Should be initialized with the default value. @@ -183,7 +183,7 @@ impl BoolParam { } /// Mark this parameter as a bypass parameter. Plugin hosts can integrate this parameter into - /// their UI. Only a single [`BoolParam`] can be a bypass parmaeter, and NIH-plug will add one + /// their UI. Only a single [`BoolParam`] can be a bypass parameter, and NIH-plug will add one /// if you don't create one yourself. You will need to implement this yourself if your plugin /// introduces latency. pub fn make_bypass(mut self) -> Self { diff --git a/src/param/float.rs b/src/param/float.rs index d00b7349..c3deab94 100644 --- a/src/param/float.rs +++ b/src/param/float.rs @@ -38,7 +38,7 @@ pub struct FloatParam { /// called multiple times in rapid succession. /// /// To use this, you'll probably want to store an `Arc` alongside the parmater in the - /// parmaeters struct, move a clone of that `Arc` into this closure, and then modify that. + /// parameters struct, move a clone of that `Arc` into this closure, and then modify that. /// /// TODO: We probably also want to pass the old value to this function. pub value_changed: Option>, diff --git a/src/param/integer.rs b/src/param/integer.rs index d3ca66c6..0d1e3a19 100644 --- a/src/param/integer.rs +++ b/src/param/integer.rs @@ -38,7 +38,7 @@ pub struct IntParam { /// called multiple times in rapid succession. /// /// To use this, you'll probably want to store an `Arc` alongside the parmater in the - /// parmaeters struct, move a clone of that `Arc` into this closure, and then modify that. + /// parameters struct, move a clone of that `Arc` into this closure, and then modify that. /// /// TODO: We probably also want to pass the old value to this function. pub value_changed: Option>, diff --git a/src/plugin.rs b/src/plugin.rs index 34c2f72a..6b1c582b 100644 --- a/src/plugin.rs +++ b/src/plugin.rs @@ -12,7 +12,7 @@ use crate::param::internals::Params; /// Basic functionality that needs to be implemented by a plugin. The wrappers will use this to /// expose the plugin in a particular plugin format. /// -/// The main thing you need to do is define a `[Params]` struct containing all of your parmaeters. +/// The main thing you need to do is define a `[Params]` struct containing all of your parameters. /// See the trait's documentation for more information on how to do that, or check out the examples. /// /// This is super basic, and lots of things I didn't need or want to use yet haven't been diff --git a/src/wrapper/clap/wrapper.rs b/src/wrapper/clap/wrapper.rs index d6d8c161..7e95fc9a 100644 --- a/src/wrapper/clap/wrapper.rs +++ b/src/wrapper/clap/wrapper.rs @@ -86,7 +86,7 @@ use crate::wrapper::state::{self, PluginState}; use crate::wrapper::util::{hash_param_id, process_wrapper, strlcpy}; /// How many output parameter changes we can store in our output parameter change queue. Storing -/// more than this many parmaeters at a time will cause changes to get lost. +/// more than this many parameters at a time will cause changes to get lost. const OUTPUT_EVENT_QUEUE_CAPACITY: usize = 2048; #[repr(C)] @@ -208,7 +208,7 @@ pub struct Wrapper { /// A queue of parameter changes and gestures that should be output in either the next process /// call or in the next parameter flush. /// - /// XXX: There's no guarentee that a single parmaeter doesn't occur twice in this queue, but + /// XXX: There's no guarentee that a single parameter doesn't occur twice in this queue, but /// even if it does then that should still not be a problem because the host also reads it /// in the same order, right? output_parameter_events: ArrayQueue, @@ -260,7 +260,7 @@ pub enum ClapParamUpdate { pub enum OutputParamEvent { /// Begin an automation gesture. This must always be sent before sending [`SetValue`]. BeginGesture { param_hash: u32 }, - /// Change the value of a parmaeter using a plain CLAP value, aka the normalized value + /// Change the value of a parameter using a plain CLAP value, aka the normalized value /// multiplied by the number of steps. SetValue { /// The internal hash for the parameter. diff --git a/src/wrapper/standalone/wrapper.rs b/src/wrapper/standalone/wrapper.rs index b95f53be..e44510de 100644 --- a/src/wrapper/standalone/wrapper.rs +++ b/src/wrapper/standalone/wrapper.rs @@ -18,7 +18,7 @@ use crate::param::ParamFlags; use crate::plugin::{BufferConfig, BusConfig, Editor, ParentWindowHandle, Plugin, ProcessStatus}; /// How many parameter changes we can store in our unprocessed parameter change queue. Storing more -/// than this many parmaeters at a time will cause changes to get lost. +/// than this many parameters at a time will cause changes to get lost. const EVENT_QUEUE_CAPACITY: usize = 2048; /// Configuration for a standalone plugin that would normally be provided by the DAW. diff --git a/src/wrapper/state.rs b/src/wrapper/state.rs index 6edda71d..eb806059 100644 --- a/src/wrapper/state.rs +++ b/src/wrapper/state.rs @@ -27,7 +27,7 @@ pub enum ParamValue { pub struct PluginState { /// The plugin's parameter values. These are stored unnormalized. This mean sthe old values will /// be recalled when when the parameter's range gets increased. Doing so may still mess with - /// parmaeter automation though, depending on how the host impelments that. + /// parameter automation though, depending on how the host impelments that. pub params: HashMap, /// Arbitrary fields that should be persisted together with the plugin's parameters. Any field /// on the [`Params`][crate::param::internals::Params] struct that's annotated with `#[persist = @@ -45,7 +45,7 @@ pub(crate) unsafe fn serialize_object( param_by_hash: &HashMap, param_id_to_hash: &HashMap, ) -> PluginState { - // We'll serialize parmaeter values as a simple `string_param_id: display_value` map. + // We'll serialize parameter values as a simple `string_param_id: display_value` map. let params: HashMap<_, _> = param_id_to_hash .iter() .filter_map(|(param_id_str, hash)| { diff --git a/src/wrapper/vst3/param_units.rs b/src/wrapper/vst3/param_units.rs index 1344732d..f42992ac 100644 --- a/src/wrapper/vst3/param_units.rs +++ b/src/wrapper/vst3/param_units.rs @@ -1,7 +1,7 @@ //! Parameter hierarchies in VST3 requires you to define units, which are linearly indexed logical //! units that have a name, a parent, and then a whole bunch of other data like note numbers and //! MIDI program state. We'll need to implement some of that to conver our list of slash-separated -//! parmaeter group paths to units. +//! parameter group paths to units. //! //! diff --git a/src/wrapper/vst3/wrapper.rs b/src/wrapper/vst3/wrapper.rs index 83cf0bd5..eb212b9c 100644 --- a/src/wrapper/vst3/wrapper.rs +++ b/src/wrapper/vst3/wrapper.rs @@ -923,7 +923,7 @@ impl IAudioProcessor for Wrapper

{ normalized_value, } => { // If this parameter change happens after the start of this block, then - // we'll split the block here and handle this parmaeter change after + // we'll split the block here and handle this parameter change after // we've processed this block if timing != block_start as u32 { event_start_idx = event_idx;