libmdr 0.1.0__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-0.1.2/PKG-INFO +48 -0
- libmdr-0.1.2/README.md +32 -0
- {libmdr-0.1.0 → libmdr-0.1.2}/pyproject.toml +5 -5
- {libmdr-0.1.0 → libmdr-0.1.2}/setup.py +1 -1
- {libmdr-0.1.0 → libmdr-0.1.2}/src/libmdr/_generated_api.py +6 -1
- {libmdr-0.1.0 → libmdr-0.1.2}/src/libmdr/_generated_constants.py +37 -13
- {libmdr-0.1.0 → libmdr-0.1.2}/src/libmdr/_generated_result.py +1 -1
- {libmdr-0.1.0 → libmdr-0.1.2}/src/libmdr/constants.py +19 -9
- {libmdr-0.1.0 → libmdr-0.1.2}/src/libmdr/headphones.py +44 -0
- libmdr-0.1.2/src/libmdr.egg-info/PKG-INFO +48 -0
- libmdr-0.1.2/src/libmdr.egg-info/requires.txt +8 -0
- libmdr-0.1.0/PKG-INFO +0 -17
- libmdr-0.1.0/README.md +0 -1
- libmdr-0.1.0/src/libmdr.egg-info/PKG-INFO +0 -17
- libmdr-0.1.0/src/libmdr.egg-info/requires.txt +0 -8
- {libmdr-0.1.0 → libmdr-0.1.2}/LICENSE +0 -0
- {libmdr-0.1.0 → libmdr-0.1.2}/setup.cfg +0 -0
- {libmdr-0.1.0 → libmdr-0.1.2}/src/libmdr/__init__.py +0 -0
- {libmdr-0.1.0 → libmdr-0.1.2}/src/libmdr/_api.py +0 -0
- {libmdr-0.1.0 → libmdr-0.1.2}/src/libmdr/_dll.py +0 -0
- {libmdr-0.1.0 → libmdr-0.1.2}/src/libmdr/connection.py +0 -0
- {libmdr-0.1.0 → libmdr-0.1.2}/src/libmdr/result.py +0 -0
- {libmdr-0.1.0 → libmdr-0.1.2}/src/libmdr.egg-info/SOURCES.txt +0 -0
- {libmdr-0.1.0 → libmdr-0.1.2}/src/libmdr.egg-info/dependency_links.txt +0 -0
- {libmdr-0.1.0 → libmdr-0.1.2}/src/libmdr.egg-info/top_level.txt +0 -0
libmdr-0.1.2/PKG-INFO
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: libmdr
|
|
3
|
+
Version: 0.1.2
|
|
4
|
+
Summary: Python bindings for the mdr-shared C ABI
|
|
5
|
+
License-Expression: MIT
|
|
6
|
+
Project-URL: Source, https://github.com/mos9527/libmdr-py
|
|
7
|
+
Requires-Python: >=3.10
|
|
8
|
+
Description-Content-Type: text/markdown
|
|
9
|
+
License-File: LICENSE
|
|
10
|
+
Provides-Extra: dev
|
|
11
|
+
Provides-Extra: bt
|
|
12
|
+
Requires-Dist: libmdr-bt==0.1.2; extra == "bt"
|
|
13
|
+
Provides-Extra: cli
|
|
14
|
+
Requires-Dist: libmdr-cli==0.1.2; extra == "cli"
|
|
15
|
+
Dynamic: license-file
|
|
16
|
+
|
|
17
|
+
# libmdr
|
|
18
|
+
|
|
19
|
+
Python (ctypes) bindings for libmdr, the protocol library behind
|
|
20
|
+
[SonyHeadphonesClient](https://github.com/mos9527/SonyHeadphonesClient).
|
|
21
|
+
|
|
22
|
+
## Installation
|
|
23
|
+
|
|
24
|
+
```
|
|
25
|
+
pip install libmdr # core bindings
|
|
26
|
+
pip install libmdr[bt] # + libmdr-bt, the platform Bluetooth backend
|
|
27
|
+
pip install libmdr[cli] # + libmdr-cli, the `mdr` command line tool
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
The extras are shorthands for the standalone
|
|
31
|
+
[`libmdr-bt`](https://pypi.org/project/libmdr-bt/) and
|
|
32
|
+
[`libmdr-cli`](https://pypi.org/project/libmdr-cli/) packages.
|
|
33
|
+
|
|
34
|
+
## Platforms
|
|
35
|
+
|
|
36
|
+
Prebuilt wheels are not tied to a Python version, and install on any Python >= 3.10 on:
|
|
37
|
+
|
|
38
|
+
| OS | Architectures |
|
|
39
|
+
|-------------------|----------------------|
|
|
40
|
+
| Windows | x86-64, arm64 |
|
|
41
|
+
| macOS 12+ | x86-64, arm64 |
|
|
42
|
+
| Linux (glibc 2.17+) | x86-64, arm64, armv7 |
|
|
43
|
+
|
|
44
|
+
Elsewhere (e.g. musl) pip builds from the sdist, which needs CMake >= 3.31, git and a C++20 compiler.
|
|
45
|
+
|
|
46
|
+
## Links
|
|
47
|
+
|
|
48
|
+
- [Source and documentation](https://github.com/mos9527/libmdr-py)
|
libmdr-0.1.2/README.md
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# libmdr
|
|
2
|
+
|
|
3
|
+
Python (ctypes) bindings for libmdr, the protocol library behind
|
|
4
|
+
[SonyHeadphonesClient](https://github.com/mos9527/SonyHeadphonesClient).
|
|
5
|
+
|
|
6
|
+
## Installation
|
|
7
|
+
|
|
8
|
+
```
|
|
9
|
+
pip install libmdr # core bindings
|
|
10
|
+
pip install libmdr[bt] # + libmdr-bt, the platform Bluetooth backend
|
|
11
|
+
pip install libmdr[cli] # + libmdr-cli, the `mdr` command line tool
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
The extras are shorthands for the standalone
|
|
15
|
+
[`libmdr-bt`](https://pypi.org/project/libmdr-bt/) and
|
|
16
|
+
[`libmdr-cli`](https://pypi.org/project/libmdr-cli/) packages.
|
|
17
|
+
|
|
18
|
+
## Platforms
|
|
19
|
+
|
|
20
|
+
Prebuilt wheels are not tied to a Python version, and install on any Python >= 3.10 on:
|
|
21
|
+
|
|
22
|
+
| OS | Architectures |
|
|
23
|
+
|-------------------|----------------------|
|
|
24
|
+
| Windows | x86-64, arm64 |
|
|
25
|
+
| macOS 12+ | x86-64, arm64 |
|
|
26
|
+
| Linux (glibc 2.17+) | x86-64, arm64, armv7 |
|
|
27
|
+
|
|
28
|
+
Elsewhere (e.g. musl) pip builds from the sdist, which needs CMake >= 3.31, git and a C++20 compiler.
|
|
29
|
+
|
|
30
|
+
## Links
|
|
31
|
+
|
|
32
|
+
- [Source and documentation](https://github.com/mos9527/libmdr-py)
|
|
@@ -4,17 +4,17 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "libmdr"
|
|
7
|
-
version = "0.1.
|
|
7
|
+
version = "0.1.2"
|
|
8
8
|
description = "Python bindings for the mdr-shared C ABI"
|
|
9
|
-
readme =
|
|
9
|
+
readme = "README.md"
|
|
10
10
|
requires-python = ">=3.10"
|
|
11
11
|
license = "MIT"
|
|
12
12
|
license-files = ["LICENSE"]
|
|
13
13
|
|
|
14
14
|
[project.optional-dependencies]
|
|
15
15
|
dev = []
|
|
16
|
-
bt = ["libmdr-bt"]
|
|
17
|
-
cli = ["libmdr-cli"]
|
|
16
|
+
bt = ["libmdr-bt==0.1.2"]
|
|
17
|
+
cli = ["libmdr-cli==0.1.2"]
|
|
18
18
|
|
|
19
19
|
[project.urls]
|
|
20
20
|
Source = "https://github.com/mos9527/libmdr-py"
|
|
@@ -29,7 +29,7 @@ libmdr = ["_native/*"]
|
|
|
29
29
|
# loaded via ctypes, so it is built once per platform and cibuildwheel reuses
|
|
30
30
|
# that wheel to run the tests on every other selected interpreter.
|
|
31
31
|
[tool.cibuildwheel]
|
|
32
|
-
skip = ["*-musllinux_*"
|
|
32
|
+
skip = ["*-musllinux_*"]
|
|
33
33
|
build-verbosity = 1
|
|
34
34
|
test-command = "python -c \"import libmdr, libmdr._dll as d; print(d.load())\""
|
|
35
35
|
# Ubuntu 22.04 based; manylinux_2_31 (Ubuntu 20.04) defaults to GCC 9, without <span>.
|
|
@@ -45,7 +45,7 @@ _SUBMODULE_DIR = _PY_ROOT / "cpp"
|
|
|
45
45
|
# overridden by .gitmodules when present. Upstream has no releases yet, so the
|
|
46
46
|
# sources are pinned to a commit matching the generated bindings.
|
|
47
47
|
_SOURCE_URL = "https://github.com/mos9527/SonyHeadphonesClient.git"
|
|
48
|
-
_SOURCE_COMMIT = "
|
|
48
|
+
_SOURCE_COMMIT = "3c8f3330c85d45c29e7b76f718082a8d4fe402f1"
|
|
49
49
|
|
|
50
50
|
# CMake target -> on-disk base name (OUTPUT_NAME set in the C++ CMakeLists).
|
|
51
51
|
_TARGET_BASENAMES = {
|
|
@@ -35,6 +35,7 @@ MDRFeature = c_uint32
|
|
|
35
35
|
MDREvent = c_uint32
|
|
36
36
|
MDRPacketDirection = c_uint32
|
|
37
37
|
MDRText = c_uint32
|
|
38
|
+
MDRValue = c_uint32
|
|
38
39
|
MDRAudioCodec = c_uint32
|
|
39
40
|
MDRBatteryPart = c_uint32
|
|
40
41
|
MDRChargingState = c_uint32
|
|
@@ -109,7 +110,6 @@ class MDRBattery(Structure):
|
|
|
109
110
|
|
|
110
111
|
MDRBattery._fields_ = [
|
|
111
112
|
("part", MDRBatteryPart),
|
|
112
|
-
("present", MDRBoolean),
|
|
113
113
|
("level_percent", c_uint32),
|
|
114
114
|
("update_threshold_percent", c_uint32),
|
|
115
115
|
("charging", MDRChargingState),
|
|
@@ -231,6 +231,8 @@ MDRGeneralSettingInfo._fields_ = [
|
|
|
231
231
|
("index", c_uint32),
|
|
232
232
|
("type", MDRGeneralSettingType),
|
|
233
233
|
("writable", MDRBoolean),
|
|
234
|
+
("option_count", c_uint32),
|
|
235
|
+
("text_is_key", MDRBoolean),
|
|
234
236
|
]
|
|
235
237
|
|
|
236
238
|
class MDRGeneralSetting(Structure):
|
|
@@ -239,6 +241,7 @@ class MDRGeneralSetting(Structure):
|
|
|
239
241
|
MDRGeneralSetting._fields_ = [
|
|
240
242
|
("index", c_uint32),
|
|
241
243
|
("boolean_value", MDRBoolean),
|
|
244
|
+
("list_value", c_uint32),
|
|
242
245
|
]
|
|
243
246
|
|
|
244
247
|
class MDRAssignableControl(Structure):
|
|
@@ -336,6 +339,8 @@ def bind(lib: object) -> None:
|
|
|
336
339
|
lib.mdrHeadphonesGetFeature.restype = MDRResult
|
|
337
340
|
lib.mdrHeadphonesGetText.argtypes = [c_void_p, MDRText, c_uint32, c_char_p, POINTER(c_uint32)]
|
|
338
341
|
lib.mdrHeadphonesGetText.restype = MDRResult
|
|
342
|
+
lib.mdrHeadphonesGetValue.argtypes = [c_void_p, MDRValue, c_uint32, POINTER(c_int32)]
|
|
343
|
+
lib.mdrHeadphonesGetValue.restype = MDRResult
|
|
339
344
|
lib.mdrHeadphonesGetModel.argtypes = [c_void_p, POINTER(MDRModel)]
|
|
340
345
|
lib.mdrHeadphonesGetModel.restype = MDRResult
|
|
341
346
|
lib.mdrHeadphonesGetBatteries.argtypes = [c_void_p, POINTER(MDRBattery), POINTER(c_uint32)]
|
|
@@ -81,7 +81,8 @@ FEATURE_LISTENING_VOICE_BOOST = 32
|
|
|
81
81
|
FEATURE_LISTENING_SOUND_LEAKAGE_REDUCTION = 33
|
|
82
82
|
FEATURE_WEARING_STATUS = 34
|
|
83
83
|
FEATURE_VOICE_ASSISTANT = 35
|
|
84
|
-
|
|
84
|
+
FEATURE_WIND_NOISE_REDUCTION = 36
|
|
85
|
+
FEATURE_MAX_VALUE = 36
|
|
85
86
|
EVENT_NONE = 0
|
|
86
87
|
EVENT_IDENTITY_CHANGED = 1
|
|
87
88
|
EVENT_BATTERY_CHANGED = 2
|
|
@@ -118,15 +119,37 @@ TEXT_MODEL_COLOR = 5
|
|
|
118
119
|
TEXT_TRACK_TITLE = 6
|
|
119
120
|
TEXT_TRACK_ALBUM = 7
|
|
120
121
|
TEXT_TRACK_ARTIST = 8
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
122
|
+
TEXT_TRACK_GENRE = 9
|
|
123
|
+
TEXT_PAIRED_DEVICE_ID = 10
|
|
124
|
+
TEXT_PAIRED_DEVICE_NAME = 11
|
|
125
|
+
TEXT_GENERAL_SETTING_SUBJECT = 12
|
|
126
|
+
TEXT_GENERAL_SETTING_SUMMARY = 13
|
|
127
|
+
TEXT_LAST_ERROR = 14
|
|
128
|
+
TEXT_LAST_ALERT = 15
|
|
129
|
+
TEXT_LAST_INTERACTION = 16
|
|
130
|
+
TEXT_LAST_DEVICE_MESSAGE = 17
|
|
131
|
+
TEXT_EQUALIZER_PRESET_NAME = 18
|
|
132
|
+
TEXT_GENERAL_SETTING_OPTION_SUBJECT = 19
|
|
133
|
+
TEXT_GENERAL_SETTING_OPTION_SUMMARY = 20
|
|
134
|
+
VALUE_PLAYBACK_VOLUME_MIN = 1
|
|
135
|
+
VALUE_PLAYBACK_VOLUME_MAX = 2
|
|
136
|
+
VALUE_PLAYBACK_VOLUME_STEP = 3
|
|
137
|
+
VALUE_AMBIENT_LEVEL_MIN = 4
|
|
138
|
+
VALUE_AMBIENT_LEVEL_MAX = 5
|
|
139
|
+
VALUE_AMBIENT_LEVEL_STEP = 6
|
|
140
|
+
VALUE_EQUALIZER_BAND_MIN = 7
|
|
141
|
+
VALUE_EQUALIZER_BAND_MAX = 8
|
|
142
|
+
VALUE_EQUALIZER_BAND_STEP = 9
|
|
143
|
+
VALUE_EQUALIZER_CLEAR_BASS_MIN = 10
|
|
144
|
+
VALUE_EQUALIZER_CLEAR_BASS_MAX = 11
|
|
145
|
+
VALUE_EQUALIZER_CLEAR_BASS_STEP = 12
|
|
146
|
+
VALUE_VOICE_GUIDANCE_VOLUME_MIN = 13
|
|
147
|
+
VALUE_VOICE_GUIDANCE_VOLUME_MAX = 14
|
|
148
|
+
VALUE_VOICE_GUIDANCE_VOLUME_STEP = 15
|
|
149
|
+
VALUE_AUTO_POWER_OFF_OPTION_COUNT = 16
|
|
150
|
+
VALUE_AUTO_POWER_OFF_OPTION = 17
|
|
151
|
+
VALUE_EQUALIZER_BAND_FREQUENCY = 18
|
|
152
|
+
VALUE_GENERAL_SETTING_OPTION_TEXT_IS_KEY = 19
|
|
130
153
|
AUDIO_CODEC_UNKNOWN = 0
|
|
131
154
|
AUDIO_CODEC_SBC = 1
|
|
132
155
|
AUDIO_CODEC_AAC = 2
|
|
@@ -158,9 +181,8 @@ SOURCE_SWITCH_CONTROL_FAILED_NOT_CONNECTED = 3
|
|
|
158
181
|
SOURCE_SWITCH_CONTROL_FAILED_VOICE_ASSISTANT = 4
|
|
159
182
|
NOISE_MODE_OFF = 0
|
|
160
183
|
NOISE_MODE_CANCELLING = 1
|
|
161
|
-
NOISE_MODE_V1_ON = 1
|
|
162
184
|
NOISE_MODE_AMBIENT = 2
|
|
163
|
-
|
|
185
|
+
NOISE_MODE_WIND_NOISE_REDUCTION = 3
|
|
164
186
|
ADAPTIVE_SENSITIVITY_UNKNOWN = 0
|
|
165
187
|
ADAPTIVE_SENSITIVITY_LOW = 1
|
|
166
188
|
ADAPTIVE_SENSITIVITY_STANDARD = 2
|
|
@@ -251,6 +273,7 @@ ALERT_ACTION_NEGATIVE = 0
|
|
|
251
273
|
ALERT_ACTION_POSITIVE = 1
|
|
252
274
|
GENERAL_SETTING_UNKNOWN = 0
|
|
253
275
|
GENERAL_SETTING_BOOLEAN = 1
|
|
276
|
+
GENERAL_SETTING_LIST = 2
|
|
254
277
|
ASSIGNABLE_NONE = 0
|
|
255
278
|
ASSIGNABLE_PLAYBACK = 1
|
|
256
279
|
ASSIGNABLE_NOISE_CONTROL = 2
|
|
@@ -332,11 +355,12 @@ FEATURE_NAMES = {
|
|
|
332
355
|
FEATURE_SHUTDOWN: 'Shutdown',
|
|
333
356
|
FEATURE_CONNECTION_MODE: 'Connection mode',
|
|
334
357
|
FEATURE_SAFE_LISTENING: 'Safe listening',
|
|
335
|
-
FEATURE_SOURCE_SWITCH_CONTROL: '
|
|
358
|
+
FEATURE_SOURCE_SWITCH_CONTROL: 'Fix Playback',
|
|
336
359
|
FEATURE_LISTENING_BACKGROUND_MUSIC: 'Listening: background music',
|
|
337
360
|
FEATURE_LISTENING_CINEMA: 'Listening: cinema',
|
|
338
361
|
FEATURE_LISTENING_VOICE_BOOST: 'Listening: voice boost',
|
|
339
362
|
FEATURE_LISTENING_SOUND_LEAKAGE_REDUCTION: 'Listening: sound leakage reduction',
|
|
340
363
|
FEATURE_WEARING_STATUS: 'Wearing status',
|
|
341
364
|
FEATURE_VOICE_ASSISTANT: 'Voice Assistant',
|
|
365
|
+
FEATURE_WIND_NOISE_REDUCTION: 'Wind Noise Reduction',
|
|
342
366
|
}
|
|
@@ -88,15 +88,18 @@ TEXT_MODEL_COLOR = 5
|
|
|
88
88
|
TEXT_TRACK_TITLE = 6
|
|
89
89
|
TEXT_TRACK_ALBUM = 7
|
|
90
90
|
TEXT_TRACK_ARTIST = 8
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
91
|
+
TEXT_TRACK_GENRE = 9
|
|
92
|
+
TEXT_PAIRED_DEVICE_ID = 10
|
|
93
|
+
TEXT_PAIRED_DEVICE_NAME = 11
|
|
94
|
+
TEXT_GENERAL_SETTING_SUBJECT = 12
|
|
95
|
+
TEXT_GENERAL_SETTING_SUMMARY = 13
|
|
96
|
+
TEXT_LAST_ERROR = 14
|
|
97
|
+
TEXT_LAST_ALERT = 15
|
|
98
|
+
TEXT_LAST_INTERACTION = 16
|
|
99
|
+
TEXT_LAST_DEVICE_MESSAGE = 17
|
|
100
|
+
TEXT_EQUALIZER_PRESET_NAME = 18
|
|
101
|
+
TEXT_GENERAL_SETTING_OPTION_SUBJECT = 19
|
|
102
|
+
TEXT_GENERAL_SETTING_OPTION_SUMMARY = 20
|
|
100
103
|
|
|
101
104
|
PACKET_DIRECTION_RX = 0
|
|
102
105
|
PACKET_DIRECTION_TX = 1
|
|
@@ -255,10 +258,17 @@ ASSIGNABLE_ACTION_KEY_TYPE_BUTTON = 2
|
|
|
255
258
|
# the generated header-derived definitions.
|
|
256
259
|
from ._generated_constants import * # noqa: E402,F403
|
|
257
260
|
|
|
261
|
+
|
|
262
|
+
def GENERAL_SETTING_OPTION_INDEX(setting: int, option: int) -> int:
|
|
263
|
+
"""Encode a general-setting option index for ``TEXT_*`` / ``VALUE_*`` access."""
|
|
264
|
+
return ((option << 8) | (setting & 0xff)) & 0xffffffff
|
|
265
|
+
|
|
266
|
+
|
|
258
267
|
NOISE_MODE_NAMES = {
|
|
259
268
|
NOISE_MODE_OFF: "off",
|
|
260
269
|
NOISE_MODE_CANCELLING: "cancelling",
|
|
261
270
|
NOISE_MODE_AMBIENT: "ambient",
|
|
271
|
+
NOISE_MODE_WIND_NOISE_REDUCTION: "wind noise reduction",
|
|
262
272
|
}
|
|
263
273
|
|
|
264
274
|
AUDIO_CODEC_NAMES = {
|
|
@@ -222,6 +222,19 @@ class Headphones:
|
|
|
222
222
|
result.check(lib.mdrHeadphonesGetText(self.handle, text_id, index, buf, byref(size)))
|
|
223
223
|
return buf.value.decode("utf-8", errors="replace")
|
|
224
224
|
|
|
225
|
+
def get_value(self, value_id: int, index: int = 0) -> int:
|
|
226
|
+
"""Read a device value selected by ``constants.VALUE_*``.
|
|
227
|
+
|
|
228
|
+
``index`` selects an option, band count, or band for indexed keys.
|
|
229
|
+
Raises :class:`result.MDRError` if initialization is incomplete, the
|
|
230
|
+
feature is unsupported, or the key/index is invalid.
|
|
231
|
+
"""
|
|
232
|
+
value = c_int32()
|
|
233
|
+
result.check(
|
|
234
|
+
_dll.lib().mdrHeadphonesGetValue(self.handle, value_id, index, byref(value))
|
|
235
|
+
)
|
|
236
|
+
return int(value.value)
|
|
237
|
+
|
|
225
238
|
def get_model(self) -> _api.MDRModel:
|
|
226
239
|
model = _api.MDRModel()
|
|
227
240
|
result.check(_dll.lib().mdrHeadphonesGetModel(self.handle, byref(model)))
|
|
@@ -469,18 +482,49 @@ class Headphones:
|
|
|
469
482
|
return value
|
|
470
483
|
|
|
471
484
|
def set_general_setting(self, index: int, enabled: bool) -> None:
|
|
485
|
+
"""Stage a boolean general setting; apply it with :meth:`request_commit`."""
|
|
472
486
|
value = _api.MDRGeneralSetting(
|
|
473
487
|
index=index,
|
|
474
488
|
boolean_value=constants.TRUE if enabled else constants.FALSE,
|
|
475
489
|
)
|
|
476
490
|
result.check(_dll.lib().mdrHeadphonesSetGeneralSetting(self.handle, byref(value)))
|
|
477
491
|
|
|
492
|
+
def set_general_setting_option(self, index: int, option: int) -> None:
|
|
493
|
+
"""Stage an option index for a ``GENERAL_SETTING_LIST`` setting.
|
|
494
|
+
|
|
495
|
+
``option`` must be less than the setting's ``option_count`` from
|
|
496
|
+
:meth:`get_general_setting_info`. Apply with :meth:`request_commit`.
|
|
497
|
+
"""
|
|
498
|
+
value = _api.MDRGeneralSetting(index=index, list_value=option)
|
|
499
|
+
result.check(_dll.lib().mdrHeadphonesSetGeneralSetting(self.handle, byref(value)))
|
|
500
|
+
|
|
478
501
|
def general_setting_subject(self, index: int) -> str:
|
|
479
502
|
return self.get_text(constants.TEXT_GENERAL_SETTING_SUBJECT, index)
|
|
480
503
|
|
|
481
504
|
def general_setting_summary(self, index: int) -> str:
|
|
482
505
|
return self.get_text(constants.TEXT_GENERAL_SETTING_SUMMARY, index)
|
|
483
506
|
|
|
507
|
+
def general_setting_option_subject(self, index: int, option: int) -> str:
|
|
508
|
+
return self.get_text(
|
|
509
|
+
constants.TEXT_GENERAL_SETTING_OPTION_SUBJECT,
|
|
510
|
+
constants.GENERAL_SETTING_OPTION_INDEX(index, option),
|
|
511
|
+
)
|
|
512
|
+
|
|
513
|
+
def general_setting_option_summary(self, index: int, option: int) -> str:
|
|
514
|
+
return self.get_text(
|
|
515
|
+
constants.TEXT_GENERAL_SETTING_OPTION_SUMMARY,
|
|
516
|
+
constants.GENERAL_SETTING_OPTION_INDEX(index, option),
|
|
517
|
+
)
|
|
518
|
+
|
|
519
|
+
def general_setting_option_text_is_key(self, index: int, option: int) -> bool:
|
|
520
|
+
"""Whether this option's texts need localization (independent of the setting)."""
|
|
521
|
+
return bool(
|
|
522
|
+
self.get_value(
|
|
523
|
+
constants.VALUE_GENERAL_SETTING_OPTION_TEXT_IS_KEY,
|
|
524
|
+
constants.GENERAL_SETTING_OPTION_INDEX(index, option),
|
|
525
|
+
)
|
|
526
|
+
)
|
|
527
|
+
|
|
484
528
|
def equalizer_preset_name(self, index: int) -> str:
|
|
485
529
|
"""Name of the preset at ``index`` in :meth:`get_equalizer_presets`."""
|
|
486
530
|
return self.get_text(constants.TEXT_EQUALIZER_PRESET_NAME, index)
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: libmdr
|
|
3
|
+
Version: 0.1.2
|
|
4
|
+
Summary: Python bindings for the mdr-shared C ABI
|
|
5
|
+
License-Expression: MIT
|
|
6
|
+
Project-URL: Source, https://github.com/mos9527/libmdr-py
|
|
7
|
+
Requires-Python: >=3.10
|
|
8
|
+
Description-Content-Type: text/markdown
|
|
9
|
+
License-File: LICENSE
|
|
10
|
+
Provides-Extra: dev
|
|
11
|
+
Provides-Extra: bt
|
|
12
|
+
Requires-Dist: libmdr-bt==0.1.2; extra == "bt"
|
|
13
|
+
Provides-Extra: cli
|
|
14
|
+
Requires-Dist: libmdr-cli==0.1.2; extra == "cli"
|
|
15
|
+
Dynamic: license-file
|
|
16
|
+
|
|
17
|
+
# libmdr
|
|
18
|
+
|
|
19
|
+
Python (ctypes) bindings for libmdr, the protocol library behind
|
|
20
|
+
[SonyHeadphonesClient](https://github.com/mos9527/SonyHeadphonesClient).
|
|
21
|
+
|
|
22
|
+
## Installation
|
|
23
|
+
|
|
24
|
+
```
|
|
25
|
+
pip install libmdr # core bindings
|
|
26
|
+
pip install libmdr[bt] # + libmdr-bt, the platform Bluetooth backend
|
|
27
|
+
pip install libmdr[cli] # + libmdr-cli, the `mdr` command line tool
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
The extras are shorthands for the standalone
|
|
31
|
+
[`libmdr-bt`](https://pypi.org/project/libmdr-bt/) and
|
|
32
|
+
[`libmdr-cli`](https://pypi.org/project/libmdr-cli/) packages.
|
|
33
|
+
|
|
34
|
+
## Platforms
|
|
35
|
+
|
|
36
|
+
Prebuilt wheels are not tied to a Python version, and install on any Python >= 3.10 on:
|
|
37
|
+
|
|
38
|
+
| OS | Architectures |
|
|
39
|
+
|-------------------|----------------------|
|
|
40
|
+
| Windows | x86-64, arm64 |
|
|
41
|
+
| macOS 12+ | x86-64, arm64 |
|
|
42
|
+
| Linux (glibc 2.17+) | x86-64, arm64, armv7 |
|
|
43
|
+
|
|
44
|
+
Elsewhere (e.g. musl) pip builds from the sdist, which needs CMake >= 3.31, git and a C++20 compiler.
|
|
45
|
+
|
|
46
|
+
## Links
|
|
47
|
+
|
|
48
|
+
- [Source and documentation](https://github.com/mos9527/libmdr-py)
|
libmdr-0.1.0/PKG-INFO
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.4
|
|
2
|
-
Name: libmdr
|
|
3
|
-
Version: 0.1.0
|
|
4
|
-
Summary: Python bindings for the mdr-shared C ABI
|
|
5
|
-
License-Expression: MIT
|
|
6
|
-
Project-URL: Source, https://github.com/mos9527/libmdr-py
|
|
7
|
-
Requires-Python: >=3.10
|
|
8
|
-
Description-Content-Type: text/plain
|
|
9
|
-
License-File: LICENSE
|
|
10
|
-
Provides-Extra: dev
|
|
11
|
-
Provides-Extra: bt
|
|
12
|
-
Requires-Dist: libmdr-bt; extra == "bt"
|
|
13
|
-
Provides-Extra: cli
|
|
14
|
-
Requires-Dist: libmdr-cli; extra == "cli"
|
|
15
|
-
Dynamic: license-file
|
|
16
|
-
|
|
17
|
-
ctypes bindings for libmdr (mdr-shared).
|
libmdr-0.1.0/README.md
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
# libmdr
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.4
|
|
2
|
-
Name: libmdr
|
|
3
|
-
Version: 0.1.0
|
|
4
|
-
Summary: Python bindings for the mdr-shared C ABI
|
|
5
|
-
License-Expression: MIT
|
|
6
|
-
Project-URL: Source, https://github.com/mos9527/libmdr-py
|
|
7
|
-
Requires-Python: >=3.10
|
|
8
|
-
Description-Content-Type: text/plain
|
|
9
|
-
License-File: LICENSE
|
|
10
|
-
Provides-Extra: dev
|
|
11
|
-
Provides-Extra: bt
|
|
12
|
-
Requires-Dist: libmdr-bt; extra == "bt"
|
|
13
|
-
Provides-Extra: cli
|
|
14
|
-
Requires-Dist: libmdr-cli; extra == "cli"
|
|
15
|
-
Dynamic: license-file
|
|
16
|
-
|
|
17
|
-
ctypes bindings for libmdr (mdr-shared).
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|