Class: Voicemeeter::BusLevels
Instance Method Summary
collapse
Methods inherited from IRemote
#set_multi, #setter, #to_s
Boolean
Constructor Details
#initialize(remote, i) ⇒ BusLevels
Returns a new instance of BusLevels.
74
75
76
77
78
|
# File 'lib/voicemeeter/bus.rb', line 74
def initialize(remote, i)
super
@init = i * 8
@offset = 8
end
|
Instance Method Details
#all ⇒ Object
93
94
95
|
# File 'lib/voicemeeter/bus.rb', line 93
def all
getter(3)
end
|
#getter(mode) ⇒ Object
84
85
86
87
88
89
90
91
|
# File 'lib/voicemeeter/bus.rb', line 84
def getter(mode)
if @remote.running && @remote.event.ldirty
vals = @remote.cache["bus_level"][@init, @offset]
else
vals = (@init...@init + @offset).map { |i| @remote.get_level(mode, i) }
end
vals.map { |x| x > 0 ? (20 * Math.log(x, 10)).round(1) : -200.0 }
end
|
#identifier ⇒ Object
80
81
82
|
# File 'lib/voicemeeter/bus.rb', line 80
def identifier
"bus[#{@index}]"
end
|
97
|
# File 'lib/voicemeeter/bus.rb', line 97
def isdirty? = @remote._bus_comp[@init, @offset].any?
|