mirror of
https://github.com/onyx-and-iris/voicemeeter-rb.git
synced 2024-11-15 15:00:46 +00:00
add logging for macrobutton getter,setter
This commit is contained in:
parent
5789b39826
commit
6769013ee3
@ -1,5 +1,6 @@
|
|||||||
require_relative "iremote"
|
require_relative "iremote"
|
||||||
require_relative "meta"
|
require_relative "meta"
|
||||||
|
require_relative "logger"
|
||||||
|
|
||||||
module Voicemeeter
|
module Voicemeeter
|
||||||
module Button
|
module Button
|
||||||
@ -7,6 +8,12 @@ module Voicemeeter
|
|||||||
STATE = 1
|
STATE = 1
|
||||||
STATEONLY = 2
|
STATEONLY = 2
|
||||||
TRIGGER = 3
|
TRIGGER = 3
|
||||||
|
|
||||||
|
def identifier(val)
|
||||||
|
[nil, :state, :stateonly, :trigger][val]
|
||||||
|
end
|
||||||
|
|
||||||
|
module_function :identifier
|
||||||
end
|
end
|
||||||
|
|
||||||
module ButtonColorMixin
|
module ButtonColorMixin
|
||||||
@ -25,14 +32,17 @@ module Voicemeeter
|
|||||||
|
|
||||||
class Base
|
class Base
|
||||||
# Base class for Button types
|
# Base class for Button types
|
||||||
|
include Logging
|
||||||
include IRemote
|
include IRemote
|
||||||
include ButtonColorMixin
|
include ButtonColorMixin
|
||||||
|
|
||||||
def getter(mode)
|
def getter(mode)
|
||||||
|
logger.debug "getter: button[#{@index}].#{ButtonEnum.identifier(mode)}"
|
||||||
@remote.get_buttonstatus(@index, mode)
|
@remote.get_buttonstatus(@index, mode)
|
||||||
end
|
end
|
||||||
|
|
||||||
def setter(mode, val)
|
def setter(mode, val)
|
||||||
|
logger.debug "setter: button[#{@index}].#{ButtonEnum.identifier(mode)}=#{val}"
|
||||||
@remote.set_buttonstatus(@index, mode, val)
|
@remote.set_buttonstatus(@index, mode, val)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user