1
0
Fork 0

Fix doc links after prelude migration

This commit is contained in:
Robbert van der Helm 2022-03-03 23:30:29 +01:00
parent 4c0b07c578
commit 80457ac0f9
8 changed files with 31 additions and 26 deletions

View file

@ -33,8 +33,8 @@ pub struct SamplesIter<'slice, 'sample: 'slice> {
}
/// Can construct iterators over actual iterator over the channel data for a sample, yielded by
/// [`Samples`]. Can be turned into an iterator, or [`Channels::iter_mut()`] can be used to iterate
/// over the channel data multiple times, or more efficiently you can use
/// [`SamplesIter`]. Can be turned into an iterator, or [`Channels::iter_mut()`] can be used to
/// iterate over the channel data multiple times, or more efficiently you can use
/// [`Channels::get_unchecked_mut()`] to do the same thing.
pub struct Channels<'slice, 'sample: 'slice> {
/// The raw output buffers.
@ -262,10 +262,10 @@ impl<'a> Buffer<'a> {
/// SIMD.
///
/// The parameter smoothers can also produce smoothed values for an entire block using
/// [`Smoother::next_block()`][crate::Smoother::next_block()]. Before using this, you will need
/// to call
/// [`Plugin::initialize_block_smoothers()`][crate::Plugin::initialize_block_smoothers()] with
/// the same `max_block_size` in your initialization function first.
/// [`Smoother::next_block()`][crate::prelude::Smoother::next_block()]. Before using this, you
/// will need to call
/// [`Plugin::initialize_block_smoothers()`][crate::prelude::Plugin::initialize_block_smoothers()]
/// with the same `max_block_size` in your initialization function first.
///
/// You can use this to obtain block-slices from a buffer so you can pass them to a library:
///

View file

@ -33,7 +33,7 @@ pub trait ProcessContext {
}
/// Callbacks the plugin can make when the user interacts with its GUI such as updating parameter
/// values. This is passed to the plugin during [`Editor::spawn()`][crate::Editor::spawn()]. All of
/// values. This is passed to the plugin during [`Editor::spawn()`][crate::prelude::Editor::spawn()]. All of
/// these functions assume they're being called from the main GUI thread.
//
// # Safety

View file

@ -1,9 +1,12 @@
//! Documentation is currently a work in progress. Import everything from the [`prelude`] module and
//! check out the example plugins to get started.
#![cfg_attr(feature = "simd", feature(portable_simd))]
#[macro_use]
pub mod debug;
/// Everything you'd need to use NIH-plug. Import this with `use nih_plug::prelude::*;`.
/// Everything you'll need to use NIH-plug. Import this with `use nih_plug::prelude::*;`.
pub mod prelude;
// These modules have also been re-exported in the prelude.

View file

@ -79,7 +79,7 @@ pub trait Param: Display {
fn update_smoother(&mut self, sample_rate: f32, reset: bool);
/// Allocate memory for block-based smoothing. The
/// [`Plugin::initialize_block_smoothers()`][crate::Plugin::initialize_block_smoothers()] method
/// [`Plugin::initialize_block_smoothers()`][crate::prelude::Plugin::initialize_block_smoothers()] method
/// will do this for every smoother.
fn initialize_block_smoother(&mut self, max_block_size: usize);

View file

@ -1,3 +1,5 @@
//! Utilities to handle smoothing parameter changes over time.
use atomic_float::AtomicF32;
use atomic_refcell::{AtomicRefCell, AtomicRefMut};
use std::sync::atomic::{AtomicI32, Ordering};
@ -42,7 +44,7 @@ pub struct Smoother<T> {
target: T,
/// A dense buffer containing smoothed values for an entire block of audio. Useful when using
/// [`Buffer::iter_blocks()`][crate::Buffer::iter_blocks()] to process small blocks of audio
/// [`Buffer::iter_blocks()`][crate::prelude::Buffer::iter_blocks()] to process small blocks of audio
/// multiple times.
block_values: AtomicRefCell<Vec<T>>,
}
@ -82,8 +84,8 @@ impl<T: Default> Smoother<T> {
}
/// Allocate memory to store smoothed values for an entire block of audio. Call this in
/// [`Plugin::initialize()`][crate::Plugin::initialize()] with the same max block size you are
/// going to pass to [`Buffer::iter_blocks()`][crate::Buffer::iter_blocks()].
/// [`Plugin::initialize()`][crate::prelude::Plugin::initialize()] with the same max block size you are
/// going to pass to [`Buffer::iter_blocks()`][crate::prelude::Buffer::iter_blocks()].
pub fn initialize_block_smoother(&mut self, max_block_size: usize) {
self.block_values
.borrow_mut()
@ -136,10 +138,10 @@ impl Smoother<f32> {
}
/// Produce smoothed values for an entire block of audio. Used in conjunction with
/// [`Buffer::iter_blocks()`][crate::Buffer::iter_blocks()]. Make sure to call
/// [`Plugin::initialize_block_smoothers()`][crate::Plugin::initialize_block_smoothers()] with
/// [`Buffer::iter_blocks()`][crate::prelude::Buffer::iter_blocks()]. Make sure to call
/// [`Plugin::initialize_block_smoothers()`][crate::prelude::Plugin::initialize_block_smoothers()] with
/// the same maximum buffer block size as the one passed to `iter_blocks()` in your
/// [`Plugin::initialize()`][crate::Plugin::initialize()] function first to allocate memory for
/// [`Plugin::initialize()`][crate::prelude::Plugin::initialize()] function first to allocate memory for
/// the block smoothing.
///
/// Returns a `None` value if the block length exceed's the allocated capacity.
@ -238,10 +240,10 @@ impl Smoother<i32> {
}
/// Produce smoothed values for an entire block of audio. Used in conjunction with
/// [`Buffer::iter_blocks()`][crate::Buffer::iter_blocks()]. Make sure to call
/// [`Plugin::initialize_block_smoothers()`][crate::Plugin::initialize_block_smoothers()] with
/// [`Buffer::iter_blocks()`][crate::prelude::Buffer::iter_blocks()]. Make sure to call
/// [`Plugin::initialize_block_smoothers()`][crate::prelude::Plugin::initialize_block_smoothers()] with
/// the same maximum buffer block size as the one passed to `iter_blocks()` in your
/// [`Plugin::initialize()`][crate::Plugin::initialize()] function first to allocate memory for
/// [`Plugin::initialize()`][crate::prelude::Plugin::initialize()] function first to allocate memory for
/// the block smoothing.
///
/// Returns a `None` value if the block length exceed's the allocated capacity.

View file

@ -57,7 +57,7 @@ pub trait Plugin: Default + Send + Sync + 'static {
/// [`Editor::spawn()`]. A plugin editor likely wants to interact with the plugin's parameters
/// and other shared data, so you'll need to move [`Arc`] pointing to any data you want to
/// access into the editor. You can later modify the parameters through the
/// [`GuiContext`][crate::GuiContext] and [`ParamSetter`][crate::ParamSetter] after the editor
/// [`GuiContext`][crate::prelude::GuiContext] and [`ParamSetter`][crate::prelude::ParamSetter] after the editor
/// GUI has been created.
fn editor(&self) -> Option<Box<dyn Editor>> {
None
@ -102,9 +102,9 @@ pub trait Plugin: Default + Send + Sync + 'static {
/// either per-sample per-channel, or per-block per-channel per-sample. The first approach is
/// preferred for plugins that don't require block-based processing because of their use of
/// per-sample SIMD or excessive branching. The parameter smoothers can also work in both modes:
/// use [`Smoother::next()`][crate::Smoother::next()] for per-sample processing, and
/// [`Smoother::next_block()`][crate::Smoother::next_block()] for block-based processing. In
/// order to use block-based smoothing, you will need to call
/// use [`Smoother::next()`][crate::prelude::Smoother::next()] for per-sample processing, and
/// [`Smoother::next_block()`][crate::prelude::Smoother::next_block()] for block-based
/// processing. In order to use block-based smoothing, you will need to call
/// [`initialize_block_smoothers()`][Self::initialize_block_smoothers()] in your
/// [`initialize()`][Self::initialize()] function first to reserve enough capacity in the
/// smoothers.
@ -119,7 +119,7 @@ pub trait Plugin: Default + Send + Sync + 'static {
/// memory, this should be called in [`initialize()`][Self::initialize()]. If you are going to
/// use [`Buffer::iter_blocks()`] and want to use parameter smoothing in those blocks, then call
/// this function with the same maximum block size first before calling
/// [`Smoother::next_block()`][crate::Smoother::next_block()].
/// [`Smoother::next_block()`][crate::prelude::Smoother::next_block()].
fn initialize_block_smoothers(&mut self, max_block_size: usize) {
for param in self.params().param_map().values_mut() {
unsafe { param.initialize_block_smoother(max_block_size) };
@ -193,7 +193,7 @@ pub trait Editor: Send + Sync {
/// Create an instance of the plugin's editor and embed it in the parent window. As explained in
/// [`Plugin::editor()`], you can then read the parameter values directly from your [`Params`]
/// object, and modifying the values can be done using the functions on the
/// [`ParamSetter`][crate::ParamSetter]. When you change a parameter value that way it will be
/// [`ParamSetter`][crate::prelude::ParamSetter]. When you change a parameter value that way it will be
/// broadcasted to the host and also updated in your [`Params`] struct.
///
/// This function should return a handle to the editor, which will be dropped when the editor

View file

@ -10,7 +10,7 @@ use crate::param::internals::ParamPtr;
use crate::plugin::{ClapPlugin, NoteEvent};
/// A [`GuiContext`] implementation for the wrapper. This is passed to the plugin in
/// [`Editor::spawn()`][crate::Editor::spawn()] so it can interact with the rest of the plugin and
/// [`Editor::spawn()`][crate::prelude::Editor::spawn()] so it can interact with the rest of the plugin and
/// with the host for things like setting parameters.
pub(crate) struct WrapperGuiContext<P: ClapPlugin> {
pub(super) wrapper: Arc<Wrapper<P>>,

View file

@ -11,7 +11,7 @@ use crate::param::internals::ParamPtr;
use crate::plugin::{NoteEvent, Vst3Plugin};
/// A [`GuiContext`] implementation for the wrapper. This is passed to the plugin in
/// [`Editor::spawn()`][crate::Editor::spawn()] so it can interact with the rest of the plugin and
/// [`Editor::spawn()`][crate::prelude::Editor::spawn()] so it can interact with the rest of the plugin and
/// with the host for things like setting parameters.
pub(crate) struct WrapperGuiContext<P: Vst3Plugin> {
pub(super) inner: Arc<WrapperInner<P>>,