diff --git a/nih_plug_vizia/src/widgets.rs b/nih_plug_vizia/src/widgets.rs index 1c729edd..6b0a534d 100644 --- a/nih_plug_vizia/src/widgets.rs +++ b/nih_plug_vizia/src/widgets.rs @@ -32,8 +32,8 @@ pub fn register_theme(cx: &mut Context) { /// with parameter values with VIZIA works a little different from updating any other state. These /// events are automatically handled by `nih_plug_vizia`. /// -/// Call the [`upcast()`][Self::upcast()] method to be able to emit this event through a -/// [`Context`][vizia::Context]. +/// Call the [`upcast()`][Self::upcast()] method to be able to emit this event through an +/// [`EventContext`][EventContext]. #[derive(Debug, Clone, Copy)] pub enum ParamEvent<'a, P: Param> { /// Begin an automation gesture for a parameter. @@ -144,7 +144,7 @@ impl From> for RawParamEvent { impl ParamEvent<'_, P> { /// Convert this event into a type erased version of itself that can be emitted through - /// [`Context::emit()`][vizia::Context::emit()]. + /// [`EventContext::emit()`][EventContext::emit()]. /// /// TODO: Think of a better, clearer term for this pub fn upcast(self) -> RawParamEvent { diff --git a/src/param.rs b/src/param.rs index 4992e8ee..cd331847 100644 --- a/src/param.rs +++ b/src/param.rs @@ -71,15 +71,15 @@ pub trait Param: Display { /// Get this parameter's polyphonic modulation ID. If this is set for a parameter in a CLAP /// plugin, then polyphonic modulation will be enabled for that parameter. Polyphonic modulation /// is communicated to the plugin through - /// [`NoteEvent::PolyModulation][crate::prelude::NoteEvent::PolyModulation`] and - /// [`NoteEvent::MonoAutomation][crate::prelude::NoteEvent::MonoAutomation`] events. See the + /// [`NoteEvent::PolyModulation`][crate::prelude::NoteEvent::PolyModulation] and + /// [`NoteEvent::MonoAutomation`][crate::prelude::NoteEvent::MonoAutomation] events. See the /// documentation on those events for more information. /// /// # Important /// /// After enabling polyphonic modulation, the plugin **must** start sending - /// [`NoteEvent::VoiceTerminated`][crate::prelude::NoteEvent::VoiceEnd] events to the host when a voice - /// has fully ended. This allows the host to reuse its modulation resources. + /// [`NoteEvent::VoiceTerminated`][crate::prelude::NoteEvent::VoiceTerminated] events to the + /// host when a voice has fully ended. This allows the host to reuse its modulation resources. fn poly_modulation_id(&self) -> Option; /// Get the unnormalized value for this parameter. @@ -207,18 +207,18 @@ pub(crate) trait ParamMut: Param { /// /// # Deriving `Params` and `#[id = "stable"]` /// -/// This trait can be derived on a struct containing [`FloatParam`][super::FloatParam] and other -/// parameter fields by adding `#[derive(Params)]`. When deriving this trait, any of those parameter -/// fields should have the `#[id = "stable"]` attribute, where `stable` is an up to 6 character long -/// string (to avoid collisions) that will be used to identify the parameter internally so you can -/// safely move it around and rename the field without breaking compatibility with old presets. +/// This trait can be derived on a struct containing [`FloatParam`] and other parameter fields by +/// adding `#[derive(Params)]`. When deriving this trait, any of those parameter fields should have +/// the `#[id = "stable"]` attribute, where `stable` is an up to 6 character long string (to avoid +/// collisions) that will be used to identify the parameter internally so you can safely move it +/// around and rename the field without breaking compatibility with old presets. /// /// ## `#[persist = "key"]` /// /// The struct can also contain other fields that should be persisted along with the rest of the -/// preset data. These fields should be [`PersistentField`]s annotated with the `#[persist = "key"]` -/// attribute containing types that can be serialized and deserialized with -/// [Serde](https://serde.rs/). +/// preset data. These fields should be [`PersistentField`][persist::PersistentField]s annotated +/// with the `#[persist = "key"]` attribute containing types that can be serialized and deserialized +/// with [Serde](https://serde.rs/). /// /// ## `#[nested]`, `#[nested(group_name = "group name")]` /// @@ -276,16 +276,16 @@ pub unsafe trait Params: 'static + Send + Sync { /// Serialize all fields marked with `#[persist = "stable_name"]` into a hash map containing /// JSON-representations of those fields so they can be written to the plugin's state and - /// recalled later. This uses [`serialize_field()`] under the hood. + /// recalled later. This uses [`persist::serialize_field()`] under the hood. fn serialize_fields(&self) -> BTreeMap { BTreeMap::new() } /// Restore all fields marked with `#[persist = "stable_name"]` from a hashmap created by /// [`serialize_fields()`][Self::serialize_fields()]. All of these fields should be wrapped in a - /// [`PersistentField`] with thread safe interior mutability, like an `RwLock` or a `Mutex`. - /// This gets called when the plugin's state is being restored. This uses [deserialize_field()] - /// under the hood. + /// [`persist::PersistentField`] with thread safe interior mutability, like an `RwLock` or a + /// `Mutex`. This gets called when the plugin's state is being restored. This uses + /// [`persist::deserialize_field()`] under the hood. #[allow(unused_variables)] fn deserialize_fields(&self, serialized: &BTreeMap) {} } diff --git a/src/param/boolean.rs b/src/param/boolean.rs index bc20161d..3ab25145 100644 --- a/src/param/boolean.rs +++ b/src/param/boolean.rs @@ -40,7 +40,7 @@ pub struct BoolParam { /// If this parameter has been marked as polyphonically modulatable, then this will be a unique /// integer identifying the parameter. Because this value is determined by the plugin itself, /// the plugin can easily map - /// [`NoteEvent::PolyModulation][crate::prelude::NoteEvent::PolyModulation`] events to the + /// [`NoteEvent::PolyModulation`][crate::prelude::NoteEvent::PolyModulation] events to the /// correct parameter by pattern matching on a constant. poly_modulation_id: Option, /// Optional custom conversion function from a boolean value to a string. @@ -232,7 +232,7 @@ impl BoolParam { } /// Enable polyphonic modulation for this parameter. The ID is used to uniquely identify this - /// parameter in [`NoteEvent::PolyModulation][crate::prelude::NoteEvent::PolyModulation`] + /// parameter in [`NoteEvent::PolyModulation`][crate::prelude::NoteEvent::PolyModulation] /// events, and must thus be unique between _all_ polyphonically modulatable parameters. See the /// event's documentation on how to use polyphonic modulation. Also consider configuring the /// [`ClapPlugin::CLAP_POLY_MODULATION_CONFIG`][crate::prelude::ClapPlugin::CLAP_POLY_MODULATION_CONFIG] @@ -241,8 +241,8 @@ impl BoolParam { /// # Important /// /// After enabling polyphonic modulation, the plugin **must** start sending - /// [`NoteEvent::VoiceTerminated`][crate::prelude::NoteEvent::VoiceEnd] events to the host when - /// a voice has fully ended. This allows the host to reuse its modulation resources. + /// [`NoteEvent::VoiceTerminated`][crate::prelude::NoteEvent::VoiceTerminated] events to the + /// host when a voice has fully ended. This allows the host to reuse its modulation resources. pub fn with_poly_modulation_id(mut self, id: u32) -> Self { self.poly_modulation_id = Some(id); self diff --git a/src/param/enums.rs b/src/param/enums.rs index a9534625..ff7126ce 100644 --- a/src/param/enums.rs +++ b/src/param/enums.rs @@ -333,7 +333,7 @@ impl EnumParam { } /// Enable polyphonic modulation for this parameter. The ID is used to uniquely identify this - /// parameter in [`NoteEvent::PolyModulation][crate::prelude::NoteEvent::PolyModulation`] + /// parameter in [`NoteEvent::PolyModulation`][crate::prelude::NoteEvent::PolyModulation] /// events, and must thus be unique between _all_ polyphonically modulatable parameters. See the /// event's documentation on how to use polyphonic modulation. Also consider configuring the /// [`ClapPlugin::CLAP_POLY_MODULATION_CONFIG`][crate::prelude::ClapPlugin::CLAP_POLY_MODULATION_CONFIG] @@ -342,8 +342,8 @@ impl EnumParam { /// # Important /// /// After enabling polyphonic modulation, the plugin **must** start sending - /// [`NoteEvent::VoiceTerminated`][crate::prelude::NoteEvent::VoiceEnd] events to the host when - /// a voice has fully ended. This allows the host to reuse its modulation resources. + /// [`NoteEvent::VoiceTerminated`][crate::prelude::NoteEvent::VoiceTerminated] events to the + /// host when a voice has fully ended. This allows the host to reuse its modulation resources. pub fn with_poly_modulation_id(mut self, id: u32) -> Self { self.inner.inner = self.inner.inner.with_poly_modulation_id(id); self diff --git a/src/param/float.rs b/src/param/float.rs index 80936e05..0e75671c 100644 --- a/src/param/float.rs +++ b/src/param/float.rs @@ -59,7 +59,7 @@ pub struct FloatParam { /// If this parameter has been marked as polyphonically modulatable, then this will be a unique /// integer identifying the parameter. Because this value is determined by the plugin itself, /// the plugin can easily map - /// [`NoteEvent::PolyModulation][crate::prelude::NoteEvent::PolyModulation`] events to the + /// [`NoteEvent::PolyModulation`][crate::prelude::NoteEvent::PolyModulation] events to the /// correct parameter by pattern matching on a constant. poly_modulation_id: Option, /// Optional custom conversion function from a plain **unnormalized** value to a string. @@ -274,7 +274,7 @@ impl FloatParam { } /// Enable polyphonic modulation for this parameter. The ID is used to uniquely identify this - /// parameter in [`NoteEvent::PolyModulation][crate::prelude::NoteEvent::PolyModulation`] + /// parameter in [`NoteEvent::PolyModulation`][crate::prelude::NoteEvent::PolyModulation] /// events, and must thus be unique between _all_ polyphonically modulatable parameters. See the /// event's documentation on how to use polyphonic modulation. Also consider configuring the /// [`ClapPlugin::CLAP_POLY_MODULATION_CONFIG`][crate::prelude::ClapPlugin::CLAP_POLY_MODULATION_CONFIG] @@ -283,8 +283,8 @@ impl FloatParam { /// # Important /// /// After enabling polyphonic modulation, the plugin **must** start sending - /// [`NoteEvent::VoiceTerminated`][crate::prelude::NoteEvent::VoiceEnd] events to the host when - /// a voice has fully ended. This allows the host to reuse its modulation resources. + /// [`NoteEvent::VoiceTerminated`][crate::prelude::NoteEvent::VoiceTerminated] events to the + /// host when a voice has fully ended. This allows the host to reuse its modulation resources. pub fn with_poly_modulation_id(mut self, id: u32) -> Self { self.poly_modulation_id = Some(id); self diff --git a/src/param/integer.rs b/src/param/integer.rs index 9816a600..0062c0bf 100644 --- a/src/param/integer.rs +++ b/src/param/integer.rs @@ -55,7 +55,7 @@ pub struct IntParam { /// If this parameter has been marked as polyphonically modulatable, then this will be a unique /// integer identifying the parameter. Because this value is determined by the plugin itself, /// the plugin can easily map - /// [`NoteEvent::PolyModulation][crate::prelude::NoteEvent::PolyModulation`] events to the + /// [`NoteEvent::PolyModulation`][crate::prelude::NoteEvent::PolyModulation] events to the /// correct parameter by pattern matching on a constant. poly_modulation_id: Option, /// Optional custom conversion function from a plain **unnormalized** value to a string. @@ -253,7 +253,7 @@ impl IntParam { } /// Enable polyphonic modulation for this parameter. The ID is used to uniquely identify this - /// parameter in [`NoteEvent::PolyModulation][crate::prelude::NoteEvent::PolyModulation`] + /// parameter in [`NoteEvent::PolyModulation`][crate::prelude::NoteEvent::PolyModulation] /// events, and must thus be unique between _all_ polyphonically modulatable parameters. See the /// event's documentation on how to use polyphonic modulation. Also consider configuring the /// [`ClapPlugin::CLAP_POLY_MODULATION_CONFIG`][crate::prelude::ClapPlugin::CLAP_POLY_MODULATION_CONFIG] @@ -262,8 +262,8 @@ impl IntParam { /// # Important /// /// After enabling polyphonic modulation, the plugin **must** start sending - /// [`NoteEvent::VoiceTerminated`][crate::prelude::NoteEvent::VoiceEnd] events to the host when - /// a voice has fully ended. This allows the host to reuse its modulation resources. + /// [`NoteEvent::VoiceTerminated`][crate::prelude::NoteEvent::VoiceTerminated] events to the + /// host when a voice has fully ended. This allows the host to reuse its modulation resources. pub fn with_poly_modulation_id(mut self, id: u32) -> Self { self.poly_modulation_id = Some(id); self diff --git a/src/param/persist.rs b/src/param/persist.rs index 8e5b0dd9..6cb138e3 100644 --- a/src/param/persist.rs +++ b/src/param/persist.rs @@ -1,13 +1,13 @@ //! Traits and helpers for persistent fields. See the [`Params`][super::Params] trait for more //! information. -/// Re-export for use in the [`Params`] proc-macro. +/// Re-export for use in the [`Params`][super::Params] proc-macro. pub use serde_json::from_str as deserialize_field; -/// Re-export for use in the [`Params`] proc-macro. +/// Re-export for use in the [`Params`][super::Params] proc-macro. pub use serde_json::to_string as serialize_field; /// Handles the functionality needed for persisting a non-parameter fields in a plugin's state. -/// These types can be used with [`Params`]' `#[persist = "..."]` attributes. +/// These types can be used with [`Params`][super::Params]' `#[persist = "..."]` attributes. /// /// This should be implemented for some type with interior mutability containing a `T`. // diff --git a/src/plugin.rs b/src/plugin.rs index bf9805ed..ef3b4832 100644 --- a/src/plugin.rs +++ b/src/plugin.rs @@ -393,8 +393,8 @@ pub enum ProcessStatus { KeepAlive, } -/// The plugin's current processing mode. Can be queried through [`ProcessContext::process_mode()`]. -/// The host will reinitialize the plugin whenever this changes. +/// The plugin's current processing mode. Exposed through [`BufferConfig::process_mode`]. The host +/// will reinitialize the plugin whenever this changes. #[derive(Debug, Clone, Copy, PartialEq, Eq)] pub enum ProcessMode { /// The plugin is processing audio in real time at a fixed rate.