| 529 | } |
| 530 | |
| 531 | void RoutingSession::GenerateNotifications(std::vector<std::string> & notifications, bool announceStreets) |
| 532 | { |
| 533 | CHECK_THREAD_CHECKER(m_threadChecker, ()); |
| 534 | notifications.clear(); |
| 535 | |
| 536 | ASSERT(m_route, ()); |
| 537 | |
| 538 | // Generate recalculating notification if needed and reset |
| 539 | if (m_routingRebuildCount > m_routingRebuildAnnounceCount) |
| 540 | { |
| 541 | m_routingRebuildAnnounceCount = m_routingRebuildCount; |
| 542 | notifications.emplace_back(m_turnNotificationsMgr.GenerateRecalculatingText()); |
| 543 | return; |
| 544 | } |
| 545 | |
| 546 | // Voice turn notifications. |
| 547 | if (!m_routingSettings.m_soundDirection) |
| 548 | return; |
| 549 | |
| 550 | if (!m_route->IsValid() || !IsNavigable()) |
| 551 | return; |
| 552 | |
| 553 | // Generate turns notifications. |
| 554 | std::vector<turns::TurnItemDist> turns; |
| 555 | if (m_route->GetNextTurns(turns)) |
| 556 | { |
| 557 | RouteSegment::RoadNameInfo nextStreetInfo; |
| 558 | |
| 559 | // only populate nextStreetInfo if TtsStreetNames is enabled |
| 560 | if (announceStreets) |
| 561 | m_route->GetNextTurnStreetName(nextStreetInfo); |
| 562 | |
| 563 | m_turnNotificationsMgr.GenerateTurnNotifications(turns, notifications, nextStreetInfo); |
| 564 | } |
| 565 | |
| 566 | m_speedCameraManager.GenerateNotifications(notifications); |
| 567 | } |
| 568 | |
| 569 | void RoutingSession::AssignRoute(std::shared_ptr<Route> const & route, RouterResultCode e) |
| 570 | { |