mirror of
https://github.com/onyx-and-iris/voicemeeter-rb.git
synced 2024-11-15 15:00:46 +00:00
pass convert as block to map
This commit is contained in:
parent
dced3bc183
commit
53f2c1847f
@ -93,12 +93,14 @@ module Voicemeeter
|
||||
end
|
||||
|
||||
def getter(mode)
|
||||
convert = ->(x) { (x > 0) ? (20 * Math.log(x, 10)).round(1) : -200.0 }
|
||||
|
||||
vals = if @remote.running && @remote.event.ldirty
|
||||
@remote.cache[:bus_level][@init, @offset]
|
||||
else
|
||||
(@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 }
|
||||
vals.map(&convert)
|
||||
end
|
||||
|
||||
def all
|
||||
|
@ -212,13 +212,15 @@ module Voicemeeter
|
||||
end
|
||||
|
||||
def get_level(mode)
|
||||
convert = ->(x) { (x > 0) ? (20 * Math.log(x, 10)).round(1) : -200.0 }
|
||||
|
||||
@remote.cache[:strip_mode] = mode
|
||||
vals = if @remote.running && @remote.event.ldirty
|
||||
@remote.cache[:strip_level][@init, @offset]
|
||||
else
|
||||
(@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 }
|
||||
vals.map(&convert)
|
||||
end
|
||||
|
||||
def prefader
|
||||
|
Loading…
Reference in New Issue
Block a user