Class: Voicemeeter::IRemote

Inherits:
Object
  • Object
show all
Includes:
Meta_Functions
Defined in:
lib/voicemeeter/iremote.rb

Instance Method Summary collapse

Methods included from Conversions

Boolean

Constructor Details

#initialize(remote, i = nil) ⇒ IRemote

Returns a new instance of IRemote.



11
12
13
14
# File 'lib/voicemeeter/iremote.rb', line 11

def initialize(remote, i = nil)
  @remote = remote
  @index = i
end

Instance Method Details

#getter(param, is_string = false) ⇒ Object



20
21
22
# File 'lib/voicemeeter/iremote.rb', line 20

def getter(param, is_string = false)
  @remote.get_parameter("#{self.identifier}.#{param}", is_string)
end

#identifierObject



28
29
30
# File 'lib/voicemeeter/iremote.rb', line 28

def identifier
  raise "Called abstract method: identifier"
end

#set_multi(param_hash) ⇒ Object Also known as: apply



32
33
34
# File 'lib/voicemeeter/iremote.rb', line 32

def set_multi(param_hash)
  param_hash.each { |(key, val)| self.send("#{key}=", val) }
end

#setter(param, value) ⇒ Object



24
25
26
# File 'lib/voicemeeter/iremote.rb', line 24

def setter(param, value)
  @remote.set_parameter("#{self.identifier}.#{param}", value)
end

#to_sObject



16
17
18
# File 'lib/voicemeeter/iremote.rb', line 16

def to_s
  "#{self.class.name.split("::").last}#{@index}#{@remote.kind}"
end