Class: AlsaRawMIDI::Soundcard
- Inherits:
-
Object
- Object
- AlsaRawMIDI::Soundcard
- Defined in:
- lib/alsa-rawmidi/soundcard.rb
Instance Attribute Summary collapse
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#subdevices ⇒ Object
readonly
Returns the value of attribute subdevices.
Class Method Summary collapse
-
.find(id) ⇒ Soundcard
Find a soundcard by its ID.
Instance Method Summary collapse
-
#initialize(id) ⇒ Soundcard
constructor
A new instance of Soundcard.
Constructor Details
#initialize(id) ⇒ Soundcard
Returns a new instance of Soundcard.
8 9 10 11 12 13 14 15 |
# File 'lib/alsa-rawmidi/soundcard.rb', line 8 def initialize(id) @subdevices = { :input => [], :output => [] } @id = id populate_subdevices end |
Instance Attribute Details
#id ⇒ Object (readonly)
Returns the value of attribute id.
5 6 7 |
# File 'lib/alsa-rawmidi/soundcard.rb', line 5 def id @id end |
#subdevices ⇒ Object (readonly)
Returns the value of attribute subdevices.
5 6 7 |
# File 'lib/alsa-rawmidi/soundcard.rb', line 5 def subdevices @subdevices end |
Class Method Details
.find(id) ⇒ Soundcard
Find a soundcard by its ID
20 21 22 23 24 25 |
# File 'lib/alsa-rawmidi/soundcard.rb', line 20 def self.find(id) @soundcards ||= {} if API::Soundcard.exists?(id) @soundcards[id] ||= Soundcard.new(id) end end |