xair-api 2.3.2__py3-none-any.whl → 2.4.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
xair_api/adapter.py CHANGED
@@ -1,4 +1,5 @@
1
1
  from .bus import Bus as IBus
2
+ from .headamp import HeadAmp as IHeadAmp
2
3
  from .lr import LR as ILR
3
4
  from .rtn import AuxRtn as IAuxRtn
4
5
  from .rtn import FxRtn as IFxRtn
@@ -38,3 +39,9 @@ class Matrix(ILR):
38
39
  @property
39
40
  def address(self) -> str:
40
41
  return f"/mtx/{str(self.index).zfill(2)}"
42
+
43
+
44
+ class HeadAmp(IHeadAmp):
45
+ @property
46
+ def address(self):
47
+ return f"/headamp/{str(self.index).zfill(3)}"
xair_api/headamp.py ADDED
@@ -0,0 +1,49 @@
1
+ import abc
2
+ import logging
3
+
4
+ from . import util
5
+
6
+ logger = logging.getLogger(__name__)
7
+
8
+
9
+ class IHeadAmp(abc.ABC):
10
+ """Abstract Base Class for headamps"""
11
+
12
+ def __init__(self, remote, index: int):
13
+ self._remote = remote
14
+ self.index = index + 1
15
+ self.logger = logger.getChild(self.__class__.__name__)
16
+
17
+ def getter(self, param: str):
18
+ return self._remote.query(f"{self.address}/{param}")
19
+
20
+ def setter(self, param: str, val: int):
21
+ self._remote.send(f"{self.address}/{param}", val)
22
+
23
+ @abc.abstractmethod
24
+ def address(self):
25
+ pass
26
+
27
+
28
+ class HeadAmp(IHeadAmp):
29
+ """Concrete class for headamps"""
30
+
31
+ @property
32
+ def address(self):
33
+ return f"/headamp/{str(self.index).zfill(2)}"
34
+
35
+ @property
36
+ def gain(self):
37
+ return round(util.lin_get(-12, 60, self.getter("gain")[0]), 1)
38
+
39
+ @gain.setter
40
+ def gain(self, val):
41
+ self.setter("gain", util.lin_set(-12, 60, val))
42
+
43
+ @property
44
+ def phantom(self):
45
+ return self.getter("phantom")[0] == 1
46
+
47
+ @phantom.setter
48
+ def phantom(self, val):
49
+ self.setter("phantom", 1 if val else 0)
xair_api/kinds.py CHANGED
@@ -16,6 +16,7 @@ class X32KindMap(KindMap):
16
16
  num_fx: int = 8
17
17
  num_auxrtn: int = 8
18
18
  num_matrix: int = 6
19
+ num_headamp: int = 127
19
20
 
20
21
 
21
22
  @dataclass
xair_api/xair.py CHANGED
@@ -20,6 +20,7 @@ from .config import Config
20
20
  from .dca import DCA
21
21
  from .errors import XAirRemoteConnectionTimeoutError, XAirRemoteError
22
22
  from .fx import FX, FXSend
23
+ from .headamp import HeadAmp
23
24
  from .kinds import KindMap
24
25
  from .lr import LR
25
26
  from .rtn import AuxRtn, FxRtn
@@ -134,6 +135,7 @@ def _make_remote(kind: KindMap) -> XAirRemote:
134
135
  self.fxreturn = tuple(adapter.FxRtn.make(self, i) for i in range(kind.num_fx))
135
136
  self.auxin = tuple(adapter.AuxRtn.make(self, i) for i in range(kind.num_auxrtn))
136
137
  self.config = Config.make(self)
138
+ self.headamp = tuple(adapter.HeadAmp(self, i) for i in range(kind.num_headamp))
137
139
 
138
140
  def init_xair(self, *args, **kwargs):
139
141
  defaultkwargs = {
@@ -154,6 +156,7 @@ def _make_remote(kind: KindMap) -> XAirRemote:
154
156
  self.fxreturn = tuple(FxRtn.make(self, i) for i in range(kind.num_fx))
155
157
  self.auxreturn = AuxRtn.make(self)
156
158
  self.config = Config.make(self)
159
+ self.headamp = tuple(HeadAmp(self, i) for i in range(kind.num_strip))
157
160
 
158
161
  if kind.id_ == "X32":
159
162
  return type(
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: xair-api
3
- Version: 2.3.2
3
+ Version: 2.4.0
4
4
  Summary: Remote control Behringer X-Air | Midas MR mixers through OSC
5
5
  Home-page: https://github.com/onyx-and-iris/xair-api-python
6
6
  License: MIT
@@ -11,6 +11,8 @@ Classifier: License :: OSI Approved :: MIT License
11
11
  Classifier: Programming Language :: Python :: 3
12
12
  Classifier: Programming Language :: Python :: 3.10
13
13
  Classifier: Programming Language :: Python :: 3.11
14
+ Classifier: Programming Language :: Python :: 3.12
15
+ Classifier: Programming Language :: Python :: 3.13
14
16
  Requires-Dist: python-osc (>=1.8.0,<2.0.0)
15
17
  Requires-Dist: tomli (>=2.0.1,<3.0.0) ; python_version < "3.11"
16
18
  Project-URL: Repository, https://github.com/onyx-and-iris/xair-api-python
@@ -18,8 +20,7 @@ Description-Content-Type: text/markdown
18
20
 
19
21
  [![PyPI version](https://badge.fury.io/py/xair-api.svg)](https://badge.fury.io/py/xair-api)
20
22
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://github.com/onyx-and-iris/xair-api-python/blob/dev/LICENSE)
21
- [![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
22
- [![Imports: isort](https://img.shields.io/badge/%20imports-isort-%231674b1?style=flat&labelColor=ef8336)](https://pycqa.github.io/isort/)
23
+ [![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)
23
24
  ![Tests Status](./tests/xair/MR18.svg?dummy=8484744)
24
25
 
25
26
  # Xair API
@@ -132,6 +133,10 @@ A class representing auxreturn channel
132
133
 
133
134
  A class representing the main config settings
134
135
 
136
+ `mixer.headamp`
137
+
138
+ A class representing the channel preamps (phantom power/gain).
139
+
135
140
  ### `LR`
136
141
 
137
142
  Contains the subclasses:
@@ -162,6 +167,13 @@ Contains the subclasses:
162
167
  Contains the subclasses:
163
168
  (`Config`, `Preamp`, `EQ`, `Mix`, `Group`, `Send`)
164
169
 
170
+ ### `HeadAmp`
171
+
172
+ The following properties are available:
173
+
174
+ - `gain`: float, from -12.0 to 60.0
175
+ - `phantom`: bool
176
+
165
177
  ### `Subclasses`
166
178
 
167
179
  For each subclass the corresponding properties are available.
@@ -1,20 +1,21 @@
1
1
  xair_api/__init__.py,sha256=na_Zd_yo8E1LCoeWrAPJR68Ygdm5R8RRrlqb-UnWMtA,73
2
- xair_api/adapter.py,sha256=icQXeqrYu6iWOJbke6zXdOzxyhAV__dXKrCnuDbZAUU,797
2
+ xair_api/adapter.py,sha256=ozQZOstdS3uJRYcnp8Qlx4mSNaKzGlFjWqtKRBF0PlA,963
3
3
  xair_api/bus.py,sha256=digswx5ApbLCpF6R7_8OqfvnJ8C9JIFpe8MFxKXbSB0,1771
4
4
  xair_api/config.py,sha256=ditmhP770trYIu7eouw4pU3BgOtXwOB8dearYJbhSuw,5853
5
5
  xair_api/dca.py,sha256=C-wyBqeAi0qr1qrOKefyIWsJwI8ebs2iV83Q2iC67-k,1443
6
6
  xair_api/errors.py,sha256=rfFmAW6QitHe0iB56M48He-qsbvDaKe1_AN_j4-9oUA,411
7
7
  xair_api/fx.py,sha256=AzjgpJSHDCWwWRGCWxeGwwsm8jcxl3fJykprk9cwSUM,1811
8
- xair_api/kinds.py,sha256=ulJJhLpiUuOw5Ir7Q3CQbmAKrd33xq8CIHpAFc5zEdw,1119
8
+ xair_api/headamp.py,sha256=tLV4LB1QmLhpo4S8PdKkvS5NgK96-fisnY1bWN-IM-M,1175
9
+ xair_api/kinds.py,sha256=93VLFEgQwDJ4RdpIuf8T6_qqc6pwYCJGcS47UZdPqj8,1147
9
10
  xair_api/lr.py,sha256=WL5YnDeLeJPxIK5OdTqZQ3s6UEfQ3-onz99OEdi0-mE,1788
10
11
  xair_api/meta.py,sha256=iUWPSP4QcWMW6gyLc5SGDJ49pKZgJrHzFphtL6OFptE,1564
11
12
  xair_api/rtn.py,sha256=lOTGSkxsYpc4usIba-reZSRmfa-7JIr_FTThSw6BdLY,3177
12
13
  xair_api/shared.py,sha256=ABVTgx9sIH9zZLJLKeZBrhdMXj-WGNuggxrqjn8oa3M,19171
13
14
  xair_api/strip.py,sha256=pAFX0Ssq1kC9BghGJhd6ShJ0on16DbkWoickH0jA-Jg,2082
14
15
  xair_api/util.py,sha256=Rd2eGhqIjFe29s-0ffQGzs9p5lXsfCRJ91i6BPEVzxE,2263
15
- xair_api/xair.py,sha256=60ZAZVj0dWmVfcedFtB_rEbv6fnyb-7nP-Z1ltAeqUs,6384
16
- xair_api-2.3.2.dist-info/entry_points.txt,sha256=hlKDU0C0XSGDitHXAvt6YQfmI99p3eJBaoQqEQhpH2U,126
17
- xair_api-2.3.2.dist-info/LICENSE,sha256=m2fbtv9II-iQqimTd4zjgynL5vuEqGXauLSDJZycYIo,1124
18
- xair_api-2.3.2.dist-info/METADATA,sha256=OhG5fjrYkW_wVbEFE6yIbaup5Owe0rz2e1scbLIX2rg,8868
19
- xair_api-2.3.2.dist-info/WHEEL,sha256=Zb28QaM1gQi8f4VCBhsUklF61CTlNYfs9YAZn-TOGFk,88
20
- xair_api-2.3.2.dist-info/RECORD,,
16
+ xair_api/xair.py,sha256=PEdIYT2236cw5I9MUC5quc-6fnzBz8TM7_XVdzKEhFY,6582
17
+ xair_api-2.4.0.dist-info/entry_points.txt,sha256=hlKDU0C0XSGDitHXAvt6YQfmI99p3eJBaoQqEQhpH2U,126
18
+ xair_api-2.4.0.dist-info/LICENSE,sha256=m2fbtv9II-iQqimTd4zjgynL5vuEqGXauLSDJZycYIo,1124
19
+ xair_api-2.4.0.dist-info/METADATA,sha256=VFhEWE1wd6JhynQ2ZDMbnAUOLO0DoxAZtolKFYccquk,9068
20
+ xair_api-2.4.0.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
21
+ xair_api-2.4.0.dist-info/RECORD,,
@@ -1,4 +1,4 @@
1
1
  Wheel-Version: 1.0
2
- Generator: poetry-core 1.6.1
2
+ Generator: poetry-core 1.9.1
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any