xair-api 2.3.2__py3-none-any.whl → 2.4.1__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/__init__.py +1 -1
- xair_api/adapter.py +13 -6
- xair_api/bus.py +6 -6
- xair_api/config.py +44 -44
- xair_api/dca.py +9 -9
- xair_api/errors.py +1 -1
- xair_api/fx.py +9 -9
- xair_api/headamp.py +49 -0
- xair_api/kinds.py +14 -15
- xair_api/lr.py +6 -6
- xair_api/meta.py +2 -2
- xair_api/rtn.py +12 -12
- xair_api/shared.py +168 -168
- xair_api/strip.py +7 -7
- xair_api/util.py +1 -1
- xair_api/xair.py +27 -24
- {xair_api-2.3.2.dist-info → xair_api-2.4.1.dist-info}/METADATA +28 -18
- xair_api-2.4.1.dist-info/RECORD +20 -0
- {xair_api-2.3.2.dist-info → xair_api-2.4.1.dist-info}/WHEEL +1 -1
- xair_api-2.3.2.dist-info/RECORD +0 -20
- xair_api-2.3.2.dist-info/entry_points.txt +0 -7
- {xair_api-2.3.2.dist-info → xair_api-2.4.1.dist-info}/LICENSE +0 -0
xair_api/strip.py
CHANGED
|
@@ -16,10 +16,10 @@ class IStrip(abc.ABC):
|
|
|
16
16
|
self.logger = logger.getChild(self.__class__.__name__)
|
|
17
17
|
|
|
18
18
|
def getter(self, param: str) -> tuple:
|
|
19
|
-
return self._remote.query(f
|
|
19
|
+
return self._remote.query(f'{self.address}/{param}')
|
|
20
20
|
|
|
21
21
|
def setter(self, param: str, val: int):
|
|
22
|
-
self._remote.send(f
|
|
22
|
+
self._remote.send(f'{self.address}/{param}', val)
|
|
23
23
|
|
|
24
24
|
@abc.abstractmethod
|
|
25
25
|
def address(self):
|
|
@@ -40,12 +40,12 @@ class Strip(IStrip):
|
|
|
40
40
|
"""
|
|
41
41
|
|
|
42
42
|
STRIP_cls = type(
|
|
43
|
-
f
|
|
43
|
+
f'Strip{remote.kind}',
|
|
44
44
|
(cls,),
|
|
45
45
|
{
|
|
46
46
|
**{
|
|
47
47
|
_cls.__name__.lower(): type(
|
|
48
|
-
f
|
|
48
|
+
f'{_cls.__name__}{remote.kind}', (_cls, cls), {}
|
|
49
49
|
)(remote, index)
|
|
50
50
|
for _cls in (
|
|
51
51
|
Config,
|
|
@@ -59,15 +59,15 @@ class Strip(IStrip):
|
|
|
59
59
|
Automix,
|
|
60
60
|
)
|
|
61
61
|
},
|
|
62
|
-
|
|
62
|
+
'send': tuple(
|
|
63
63
|
Send.make(cls, i, remote, index)
|
|
64
64
|
for i in range(remote.kind.num_bus + remote.kind.num_fx)
|
|
65
65
|
),
|
|
66
|
-
|
|
66
|
+
'mute': mute_prop(),
|
|
67
67
|
},
|
|
68
68
|
)
|
|
69
69
|
return STRIP_cls(remote, index)
|
|
70
70
|
|
|
71
71
|
@property
|
|
72
72
|
def address(self) -> str:
|
|
73
|
-
return f
|
|
73
|
+
return f'/ch/{str(self.index).zfill(2)}'
|
xair_api/util.py
CHANGED
|
@@ -19,7 +19,7 @@ def timeout(func):
|
|
|
19
19
|
while time.time() < start + remote.connect_timeout:
|
|
20
20
|
try:
|
|
21
21
|
func(*args, **kwargs)
|
|
22
|
-
remote.logger.debug(f
|
|
22
|
+
remote.logger.debug(f'login time: {round(time.time() - start, 2)}')
|
|
23
23
|
err = None
|
|
24
24
|
break
|
|
25
25
|
except XAirRemoteConnectionTimeoutError as e:
|
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
|
|
@@ -30,7 +31,7 @@ logger = logging.getLogger(__name__)
|
|
|
30
31
|
|
|
31
32
|
class OSCClientServer(BlockingOSCUDPServer):
|
|
32
33
|
def __init__(self, address: str, dispatcher: Dispatcher):
|
|
33
|
-
super().__init__((
|
|
34
|
+
super().__init__(('', 0), dispatcher)
|
|
34
35
|
self.xr_address = address
|
|
35
36
|
|
|
36
37
|
def send_message(self, address: str, vals: Optional[Union[str, list]]):
|
|
@@ -52,13 +53,13 @@ class XAirRemote(abc.ABC):
|
|
|
52
53
|
def __init__(self, **kwargs):
|
|
53
54
|
dispatcher = Dispatcher()
|
|
54
55
|
dispatcher.set_default_handler(self.msg_handler)
|
|
55
|
-
self.xair_ip = kwargs[
|
|
56
|
-
self.xair_port = kwargs[
|
|
57
|
-
self._delay = kwargs[
|
|
58
|
-
self.connect_timeout = kwargs[
|
|
56
|
+
self.xair_ip = kwargs['ip'] or self._ip_from_toml()
|
|
57
|
+
self.xair_port = kwargs['port']
|
|
58
|
+
self._delay = kwargs['delay']
|
|
59
|
+
self.connect_timeout = kwargs['connect_timeout']
|
|
59
60
|
self.logger = logger.getChild(self.__class__.__name__)
|
|
60
61
|
if not self.xair_ip:
|
|
61
|
-
raise XAirRemoteError(
|
|
62
|
+
raise XAirRemoteError('No valid ip detected')
|
|
62
63
|
self.server = OSCClientServer((self.xair_ip, self.xair_port), dispatcher)
|
|
63
64
|
|
|
64
65
|
def __enter__(self):
|
|
@@ -68,17 +69,17 @@ class XAirRemote(abc.ABC):
|
|
|
68
69
|
return self
|
|
69
70
|
|
|
70
71
|
def _ip_from_toml(self) -> str:
|
|
71
|
-
filepath = Path.cwd() /
|
|
72
|
-
with open(filepath,
|
|
72
|
+
filepath = Path.cwd() / 'config.toml'
|
|
73
|
+
with open(filepath, 'rb') as f:
|
|
73
74
|
conn = tomllib.load(f)
|
|
74
|
-
return conn[
|
|
75
|
+
return conn['connection'].get('ip')
|
|
75
76
|
|
|
76
77
|
@util.timeout
|
|
77
78
|
def validate_connection(self):
|
|
78
|
-
if not self.query(
|
|
79
|
+
if not self.query('/xinfo'):
|
|
79
80
|
raise XAirRemoteConnectionTimeoutError(self.xair_ip, self.xair_port)
|
|
80
81
|
self.logger.info(
|
|
81
|
-
f
|
|
82
|
+
f'Successfully connected to {self.info_response[2]} at {self.info_response[0]}.'
|
|
82
83
|
)
|
|
83
84
|
|
|
84
85
|
@property
|
|
@@ -114,10 +115,10 @@ def _make_remote(kind: KindMap) -> XAirRemote:
|
|
|
114
115
|
|
|
115
116
|
def init_x32(self, *args, **kwargs):
|
|
116
117
|
defaultkwargs = {
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
118
|
+
'ip': None,
|
|
119
|
+
'port': 10023,
|
|
120
|
+
'delay': 0.02,
|
|
121
|
+
'connect_timeout': 2,
|
|
121
122
|
}
|
|
122
123
|
kwargs = defaultkwargs | kwargs
|
|
123
124
|
XAirRemote.__init__(self, *args, **kwargs)
|
|
@@ -134,13 +135,14 @@ 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 = {
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
142
|
+
'ip': None,
|
|
143
|
+
'port': 10024,
|
|
144
|
+
'delay': 0.02,
|
|
145
|
+
'connect_timeout': 2,
|
|
144
146
|
}
|
|
145
147
|
kwargs = defaultkwargs | kwargs
|
|
146
148
|
XAirRemote.__init__(self, *args, **kwargs)
|
|
@@ -154,20 +156,21 @@ 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
|
-
if kind.id_ ==
|
|
161
|
+
if kind.id_ == 'X32':
|
|
159
162
|
return type(
|
|
160
|
-
f
|
|
163
|
+
f'XAirRemote{kind}',
|
|
161
164
|
(XAirRemote,),
|
|
162
165
|
{
|
|
163
|
-
|
|
166
|
+
'__init__': init_x32,
|
|
164
167
|
},
|
|
165
168
|
)
|
|
166
169
|
return type(
|
|
167
|
-
f
|
|
170
|
+
f'XAirRemote{kind}',
|
|
168
171
|
(XAirRemote,),
|
|
169
172
|
{
|
|
170
|
-
|
|
173
|
+
'__init__': init_xair,
|
|
171
174
|
},
|
|
172
175
|
)
|
|
173
176
|
|
|
@@ -1,25 +1,24 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.3
|
|
2
2
|
Name: xair-api
|
|
3
|
-
Version: 2.
|
|
3
|
+
Version: 2.4.1
|
|
4
4
|
Summary: Remote control Behringer X-Air | Midas MR mixers through OSC
|
|
5
|
-
Home-page: https://github.com/onyx-and-iris/xair-api-python
|
|
6
5
|
License: MIT
|
|
7
|
-
Author:
|
|
6
|
+
Author: Onyx and Iris
|
|
8
7
|
Author-email: code@onyxandiris.online
|
|
9
|
-
Requires-Python:
|
|
8
|
+
Requires-Python: <4.0,>=3.10
|
|
10
9
|
Classifier: License :: OSI Approved :: MIT License
|
|
11
10
|
Classifier: Programming Language :: Python :: 3
|
|
12
11
|
Classifier: Programming Language :: Python :: 3.10
|
|
13
12
|
Classifier: Programming Language :: Python :: 3.11
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
15
|
+
Requires-Dist: python-osc (>=1.9.3,<2.0.0)
|
|
16
|
+
Requires-Dist: tomli (>=2.0.1,<3.0) ; python_version < "3.11"
|
|
17
17
|
Description-Content-Type: text/markdown
|
|
18
18
|
|
|
19
19
|
[](https://badge.fury.io/py/xair-api)
|
|
20
20
|
[](https://github.com/onyx-and-iris/xair-api-python/blob/dev/LICENSE)
|
|
21
|
-
[](https://pycqa.github.io/isort/)
|
|
21
|
+
[](https://github.com/astral-sh/ruff)
|
|
23
22
|

|
|
24
23
|
|
|
25
24
|
# Xair API
|
|
@@ -58,18 +57,18 @@ import xair_api
|
|
|
58
57
|
|
|
59
58
|
|
|
60
59
|
def main():
|
|
61
|
-
kind_id =
|
|
62
|
-
ip =
|
|
60
|
+
kind_id = 'XR18'
|
|
61
|
+
ip = '<ip address>'
|
|
63
62
|
|
|
64
63
|
with xair_api.connect(kind_id, ip=ip) as mixer:
|
|
65
|
-
mixer.strip[8].config.name =
|
|
64
|
+
mixer.strip[8].config.name = 'sm7b'
|
|
66
65
|
mixer.strip[8].mix.on = True
|
|
67
66
|
print(
|
|
68
|
-
f
|
|
67
|
+
f'strip 09 ({mixer.strip[8].config.name}) on has been set to {mixer.strip[8].mix.on}'
|
|
69
68
|
)
|
|
70
69
|
|
|
71
70
|
|
|
72
|
-
if __name__ ==
|
|
71
|
+
if __name__ == '__main__':
|
|
73
72
|
main()
|
|
74
73
|
```
|
|
75
74
|
|
|
@@ -132,6 +131,10 @@ A class representing auxreturn channel
|
|
|
132
131
|
|
|
133
132
|
A class representing the main config settings
|
|
134
133
|
|
|
134
|
+
`mixer.headamp`
|
|
135
|
+
|
|
136
|
+
A class representing the channel preamps (phantom power/gain).
|
|
137
|
+
|
|
135
138
|
### `LR`
|
|
136
139
|
|
|
137
140
|
Contains the subclasses:
|
|
@@ -162,6 +165,13 @@ Contains the subclasses:
|
|
|
162
165
|
Contains the subclasses:
|
|
163
166
|
(`Config`, `Preamp`, `EQ`, `Mix`, `Group`, `Send`)
|
|
164
167
|
|
|
168
|
+
### `HeadAmp`
|
|
169
|
+
|
|
170
|
+
The following properties are available:
|
|
171
|
+
|
|
172
|
+
- `gain`: float, from -12.0 to 60.0
|
|
173
|
+
- `phantom`: bool
|
|
174
|
+
|
|
165
175
|
### `Subclasses`
|
|
166
176
|
|
|
167
177
|
For each subclass the corresponding properties are available.
|
|
@@ -322,8 +332,8 @@ Send an OSC command directly to the mixer
|
|
|
322
332
|
for example:
|
|
323
333
|
|
|
324
334
|
```python
|
|
325
|
-
mixer.send(
|
|
326
|
-
mixer.send(
|
|
335
|
+
mixer.send('/ch/01/mix/on', 1)
|
|
336
|
+
mixer.send('/bus/2/config/name', 'somename')
|
|
327
337
|
```
|
|
328
338
|
|
|
329
339
|
Query the value of a command:
|
|
@@ -333,7 +343,7 @@ Query the value of a command:
|
|
|
333
343
|
for example:
|
|
334
344
|
|
|
335
345
|
```python
|
|
336
|
-
print(mixer.query(
|
|
346
|
+
print(mixer.query('/ch/01/mix/on'))
|
|
337
347
|
```
|
|
338
348
|
|
|
339
349
|
### Errors
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
xair_api/__init__.py,sha256=O6VVgrgm1hq2iwgl6XNAWu54uxlpr7aB28s_a6fCm10,73
|
|
2
|
+
xair_api/adapter.py,sha256=wD2oIFoHG-smgCC9z6fC_Ly0yIwjvZW5HPdjCT9KfLs,963
|
|
3
|
+
xair_api/bus.py,sha256=a44uaQ-OVxekKottir86aNzuP1Srw2s97Afshqq5m5o,1771
|
|
4
|
+
xair_api/config.py,sha256=vZ7R3eNu-it39icn1AlixAAFlp08ay3PXuNVQ725lzg,5853
|
|
5
|
+
xair_api/dca.py,sha256=sn_X9dK4i-DEPr8E8Ot9seYrIiL1bJiKSjiPmZ4FjBo,1443
|
|
6
|
+
xair_api/errors.py,sha256=Bm0ezXP8pgeiiz76UbVkaVpvJLw03qq71LOpCclaDEY,411
|
|
7
|
+
xair_api/fx.py,sha256=PxAX_XZE67XtnsPyp3xLH79-DeG6dVJZpjECDSB2Ltg,1811
|
|
8
|
+
xair_api/headamp.py,sha256=L6N5FrifYChUckuvOfp8fOrwczW9i1V51mXFowKaONk,1175
|
|
9
|
+
xair_api/kinds.py,sha256=WS3pZBgpGAG-HPIPkgOxnGqqTnqQAjOEAO6f5SD7FUY,1155
|
|
10
|
+
xair_api/lr.py,sha256=xqlsr2D_jvzDWsHDzbOf1EKW699UHd19vGmCFG6UQkk,1788
|
|
11
|
+
xair_api/meta.py,sha256=rU61YNScmiPcvlNU7WcAhRP9AQXS0XoOkZ9ntm1iW6k,1564
|
|
12
|
+
xair_api/rtn.py,sha256=f35eMrGw4YBfv1JK6vsKbaVXJfACotz8EycMxBiz2y4,3177
|
|
13
|
+
xair_api/shared.py,sha256=k1RuE2N_RR9nKQQa6AyeIqtZ4i6IfrKzSl4YM7eAC_4,19171
|
|
14
|
+
xair_api/strip.py,sha256=_ge_GfBeYiEBbRzMWBh67kaoZ907iwvnd6Bte_n_x9Y,2082
|
|
15
|
+
xair_api/util.py,sha256=OxgWTWRqZLUz4AGTRT-hETjM4EUO4e8tXppRSOFY01M,2263
|
|
16
|
+
xair_api/xair.py,sha256=Qhy7Ey6Gk092ADZNfn9sQ2sClRJHBZtehDBUNrUkRXQ,6582
|
|
17
|
+
xair_api-2.4.1.dist-info/LICENSE,sha256=m2fbtv9II-iQqimTd4zjgynL5vuEqGXauLSDJZycYIo,1124
|
|
18
|
+
xair_api-2.4.1.dist-info/METADATA,sha256=kc-8xB3c0997vgOl2YCEs33-je04tOmksS6uP6Uvx9s,8932
|
|
19
|
+
xair_api-2.4.1.dist-info/WHEEL,sha256=IYZQI976HJqqOpQU6PHkJ8fb3tMNBFjg-Cn-pwAbaFM,88
|
|
20
|
+
xair_api-2.4.1.dist-info/RECORD,,
|
xair_api-2.3.2.dist-info/RECORD
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
xair_api/__init__.py,sha256=na_Zd_yo8E1LCoeWrAPJR68Ygdm5R8RRrlqb-UnWMtA,73
|
|
2
|
-
xair_api/adapter.py,sha256=icQXeqrYu6iWOJbke6zXdOzxyhAV__dXKrCnuDbZAUU,797
|
|
3
|
-
xair_api/bus.py,sha256=digswx5ApbLCpF6R7_8OqfvnJ8C9JIFpe8MFxKXbSB0,1771
|
|
4
|
-
xair_api/config.py,sha256=ditmhP770trYIu7eouw4pU3BgOtXwOB8dearYJbhSuw,5853
|
|
5
|
-
xair_api/dca.py,sha256=C-wyBqeAi0qr1qrOKefyIWsJwI8ebs2iV83Q2iC67-k,1443
|
|
6
|
-
xair_api/errors.py,sha256=rfFmAW6QitHe0iB56M48He-qsbvDaKe1_AN_j4-9oUA,411
|
|
7
|
-
xair_api/fx.py,sha256=AzjgpJSHDCWwWRGCWxeGwwsm8jcxl3fJykprk9cwSUM,1811
|
|
8
|
-
xair_api/kinds.py,sha256=ulJJhLpiUuOw5Ir7Q3CQbmAKrd33xq8CIHpAFc5zEdw,1119
|
|
9
|
-
xair_api/lr.py,sha256=WL5YnDeLeJPxIK5OdTqZQ3s6UEfQ3-onz99OEdi0-mE,1788
|
|
10
|
-
xair_api/meta.py,sha256=iUWPSP4QcWMW6gyLc5SGDJ49pKZgJrHzFphtL6OFptE,1564
|
|
11
|
-
xair_api/rtn.py,sha256=lOTGSkxsYpc4usIba-reZSRmfa-7JIr_FTThSw6BdLY,3177
|
|
12
|
-
xair_api/shared.py,sha256=ABVTgx9sIH9zZLJLKeZBrhdMXj-WGNuggxrqjn8oa3M,19171
|
|
13
|
-
xair_api/strip.py,sha256=pAFX0Ssq1kC9BghGJhd6ShJ0on16DbkWoickH0jA-Jg,2082
|
|
14
|
-
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,,
|
|
File without changes
|