From ccd7e93e94babde226193e4eb6633b8acfce76fc Mon Sep 17 00:00:00 2001 From: onyx-and-iris Date: Sun, 9 Jul 2023 19:43:26 +0100 Subject: [PATCH] StripMixins removed --- lib/voicemeeter/mixins.rb | 119 ++++++++++++++++++-------------------- 1 file changed, 57 insertions(+), 62 deletions(-) diff --git a/lib/voicemeeter/mixins.rb b/lib/voicemeeter/mixins.rb index 4ab7e13..b2ffb98 100644 --- a/lib/voicemeeter/mixins.rb +++ b/lib/voicemeeter/mixins.rb @@ -1,86 +1,81 @@ module Voicemeeter module Mixins - module StripMixins - module Fades - def fadeto(target, time) - self.setter("FadeTo", "(#{target}, #{time})") - sleep(@remote.delay) - end - - def fadeby(change, time) - self.setter("FadeBy", "(#{change}, #{time})") - sleep(@remote.delay) - end + module Fades + def fadeto(target, time) + self.setter("FadeTo", "(#{target}, #{time})") + sleep(@remote.delay) end - module Apps - def appgain(name, gain) - self.setter("AppGain", "(\"#{name}\", #{gain})") - end + def fadeby(change, time) + self.setter("FadeBy", "(#{change}, #{time})") + sleep(@remote.delay) + end + end - def appmute(name, mute) - self.setter("AppMute", "(\"#{name}\", #{mute ? 1 : 0})") - end + module Return + include Meta_Functions + + def initialize(remote, i) + super + make_accessor_float :returnreverb, :returndelay, :returnfx1, :returnfx2 + end + end + + module Apps + def appgain(name, gain) + self.setter("AppGain", "(\"#{name}\", #{gain})") end - module Outputs - def initialize(*args) + def appmute(name, mute) + self.setter("AppMute", "(\"#{name}\", #{mute ? 1 : 0})") + end + end + + module Outputs + def initialize(*args) + super + remote, *rem = args + num_A, num_B = remote.kind.outs + channels = + (1..(num_A + num_B)).map do |i| + i <= num_A ? "A#{i}" : "B#{i - num_A}" + end + make_accessor_bool *channels + end + end + + module Xy + include Meta_Functions + + module Pan + def initialize(remote, i) super - remote, *rem = args - num_A, num_B = remote.kind.outs - channels = - (1..(num_A + num_B)).map do |i| - i <= num_A ? "A#{i}" : "B#{i - num_A}" - end - make_accessor_bool *channels + make_accessor_float :pan_x, :pan_y end end - module Xy - include Meta_Functions - - module Pan - def initialize(remote, i) - super - make_accessor_float :pan_x, :pan_y - end - end - - module Color - def initialize(remote, i) - super - make_accessor_float :color_x, :color_y - end - end - - module Fx - def initialize(remote, i) - super - make_accessor_float :fx_x, :fx_y - end + module Color + def initialize(remote, i) + super + make_accessor_float :color_x, :color_y end end module Fx - include Meta_Functions - def initialize(remote, i) super - make_accessor_float :reverb, :delay, :fx1, :fx2 - make_accessor_bool :postreverb, :postdelay, :postfx1, :postfx2 + make_accessor_float :fx_x, :fx_y end end + end - module Return - include Meta_Functions + module Fx + include Meta_Functions - def initialize(remote, i) - super - make_accessor_float :returnreverb, - :returndelay, - :returnfx1, - :returnfx2 - end + def initialize(remote, i) + super + make_accessor_float :reverb, :delay, :fx1, :fx2 + make_accessor_bool :postreverb, :postdelay, :postfx1, :postfx2 end end end