libosmscout 0.1
Loading...
Searching...
No Matches
osmscout::TTSMessageGenerator Class Referenceabstract

Abstract class for generating template-based messages for TTS engine. More...

#include <VoiceInstructionAgent.h>

+ Inheritance diagram for osmscout::TTSMessageGenerator:

Public Member Functions

virtual std::optional< std::string > GenerateMessage (const Distance &distanceFromStart, const VoiceMessageStruct &message, const VoiceMessageStruct &then)=0
 Generate a spoken message for the given maneuver.
 
virtual bool SetLanguage (const std::string &languageCode)=0
 Set the language of the generated messages.
 
virtual void SetUnits (DistanceUnitSystem units)=0
 Set the distance units used for the announced distances.
 
virtual void SetVehicle (Vehicle vehicle)=0
 Set the current vehicle.
 
virtual ~TTSMessageGenerator ()=default
 

Detailed Description

Abstract class for generating template-based messages for TTS engine.

Constructor & Destructor Documentation

◆ ~TTSMessageGenerator()

virtual osmscout::TTSMessageGenerator::~TTSMessageGenerator ( )
virtualdefault

Member Function Documentation

◆ GenerateMessage()

virtual std::optional< std::string > osmscout::TTSMessageGenerator::GenerateMessage ( const Distance distanceFromStart,
const VoiceMessageStruct message,
const VoiceMessageStruct then 
)
pure virtual

Generate a spoken message for the given maneuver.

Parameters
distanceFromStartcurrent 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).
messagethe maneuver to announce
thenoptional following maneuver, only announced when close enough
Returns
the message text, or std::nullopt when there is nothing to say

Implemented in osmscout::TTSMessageGeneratorQt, and osmscout::NoOpTTSMessageGenerator.

◆ SetLanguage()

virtual bool osmscout::TTSMessageGenerator::SetLanguage ( const std::string &  languageCode)
pure virtual

Set the language of the generated messages.

Parameters
languageCode
Returns
true if language is supported

Implemented in osmscout::TTSMessageGeneratorQt, and osmscout::NoOpTTSMessageGenerator.

◆ SetUnits()

virtual void osmscout::TTSMessageGenerator::SetUnits ( DistanceUnitSystem  units)
pure virtual

Set the distance units used for the announced distances.

Implemented in osmscout::TTSMessageGeneratorQt, and osmscout::NoOpTTSMessageGenerator.

◆ SetVehicle()

virtual void osmscout::TTSMessageGenerator::SetVehicle ( Vehicle  vehicle)
pure virtual

Set the current vehicle.

Implemented in osmscout::TTSMessageGeneratorQt, and osmscout::NoOpTTSMessageGenerator.


The documentation for this class was generated from the following file: