TTS preferences¶
Source: ui/tts_preferences.py
Process-wide TTS language, auto-speak, and word-list speaker defaults, loaded from and saved to preferences. A set with empty override cells uses these values. Ownership and preference keys are in State and persistence; per-set cells are in Per-set settings. Startup restore order is in Startup.
Process-wide TTS language and auto-speak flags backed by preferences.
TtsPreferences ¶
Runtime TTS settings loaded at startup and edited from Settings.
DEFAULT_* flags are the original Settings values. The mutable class
attributes below start there and change when the user edits Settings.
Attributes:
| Name | Type | Description |
|---|---|---|
language |
str
|
gTTS language code used by |
auto_speak_definitions |
bool
|
When |
speakers_word_formations |
bool
|
When |
speakers_word |
bool
|
When |
speakers_definition |
bool
|
When |
Source code in src/learning_app/ui/tts_preferences.py
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 | |
normalize_language
classmethod
¶
Return a supported language code, or English when unknown.
Source code in src/learning_app/ui/tts_preferences.py
parse_auto_speak
classmethod
¶
parse_speakers_word_formations
classmethod
¶
Parse word-formation speaker switch; missing or unknown means on.
parse_speakers_word
classmethod
¶
Parse word-field speaker switch; missing or unknown means on.
parse_speakers_definition
classmethod
¶
Parse definition-field speaker switch; missing or unknown means off.
load_from_preferences
async
classmethod
¶
Load language, auto-speak, and list-speaker flags from storage.
Missing keys are seeded with English, auto-speak on, word-formation and word speakers on, and definition speakers off.
Source code in src/learning_app/ui/tts_preferences.py
save_language
async
classmethod
¶
Persist and apply a language code.
save_auto_speak_definitions
async
classmethod
¶
Persist and apply the definitions auto-speak switch.
Source code in src/learning_app/ui/tts_preferences.py
save_speakers_word_formations
async
classmethod
¶
Persist and apply speakers on word-formation list cards.
Source code in src/learning_app/ui/tts_preferences.py
save_speakers_word
async
classmethod
¶
Persist and apply speakers on definition-list word fields.
Source code in src/learning_app/ui/tts_preferences.py
save_speakers_definition
async
classmethod
¶
Persist and apply speakers on definition-list definition fields.