class OutputStream

Overview

An output MIDI stream.

Defined in:

port_midi/output_stream.cr

Constructors

Instance Method Summary

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

def self.open(output_device_num : Int32, output_driver_info : Pointer(Void) | Nil = nil, buffer_size : Int32 = 1024, time_proc : Pointer(Void) -> LibPortMIDI::PmTimestamp | Nil = nil, time_info : Pointer(Void) | Nil = nil, latency : Int32 = 0) : OutputStream #

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


[View source]

Instance Method Detail

def abort_write #

Terminates outgoing messages immediately. This stream should be closed immediately after this call. Raises an exception on error.


[View source]
def write(buffer : Pointer(LibPortMIDI::Event), length : Int32) #

Writes the length LibPortMIDI::Event structs in buffer. Raises an exception on error.


[View source]
def write(buffer : Array(LibPortMIDI::Event)) #

Writes all of the LibPortMIDI::Event structs in buffer. Raises an exception on error.


[View source]
def write_short(msg : UInt32, when_tstamp : Int32 = 0) #

Writes a single msg at time when_tstamp (now by default). Raises an exception on error.


[View source]
def write_short(status : UInt8, data1 : UInt8 = 0_u8, data2 : UInt8 = 0_u8, when_tstamp : Int32 = 0) #

Writes a single MIDI message consisting of status, data1 (default value 0), and data2 (default 0) at time when_tstamp (default now). Raises an exception on error.


[View source]
def write_sysex(msg : Pointer(UInt8), when_tstamp : Int32 = 0) #

Writes a sysex msg at time when_tstamp (now by default). Raises an exception on error.


[View source]
def write_sysex(msg : Array(UInt8), when_tstamp : Int32 = 0) #

Writes a sysex msg at time when_tstamp (now by default). Raises an exception on error.


[View source]