Example #1
0
 public void newRouteIsCalculated(boolean newRoute) {
   CommandBuilder play = getNewCommandPlayerToPlay();
   if (play != null) {
     if (!newRoute) {
       // suppress "route recalculated" prompt for GPX-routing, it makes no sense
       // suppress "route recalculated" prompt for 60sec (this workaround now outdated after more
       // intelligent route recalculation and directional voice prompt suppression)
       // if (router.getCurrentGPXRoute() == null && (System.currentTimeMillis() -
       // lastTimeRouteRecalcAnnounced > 60000)) {
       if (router.getCurrentGPXRoute() == null) {
         play.routeRecalculated(router.getLeftDistance()).play();
         currentStatus = STATUS_UNKNOWN;
         // lastTimeRouteRecalcAnnounced = System.currentTimeMillis();
       }
     } else {
       play.newRouteCalculated(router.getLeftDistance()).play();
       currentStatus = STATUS_UNKNOWN;
     }
   } else if (player == null) {
     pendingCommand =
         new VoiceCommandPending(
             !newRoute
                 ? VoiceCommandPending.ROUTE_RECALCULATED
                 : VoiceCommandPending.ROUTE_CALCULATED,
             this);
     currentStatus = STATUS_UNKNOWN;
   }
   nextRouteDirection = null;
 }
Example #2
0
 public void play(CommandBuilder newCommand) {
   int left = voiceRouter.router.getLeftDistance();
   if (left > 0) {
     if (type == ROUTE_CALCULATED) {
       newCommand.newRouteCalculated(left).play();
     } else if (type == ROUTE_RECALCULATED) {
       newCommand.routeRecalculated(left).play();
     }
   }
 }