add ButtonColorMixin

This commit is contained in:
onyx-and-iris 2023-07-23 11:04:04 +01:00
parent 6a21aa686a
commit 57946fa151

View File

@ -9,7 +9,23 @@ module Voicemeeter
TRIGGER = 3
end
module ButtonColorMixin
def identifier
"command.button[#{@index}]"
end
def color
method(:getter).super_method.call("color").to_i
end
def color=(val)
method(:setter).super_method.call("color", val)
end
end
class Button < IRemote
include ButtonColorMixin
def getter(mode)
@remote.get_buttonstatus(@index, mode)
end