xair-api 2.4.0__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/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"{self.address}/{param}")
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"{self.address}/{param}", val)
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"Strip{remote.kind}",
43
+ f'Strip{remote.kind}',
44
44
  (cls,),
45
45
  {
46
46
  **{
47
47
  _cls.__name__.lower(): type(
48
- f"{_cls.__name__}{remote.kind}", (_cls, cls), {}
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
- "send": tuple(
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
- "mute": mute_prop(),
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"/ch/{str(self.index).zfill(2)}"
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"login time: {round(time.time() - start, 2)}")
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
@@ -31,7 +31,7 @@ logger = logging.getLogger(__name__)
31
31
 
32
32
  class OSCClientServer(BlockingOSCUDPServer):
33
33
  def __init__(self, address: str, dispatcher: Dispatcher):
34
- super().__init__(("", 0), dispatcher)
34
+ super().__init__(('', 0), dispatcher)
35
35
  self.xr_address = address
36
36
 
37
37
  def send_message(self, address: str, vals: Optional[Union[str, list]]):
@@ -53,13 +53,13 @@ class XAirRemote(abc.ABC):
53
53
  def __init__(self, **kwargs):
54
54
  dispatcher = Dispatcher()
55
55
  dispatcher.set_default_handler(self.msg_handler)
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"]
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']
60
60
  self.logger = logger.getChild(self.__class__.__name__)
61
61
  if not self.xair_ip:
62
- raise XAirRemoteError("No valid ip detected")
62
+ raise XAirRemoteError('No valid ip detected')
63
63
  self.server = OSCClientServer((self.xair_ip, self.xair_port), dispatcher)
64
64
 
65
65
  def __enter__(self):
@@ -69,17 +69,17 @@ class XAirRemote(abc.ABC):
69
69
  return self
70
70
 
71
71
  def _ip_from_toml(self) -> str:
72
- filepath = Path.cwd() / "config.toml"
73
- with open(filepath, "rb") as f:
72
+ filepath = Path.cwd() / 'config.toml'
73
+ with open(filepath, 'rb') as f:
74
74
  conn = tomllib.load(f)
75
- return conn["connection"].get("ip")
75
+ return conn['connection'].get('ip')
76
76
 
77
77
  @util.timeout
78
78
  def validate_connection(self):
79
- if not self.query("/xinfo"):
79
+ if not self.query('/xinfo'):
80
80
  raise XAirRemoteConnectionTimeoutError(self.xair_ip, self.xair_port)
81
81
  self.logger.info(
82
- f"Successfully connected to {self.info_response[2]} at {self.info_response[0]}."
82
+ f'Successfully connected to {self.info_response[2]} at {self.info_response[0]}.'
83
83
  )
84
84
 
85
85
  @property
@@ -115,10 +115,10 @@ def _make_remote(kind: KindMap) -> XAirRemote:
115
115
 
116
116
  def init_x32(self, *args, **kwargs):
117
117
  defaultkwargs = {
118
- "ip": None,
119
- "port": 10023,
120
- "delay": 0.02,
121
- "connect_timeout": 2,
118
+ 'ip': None,
119
+ 'port': 10023,
120
+ 'delay': 0.02,
121
+ 'connect_timeout': 2,
122
122
  }
123
123
  kwargs = defaultkwargs | kwargs
124
124
  XAirRemote.__init__(self, *args, **kwargs)
@@ -139,10 +139,10 @@ def _make_remote(kind: KindMap) -> XAirRemote:
139
139
 
140
140
  def init_xair(self, *args, **kwargs):
141
141
  defaultkwargs = {
142
- "ip": None,
143
- "port": 10024,
144
- "delay": 0.02,
145
- "connect_timeout": 2,
142
+ 'ip': None,
143
+ 'port': 10024,
144
+ 'delay': 0.02,
145
+ 'connect_timeout': 2,
146
146
  }
147
147
  kwargs = defaultkwargs | kwargs
148
148
  XAirRemote.__init__(self, *args, **kwargs)
@@ -158,19 +158,19 @@ def _make_remote(kind: KindMap) -> XAirRemote:
158
158
  self.config = Config.make(self)
159
159
  self.headamp = tuple(HeadAmp(self, i) for i in range(kind.num_strip))
160
160
 
161
- if kind.id_ == "X32":
161
+ if kind.id_ == 'X32':
162
162
  return type(
163
- f"XAirRemote{kind}",
163
+ f'XAirRemote{kind}',
164
164
  (XAirRemote,),
165
165
  {
166
- "__init__": init_x32,
166
+ '__init__': init_x32,
167
167
  },
168
168
  )
169
169
  return type(
170
- f"XAirRemote{kind}",
170
+ f'XAirRemote{kind}',
171
171
  (XAirRemote,),
172
172
  {
173
- "__init__": init_xair,
173
+ '__init__': init_xair,
174
174
  },
175
175
  )
176
176
 
@@ -1,21 +1,19 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.3
2
2
  Name: xair-api
3
- Version: 2.4.0
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: onyx-and-iris
6
+ Author: Onyx and Iris
8
7
  Author-email: code@onyxandiris.online
9
- Requires-Python: >=3.10,<4.0
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
13
  Classifier: Programming Language :: Python :: 3.12
15
14
  Classifier: Programming Language :: Python :: 3.13
16
- Requires-Dist: python-osc (>=1.8.0,<2.0.0)
17
- Requires-Dist: tomli (>=2.0.1,<3.0.0) ; python_version < "3.11"
18
- Project-URL: Repository, https://github.com/onyx-and-iris/xair-api-python
15
+ Requires-Dist: python-osc (>=1.9.3,<2.0.0)
16
+ Requires-Dist: tomli (>=2.0.1,<3.0) ; python_version < "3.11"
19
17
  Description-Content-Type: text/markdown
20
18
 
21
19
  [![PyPI version](https://badge.fury.io/py/xair-api.svg)](https://badge.fury.io/py/xair-api)
@@ -59,18 +57,18 @@ import xair_api
59
57
 
60
58
 
61
59
  def main():
62
- kind_id = "XR18"
63
- ip = "<ip address>"
60
+ kind_id = 'XR18'
61
+ ip = '<ip address>'
64
62
 
65
63
  with xair_api.connect(kind_id, ip=ip) as mixer:
66
- mixer.strip[8].config.name = "sm7b"
64
+ mixer.strip[8].config.name = 'sm7b'
67
65
  mixer.strip[8].mix.on = True
68
66
  print(
69
- f"strip 09 ({mixer.strip[8].config.name}) on has been set to {mixer.strip[8].mix.on}"
67
+ f'strip 09 ({mixer.strip[8].config.name}) on has been set to {mixer.strip[8].mix.on}'
70
68
  )
71
69
 
72
70
 
73
- if __name__ == "__main__":
71
+ if __name__ == '__main__':
74
72
  main()
75
73
  ```
76
74
 
@@ -334,8 +332,8 @@ Send an OSC command directly to the mixer
334
332
  for example:
335
333
 
336
334
  ```python
337
- mixer.send("/ch/01/mix/on", 1)
338
- mixer.send("/bus/2/config/name", "somename")
335
+ mixer.send('/ch/01/mix/on', 1)
336
+ mixer.send('/bus/2/config/name', 'somename')
339
337
  ```
340
338
 
341
339
  Query the value of a command:
@@ -345,7 +343,7 @@ Query the value of a command:
345
343
  for example:
346
344
 
347
345
  ```python
348
- print(mixer.query("/ch/01/mix/on"))
346
+ print(mixer.query('/ch/01/mix/on'))
349
347
  ```
350
348
 
351
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,,
@@ -1,4 +1,4 @@
1
1
  Wheel-Version: 1.0
2
- Generator: poetry-core 1.9.1
2
+ Generator: poetry-core 2.0.1
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
@@ -1,21 +0,0 @@
1
- xair_api/__init__.py,sha256=na_Zd_yo8E1LCoeWrAPJR68Ygdm5R8RRrlqb-UnWMtA,73
2
- xair_api/adapter.py,sha256=ozQZOstdS3uJRYcnp8Qlx4mSNaKzGlFjWqtKRBF0PlA,963
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/headamp.py,sha256=tLV4LB1QmLhpo4S8PdKkvS5NgK96-fisnY1bWN-IM-M,1175
9
- xair_api/kinds.py,sha256=93VLFEgQwDJ4RdpIuf8T6_qqc6pwYCJGcS47UZdPqj8,1147
10
- xair_api/lr.py,sha256=WL5YnDeLeJPxIK5OdTqZQ3s6UEfQ3-onz99OEdi0-mE,1788
11
- xair_api/meta.py,sha256=iUWPSP4QcWMW6gyLc5SGDJ49pKZgJrHzFphtL6OFptE,1564
12
- xair_api/rtn.py,sha256=lOTGSkxsYpc4usIba-reZSRmfa-7JIr_FTThSw6BdLY,3177
13
- xair_api/shared.py,sha256=ABVTgx9sIH9zZLJLKeZBrhdMXj-WGNuggxrqjn8oa3M,19171
14
- xair_api/strip.py,sha256=pAFX0Ssq1kC9BghGJhd6ShJ0on16DbkWoickH0jA-Jg,2082
15
- xair_api/util.py,sha256=Rd2eGhqIjFe29s-0ffQGzs9p5lXsfCRJ91i6BPEVzxE,2263
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,7 +0,0 @@
1
- [console_scripts]
2
- all=scripts:test_all
3
- obs=scripts:ex_obs
4
- sends=scripts:ex_sends
5
- x32=scripts:test_x32
6
- xair=scripts:test_xair
7
-