diff options
author | Vladimir Byko-Ianko <v.bykoianko@corp.mail.ru> | 2015-09-04 17:20:41 +0300 |
---|---|---|
committer | Alex Zolotarev <alex@maps.me> | 2015-09-23 03:03:49 +0300 |
commit | 33e22b9e989c66050e733dc63d83d458007928cf (patch) | |
tree | 9d84c74ef7fb17d1ded6bc230d169cb3eee4c3b7 /routing | |
parent | ac57f8d4da92af07513664613bcc5c085bf098a0 (diff) |
Corrections after colleagues comments.
Diffstat (limited to 'routing')
-rw-r--r-- | routing/turns_sound.cpp | 12 | ||||
-rw-r--r-- | routing/turns_sound.hpp | 1 |
2 files changed, 9 insertions, 4 deletions
diff --git a/routing/turns_sound.cpp b/routing/turns_sound.cpp index df5283eaaf..fef2aa3cc9 100644 --- a/routing/turns_sound.cpp +++ b/routing/turns_sound.cpp @@ -76,8 +76,10 @@ void TurnsSound::GenerateTurnSound(TurnItem const & turn, double distanceToTurnM // First turn sound notification. uint32_t const distToPronounce = m_settings.RoundByPresetSoundedDistancesUnits(turnNotificationDistUnits); - turnNotifications.emplace_back(GenerateTurnText(distToPronounce, turn.m_exitNum, false, turn.m_turn, - m_settings.GetLengthUnits())); + string const text = GenerateTurnText(distToPronounce, turn.m_exitNum, false, turn.m_turn, + m_settings.GetLengthUnits()); + if (!text.empty()) + turnNotifications.emplace_back(text); // @TODO(vbykoianko) Check if there's a turn immediately after the current turn. // If so add an extra item to turnNotifications with "then parameter". m_nextTurnNotificationProgress = PronouncedNotification::First; @@ -95,8 +97,10 @@ void TurnsSound::GenerateTurnSound(TurnItem const & turn, double distanceToTurnM if (m_nextTurnNotificationProgress == PronouncedNotification::First && distanceToTurnMeters < distanceToPronounceNotificationMeters) { - turnNotifications.emplace_back(GenerateTurnText(0, turn.m_exitNum, false, turn.m_turn, - m_settings.GetLengthUnits())); + string const text = GenerateTurnText(0, turn.m_exitNum, false, turn.m_turn, + m_settings.GetLengthUnits()); + if (!text.empty()) + turnNotifications.emplace_back(text); // @TODO(vbykoianko) Check if there's a turn immediately after the current turn. // If so add an extra item to info.turnNotifications with "then parameter". diff --git a/routing/turns_sound.hpp b/routing/turns_sound.hpp index 3be3f708b7..86ddb1e248 100644 --- a/routing/turns_sound.hpp +++ b/routing/turns_sound.hpp @@ -80,6 +80,7 @@ public: /// \param turn contains information about the next turn. /// \param distanceToTurnMeters is distance to the next turn in meters. /// \param turnNotifications is a parameter to fill it if it's necessary. + /// \note The client implies turnNotifications does not contain empty strings. void GenerateTurnSound(TurnItem const & turn, double distanceToTurnMeters, vector<string> & turnNotifications); /// Reset states which reflects current route position. |