Class: RawMIDI::Output

Inherits:
Object
  • Object
show all
Includes:
Device
Defined in:
lib/rawmidi/output.rb

Instance Attribute Summary

Attributes included from Device

#card, #id, #name

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Device

#close, #closed?, #handle_name, #initialize, #inspect, #open, #open?

Class Method Details

.allObject



8
9
10
# File 'lib/rawmidi/output.rb', line 8

def self.all
  Card.all.flat_map(&:outputs)
end

Instance Method Details

#input?Boolean

Returns:

  • (Boolean)


12
13
14
# File 'lib/rawmidi/output.rb', line 12

def input?
  false
end

#output?Boolean

Returns:

  • (Boolean)


16
17
18
# File 'lib/rawmidi/output.rb', line 16

def output?
  true
end

#write(buffer) ⇒ Object



20
21
22
23
# File 'lib/rawmidi/output.rb', line 20

def write(buffer)
  fail 'device is closed' if closed?
  API::Device.write(@midi_p, buffer)
end