💥 Move re-exports to a prelude module

So you can import everything at once, because you're likely going to
need at least 90% of it anyways.
This commit is contained in:
Robbert van der Helm
2022-03-03 23:23:51 +01:00
parent f581294d7b
commit 4c0b07c578
14 changed files with 43 additions and 58 deletions

View File

@@ -1,11 +1,7 @@
#[macro_use]
extern crate nih_plug;
use nih_plug::{
formatters, util, Buffer, BufferConfig, BusConfig, ClapPlugin, Plugin, ProcessContext,
ProcessStatus, Vst3Plugin,
};
use nih_plug::{BoolParam, FloatParam, FloatRange, Params, Smoother, SmoothingStyle};
use nih_plug::prelude::*;
use std::f32::consts;
use std::pin::Pin;
@@ -144,11 +140,11 @@ impl Plugin for Sine {
'midi_events: loop {
match next_event {
Some(event) if event.timing() == sample_id as u32 => match event {
nih_plug::NoteEvent::NoteOn { note, .. } => {
NoteEvent::NoteOn { note, .. } => {
self.midi_note_freq = util::midi_note_to_freq(note);
self.midi_note_gain.set_target(self.sample_rate, 1.0);
}
nih_plug::NoteEvent::NoteOff { note, .. } => {
NoteEvent::NoteOff { note, .. } => {
if self.midi_note_freq == util::midi_note_to_freq(note) {
self.midi_note_gain.set_target(self.sample_rate, 0.0);
}