use of net.osmand.plus.voice.CommandBuilder in project Osmand by osmandapp.
the class VoiceRouter method gpsLocationRecover.
public void gpsLocationRecover() {
CommandBuilder play = getNewCommandPlayerToPlay();
if (play != null) {
notifyOnVoiceMessage();
play.gpsLocationRecover().play();
}
}
use of net.osmand.plus.voice.CommandBuilder in project Osmand by osmandapp.
the class VoiceRouter method playMakeUTwp.
private boolean playMakeUTwp() {
CommandBuilder play = getNewCommandPlayerToPlay();
if (play != null) {
notifyOnVoiceMessage();
play.makeUTwp().play();
return true;
}
return false;
}
use of net.osmand.plus.voice.CommandBuilder in project Osmand by osmandapp.
the class VoiceRouter method arrivedDestinationPoint.
public void arrivedDestinationPoint(String name) {
CommandBuilder play = getNewCommandPlayerToPlay();
if (play != null) {
notifyOnVoiceMessage();
play.arrivedAtDestination(getSpeakablePointName(name)).play();
}
}
use of net.osmand.plus.voice.CommandBuilder in project Osmand by osmandapp.
the class VoiceRouter method approachFavorite.
public void approachFavorite(Location location, List<LocationPointWrapper> points) {
CommandBuilder p = getNewCommandPlayerToPlay();
if (p == null) {
return;
}
notifyOnVoiceMessage();
double[] dist = new double[1];
makeSound();
String text = getText(location, points, dist);
p.goAhead(dist[0], null).andArriveAtFavorite(text).play();
}
use of net.osmand.plus.voice.CommandBuilder in project Osmand by osmandapp.
the class VoiceRouter method playMakeTurnIn.
private void playMakeTurnIn(RouteSegmentResult currentSegment, RouteDirectionInfo next, int dist, RouteDirectionInfo pronounceNextNext) {
CommandBuilder play = getNewCommandPlayerToPlay();
if (play != null) {
String tParam = getTurnType(next.getTurnType());
boolean isPlay = true;
if (tParam != null) {
play.turn(tParam, dist, getSpeakableStreetName(currentSegment, next, true));
suppressDest = true;
} else if (next.getTurnType().isRoundAbout()) {
play.roundAbout(dist, next.getTurnType().getTurnAngle(), next.getTurnType().getExitOut(), getSpeakableStreetName(currentSegment, next, true));
// Other than in prepareTurn, in prepareRoundabout we do not announce destination, so we can repeat it one more time
suppressDest = false;
} else if (next.getTurnType().getValue() == TurnType.TU || next.getTurnType().getValue() == TurnType.TRU) {
play.makeUT(dist, getSpeakableStreetName(currentSegment, next, true));
suppressDest = true;
} else {
isPlay = false;
}
// 'then keep' preparation for next after next. (Also announces an interim straight segment, which is not pronounced above.)
if (pronounceNextNext != null) {
TurnType t = pronounceNextNext.getTurnType();
isPlay = true;
if (t.getValue() != TurnType.C && next.getTurnType().getValue() == TurnType.C) {
play.goAhead(dist, getSpeakableStreetName(currentSegment, next, true));
}
if (t.getValue() == TurnType.TL || t.getValue() == TurnType.TSHL || t.getValue() == TurnType.TSLL || t.getValue() == TurnType.TU || t.getValue() == TurnType.KL) {
play.then().bearLeft(getSpeakableStreetName(currentSegment, next, false));
} else if (t.getValue() == TurnType.TR || t.getValue() == TurnType.TSHR || t.getValue() == TurnType.TSLR || t.getValue() == TurnType.TRU || t.getValue() == TurnType.KR) {
play.then().bearRight(getSpeakableStreetName(currentSegment, next, false));
}
}
if (isPlay) {
notifyOnVoiceMessage();
play.play();
}
}
}
Aggregations