2022-06-16 14:07:12 +01:00
|
|
|
import random
|
|
|
|
import sys
|
|
|
|
from dataclasses import dataclass
|
|
|
|
|
|
|
|
import voicemeeterlib
|
2023-06-23 04:13:34 +01:00
|
|
|
from voicemeeterlib.kinds import KindId
|
2022-06-16 14:07:12 +01:00
|
|
|
from voicemeeterlib.kinds import request_kind_map as kindmap
|
|
|
|
|
|
|
|
# let's keep things random
|
2023-06-23 04:13:34 +01:00
|
|
|
KIND_ID = random.choice(tuple(kind_id.name.lower() for kind_id in KindId))
|
|
|
|
vm = voicemeeterlib.api(KIND_ID)
|
|
|
|
kind = kindmap(KIND_ID)
|
2022-06-16 14:07:12 +01:00
|
|
|
|
|
|
|
|
|
|
|
@dataclass
|
|
|
|
class Data:
|
|
|
|
"""bounds data to map tests to a kind"""
|
|
|
|
|
|
|
|
name: str = kind.name
|
|
|
|
phys_in: int = kind.ins[0] - 1
|
2022-07-21 23:17:42 +01:00
|
|
|
virt_in: int = kind.ins[0] + kind.ins[-1] - 1
|
2022-06-16 14:07:12 +01:00
|
|
|
phys_out: int = kind.outs[0] - 1
|
2022-07-21 23:17:42 +01:00
|
|
|
virt_out: int = kind.outs[0] + kind.outs[-1] - 1
|
2022-06-16 14:07:12 +01:00
|
|
|
vban_in: int = kind.vban[0] - 1
|
2022-07-21 23:17:42 +01:00
|
|
|
vban_out: int = kind.vban[-1] - 1
|
2022-06-16 14:07:12 +01:00
|
|
|
button_lower: int = 0
|
|
|
|
button_upper: int = 79
|
2022-07-21 23:17:42 +01:00
|
|
|
asio_in: int = kind.asio[0] - 1
|
|
|
|
asio_out: int = kind.asio[-1] - 1
|
|
|
|
insert_lower: int = 0
|
|
|
|
insert_higher: int = kind.insert - 1
|
|
|
|
|
|
|
|
@property
|
|
|
|
def channels(self):
|
|
|
|
return (2 * self.phys_in) + (8 * self.virt_in)
|
2022-06-16 14:07:12 +01:00
|
|
|
|
|
|
|
|
|
|
|
data = Data()
|
|
|
|
|
|
|
|
|
|
|
|
def setup_module():
|
|
|
|
print(f"\nRunning tests for kind [{data.name}]\n", file=sys.stdout)
|
2023-06-23 04:13:34 +01:00
|
|
|
vm.login()
|
|
|
|
vm.command.reset()
|
2022-06-16 14:07:12 +01:00
|
|
|
|
|
|
|
|
|
|
|
def teardown_module():
|
2023-06-23 04:13:34 +01:00
|
|
|
vm.logout()
|