get method added to BusMode class

This commit is contained in:
2023-07-18 10:34:51 +01:00
parent 049b8614a2
commit d5f1dd7814
3 changed files with 40 additions and 24 deletions

View File

@@ -110,7 +110,7 @@ module Voicemeeter
end
def get(name, is_string = false)
polling(:get, name: name) do
polling(:get, name:) do
if is_string
cget = FFI::MemoryPointer.new(:string, 512, true)
CBindings.call(:bind_get_parameter_string_a, name, cget)
@@ -133,7 +133,7 @@ module Voicemeeter
end
def get_buttonstatus(id, mode)
polling(:get_buttonstatus, id: id, mode: mode) do
polling(:get_buttonstatus, id:, mode:) do
cget = FFI::MemoryPointer.new(:float, 1)
CBindings.call(:bind_macro_button_get_status, id, cget, mode)
cget.read_float.to_i

View File

@@ -68,6 +68,16 @@ module Voicemeeter
def identifier
"bus[#{@index}].mode"
end
def get
sleep(@remote.delay)
%i[amix bmix repeat composite tvmix upmix21 upmix41 upmix61 centeronly lfeonly rearonly].each do |mode|
if send(mode)
return mode
end
end
:normal
end
end
end