Add system_volume: absolute read/set master volume and mute#432
Merged
Conversation
Replace the blind media-key nudges with read-backable, absolute control of the default output device (percent 0-100 + mute), behind an injectable VolumeDriver seam so all logic is unit-tested without an audio device. The default driver uses Windows Core Audio via the optional pycaw extra.
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 45 |
| Duplication | 0 |
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Summary
Fourth feature of the ROUND-15 cross-app OS lane. Replaces the blind media-key nudges (
volume up/down, unknown step, no read-back) with absolute, read-backable control of the default output device.utils/system_volume/: pure clamp + percent↔scalar +get_volume/set_volume/change_volume/is_muted/set_mute/mute/unmute/toggle_mute, all behind an injectableVolumeDriverseam (4 methods over a 0.0..1.0 scalar). Fully unit-tested with a fake driver — no audio device needed.IAudioEndpointVolumevia the new optional[audio]extra (pycaw); degrades with a clearRuntimeError("pass driver=") on a non-Windows / no-pycaw host.__all__,AC_get_volume/AC_set_volume/AC_change_volume/AC_set_mute/AC_toggle_muteexecutor commands, matchingac_*MCP tools (read read-only, writes side-effect-only), Script Builder commands under Shell.v206_features_doc.rst+WHATS_NEW.md.Test
test/unit_test/headless/test_system_volume_batch.py— pure conversion, read/write, mute/toggle via fake driver, plus facade + executor/MCP/builder wiring membership. All green;ruffclean; package stays Qt-free.