voicemeeter-rb/lib/voicemeeter/mixins.rb

84 lines
1.7 KiB
Ruby
Raw Normal View History

module Voicemeeter
module Mixins
2023-07-09 19:43:26 +01:00
module Fades
def fadeto(target, time)
2023-07-14 12:01:41 +01:00
setter("FadeTo", "(#{target}, #{time})")
2023-07-09 19:43:26 +01:00
sleep(@remote.delay)
end
2023-07-09 19:43:26 +01:00
def fadeby(change, time)
2023-07-14 12:01:41 +01:00
setter("FadeBy", "(#{change}, #{time})")
2023-07-09 19:43:26 +01:00
sleep(@remote.delay)
end
2023-07-09 19:43:26 +01:00
end
2023-07-09 19:43:26 +01:00
module Return
def initialize(remote, i)
super
make_accessor_float :returnreverb, :returndelay, :returnfx1, :returnfx2
end
2023-07-09 19:43:26 +01:00
end
2023-07-09 19:43:26 +01:00
module Apps
def appgain(name, gain)
2023-07-14 12:01:41 +01:00
setter("AppGain", "(\"#{name}\", #{gain})")
end
2023-07-09 19:43:26 +01:00
def appmute(name, mute)
2023-07-14 12:01:41 +01:00
setter("AppMute", "(\"#{name}\", #{mute ? 1 : 0})")
2023-07-09 19:43:26 +01:00
end
end
2023-07-09 19:43:26 +01:00
module Outputs
def initialize(*args)
super
remote, *rem = args
2023-07-14 12:01:41 +01:00
num_a, num_b = remote.kind.outs
2023-07-09 19:43:26 +01:00
channels =
2023-07-14 12:01:41 +01:00
(1..(num_a + num_b)).map do |i|
(i <= num_a) ? "A#{i}" : "B#{i - num_a}"
end
2023-07-14 12:01:41 +01:00
make_accessor_bool(*channels)
2023-07-09 19:43:26 +01:00
end
end
2023-07-09 19:43:26 +01:00
module Xy
module Pan
def initialize(remote, i)
super
make_accessor_float :pan_x, :pan_y
end
end
2023-07-09 19:43:26 +01:00
module Color
def initialize(remote, i)
super
2023-07-09 19:43:26 +01:00
make_accessor_float :color_x, :color_y
end
end
2023-07-09 19:43:26 +01:00
module Fx
def initialize(remote, i)
super
2023-07-09 19:43:26 +01:00
make_accessor_float :fx_x, :fx_y
end
end
end
2023-07-09 19:43:26 +01:00
module Fx
def initialize(remote, i)
super
make_accessor_float :reverb, :delay, :fx1, :fx2
make_accessor_bool :postreverb, :postdelay, :postfx1, :postfx2
end
end
module LevelEnum
PREFADER = 0
POSTFADER = 1
POSTMUTE = 2
BUS = 3
end
end
end