Module: AlsaRawMIDI::Device::ClassMethods

Included in:
AlsaRawMIDI::Device
Defined in:
lib/alsa-rawmidi/device.rb

Instance Method Summary collapse

Instance Method Details

#allArray<Input, Output>

All devices

Returns:



29
30
31
# File 'lib/alsa-rawmidi/device.rb', line 29

def all
  all_by_type.values.flatten
end

#all_by_typeHash

A hash of devices, partitioned by direction

Returns:

  • (Hash)


23
24
25
# File 'lib/alsa-rawmidi/device.rb', line 23

def all_by_type
  @devices ||= get_devices
end

#first(direction) ⇒ Input, Output

Select the first device of the given direction

Parameters:

  • direction (Symbol)

Returns:



10
11
12
# File 'lib/alsa-rawmidi/device.rb', line 10

def first(direction)
  all_by_type[direction].first
end

#last(direction) ⇒ Input, Output

Select the last device of the given direction

Parameters:

  • direction (Symbol)

Returns:



17
18
19
# File 'lib/alsa-rawmidi/device.rb', line 17

def last(direction)
  all_by_type[direction].last
end