mirror of
https://github.com/onyx-and-iris/xair-api-python.git
synced 2025-04-20 12:13:53 +01:00
Compare commits
No commits in common. "9c1fa36aed9146d5961ae7916639f10d92321d53" and "764195a4521b2e0638eb3b21ee711e047752c478" have entirely different histories.
9c1fa36aed
...
764195a452
10
CHANGELOG.md
10
CHANGELOG.md
@ -11,16 +11,6 @@ Before any major/minor/patch bump all unit tests will be run to verify they pass
|
|||||||
|
|
||||||
- [ ]
|
- [ ]
|
||||||
|
|
||||||
## [2.3.1] - 2024-02-15
|
|
||||||
|
|
||||||
### Changed
|
|
||||||
|
|
||||||
- Module level loggers implemented
|
|
||||||
- class loggers are now child loggers
|
|
||||||
- Passing an incorrect kind_id to the entry point now raises an XAirRemoteError.
|
|
||||||
- Passing a value out of bounds to a setter now logs a warning instead of raising an exception.
|
|
||||||
- Send class added to README.
|
|
||||||
|
|
||||||
## [2.2.4] - 2024-02-14
|
## [2.2.4] - 2024-02-14
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
|
12
README.md
12
README.md
@ -121,7 +121,7 @@ Contains the subclasses:
|
|||||||
### `Strip`
|
### `Strip`
|
||||||
|
|
||||||
Contains the subclasses:
|
Contains the subclasses:
|
||||||
(`Config`, `Preamp`, `Gate`, `Dyn`, `Insert`, `GEQ`, `EQ`, `Mix`, `Group`, `Automix`, `Send`)
|
(`Config`, `Preamp`, `Gate`, `Dyn`, `Insert`, `GEQ`, `EQ`, `Mix`, `Group`, `Automix`)
|
||||||
|
|
||||||
### `Bus`
|
### `Bus`
|
||||||
|
|
||||||
@ -136,12 +136,12 @@ Contains the subclasses:
|
|||||||
### `FXRtn`
|
### `FXRtn`
|
||||||
|
|
||||||
Contains the subclasses:
|
Contains the subclasses:
|
||||||
(`Config`, `Preamp`, `EQ`, `Mix`, `Group`, `Send`)
|
(`Config`, `Preamp`, `EQ`, `Mix`, `Group`)
|
||||||
|
|
||||||
### `AuxRtn`
|
### `AuxRtn`
|
||||||
|
|
||||||
Contains the subclasses:
|
Contains the subclasses:
|
||||||
(`Config`, `Preamp`, `EQ`, `Mix`, `Group`, `Send`)
|
(`Config`, `Preamp`, `EQ`, `Mix`, `Group`)
|
||||||
|
|
||||||
### `Subclasses`
|
### `Subclasses`
|
||||||
|
|
||||||
@ -288,12 +288,6 @@ tuple containing a class for each mute group
|
|||||||
|
|
||||||
for example: `config.mute_group[0].on = True`
|
for example: `config.mute_group[0].on = True`
|
||||||
|
|
||||||
### `Send`
|
|
||||||
|
|
||||||
- `level`: float, -inf to 10.0
|
|
||||||
|
|
||||||
for example: `mixer.strip[10].send[3].level = -16.5`
|
|
||||||
|
|
||||||
### XAirRemote class (lower level)
|
### XAirRemote class (lower level)
|
||||||
|
|
||||||
Send an OSC command directly to the mixer
|
Send an OSC command directly to the mixer
|
||||||
|
57
poetry.lock
generated
57
poetry.lock
generated
@ -1,5 +1,22 @@
|
|||||||
# This file is automatically @generated by Poetry 1.5.1 and should not be changed by hand.
|
# This file is automatically @generated by Poetry 1.5.1 and should not be changed by hand.
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "attrs"
|
||||||
|
version = "22.1.0"
|
||||||
|
description = "Classes Without Boilerplate"
|
||||||
|
optional = false
|
||||||
|
python-versions = ">=3.5"
|
||||||
|
files = [
|
||||||
|
{file = "attrs-22.1.0-py2.py3-none-any.whl", hash = "sha256:86efa402f67bf2df34f51a335487cf46b1ec130d02b8d39fd248abfd30da551c"},
|
||||||
|
{file = "attrs-22.1.0.tar.gz", hash = "sha256:29adc2665447e5191d0e7c568fde78b21f9672d344281d0c6e1ab085429b22b6"},
|
||||||
|
]
|
||||||
|
|
||||||
|
[package.extras]
|
||||||
|
dev = ["cloudpickle", "coverage[toml] (>=5.0.2)", "furo", "hypothesis", "mypy (>=0.900,!=0.940)", "pre-commit", "pympler", "pytest (>=4.3.0)", "pytest-mypy-plugins", "sphinx", "sphinx-notfound-page", "zope.interface"]
|
||||||
|
docs = ["furo", "sphinx", "sphinx-notfound-page", "zope.interface"]
|
||||||
|
tests = ["cloudpickle", "coverage[toml] (>=5.0.2)", "hypothesis", "mypy (>=0.900,!=0.940)", "pympler", "pytest (>=4.3.0)", "pytest-mypy-plugins", "zope.interface"]
|
||||||
|
tests-no-zope = ["cloudpickle", "coverage[toml] (>=5.0.2)", "hypothesis", "mypy (>=0.900,!=0.940)", "pympler", "pytest (>=4.3.0)", "pytest-mypy-plugins"]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "black"
|
name = "black"
|
||||||
version = "22.8.0"
|
version = "22.8.0"
|
||||||
@ -70,20 +87,6 @@ files = [
|
|||||||
{file = "colorama-0.4.5.tar.gz", hash = "sha256:e6c6b4334fc50988a639d9b98aa429a0b57da6e17b9a44f0451f930b6967b7a4"},
|
{file = "colorama-0.4.5.tar.gz", hash = "sha256:e6c6b4334fc50988a639d9b98aa429a0b57da6e17b9a44f0451f930b6967b7a4"},
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "exceptiongroup"
|
|
||||||
version = "1.2.0"
|
|
||||||
description = "Backport of PEP 654 (exception groups)"
|
|
||||||
optional = false
|
|
||||||
python-versions = ">=3.7"
|
|
||||||
files = [
|
|
||||||
{file = "exceptiongroup-1.2.0-py3-none-any.whl", hash = "sha256:4bfd3996ac73b41e9b9628b04e079f193850720ea5945fc96a08633c66912f14"},
|
|
||||||
{file = "exceptiongroup-1.2.0.tar.gz", hash = "sha256:91f5c769735f051a4290d52edd0858999b57e5876e9f85937691bd4c9fa3ed68"},
|
|
||||||
]
|
|
||||||
|
|
||||||
[package.extras]
|
|
||||||
test = ["pytest (>=6)"]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "iniconfig"
|
name = "iniconfig"
|
||||||
version = "1.1.1"
|
version = "1.1.1"
|
||||||
@ -178,6 +181,17 @@ files = [
|
|||||||
dev = ["pre-commit", "tox"]
|
dev = ["pre-commit", "tox"]
|
||||||
testing = ["pytest", "pytest-benchmark"]
|
testing = ["pytest", "pytest-benchmark"]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "py"
|
||||||
|
version = "1.11.0"
|
||||||
|
description = "library with cross-python path, ini-parsing, io, code, log facilities"
|
||||||
|
optional = false
|
||||||
|
python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*"
|
||||||
|
files = [
|
||||||
|
{file = "py-1.11.0-py2.py3-none-any.whl", hash = "sha256:607c53218732647dff4acdfcd50cb62615cedf612e72d1724fb1a0cc6405b378"},
|
||||||
|
{file = "py-1.11.0.tar.gz", hash = "sha256:51c75c4126074b472f746a24399ad32f6053d1b34b68d2fa41e558e6f4a98719"},
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "pyparsing"
|
name = "pyparsing"
|
||||||
version = "3.0.9"
|
version = "3.0.9"
|
||||||
@ -194,25 +208,26 @@ diagrams = ["jinja2", "railroad-diagrams"]
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "pytest"
|
name = "pytest"
|
||||||
version = "7.4.4"
|
version = "7.1.3"
|
||||||
description = "pytest: simple powerful testing with Python"
|
description = "pytest: simple powerful testing with Python"
|
||||||
optional = false
|
optional = false
|
||||||
python-versions = ">=3.7"
|
python-versions = ">=3.7"
|
||||||
files = [
|
files = [
|
||||||
{file = "pytest-7.4.4-py3-none-any.whl", hash = "sha256:b090cdf5ed60bf4c45261be03239c2c1c22df034fbffe691abe93cd80cea01d8"},
|
{file = "pytest-7.1.3-py3-none-any.whl", hash = "sha256:1377bda3466d70b55e3f5cecfa55bb7cfcf219c7964629b967c37cf0bda818b7"},
|
||||||
{file = "pytest-7.4.4.tar.gz", hash = "sha256:2cf0005922c6ace4a3e2ec8b4080eb0d9753fdc93107415332f50ce9e7994280"},
|
{file = "pytest-7.1.3.tar.gz", hash = "sha256:4f365fec2dff9c1162f834d9f18af1ba13062db0c708bf7b946f8a5c76180c39"},
|
||||||
]
|
]
|
||||||
|
|
||||||
[package.dependencies]
|
[package.dependencies]
|
||||||
|
attrs = ">=19.2.0"
|
||||||
colorama = {version = "*", markers = "sys_platform == \"win32\""}
|
colorama = {version = "*", markers = "sys_platform == \"win32\""}
|
||||||
exceptiongroup = {version = ">=1.0.0rc8", markers = "python_version < \"3.11\""}
|
|
||||||
iniconfig = "*"
|
iniconfig = "*"
|
||||||
packaging = "*"
|
packaging = "*"
|
||||||
pluggy = ">=0.12,<2.0"
|
pluggy = ">=0.12,<2.0"
|
||||||
tomli = {version = ">=1.0.0", markers = "python_version < \"3.11\""}
|
py = ">=1.8.2"
|
||||||
|
tomli = ">=1.0.0"
|
||||||
|
|
||||||
[package.extras]
|
[package.extras]
|
||||||
testing = ["argcomplete", "attrs (>=19.2.0)", "hypothesis (>=3.56)", "mock", "nose", "pygments (>=2.7.2)", "requests", "setuptools", "xmlschema"]
|
testing = ["argcomplete", "hypothesis (>=3.56)", "mock", "nose", "pygments (>=2.7.2)", "requests", "xmlschema"]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "pytest-randomly"
|
name = "pytest-randomly"
|
||||||
@ -253,4 +268,4 @@ files = [
|
|||||||
[metadata]
|
[metadata]
|
||||||
lock-version = "2.0"
|
lock-version = "2.0"
|
||||||
python-versions = "^3.10"
|
python-versions = "^3.10"
|
||||||
content-hash = "0264ddbe13d88918bc21cd41f856b7d88845dbe74891f3d7dc7d72bd85850f94"
|
content-hash = "def96d1658f870a9820fef363ee6a04455f1d895e15a189ea4f39801f168552f"
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
[tool.poetry]
|
[tool.poetry]
|
||||||
name = "xair-api"
|
name = "xair-api"
|
||||||
version = "2.3.1"
|
version = "2.2.5"
|
||||||
description = "Remote control Behringer X-Air | Midas MR mixers through OSC"
|
description = "Remote control Behringer X-Air | Midas MR mixers through OSC"
|
||||||
authors = ["onyx-and-iris <code@onyxandiris.online>"]
|
authors = ["onyx-and-iris <code@onyxandiris.online>"]
|
||||||
license = "MIT"
|
license = "MIT"
|
||||||
@ -13,7 +13,7 @@ python-osc = "^1.8.0"
|
|||||||
tomli = { version = "^2.0.1", python = "<3.11" }
|
tomli = { version = "^2.0.1", python = "<3.11" }
|
||||||
|
|
||||||
[tool.poetry.group.dev.dependencies]
|
[tool.poetry.group.dev.dependencies]
|
||||||
pytest = "^7.4.4"
|
pytest = "^7.1.2"
|
||||||
pytest-randomly = "^3.12.0"
|
pytest-randomly = "^3.12.0"
|
||||||
black = "^22.6.0"
|
black = "^22.6.0"
|
||||||
isort = "^5.10.1"
|
isort = "^5.10.1"
|
||||||
|
@ -1,11 +1,8 @@
|
|||||||
import abc
|
import abc
|
||||||
import logging
|
|
||||||
|
|
||||||
from .meta import mute_prop
|
from .meta import mute_prop
|
||||||
from .shared import EQ, GEQ, Config, Dyn, Group, Insert, Mix
|
from .shared import EQ, GEQ, Config, Dyn, Group, Insert, Mix
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
|
||||||
|
|
||||||
|
|
||||||
class IBus(abc.ABC):
|
class IBus(abc.ABC):
|
||||||
"""Abstract Base Class for buses"""
|
"""Abstract Base Class for buses"""
|
||||||
@ -13,7 +10,6 @@ class IBus(abc.ABC):
|
|||||||
def __init__(self, remote, index: int):
|
def __init__(self, remote, index: int):
|
||||||
self._remote = remote
|
self._remote = remote
|
||||||
self.index = index + 1
|
self.index = index + 1
|
||||||
self.logger = logger.getChild(self.__class__.__name__)
|
|
||||||
|
|
||||||
def getter(self, param: str):
|
def getter(self, param: str):
|
||||||
return self._remote.query(f"{self.address}/{param}")
|
return self._remote.query(f"{self.address}/{param}")
|
||||||
|
@ -1,18 +1,15 @@
|
|||||||
import abc
|
import abc
|
||||||
import logging
|
|
||||||
|
|
||||||
from . import kinds, util
|
from . import kinds, util
|
||||||
|
from .errors import XAirRemoteError
|
||||||
from .meta import bool_prop
|
from .meta import bool_prop
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
|
||||||
|
|
||||||
|
|
||||||
class IConfig(abc.ABC):
|
class IConfig(abc.ABC):
|
||||||
"""Abstract Base Class for config"""
|
"""Abstract Base Class for config"""
|
||||||
|
|
||||||
def __init__(self, remote):
|
def __init__(self, remote):
|
||||||
self._remote = remote
|
self._remote = remote
|
||||||
self.logger = logger.getChild(self.__class__.__name__)
|
|
||||||
|
|
||||||
def getter(self, param: str):
|
def getter(self, param: str):
|
||||||
return self._remote.query(f"{self.address}/{param}")
|
return self._remote.query(f"{self.address}/{param}")
|
||||||
@ -117,9 +114,7 @@ class Config(IConfig):
|
|||||||
@sourcetrim.setter
|
@sourcetrim.setter
|
||||||
def sourcetrim(self, val: float):
|
def sourcetrim(self, val: float):
|
||||||
if not -18 <= val <= 18:
|
if not -18 <= val <= 18:
|
||||||
self.logger.warning(
|
raise XAirRemoteError("expected value in range -18.0 to 18.0")
|
||||||
f"sourcetrim got {val}, expected value in range -18.0 to 18.0"
|
|
||||||
)
|
|
||||||
self.setter("sourcetrim", util.lin_set(-18, 18, val))
|
self.setter("sourcetrim", util.lin_set(-18, 18, val))
|
||||||
|
|
||||||
@property
|
@property
|
||||||
@ -145,9 +140,7 @@ class Config(IConfig):
|
|||||||
@dimgain.setter
|
@dimgain.setter
|
||||||
def dimgain(self, val: int):
|
def dimgain(self, val: int):
|
||||||
if not -40 <= val <= 0:
|
if not -40 <= val <= 0:
|
||||||
self.logger.warning(
|
raise XAirRemoteError("expected value in range -40 to 0")
|
||||||
f"dimgain got {val}, expected value in range -40 to 0"
|
|
||||||
)
|
|
||||||
self.setter("dimatt", util.lin_set(-40, 0, val))
|
self.setter("dimatt", util.lin_set(-40, 0, val))
|
||||||
|
|
||||||
@property
|
@property
|
||||||
|
@ -1,7 +1,4 @@
|
|||||||
import abc
|
import abc
|
||||||
import logging
|
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
|
||||||
|
|
||||||
|
|
||||||
class IDCA(abc.ABC):
|
class IDCA(abc.ABC):
|
||||||
@ -10,7 +7,6 @@ class IDCA(abc.ABC):
|
|||||||
def __init__(self, remote, index: int):
|
def __init__(self, remote, index: int):
|
||||||
self._remote = remote
|
self._remote = remote
|
||||||
self.index = index + 1
|
self.index = index + 1
|
||||||
self.logger = logger.getChild(self.__class__.__name__)
|
|
||||||
|
|
||||||
def getter(self, param: str) -> tuple:
|
def getter(self, param: str) -> tuple:
|
||||||
return self._remote.query(f"{self.address}/{param}")
|
return self._remote.query(f"{self.address}/{param}")
|
||||||
|
@ -1,11 +1,8 @@
|
|||||||
import abc
|
import abc
|
||||||
import logging
|
|
||||||
|
|
||||||
from .meta import mute_prop
|
from .meta import mute_prop
|
||||||
from .shared import Config, Group, Mix
|
from .shared import Config, Group, Mix
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
|
||||||
|
|
||||||
|
|
||||||
class IFX(abc.ABC):
|
class IFX(abc.ABC):
|
||||||
"""Abstract Base Class for fxs"""
|
"""Abstract Base Class for fxs"""
|
||||||
@ -13,7 +10,6 @@ class IFX(abc.ABC):
|
|||||||
def __init__(self, remote, index: int):
|
def __init__(self, remote, index: int):
|
||||||
self._remote = remote
|
self._remote = remote
|
||||||
self.index = index + 1
|
self.index = index + 1
|
||||||
self.logger = logger.getChild(self.__class__.__name__)
|
|
||||||
|
|
||||||
def getter(self, param: str):
|
def getter(self, param: str):
|
||||||
return self._remote.query(f"{self.address}/{param}")
|
return self._remote.query(f"{self.address}/{param}")
|
||||||
|
@ -1,12 +1,9 @@
|
|||||||
import abc
|
import abc
|
||||||
import logging
|
|
||||||
from typing import Optional
|
from typing import Optional
|
||||||
|
|
||||||
from .meta import mute_prop
|
from .meta import mute_prop
|
||||||
from .shared import EQ, GEQ, Config, Dyn, Insert, Mix
|
from .shared import EQ, GEQ, Config, Dyn, Insert, Mix
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
|
||||||
|
|
||||||
|
|
||||||
class ILR(abc.ABC):
|
class ILR(abc.ABC):
|
||||||
"""Abstract Base Class for lr"""
|
"""Abstract Base Class for lr"""
|
||||||
@ -15,7 +12,6 @@ class ILR(abc.ABC):
|
|||||||
self._remote = remote
|
self._remote = remote
|
||||||
if index is not None:
|
if index is not None:
|
||||||
self.index = index + 1
|
self.index = index + 1
|
||||||
self.logger = logger.getChild(self.__class__.__name__)
|
|
||||||
|
|
||||||
def getter(self, param: str):
|
def getter(self, param: str):
|
||||||
return self._remote.query(f"{self.address}/{param}")
|
return self._remote.query(f"{self.address}/{param}")
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
from .errors import XAirRemoteError
|
||||||
from .util import lin_get, lin_set
|
from .util import lin_get, lin_set
|
||||||
|
|
||||||
|
|
||||||
@ -57,9 +58,7 @@ def geq_prop(param):
|
|||||||
|
|
||||||
def fset(self, val):
|
def fset(self, val):
|
||||||
if not -15 <= val <= 15:
|
if not -15 <= val <= 15:
|
||||||
self.logger.warning(
|
raise XAirRemoteError("expected value in range -15.0 to 15.0")
|
||||||
f"slider_{param} got {val}, expected value in range -15.0 to 15.0"
|
|
||||||
)
|
|
||||||
self.setter(param, lin_set(-15, 15, val))
|
self.setter(param, lin_set(-15, 15, val))
|
||||||
|
|
||||||
return property(fget, fset)
|
return property(fget, fset)
|
||||||
|
@ -1,12 +1,9 @@
|
|||||||
import abc
|
import abc
|
||||||
import logging
|
|
||||||
from typing import Optional
|
from typing import Optional
|
||||||
|
|
||||||
from .meta import mute_prop
|
from .meta import mute_prop
|
||||||
from .shared import EQ, Config, Group, Mix, Preamp, Send
|
from .shared import EQ, Config, Group, Mix, Preamp, Send
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
|
||||||
|
|
||||||
|
|
||||||
class IRtn(abc.ABC):
|
class IRtn(abc.ABC):
|
||||||
"""Abstract Base Class for rtn"""
|
"""Abstract Base Class for rtn"""
|
||||||
@ -15,7 +12,6 @@ class IRtn(abc.ABC):
|
|||||||
self._remote = remote
|
self._remote = remote
|
||||||
if index is not None:
|
if index is not None:
|
||||||
self.index = index + 1
|
self.index = index + 1
|
||||||
self.logger = logger.getChild(self.__class__.__name__)
|
|
||||||
|
|
||||||
def getter(self, param: str):
|
def getter(self, param: str):
|
||||||
return self._remote.query(f"{self.address}/{param}")
|
return self._remote.query(f"{self.address}/{param}")
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
from typing import Optional, Union
|
from typing import Optional, Union
|
||||||
|
|
||||||
from . import util
|
from . import util
|
||||||
|
from .errors import XAirRemoteError
|
||||||
from .meta import geq_prop
|
from .meta import geq_prop
|
||||||
|
|
||||||
"""
|
"""
|
||||||
@ -60,9 +61,7 @@ class Preamp:
|
|||||||
@usbtrim.setter
|
@usbtrim.setter
|
||||||
def usbtrim(self, val: float):
|
def usbtrim(self, val: float):
|
||||||
if not -18 <= val <= 18:
|
if not -18 <= val <= 18:
|
||||||
self.logger.warning(
|
raise XAirRemoteError("expected value in range -18.0 to 18.0")
|
||||||
f"usbtrim got {val}, expected value in range -18.0 to 18.0"
|
|
||||||
)
|
|
||||||
self.setter("rtntrim", util.lin_set(-18, 18, val))
|
self.setter("rtntrim", util.lin_set(-18, 18, val))
|
||||||
|
|
||||||
@property
|
@property
|
||||||
@ -96,9 +95,7 @@ class Preamp:
|
|||||||
@highpassfilter.setter
|
@highpassfilter.setter
|
||||||
def highpassfilter(self, val: int):
|
def highpassfilter(self, val: int):
|
||||||
if not 20 <= val <= 400:
|
if not 20 <= val <= 400:
|
||||||
self.logger.warning(
|
raise XAirRemoteError("expected value in range 20 to 400")
|
||||||
f"highpassfilter got {val}, expected value in range 20 to 400"
|
|
||||||
)
|
|
||||||
self.setter("hpf", util.log_set(20, 400, val))
|
self.setter("hpf", util.log_set(20, 400, val))
|
||||||
|
|
||||||
|
|
||||||
@ -125,7 +122,7 @@ class Gate:
|
|||||||
def mode(self, val: str):
|
def mode(self, val: str):
|
||||||
opts = ("gate", "exp2", "exp3", "exp4", "duck")
|
opts = ("gate", "exp2", "exp3", "exp4", "duck")
|
||||||
if val not in opts:
|
if val not in opts:
|
||||||
self.logger.warning(f"mode got {val}, expected one of {opts}")
|
raise XAirRemoteError(f"expected one of {opts}")
|
||||||
self.setter("mode", opts.index(val))
|
self.setter("mode", opts.index(val))
|
||||||
|
|
||||||
@property
|
@property
|
||||||
@ -135,9 +132,7 @@ class Gate:
|
|||||||
@threshold.setter
|
@threshold.setter
|
||||||
def threshold(self, val: float):
|
def threshold(self, val: float):
|
||||||
if not -80 <= val <= 0:
|
if not -80 <= val <= 0:
|
||||||
self.logger.warning(
|
raise XAirRemoteError("expected value in range -80.0 to 0.0")
|
||||||
f"threshold got {val}, expected value in range -80.0 to 0.0"
|
|
||||||
)
|
|
||||||
self.setter("thr", util.lin_set(-80, 0, val))
|
self.setter("thr", util.lin_set(-80, 0, val))
|
||||||
|
|
||||||
@property
|
@property
|
||||||
@ -147,7 +142,7 @@ class Gate:
|
|||||||
@range.setter
|
@range.setter
|
||||||
def range(self, val: int):
|
def range(self, val: int):
|
||||||
if not 3 <= val <= 60:
|
if not 3 <= val <= 60:
|
||||||
self.logger.warning(f"range got {val}, expected value in range 3 to 60")
|
raise XAirRemoteError("expected value in range 3 to 60")
|
||||||
self.setter("range", util.lin_set(3, 60, val))
|
self.setter("range", util.lin_set(3, 60, val))
|
||||||
|
|
||||||
@property
|
@property
|
||||||
@ -157,7 +152,7 @@ class Gate:
|
|||||||
@attack.setter
|
@attack.setter
|
||||||
def attack(self, val: int):
|
def attack(self, val: int):
|
||||||
if not 0 <= val <= 120:
|
if not 0 <= val <= 120:
|
||||||
self.logger.warning(f"attack got {val}, expected value in range 0 to 120")
|
raise XAirRemoteError("expected value in range 0 to 120")
|
||||||
self.setter("attack", util.lin_set(0, 120, val))
|
self.setter("attack", util.lin_set(0, 120, val))
|
||||||
|
|
||||||
@property
|
@property
|
||||||
@ -168,9 +163,7 @@ class Gate:
|
|||||||
@hold.setter
|
@hold.setter
|
||||||
def hold(self, val: float):
|
def hold(self, val: float):
|
||||||
if not 0.02 <= val <= 2000:
|
if not 0.02 <= val <= 2000:
|
||||||
self.logger.warning(
|
raise XAirRemoteError("expected value in range 0.02 to 2000.0")
|
||||||
f"hold got {val}, expected value in range 0.02 to 2000.0"
|
|
||||||
)
|
|
||||||
self.setter("hold", util.log_set(0.02, 2000, val))
|
self.setter("hold", util.log_set(0.02, 2000, val))
|
||||||
|
|
||||||
@property
|
@property
|
||||||
@ -180,7 +173,7 @@ class Gate:
|
|||||||
@release.setter
|
@release.setter
|
||||||
def release(self, val: int):
|
def release(self, val: int):
|
||||||
if not 5 <= val <= 4000:
|
if not 5 <= val <= 4000:
|
||||||
self.logger.warning(f"release got {val}, expected value in range 5 to 4000")
|
raise XAirRemoteError("expected value in range 5 to 4000")
|
||||||
self.setter("release", util.log_set(5, 4000, val))
|
self.setter("release", util.log_set(5, 4000, val))
|
||||||
|
|
||||||
@property
|
@property
|
||||||
@ -215,9 +208,7 @@ class Gate:
|
|||||||
@filterfreq.setter
|
@filterfreq.setter
|
||||||
def filterfreq(self, val: Union[float, int]):
|
def filterfreq(self, val: Union[float, int]):
|
||||||
if not 20 <= val <= 20000:
|
if not 20 <= val <= 20000:
|
||||||
self.logger.warning(
|
raise XAirRemoteError("expected value in range 20 to 20000")
|
||||||
f"filterfreq got {val}, expected value in range 20 to 20000"
|
|
||||||
)
|
|
||||||
self.setter("filter/f", util.log_set(20, 20000, val))
|
self.setter("filter/f", util.log_set(20, 20000, val))
|
||||||
|
|
||||||
|
|
||||||
@ -244,7 +235,7 @@ class Dyn:
|
|||||||
def mode(self, val: str):
|
def mode(self, val: str):
|
||||||
opts = ("comp", "exp")
|
opts = ("comp", "exp")
|
||||||
if val not in opts:
|
if val not in opts:
|
||||||
self.logger.warning(f"mode got {val}, expected one of {opts}")
|
raise XAirRemoteError(f"expected one of {opts}")
|
||||||
self.setter("mode", opts.index(val))
|
self.setter("mode", opts.index(val))
|
||||||
|
|
||||||
@property
|
@property
|
||||||
@ -256,7 +247,7 @@ class Dyn:
|
|||||||
def det(self, val: str):
|
def det(self, val: str):
|
||||||
opts = ("peak", "rms")
|
opts = ("peak", "rms")
|
||||||
if val not in opts:
|
if val not in opts:
|
||||||
self.logger.warning(f"det got {val}, expected one of {opts}")
|
raise XAirRemoteError(f"expected one of {opts}")
|
||||||
self.setter("det", opts.index(val))
|
self.setter("det", opts.index(val))
|
||||||
|
|
||||||
@property
|
@property
|
||||||
@ -268,7 +259,7 @@ class Dyn:
|
|||||||
def env(self, val: str):
|
def env(self, val: str):
|
||||||
opts = ("lin", "log")
|
opts = ("lin", "log")
|
||||||
if val not in opts:
|
if val not in opts:
|
||||||
self.logger.warning(f"env got {val}, expected one of {opts}")
|
raise XAirRemoteError(f"expected one of {opts}")
|
||||||
self.setter("env", opts.index(val))
|
self.setter("env", opts.index(val))
|
||||||
|
|
||||||
@property
|
@property
|
||||||
@ -278,9 +269,7 @@ class Dyn:
|
|||||||
@threshold.setter
|
@threshold.setter
|
||||||
def threshold(self, val: float):
|
def threshold(self, val: float):
|
||||||
if not -60 <= val <= 0:
|
if not -60 <= val <= 0:
|
||||||
self.logger.warning(
|
raise XAirRemoteError("expected value in range -60.0 to 0")
|
||||||
f"threshold got {val}, expected value in range -60.0 to 0"
|
|
||||||
)
|
|
||||||
self.setter("thr", util.lin_set(-60, 0, val))
|
self.setter("thr", util.lin_set(-60, 0, val))
|
||||||
|
|
||||||
@property
|
@property
|
||||||
@ -299,7 +288,7 @@ class Dyn:
|
|||||||
@knee.setter
|
@knee.setter
|
||||||
def knee(self, val: int):
|
def knee(self, val: int):
|
||||||
if not 0 <= val <= 5:
|
if not 0 <= val <= 5:
|
||||||
self.logger.warning(f"knee got {val}, expected value in range 0 to 5")
|
raise XAirRemoteError("expected value in range 0 to 5")
|
||||||
self.setter("knee", util.lin_set(0, 5, val))
|
self.setter("knee", util.lin_set(0, 5, val))
|
||||||
|
|
||||||
@property
|
@property
|
||||||
@ -309,7 +298,7 @@ class Dyn:
|
|||||||
@mgain.setter
|
@mgain.setter
|
||||||
def mgain(self, val: float):
|
def mgain(self, val: float):
|
||||||
if not 0 <= val <= 24:
|
if not 0 <= val <= 24:
|
||||||
self.logger.warning(f"mgain got {val}, expected value in range 0.0 to 24.0")
|
raise XAirRemoteError("expected value in range 0.0 to 24.0")
|
||||||
self.setter("mgain", util.lin_set(0, 24, val))
|
self.setter("mgain", util.lin_set(0, 24, val))
|
||||||
|
|
||||||
@property
|
@property
|
||||||
@ -319,7 +308,7 @@ class Dyn:
|
|||||||
@attack.setter
|
@attack.setter
|
||||||
def attack(self, val: int):
|
def attack(self, val: int):
|
||||||
if not 0 <= val <= 120:
|
if not 0 <= val <= 120:
|
||||||
self.logger.warning(f"attack got {val}, expected value in range 0 to 120")
|
raise XAirRemoteError("expected value in range 0 to 120")
|
||||||
self.setter("attack", util.lin_set(0, 120, val))
|
self.setter("attack", util.lin_set(0, 120, val))
|
||||||
|
|
||||||
@property
|
@property
|
||||||
@ -330,9 +319,7 @@ class Dyn:
|
|||||||
@hold.setter
|
@hold.setter
|
||||||
def hold(self, val: float):
|
def hold(self, val: float):
|
||||||
if not 0.02 <= val <= 2000:
|
if not 0.02 <= val <= 2000:
|
||||||
self.logger.warning(
|
raise XAirRemoteError("expected value in range 0.02 to 2000.0")
|
||||||
f"hold got {val}, expected value in range 0.02 to 2000.0"
|
|
||||||
)
|
|
||||||
self.setter("hold", util.log_set(0.02, 2000, val))
|
self.setter("hold", util.log_set(0.02, 2000, val))
|
||||||
|
|
||||||
@property
|
@property
|
||||||
@ -342,7 +329,7 @@ class Dyn:
|
|||||||
@release.setter
|
@release.setter
|
||||||
def release(self, val: int):
|
def release(self, val: int):
|
||||||
if not 5 <= val <= 4000:
|
if not 5 <= val <= 4000:
|
||||||
self.logger.warning(f"release got {val}, expected value in range 5 to 4000")
|
raise XAirRemoteError("expected value in range 5 to 4000")
|
||||||
self.setter("release", util.log_set(5, 4000, val))
|
self.setter("release", util.log_set(5, 4000, val))
|
||||||
|
|
||||||
@property
|
@property
|
||||||
@ -352,7 +339,7 @@ class Dyn:
|
|||||||
@mix.setter
|
@mix.setter
|
||||||
def mix(self, val: int):
|
def mix(self, val: int):
|
||||||
if not 0 <= val <= 100:
|
if not 0 <= val <= 100:
|
||||||
self.logger.warning(f"mix got {val}, expected value in range 0 to 100")
|
raise XAirRemoteError("expected value in range 0 to 100")
|
||||||
self.setter("mix", util.lin_set(0, 100, val))
|
self.setter("mix", util.lin_set(0, 100, val))
|
||||||
|
|
||||||
@property
|
@property
|
||||||
@ -395,9 +382,7 @@ class Dyn:
|
|||||||
@filterfreq.setter
|
@filterfreq.setter
|
||||||
def filterfreq(self, val: Union[float, int]):
|
def filterfreq(self, val: Union[float, int]):
|
||||||
if not 20 <= val <= 20000:
|
if not 20 <= val <= 20000:
|
||||||
self.logger.warning(
|
raise XAirRemoteError("expected value in range 20 to 20000")
|
||||||
f"filterfreq got {val}, expected value in range 20 to 20000"
|
|
||||||
)
|
|
||||||
self.setter("filter/f", util.log_set(20, 20000, val))
|
self.setter("filter/f", util.log_set(20, 20000, val))
|
||||||
|
|
||||||
|
|
||||||
@ -477,7 +462,7 @@ class EQ:
|
|||||||
def mode(self, val: str):
|
def mode(self, val: str):
|
||||||
opts = ("peq", "geq", "teq")
|
opts = ("peq", "geq", "teq")
|
||||||
if val not in opts:
|
if val not in opts:
|
||||||
self.logger.warning(f"mode got {val}, expected one of {opts}")
|
raise XAirRemoteError(f"expected one of {opts}")
|
||||||
self.setter("mode", opts.index(val))
|
self.setter("mode", opts.index(val))
|
||||||
|
|
||||||
class EQBand:
|
class EQBand:
|
||||||
@ -506,9 +491,7 @@ class EQ:
|
|||||||
@frequency.setter
|
@frequency.setter
|
||||||
def frequency(self, val: float):
|
def frequency(self, val: float):
|
||||||
if not 20 <= val <= 20000:
|
if not 20 <= val <= 20000:
|
||||||
self.logger.warning(
|
raise XAirRemoteError("expected value in range 20.0 to 20000.0")
|
||||||
f"frequency got {val}, expected value in range 20.0 to 20000.0"
|
|
||||||
)
|
|
||||||
self.setter("f", util.log_set(20, 20000, val))
|
self.setter("f", util.log_set(20, 20000, val))
|
||||||
|
|
||||||
@property
|
@property
|
||||||
@ -518,9 +501,7 @@ class EQ:
|
|||||||
@gain.setter
|
@gain.setter
|
||||||
def gain(self, val: float):
|
def gain(self, val: float):
|
||||||
if not -15 <= val <= 15:
|
if not -15 <= val <= 15:
|
||||||
self.logger.warning(
|
raise XAirRemoteError("expected value in range -15.0 to 15.0")
|
||||||
f"gain got {val}, expected value in range -15.0 to 15.0"
|
|
||||||
)
|
|
||||||
self.setter("g", util.lin_set(-15, 15, val))
|
self.setter("g", util.lin_set(-15, 15, val))
|
||||||
|
|
||||||
@property
|
@property
|
||||||
@ -531,9 +512,7 @@ class EQ:
|
|||||||
@quality.setter
|
@quality.setter
|
||||||
def quality(self, val: float):
|
def quality(self, val: float):
|
||||||
if not 0.3 <= val <= 10:
|
if not 0.3 <= val <= 10:
|
||||||
self.logger.warning(
|
raise XAirRemoteError("expected value in range 0.3 to 10.0")
|
||||||
f"quality got {val}, expected value in range 0.3 to 10.0"
|
|
||||||
)
|
|
||||||
self.setter("q", util.log_set(0.3, 10, val))
|
self.setter("q", util.log_set(0.3, 10, val))
|
||||||
|
|
||||||
|
|
||||||
@ -641,9 +620,7 @@ class Automix:
|
|||||||
@weight.setter
|
@weight.setter
|
||||||
def weight(self, val: float):
|
def weight(self, val: float):
|
||||||
if not -12 <= val <= 12:
|
if not -12 <= val <= 12:
|
||||||
self.logger.warning(
|
raise XAirRemoteError("expected value in range -12.0 to 12.0")
|
||||||
f"weight got {val}, expected value in range -12.0 to 12.0"
|
|
||||||
)
|
|
||||||
self.setter("weight", util.lin_set(-12, 12, val))
|
self.setter("weight", util.lin_set(-12, 12, val))
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,11 +1,8 @@
|
|||||||
import abc
|
import abc
|
||||||
import logging
|
|
||||||
|
|
||||||
from .meta import mute_prop
|
from .meta import mute_prop
|
||||||
from .shared import EQ, Automix, Config, Dyn, Gate, Group, Insert, Mix, Preamp, Send
|
from .shared import EQ, Automix, Config, Dyn, Gate, Group, Insert, Mix, Preamp, Send
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
|
||||||
|
|
||||||
|
|
||||||
class IStrip(abc.ABC):
|
class IStrip(abc.ABC):
|
||||||
"""Abstract Base Class for strips"""
|
"""Abstract Base Class for strips"""
|
||||||
@ -13,7 +10,6 @@ class IStrip(abc.ABC):
|
|||||||
def __init__(self, remote, index: int):
|
def __init__(self, remote, index: int):
|
||||||
self._remote = remote
|
self._remote = remote
|
||||||
self.index = index + 1
|
self.index = index + 1
|
||||||
self.logger = logger.getChild(self.__class__.__name__)
|
|
||||||
|
|
||||||
def getter(self, param: str) -> tuple:
|
def getter(self, param: str) -> tuple:
|
||||||
return self._remote.query(f"{self.address}/{param}")
|
return self._remote.query(f"{self.address}/{param}")
|
||||||
|
@ -25,8 +25,6 @@ from .lr import LR
|
|||||||
from .rtn import AuxRtn, FxRtn
|
from .rtn import AuxRtn, FxRtn
|
||||||
from .strip import Strip
|
from .strip import Strip
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
|
||||||
|
|
||||||
|
|
||||||
class OSCClientServer(BlockingOSCUDPServer):
|
class OSCClientServer(BlockingOSCUDPServer):
|
||||||
def __init__(self, address: str, dispatcher: Dispatcher):
|
def __init__(self, address: str, dispatcher: Dispatcher):
|
||||||
@ -47,6 +45,8 @@ class OSCClientServer(BlockingOSCUDPServer):
|
|||||||
class XAirRemote(abc.ABC):
|
class XAirRemote(abc.ABC):
|
||||||
"""Handles the communication with the mixer via the OSC protocol"""
|
"""Handles the communication with the mixer via the OSC protocol"""
|
||||||
|
|
||||||
|
logger = logging.getLogger("xair.xairremote")
|
||||||
|
|
||||||
_CONNECT_TIMEOUT = 0.5
|
_CONNECT_TIMEOUT = 0.5
|
||||||
|
|
||||||
_info_response = []
|
_info_response = []
|
||||||
@ -57,7 +57,6 @@ class XAirRemote(abc.ABC):
|
|||||||
self.xair_ip = kwargs["ip"] or self._ip_from_toml()
|
self.xair_ip = kwargs["ip"] or self._ip_from_toml()
|
||||||
self.xair_port = kwargs["port"]
|
self.xair_port = kwargs["port"]
|
||||||
self._delay = kwargs["delay"]
|
self._delay = kwargs["delay"]
|
||||||
self.logger = logger.getChild(self.__class__.__name__)
|
|
||||||
if not self.xair_ip:
|
if not self.xair_ip:
|
||||||
raise XAirRemoteError("No valid ip detected")
|
raise XAirRemoteError("No valid ip detected")
|
||||||
self.server = OSCClientServer((self.xair_ip, self.xair_port), dispatcher)
|
self.server = OSCClientServer((self.xair_ip, self.xair_port), dispatcher)
|
||||||
@ -81,7 +80,7 @@ class XAirRemote(abc.ABC):
|
|||||||
raise XAirRemoteError(
|
raise XAirRemoteError(
|
||||||
"Failed to setup OSC connection to mixer. Please check for correct ip address."
|
"Failed to setup OSC connection to mixer. Please check for correct ip address."
|
||||||
)
|
)
|
||||||
self.logger.info(
|
print(
|
||||||
f"Successfully connected to {self.info_response[2]} at {self.info_response[0]}."
|
f"Successfully connected to {self.info_response[2]} at {self.info_response[0]}."
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -175,10 +174,9 @@ def request_remote_obj(kind_id: str, *args, **kwargs) -> XAirRemote:
|
|||||||
|
|
||||||
Returns a reference to an XAirRemote class of a kind
|
Returns a reference to an XAirRemote class of a kind
|
||||||
"""
|
"""
|
||||||
|
|
||||||
XAIRREMOTE_cls = None
|
XAIRREMOTE_cls = None
|
||||||
try:
|
try:
|
||||||
XAIRREMOTE_cls = _remotes[kind_id]
|
XAIRREMOTE_cls = _remotes[kind_id]
|
||||||
except KeyError as e:
|
except ValueError as e:
|
||||||
raise XAirRemoteError(f"Unknown mixer kind '{kind_id}'") from e
|
raise SystemExit(e)
|
||||||
return XAIRREMOTE_cls(*args, **kwargs)
|
return XAIRREMOTE_cls(*args, **kwargs)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user