Re-export all user facing includes
This commit is contained in:
parent
f44597df7c
commit
c8cc6bd26b
|
@ -18,13 +18,10 @@
|
||||||
extern crate nih_plug;
|
extern crate nih_plug;
|
||||||
|
|
||||||
use nih_plug::{
|
use nih_plug::{
|
||||||
buffer::Buffer,
|
formatters, util, Buffer, BufferConfig, BusConfig, Plugin, ProcessContext, ProcessStatus,
|
||||||
context::ProcessContext,
|
Vst3Plugin,
|
||||||
formatters,
|
|
||||||
param::{BoolParam, FloatParam, Param, Params, Range},
|
|
||||||
plugin::{BufferConfig, BusConfig, Plugin, ProcessStatus, Vst3Plugin},
|
|
||||||
util,
|
|
||||||
};
|
};
|
||||||
|
use nih_plug::{BoolParam, FloatParam, Param, Params, Range};
|
||||||
use parking_lot::RwLock;
|
use parking_lot::RwLock;
|
||||||
use std::pin::Pin;
|
use std::pin::Pin;
|
||||||
|
|
||||||
|
|
|
@ -18,13 +18,10 @@
|
||||||
extern crate nih_plug;
|
extern crate nih_plug;
|
||||||
|
|
||||||
use nih_plug::{
|
use nih_plug::{
|
||||||
buffer::Buffer,
|
formatters, util, Buffer, BufferConfig, BusConfig, Plugin, ProcessContext, ProcessStatus,
|
||||||
context::ProcessContext,
|
Vst3Plugin,
|
||||||
formatters,
|
|
||||||
param::{FloatParam, Param, Params, Range},
|
|
||||||
plugin::{BufferConfig, BusConfig, Plugin, ProcessStatus, Vst3Plugin},
|
|
||||||
util,
|
|
||||||
};
|
};
|
||||||
|
use nih_plug::{FloatParam, Param, Params, Range};
|
||||||
use std::f32::consts;
|
use std::f32::consts;
|
||||||
use std::pin::Pin;
|
use std::pin::Pin;
|
||||||
|
|
||||||
|
|
21
src/lib.rs
21
src/lib.rs
|
@ -16,15 +16,26 @@
|
||||||
|
|
||||||
// TODO: Once everything is more fleshed out, document the basic usage of this library
|
// TODO: Once everything is more fleshed out, document the basic usage of this library
|
||||||
|
|
||||||
pub mod buffer;
|
|
||||||
pub mod context;
|
|
||||||
#[macro_use]
|
#[macro_use]
|
||||||
pub mod debug;
|
pub mod debug;
|
||||||
|
|
||||||
pub mod formatters;
|
pub mod formatters;
|
||||||
pub mod param;
|
|
||||||
pub mod plugin;
|
|
||||||
pub mod util;
|
pub mod util;
|
||||||
pub mod wrapper;
|
|
||||||
|
|
||||||
// Re-export our derive macros to make this a bit easier to use
|
// Re-export our derive macros to make this a bit easier to use
|
||||||
pub use nih_plug_derive::Params;
|
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;
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
use std::fmt::Display;
|
use std::fmt::Display;
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
|
|
||||||
use self::range::NormalizebleRange;
|
use self::range::{NormalizebleRange, Range};
|
||||||
|
|
||||||
pub mod internals;
|
pub mod internals;
|
||||||
pub mod range;
|
pub mod range;
|
||||||
|
@ -27,9 +27,6 @@ pub mod range;
|
||||||
pub type FloatParam = PlainParam<f32>;
|
pub type FloatParam = PlainParam<f32>;
|
||||||
pub type IntParam = PlainParam<i32>;
|
pub type IntParam = PlainParam<i32>;
|
||||||
|
|
||||||
pub use internals::Params;
|
|
||||||
pub use range::Range;
|
|
||||||
|
|
||||||
/// Describes a single parmaetre of any type.
|
/// Describes a single parmaetre of any type.
|
||||||
pub trait Param {
|
pub trait Param {
|
||||||
/// The plain parameter type.
|
/// The plain parameter type.
|
||||||
|
|
|
@ -18,7 +18,7 @@ use std::pin::Pin;
|
||||||
|
|
||||||
use crate::buffer::Buffer;
|
use crate::buffer::Buffer;
|
||||||
use crate::context::ProcessContext;
|
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
|
/// Basic functionality that needs to be implemented by a plugin. The wrappers will use this to
|
||||||
/// expose the plugin in a particular plugin format.
|
/// expose the plugin in a particular plugin format.
|
||||||
|
|
|
@ -43,6 +43,7 @@ use widestring::U16CStr;
|
||||||
use crate::buffer::Buffer;
|
use crate::buffer::Buffer;
|
||||||
use crate::context::{EventLoop, MainThreadExecutor, OsEventLoop, ProcessContext};
|
use crate::context::{EventLoop, MainThreadExecutor, OsEventLoop, ProcessContext};
|
||||||
use crate::param::internals::ParamPtr;
|
use crate::param::internals::ParamPtr;
|
||||||
|
use crate::param::range::Range;
|
||||||
use crate::param::Param;
|
use crate::param::Param;
|
||||||
use crate::plugin::{BufferConfig, BusConfig, Plugin, ProcessStatus, Vst3Plugin};
|
use crate::plugin::{BufferConfig, BusConfig, Plugin, ProcessStatus, Vst3Plugin};
|
||||||
use crate::wrapper::state::{ParamValue, State};
|
use crate::wrapper::state::{ParamValue, State};
|
||||||
|
@ -637,9 +638,9 @@ impl<P: Plugin> IEditController for Wrapper<'_, P> {
|
||||||
info.step_count = match param_ptr {
|
info.step_count = match param_ptr {
|
||||||
ParamPtr::FloatParam(_) => 0,
|
ParamPtr::FloatParam(_) => 0,
|
||||||
ParamPtr::IntParam(p) => match (**p).range {
|
ParamPtr::IntParam(p) => match (**p).range {
|
||||||
crate::param::Range::Linear { min, max } => max - min,
|
Range::Linear { min, max } => max - min,
|
||||||
crate::param::Range::Skewed { min, max, .. } => max - min,
|
Range::Skewed { min, max, .. } => max - min,
|
||||||
crate::param::Range::SymmetricalSkewed { min, max, .. } => max - min,
|
Range::SymmetricalSkewed { min, max, .. } => max - min,
|
||||||
},
|
},
|
||||||
ParamPtr::BoolParam(_) => 1,
|
ParamPtr::BoolParam(_) => 1,
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue