class

InputStream

Inherits PMStream < Reference < Object

An input MIDI stream.

Constructors

open(input_device_num : Int32, input_driver_info : Pointer(Void) | Nil = nil, buffer_size : Int32 = 1024, time_proc : Pointer(Void) -> LibPortMIDI::PmTimestamp | Nil = nil, time_info : Pointer(Void) | Nil = nil) : InputStream

Opens and returns a new InputStream. This convenience method provides default for most of its arguments.

Source

Instance methods

has_data?

Returns true if polling indicates that data is ready to read.

Source
read(buffer : Pointer(LibPortMIDI::Event), length : Int32) : Int32

Reads up to length LibPortMIDI::Event structs into buffer. Raises an exception on error.

Source
read(buffer : Array(LibPortMIDI::Event)) : Int32

Reads LibPortMIDI::Event structs into buffer, up to the length of the buffer. Raises an exception on error.

Source
set_channel_mask(bitmask : UInt32)

Sets the channel maks for this input stream. Raises an exception on error.

Source
set_filter(filters_bitmask : UInt32)

Sets the filter bitmask for this input stream. Raises an exception on error.

Source
wait_for_data(sleep_secs = 0.001)

Polls for data, waiting sleep_secs between polls. sleep_secs may be sub-second.

Source