From 1e694b21aae4366c2cbabf45a7dca02e1438e1bc Mon Sep 17 00:00:00 2001 From: onyx-and-iris Date: Sat, 22 Jul 2023 13:05:38 +0100 Subject: [PATCH] use numbered parameters when building class arrays --- lib/voicemeeter/option.rb | 2 +- lib/voicemeeter/patch.rb | 14 +++++++------- lib/voicemeeter/recorder.rb | 4 ++-- lib/voicemeeter/remote.rb | 6 +++--- lib/voicemeeter/strip.rb | 2 +- lib/voicemeeter/vban.rb | 4 ++-- 6 files changed, 16 insertions(+), 16 deletions(-) diff --git a/lib/voicemeeter/option.rb b/lib/voicemeeter/option.rb index 9048703..aa5343e 100644 --- a/lib/voicemeeter/option.rb +++ b/lib/voicemeeter/option.rb @@ -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 diff --git a/lib/voicemeeter/patch.rb b/lib/voicemeeter/patch.rb index 7da8cac..6149922 100644 --- a/lib/voicemeeter/patch.rb +++ b/lib/voicemeeter/patch.rb @@ -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 diff --git a/lib/voicemeeter/recorder.rb b/lib/voicemeeter/recorder.rb index 4aba331..db75cd8 100644 --- a/lib/voicemeeter/recorder.rb +++ b/lib/voicemeeter/recorder.rb @@ -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 diff --git a/lib/voicemeeter/remote.rb b/lib/voicemeeter/remote.rb index 224c87a..2d0afd2 100644 --- a/lib/voicemeeter/remote.rb +++ b/lib/voicemeeter/remote.rb @@ -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) }, diff --git a/lib/voicemeeter/strip.rb b/lib/voicemeeter/strip.rb index 6278a55..a46e530 100644 --- a/lib/voicemeeter/strip.rb +++ b/lib/voicemeeter/strip.rb @@ -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 diff --git a/lib/voicemeeter/vban.rb b/lib/voicemeeter/vban.rb index 51d7960..171e49b 100644 --- a/lib/voicemeeter/vban.rb +++ b/lib/voicemeeter/vban.rb @@ -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