class InputStream
- InputStream
- PMStream
- Reference
- Object
Overview
An input MIDI stream.
Defined in:
port_midi/input_stream.crConstructors
-
.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.
Instance Method Summary
-
#has_data? : Bool
Returns
trueif polling indicates that data is ready to read. -
#read(buffer : Pointer(LibPortMIDI::Event), length : Int32) : Int32
Reads up to length
LibPortMIDI::Eventstructs into buffer. -
#read(buffer : Array(LibPortMIDI::Event)) : Int32
Reads
LibPortMIDI::Eventstructs into buffer, up to the length of the buffer. -
#set_channel_mask(bitmask : UInt32)
Sets the channel maks for this input stream.
-
#set_filter(filters_bitmask : UInt32)
Sets the filter bitmask for this input stream.
-
#wait_for_data(sleep_secs = 0.001)
Polls for data, waiting sleep_secs between polls.
Instance methods inherited from class PMStream
close
close,
host_error? : Bool
host_error?,
stream : LibPortMIDI::Stream
stream,
synchronize
synchronize
Constructor methods inherited from class PMStream
new(stream : LibPortMIDI::Stream)
new
Constructor Detail
Opens and returns a new InputStream. This convenience method provides
default for most of its arguments.
Instance Method Detail
Reads up to length LibPortMIDI::Event structs into buffer. Raises
an exception on error.
Reads LibPortMIDI::Event structs into buffer, up to the length of
the buffer. Raises an exception on error.
Sets the channel maks for this input stream. Raises an exception on error.
Sets the filter bitmask for this input stream. Raises an exception on error.
Polls for data, waiting sleep_secs between polls. sleep_secs may be sub-second.