class RawMIDI::Card

Attributes

id[R]
name[R]

Public Class Methods

all() click to toggle source
# File lib/rawmidi/card.rb, line 9
def self.all
  API::Card.each_id.map { |id| new(id) }
end
new(id) click to toggle source
# File lib/rawmidi/card.rb, line 13
def initialize(id)
  @id = id
  @name = API::Card.get_name(id)
end

Public Instance Methods

handle_name() click to toggle source
# File lib/rawmidi/card.rb, line 18
def handle_name
  "hw:#{@id}"
end
inputs() click to toggle source
# 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() click to toggle source
# File lib/rawmidi/card.rb, line 38
def inspect
  "#<#{self.class.name}:#{"0x%014x" % object_id} #{handle_name} #{@name.inspect}>"
end
longname() click to toggle source
# File lib/rawmidi/card.rb, line 34
def longname
  API::Card.get_longname(@id)
end
outputs() click to toggle source
# File lib/rawmidi/card.rb, line 28
def outputs
  API::Device.each(@id).select { |_, info| info[:output] }.map do |id, info|
    Output.new(self, id, name: info[:name])
  end
end