vban-cmd-python/vbancmd/kinds.py
onyx-and-iris 5d878a5df0 black reformatter
now using black reformatter
2022-03-26 23:00:09 +00:00

37 lines
866 B
Python

import sys
import platform
from collections import namedtuple
from .errors import VMCMDErrors
"""
Represents a major version of Voicemeeter and describes
its strip layout.
"""
VMKind = namedtuple("VMKind", ["id", "name", "ins", "outs", "executable", "vban"])
bits = 64 if sys.maxsize > 2**32 else 32
os = platform.system()
_kind_map = {
"basic": VMKind("basic", "Basic", (2, 1), (1, 1), "voicemeeter.exe", (4, 4)),
"banana": VMKind("banana", "Banana", (3, 2), (3, 2), "voicemeeterpro.exe", (8, 8)),
"potato": VMKind(
"potato",
"Potato",
(5, 3),
(5, 3),
f'voicemeeter8{"x64" if bits == 64 else ""}.exe',
(8, 8),
),
}
def get(kind_id):
try:
return _kind_map[kind_id]
except KeyError:
raise VMCMDErrors(f"Invalid Voicemeeter kind: {kind_id}")
all = list(_kind_map.values())