2022-06-15 01:30:57 +10:00
|
|
|
pub use self::dummy::Dummy;
|
|
|
|
pub use self::jack::Jack;
|
|
|
|
pub use crate::buffer::Buffer;
|
2022-06-15 06:48:36 +10:00
|
|
|
use crate::midi::NoteEvent;
|
2022-04-23 04:41:21 +10:00
|
|
|
|
2022-06-15 01:30:57 +10:00
|
|
|
mod dummy;
|
|
|
|
mod jack;
|
2022-04-23 04:41:21 +10:00
|
|
|
|
|
|
|
/// An audio+MIDI backend for the standalone wrapper.
|
|
|
|
pub trait Backend: 'static + Send + Sync {
|
|
|
|
/// Start processing audio and MIDI on this thread. The process callback will be called whenever
|
|
|
|
/// there's a new block of audio to be processed. The process callback receives the audio
|
|
|
|
/// buffers for the wrapped plugin's outputs. Any inputs will have already been copied to this
|
|
|
|
/// buffer. This will block until the process callback returns `false`.
|
|
|
|
///
|
2022-06-15 01:49:45 +10:00
|
|
|
/// TODO: Auxiliary inputs and outputs
|
2022-06-15 06:48:36 +10:00
|
|
|
fn run(
|
|
|
|
&mut self,
|
|
|
|
cb: impl FnMut(&mut Buffer, &[NoteEvent], &mut Vec<NoteEvent>) -> bool + 'static + Send,
|
|
|
|
);
|
2022-04-23 04:41:21 +10:00
|
|
|
}
|