rbutil: Port TTS preview to QT6
rockbox-gerrit-noreply--- via rockbox-cvs <[email protected]> Sat, 27 Jun 2026 11:42:50 -0400
| Newsgroups | gmane.comp.systems.archos.rockbox.cvs |
|---|---|
| Message-ID | <[email protected]> |
commit 02f7dabc6724602ffbef7b23ff9fc76dbd8cfcff Author: Solomon Peachy <[email protected]> Date: Fri Jun 26 21:30:40 2026 -0400 rbutil: Port TTS preview to QT6 Change-Id: Ib4a5b1ef1cd3927792e0022e387b6abc8e5f099e diff --git a/utils/rbutilqt/changelog.txt b/utils/rbutilqt/changelog.txt index fef1e317c6..d656142e69 100644 --- a/utils/rbutilqt/changelog.txt +++ b/utils/rbutilqt/changelog.txt @@ -55,4 +55,5 @@ Version 1.5.2 * Generate additional talk clips for language name and 'invalid voice file' * When installing development builds, fall back to daily artefacts for non-firmware files * Where possible, extract voice corrections file from the actual device +* Port TTS preview to QT6 * Drop support for Qt5, now requires Qt6. diff --git a/utils/rbutilqt/configure.cpp b/utils/rbutilqt/configure.cpp index a8bc2e49aa..25cea94acf 100644 --- a/utils/rbutilqt/configure.cpp +++ b/utils/rbutilqt/configure.cpp @@ -20,8 +20,9 @@ #include <QProgressDialog> #include <QFileDialog> #include <QUrl> -#if defined(QT_MULTIMEDIA_LIB) && (QT_VERSION < 0x060000) -#include <QSound> + +#if defined(QT_MULTIMEDIA_LIB) +#include <QSoundEffect> #endif #include "version.h" @@ -449,7 +450,7 @@ void Config::updateTtsState(int index) { ui.configTTSstatus->setText(tr("Configuration OK")); ui.configTTSstatusimg->setPixmap(QPixmap(QString::fromUtf8(":/icons/go-next.svg"))); -#if defined(QT_MULTIMEDIA_LIB) && (QT_VERSION < 0x060000) +#if defined(QT_MULTIMEDIA_LIB) ui.testTTS->setEnabled(true); #else ui.testTTS->setEnabled(false); @@ -908,7 +909,7 @@ void Config::configTts() void Config::testTts() { -#if defined(QT_MULTIMEDIA_LIB) && (QT_VERSION < 0x060000) +#if defined(QT_MULTIMEDIA_LIB) QString errstr; int index = ui.comboTts->currentIndex(); TTSBase* tts; @@ -955,7 +956,11 @@ void Config::testTts() } tts->stop(); if(!filename.isEmpty()) { - QSound::play(filename); + QSoundEffect effect; + effect.setSource(QUrl::fromLocalFile(filename)); + effect.setLoopCount(0); + effect.setVolume(1.0f); + effect.play(); } ui.testTTS->setEnabled(true); delete tts; /* Config objects are never deleted (in fact, they are -- rockbox-cvs mailing list [email protected] https://lists.haxx.se/mailman/listinfo/rockbox-cvs