2023-07-07 02:32:18 +01:00
|
|
|
module Voicemeeter
|
|
|
|
module Kinds
|
|
|
|
private
|
|
|
|
|
2023-08-09 16:06:55 +01:00
|
|
|
module KindEnum
|
|
|
|
BASIC = 1
|
|
|
|
BANANA = 2
|
|
|
|
POTATO = 3
|
2024-06-29 05:27:23 +01:00
|
|
|
BASICX64 = 4
|
|
|
|
BANANAX64 = 5
|
2023-08-09 16:06:55 +01:00
|
|
|
POTATOX64 = 6
|
|
|
|
end
|
|
|
|
|
2023-07-07 02:32:18 +01:00
|
|
|
KindMap =
|
|
|
|
Data.define(:name, :ins, :outs, :vban, :asio, :insert, :num_buttons) do
|
2023-08-27 21:36:44 +01:00
|
|
|
def phys_in = ins.first
|
2023-07-14 12:01:41 +01:00
|
|
|
|
2023-08-27 21:36:44 +01:00
|
|
|
def virt_in = ins.last
|
2023-07-14 12:01:41 +01:00
|
|
|
|
2023-08-27 21:36:44 +01:00
|
|
|
def phys_out = outs.first
|
2023-07-14 12:01:41 +01:00
|
|
|
|
2023-08-27 21:36:44 +01:00
|
|
|
def virt_out = outs.last
|
2023-07-14 12:01:41 +01:00
|
|
|
|
2023-07-07 02:32:18 +01:00
|
|
|
def num_strip = ins.sum
|
2023-07-14 12:01:41 +01:00
|
|
|
|
2023-07-07 02:32:18 +01:00
|
|
|
def num_bus = outs.sum
|
2023-07-14 12:01:41 +01:00
|
|
|
|
2023-07-14 01:47:18 +01:00
|
|
|
def num_strip_levels = 2 * phys_in + 8 * virt_in
|
2023-07-14 12:01:41 +01:00
|
|
|
|
2023-07-14 01:47:18 +01:00
|
|
|
def num_bus_levels = 8 * (phys_out + virt_out)
|
2023-07-14 12:01:41 +01:00
|
|
|
|
|
|
|
def to_s = name.to_s.capitalize
|
2023-07-07 02:32:18 +01:00
|
|
|
end
|
|
|
|
|
2023-08-03 12:56:16 +01:00
|
|
|
basic = KindMap.new(:basic, [2, 1], [1, 1], [4, 4, 1, 1], [0, 0], 0, 80)
|
2023-07-07 02:32:18 +01:00
|
|
|
|
2023-08-03 12:56:16 +01:00
|
|
|
banana = KindMap.new(:banana, [3, 2], [3, 2], [8, 8, 1, 1], [6, 8], 22, 80)
|
2023-07-07 02:32:18 +01:00
|
|
|
|
2023-08-03 12:56:16 +01:00
|
|
|
potato = KindMap.new(:potato, [5, 3], [5, 3], [8, 8, 1, 1], [10, 8], 34, 80)
|
2023-07-07 02:32:18 +01:00
|
|
|
|
|
|
|
KIND_MAPS = [basic, banana, potato].to_h { |kind| [kind.name, kind] }
|
|
|
|
|
2023-07-16 11:08:24 +01:00
|
|
|
public
|
|
|
|
|
2023-07-07 02:32:18 +01:00
|
|
|
def get(kind_id)
|
2023-07-16 22:33:02 +01:00
|
|
|
KIND_MAPS.fetch(kind_id)
|
2023-07-07 02:32:18 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
ALL = KIND_MAPS.values
|
|
|
|
|
|
|
|
module_function :get
|
|
|
|
end
|
|
|
|
end
|