mirror of
https://github.com/onyx-and-iris/voicemeeter-rb.git
synced 2024-11-22 01:40:49 +00:00
make_writer_methods added to Event class
This commit is contained in:
parent
53f2c1847f
commit
8b45ffbeb6
@ -36,6 +36,7 @@ module Voicemeeter
|
|||||||
@mdirty = mdirty
|
@mdirty = mdirty
|
||||||
@midi = midi
|
@midi = midi
|
||||||
@ldirty = ldirty
|
@ldirty = ldirty
|
||||||
|
make_writer_methods :pdirty, :mdirty, :midi, :ldirty
|
||||||
end
|
end
|
||||||
|
|
||||||
def to_s
|
def to_s
|
||||||
@ -52,24 +53,13 @@ module Voicemeeter
|
|||||||
logger.info(info_msg.join(" "))
|
logger.info(info_msg.join(" "))
|
||||||
end
|
end
|
||||||
|
|
||||||
def pdirty=(val)
|
def make_writer_methods(*params)
|
||||||
@pdirty = val
|
params.each do |param|
|
||||||
info("pdirty #{val ? "added to" : "removed from"}")
|
define_singleton_method("#{param}=") do |value|
|
||||||
|
instance_variable_set("@#{param}", value)
|
||||||
|
info("#{param} #{send(param) ? "added to" : "removed from"}")
|
||||||
end
|
end
|
||||||
|
|
||||||
def mdirty=(val)
|
|
||||||
@mdirty = val
|
|
||||||
info("mdirty #{val ? "added to" : "removed from"}")
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def ldirty=(val)
|
|
||||||
@ldirty = val
|
|
||||||
info("ldirty #{val ? "added to" : "removed from"}")
|
|
||||||
end
|
|
||||||
|
|
||||||
def midi=(val)
|
|
||||||
@midi = val
|
|
||||||
info("midi #{val ? "added to" : "removed from"}")
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def get
|
def get
|
||||||
|
Loading…
Reference in New Issue
Block a user