diff --git a/lib/voicemeeter/option.rb b/lib/voicemeeter/option.rb new file mode 100644 index 0000000..5156d04 --- /dev/null +++ b/lib/voicemeeter/option.rb @@ -0,0 +1,64 @@ +require_relative "iremote" + +module Voicemeeter + module Option + class Option < IRemote + attr_reader :delay, :buffer, :mode + + def initialize(remote) + super + make_accessor_int :sr + make_accessor_bool :asiosr, :monitoronsel, :slidermode + + @delay = (0...remote.kind.phys_out).map { |i| OptionDelay(remote, i) } + @buffer = OptionBuffer.new(remote) + @mode = OptionMode.new(remote) + end + + def identifier + :option + end + end + + class OptionDelay < IRemote + def initialize(remote, i) + super + make_accessor_bool :on, :ab + end + + def identifier + "option.delay" + end + + def get + getter("[#{i}]").to_i + end + + def set(val) + setter("[#{i}]", val) + end + end + + class OptionBuffer < IRemote + def initialize(remote) + super + make_accessor_int :mme, :wdm, :ks, :asio + end + + def identifier + "option.buffer" + end + end + + class OptionMode < IRemote + def initialize(remote) + super + make_accessor_bool :exclusif, :swift + end + + def identifier + "option.mode" + end + end + end +end diff --git a/lib/voicemeeter/remote.rb b/lib/voicemeeter/remote.rb index 4617c73..b6f554e 100644 --- a/lib/voicemeeter/remote.rb +++ b/lib/voicemeeter/remote.rb @@ -9,6 +9,7 @@ require_relative "command" require_relative "recorder" require_relative "device" require_relative "fx" +require_relative "option" require_relative "configs" module Voicemeeter @@ -26,6 +27,7 @@ module Voicemeeter @recorder = Recorder::Recorder.new(self) @device = Device.new(self) @fx = Fx.new(self) + @option = Option::Option.new(self) end def configs @@ -42,15 +44,15 @@ module Voicemeeter end class RemoteBasic < Remote - attr_reader :strip, :bus, :button, :vban, :command, :device + attr_reader :strip, :bus, :button, :vban, :command, :device, :option end class RemoteBanana < Remote - attr_reader :strip, :bus, :button, :vban, :command, :device, :recorder + attr_reader :strip, :bus, :button, :vban, :command, :device, :option, :recorder end class RemotePotato < Remote - attr_reader :strip, :bus, :button, :vban, :command, :device, :recorder, :fx + attr_reader :strip, :bus, :button, :vban, :command, :device, :option, :recorder, :fx end public