Events::Callback now a class

on_event method renamed to trigger

events example updated to reflect changes to Events module
This commit is contained in:
2023-07-17 08:34:34 +01:00
parent 6d080af041
commit ac7d9c0d03
4 changed files with 20 additions and 15 deletions

View File

@@ -31,15 +31,15 @@ module Voicemeeter
logger.debug("closing worker thread")
break
end
on_event :on_pdirty if e_from_que == :pdirty && pdirty?
on_event :on_mdirty if e_from_que == :mdirty && mdirty?
on_event :on_midi if e_from_que == :midi && get_midi_message
callback.trigger :on_pdirty if e_from_que == :pdirty && pdirty?
callback.trigger :on_mdirty if e_from_que == :mdirty && mdirty?
callback.trigger :on_midi if e_from_que == :midi && get_midi_message
if e_from_que == :ldirty && ldirty?
cache[:strip_comp] = cache[:strip_level].zip(cache[:strip_buf]).map { |a, b| a != b }
cache[:bus_comp] = cache[:bus_level].zip(cache[:bus_buf]).map { |a, b| a != b }
cache[:strip_level] = cache[:strip_buf]
cache[:bus_level] = cache[:bus_buf]
on_event :on_ldirty
callback.trigger :on_ldirty
end
end
end