2023-07-14 01:40:05 +01:00
|
|
|
require_relative "../../lib/voicemeeter"
|
|
|
|
|
|
|
|
class Main
|
2023-07-17 08:34:34 +01:00
|
|
|
def initialize(vm)
|
|
|
|
@vm = vm
|
|
|
|
@vm.callback.register(method(:on_pdirty), method(:on_mdirty), method(:on_midi), method(:on_ldirty))
|
2023-07-14 01:40:05 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
def run
|
2023-07-17 08:34:34 +01:00
|
|
|
exit if gets.chomp.empty?
|
2023-07-14 01:40:05 +01:00
|
|
|
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
|
|
|
|
|
2023-07-17 08:34:34 +01:00
|
|
|
if $0 == __FILE__
|
|
|
|
Voicemeeter::Remote.new(:potato, pdirty: true, mdirty: true, midi: true, ldirty: true).run do |vm|
|
|
|
|
Main.new(vm).run
|
|
|
|
end
|
|
|
|
end
|