2023-07-07 02:33:49 +01:00
|
|
|
require_relative "iremote"
|
|
|
|
require_relative "meta"
|
|
|
|
|
|
|
|
module Voicemeeter
|
|
|
|
module Button
|
|
|
|
module ButtonEnum
|
|
|
|
STATE = 1
|
|
|
|
STATEONLY = 2
|
|
|
|
TRIGGER = 3
|
|
|
|
end
|
|
|
|
|
2023-07-09 05:48:24 +01:00
|
|
|
class Button < IRemote
|
2023-07-07 02:33:49 +01:00
|
|
|
def initialize(remote, i)
|
|
|
|
super
|
|
|
|
end
|
|
|
|
|
2023-07-14 01:48:35 +01:00
|
|
|
def getter(type_)
|
|
|
|
remote.get_buttonstatus(@index, type_)
|
2023-07-07 02:33:49 +01:00
|
|
|
end
|
|
|
|
|
2023-07-14 01:48:35 +01:00
|
|
|
def setter(type_, val)
|
|
|
|
remote.set_buttonstatus(@index, type_, val)
|
2023-07-07 02:33:49 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
def state
|
|
|
|
getter(ButtonEnum::STATE)
|
|
|
|
end
|
|
|
|
|
|
|
|
def state=(value)
|
|
|
|
setter(ButtonEnum::STATE, value && 1 || 0)
|
|
|
|
end
|
|
|
|
|
|
|
|
def stateonly
|
|
|
|
getter(ButtonEnum::STATEONLY)
|
|
|
|
end
|
|
|
|
|
|
|
|
def stateonly=(value)
|
|
|
|
setter(ButtonEnum::STATEONLY, value && 1 || 0)
|
|
|
|
end
|
|
|
|
|
|
|
|
def trigger
|
|
|
|
getter(ButtonEnum::TRIGGER)
|
|
|
|
end
|
|
|
|
|
|
|
|
def trigger=(value)
|
|
|
|
setter(ButtonEnum::TRIGGER, value && 1 || 0)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|