Module: MIDICommunicationsWindows::Device::ClassMethods

Included in:
Input, Output
Defined in:
lib/midi-communications-windows/device.rb

Overview

Methods on Input and Output themselves.

Instance Method Summary collapse

Instance Method Details

#all ⇒ Array<Input>, Array<Output>

Every port of this direction.

WinMM is asked afresh on every call, so a port that appeared or went away since the last one is reflected. A port that is still there comes back as the same object as before; see MIDICommunicationsWindows::Device.enumerate.

Returns:



69
70
71
# File 'lib/midi-communications-windows/device.rb', line 69

def all
  Device.all_by_type[direction]
end

#first ⇒ Input, ...

The first port of this direction, or nil if there are none.

Returns:



75
76
77
# File 'lib/midi-communications-windows/device.rb', line 75

def first
  all.first
end

#last ⇒ Input, ...

The last port of this direction, or nil if there are none.

Returns:



81
82
83
# File 'lib/midi-communications-windows/device.rb', line 81

def last
  all.last
end