Skip to content

Add --fixed-volume for an output whose level is set elsewhere - #88

Merged
chrisuthe merged 1 commit into
mainfrom
chrisuthe/task/triage-82-add-fixed-volume-then-cut-the-0-4-0
Oct 15, 2026
Merged

chrisuthe merged 1 commit into
mainfrom
chrisuthe/task/triage-82-add-fixed-volume-then-cut-the-0-4-0

Conversation

@chrisuthe

Copy link
Copy Markdown
Member

Adopts sendspin-cpp#203 (set_volume_adjustable / set_mute_adjustable, in the v0.9.5 pin) as one switch, --fixed-volume / fixed-volume = true, for an output whose level is set elsewhere, such as a line-out into an amplifier.

What changes

  • Volume and mute are withdrawn together. With the flag the role reports neither volume nor muted in client/state and lists neither command in supported_commands, so a server's slider for this player disappears rather than silently doing nothing; a command for either is ignored by the library. A mute the server could still set would silence a fixed level, which is why the two go together.
  • The sink plays at full gain, unmuted. PlayerListener::fix_volume() pins the sink and marks the source VolumeSource::Fixed; update_volume(100) / update_muted(false) keep the role reporting what the sink applies. The listener's on_volume_changed / on_mute_changed are guarded while fixed, so a command can never reach the sink or the state file.
  • A remembered volume is kept, not restored. One INFO line says the remembered value is ignored while the flag is set and returns once it is dropped. The state file is not rewritten.
  • status prints player volume: 100 (fixed; the server cannot set it).
  • vol and mute on the control socket are untouched. They are group commands to the server, refused only on what the server publishes.
  • Docs: --help, README, the config key table, Controlling the Player, and the example config.

Verification

  • ctest: 519/519 apart from ConfigMerge.AConfiguredControlSocketIsAbsolutizedUnderDaemonize, which fails only because this worktree's socket path is 105 bytes; it passes from a short directory.
  • New tests: the flag and key (true, false, maybe refused with the allow-unpaired wording), the status note verbatim, and a listener test that with a remembered volume a server volume or mute command under the flag leaves the state file byte-identical, next to one showing the same commands apply and persist without it.
  • scripts/format.sh --check, scripts/smoke_test.sh and a -DSENDSPIN_CLI_WERROR=ON build are clean.
  • Run by hand with volume = 40, muted = true in the state file: with the flag, the log names the ignored value, status prints the fixed note and the file is byte-identical after the run; without it, Restored volume 40 (muted) and status read as before.

With the flag the player plays at full gain, unmuted, and withholds volume and
mute from the server: neither appears in client/state or supported_commands,
and a server command for either is ignored. A volume remembered in the state
file is kept but not restored, with one INFO line saying so, and returns once
the flag is dropped. status prints the player volume as fixed.

vol and mute on the control socket are group commands and stay as they are.
@chrisuthe
chrisuthe marked this pull request as ready for review October 15, 2026 23:31
@chrisuthe
chrisuthe merged commit 6ed2f02 into main Oct 15, 2026
18 checks passed
@chrisuthe chrisuthe mentioned this pull request Oct 15, 2026
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