OutPuts and Fades mixins defined

and mixed into Strip class

add reader methods for PhysicalStrip class
This commit is contained in:
onyx-and-iris 2023-07-09 05:50:06 +01:00
parent 3e02f0c451
commit 84761ef997
2 changed files with 36 additions and 19 deletions

View File

@ -1,6 +1,18 @@
module Voicemeeter module Voicemeeter
module Mixins module Mixins
module StripMixins 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
end
module Apps module Apps
def appgain(name, gain) def appgain(name, gain)
self.setter("AppGain", "(\"#{name}\", #{gain})") self.setter("AppGain", "(\"#{name}\", #{gain})")
@ -11,6 +23,19 @@ module Voicemeeter
end end
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 module Xy
include Meta_Functions include Meta_Functions

View File

@ -1,12 +1,12 @@
require_relative "iremote" require_relative "iremote"
require_relative "kinds" require_relative "kinds"
require_relative "meta"
require_relative "mixins" require_relative "mixins"
module Voicemeeter module Voicemeeter
module Strip module Strip
class Strip < IRemote class Strip < IRemote
include Meta_Functions include Mixins::StripMixins::Outputs
include Mixins::StripMixins::Fades
def self.make(remote, i) def self.make(remote, i)
" "
@ -37,6 +37,8 @@ module Voicemeeter
include Mixins::StripMixins::Xy::Fx include Mixins::StripMixins::Xy::Fx
include Mixins::StripMixins::Fx include Mixins::StripMixins::Fx
attr_reader :comp, :gate, :denoiser, :eq, :device
def initialize(remote, i) def initialize(remote, i)
super super
make_accessor_float :audibility make_accessor_float :audibility
@ -50,8 +52,6 @@ module Voicemeeter
end end
class StripComp < IRemote class StripComp < IRemote
include Meta_Functions
def initialize(remote, i) def initialize(remote, i)
super super
make_accessor_float :gainin, make_accessor_float :gainin,
@ -69,17 +69,15 @@ module Voicemeeter
end end
def knob def knob
getter("").to_i == 1 getter("")
end end
def knob=(val) def knob=(val)
setter("", val && 1 || 0) setter("", val)
end end
end end
class StripGate < IRemote class StripGate < IRemote
include Meta_Functions
def initialize(remote, i) def initialize(remote, i)
super super
make_accessor_float :threshold, :damping, :attack, :hold, :release make_accessor_float :threshold, :damping, :attack, :hold, :release
@ -91,17 +89,15 @@ module Voicemeeter
end end
def knob def knob
getter("").to_i == 1 getter("")
end end
def knob=(val) def knob=(val)
setter("", val && 1 || 0) setter("", val)
end end
end end
class StripDenoiser < IRemote class StripDenoiser < IRemote
include Meta_Functions
def initialize(remote, i) def initialize(remote, i)
super super
end end
@ -111,30 +107,26 @@ module Voicemeeter
end end
def knob def knob
getter("").to_i == 1 getter("")
end end
def knob=(val) def knob=(val)
setter("", val && 1 || 0) setter("", val)
end end
end end
class StripEq < IRemote class StripEq < IRemote
include Meta_Functions
def initialize(remote, i) def initialize(remote, i)
super super
make_accessor_bool :on, :ab make_accessor_bool :on, :ab
end end
def identifier def identifier
"strip[#{@index}].device" "strip[#{@index}].eq"
end end
end end
class StripDevice < IRemote class StripDevice < IRemote
include Meta_Functions
def initialize(remote, i) def initialize(remote, i)
super super
make_reader_int :sr make_reader_int :sr