2023-07-14 01:40:05 +01:00
|
|
|
require_relative "../../lib/voicemeeter"
|
|
|
|
|
|
|
|
class Main
|
|
|
|
def initialize
|
|
|
|
@vm = Voicemeeter::Remote.new(:potato, pdirty: true, ldirty: true)
|
|
|
|
@vm.register(method(:on_pdirty), method(:on_ldirty))
|
|
|
|
end
|
|
|
|
|
|
|
|
def run
|
|
|
|
@vm.run { exit if gets.chomp.empty? }
|
|
|
|
end
|
|
|
|
|
|
|
|
def on_pdirty
|
|
|
|
puts "pdirty"
|
|
|
|
end
|
|
|
|
|
|
|
|
def on_mdirty
|
|
|
|
puts "mdirty"
|
|
|
|
end
|
|
|
|
|
|
|
|
def on_midi
|
|
|
|
current = @vm.midi.current
|
|
|
|
puts "Value of midi button #{current}: #{@vm.midi.get(current)}"
|
|
|
|
end
|
|
|
|
|
|
|
|
def on_ldirty
|
|
|
|
@vm.bus.each do |bus|
|
2023-07-14 21:03:40 +01:00
|
|
|
puts "#{bus} #{bus.levels.all.join(" ")}" if bus.levels.isdirty?
|
2023-07-14 01:40:05 +01:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
Main.new.run if $0 == __FILE__
|