From 57946fa15154e8d5d24016fb30f3117001880cbd Mon Sep 17 00:00:00 2001 From: onyx-and-iris Date: Sun, 23 Jul 2023 11:04:04 +0100 Subject: [PATCH] add ButtonColorMixin --- lib/voicemeeter/button.rb | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/lib/voicemeeter/button.rb b/lib/voicemeeter/button.rb index 5d257c8..4728f8e 100644 --- a/lib/voicemeeter/button.rb +++ b/lib/voicemeeter/button.rb @@ -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