Struct rmididings::proc::PortsFilter[][src]

pub struct PortsFilter(pub &'static [usize]);
Expand description

Filter on multiple port numbers

When calling [RMididings.config()] the in_ports and out_ports are arrays that indicate which MIDI ports to create. The index in these arrays are the port number (starting with index 0).

Examples

let filter = PortsFilter(&[1,2]);

let ev1 = NoteOnEvent(0,0,60,20);
let ev2 = NoteOnEvent(1,0,60,20);
let ev3 = NoteOnEvent(2,0,60,20);
let ev4 = NoteOnEvent(4,0,60,20);

let mut evs = EventStream::from(vec![&ev1, &ev2, &ev3, &ev4]);
filter.run(&mut evs);
assert_eq!(evs, vec![ev2, ev3]);

Trait Implementations

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

Performs the conversion.

Performs the conversion.

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.