|
libosmscout 0.1
|
Qt based implementation of TTSMessageGenerator producing template-based messages for a TTS engine. More...
#include <TTSMessageGeneratorQt.h>
Inheritance diagram for osmscout::TTSMessageGeneratorQt:Public Member Functions | |
| std::optional< std::string > | GenerateMessage (const Distance &distanceFromStart, const VoiceMessageStruct &message, const VoiceMessageStruct &then) override |
| Generate a spoken message for the given maneuver. | |
| bool | SetLanguage (const std::string &language) override |
| Set the language of the generated messages. | |
| void | SetUnits (DistanceUnitSystem units) override |
| Set the distance units used for the announced distances. | |
| void | SetVehicle (Vehicle vehicle) override |
| Set the current vehicle. | |
| TTSMessageGeneratorQt (const QString &translationDir) | |
| ~TTSMessageGeneratorQt () override=default | |
Public Member Functions inherited from osmscout::TTSMessageGenerator | |
| virtual | ~TTSMessageGenerator ()=default |
Static Public Attributes | |
| static constexpr const char * | TranslationContext = "TTSMessageGeneratorQt" |
| < Translation context used for all source strings (must match lupdate context). | |
Qt based implementation of TTSMessageGenerator producing template-based messages for a TTS engine.
Translations are resolved through a dedicated QTranslator instance (see SetLanguage) instead of the globally installed application translators. This makes it possible to generate voice instructions in a language that is different from the language used by the rest of the application. When no translation is available for a given source string, the (English) source text is used as a fallback.
|
explicit |
|
overridedefault |
|
overridevirtual |
Generate a spoken message for the given maneuver.
| distanceFromStart | current position (distance from the route start). Together with the maneuver distance it defines how far ahead the maneuver is, which may be announced ("After 300 meters, ...") and controls the wording (e.g. a short roundabout phrase when close). |
| message | the maneuver to announce |
| then | optional following maneuver, only announced when close enough |
Implements osmscout::TTSMessageGenerator.
References osmscout::Distance::As(), osmscout::Distance::AsMeter(), osmscout::VoiceMessageStruct::distance, osmscout::Meters(), osmscout::Metrics, osmscout::VoiceMessageStruct::type, and osmscout::vehicleCar.
|
overridevirtual |
Set the language of the generated messages.
| languageCode |
Implements osmscout::TTSMessageGenerator.
References osmscout::Log::Debug(), osmscout::log, and osmscout::Log::Warn().
|
overridevirtual |
Set the distance units used for the announced distances.
Implements osmscout::TTSMessageGenerator.
|
overridevirtual |
Set the current vehicle.
Implements osmscout::TTSMessageGenerator.
|
staticconstexpr |
< Translation context used for all source strings (must match lupdate context).