|
libosmscout 0.1
|
Model providing access to currently installed voices on device. More...
#include <InstalledVoicesModel.h>
Inheritance diagram for osmscout::InstalledVoicesModel:Public Types | |
| enum | Roles { NameRole = Qt::UserRole , LangRole = Qt::UserRole + 1 , GenderRole = Qt::UserRole + 2 , ValidRole = Qt::UserRole + 3 , LicenseRole = Qt::UserRole + 4 , AuthorRole = Qt::UserRole + 5 , DescriptionRole = Qt::UserRole + 6 , SelectedRole = Qt::UserRole + 7 , TypeRole = Qt::UserRole + 8 } |
Public Slots | |
| void | onVoiceChanged (const QString &) |
| void | playTTSAudio (const QList< QUrl > &audioFiles) |
| void | update () |
Signals | |
| void | initTTSVoiceRequested (const Voice &voice) |
| void | playTTSMessageRequested (QString message) |
| emitted whenever getTTSStateText() changes | |
| void | ttsStateChanged () |
| void | voiceChanged (const QString) |
Public Member Functions | |
| Q_INVOKABLE QVariant | data (const QModelIndex &index, int role) const override |
| Q_INVOKABLE Qt::ItemFlags | flags (const QModelIndex &index) const override |
| QString | getTTSStateText () const |
| Localized, human readable description of the current TTS engine state (see osmscout::TTSEngineState). | |
| InstalledVoicesModel () | |
| Q_INVOKABLE void | playSample (const QModelIndex &index, const QStringList &sample) |
| Q_INVOKABLE void | playTTSSample (const QModelIndex &index) |
| Play a synthesized voice sample for a Piper TTS voice at the given index. | |
| QHash< int, QByteArray > | roleNames () const override |
| Q_INVOKABLE int | rowCount (const QModelIndex &parent=QModelIndex()) const override |
| Q_INVOKABLE void | select (const QModelIndex &index) |
| ~InstalledVoicesModel () override | |
Properties | |
| QString | ttsStateText |
| < localized, human readable description of the current TTS engine state (e.g. | |
Model providing access to currently installed voices on device.
This model suppose to be used in combo box.
| osmscout::InstalledVoicesModel::InstalledVoicesModel | ( | ) |
|
override |
|
override |
References AuthorRole, DescriptionRole, GenderRole, LangRole, LicenseRole, NameRole, SelectedRole, TypeRole, and ValidRole.
|
override |
| QString osmscout::InstalledVoicesModel::getTTSStateText | ( | ) | const |
Localized, human readable description of the current TTS engine state (see osmscout::TTSEngineState).
Reads as "Ready" before any Piper sample was requested (or when the library was built without libpiper support).
References osmscout::Error, osmscout::Idle, and osmscout::Synthesizing.
|
signal |
Referenced by playTTSSample().
|
slot |
References SelectedRole.
| void osmscout::InstalledVoicesModel::playSample | ( | const QModelIndex & | index, |
| const QStringList & | sample | ||
| ) |
|
slot |
|
signal |
emitted whenever getTTSStateText() changes
Referenced by playTTSSample().
| void osmscout::InstalledVoicesModel::playTTSSample | ( | const QModelIndex & | index | ) |
Play a synthesized voice sample for a Piper TTS voice at the given index.
Unlike playSample() (which plays pre-recorded "Voice of Marble" ogg files), this synthesizes a short, representative navigation message using TTSMessageGeneratorQt and PiperTTSEngine. It is a no-op for non-Piper (or invalid) voices, or when the library was built without libpiper support.
References osmscout::Locale::ByEnvironmentSafe(), osmscout::Voice::getDir(), osmscout::OSMScoutQt::GetInstance(), osmscout::TTSEngine::getVoice(), initTTSVoiceRequested(), osmscout::Meters(), and playTTSMessageRequested().
|
override |
References GenderRole, LangRole, NameRole, SelectedRole, TypeRole, and ValidRole.
|
override |
| void osmscout::InstalledVoicesModel::select | ( | const QModelIndex & | index | ) |
|
signal |
|
slot |
Referenced by InstalledVoicesModel().
|
signal |
|
read |
< localized, human readable description of the current TTS engine state (e.g.
"Synthesizing voice sampleā¦"), useful for showing synthesis progress in the UI as the initial synthesis may take some time.