Skip to content

Add system_volume: absolute read/set master volume and mute#432

Merged
JE-Chen merged 1 commit into
devfrom
feat/system-volume-batch
Jun 25, 2026
Merged

Add system_volume: absolute read/set master volume and mute#432
JE-Chen merged 1 commit into
devfrom
feat/system-volume-batch

Conversation

@JE-Chen

@JE-Chen JE-Chen commented Jun 25, 2026

Copy link
Copy Markdown
Member

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.

  • Headless core utils/system_volume/: pure clamp + percent↔scalar + get_volume/set_volume/change_volume/is_muted/set_mute/mute/unmute/toggle_mute, all behind an injectable VolumeDriver seam (4 methods over a 0.0..1.0 scalar). Fully unit-tested with a fake driver — no audio device needed.
  • Default driver: Windows Core Audio IAudioEndpointVolume via the new optional [audio] extra (pycaw); degrades with a clear RuntimeError ("pass driver=") on a non-Windows / no-pycaw host.
  • 5 layers wired: facade __all__, AC_get_volume/AC_set_volume/AC_change_volume/AC_set_mute/AC_toggle_mute executor commands, matching ac_* MCP tools (read read-only, writes side-effect-only), Script Builder commands under Shell.
  • Docs: EN + Zh 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; ruff clean; package stays Qt-free.

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.
@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 45 complexity · 0 duplication

Metric Results
Complexity 45
Duplication 0

View in Codacy

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.

@JE-Chen JE-Chen merged commit 23329d5 into dev Jun 25, 2026
16 checks passed
@JE-Chen JE-Chen deleted the feat/system-volume-batch branch June 25, 2026 20:53
@sonarqubecloud

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant