option implemented

This commit is contained in:
onyx-and-iris 2023-07-17 06:30:09 +01:00
parent 099ef38fad
commit f03a44044d
2 changed files with 69 additions and 3 deletions

64
lib/voicemeeter/option.rb Normal file
View File

@ -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

View File

@ -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