spacr.qt.sound_preferences

The Sound tab of Preferences: every switch off until somebody asks.

Built into the dialog by spacr.qt.preferences.PreferencesDialog as its LAST tab – it is the least important thing in Preferences – and kept in its own module so the dialog only has to create the page, save it and reset it. Built ONLY IN SPACEOUT MODE since 2026-09-21: ordinary spaCR has no Sound tab and plays nothing (see spacr.qt.preferences.sound_is_offered()).

Every event has its own switch and a Preview button beside it. The switches, the volume, the sound set and the Previews are all disabled while the master switch is off, so nothing on this page can make a sound until the user has turned sound on; a Preview is the user asking to hear one.

Every caption is a literal at the line that shows it, rather than a row in a table handed to a helper: the translation extractor reads literals at the calls it knows, and a caption routed through a helper’s parameter is a caption it never sees (tests/test_a_helper_does_not_hide_a_caption_from_the_catalog.py).

Classes

SoundPage

The Sound tab's controls, and the two things the dialog asks of them.

Module Contents

class spacr.qt.sound_preferences.SoundPage(form, dialog)[source]

The Sound tab’s controls, and the two things the dialog asks of them.

Parameters:
  • form – the tab’s form layout, from the dialog’s _page.

  • dialog – the Preferences dialog; closing it ends any preview.

Build every row, reading the stored values.

reset() → None[source]

Show what a fresh install has.

Called while the dialog has swapped in its empty defaults store, so every getter answers with its default.

save() → None[source]

Write every control on the page to the preference store.

select_theme(key: str) → bool[source]

Show key in the Sound set control, without saving anything.

The Appearance tab calls this when one of the ten night themes is chosen, so the sound set that goes with the colours is visible on the Sound tab before Save is pressed rather than appearing there afterwards. It moves one combo box and nothing else: the master switch, the volume and the per-event switches are the user’s and are not touched, so a theme can never turn sound on.

Parameters:

key – a key of spacr.qt.sound_synth.SOUND_THEMES.

Returns:

whether a set of that name was found and selected.