mirror of
https://github.com/onyx-and-iris/xair-api-python.git
synced 2026-04-18 13:33:31 +00:00
tests migrated from nose to pytest
fixes #1 config.ini added to gitignore rewording in readme, links to behringer/midas pages added. kinds supported updated. development dependencies updated in setup.py kind maps in kinds module updated kwarg port added (might revert this later) pre-commit.ps1 added for use with git hook mr18 tests badge added to readme
This commit is contained in:
@@ -1,9 +1,23 @@
|
||||
from dataclasses import dataclass
|
||||
|
||||
"""
|
||||
# osc slightly different, interface would need adjusting to support this mixer.
|
||||
|
||||
@dataclass
|
||||
class X32KindMap:
|
||||
id_: str = "X32"
|
||||
num_dca: int = 8
|
||||
num_strip: int = 32
|
||||
num_bus: int = 16
|
||||
num_fx: int = 8
|
||||
num_rtn: int = 6
|
||||
"""
|
||||
|
||||
|
||||
@dataclass
|
||||
class MR18KindMap:
|
||||
id_: str = "MR18"
|
||||
# note ch 17-18 defined as aux rtn
|
||||
id_: str
|
||||
num_dca: int = 4
|
||||
num_strip: int = 16
|
||||
num_bus: int = 6
|
||||
@@ -11,9 +25,36 @@ class MR18KindMap:
|
||||
num_rtn: int = 4
|
||||
|
||||
|
||||
@dataclass
|
||||
class XR16KindMap:
|
||||
id_: str
|
||||
num_dca: int = 4
|
||||
num_strip: int = 16
|
||||
num_bus: int = 4
|
||||
num_fx: int = 4
|
||||
num_rtn: int = 4
|
||||
|
||||
|
||||
@dataclass
|
||||
class XR12KindMap:
|
||||
id_: str
|
||||
num_dca: int = 4
|
||||
num_strip: int = 12
|
||||
num_bus: int = 2
|
||||
num_fx: int = 4
|
||||
num_rtn: int = 4
|
||||
|
||||
|
||||
_kinds = {
|
||||
"XR18": MR18KindMap(),
|
||||
"MR18": MR18KindMap(),
|
||||
"XR18": MR18KindMap(id_="XR18"),
|
||||
"MR18": MR18KindMap(id_="MR18"),
|
||||
"XR16": XR16KindMap(id_="XR16"),
|
||||
"XR12": XR12KindMap(id_="XR12"),
|
||||
}
|
||||
|
||||
|
||||
def get(kind_id):
|
||||
return _kinds[kind_id]
|
||||
|
||||
|
||||
all = list(kind for kind in _kinds.values())
|
||||
|
||||
@@ -54,7 +54,8 @@ class MAirRemote(abc.ABC):
|
||||
dispatcher = Dispatcher()
|
||||
dispatcher.set_default_handler(self.msg_handler)
|
||||
self.xair_ip = kwargs["ip"] or self._ip_from_ini()
|
||||
self.server = OSCClientServer((self.xair_ip, self.XAIR_PORT), dispatcher)
|
||||
self.xair_port = kwargs["port"] or self.XAIR_PORT
|
||||
self.server = OSCClientServer((self.xair_ip, self.xair_port), dispatcher)
|
||||
|
||||
def __enter__(self):
|
||||
self.worker = threading.Thread(target=self.run_server)
|
||||
@@ -107,7 +108,7 @@ def _make_remote(kind: kinds.MR18KindMap) -> MAirRemote:
|
||||
"""
|
||||
|
||||
def init(self, *args, **kwargs):
|
||||
defaultkwargs = {"ip": None}
|
||||
defaultkwargs = {"ip": None, "port": None}
|
||||
kwargs = defaultkwargs | kwargs
|
||||
MAirRemote.__init__(self, *args, **kwargs)
|
||||
self.kind = kind
|
||||
|
||||
Reference in New Issue
Block a user