pub struct JackMidiEvent { /* private fields */ }Expand description
Short MIDI event delivered by JACK for a process block.
Implementations§
Source§impl JackMidiEvent
impl JackMidiEvent
Sourcepub fn short(offset: u32, bytes: &[u8]) -> Result<Self>
pub fn short(offset: u32, bytes: &[u8]) -> Result<Self>
Builds a short MIDI event delivered at sample offset within the block.
bytes carries one to three status/data bytes; shorter messages are
zero-padded to the fixed three-byte buffer.
§Errors
Returns an error when bytes is empty or longer than three bytes.
§Examples
use sim_lib_stream_jack::JackMidiEvent;
let note_on = JackMidiEvent::short(64, &[0x90, 60, 100]).unwrap();
assert_eq!(note_on.offset(), 64);
assert_eq!(note_on.byte_len(), 3);
assert_eq!(note_on.bytes(), [0x90, 60, 100]);
let too_long = JackMidiEvent::short(0, &[0, 1, 2, 3]);
assert!(too_long.is_err());Trait Implementations§
Source§impl Clone for JackMidiEvent
impl Clone for JackMidiEvent
Source§fn clone(&self) -> JackMidiEvent
fn clone(&self) -> JackMidiEvent
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for JackMidiEvent
Source§impl Debug for JackMidiEvent
impl Debug for JackMidiEvent
impl Eq for JackMidiEvent
Source§impl PartialEq for JackMidiEvent
impl PartialEq for JackMidiEvent
Source§fn eq(&self, other: &JackMidiEvent) -> bool
fn eq(&self, other: &JackMidiEvent) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for JackMidiEvent
Auto Trait Implementations§
impl Freeze for JackMidiEvent
impl RefUnwindSafe for JackMidiEvent
impl Send for JackMidiEvent
impl Sync for JackMidiEvent
impl Unpin for JackMidiEvent
impl UnsafeUnpin for JackMidiEvent
impl UnwindSafe for JackMidiEvent
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