libmdr-cli 0.1.1__tar.gz → 0.1.2__tar.gz
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.
- {libmdr_cli-0.1.1 → libmdr_cli-0.1.2}/PKG-INFO +3 -3
- {libmdr_cli-0.1.1 → libmdr_cli-0.1.2}/pyproject.toml +2 -2
- {libmdr_cli-0.1.1 → libmdr_cli-0.1.2}/src/libmdr_cli.egg-info/PKG-INFO +3 -3
- libmdr_cli-0.1.2/src/libmdr_cli.egg-info/requires.txt +2 -0
- {libmdr_cli-0.1.1 → libmdr_cli-0.1.2}/src/mdr/__main__.py +18 -18
- libmdr_cli-0.1.1/src/libmdr_cli.egg-info/requires.txt +0 -2
- {libmdr_cli-0.1.1 → libmdr_cli-0.1.2}/LICENSE +0 -0
- {libmdr_cli-0.1.1 → libmdr_cli-0.1.2}/README.md +0 -0
- {libmdr_cli-0.1.1 → libmdr_cli-0.1.2}/setup.cfg +0 -0
- {libmdr_cli-0.1.1 → libmdr_cli-0.1.2}/src/libmdr_cli.egg-info/SOURCES.txt +0 -0
- {libmdr_cli-0.1.1 → libmdr_cli-0.1.2}/src/libmdr_cli.egg-info/dependency_links.txt +0 -0
- {libmdr_cli-0.1.1 → libmdr_cli-0.1.2}/src/libmdr_cli.egg-info/entry_points.txt +0 -0
- {libmdr_cli-0.1.1 → libmdr_cli-0.1.2}/src/libmdr_cli.egg-info/top_level.txt +0 -0
- {libmdr_cli-0.1.1 → libmdr_cli-0.1.2}/src/mdr/__init__.py +0 -0
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: libmdr-cli
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.2
|
|
4
4
|
Summary: libmdr CLI Frontend
|
|
5
5
|
License-Expression: MIT
|
|
6
6
|
Project-URL: Source, https://github.com/mos9527/libmdr-py
|
|
7
7
|
Requires-Python: >=3.10
|
|
8
8
|
Description-Content-Type: text/markdown
|
|
9
9
|
License-File: LICENSE
|
|
10
|
-
Requires-Dist: libmdr==0.1.
|
|
11
|
-
Requires-Dist: libmdr-bt==0.1.
|
|
10
|
+
Requires-Dist: libmdr==0.1.2
|
|
11
|
+
Requires-Dist: libmdr-bt==0.1.2
|
|
12
12
|
Dynamic: license-file
|
|
13
13
|
|
|
14
14
|
# libmdr-cli
|
|
@@ -4,13 +4,13 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "libmdr-cli"
|
|
7
|
-
version = "0.1.
|
|
7
|
+
version = "0.1.2"
|
|
8
8
|
description = "libmdr CLI Frontend"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
requires-python = ">=3.10"
|
|
11
11
|
license = "MIT"
|
|
12
12
|
license-files = ["LICENSE"]
|
|
13
|
-
dependencies = ["libmdr==0.1.
|
|
13
|
+
dependencies = ["libmdr==0.1.2", "libmdr-bt==0.1.2"]
|
|
14
14
|
|
|
15
15
|
[project.urls]
|
|
16
16
|
Source = "https://github.com/mos9527/libmdr-py"
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: libmdr-cli
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.2
|
|
4
4
|
Summary: libmdr CLI Frontend
|
|
5
5
|
License-Expression: MIT
|
|
6
6
|
Project-URL: Source, https://github.com/mos9527/libmdr-py
|
|
7
7
|
Requires-Python: >=3.10
|
|
8
8
|
Description-Content-Type: text/markdown
|
|
9
9
|
License-File: LICENSE
|
|
10
|
-
Requires-Dist: libmdr==0.1.
|
|
11
|
-
Requires-Dist: libmdr-bt==0.1.
|
|
10
|
+
Requires-Dist: libmdr==0.1.2
|
|
11
|
+
Requires-Dist: libmdr-bt==0.1.2
|
|
12
12
|
Dynamic: license-file
|
|
13
13
|
|
|
14
14
|
# libmdr-cli
|
|
@@ -116,7 +116,7 @@ class Battery:
|
|
|
116
116
|
|
|
117
117
|
@dataclass
|
|
118
118
|
class NoiseControl:
|
|
119
|
-
mode: Literal["off", "nc", "amb"]
|
|
119
|
+
mode: Literal["off", "nc", "amb", "wind"]
|
|
120
120
|
level: Annotated[int, "ambient level 0..20"]
|
|
121
121
|
voice: Annotated[bool, "focus on voice"]
|
|
122
122
|
adaptive: Annotated[bool, "adaptive ambient sound"]
|
|
@@ -143,6 +143,7 @@ class Playback:
|
|
|
143
143
|
title: Annotated[str, RO] = ""
|
|
144
144
|
artist: Annotated[str, RO] = ""
|
|
145
145
|
album: Annotated[str, RO] = ""
|
|
146
|
+
genre: Annotated[str, RO] = ""
|
|
146
147
|
|
|
147
148
|
|
|
148
149
|
@dataclass
|
|
@@ -402,23 +403,25 @@ def read_battery(hp: Headphones, proto: int, view: int) -> Battery:
|
|
|
402
403
|
out = Battery()
|
|
403
404
|
for b in hp.get_batteries():
|
|
404
405
|
part = C.BATTERY_PART_NAMES.get(b.part)
|
|
405
|
-
if
|
|
406
|
+
if part:
|
|
406
407
|
setattr(out, part, int(b.level_percent))
|
|
407
408
|
if b.charging == C.CHARGING_YES:
|
|
408
409
|
out.charging.append(part)
|
|
409
410
|
return out
|
|
410
411
|
|
|
411
412
|
|
|
413
|
+
NOISE_MODES = {
|
|
414
|
+
"off": C.NOISE_MODE_OFF,
|
|
415
|
+
"nc": C.NOISE_MODE_CANCELLING,
|
|
416
|
+
"amb": C.NOISE_MODE_AMBIENT,
|
|
417
|
+
"wind": C.NOISE_MODE_WIND_NOISE_REDUCTION,
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
|
|
412
421
|
def read_anc(hp: Headphones, proto: int, view: int) -> NoiseControl:
|
|
413
422
|
nc = hp.get_noise_control(view)
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
mode = "off"
|
|
417
|
-
elif proto == C.PROTOCOL_V1:
|
|
418
|
-
mode = "nc" if level == C.NOISE_AMBIENT_LEVEL_V1_NOISE_CANCELLING else "amb"
|
|
419
|
-
else:
|
|
420
|
-
mode = "nc" if nc.mode == C.NOISE_MODE_CANCELLING else "amb"
|
|
421
|
-
return NoiseControl(mode, min(level, 20), bool(nc.focus_on_voice), bool(nc.adaptive_ambient))
|
|
423
|
+
mode = next((name for name, ident in NOISE_MODES.items() if ident == nc.mode), "unknown")
|
|
424
|
+
return NoiseControl(mode, int(nc.ambient_level), bool(nc.focus_on_voice), bool(nc.adaptive_ambient))
|
|
422
425
|
|
|
423
426
|
|
|
424
427
|
def write_anc(hp: Headphones, proto: int, old: NoiseControl, new: NoiseControl) -> None:
|
|
@@ -426,17 +429,13 @@ def write_anc(hp: Headphones, proto: int, old: NoiseControl, new: NoiseControl)
|
|
|
426
429
|
require(hp, C.FEATURE_NOISE_CANCELLING)
|
|
427
430
|
if new.mode == "amb":
|
|
428
431
|
require(hp, C.FEATURE_AMBIENT_SOUND)
|
|
432
|
+
if new.mode == "wind":
|
|
433
|
+
require(hp, C.FEATURE_WIND_NOISE_REDUCTION)
|
|
429
434
|
if new.adaptive != old.adaptive:
|
|
430
435
|
require(hp, C.FEATURE_ADAPTIVE_AMBIENT_SOUND)
|
|
431
|
-
v1 = proto == C.PROTOCOL_V1
|
|
432
436
|
nc = hp.get_noise_control(DESIRED)
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
elif v1:
|
|
436
|
-
nc.mode = C.NOISE_MODE_V1_ON
|
|
437
|
-
else:
|
|
438
|
-
nc.mode = C.NOISE_MODE_CANCELLING if new.mode == "nc" else C.NOISE_MODE_AMBIENT
|
|
439
|
-
nc.ambient_level = C.NOISE_AMBIENT_LEVEL_V1_NOISE_CANCELLING if v1 and new.mode == "nc" else new.level
|
|
437
|
+
nc.mode = NOISE_MODES[new.mode]
|
|
438
|
+
nc.ambient_level = new.level
|
|
440
439
|
nc.focus_on_voice = flag(new.voice)
|
|
441
440
|
nc.adaptive_ambient = flag(new.adaptive)
|
|
442
441
|
nc.changing_asm_level = C.FALSE
|
|
@@ -502,6 +501,7 @@ def read_playback(hp: Headphones, proto: int, view: int) -> Playback:
|
|
|
502
501
|
title=hp.get_text(C.TEXT_TRACK_TITLE),
|
|
503
502
|
artist=hp.get_text(C.TEXT_TRACK_ARTIST),
|
|
504
503
|
album=hp.get_text(C.TEXT_TRACK_ALBUM),
|
|
504
|
+
genre=hp.get_text(C.TEXT_TRACK_GENRE),
|
|
505
505
|
)
|
|
506
506
|
|
|
507
507
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|