Commit graph

172 commits

Author SHA1 Message Date
Vencislav Atanasov
e28511a757 rbutilqt: Fix case of "iPod" in logs and translations
Functions, classes and variables not modified.

Change-Id: I252c32c5c22294d73896e6ad6368328f260bdcab
2026-10-01 17:32:24 -04:00
Solomon Peachy
3e996ec73e FS#13993 - rbutl push decompression onto a separate thread (Alessio Lenzi)
During Rockbox installation or update, the progress window currently
becomes unresponsive to screen-reader navigation while archive
inspection, free-space calculation and extraction are in progress. A
blind user cannot reliably move through or read the status messages and
therefore cannot determine what the utility is doing, how far the
installation has progressed, or whether an error has occurred.

The cause is that these operations are performed synchronously in the
GUI thread after a package has been downloaded. Although the
installation itself continues, the user interface cannot process
keyboard input and accessibility events reliably until the operation
finishes.

The attached patch moves the package installation work to a low-priority
QThread. Downloading remains asynchronous as before, while progress and
log signals from archive extraction are delivered back to the GUI thread
through Qt connections. This keeps the progress window fully navigable
with a screen reader throughout the installation.

Change-Id: I9a36a736e5b4bf98de8c3a71151679a4c1333dc7
2026-09-01 07:36:48 -04:00
Solomon Peachy
fd2b070bb1 FS#13984 - Rockbox Utility: Add SAPI5 voice volume control (Alessio Lenzi)
Rockbox Utility currently exposes SAPI5 voice speed but not the SAPI
voice volume. The encoder volume setting is applied after synthesis, so
it cannot prevent clipping or distortion already present in the
generated wave file.

This patch adds a Volume control to the SAPI5 TTS configuration. The
value is passed to the standard SpVoice.Volume property before
synthesis.

Change-Id: Ifa43e55f716f98150e94c86e5e6a6c8bce0ca852
2026-08-25 11:11:42 -04:00
Solomon Peachy
eded05f0cb FS13980: Updated rbutil Italian Translation (Alessio Lenzi)
Change-Id: Ic996de7db4a197858a7115627136d10a2f72be24
2026-08-13 12:36:50 -04:00
Solomon Peachy
612453da48 FS#13979 - rbutil: fix Talk file exclusion options and initial focus (Alessio Lenzi)
1. The "Ignore files" checkbox was saved in the settings but not
   consulted when starting generation. Patterns from the text field were
   therefore applied even when the checkbox was unchecked. The pattern list
   is now passed to TalkFileCreator only when the option is enabled.

2. Ignore patterns were converted to regular expressions by replacing only
   '*' and '?'. Other regular-expression characters were left unescaped and
   matches were not properly bounded. The patch uses Qt's
   wildcardToRegularExpression() conversion instead.

3. The Talk generation dialog initially focused "Strip Extensions" because of
   widget creation order. It now explicitly focuses the folder tree, matching
   the task flow and making keyboard and screen-reader use more predictable.

4. The handling of talkclips.ignore is also corrected so that files below a
   marked directory are skipped recursively. Previously Rockbox Utility could
   generate talkclips.ignore.talk and clips for files below .rockbox even though
   .rockbox/talkclips.ignore was present.

Change-Id: I1f9f14ed7fc057bc254f62148a7ef8ffb69425ed
2026-08-10 11:05:44 -04:00
Solomon Peachy
0726ec9351 FS#13978 - rbutil: Improve GUI responsiveness during voice/talk file generation (Alessio Lenzi)
Voice file and Talk clip generation currently run synchronously in the
GUI thread. During long TTS operations this prevents the progress window
from processing input and accessibility events. On Windows this makes
the progress list unavailable to screen readers such as NVDA and can
make Rockbox Utility appear to be hung.

The attached patch moves VoiceFileCreator and TalkFileCreator to
low-priority QThreads while keeping ProgressLoggerGui in the GUI thread.
Progress and log signals are delivered through queued Qt connections.

Cancellation remains available while a synchronous TTS request is
running. The abort flags used across threads are atomic and the abort
signal is sent through a direct connection. Worker objects and threads
are deleted through the standard finished / deleteLater lifecycle.

Talk generation now passes all selected folders to one worker and
processes them sequentially, emitting the final done signal only once.
This preserves multiple-folder selection without starting work in the
GUI thread.

Change-Id: I58aa66333d43e1be249c84e0cf46c17c119a8360
2026-08-09 15:54:58 -04:00
Solomon Peachy
21e95258f2 FS#13977 - rbutil: fix SAPI5 TTS test output and playback (Alessio Lenzi)
After the SAPI5 error handling added for FS#13972, the Test TTS button
can fail with SAPI error 5 even though the engine and voice are
configured correctly. The test also destroys its QSoundEffect and
temporary file before asynchronous playback can complete.

Config::testTts() used a QTemporaryFile with no .wav extension.
TTSSapi::voice() removes the requested output before synthesis so that a
stale file cannot be mistaken for successful output. SAPI SpFileStream
was therefore asked to create an extensionless output file and returned
error 5 (invalid procedure call or argument).

After successful synthesis, QSoundEffect was allocated on the stack, its
loop count was set to zero, and the temporary file was removed when
testTts() returned. This does not allow asynchronous playback to
complete reliably.

 * create a temporary directory and requests an initially
   nonexistent tts-test.wav inside it;
 * keep the directory and generated wave file alive for playback;
 * keep QSoundEffect alive until playback finishes or fails;
 * request one playback and clean up all temporary data afterward.

Change-Id: I8e482ab846e6445889118e121025ec48d3776d6b
2026-08-09 08:00:50 -04:00
Solomon Peachy
a467bfc55f FS#13972 - Improve rbutil SAPI5 stability (Alessio Lenzi)
The existing code treated any ready-read notification from cscript as
proof that synthesis had completed. The SAPI script can emit other
output, so the Utility could check for the wave file before the explicit
SYNC reply and report that the output file did not exist.

The script also used global "On Error Resume Next" without reporting
errors from SpFileStream.Open(), SpVoice.Speak(), or
SpFileStream.Close(). Several waits had no timeout, allowing the GUI
thread to remain blocked indefinitely.

The changes:

 * reports SAPI COM errors to Rockbox Utility;
 * verifies that SAPI actually created the requested wave file;
 * waits for the explicit SYNC reply instead of any process output;
 * applies finite timeouts to vendor queries, synthesis, and shutdown;
 * terminates a stuck private cscript process safely;
 * restarts cscript and retries the current string up to three times when a
   third-party SAPI engine stops responding during a long generation run.

Change-Id: I2cf2aefb704353c648bef0c4312f35282ac4e25d
2026-08-04 17:03:50 -04:00
Solomon Peachy
1b6767a7d7 FS#13972 - Fix crash creating voice files under Windows (Alessio Lenzi)
VoiceFileCreator::createVoiceFile() stored corrFile as the address of a
local QTemporaryFile (or a local QFile used as fallback). Both objects
were destroyed before VoiceFileCreator::create() called
TalkGenerator::setLang(), leaving a dangling pointer.

On Windows this produced an access violation in RockboxUtility.exe
immediately after the voice strings had been read. Windows reported
exception 0xc0000005.

The change gives the corrections file QObject lifetime under
VoiceFileCreator, uses the built-in corrections file as a persistent
default, and replaces it with a persistent extracted QTemporaryFile when
extraction succeeds.

Change-Id: I29a371d2431021833676dec2b875186a3c021b13
2026-08-04 17:03:50 -04:00
Solomon Peachy
00bf7f97ba rbutil: Support building with QT 6.6
Without this we'd need 6.7 or newer, which isn't that big of a deal except
we want to support producing RHEL9-based AppImages.

Change-Id: I931be94400d0d19af7fba498f46f174f51a4cd8b
2026-08-01 13:07:44 -04:00
Solomon Peachy
58d4d2b221 desktop: Drop the 'version' fields
They refer to the *desktop file specification* not the application version

Change-Id: Ib35f460c73aae40961255826f0c767a22cb5b518
2026-07-29 10:27:35 -04:00
Solomon Peachy
91d49adce2 rbutil: Silence the final build warnings when building with Clang
Change-Id: I65bb37993ef0ef6a0f373711ea16a417d0839cc5
2026-07-15 23:04:26 -04:00
Solomon Peachy
b4a0dc7274 rbutil: Ignore the deprecated warnings for macos builds
A replacement is in progress, so let's ignore those warnings in the mean time

Change-Id: Ic3123d2b37a21c6c0570619c387de0f1141c70f1
2026-07-15 21:16:56 -04:00
Solomon Peachy
2b6a8ffba2 rbutil: Get rid of all remnants of SAPI4 TTS support
Change-Id: I89cc53e2ebea273752c119e8c63f7eb36b1f22e0
2026-07-10 22:12:11 -04:00
Solomon Peachy
931fbb6734 rbutilqt: QtTTS: Pick a sane TTS engine/backend by default
* Ignore 'mock' tts engine
 * Must support synthesizing to a file (ie not just "speaking")
 * Don't claim 'speak' capabilities if the chosen engine does not

Change-Id: Id5fd224466ed62df5af837256fa66a340672d167
2026-07-10 08:08:39 -04:00
Solomon Peachy
d33d2f0840 rbutil: ttsqt: Bail if TTS engine doesn't support saving to file
Change-Id: Iaac0f77836727e5d8853d32a0b47c5d8d62b3365
2026-07-09 20:32:19 -04:00
Vencislav Atanasov
acba3fcb07 rbutilqt: Add the Qt TextToSpeech module as a new optional TTS engine
Co-authored-by: Qwen3.7-Plus
Change-Id: Ib6ddce52eee30139952e6597504ab96517dc15bd
2026-07-09 15:56:49 -04:00
Solomon Peachy
390d17893f rbutil: Rework TTS classes to use a stringlist for arguments
Instead of passing the entire cmdline as a single string that was
treated as the exectuable name on some platforms

Change-Id: Ic4f043a3a48e1b1bfab82bbfa8983c2d224606ec
2026-07-09 15:00:20 -04:00
Solomon Peachy
a9a4b3316f rbutil: Delete the long-disabled and very obsolete SAPI4 TTS code
Change-Id: I24f69cbe646d5c5ddb488a8a1912d028ec017acf
2026-07-09 14:58:37 -04:00
Vencislav Atanasov
3967180c62 rbutilqt: Simplify Utils::mountpoints() using QStorageInfo
Co-authored-by: Qwen3.7-Plus
Change-Id: I5832963d1a176754315dc28ffab75fa0a06f0334
2026-07-08 03:16:28 +03:00
Vencislav Atanasov
db1ca7c5c1 rbutilqt: Remove Utils::filesystemSize()
Implement the available/total functions using QStorageInfo. Unfortunately, QStorageInfo does not provide cluster size, so there's still some platform-specific code left extracted to Utils::filesystemClusterSize().

Co-authored-by: Qwen3.7-Plus
Change-Id: Iacec829b7d12afb65a966fe15e319d305c7384fd
2026-07-08 03:16:28 +03:00
Vencislav Atanasov
d06fa10485 rbutilqt: Simplify Utils::filesystemType() using QStorageInfo
Co-authored-by: Qwen3.7-Plus
Change-Id: Ia3b51be02d6848199ab573399f566eed7a2df085
2026-07-07 23:38:00 +03:00
Vencislav Atanasov
f62e29f311 rbutilqt: Simplify Utils::findExecutable() using QStandardPaths
Co-authored-by: Qwen3.7-Plus
Change-Id: I8f6f4003ebc7b9a4a8139f5dd4dfca3ae6cff273
2026-07-07 23:35:43 +03:00
Vencislav Atanasov
f9504df7bd rbutilqt: Simplify Utils::recursiveFolderSize() using QDirIterator
Co-authored-by: Qwen3.7-Plus
Change-Id: I73ee0f25c0b06d120364e245f8adf66e9fa09bbf
2026-07-07 23:33:30 +03:00
Solomon Peachy
7437f7b214 rbutil: Fix up the last of the windows-specific compile warnings.
The remaining ones apply to all targets

Change-Id: Iadb33dfe12349c6fd8329dbba68e762e7bc2095b
2026-07-05 09:59:48 -04:00
Solomon Peachy
f69d40564d rbutil: Add file missing from mspack update
Change-Id: Ie764ed422c328da10e0a6c4144bf3abd30b98d68
2026-07-05 07:59:42 -04:00
Solomon Peachy
a82396b0be rbutil: Update embedded 'mspack' library from 0.10.1alpha to 0.11alpha
Change-Id: I37210d1dc2c5cecdf8256f9e0294dcbd8516e8c8
2026-07-04 21:42:33 -04:00
Solomon Peachy
9e6135ecd2 rbutil: Update version in the '.desktop' file
Change-Id: Ifa4a852f8bbc01e9662fae9e5b9ee2140a54116c
2026-07-04 11:13:56 -04:00
Solomon Peachy
9a31255ff8 rbutil: Fix some compile warnings under Windows
Change-Id: I8abfbd61066c17297962de1432144692604cf245
2026-07-04 11:13:56 -04:00
Solomon Peachy
a3be8d1a12 rbutil: Documentation updates
Change-Id: I4782c034593e011d51ec213af1db3a82e6f832f3
2026-07-04 09:39:09 -04:00
Solomon Peachy
55d15b17b7 rbutil: Use 'English' as the default voice in the selection box
Instead of the first one on the (alphabetically sorted) list, currently
Bulgarian.

Ideally we'd try to discern this from the current system/UI language

Change-Id: I82a14716afb484fbaea22f78fe4dd7f00c24252e
2026-07-04 09:35:46 -04:00
Vencislav Atanasov
9e3b38c863 rbutilqt: Remove unused macOS includes from utils
Co-authored-by: ChatGPT (GPT-5.3 Mini) <chatgpt@openai.com>
Change-Id: I603e327acbad48bb1dd2ff8be8a2953c7155f5b9
2026-06-29 21:18:23 -04:00
Vencislav Atanasov
379c056299 rbutilqt: Replace Utils::ejectDevice() on macOS with a diskutil process invocation
Co-authored-by: ChatGPT (GPT-5.3 Mini) <chatgpt@openai.com>
Change-Id: Icedf758af6f1f0843c58e7ea5bb3efb2e7177b4a
2026-06-29 21:16:30 -04:00
Vencislav Atanasov
1039eb305a rbutilqt: Add error handling to TTSCarbon::generateSettings()
Co-authored-by: ChatGPT (GPT-5.3 Mini) <chatgpt@openai.com>
Change-Id: Iad04028853e930b508e72c2c9c3e9ebd9504d4bb
2026-06-29 21:16:19 -04:00
Vencislav Atanasov
174a2330e9 rbutilqt/themeeditor: Fix compiler warnings
- match sign in integer comparison
- remove unused RBViewport member

Co-authored-by: ChatGPT (GPT-5.3 Mini) <chatgpt@openai.com>
Change-Id: I9a59d701593a4290523bf4b837ab0794bea2ebaa
2026-06-29 20:13:29 -04:00
Vencislav Atanasov
6aa8d80ba2 rbutilqt: Replace Utils::findRunningProcess() on macOS with a libproc implementation
GetNextProcess, GetProcessPID and GetProcessInformation are replaced by proc_listallpids() and proc_pidpath()

Co-authored-by: ChatGPT (GPT-5.3 Mini) <chatgpt@openai.com>
Change-Id: Ic4fe13c405e11b658b1a9540e49741d4e69069f3
2026-06-29 20:13:09 -04:00
Vencislav Atanasov
45bd7c4400 rbutilqt: Simplify Utils::filesystemName()
Co-authored-by: ChatGPT (GPT-5.3 Mini) <chatgpt@openai.com>
Change-Id: Ib8851f27c473afa0d656ea3885e4d65342d10ab5
2026-06-29 20:12:48 -04:00
Vencislav Atanasov
05de3651d2 rbutilqt: Simplify conversion from UTF-16 string to QString for proxy host
Co-authored-by: ChatGPT (GPT-5.3 Mini) <chatgpt@openai.com>
Change-Id: Idf3437f66c6ac95d38cad997143b995b2fe9a5f2
2026-06-29 17:41:25 -04:00
Vencislav Atanasov
cf2872af11 rbutilqt: Replace insecure sprintf() with snprintf()
Co-authored-by: ChatGPT (GPT-5.3 Mini) <chatgpt@openai.com>
Change-Id: Ic2abe417f17a6f104cc4523b155ca6fdb5965bb1
2026-06-29 17:41:06 -04:00
Vencislav Atanasov
e3e416c51b rbutilqt/themeeditor: Fix Qt6 deprecations
- insertMulti() -> insert()
- QString::fromUtf16() with a parameter type other than char16_t*
- enterEvent() parameter type changed from QEvent to QEnterEvent
- QVariant -> QMetaType

Co-authored-by: ChatGPT (GPT-5.3 Mini) <chatgpt@openai.com>
Change-Id: Ia9c6c93e281475856e8355a8aa0e64c474eed80c
2026-06-29 17:28:53 -04:00
Vencislav Atanasov
dcc997e4e4 rbutilqt: Switch to a Qt API to get macOS version number, get system architecture using a compiler macro
This removes usage of the deprecated macOS Gestalt() API (2/2)

Co-authored-by: ChatGPT (GPT-5.3 Mini) <chatgpt@openai.com>
Change-Id: Id10386285469c06f082a7dcdcc3284b97519b10a
2026-06-29 16:55:47 -04:00
Vencislav Atanasov
1cbf61607e rbutilqt: Switch to a Qt API to get the CPU cores count
This removes usage of the deprecated macOS Gestalt() API (1/2)

Co-authored-by: ChatGPT (GPT-5.3 Mini) <chatgpt@openai.com>
Change-Id: Ia3af510412a97258dcd9fc9134708900c04c62c4
2026-06-29 16:54:27 -04:00
Vencislav Atanasov
cac0be6af5 rbutilqt: Replace deprecated macro Q_OS_MACX with Q_OS_MACOS
Co-authored-by: ChatGPT (GPT-5.3 Mini) <chatgpt@openai.com>
Change-Id: I0c51044574b8ec96ceaf0b953c6735ccf5d19e5e
2026-06-29 16:53:48 -04:00
Vencislav Atanasov
e0ac7a75a3 macOS 12.0 Deprecation: kIOMasterPortDefault -> kIOMainPortDefault
Co-authored-by: ChatGPT (GPT-5.3 Mini) <chatgpt@openai.com>
Change-Id: I4b5d6b73b87b7ea9e79ed20bbd27fb88fc8647ab
2026-06-29 16:53:21 -04:00
Solomon Peachy
02f7dabc67 rbutil: Port TTS preview to QT6
Change-Id: Ib4a5b1ef1cd3927792e0022e387b6abc8e5f099e
2026-06-27 11:42:50 -04:00
Solomon Peachy
0db37606b0 rbutilqt: Handle translation load failures, part deux
This set happens on startup, when we try to load a translation
matching the system locale

Change-Id: Ib1d3effa7aa738550841023a14f733d8d5b48837
2026-06-27 07:35:21 -04:00
Solomon Peachy
4875f706c2 rbutil: Cleanly handle translation loading errors at runtime
Change-Id: I2d8c566437b9a6224db41608bf3cbab8aed76763
2026-06-27 07:29:21 -04:00
Solomon Peachy
a700dcdfb0 rbutil: Use add_compile_definitions instead of add_compile_options
Change-Id: Iaeca86f89ccfb961456a10b96f3257d444cc0971
2026-06-27 07:29:21 -04:00
Solomon Peachy
5d3723bbf4 rbutil: Use QT_NO_USE_NODISCARD_FILE_OPEN everywhere
Not sure why we needed to specify this in three different places, but eh

Change-Id: If8d7304971f176bcfca839f5d6da626908621be4
2026-06-26 21:38:57 -04:00
Solomon Peachy
3c41d6a1c1 rbutil: Eliminate more pre-QT6 workarounds
Change-Id: I7b5cf428ef626543aa8e932622f4658e789e9236
2026-06-26 21:38:57 -04:00