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

Creates a new scanner.

Feeds the scanner a single short message.

Returns the 14-bit Control Change message if one has been detected.

Resets the scanner discarding all intermediate scanning progress.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.