1
0
Fork 0

Re-export all user facing includes

This commit is contained in:
Robbert van der Helm 2022-02-02 15:12:33 +01:00
parent f44597df7c
commit c8cc6bd26b
6 changed files with 28 additions and 25 deletions

View file

@ -18,13 +18,10 @@
extern crate nih_plug;
use nih_plug::{
buffer::Buffer,
context::ProcessContext,
formatters,
param::{BoolParam, FloatParam, Param, Params, Range},
plugin::{BufferConfig, BusConfig, Plugin, ProcessStatus, Vst3Plugin},
util,
formatters, util, Buffer, BufferConfig, BusConfig, Plugin, ProcessContext, ProcessStatus,
Vst3Plugin,
};
use nih_plug::{BoolParam, FloatParam, Param, Params, Range};
use parking_lot::RwLock;
use std::pin::Pin;

View file

@ -18,13 +18,10 @@
extern crate nih_plug;
use nih_plug::{
buffer::Buffer,
context::ProcessContext,
formatters,
param::{FloatParam, Param, Params, Range},
plugin::{BufferConfig, BusConfig, Plugin, ProcessStatus, Vst3Plugin},
util,
formatters, util, Buffer, BufferConfig, BusConfig, Plugin, ProcessContext, ProcessStatus,
Vst3Plugin,
};
use nih_plug::{FloatParam, Param, Params, Range};
use std::f32::consts;
use std::pin::Pin;

View file

@ -16,15 +16,26 @@
// TODO: Once everything is more fleshed out, document the basic usage of this library
pub mod buffer;
pub mod context;
#[macro_use]
pub mod debug;
pub mod formatters;
pub mod param;
pub mod plugin;
pub mod util;
pub mod wrapper;
// Re-export our derive macros to make this a bit easier to use
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 param::internals::Params;
pub use param::range::Range;
pub use param::{BoolParam, FloatParam, IntParam, Param};
pub use plugin::{BufferConfig, BusConfig, Plugin, ProcessStatus, Vst3Plugin};
// The rest is either internal or already re-exported
mod buffer;
mod context;
pub mod param;
pub mod plugin;
pub mod wrapper;

View file

@ -19,7 +19,7 @@
use std::fmt::Display;
use std::sync::Arc;
use self::range::NormalizebleRange;
use self::range::{NormalizebleRange, Range};
pub mod internals;
pub mod range;
@ -27,9 +27,6 @@ pub mod range;
pub type FloatParam = PlainParam<f32>;
pub type IntParam = PlainParam<i32>;
pub use internals::Params;
pub use range::Range;
/// Describes a single parmaetre of any type.
pub trait Param {
/// The plain parameter type.

View file

@ -18,7 +18,7 @@ use std::pin::Pin;
use crate::buffer::Buffer;
use crate::context::ProcessContext;
use crate::param::Params;
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.

View file

@ -43,6 +43,7 @@ use widestring::U16CStr;
use crate::buffer::Buffer;
use crate::context::{EventLoop, MainThreadExecutor, OsEventLoop, ProcessContext};
use crate::param::internals::ParamPtr;
use crate::param::range::Range;
use crate::param::Param;
use crate::plugin::{BufferConfig, BusConfig, Plugin, ProcessStatus, Vst3Plugin};
use crate::wrapper::state::{ParamValue, State};
@ -637,9 +638,9 @@ impl<P: Plugin> IEditController for Wrapper<'_, P> {
info.step_count = match param_ptr {
ParamPtr::FloatParam(_) => 0,
ParamPtr::IntParam(p) => match (**p).range {
crate::param::Range::Linear { min, max } => max - min,
crate::param::Range::Skewed { min, max, .. } => max - min,
crate::param::Range::SymmetricalSkewed { min, max, .. } => max - min,
Range::Linear { min, max } => max - min,
Range::Skewed { min, max, .. } => max - min,
Range::SymmetricalSkewed { min, max, .. } => max - min,
},
ParamPtr::BoolParam(_) => 1,
};