pub struct AudioMidiShell {
pub midi_connections: Vec<MidiInputConnection<Sender<(u64, Vec<u8>)>>>,
pub output_device: OutputDevice,
}Expand description
Shell running the audio and MIDI processing.
Fields§
§midi_connections: Vec<MidiInputConnection<Sender<(u64, Vec<u8>)>>>MIDI connections.
output_device: OutputDeviceOutput device:
Implementations§
Source§impl AudioMidiShell
impl AudioMidiShell
Sourcepub fn spawn(
sample_rate: u32,
buffer_size: usize,
process_chunk_size: usize,
generator: impl AudioGenerator + Send + 'static,
) -> Self
pub fn spawn( sample_rate: u32, buffer_size: usize, process_chunk_size: usize, generator: impl AudioGenerator + Send + 'static, ) -> Self
Initializes the MIDI inputs, the output device and runs the generator in a callback. It returns a shell object that must be kept alive.
sample_rateis the sampling frequency in Hz.buffer_sizeis the number of frames used by the system buffer. This setting determines the latency.process_chunk_sizeis the number of frames passed to theprocessfunction.
Sourcepub fn run_forever(
sample_rate: u32,
buffer_size: usize,
process_chunk_size: usize,
generator: impl AudioGenerator + Send + 'static,
) -> !
pub fn run_forever( sample_rate: u32, buffer_size: usize, process_chunk_size: usize, generator: impl AudioGenerator + Send + 'static, ) -> !
Spawns the shell and keeps it alive forever.
sample_rateis the sampling frequency in Hz.buffer_sizeis the number of samples used by the system buffer. This setting determines the latency.process_chunk_sizeis the number of samples passed to theprocessfunction.
Auto Trait Implementations§
impl Freeze for AudioMidiShell
impl !RefUnwindSafe for AudioMidiShell
impl Send for AudioMidiShell
impl !Sync for AudioMidiShell
impl Unpin for AudioMidiShell
impl !UnwindSafe for AudioMidiShell
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more