diff --git a/src/context.rs b/src/context.rs index cf3e9f15..55e52e25 100644 --- a/src/context.rs +++ b/src/context.rs @@ -65,21 +65,22 @@ pub trait ProcessContext { // the actual callback within [MainThreadQueue::do_maybe_async]. pub trait GuiContext { /// Inform the host that you will start automating a parmater. This needs to be called before - /// calling [set_parameter] for the specified parameter. + /// calling [Self::set_parameter()] for the specified parameter. fn begin_set_parameter(&self, param: &P); /// Set a parameter to the specified parameter value. You will need to call - /// [begin_set_parameter] before and [end_set_parameter] after calling this so the host can - /// properly record automation for the parameter. This can be called multiple times in a row - /// before calling [end_set_parameter], for instance when moving a slider around. + /// [Self::begin_set_parameter()] before and [Self::end_set_parameter()] after calling this so + /// the host can properly record automation for the parameter. This can be called multiple times + /// in a row before calling [Self::end_set_parameter()], for instance when moving a slider + /// around. /// /// This function assumes you're already calling this from a GUI thread. Calling any of these /// functions from any other thread may result in unexpected behavior. fn set_parameter(&self, param: &P, value: P::Plain); /// Inform the host that you are done automating a parameter. This needs to be called after one - /// or more [set_parameter] calls for a parameter so the host knows the automation gesture has - /// finished. + /// or more [Self::set_parameter()] calls for a parameter so the host knows the automation + /// gesture has finished. fn end_set_parameter(&self, param: &P); } diff --git a/src/lib.rs b/src/lib.rs index d32c254d..95cd2431 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -27,7 +27,7 @@ pub use nih_plug_derive::Params; // And also re-export anything you'd need to build a plugin pub use buffer::Buffer; -pub use context::ProcessContext; +pub use context::{GuiContext, ProcessContext}; pub use param::internals::Params; pub use param::range::Range; pub use param::smoothing::{Smoother, SmoothingStyle}; diff --git a/src/param.rs b/src/param.rs index 2cf9b0bb..7d749a8e 100644 --- a/src/param.rs +++ b/src/param.rs @@ -72,7 +72,8 @@ pub trait Param { /// Get the string representation for a normalized value. Used as part of the wrappers. fn string_to_normalized_value(&self, string: &str) -> Option; - /// Internal implementation detail for implementing [Params]. This should not be used directly. + /// Internal implementation detail for implementing [internals::Params]. This should not be used + /// directly. fn as_ptr(&self) -> internals::ParamPtr; } diff --git a/src/param/internals.rs b/src/param/internals.rs index 2f18e161..837a9b65 100644 --- a/src/param/internals.rs +++ b/src/param/internals.rs @@ -27,11 +27,11 @@ pub use serde_json::from_str as deserialize_field; pub use serde_json::to_string as serialize_field; /// Describes a struct containing parameters and other persistent fields. The idea is that we can -/// have a normal struct containing [FloatParam] and other parameter types with attributes assigning -/// a unique identifier to each parameter. We can then build a mapping from those parameter IDs to -/// the parameters using the [Params::param_map] function. That way we can have easy to work with -/// JUCE-style parameter objects in the plugin without needing to manually register each parameter, -/// like you would in JUCE. +/// have a normal struct containing [super::FloatParam] and other parameter types with attributes +/// assigning a unique identifier to each parameter. We can then build a mapping from those +/// parameter IDs to the parameters using the [Params::param_map] function. That way we can have +/// easy to work with JUCE-style parameter objects in the plugin without needing to manually +/// register each parameter, like you would in JUCE. /// /// The other persistent parameters should be [PersistentField]s containing types that can be /// serialized and deserialized with Serde. diff --git a/src/param/smoothing.rs b/src/param/smoothing.rs index 860b646e..e35c7b5d 100644 --- a/src/param/smoothing.rs +++ b/src/param/smoothing.rs @@ -72,7 +72,7 @@ impl Smoother { Default::default() } - /// Whether calling [next] will yield a new value or an old value. Useful if you need to + /// Whether calling [Self::next] will yield a new value or an old value. Useful if you need to /// recompute something wheenver this parameter changes. pub fn is_smoothing(&self) -> bool { self.steps_left > 0 diff --git a/src/plugin.rs b/src/plugin.rs index f7efdc4f..c7d24585 100644 --- a/src/plugin.rs +++ b/src/plugin.rs @@ -41,8 +41,8 @@ use crate::param::internals::Params; /// - GUIs pub trait Plugin: Default + Send + Sync { /// The type of the GUI editor instance belonging to this plugin. Use [NoEditor] when you don't - /// need an editor. Make sure to implement both the [create_editor] and [editor_size] functions - /// when you do add an editor. + /// need an editor. Make sure to implement both the [Self::create_editor()] and + /// [Self::editor_size()] functions when you do add an editor. type Editor: Editor; const NAME: &'static str;