use numbered parameters when building class arrays

This commit is contained in:
onyx-and-iris 2023-07-22 13:05:38 +01:00
parent fefcbe6661
commit 1e694b21aa
6 changed files with 16 additions and 16 deletions

View File

@ -10,7 +10,7 @@ module Voicemeeter
make_accessor_int :sr
make_accessor_bool :asiosr, :monitoronsel, :slidermode
@delay = (0...remote.kind.phys_out).map { |i| OptionDelay.new(remote, i) }
@delay = (0...remote.kind.phys_out).map { OptionDelay.new(remote, _1) }
@buffer = OptionBuffer.new(remote)
@mode = OptionMode.new(remote)
end

View File

@ -10,13 +10,13 @@ module Voicemeeter
make_accessor_bool :postfadercomposite, :postfxinsert
asio_in, asio_out = remote.kind.asio
@asio = (0...asio_in).map { |i| PatchAsioIn.new(remote, i) }
@outa2 = (0...asio_out).map { |i| PatchAsioOut.new(remote, i) }
@outa3 = (0...asio_out).map { |i| PatchAsioOut.new(remote, i) }
@outa4 = (0...asio_out).map { |i| PatchAsioOut.new(remote, i) }
@outa5 = (0...asio_out).map { |i| PatchAsioOut.new(remote, i) }
@composite = (0...8).map { |i| PatchComposite.new(remote, i) }
@insert = (0...remote.kind.insert).map { |i| PatchInsert.new(remote, i) }
@asio = (0...asio_in).map { PatchAsioIn.new(remote, _1) }
@outa2 = (0...asio_out).map { PatchAsioOut.new(remote, _1) }
@outa3 = (0...asio_out).map { PatchAsioOut.new(remote, _1) }
@outa4 = (0...asio_out).map { PatchAsioOut.new(remote, _1) }
@outa5 = (0...asio_out).map { PatchAsioOut.new(remote, _1) }
@composite = (0...8).map { PatchComposite.new(remote, _1) }
@insert = (0...remote.kind.insert).map { PatchInsert.new(remote, _1) }
end
end

View File

@ -26,8 +26,8 @@ module Voicemeeter
make_accessor_float :gain
@mode = RecorderMode.new(remote)
@armstrip = (0...remote.kind.num_strip).map { |j| RecorderArmStrip.new(remote, j) }
@armbus = (0...remote.kind.num_bus).map { |j| RecorderArmBus.new(remote, j) }
@armstrip = (0...remote.kind.num_strip).map { RecorderArmStrip.new(remote, _1) }
@armbus = (0...remote.kind.num_bus).map { RecorderArmBus.new(remote, _1) }
end
def identifier

View File

@ -19,9 +19,9 @@ module Voicemeeter
def steps
{
strip: -> { (0...kind.num_strip).map { |i| Strip::Strip.make(self, i) } },
bus: -> { (0...kind.num_bus).map { |i| Bus::Bus.make(self, i) } },
button: -> { (0...kind.num_buttons).map { |i| Button::Button.new(self, i) } },
strip: -> { (0...kind.num_strip).map { Strip::Strip.make(self, _1) } },
bus: -> { (0...kind.num_bus).map { Bus::Bus.make(self, _1) } },
button: -> { (0...kind.num_buttons).map { Button::Button.new(self, _1) } },
vban: -> { Vban::Vban.new(self) },
command: -> { Command.new(self) },
recorder: -> { Recorder::Recorder.new(self) },

View File

@ -22,7 +22,7 @@ module Voicemeeter
make_accessor_int :limit
make_accessor_string :label
@gainlayer = (0...8).map { |j| GainLayer.new(remote, i, j) }
@gainlayer = (0...8).map { GainLayer.new(remote, i, _1) }
@levels = StripLevels.new(remote, i)
end

View File

@ -48,8 +48,8 @@ module Voicemeeter
def initialize(remote)
vban_in, vban_out = remote.kind.vban
@instream = (0...vban_in).map { |i| VbanInstream.new(remote, i) }
@outstream = (0...vban_out).map { |i| VbanOutstream.new(remote, i) }
@instream = (0...vban_in).map { VbanInstream.new(remote, _1) }
@outstream = (0...vban_out).map { VbanOutstream.new(remote, _1) }
@remote = remote
end