Class: UniMIDI::CongruousApiOutput

Inherits:
Object
  • Object
show all
Extended by:
UniMIDI::CongruousApiAdapter::Device::ClassMethods
Includes:
UniMIDI::CongruousApiAdapter::Device
Defined in:
lib/unimidi/congruous_api_adapter.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods included from UniMIDI::CongruousApiAdapter::Device::ClassMethods

all, all_by_type, defer_to, first, input_class, last, output_class

Methods included from UniMIDI::CongruousApiAdapter::Device

#close, included, #initialize, #open

Class Method Details

.allObject

returns all outputs



205
206
207
# File 'lib/unimidi/congruous_api_adapter.rb', line 205

def self.all
  @deference[self].all.map { |d| new(d) }
end

Instance Method Details

#puts(*a) ⇒ Object

sends a message to the output. the message can be:

bytes eg output.puts(0x90, 0x40, 0x40) an array of bytes eg output.puts([0x90, 0x40, 0x40]) or a string eg output.puts(“904040”)



186
187
188
# File 'lib/unimidi/congruous_api_adapter.rb', line 186

def puts(*a)
  @device.puts(*a)
end

#puts_bytes(*a) ⇒ Object

sends a message to the output in a form of bytes eg output.puts_bytes(0x90, 0x40, 0x40). this method does not do type checking and therefore is more performant than puts



200
201
202
# File 'lib/unimidi/congruous_api_adapter.rb', line 200

def puts_bytes(*a)
  @device.puts_bytes(*a)
end

#puts_s(*a) ⇒ Object Also known as: puts_bytestr, puts_hex

sends a message to the output in a form of a string eg “904040”. this method does not do type checking and therefore is more performant than puts



192
193
194
# File 'lib/unimidi/congruous_api_adapter.rb', line 192

def puts_s(*a)
  @device.puts_s(*a)
end