Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/iphone
diff options
context:
space:
mode:
authorVladimir Byko-Ianko <v.bykoianko@corp.mail.ru>2015-08-11 17:17:04 +0300
committerAlex Zolotarev <alex@maps.me>2015-09-23 03:01:11 +0300
commitea10728f856cd9bb157e8f9d99d31b447a710edc (patch)
tree531357a2553d7c899247cdfc8c38117a73a84cc1 /iphone
parent46aaa28d28af4c1097a37a0082b7f9374daa2e0f (diff)
Splitting GetRouteFollowingInfo into two functions. One for TTS string generation and another one for getting route following information.
Diffstat (limited to 'iphone')
-rw-r--r--iphone/Maps/Classes/CustomViews/MapViewControls/MWMMapViewControlsManager.h1
-rw-r--r--iphone/Maps/Classes/CustomViews/MapViewControls/MWMMapViewControlsManager.mm5
-rw-r--r--iphone/Maps/Classes/CustomViews/NavigationDashboard/MWMNavigationDashboardEntity.h2
-rw-r--r--iphone/Maps/Classes/CustomViews/NavigationDashboard/MWMNavigationDashboardEntity.mm8
-rw-r--r--iphone/Maps/Classes/CustomViews/NavigationDashboard/MWMNavigationDashboardManager.h1
-rw-r--r--iphone/Maps/Classes/CustomViews/NavigationDashboard/MWMNavigationDashboardManager.mm25
-rw-r--r--iphone/Maps/Classes/MapViewController.mm5
7 files changed, 27 insertions, 20 deletions
diff --git a/iphone/Maps/Classes/CustomViews/MapViewControls/MWMMapViewControlsManager.h b/iphone/Maps/Classes/CustomViews/MapViewControls/MWMMapViewControlsManager.h
index a812d2ecd4..de54d03c2b 100644
--- a/iphone/Maps/Classes/CustomViews/MapViewControls/MWMMapViewControlsManager.h
+++ b/iphone/Maps/Classes/CustomViews/MapViewControls/MWMMapViewControlsManager.h
@@ -47,6 +47,7 @@
#pragma mark - MWMNavigationDashboardManager
- (void)setupRoutingDashboard:(location::FollowingInfo const &)info;
+- (void)playSound:(vector<string> const &)notifications;
- (void)routingReady;
- (void)routingNavigation;
- (void)handleRoutingError;
diff --git a/iphone/Maps/Classes/CustomViews/MapViewControls/MWMMapViewControlsManager.mm b/iphone/Maps/Classes/CustomViews/MapViewControls/MWMMapViewControlsManager.mm
index b8d242098b..de380159e8 100644
--- a/iphone/Maps/Classes/CustomViews/MapViewControls/MWMMapViewControlsManager.mm
+++ b/iphone/Maps/Classes/CustomViews/MapViewControls/MWMMapViewControlsManager.mm
@@ -120,6 +120,11 @@
[self.navigationManager setupDashboard:info];
}
+- (void)playSound:(vector<string> const &)notifications
+{
+ [self.navigationManager playSound:notifications];
+}
+
- (void)handleRoutingError
{
self.navigationManager.state = MWMNavigationDashboardStateError;
diff --git a/iphone/Maps/Classes/CustomViews/NavigationDashboard/MWMNavigationDashboardEntity.h b/iphone/Maps/Classes/CustomViews/NavigationDashboard/MWMNavigationDashboardEntity.h
index c0f1fad49b..3cfcf1198a 100644
--- a/iphone/Maps/Classes/CustomViews/NavigationDashboard/MWMNavigationDashboardEntity.h
+++ b/iphone/Maps/Classes/CustomViews/NavigationDashboard/MWMNavigationDashboardEntity.h
@@ -21,10 +21,8 @@
@property (nonatomic, readonly) NSUInteger timeToTarget;
@property (nonatomic, readonly) BOOL isPedestrian;
-- (instancetype)initWithFollowingInfo:(location::FollowingInfo const &)info;
- (void)updateWithFollowingInfo:(location::FollowingInfo const &)info;
-- (instancetype)init __attribute__((unavailable("init is not available")));
+ (instancetype)new __attribute__((unavailable("init is not available")));
@end
diff --git a/iphone/Maps/Classes/CustomViews/NavigationDashboard/MWMNavigationDashboardEntity.mm b/iphone/Maps/Classes/CustomViews/NavigationDashboard/MWMNavigationDashboardEntity.mm
index 1f40ea43c2..010de411a2 100644
--- a/iphone/Maps/Classes/CustomViews/NavigationDashboard/MWMNavigationDashboardEntity.mm
+++ b/iphone/Maps/Classes/CustomViews/NavigationDashboard/MWMNavigationDashboardEntity.mm
@@ -16,14 +16,6 @@
@implementation MWMNavigationDashboardEntity
-- (instancetype)initWithFollowingInfo:(location::FollowingInfo const &)info
-{
- self = [super init];
- if (self)
- [self configure:info];
- return self;
-}
-
- (void)updateWithFollowingInfo:(location::FollowingInfo const &)info
{
[self configure:info];
diff --git a/iphone/Maps/Classes/CustomViews/NavigationDashboard/MWMNavigationDashboardManager.h b/iphone/Maps/Classes/CustomViews/NavigationDashboard/MWMNavigationDashboardManager.h
index 972c3fe8f2..a660e9aebf 100644
--- a/iphone/Maps/Classes/CustomViews/NavigationDashboard/MWMNavigationDashboardManager.h
+++ b/iphone/Maps/Classes/CustomViews/NavigationDashboard/MWMNavigationDashboardManager.h
@@ -42,6 +42,7 @@ typedef NS_ENUM(NSUInteger, MWMNavigationDashboardState)
- (instancetype)init __attribute__((unavailable("init is not available")));
- (instancetype)initWithParentView:(UIView *)view delegate:(id<MWMNavigationDashboardManagerProtocol>)delegate;
- (void)setupDashboard:(location::FollowingInfo const &)info;
+- (void)playSound:(vector<string> const &)notifications;
- (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)orientation;
- (void)setRouteBuildingProgress:(CGFloat)progress;
diff --git a/iphone/Maps/Classes/CustomViews/NavigationDashboard/MWMNavigationDashboardManager.mm b/iphone/Maps/Classes/CustomViews/NavigationDashboard/MWMNavigationDashboardManager.mm
index 960f85a423..8384711816 100644
--- a/iphone/Maps/Classes/CustomViews/NavigationDashboard/MWMNavigationDashboardManager.mm
+++ b/iphone/Maps/Classes/CustomViews/NavigationDashboard/MWMNavigationDashboardManager.mm
@@ -51,6 +51,8 @@
[NSBundle.mainBundle loadNibNamed:@"MWMLandscapeNavigationDashboard" owner:self options:nil];
self.navigationDashboard = isPortrait ? self.navigationDashboardPortrait : self.navigationDashboardLandscape;
self.navigationDashboardPortrait.delegate = self.navigationDashboardLandscape.delegate = delegate;
+
+ self.tts = [[MWMTextToSpeech alloc] init];
}
return self;
}
@@ -79,21 +81,24 @@
self.navigationDashboard = navigationDashboard;
}
+- (MWMNavigationDashboardEntity *)entity
+{
+ if (!_entity)
+ _entity = [[MWMNavigationDashboardEntity alloc] init];
+ return _entity;
+}
+
- (void)setupDashboard:(location::FollowingInfo const &)info
{
- if (!self.entity)
- {
- self.entity = [[MWMNavigationDashboardEntity alloc] initWithFollowingInfo:info];
- self.tts = [[MWMTextToSpeech alloc] init];
- }
- else
- {
- [self.entity updateWithFollowingInfo:info];
- [self.tts speakNotifications:info.m_turnNotifications];
- }
+ [self.entity updateWithFollowingInfo:info];
[self updateDashboard];
}
+- (void)playSound:(vector<string> const &)notifications
+{
+ [self.tts speakNotifications:notifications];
+}
+
- (void)handleError
{
[self.routePreviewPortrait stateError];
diff --git a/iphone/Maps/Classes/MapViewController.mm b/iphone/Maps/Classes/MapViewController.mm
index 2506d3750b..ba2958276a 100644
--- a/iphone/Maps/Classes/MapViewController.mm
+++ b/iphone/Maps/Classes/MapViewController.mm
@@ -168,6 +168,11 @@ typedef NS_OPTIONS(NSUInteger, MapInfoView)
if (res.IsValid())
[self.controlsManager setupRoutingDashboard:res];
+
+ vector<string> notifications;
+ frm.GenerateTurnSound(notifications);
+ if (!notifications.empty())
+ [self.controlsManager playSound:notifications];
}
- (void)onCompassUpdate:(location::CompassInfo const &)info