forked from organicmaps/organicmaps
Add recalculating TTS announcement
Signed-off-by: zyphlar <zyphlar@users.noreply.github.com>
This commit is contained in:
parent
b14939e770
commit
13071a609c
7 changed files with 73 additions and 0 deletions
|
@ -623,6 +623,50 @@
|
||||||
en = NULL
|
en = NULL
|
||||||
nl = Neem
|
nl = Neem
|
||||||
|
|
||||||
|
[route_recalculating]
|
||||||
|
en = Recalculating the route
|
||||||
|
af = Herbereken die roete
|
||||||
|
ar = إعادة حساب المسار
|
||||||
|
az = Marşrutun yenidən hesablanması
|
||||||
|
be = Пераразлік маршруту
|
||||||
|
bg = Преизчисляване на маршрута
|
||||||
|
ca = Recalcular el recorregut
|
||||||
|
cs = Přepočítání trasy
|
||||||
|
da = Genberegning af ruten
|
||||||
|
de = Neuberechnung der Route
|
||||||
|
el = Επαναϋπολογισμός της διαδρομής
|
||||||
|
es = Recalculando la ruta
|
||||||
|
et = Marsruudi ümberarvutamine
|
||||||
|
eu = Ibilbidea berriro kalkulatzea
|
||||||
|
fa = محاسبه مجدد مسیر
|
||||||
|
fi = Reitin uudelleenlaskenta
|
||||||
|
fr = Recalcul de l'itinéraire
|
||||||
|
he = חישוב מחדש של המסלול
|
||||||
|
hi = मार्ग की पुनर्गणना
|
||||||
|
hu = Az útvonal újraszámítása
|
||||||
|
id = Menghitung ulang rute
|
||||||
|
it = Ricalcolo del percorso
|
||||||
|
ja = ルートの再計算
|
||||||
|
ko = 경로 다시 계산하기
|
||||||
|
lt = Maršruto perskaičiavimas
|
||||||
|
mr = मार्गाची पुनर्गणना करत आहे
|
||||||
|
nb = Beregner ruten på nytt
|
||||||
|
nl = De route herberekenen
|
||||||
|
pl = Ponowne obliczanie trasy
|
||||||
|
pt = Recalculando itinerário
|
||||||
|
pt-BR = Recalculando rota
|
||||||
|
ro = Recalcularea traseului
|
||||||
|
ru = Перерасчет маршрута
|
||||||
|
sk = Prepočítanie trasy
|
||||||
|
sv = Omberäkning av rutten
|
||||||
|
sw = Kuhesabu upya njia
|
||||||
|
th = การคำนวณเส้นทางใหม่
|
||||||
|
tr = Rotanın yeniden hesaplanması
|
||||||
|
uk = Перерахунок маршруту
|
||||||
|
vi = Tính toán lại lộ trình
|
||||||
|
zh-Hans = 重新计算路线
|
||||||
|
zh-Hant = 重新計算路
|
||||||
|
|
||||||
[destination]
|
[destination]
|
||||||
en = You’ll arrive.
|
en = You’ll arrive.
|
||||||
ar = سوف تصل.
|
ar = سوف تصل.
|
||||||
|
|
|
@ -74,6 +74,7 @@ void RoutingSession::BuildRoute(Checkpoints const & checkpoints, uint32_t timeou
|
||||||
|
|
||||||
m_isFollowing = false;
|
m_isFollowing = false;
|
||||||
m_routingRebuildCount = -1; // -1 for the first rebuild.
|
m_routingRebuildCount = -1; // -1 for the first rebuild.
|
||||||
|
m_routingRebuildAnnounceCount = 0;
|
||||||
|
|
||||||
RebuildRoute(checkpoints.GetStart(), m_buildReadyCallback, m_needMoreMapsCallback,
|
RebuildRoute(checkpoints.GetStart(), m_buildReadyCallback, m_needMoreMapsCallback,
|
||||||
m_removeRouteCallback, timeoutSec, SessionState::RouteBuilding, false /* adjust */);
|
m_removeRouteCallback, timeoutSec, SessionState::RouteBuilding, false /* adjust */);
|
||||||
|
@ -242,6 +243,10 @@ void RoutingSession::Reset()
|
||||||
m_passedDistanceOnRouteMeters = 0.0;
|
m_passedDistanceOnRouteMeters = 0.0;
|
||||||
m_isFollowing = false;
|
m_isFollowing = false;
|
||||||
m_lastCompletionPercent = 0;
|
m_lastCompletionPercent = 0;
|
||||||
|
|
||||||
|
// reset announcement counters
|
||||||
|
m_routingRebuildCount = -1;
|
||||||
|
m_routingRebuildAnnounceCount = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void RoutingSession::SetState(SessionState state)
|
void RoutingSession::SetState(SessionState state)
|
||||||
|
@ -484,6 +489,14 @@ void RoutingSession::GenerateNotifications(std::vector<std::string> & notificati
|
||||||
|
|
||||||
ASSERT(m_route, ());
|
ASSERT(m_route, ());
|
||||||
|
|
||||||
|
// Generate recalculating notification if needed and reset
|
||||||
|
if (m_routingRebuildCount > m_routingRebuildAnnounceCount)
|
||||||
|
{
|
||||||
|
m_routingRebuildAnnounceCount = m_routingRebuildCount;
|
||||||
|
notifications.emplace_back(m_turnNotificationsMgr.GenerateRecalculatingText());
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// Voice turn notifications.
|
// Voice turn notifications.
|
||||||
if (!m_routingSettings.m_soundDirection)
|
if (!m_routingSettings.m_soundDirection)
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -234,6 +234,7 @@ private:
|
||||||
double m_passedDistanceOnRouteMeters = 0.0;
|
double m_passedDistanceOnRouteMeters = 0.0;
|
||||||
// Rerouting count
|
// Rerouting count
|
||||||
int m_routingRebuildCount = -1; // -1 for the first rebuild called in BuildRoute().
|
int m_routingRebuildCount = -1; // -1 for the first rebuild called in BuildRoute().
|
||||||
|
int m_routingRebuildAnnounceCount = 0; // track TTS announcement state (ignore the first build)
|
||||||
mutable double m_lastCompletionPercent = 0.0;
|
mutable double m_lastCompletionPercent = 0.0;
|
||||||
|
|
||||||
DECLARE_THREAD_CHECKER(m_threadChecker);
|
DECLARE_THREAD_CHECKER(m_threadChecker);
|
||||||
|
|
|
@ -84,6 +84,11 @@ std::string NotificationManager::GenerateTurnText(uint32_t distanceUnits, uint8_
|
||||||
return m_getTtsText.GetTurnNotification({distanceUnits, exitNum, useThenInsteadOfDistance, turn.m_pedestrianTurn, lengthUnits, nextStreetInfo});
|
return m_getTtsText.GetTurnNotification({distanceUnits, exitNum, useThenInsteadOfDistance, turn.m_pedestrianTurn, lengthUnits, nextStreetInfo});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::string NotificationManager::GenerateRecalculatingText() const
|
||||||
|
{
|
||||||
|
return m_getTtsText.GetRecalculatingNotification();
|
||||||
|
}
|
||||||
|
|
||||||
std::string NotificationManager::GenerateSpeedCameraText() const
|
std::string NotificationManager::GenerateSpeedCameraText() const
|
||||||
{
|
{
|
||||||
return m_getTtsText.GetSpeedCameraNotification();
|
return m_getTtsText.GetSpeedCameraNotification();
|
||||||
|
|
|
@ -49,6 +49,9 @@ public:
|
||||||
measurement_utils::Units GetLengthUnits() const { return m_settings.GetLengthUnits(); }
|
measurement_utils::Units GetLengthUnits() const { return m_settings.GetLengthUnits(); }
|
||||||
void SetLocaleWithJsonForTesting(std::string const & json, std::string const & locale);
|
void SetLocaleWithJsonForTesting(std::string const & json, std::string const & locale);
|
||||||
|
|
||||||
|
/// \brief Generate text of route rebuild notification.
|
||||||
|
std::string GenerateRecalculatingText() const;
|
||||||
|
|
||||||
/// \brief Generate text of speed camera notification.
|
/// \brief Generate text of speed camera notification.
|
||||||
std::string GenerateSpeedCameraText() const;
|
std::string GenerateSpeedCameraText() const;
|
||||||
|
|
||||||
|
|
|
@ -250,6 +250,11 @@ std::string GetTtsText::GetTurnNotification(Notification const & notification) c
|
||||||
return out;
|
return out;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::string GetTtsText::GetRecalculatingNotification() const
|
||||||
|
{
|
||||||
|
return GetTextById("route_recalculating");
|
||||||
|
}
|
||||||
|
|
||||||
std::string GetTtsText::GetSpeedCameraNotification() const
|
std::string GetTtsText::GetSpeedCameraNotification() const
|
||||||
{
|
{
|
||||||
return GetTextById("unknown_camera");
|
return GetTextById("unknown_camera");
|
||||||
|
|
|
@ -25,6 +25,8 @@ public:
|
||||||
|
|
||||||
std::string GetTurnNotification(Notification const & notification) const;
|
std::string GetTurnNotification(Notification const & notification) const;
|
||||||
|
|
||||||
|
std::string GetRecalculatingNotification() const;
|
||||||
|
|
||||||
std::string GetSpeedCameraNotification() const;
|
std::string GetSpeedCameraNotification() const;
|
||||||
|
|
||||||
/// \brief Sets a locale.
|
/// \brief Sets a locale.
|
||||||
|
|
Loading…
Add table
Reference in a new issue