pub struct ControlChange {
pub channel: u8,
pub controller: u8,
pub value: u8,
}Expand description
A MIDI 1.0 Control Change message.
Fields§
§channel: u8MIDI channel, 0..=15.
controller: u8Controller number, 0..=127.
value: u8Controller value, 0..=127.
Implementations§
Source§impl ControlChange
impl ControlChange
Sourcepub fn new(channel: u8, controller: u8, value: u8) -> Result<Self, AudioError>
pub fn new(channel: u8, controller: u8, value: u8) -> Result<Self, AudioError>
Construct a validated Control Change.
Sourcepub fn parse(bytes: &[u8]) -> Result<Self, AudioError>
pub fn parse(bytes: &[u8]) -> Result<Self, AudioError>
Parse from a slice whose first byte is a Control Change status.
Sourcepub fn is_channel_mode(self) -> bool
pub fn is_channel_mode(self) -> bool
True if the controller number is in the channel-mode range (120..=127).
Trait Implementations§
Source§impl Clone for ControlChange
impl Clone for ControlChange
impl Copy for ControlChange
Source§impl Debug for ControlChange
impl Debug for ControlChange
impl Eq for ControlChange
Source§impl PartialEq for ControlChange
impl PartialEq for ControlChange
impl StructuralPartialEq for ControlChange
Auto Trait Implementations§
impl Freeze for ControlChange
impl RefUnwindSafe for ControlChange
impl Send for ControlChange
impl Sync for ControlChange
impl Unpin for ControlChange
impl UnsafeUnpin for ControlChange
impl UnwindSafe for ControlChange
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