xair-api 2.4.1__py3-none-any.whl → 2.4.2__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 +3 -3
- xair_api/adapter.py +47 -47
- xair_api/bus.py +66 -66
- xair_api/config.py +207 -207
- xair_api/dca.py +63 -63
- xair_api/errors.py +14 -14
- xair_api/fx.py +74 -74
- xair_api/headamp.py +49 -49
- xair_api/kinds.py +61 -61
- xair_api/lr.py +67 -67
- xair_api/meta.py +75 -75
- xair_api/rtn.py +112 -112
- xair_api/shared.py +674 -673
- xair_api/strip.py +73 -73
- xair_api/util.py +94 -94
- xair_api/xair.py +193 -193
- {xair_api-2.4.1.dist-info → xair_api-2.4.2.dist-info}/METADATA +12 -9
- xair_api-2.4.2.dist-info/RECORD +20 -0
- {xair_api-2.4.1.dist-info → xair_api-2.4.2.dist-info}/WHEEL +1 -1
- {xair_api-2.4.1.dist-info → xair_api-2.4.2.dist-info/licenses}/LICENSE +22 -22
- xair_api-2.4.1.dist-info/RECORD +0 -20
xair_api/shared.py
CHANGED
|
@@ -1,673 +1,674 @@
|
|
|
1
|
-
from typing import Optional, Union
|
|
2
|
-
|
|
3
|
-
from . import util
|
|
4
|
-
from .meta import geq_prop
|
|
5
|
-
|
|
6
|
-
"""
|
|
7
|
-
Classes shared by /ch, /rtn, /rtn/aux, /bus, /fxsend, /lr
|
|
8
|
-
"""
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
class Config:
|
|
12
|
-
@property
|
|
13
|
-
def address(self) -> str:
|
|
14
|
-
root = super(Config, self).address
|
|
15
|
-
return f'{root}/config'
|
|
16
|
-
|
|
17
|
-
@property
|
|
18
|
-
def name(self) -> str:
|
|
19
|
-
return self.getter('name')[0]
|
|
20
|
-
|
|
21
|
-
@name.setter
|
|
22
|
-
def name(self, val: str):
|
|
23
|
-
self.setter('name', val)
|
|
24
|
-
|
|
25
|
-
@property
|
|
26
|
-
def color(self) -> int:
|
|
27
|
-
return self.getter('color')[0]
|
|
28
|
-
|
|
29
|
-
@color.setter
|
|
30
|
-
def color(self, val: int):
|
|
31
|
-
self.setter('color', val)
|
|
32
|
-
|
|
33
|
-
@property
|
|
34
|
-
def inputsource(self) -> int:
|
|
35
|
-
return self.getter('insrc')[0]
|
|
36
|
-
|
|
37
|
-
@inputsource.setter
|
|
38
|
-
def inputsource(self, val: int):
|
|
39
|
-
self.setter('insrc', val)
|
|
40
|
-
|
|
41
|
-
@property
|
|
42
|
-
def usbreturn(self) -> int:
|
|
43
|
-
return self.getter('rtnsrc')[0]
|
|
44
|
-
|
|
45
|
-
@usbreturn.setter
|
|
46
|
-
def usbreturn(self, val: int):
|
|
47
|
-
self.setter('rtnsrc', val)
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
class Preamp:
|
|
51
|
-
@property
|
|
52
|
-
def address(self) -> str:
|
|
53
|
-
root = super(Preamp, self).address
|
|
54
|
-
return f'{root}/preamp'
|
|
55
|
-
|
|
56
|
-
@property
|
|
57
|
-
def usbtrim(self) -> float:
|
|
58
|
-
return round(util.lin_get(-18, 18, self.getter('rtntrim')[0]), 1)
|
|
59
|
-
|
|
60
|
-
@usbtrim.setter
|
|
61
|
-
def usbtrim(self, val: float):
|
|
62
|
-
if not -18 <= val <= 18:
|
|
63
|
-
self.logger.warning(
|
|
64
|
-
f'usbtrim got {val}, expected value in range -18.0 to 18.0'
|
|
65
|
-
)
|
|
66
|
-
self.setter('rtntrim', util.lin_set(-18, 18, val))
|
|
67
|
-
|
|
68
|
-
@property
|
|
69
|
-
def usbinput(self) -> bool:
|
|
70
|
-
return self.getter('rtnsw')[0] == 1
|
|
71
|
-
|
|
72
|
-
@usbinput.setter
|
|
73
|
-
def usbinput(self, val: bool):
|
|
74
|
-
self.setter('rtnsw', 1 if val else 0)
|
|
75
|
-
|
|
76
|
-
@property
|
|
77
|
-
def invert(self) -> bool:
|
|
78
|
-
return self.getter('invert')[0] == 1
|
|
79
|
-
|
|
80
|
-
@invert.setter
|
|
81
|
-
def invert(self, val: bool):
|
|
82
|
-
self.setter('invert', 1 if val else 0)
|
|
83
|
-
|
|
84
|
-
@property
|
|
85
|
-
def highpasson(self) -> bool:
|
|
86
|
-
return self.getter('hpon')[0] == 1
|
|
87
|
-
|
|
88
|
-
@highpasson.setter
|
|
89
|
-
def highpasson(self, val: bool):
|
|
90
|
-
self.setter('hpon', 1 if val else 0)
|
|
91
|
-
|
|
92
|
-
@property
|
|
93
|
-
def highpassfilter(self) -> int:
|
|
94
|
-
return int(util.log_get(20, 400, self.getter('hpf')[0]))
|
|
95
|
-
|
|
96
|
-
@highpassfilter.setter
|
|
97
|
-
def highpassfilter(self, val: int):
|
|
98
|
-
if not 20 <= val <= 400:
|
|
99
|
-
self.logger.warning(
|
|
100
|
-
f'highpassfilter got {val}, expected value in range 20 to 400'
|
|
101
|
-
)
|
|
102
|
-
self.setter('hpf', util.log_set(20, 400, val))
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
class Gate:
|
|
106
|
-
@property
|
|
107
|
-
def address(self) -> str:
|
|
108
|
-
root = super(Gate, self).address
|
|
109
|
-
return f'{root}/gate'
|
|
110
|
-
|
|
111
|
-
@property
|
|
112
|
-
def on(self) -> bool:
|
|
113
|
-
return self.getter('on')[0] == 1
|
|
114
|
-
|
|
115
|
-
@on.setter
|
|
116
|
-
def on(self, val: bool):
|
|
117
|
-
self.setter('on', 1 if val else 0)
|
|
118
|
-
|
|
119
|
-
@property
|
|
120
|
-
def mode(self) -> str:
|
|
121
|
-
opts = ('gate', 'exp2', 'exp3', 'exp4', 'duck')
|
|
122
|
-
return opts[self.getter('mode')[0]]
|
|
123
|
-
|
|
124
|
-
@mode.setter
|
|
125
|
-
def mode(self, val: str):
|
|
126
|
-
opts = ('gate', 'exp2', 'exp3', 'exp4', 'duck')
|
|
127
|
-
if val not in opts:
|
|
128
|
-
self.logger.warning(f'mode got {val}, expected one of {opts}')
|
|
129
|
-
self.setter('mode', opts.index(val))
|
|
130
|
-
|
|
131
|
-
@property
|
|
132
|
-
def threshold(self) -> float:
|
|
133
|
-
return round(util.lin_get(-80, 0, self.getter('thr')[0]), 1)
|
|
134
|
-
|
|
135
|
-
@threshold.setter
|
|
136
|
-
def threshold(self, val: float):
|
|
137
|
-
if not -80 <= val <= 0:
|
|
138
|
-
self.logger.warning(
|
|
139
|
-
f'threshold got {val}, expected value in range -80.0 to 0.0'
|
|
140
|
-
)
|
|
141
|
-
self.setter('thr', util.lin_set(-80, 0, val))
|
|
142
|
-
|
|
143
|
-
@property
|
|
144
|
-
def range(self) -> int:
|
|
145
|
-
return int(util.lin_get(3, 60, self.getter('range')[0]))
|
|
146
|
-
|
|
147
|
-
@range.setter
|
|
148
|
-
def range(self, val: int):
|
|
149
|
-
if not 3 <= val <= 60:
|
|
150
|
-
self.logger.warning(f'range got {val}, expected value in range 3 to 60')
|
|
151
|
-
self.setter('range', util.lin_set(3, 60, val))
|
|
152
|
-
|
|
153
|
-
@property
|
|
154
|
-
def attack(self) -> int:
|
|
155
|
-
return int(util.lin_get(0, 120, self.getter('attack')[0]))
|
|
156
|
-
|
|
157
|
-
@attack.setter
|
|
158
|
-
def attack(self, val: int):
|
|
159
|
-
if not 0 <= val <= 120:
|
|
160
|
-
self.logger.warning(f'attack got {val}, expected value in range 0 to 120')
|
|
161
|
-
self.setter('attack', util.lin_set(0, 120, val))
|
|
162
|
-
|
|
163
|
-
@property
|
|
164
|
-
def hold(self) -> Union[float, int]:
|
|
165
|
-
val = util.log_get(0.02, 2000, self.getter('hold')[0])
|
|
166
|
-
return round(val, 1) if val < 100 else int(val)
|
|
167
|
-
|
|
168
|
-
@hold.setter
|
|
169
|
-
def hold(self, val: float):
|
|
170
|
-
if not 0.02 <= val <= 2000:
|
|
171
|
-
self.logger.warning(
|
|
172
|
-
f'hold got {val}, expected value in range 0.02 to 2000.0'
|
|
173
|
-
)
|
|
174
|
-
self.setter('hold', util.log_set(0.02, 2000, val))
|
|
175
|
-
|
|
176
|
-
@property
|
|
177
|
-
def release(self) -> int:
|
|
178
|
-
return int(util.log_get(5, 4000, self.getter('release')[0]))
|
|
179
|
-
|
|
180
|
-
@release.setter
|
|
181
|
-
def release(self, val: int):
|
|
182
|
-
if not 5 <= val <= 4000:
|
|
183
|
-
self.logger.warning(f'release got {val}, expected value in range 5 to 4000')
|
|
184
|
-
self.setter('release', util.log_set(5, 4000, val))
|
|
185
|
-
|
|
186
|
-
@property
|
|
187
|
-
def keysource(self):
|
|
188
|
-
return self.getter('keysrc')[0]
|
|
189
|
-
|
|
190
|
-
@keysource.setter
|
|
191
|
-
def keysource(self, val):
|
|
192
|
-
self.setter('keysrc', val)
|
|
193
|
-
|
|
194
|
-
@property
|
|
195
|
-
def filteron(self):
|
|
196
|
-
return self.getter('filter/on')[0] == 1
|
|
197
|
-
|
|
198
|
-
@filteron.setter
|
|
199
|
-
def filteron(self, val: bool):
|
|
200
|
-
self.setter('filter/on', 1 if val else 0)
|
|
201
|
-
|
|
202
|
-
@property
|
|
203
|
-
def filtertype(self) -> int:
|
|
204
|
-
return int(self.getter('filter/type')[0])
|
|
205
|
-
|
|
206
|
-
@filtertype.setter
|
|
207
|
-
def filtertype(self, val: int):
|
|
208
|
-
self.setter('filter/type', val)
|
|
209
|
-
|
|
210
|
-
@property
|
|
211
|
-
def filterfreq(self) -> Union[float, int]:
|
|
212
|
-
retval = util.log_get(20, 20000, self.getter('filter/f')[0])
|
|
213
|
-
return int(retval) if retval > 1000 else round(retval, 1)
|
|
214
|
-
|
|
215
|
-
@filterfreq.setter
|
|
216
|
-
def filterfreq(self, val: Union[float, int]):
|
|
217
|
-
if not 20 <= val <= 20000:
|
|
218
|
-
self.logger.warning(
|
|
219
|
-
f'filterfreq got {val}, expected value in range 20 to 20000'
|
|
220
|
-
)
|
|
221
|
-
self.setter('filter/f', util.log_set(20, 20000, val))
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
class Dyn:
|
|
225
|
-
@property
|
|
226
|
-
def address(self) -> str:
|
|
227
|
-
root = super(Dyn, self).address
|
|
228
|
-
return f'{root}/dyn'
|
|
229
|
-
|
|
230
|
-
@property
|
|
231
|
-
def on(self) -> bool:
|
|
232
|
-
return self.getter('on')[0] == 1
|
|
233
|
-
|
|
234
|
-
@on.setter
|
|
235
|
-
def on(self, val: bool):
|
|
236
|
-
self.setter('on', 1 if val else 0)
|
|
237
|
-
|
|
238
|
-
@property
|
|
239
|
-
def mode(self) -> str:
|
|
240
|
-
opts = ('comp', 'exp')
|
|
241
|
-
return opts[self.getter('mode')[0]]
|
|
242
|
-
|
|
243
|
-
@mode.setter
|
|
244
|
-
def mode(self, val: str):
|
|
245
|
-
opts = ('comp', 'exp')
|
|
246
|
-
if val not in opts:
|
|
247
|
-
self.logger.warning(f'mode got {val}, expected one of {opts}')
|
|
248
|
-
self.setter('mode', opts.index(val))
|
|
249
|
-
|
|
250
|
-
@property
|
|
251
|
-
def det(self) -> str:
|
|
252
|
-
opts = ('peak', 'rms')
|
|
253
|
-
return opts[self.getter('det')[0]]
|
|
254
|
-
|
|
255
|
-
@det.setter
|
|
256
|
-
def det(self, val: str):
|
|
257
|
-
opts = ('peak', 'rms')
|
|
258
|
-
if val not in opts:
|
|
259
|
-
self.logger.warning(f'det got {val}, expected one of {opts}')
|
|
260
|
-
self.setter('det', opts.index(val))
|
|
261
|
-
|
|
262
|
-
@property
|
|
263
|
-
def env(self) -> str:
|
|
264
|
-
opts = ('lin', 'log')
|
|
265
|
-
return opts[self.getter('env')[0]]
|
|
266
|
-
|
|
267
|
-
@env.setter
|
|
268
|
-
def env(self, val: str):
|
|
269
|
-
opts = ('lin', 'log')
|
|
270
|
-
if val not in opts:
|
|
271
|
-
self.logger.warning(f'env got {val}, expected one of {opts}')
|
|
272
|
-
self.setter('env', opts.index(val))
|
|
273
|
-
|
|
274
|
-
@property
|
|
275
|
-
def threshold(self) -> float:
|
|
276
|
-
return round(util.lin_get(-60, 0, self.getter('thr')[0]), 1)
|
|
277
|
-
|
|
278
|
-
@threshold.setter
|
|
279
|
-
def threshold(self, val: float):
|
|
280
|
-
if not -60 <= val <= 0:
|
|
281
|
-
self.logger.warning(
|
|
282
|
-
f'threshold got {val}, expected value in range -60.0 to 0'
|
|
283
|
-
)
|
|
284
|
-
self.setter('thr', util.lin_set(-60, 0, val))
|
|
285
|
-
|
|
286
|
-
@property
|
|
287
|
-
def ratio(self) -> Union[float, int]:
|
|
288
|
-
opts = (1.1, 1.3, 1.5, 2.0, 2.5, 3.0, 4.0, 5.0, 7.0, 10, 20, 100)
|
|
289
|
-
return opts[self.getter('ratio')[0]]
|
|
290
|
-
|
|
291
|
-
@ratio.setter
|
|
292
|
-
def ratio(self, val: int):
|
|
293
|
-
self.setter('ratio', val)
|
|
294
|
-
|
|
295
|
-
@property
|
|
296
|
-
def knee(self) -> int:
|
|
297
|
-
return int(util.lin_get(0, 5, self.getter('knee')[0]))
|
|
298
|
-
|
|
299
|
-
@knee.setter
|
|
300
|
-
def knee(self, val: int):
|
|
301
|
-
if not 0 <= val <= 5:
|
|
302
|
-
self.logger.warning(f'knee got {val}, expected value in range 0 to 5')
|
|
303
|
-
self.setter('knee', util.lin_set(0, 5, val))
|
|
304
|
-
|
|
305
|
-
@property
|
|
306
|
-
def mgain(self) -> float:
|
|
307
|
-
return round(util.lin_get(0, 24, self.getter('mgain')[0]), 1)
|
|
308
|
-
|
|
309
|
-
@mgain.setter
|
|
310
|
-
def mgain(self, val: float):
|
|
311
|
-
if not 0 <= val <= 24:
|
|
312
|
-
self.logger.warning(f'mgain got {val}, expected value in range 0.0 to 24.0')
|
|
313
|
-
self.setter('mgain', util.lin_set(0, 24, val))
|
|
314
|
-
|
|
315
|
-
@property
|
|
316
|
-
def attack(self) -> int:
|
|
317
|
-
return int(util.lin_get(0, 120, self.getter('attack')[0]))
|
|
318
|
-
|
|
319
|
-
@attack.setter
|
|
320
|
-
def attack(self, val: int):
|
|
321
|
-
if not 0 <= val <= 120:
|
|
322
|
-
self.logger.warning(f'attack got {val}, expected value in range 0 to 120')
|
|
323
|
-
self.setter('attack', util.lin_set(0, 120, val))
|
|
324
|
-
|
|
325
|
-
@property
|
|
326
|
-
def hold(self) -> Union[float, int]:
|
|
327
|
-
val = util.log_get(0.02, 2000, self.getter('hold')[0])
|
|
328
|
-
return round(val, 1) if val < 100 else int(val)
|
|
329
|
-
|
|
330
|
-
@hold.setter
|
|
331
|
-
def hold(self, val: float):
|
|
332
|
-
if not 0.02 <= val <= 2000:
|
|
333
|
-
self.logger.warning(
|
|
334
|
-
f'hold got {val}, expected value in range 0.02 to 2000.0'
|
|
335
|
-
)
|
|
336
|
-
self.setter('hold', util.log_set(0.02, 2000, val))
|
|
337
|
-
|
|
338
|
-
@property
|
|
339
|
-
def release(self) -> int:
|
|
340
|
-
return int(util.log_get(5, 4000, self.getter('release')[0]))
|
|
341
|
-
|
|
342
|
-
@release.setter
|
|
343
|
-
def release(self, val: int):
|
|
344
|
-
if not 5 <= val <= 4000:
|
|
345
|
-
self.logger.warning(f'release got {val}, expected value in range 5 to 4000')
|
|
346
|
-
self.setter('release', util.log_set(5, 4000, val))
|
|
347
|
-
|
|
348
|
-
@property
|
|
349
|
-
def mix(self) -> int:
|
|
350
|
-
return int(util.lin_get(0, 100, self.getter('mix')[0]))
|
|
351
|
-
|
|
352
|
-
@mix.setter
|
|
353
|
-
def mix(self, val: int):
|
|
354
|
-
if not 0 <= val <= 100:
|
|
355
|
-
self.logger.warning(f'mix got {val}, expected value in range 0 to 100')
|
|
356
|
-
self.setter('mix', util.lin_set(0, 100, val))
|
|
357
|
-
|
|
358
|
-
@property
|
|
359
|
-
def keysource(self):
|
|
360
|
-
return self.getter('keysrc')[0]
|
|
361
|
-
|
|
362
|
-
@keysource.setter
|
|
363
|
-
def keysource(self, val):
|
|
364
|
-
self.setter('keysrc', val)
|
|
365
|
-
|
|
366
|
-
@property
|
|
367
|
-
def auto(self) -> bool:
|
|
368
|
-
return self.getter('auto')[0] == 1
|
|
369
|
-
|
|
370
|
-
@auto.setter
|
|
371
|
-
def auto(self, val: bool):
|
|
372
|
-
self.setter('auto', 1 if val else 0)
|
|
373
|
-
|
|
374
|
-
@property
|
|
375
|
-
def filteron(self):
|
|
376
|
-
return self.getter('filter/on')[0] == 1
|
|
377
|
-
|
|
378
|
-
@filteron.setter
|
|
379
|
-
def filteron(self, val: bool):
|
|
380
|
-
self.setter('filter/on', 1 if val else 0)
|
|
381
|
-
|
|
382
|
-
@property
|
|
383
|
-
def filtertype(self) -> int:
|
|
384
|
-
return int(self.getter('filter/type')[0])
|
|
385
|
-
|
|
386
|
-
@filtertype.setter
|
|
387
|
-
def filtertype(self, val: int):
|
|
388
|
-
self.setter('filter/type', val)
|
|
389
|
-
|
|
390
|
-
@property
|
|
391
|
-
def filterfreq(self) -> Union[float, int]:
|
|
392
|
-
retval = util.log_get(20, 20000, self.getter('filter/f')[0])
|
|
393
|
-
return int(retval) if retval > 1000 else round(retval, 1)
|
|
394
|
-
|
|
395
|
-
@filterfreq.setter
|
|
396
|
-
def filterfreq(self, val: Union[float, int]):
|
|
397
|
-
if not 20 <= val <= 20000:
|
|
398
|
-
self.logger.warning(
|
|
399
|
-
f'filterfreq got {val}, expected value in range 20 to 20000'
|
|
400
|
-
)
|
|
401
|
-
self.setter('filter/f', util.log_set(20, 20000, val))
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
class Insert:
|
|
405
|
-
@property
|
|
406
|
-
def address(self) -> str:
|
|
407
|
-
root = super(Insert, self).address
|
|
408
|
-
return f'{root}/insert'
|
|
409
|
-
|
|
410
|
-
@property
|
|
411
|
-
def on(self) -> bool:
|
|
412
|
-
return self.getter('on')[0] == 1
|
|
413
|
-
|
|
414
|
-
@on.setter
|
|
415
|
-
def on(self, val: bool):
|
|
416
|
-
self.setter('on', 1 if val else 0)
|
|
417
|
-
|
|
418
|
-
@property
|
|
419
|
-
def sel(self) -> int:
|
|
420
|
-
return self.getter('sel')[0]
|
|
421
|
-
|
|
422
|
-
@sel.setter
|
|
423
|
-
def sel(self, val: int):
|
|
424
|
-
self.setter('sel', val)
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
class EQ:
|
|
428
|
-
@classmethod
|
|
429
|
-
def make_fourband(cls, _cls, remote, index=None):
|
|
430
|
-
EQBand_cls = type('EQBand', (EQ.EQBand, _cls), {})
|
|
431
|
-
return type(
|
|
432
|
-
'EQ',
|
|
433
|
-
(cls,),
|
|
434
|
-
{
|
|
435
|
-
'low': EQBand_cls(1, remote, index),
|
|
436
|
-
'lomid': EQBand_cls(2, remote, index),
|
|
437
|
-
'himid': EQBand_cls(3, remote, index),
|
|
438
|
-
'high': EQBand_cls(4, remote, index),
|
|
439
|
-
},
|
|
440
|
-
)
|
|
441
|
-
|
|
442
|
-
@classmethod
|
|
443
|
-
def make_sixband(cls, _cls, remote, index=None):
|
|
444
|
-
EQBand_cls = type('EQBand', (EQ.EQBand, _cls), {})
|
|
445
|
-
return type(
|
|
446
|
-
'EQ',
|
|
447
|
-
(cls,),
|
|
448
|
-
{
|
|
449
|
-
'low': EQBand_cls(1, remote, index),
|
|
450
|
-
'low2': EQBand_cls(2, remote, index),
|
|
451
|
-
'lomid': EQBand_cls(3, remote, index),
|
|
452
|
-
'himid': EQBand_cls(4, remote, index),
|
|
453
|
-
'high2': EQBand_cls(5, remote, index),
|
|
454
|
-
'high': EQBand_cls(6, remote, index),
|
|
455
|
-
},
|
|
456
|
-
)
|
|
457
|
-
|
|
458
|
-
@property
|
|
459
|
-
def address(self) -> str:
|
|
460
|
-
root = super(EQ, self).address
|
|
461
|
-
return f'{root}/eq'
|
|
462
|
-
|
|
463
|
-
@property
|
|
464
|
-
def on(self) -> bool:
|
|
465
|
-
return self.getter('on')[0] == 1
|
|
466
|
-
|
|
467
|
-
@on.setter
|
|
468
|
-
def on(self, val: bool):
|
|
469
|
-
self.setter('on', 1 if val else 0)
|
|
470
|
-
|
|
471
|
-
@property
|
|
472
|
-
def mode(self) -> str:
|
|
473
|
-
opts = ('peq', 'geq', 'teq')
|
|
474
|
-
return opts[self.getter('mode')[0]]
|
|
475
|
-
|
|
476
|
-
@mode.setter
|
|
477
|
-
def mode(self, val: str):
|
|
478
|
-
opts = ('peq', 'geq', 'teq')
|
|
479
|
-
if val not in opts:
|
|
480
|
-
self.logger.warning(f'mode got {val}, expected one of {opts}')
|
|
481
|
-
self.setter('mode', opts.index(val))
|
|
482
|
-
|
|
483
|
-
class EQBand:
|
|
484
|
-
def __init__(self, i, remote, index):
|
|
485
|
-
super(EQ.EQBand, self).__init__(remote, index)
|
|
486
|
-
self.i = i
|
|
487
|
-
|
|
488
|
-
@property
|
|
489
|
-
def address(self) -> str:
|
|
490
|
-
root = super(EQ.EQBand, self).address
|
|
491
|
-
return f'{root}/eq/{self.i}'
|
|
492
|
-
|
|
493
|
-
@property
|
|
494
|
-
def type(self) -> int:
|
|
495
|
-
return int(self.getter('type')[0])
|
|
496
|
-
|
|
497
|
-
@type.setter
|
|
498
|
-
def type(self, val: int):
|
|
499
|
-
self.setter('type', val)
|
|
500
|
-
|
|
501
|
-
@property
|
|
502
|
-
def frequency(self) -> float:
|
|
503
|
-
retval = util.log_get(20, 20000, self.getter('f')[0])
|
|
504
|
-
return round(retval, 1)
|
|
505
|
-
|
|
506
|
-
@frequency.setter
|
|
507
|
-
def frequency(self, val: float):
|
|
508
|
-
if not 20 <= val <= 20000:
|
|
509
|
-
self.logger.warning(
|
|
510
|
-
f'frequency got {val}, expected value in range 20.0 to 20000.0'
|
|
511
|
-
)
|
|
512
|
-
self.setter('f', util.log_set(20, 20000, val))
|
|
513
|
-
|
|
514
|
-
@property
|
|
515
|
-
def gain(self) -> float:
|
|
516
|
-
return round(util.lin_get(-15, 15, self.getter('g')[0]), 1)
|
|
517
|
-
|
|
518
|
-
@gain.setter
|
|
519
|
-
def gain(self, val: float):
|
|
520
|
-
if not -15 <= val <= 15:
|
|
521
|
-
self.logger.warning(
|
|
522
|
-
f'gain got {val}, expected value in range -15.0 to 15.0'
|
|
523
|
-
)
|
|
524
|
-
self.setter('g', util.lin_set(-15, 15, val))
|
|
525
|
-
|
|
526
|
-
@property
|
|
527
|
-
def quality(self) -> float:
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
"
|
|
553
|
-
"
|
|
554
|
-
"
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
@
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
@
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
self.
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
@
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
@
|
|
672
|
-
|
|
673
|
-
|
|
1
|
+
from typing import Optional, Union
|
|
2
|
+
|
|
3
|
+
from . import util
|
|
4
|
+
from .meta import geq_prop
|
|
5
|
+
|
|
6
|
+
"""
|
|
7
|
+
Classes shared by /ch, /rtn, /rtn/aux, /bus, /fxsend, /lr
|
|
8
|
+
"""
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class Config:
|
|
12
|
+
@property
|
|
13
|
+
def address(self) -> str:
|
|
14
|
+
root = super(Config, self).address
|
|
15
|
+
return f'{root}/config'
|
|
16
|
+
|
|
17
|
+
@property
|
|
18
|
+
def name(self) -> str:
|
|
19
|
+
return self.getter('name')[0]
|
|
20
|
+
|
|
21
|
+
@name.setter
|
|
22
|
+
def name(self, val: str):
|
|
23
|
+
self.setter('name', val)
|
|
24
|
+
|
|
25
|
+
@property
|
|
26
|
+
def color(self) -> int:
|
|
27
|
+
return self.getter('color')[0]
|
|
28
|
+
|
|
29
|
+
@color.setter
|
|
30
|
+
def color(self, val: int):
|
|
31
|
+
self.setter('color', val)
|
|
32
|
+
|
|
33
|
+
@property
|
|
34
|
+
def inputsource(self) -> int:
|
|
35
|
+
return self.getter('insrc')[0]
|
|
36
|
+
|
|
37
|
+
@inputsource.setter
|
|
38
|
+
def inputsource(self, val: int):
|
|
39
|
+
self.setter('insrc', val)
|
|
40
|
+
|
|
41
|
+
@property
|
|
42
|
+
def usbreturn(self) -> int:
|
|
43
|
+
return self.getter('rtnsrc')[0]
|
|
44
|
+
|
|
45
|
+
@usbreturn.setter
|
|
46
|
+
def usbreturn(self, val: int):
|
|
47
|
+
self.setter('rtnsrc', val)
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
class Preamp:
|
|
51
|
+
@property
|
|
52
|
+
def address(self) -> str:
|
|
53
|
+
root = super(Preamp, self).address
|
|
54
|
+
return f'{root}/preamp'
|
|
55
|
+
|
|
56
|
+
@property
|
|
57
|
+
def usbtrim(self) -> float:
|
|
58
|
+
return round(util.lin_get(-18, 18, self.getter('rtntrim')[0]), 1)
|
|
59
|
+
|
|
60
|
+
@usbtrim.setter
|
|
61
|
+
def usbtrim(self, val: float):
|
|
62
|
+
if not -18 <= val <= 18:
|
|
63
|
+
self.logger.warning(
|
|
64
|
+
f'usbtrim got {val}, expected value in range -18.0 to 18.0'
|
|
65
|
+
)
|
|
66
|
+
self.setter('rtntrim', util.lin_set(-18, 18, val))
|
|
67
|
+
|
|
68
|
+
@property
|
|
69
|
+
def usbinput(self) -> bool:
|
|
70
|
+
return self.getter('rtnsw')[0] == 1
|
|
71
|
+
|
|
72
|
+
@usbinput.setter
|
|
73
|
+
def usbinput(self, val: bool):
|
|
74
|
+
self.setter('rtnsw', 1 if val else 0)
|
|
75
|
+
|
|
76
|
+
@property
|
|
77
|
+
def invert(self) -> bool:
|
|
78
|
+
return self.getter('invert')[0] == 1
|
|
79
|
+
|
|
80
|
+
@invert.setter
|
|
81
|
+
def invert(self, val: bool):
|
|
82
|
+
self.setter('invert', 1 if val else 0)
|
|
83
|
+
|
|
84
|
+
@property
|
|
85
|
+
def highpasson(self) -> bool:
|
|
86
|
+
return self.getter('hpon')[0] == 1
|
|
87
|
+
|
|
88
|
+
@highpasson.setter
|
|
89
|
+
def highpasson(self, val: bool):
|
|
90
|
+
self.setter('hpon', 1 if val else 0)
|
|
91
|
+
|
|
92
|
+
@property
|
|
93
|
+
def highpassfilter(self) -> int:
|
|
94
|
+
return int(util.log_get(20, 400, self.getter('hpf')[0]))
|
|
95
|
+
|
|
96
|
+
@highpassfilter.setter
|
|
97
|
+
def highpassfilter(self, val: int):
|
|
98
|
+
if not 20 <= val <= 400:
|
|
99
|
+
self.logger.warning(
|
|
100
|
+
f'highpassfilter got {val}, expected value in range 20 to 400'
|
|
101
|
+
)
|
|
102
|
+
self.setter('hpf', util.log_set(20, 400, val))
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
class Gate:
|
|
106
|
+
@property
|
|
107
|
+
def address(self) -> str:
|
|
108
|
+
root = super(Gate, self).address
|
|
109
|
+
return f'{root}/gate'
|
|
110
|
+
|
|
111
|
+
@property
|
|
112
|
+
def on(self) -> bool:
|
|
113
|
+
return self.getter('on')[0] == 1
|
|
114
|
+
|
|
115
|
+
@on.setter
|
|
116
|
+
def on(self, val: bool):
|
|
117
|
+
self.setter('on', 1 if val else 0)
|
|
118
|
+
|
|
119
|
+
@property
|
|
120
|
+
def mode(self) -> str:
|
|
121
|
+
opts = ('gate', 'exp2', 'exp3', 'exp4', 'duck')
|
|
122
|
+
return opts[self.getter('mode')[0]]
|
|
123
|
+
|
|
124
|
+
@mode.setter
|
|
125
|
+
def mode(self, val: str):
|
|
126
|
+
opts = ('gate', 'exp2', 'exp3', 'exp4', 'duck')
|
|
127
|
+
if val not in opts:
|
|
128
|
+
self.logger.warning(f'mode got {val}, expected one of {opts}')
|
|
129
|
+
self.setter('mode', opts.index(val))
|
|
130
|
+
|
|
131
|
+
@property
|
|
132
|
+
def threshold(self) -> float:
|
|
133
|
+
return round(util.lin_get(-80, 0, self.getter('thr')[0]), 1)
|
|
134
|
+
|
|
135
|
+
@threshold.setter
|
|
136
|
+
def threshold(self, val: float):
|
|
137
|
+
if not -80 <= val <= 0:
|
|
138
|
+
self.logger.warning(
|
|
139
|
+
f'threshold got {val}, expected value in range -80.0 to 0.0'
|
|
140
|
+
)
|
|
141
|
+
self.setter('thr', util.lin_set(-80, 0, val))
|
|
142
|
+
|
|
143
|
+
@property
|
|
144
|
+
def range(self) -> int:
|
|
145
|
+
return int(util.lin_get(3, 60, self.getter('range')[0]))
|
|
146
|
+
|
|
147
|
+
@range.setter
|
|
148
|
+
def range(self, val: int):
|
|
149
|
+
if not 3 <= val <= 60:
|
|
150
|
+
self.logger.warning(f'range got {val}, expected value in range 3 to 60')
|
|
151
|
+
self.setter('range', util.lin_set(3, 60, val))
|
|
152
|
+
|
|
153
|
+
@property
|
|
154
|
+
def attack(self) -> int:
|
|
155
|
+
return int(util.lin_get(0, 120, self.getter('attack')[0]))
|
|
156
|
+
|
|
157
|
+
@attack.setter
|
|
158
|
+
def attack(self, val: int):
|
|
159
|
+
if not 0 <= val <= 120:
|
|
160
|
+
self.logger.warning(f'attack got {val}, expected value in range 0 to 120')
|
|
161
|
+
self.setter('attack', util.lin_set(0, 120, val))
|
|
162
|
+
|
|
163
|
+
@property
|
|
164
|
+
def hold(self) -> Union[float, int]:
|
|
165
|
+
val = util.log_get(0.02, 2000, self.getter('hold')[0])
|
|
166
|
+
return round(val, 1) if val < 100 else int(val)
|
|
167
|
+
|
|
168
|
+
@hold.setter
|
|
169
|
+
def hold(self, val: float):
|
|
170
|
+
if not 0.02 <= val <= 2000:
|
|
171
|
+
self.logger.warning(
|
|
172
|
+
f'hold got {val}, expected value in range 0.02 to 2000.0'
|
|
173
|
+
)
|
|
174
|
+
self.setter('hold', util.log_set(0.02, 2000, val))
|
|
175
|
+
|
|
176
|
+
@property
|
|
177
|
+
def release(self) -> int:
|
|
178
|
+
return int(util.log_get(5, 4000, self.getter('release')[0]))
|
|
179
|
+
|
|
180
|
+
@release.setter
|
|
181
|
+
def release(self, val: int):
|
|
182
|
+
if not 5 <= val <= 4000:
|
|
183
|
+
self.logger.warning(f'release got {val}, expected value in range 5 to 4000')
|
|
184
|
+
self.setter('release', util.log_set(5, 4000, val))
|
|
185
|
+
|
|
186
|
+
@property
|
|
187
|
+
def keysource(self):
|
|
188
|
+
return self.getter('keysrc')[0]
|
|
189
|
+
|
|
190
|
+
@keysource.setter
|
|
191
|
+
def keysource(self, val):
|
|
192
|
+
self.setter('keysrc', val)
|
|
193
|
+
|
|
194
|
+
@property
|
|
195
|
+
def filteron(self):
|
|
196
|
+
return self.getter('filter/on')[0] == 1
|
|
197
|
+
|
|
198
|
+
@filteron.setter
|
|
199
|
+
def filteron(self, val: bool):
|
|
200
|
+
self.setter('filter/on', 1 if val else 0)
|
|
201
|
+
|
|
202
|
+
@property
|
|
203
|
+
def filtertype(self) -> int:
|
|
204
|
+
return int(self.getter('filter/type')[0])
|
|
205
|
+
|
|
206
|
+
@filtertype.setter
|
|
207
|
+
def filtertype(self, val: int):
|
|
208
|
+
self.setter('filter/type', val)
|
|
209
|
+
|
|
210
|
+
@property
|
|
211
|
+
def filterfreq(self) -> Union[float, int]:
|
|
212
|
+
retval = util.log_get(20, 20000, self.getter('filter/f')[0])
|
|
213
|
+
return int(retval) if retval > 1000 else round(retval, 1)
|
|
214
|
+
|
|
215
|
+
@filterfreq.setter
|
|
216
|
+
def filterfreq(self, val: Union[float, int]):
|
|
217
|
+
if not 20 <= val <= 20000:
|
|
218
|
+
self.logger.warning(
|
|
219
|
+
f'filterfreq got {val}, expected value in range 20 to 20000'
|
|
220
|
+
)
|
|
221
|
+
self.setter('filter/f', util.log_set(20, 20000, val))
|
|
222
|
+
|
|
223
|
+
|
|
224
|
+
class Dyn:
|
|
225
|
+
@property
|
|
226
|
+
def address(self) -> str:
|
|
227
|
+
root = super(Dyn, self).address
|
|
228
|
+
return f'{root}/dyn'
|
|
229
|
+
|
|
230
|
+
@property
|
|
231
|
+
def on(self) -> bool:
|
|
232
|
+
return self.getter('on')[0] == 1
|
|
233
|
+
|
|
234
|
+
@on.setter
|
|
235
|
+
def on(self, val: bool):
|
|
236
|
+
self.setter('on', 1 if val else 0)
|
|
237
|
+
|
|
238
|
+
@property
|
|
239
|
+
def mode(self) -> str:
|
|
240
|
+
opts = ('comp', 'exp')
|
|
241
|
+
return opts[self.getter('mode')[0]]
|
|
242
|
+
|
|
243
|
+
@mode.setter
|
|
244
|
+
def mode(self, val: str):
|
|
245
|
+
opts = ('comp', 'exp')
|
|
246
|
+
if val not in opts:
|
|
247
|
+
self.logger.warning(f'mode got {val}, expected one of {opts}')
|
|
248
|
+
self.setter('mode', opts.index(val))
|
|
249
|
+
|
|
250
|
+
@property
|
|
251
|
+
def det(self) -> str:
|
|
252
|
+
opts = ('peak', 'rms')
|
|
253
|
+
return opts[self.getter('det')[0]]
|
|
254
|
+
|
|
255
|
+
@det.setter
|
|
256
|
+
def det(self, val: str):
|
|
257
|
+
opts = ('peak', 'rms')
|
|
258
|
+
if val not in opts:
|
|
259
|
+
self.logger.warning(f'det got {val}, expected one of {opts}')
|
|
260
|
+
self.setter('det', opts.index(val))
|
|
261
|
+
|
|
262
|
+
@property
|
|
263
|
+
def env(self) -> str:
|
|
264
|
+
opts = ('lin', 'log')
|
|
265
|
+
return opts[self.getter('env')[0]]
|
|
266
|
+
|
|
267
|
+
@env.setter
|
|
268
|
+
def env(self, val: str):
|
|
269
|
+
opts = ('lin', 'log')
|
|
270
|
+
if val not in opts:
|
|
271
|
+
self.logger.warning(f'env got {val}, expected one of {opts}')
|
|
272
|
+
self.setter('env', opts.index(val))
|
|
273
|
+
|
|
274
|
+
@property
|
|
275
|
+
def threshold(self) -> float:
|
|
276
|
+
return round(util.lin_get(-60, 0, self.getter('thr')[0]), 1)
|
|
277
|
+
|
|
278
|
+
@threshold.setter
|
|
279
|
+
def threshold(self, val: float):
|
|
280
|
+
if not -60 <= val <= 0:
|
|
281
|
+
self.logger.warning(
|
|
282
|
+
f'threshold got {val}, expected value in range -60.0 to 0'
|
|
283
|
+
)
|
|
284
|
+
self.setter('thr', util.lin_set(-60, 0, val))
|
|
285
|
+
|
|
286
|
+
@property
|
|
287
|
+
def ratio(self) -> Union[float, int]:
|
|
288
|
+
opts = (1.1, 1.3, 1.5, 2.0, 2.5, 3.0, 4.0, 5.0, 7.0, 10, 20, 100)
|
|
289
|
+
return opts[self.getter('ratio')[0]]
|
|
290
|
+
|
|
291
|
+
@ratio.setter
|
|
292
|
+
def ratio(self, val: int):
|
|
293
|
+
self.setter('ratio', val)
|
|
294
|
+
|
|
295
|
+
@property
|
|
296
|
+
def knee(self) -> int:
|
|
297
|
+
return int(util.lin_get(0, 5, self.getter('knee')[0]))
|
|
298
|
+
|
|
299
|
+
@knee.setter
|
|
300
|
+
def knee(self, val: int):
|
|
301
|
+
if not 0 <= val <= 5:
|
|
302
|
+
self.logger.warning(f'knee got {val}, expected value in range 0 to 5')
|
|
303
|
+
self.setter('knee', util.lin_set(0, 5, val))
|
|
304
|
+
|
|
305
|
+
@property
|
|
306
|
+
def mgain(self) -> float:
|
|
307
|
+
return round(util.lin_get(0, 24, self.getter('mgain')[0]), 1)
|
|
308
|
+
|
|
309
|
+
@mgain.setter
|
|
310
|
+
def mgain(self, val: float):
|
|
311
|
+
if not 0 <= val <= 24:
|
|
312
|
+
self.logger.warning(f'mgain got {val}, expected value in range 0.0 to 24.0')
|
|
313
|
+
self.setter('mgain', util.lin_set(0, 24, val))
|
|
314
|
+
|
|
315
|
+
@property
|
|
316
|
+
def attack(self) -> int:
|
|
317
|
+
return int(util.lin_get(0, 120, self.getter('attack')[0]))
|
|
318
|
+
|
|
319
|
+
@attack.setter
|
|
320
|
+
def attack(self, val: int):
|
|
321
|
+
if not 0 <= val <= 120:
|
|
322
|
+
self.logger.warning(f'attack got {val}, expected value in range 0 to 120')
|
|
323
|
+
self.setter('attack', util.lin_set(0, 120, val))
|
|
324
|
+
|
|
325
|
+
@property
|
|
326
|
+
def hold(self) -> Union[float, int]:
|
|
327
|
+
val = util.log_get(0.02, 2000, self.getter('hold')[0])
|
|
328
|
+
return round(val, 1) if val < 100 else int(val)
|
|
329
|
+
|
|
330
|
+
@hold.setter
|
|
331
|
+
def hold(self, val: float):
|
|
332
|
+
if not 0.02 <= val <= 2000:
|
|
333
|
+
self.logger.warning(
|
|
334
|
+
f'hold got {val}, expected value in range 0.02 to 2000.0'
|
|
335
|
+
)
|
|
336
|
+
self.setter('hold', util.log_set(0.02, 2000, val))
|
|
337
|
+
|
|
338
|
+
@property
|
|
339
|
+
def release(self) -> int:
|
|
340
|
+
return int(util.log_get(5, 4000, self.getter('release')[0]))
|
|
341
|
+
|
|
342
|
+
@release.setter
|
|
343
|
+
def release(self, val: int):
|
|
344
|
+
if not 5 <= val <= 4000:
|
|
345
|
+
self.logger.warning(f'release got {val}, expected value in range 5 to 4000')
|
|
346
|
+
self.setter('release', util.log_set(5, 4000, val))
|
|
347
|
+
|
|
348
|
+
@property
|
|
349
|
+
def mix(self) -> int:
|
|
350
|
+
return int(util.lin_get(0, 100, self.getter('mix')[0]))
|
|
351
|
+
|
|
352
|
+
@mix.setter
|
|
353
|
+
def mix(self, val: int):
|
|
354
|
+
if not 0 <= val <= 100:
|
|
355
|
+
self.logger.warning(f'mix got {val}, expected value in range 0 to 100')
|
|
356
|
+
self.setter('mix', util.lin_set(0, 100, val))
|
|
357
|
+
|
|
358
|
+
@property
|
|
359
|
+
def keysource(self):
|
|
360
|
+
return self.getter('keysrc')[0]
|
|
361
|
+
|
|
362
|
+
@keysource.setter
|
|
363
|
+
def keysource(self, val):
|
|
364
|
+
self.setter('keysrc', val)
|
|
365
|
+
|
|
366
|
+
@property
|
|
367
|
+
def auto(self) -> bool:
|
|
368
|
+
return self.getter('auto')[0] == 1
|
|
369
|
+
|
|
370
|
+
@auto.setter
|
|
371
|
+
def auto(self, val: bool):
|
|
372
|
+
self.setter('auto', 1 if val else 0)
|
|
373
|
+
|
|
374
|
+
@property
|
|
375
|
+
def filteron(self):
|
|
376
|
+
return self.getter('filter/on')[0] == 1
|
|
377
|
+
|
|
378
|
+
@filteron.setter
|
|
379
|
+
def filteron(self, val: bool):
|
|
380
|
+
self.setter('filter/on', 1 if val else 0)
|
|
381
|
+
|
|
382
|
+
@property
|
|
383
|
+
def filtertype(self) -> int:
|
|
384
|
+
return int(self.getter('filter/type')[0])
|
|
385
|
+
|
|
386
|
+
@filtertype.setter
|
|
387
|
+
def filtertype(self, val: int):
|
|
388
|
+
self.setter('filter/type', val)
|
|
389
|
+
|
|
390
|
+
@property
|
|
391
|
+
def filterfreq(self) -> Union[float, int]:
|
|
392
|
+
retval = util.log_get(20, 20000, self.getter('filter/f')[0])
|
|
393
|
+
return int(retval) if retval > 1000 else round(retval, 1)
|
|
394
|
+
|
|
395
|
+
@filterfreq.setter
|
|
396
|
+
def filterfreq(self, val: Union[float, int]):
|
|
397
|
+
if not 20 <= val <= 20000:
|
|
398
|
+
self.logger.warning(
|
|
399
|
+
f'filterfreq got {val}, expected value in range 20 to 20000'
|
|
400
|
+
)
|
|
401
|
+
self.setter('filter/f', util.log_set(20, 20000, val))
|
|
402
|
+
|
|
403
|
+
|
|
404
|
+
class Insert:
|
|
405
|
+
@property
|
|
406
|
+
def address(self) -> str:
|
|
407
|
+
root = super(Insert, self).address
|
|
408
|
+
return f'{root}/insert'
|
|
409
|
+
|
|
410
|
+
@property
|
|
411
|
+
def on(self) -> bool:
|
|
412
|
+
return self.getter('on')[0] == 1
|
|
413
|
+
|
|
414
|
+
@on.setter
|
|
415
|
+
def on(self, val: bool):
|
|
416
|
+
self.setter('on', 1 if val else 0)
|
|
417
|
+
|
|
418
|
+
@property
|
|
419
|
+
def sel(self) -> int:
|
|
420
|
+
return self.getter('sel')[0]
|
|
421
|
+
|
|
422
|
+
@sel.setter
|
|
423
|
+
def sel(self, val: int):
|
|
424
|
+
self.setter('sel', val)
|
|
425
|
+
|
|
426
|
+
|
|
427
|
+
class EQ:
|
|
428
|
+
@classmethod
|
|
429
|
+
def make_fourband(cls, _cls, remote, index=None):
|
|
430
|
+
EQBand_cls = type('EQBand', (EQ.EQBand, _cls), {})
|
|
431
|
+
return type(
|
|
432
|
+
'EQ',
|
|
433
|
+
(cls,),
|
|
434
|
+
{
|
|
435
|
+
'low': EQBand_cls(1, remote, index),
|
|
436
|
+
'lomid': EQBand_cls(2, remote, index),
|
|
437
|
+
'himid': EQBand_cls(3, remote, index),
|
|
438
|
+
'high': EQBand_cls(4, remote, index),
|
|
439
|
+
},
|
|
440
|
+
)
|
|
441
|
+
|
|
442
|
+
@classmethod
|
|
443
|
+
def make_sixband(cls, _cls, remote, index=None):
|
|
444
|
+
EQBand_cls = type('EQBand', (EQ.EQBand, _cls), {})
|
|
445
|
+
return type(
|
|
446
|
+
'EQ',
|
|
447
|
+
(cls,),
|
|
448
|
+
{
|
|
449
|
+
'low': EQBand_cls(1, remote, index),
|
|
450
|
+
'low2': EQBand_cls(2, remote, index),
|
|
451
|
+
'lomid': EQBand_cls(3, remote, index),
|
|
452
|
+
'himid': EQBand_cls(4, remote, index),
|
|
453
|
+
'high2': EQBand_cls(5, remote, index),
|
|
454
|
+
'high': EQBand_cls(6, remote, index),
|
|
455
|
+
},
|
|
456
|
+
)
|
|
457
|
+
|
|
458
|
+
@property
|
|
459
|
+
def address(self) -> str:
|
|
460
|
+
root = super(EQ, self).address
|
|
461
|
+
return f'{root}/eq'
|
|
462
|
+
|
|
463
|
+
@property
|
|
464
|
+
def on(self) -> bool:
|
|
465
|
+
return self.getter('on')[0] == 1
|
|
466
|
+
|
|
467
|
+
@on.setter
|
|
468
|
+
def on(self, val: bool):
|
|
469
|
+
self.setter('on', 1 if val else 0)
|
|
470
|
+
|
|
471
|
+
@property
|
|
472
|
+
def mode(self) -> str:
|
|
473
|
+
opts = ('peq', 'geq', 'teq')
|
|
474
|
+
return opts[self.getter('mode')[0]]
|
|
475
|
+
|
|
476
|
+
@mode.setter
|
|
477
|
+
def mode(self, val: str):
|
|
478
|
+
opts = ('peq', 'geq', 'teq')
|
|
479
|
+
if val not in opts:
|
|
480
|
+
self.logger.warning(f'mode got {val}, expected one of {opts}')
|
|
481
|
+
self.setter('mode', opts.index(val))
|
|
482
|
+
|
|
483
|
+
class EQBand:
|
|
484
|
+
def __init__(self, i, remote, index):
|
|
485
|
+
super(EQ.EQBand, self).__init__(remote, index)
|
|
486
|
+
self.i = i
|
|
487
|
+
|
|
488
|
+
@property
|
|
489
|
+
def address(self) -> str:
|
|
490
|
+
root = super(EQ.EQBand, self).address
|
|
491
|
+
return f'{root}/eq/{self.i}'
|
|
492
|
+
|
|
493
|
+
@property
|
|
494
|
+
def type(self) -> int:
|
|
495
|
+
return int(self.getter('type')[0])
|
|
496
|
+
|
|
497
|
+
@type.setter
|
|
498
|
+
def type(self, val: int):
|
|
499
|
+
self.setter('type', val)
|
|
500
|
+
|
|
501
|
+
@property
|
|
502
|
+
def frequency(self) -> float:
|
|
503
|
+
retval = util.log_get(20, 20000, self.getter('f')[0])
|
|
504
|
+
return round(retval, 1)
|
|
505
|
+
|
|
506
|
+
@frequency.setter
|
|
507
|
+
def frequency(self, val: float):
|
|
508
|
+
if not 20 <= val <= 20000:
|
|
509
|
+
self.logger.warning(
|
|
510
|
+
f'frequency got {val}, expected value in range 20.0 to 20000.0'
|
|
511
|
+
)
|
|
512
|
+
self.setter('f', util.log_set(20, 20000, val))
|
|
513
|
+
|
|
514
|
+
@property
|
|
515
|
+
def gain(self) -> float:
|
|
516
|
+
return round(util.lin_get(-15, 15, self.getter('g')[0]), 1)
|
|
517
|
+
|
|
518
|
+
@gain.setter
|
|
519
|
+
def gain(self, val: float):
|
|
520
|
+
if not -15 <= val <= 15:
|
|
521
|
+
self.logger.warning(
|
|
522
|
+
f'gain got {val}, expected value in range -15.0 to 15.0'
|
|
523
|
+
)
|
|
524
|
+
self.setter('g', util.lin_set(-15, 15, val))
|
|
525
|
+
|
|
526
|
+
@property
|
|
527
|
+
def quality(self) -> float:
|
|
528
|
+
raw_value = self.getter('q')[0]
|
|
529
|
+
retval = util.log_get(0.3, 10, 1.0 - raw_value)
|
|
530
|
+
return round(retval, 1)
|
|
531
|
+
|
|
532
|
+
@quality.setter
|
|
533
|
+
def quality(self, val: float):
|
|
534
|
+
if not 0.3 <= val <= 10:
|
|
535
|
+
self.logger.warning(
|
|
536
|
+
f'quality got {val}, expected value in range 0.3 to 10.0'
|
|
537
|
+
)
|
|
538
|
+
self.setter('q', 1.0 - util.log_set(0.3, 10, val))
|
|
539
|
+
|
|
540
|
+
|
|
541
|
+
class GEQ:
|
|
542
|
+
@classmethod
|
|
543
|
+
def make(cls):
|
|
544
|
+
# fmt: off
|
|
545
|
+
return type(
|
|
546
|
+
"GEQ",
|
|
547
|
+
(cls,),
|
|
548
|
+
{
|
|
549
|
+
**{
|
|
550
|
+
f"slider_{param}": geq_prop(param)
|
|
551
|
+
for param in [
|
|
552
|
+
"20", "25", "31_5", "40", "50", "63", "80", "100", "125",
|
|
553
|
+
"160", "200", "250", "315", "400", "500", "630", "800", "1k",
|
|
554
|
+
"1k25", "1k6", "2k", "2k5", "3k15", "4k", "5k", "6k3", "8k",
|
|
555
|
+
"10k", "12k5", "16k", "20k",
|
|
556
|
+
]
|
|
557
|
+
}
|
|
558
|
+
},
|
|
559
|
+
)
|
|
560
|
+
# fmt: on
|
|
561
|
+
|
|
562
|
+
@property
|
|
563
|
+
def address(self) -> str:
|
|
564
|
+
root = super(GEQ, self).address
|
|
565
|
+
return f'{root}/geq'
|
|
566
|
+
|
|
567
|
+
|
|
568
|
+
class Mix:
|
|
569
|
+
@property
|
|
570
|
+
def address(self) -> str:
|
|
571
|
+
root = super(Mix, self).address
|
|
572
|
+
return f'{root}/mix'
|
|
573
|
+
|
|
574
|
+
@property
|
|
575
|
+
def on(self) -> bool:
|
|
576
|
+
return self.getter('on')[0] == 1
|
|
577
|
+
|
|
578
|
+
@on.setter
|
|
579
|
+
def on(self, val: bool):
|
|
580
|
+
self.setter('on', 1 if val else 0)
|
|
581
|
+
|
|
582
|
+
@property
|
|
583
|
+
@util.db_from
|
|
584
|
+
def fader(self) -> float:
|
|
585
|
+
return self.getter('fader')[0]
|
|
586
|
+
|
|
587
|
+
@fader.setter
|
|
588
|
+
@util.db_to
|
|
589
|
+
def fader(self, val: float):
|
|
590
|
+
self.setter('fader', val)
|
|
591
|
+
|
|
592
|
+
@property
|
|
593
|
+
def lr(self) -> bool:
|
|
594
|
+
return self.getter('lr')[0] == 1
|
|
595
|
+
|
|
596
|
+
@lr.setter
|
|
597
|
+
def lr(self, val: bool):
|
|
598
|
+
self.setter('lr', 1 if val else 0)
|
|
599
|
+
|
|
600
|
+
|
|
601
|
+
class Group:
|
|
602
|
+
@property
|
|
603
|
+
def address(self) -> str:
|
|
604
|
+
root = super(Group, self).address
|
|
605
|
+
return f'{root}/grp'
|
|
606
|
+
|
|
607
|
+
@property
|
|
608
|
+
def dca(self) -> int:
|
|
609
|
+
return self.getter('dca')[0]
|
|
610
|
+
|
|
611
|
+
@dca.setter
|
|
612
|
+
def dca(self, val: int):
|
|
613
|
+
self.setter('dca', val)
|
|
614
|
+
|
|
615
|
+
@property
|
|
616
|
+
def mute(self) -> int:
|
|
617
|
+
return self.getter('mute')[0]
|
|
618
|
+
|
|
619
|
+
@mute.setter
|
|
620
|
+
def mute(self, val: int):
|
|
621
|
+
self.setter('mute', val)
|
|
622
|
+
|
|
623
|
+
|
|
624
|
+
class Automix:
|
|
625
|
+
@property
|
|
626
|
+
def address(self) -> str:
|
|
627
|
+
root = super(Automix, self).address
|
|
628
|
+
return f'{root}/automix'
|
|
629
|
+
|
|
630
|
+
@property
|
|
631
|
+
def group(self) -> int:
|
|
632
|
+
return self.getter('group')[0]
|
|
633
|
+
|
|
634
|
+
@group.setter
|
|
635
|
+
def group(self, val: int):
|
|
636
|
+
self.setter('group', val)
|
|
637
|
+
|
|
638
|
+
@property
|
|
639
|
+
def weight(self) -> float:
|
|
640
|
+
return round(util.lin_get(-12, 12, self.getter('weight')[0]), 1)
|
|
641
|
+
|
|
642
|
+
@weight.setter
|
|
643
|
+
def weight(self, val: float):
|
|
644
|
+
if not -12 <= val <= 12:
|
|
645
|
+
self.logger.warning(
|
|
646
|
+
f'weight got {val}, expected value in range -12.0 to 12.0'
|
|
647
|
+
)
|
|
648
|
+
self.setter('weight', util.lin_set(-12, 12, val))
|
|
649
|
+
|
|
650
|
+
|
|
651
|
+
class Send:
|
|
652
|
+
def __init__(self, i, remote, index: Optional[int] = None):
|
|
653
|
+
super(Send, self).__init__(remote, index)
|
|
654
|
+
self.i = i + 1
|
|
655
|
+
|
|
656
|
+
@classmethod
|
|
657
|
+
def make(cls, _cls, i, remote, index=None):
|
|
658
|
+
SEND_cls = type('Send', (cls, _cls), {})
|
|
659
|
+
return SEND_cls(i, remote, index)
|
|
660
|
+
|
|
661
|
+
@property
|
|
662
|
+
def address(self) -> str:
|
|
663
|
+
root = super(Send, self).address
|
|
664
|
+
return f'{root}/mix/{str(self.i).zfill(2)}'
|
|
665
|
+
|
|
666
|
+
@property
|
|
667
|
+
@util.db_from
|
|
668
|
+
def level(self) -> float:
|
|
669
|
+
return self.getter('level')[0]
|
|
670
|
+
|
|
671
|
+
@level.setter
|
|
672
|
+
@util.db_to
|
|
673
|
+
def level(self, val: float):
|
|
674
|
+
self.setter('level', val)
|