Class: Voicemeeter::Device
- Inherits:
-
Object
- Object
- Voicemeeter::Device
- Defined in:
- lib/voicemeeter/device.rb
Instance Method Summary collapse
- #getter(**kwargs) ⇒ Object
-
#initialize(remote) ⇒ Device
constructor
A new instance of Device.
- #input(i) ⇒ Object
- #ins ⇒ Object
- #output(i) ⇒ Object
- #outs ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(remote) ⇒ Device
Returns a new instance of Device.
6 7 8 |
# File 'lib/voicemeeter/device.rb', line 6 def initialize(remote) @remote = remote end |
Instance Method Details
#getter(**kwargs) ⇒ Object
14 15 16 17 18 19 20 |
# File 'lib/voicemeeter/device.rb', line 14 def getter(**kwargs) return @remote.get_num_devices(kwargs[:direction]) if kwargs[:index].nil? vals = @remote.get_device_description(kwargs[:index], kwargs[:direction]) types = { 1 => "mme", 3 => "wdm", 4 => "ks", 5 => "asio" } { name: vals[0], type: types[vals[1]], id: vals[2] } end |
#input(i) ⇒ Object
26 |
# File 'lib/voicemeeter/device.rb', line 26 def input(i) = getter(index: i, direction: "in") |
#ins ⇒ Object
22 |
# File 'lib/voicemeeter/device.rb', line 22 def ins = getter(direction: "in") |
#output(i) ⇒ Object
28 |
# File 'lib/voicemeeter/device.rb', line 28 def output(i) = getter(index: i, direction: "out") |
#outs ⇒ Object
24 |
# File 'lib/voicemeeter/device.rb', line 24 def outs = getter(direction: "out") |
#to_s ⇒ Object
10 11 12 |
# File 'lib/voicemeeter/device.rb', line 10 def to_s "#{self.class.name.split("::").last}#{@index}#{@remote.kind}" end |