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
|
2023-08-27 21:36:34 +01:00
|
|
|
|
2023-08-18 00:27:43 +01:00
|
|
|
@vm.on :pdirty do
|
|
|
|
puts "pdirty"
|
|
|
|
end
|
2023-08-27 21:36:34 +01:00
|
|
|
|
2023-08-18 00:27:43 +01:00
|
|
|
@vm.on :mdirty do
|
|
|
|
puts "mdirty"
|
|
|
|
end
|
2023-08-27 21:36:34 +01:00
|
|
|
|
2023-08-18 00:27:43 +01:00
|
|
|
@vm.on :midi do
|
|
|
|
current = @vm.midi.current
|
|
|
|
puts "Value of midi input #{current}: #{@vm.midi.get(current)}"
|
|
|
|
end
|
2023-08-27 21:36:34 +01:00
|
|
|
|
2023-08-18 00:27:43 +01:00
|
|
|
@vm.on :ldirty do
|
|
|
|
@vm.bus.each do |bus|
|
|
|
|
puts "#{bus} #{bus.levels.all.join(" ")}" if bus.levels.isdirty?
|
|
|
|
end
|
|
|
|
end
|
2023-07-14 01:40:05 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
def run
|
2023-07-21 09:34:26 +01:00
|
|
|
puts "press <Enter> to quit"
|
|
|
|
loop { break if gets.chomp.empty? }
|
2023-07-14 01:40:05 +01:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2023-07-21 09:34:26 +01:00
|
|
|
if $PROGRAM_NAME == __FILE__
|
2023-08-18 00:27:43 +01:00
|
|
|
Voicemeeter::Remote
|
|
|
|
.new(:potato, pdirty: true, mdirty: true, midi: true, ldirty: true)
|
|
|
|
.run do |vm|
|
2023-07-17 08:34:34 +01:00
|
|
|
Main.new(vm).run
|
|
|
|
end
|
|
|
|
end
|