Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
829787df47
1 changed files with 22 additions and 27 deletions
|
@ -105,8 +105,7 @@ public class VoiceRouter {
|
||||||
public boolean isMute() {
|
public boolean isMute() {
|
||||||
return mute;
|
return mute;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
protected CommandBuilder getNewCommandPlayerToPlay() {
|
protected CommandBuilder getNewCommandPlayerToPlay() {
|
||||||
if (player == null) {
|
if (player == null) {
|
||||||
return null;
|
return null;
|
||||||
|
@ -114,9 +113,7 @@ public class VoiceRouter {
|
||||||
lastAnnouncement = System.currentTimeMillis();
|
lastAnnouncement = System.currentTimeMillis();
|
||||||
return player.newCommandBuilder();
|
return player.newCommandBuilder();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public void updateAppMode() {
|
public void updateAppMode() {
|
||||||
// Turn prompt starts either at distance, or additionally (TURN_IN and TURN only) if actual-lead-time(currentSpeed) < maximum-lead-time(defined by default speed)
|
// Turn prompt starts either at distance, or additionally (TURN_IN and TURN only) if actual-lead-time(currentSpeed) < maximum-lead-time(defined by default speed)
|
||||||
if (router.getAppMode().isDerivedRoutingFrom(ApplicationMode.CAR)) {
|
if (router.getAppMode().isDerivedRoutingFrom(ApplicationMode.CAR)) {
|
||||||
|
@ -203,8 +200,7 @@ public class VoiceRouter {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private void nextStatusAfter(int previousStatus) {
|
private void nextStatusAfter(int previousStatus) {
|
||||||
//STATUS_UNKNOWN=0 -> STATUS_LONG_PREPARE=1 -> STATUS_PREPARE=2 -> STATUS_TURN_IN=3 -> STATUS_TURN=4 -> STATUS_TOLD=5
|
//STATUS_UNKNOWN=0 -> STATUS_LONG_PREPARE=1 -> STATUS_PREPARE=2 -> STATUS_TURN_IN=3 -> STATUS_TURN=4 -> STATUS_TOLD=5
|
||||||
if (previousStatus != STATUS_TOLD) {
|
if (previousStatus != STATUS_TOLD) {
|
||||||
|
@ -474,7 +470,7 @@ public class VoiceRouter {
|
||||||
}
|
}
|
||||||
if (nextNextInfo.distanceTo < TURN_IN_DISTANCE && isTargetPoint(nextNextInfo)) {
|
if (nextNextInfo.distanceTo < TURN_IN_DISTANCE && isTargetPoint(nextNextInfo)) {
|
||||||
if (!next.getTurnType().goAhead()) { // Avoids isolated "and arrive.." prompt
|
if (!next.getTurnType().goAhead()) { // Avoids isolated "and arrive.." prompt
|
||||||
andSpeakArriveAtPoint(nextNextInfo);
|
playAndArriveAtDestination(nextNextInfo);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
nextStatusAfter(STATUS_TURN);
|
nextStatusAfter(STATUS_TURN);
|
||||||
|
@ -488,7 +484,7 @@ public class VoiceRouter {
|
||||||
} else {
|
} else {
|
||||||
playMakeTurnIn(currentSegment, next, dist - (int) btScoDelayDistance, null);
|
playMakeTurnIn(currentSegment, next, dist - (int) btScoDelayDistance, null);
|
||||||
}
|
}
|
||||||
playAndArriveAtDestination(repeat, nextInfo, currentSegment);
|
playGoAndArriveAtDestination(repeat, nextInfo, currentSegment);
|
||||||
}
|
}
|
||||||
nextStatusAfter(STATUS_TURN_IN);
|
nextStatusAfter(STATUS_TURN_IN);
|
||||||
|
|
||||||
|
@ -499,7 +495,7 @@ public class VoiceRouter {
|
||||||
// Do not play prepare for keep left/right
|
// Do not play prepare for keep left/right
|
||||||
} else {
|
} else {
|
||||||
playPrepareTurn(currentSegment, next, dist);
|
playPrepareTurn(currentSegment, next, dist);
|
||||||
playAndArriveAtDestination(repeat, nextInfo, currentSegment);
|
playGoAndArriveAtDestination(repeat, nextInfo, currentSegment);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
nextStatusAfter(STATUS_PREPARE);
|
nextStatusAfter(STATUS_PREPARE);
|
||||||
|
@ -508,7 +504,7 @@ public class VoiceRouter {
|
||||||
} else if ((repeat || statusNotPassed(STATUS_LONG_PREPARE)) && (dist <= PREPARE_LONG_DISTANCE)) {
|
} else if ((repeat || statusNotPassed(STATUS_LONG_PREPARE)) && (dist <= PREPARE_LONG_DISTANCE)) {
|
||||||
if (repeat || dist >= PREPARE_LONG_DISTANCE_END) {
|
if (repeat || dist >= PREPARE_LONG_DISTANCE_END) {
|
||||||
playPrepareTurn(currentSegment, next, dist);
|
playPrepareTurn(currentSegment, next, dist);
|
||||||
playAndArriveAtDestination(repeat, nextInfo, currentSegment);
|
playGoAndArriveAtDestination(repeat, nextInfo, currentSegment);
|
||||||
}
|
}
|
||||||
nextStatusAfter(STATUS_LONG_PREPARE);
|
nextStatusAfter(STATUS_LONG_PREPARE);
|
||||||
|
|
||||||
|
@ -522,20 +518,6 @@ public class VoiceRouter {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void playAndArriveAtDestination(boolean repeat, NextDirectionInfo nextInfo, RouteSegmentResult currentSegment) {
|
|
||||||
RouteDirectionInfo next = nextInfo.directionInfo;
|
|
||||||
if (isTargetPoint(nextInfo) && (!playedAndArriveAtTarget || repeat)) {
|
|
||||||
if (next.getTurnType().goAhead()) {
|
|
||||||
playGoAhead(nextInfo.distanceTo, getSpeakableStreetName(currentSegment, next, false));
|
|
||||||
andSpeakArriveAtPoint(nextInfo);
|
|
||||||
playedAndArriveAtTarget = true;
|
|
||||||
} else if (nextInfo.distanceTo <= 2 * TURN_IN_DISTANCE) {
|
|
||||||
andSpeakArriveAtPoint(nextInfo);
|
|
||||||
playedAndArriveAtTarget = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void announceCurrentDirection(Location currentLocation) {
|
public void announceCurrentDirection(Location currentLocation) {
|
||||||
synchronized (router) {
|
synchronized (router) {
|
||||||
if (currentStatus != STATUS_UTWP_TOLD) {
|
if (currentStatus != STATUS_UTWP_TOLD) {
|
||||||
|
@ -546,7 +528,6 @@ public class VoiceRouter {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private boolean playMakeUTwp() {
|
private boolean playMakeUTwp() {
|
||||||
CommandBuilder play = getNewCommandPlayerToPlay();
|
CommandBuilder play = getNewCommandPlayerToPlay();
|
||||||
if (play != null) {
|
if (play != null) {
|
||||||
|
@ -687,8 +668,22 @@ public class VoiceRouter {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void playGoAndArriveAtDestination(boolean repeat, NextDirectionInfo nextInfo, RouteSegmentResult currentSegment) {
|
||||||
|
RouteDirectionInfo next = nextInfo.directionInfo;
|
||||||
|
if (isTargetPoint(nextInfo) && (!playedAndArriveAtTarget || repeat)) {
|
||||||
|
if (next.getTurnType().goAhead()) {
|
||||||
|
playGoAhead(nextInfo.distanceTo, getSpeakableStreetName(currentSegment, next, false));
|
||||||
|
playAndArriveAtDestination(nextInfo);
|
||||||
|
playedAndArriveAtTarget = true;
|
||||||
|
} else if (nextInfo.distanceTo <= 2 * TURN_IN_DISTANCE) {
|
||||||
|
playAndArriveAtDestination(nextInfo);
|
||||||
|
playedAndArriveAtTarget = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void andSpeakArriveAtPoint(NextDirectionInfo info) {
|
private void playAndArriveAtDestination(NextDirectionInfo info) {
|
||||||
if (isTargetPoint(info)) {
|
if (isTargetPoint(info)) {
|
||||||
String pointName = info == null ? "" : info.pointName;
|
String pointName = info == null ? "" : info.pointName;
|
||||||
CommandBuilder play = getNewCommandPlayerToPlay();
|
CommandBuilder play = getNewCommandPlayerToPlay();
|
||||||
|
|
Loading…
Reference in a new issue