Class: RawMIDI::Card
- Inherits:
-
Object
- Object
- RawMIDI::Card
- Defined in:
- lib/rawmidi/card.rb
Instance Attribute Summary collapse
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Class Method Summary collapse
Instance Method Summary collapse
- #handle_name ⇒ Object
-
#initialize(id) ⇒ Card
constructor
A new instance of Card.
- #inputs ⇒ Object
- #inspect ⇒ Object
- #longname ⇒ Object
- #outputs ⇒ Object
Constructor Details
Instance Attribute Details
#id ⇒ Object (readonly)
Returns the value of attribute id.
7 8 9 |
# File 'lib/rawmidi/card.rb', line 7 def id @id end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
7 8 9 |
# File 'lib/rawmidi/card.rb', line 7 def name @name end |
Class Method Details
Instance Method Details
#handle_name ⇒ Object
18 19 20 |
# File 'lib/rawmidi/card.rb', line 18 def handle_name "hw:#{@id}" end |
#inputs ⇒ Object
22 23 24 25 26 |
# File 'lib/rawmidi/card.rb', line 22 def inputs API::Device.each(@id).select { |_, info| info[:input] }.map do |id, info| Input.new(self, id, name: info[:name]) end end |
#inspect ⇒ Object
38 39 40 |
# File 'lib/rawmidi/card.rb', line 38 def inspect "#<#{self.class.name}:#{"0x%014x" % object_id} #{handle_name} #{@name.inspect}>" end |
#longname ⇒ Object
34 35 36 |
# File 'lib/rawmidi/card.rb', line 34 def longname API::Card.get_longname(@id) end |