diff --git a/examples/dimension_expander.rs b/examples/dimension_expander.rs index 6ea53476..0fbe008a 100644 --- a/examples/dimension_expander.rs +++ b/examples/dimension_expander.rs @@ -3,14 +3,11 @@ #[macro_use] extern crate vst; -use vst::buffer::AudioBuffer; -use vst::plugin::{Category, HostCallback, Info, Plugin, PluginParameters}; -use vst::util::AtomicFloat; - use std::collections::VecDeque; use std::f64::consts::PI; use std::sync::Arc; use std::time::{SystemTime, UNIX_EPOCH}; +use vst::prelude::*; /// Calculate the length in samples for a delay. Size ranges from 0.0 to 1.0. fn delay(index: usize, mut size: f32) -> isize { diff --git a/examples/fwd_midi.rs b/examples/fwd_midi.rs index a9f5560d..c5818fbc 100644 --- a/examples/fwd_midi.rs +++ b/examples/fwd_midi.rs @@ -2,8 +2,7 @@ extern crate vst; use vst::api; -use vst::buffer::{AudioBuffer, SendEventBuffer}; -use vst::plugin::{CanDo, HostCallback, Info, Plugin}; +use vst::prelude::*; plugin_main!(MyPlugin); // Important! diff --git a/examples/gain_effect.rs b/examples/gain_effect.rs index d82cba4d..cbe06bd7 100644 --- a/examples/gain_effect.rs +++ b/examples/gain_effect.rs @@ -3,12 +3,10 @@ #[macro_use] extern crate vst; -use vst::buffer::AudioBuffer; -use vst::plugin::{Category, HostCallback, Info, Plugin, PluginParameters}; -use vst::util::AtomicFloat; - use std::sync::Arc; +use vst::prelude::*; + /// Simple Gain Effect. /// Note that this does not use a proper scale for sound and shouldn't be used in /// a production amplification effect! This is purely for demonstration purposes, diff --git a/examples/ladder_filter.rs b/examples/ladder_filter.rs index 06b4b8e6..0c6dac81 100644 --- a/examples/ladder_filter.rs +++ b/examples/ladder_filter.rs @@ -16,9 +16,7 @@ use std::f32::consts::PI; use std::sync::atomic::{AtomicUsize, Ordering}; use std::sync::Arc; -use vst::buffer::AudioBuffer; -use vst::plugin::{Category, HostCallback, Info, Plugin, PluginParameters}; -use vst::util::AtomicFloat; +use vst::prelude::*; // this is a 4-pole filter with resonance, which is why there's 4 states and vouts #[derive(Clone)] diff --git a/examples/sine_synth.rs b/examples/sine_synth.rs index e9173762..81a0475a 100644 --- a/examples/sine_synth.rs +++ b/examples/sine_synth.rs @@ -3,10 +3,7 @@ #[macro_use] extern crate vst; -use vst::api::{Events, Supported}; -use vst::buffer::AudioBuffer; -use vst::event::Event; -use vst::plugin::{CanDo, Category, HostCallback, Info, Plugin}; +use vst::prelude::*; use std::f64::consts::PI; diff --git a/examples/transfer_and_smooth.rs b/examples/transfer_and_smooth.rs index 5bdc1106..ba50b121 100644 --- a/examples/transfer_and_smooth.rs +++ b/examples/transfer_and_smooth.rs @@ -10,9 +10,7 @@ extern crate vst; use std::f32; use std::sync::Arc; -use vst::buffer::AudioBuffer; -use vst::plugin::{Category, HostCallback, Info, Plugin, PluginParameters}; -use vst::util::ParameterTransfer; +use vst::prelude::*; const PARAMETER_COUNT: usize = 100; const BASE_FREQUENCY: f32 = 5.0; diff --git a/src/lib.rs b/src/lib.rs index 8cb6a8f3..7f311874 100755 --- a/src/lib.rs +++ b/src/lib.rs @@ -128,7 +128,7 @@ pub mod event; pub mod host; mod interfaces; pub mod plugin; - +pub mod prelude; pub mod util; use api::consts::VST_MAGIC; diff --git a/src/prelude.rs b/src/prelude.rs new file mode 100644 index 00000000..3e76ff88 --- /dev/null +++ b/src/prelude.rs @@ -0,0 +1,12 @@ +//! A collection of commonly used items for implement a Plugin + +#[doc(no_inline)] +pub use api::{Events, Supported}; +#[doc(no_inline)] +pub use buffer::{AudioBuffer, SendEventBuffer}; +#[doc(no_inline)] +pub use event::{Event, MidiEvent}; +#[doc(no_inline)] +pub use plugin::{CanDo, Category, HostCallback, Info, Plugin, PluginParameters}; +#[doc(no_inline)] +pub use util::{AtomicFloat, ParameterTransfer};