pub struct ControlChange14BitMessageScanner { /* private fields */ }
Expand description
Scanner for detecting 14-bit Control Change messages in a stream of short MIDI messages.
§Example
use helgoboss_midi::test_util::control_change;
use helgoboss_midi::{
Channel, ControlChange14BitMessage, ControlChange14BitMessageScanner, ControllerNumber, U14,
};
let mut scanner = ControlChange14BitMessageScanner::new();
let result_1 = scanner.feed(&control_change(5, 2, 8));
let result_2 = scanner.feed(&control_change(5, 34, 33));
assert_eq!(result_1, None);
assert_eq!(
result_2,
Some(ControlChange14BitMessage::new(
Channel::new(5),
ControllerNumber::new(2),
U14::new(1057)
))
);
Implementations§
Source§impl ControlChange14BitMessageScanner
impl ControlChange14BitMessageScanner
Sourcepub fn new() -> ControlChange14BitMessageScanner
pub fn new() -> ControlChange14BitMessageScanner
Creates a new scanner.
Sourcepub fn feed(
&mut self,
msg: &impl ShortMessage,
) -> Option<ControlChange14BitMessage>
pub fn feed( &mut self, msg: &impl ShortMessage, ) -> Option<ControlChange14BitMessage>
Feeds the scanner a single short message.
Returns the 14-bit Control Change message if one has been detected.
Trait Implementations§
Source§impl Clone for ControlChange14BitMessageScanner
impl Clone for ControlChange14BitMessageScanner
Source§fn clone(&self) -> ControlChange14BitMessageScanner
fn clone(&self) -> ControlChange14BitMessageScanner
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Default for ControlChange14BitMessageScanner
impl Default for ControlChange14BitMessageScanner
Source§fn default() -> ControlChange14BitMessageScanner
fn default() -> ControlChange14BitMessageScanner
Returns the “default value” for a type. Read more
Source§impl PartialEq for ControlChange14BitMessageScanner
impl PartialEq for ControlChange14BitMessageScanner
Source§fn eq(&self, other: &ControlChange14BitMessageScanner) -> bool
fn eq(&self, other: &ControlChange14BitMessageScanner) -> bool
Tests for
self
and other
values to be equal, and is used by ==
.impl Copy for ControlChange14BitMessageScanner
impl Eq for ControlChange14BitMessageScanner
impl StructuralPartialEq for ControlChange14BitMessageScanner
Auto Trait Implementations§
impl Freeze for ControlChange14BitMessageScanner
impl RefUnwindSafe for ControlChange14BitMessageScanner
impl Send for ControlChange14BitMessageScanner
impl Sync for ControlChange14BitMessageScanner
impl Unpin for ControlChange14BitMessageScanner
impl UnwindSafe for ControlChange14BitMessageScanner
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