Struct portmidi::InputPort
[−]
[src]
pub struct InputPort { // some fields omitted }
Representation of an input midi port
Methods
impl InputPort
[src]
fn new(input_device: PortMidiDeviceId, buffer_size: i32) -> InputPort
Construct a new InputPort
for input_device
fn open(&mut self) -> PortMidiResult<()>
Open the port returning an error if there is a problem
fn read(&mut self) -> PortMidiResult<Option<MidiEvent>>
Reads a single MidiEvent
if one is avaible
A Result
of None
means no event was available.
See the PortMidi documentation for information on how it deals with input overflows
fn poll(&self) -> PortMidiResult<bool>
poll
tests if there is input available, either returing a bool or an error
fn close(&mut self) -> PortMidiResult<()>
Closes the input, flushing any pending buffers
PortMidi attempts to close open streams when the application exits, but this can be difficult under Windows (according to the PortMidi documentation).