voicemeeter-rb/lib/voicemeeter/option.rb

65 lines
1.1 KiB
Ruby
Raw Normal View History

2023-07-17 06:30:09 +01:00
module Voicemeeter
module Option
2023-07-27 10:58:26 +01:00
class Base
include IRemote
extend MetaFunctions
2023-07-17 06:30:09 +01:00
attr_reader :delay, :buffer, :mode
attr_accessor_int :sr
attr_accessor_bool :asiosr, :monitoronsel, :slidermode
2023-07-17 06:30:09 +01:00
def initialize(remote)
super
@delay = (0...remote.kind.phys_out).map { OptionDelay.new(remote, _1) }
2023-07-17 06:30:09 +01:00
@buffer = OptionBuffer.new(remote)
@mode = OptionMode.new(remote)
end
def identifier
:option
end
end
2023-07-27 10:58:26 +01:00
class OptionDelay
include IRemote
extend MetaFunctions
2023-07-27 10:58:26 +01:00
attr_accessor_bool :on, :ab
2023-07-17 06:30:09 +01:00
def identifier
"option.delay"
end
def get
2023-07-27 17:44:02 +01:00
getter("[#{@index}]").to_i
2023-07-17 06:30:09 +01:00
end
def set(val)
2023-07-27 17:44:02 +01:00
setter("[#{@index}]", val)
2023-07-17 06:30:09 +01:00
end
end
2023-07-27 10:58:26 +01:00
class OptionBuffer
include IRemote
extend MetaFunctions
2023-07-27 10:58:26 +01:00
attr_accessor_int :mme, :wdm, :ks, :asio
2023-07-17 06:30:09 +01:00
def identifier
"option.buffer"
end
end
2023-07-27 10:58:26 +01:00
class OptionMode
include IRemote
extend MetaFunctions
2023-07-27 10:58:26 +01:00
attr_accessor_bool :exclusif, :swift
2023-07-17 06:30:09 +01:00
def identifier
"option.mode"
end
end
end
end