use of net.osmand.plus.voice.CommandBuilder in project Osmand by osmandapp.
the class VoiceRouter method announceBackOnRoute.
public void announceBackOnRoute() {
CommandBuilder p = getNewCommandPlayerToPlay();
if (announceBackOnRoute == true) {
if (p != null) {
notifyOnVoiceMessage();
p.backOnRoute().play();
}
announceBackOnRoute = false;
}
}
use of net.osmand.plus.voice.CommandBuilder in project Osmand by osmandapp.
the class VoiceRouter method playAndArriveAtDestination.
private void playAndArriveAtDestination(NextDirectionInfo info) {
if (isTargetPoint(info)) {
String pointName = info == null ? "" : info.pointName;
CommandBuilder play = getNewCommandPlayerToPlay();
if (play != null) {
notifyOnVoiceMessage();
if (info != null && info.intermediatePoint) {
play.andArriveAtIntermediatePoint(getSpeakablePointName(pointName)).play();
} else {
play.andArriveAtDestination(getSpeakablePointName(pointName)).play();
}
}
}
}
use of net.osmand.plus.voice.CommandBuilder in project Osmand by osmandapp.
the class VoiceRouter method newRouteIsCalculated.
public void newRouteIsCalculated(boolean newRoute) {
CommandBuilder play = getNewCommandPlayerToPlay();
if (play != null) {
notifyOnVoiceMessage();
if (!newRoute) {
play.routeRecalculated(router.getLeftDistance(), router.getLeftTime()).play();
} else {
play.newRouteCalculated(router.getLeftDistance(), router.getLeftTime()).play();
}
} else if (player == null) {
pendingCommand = new VoiceCommandPending(!newRoute ? VoiceCommandPending.ROUTE_RECALCULATED : VoiceCommandPending.ROUTE_CALCULATED, this);
}
if (newRoute) {
playGoAheadDist = -1;
}
currentStatus = STATUS_UNKNOWN;
suppressDest = false;
nextRouteDirection = null;
}
use of net.osmand.plus.voice.CommandBuilder in project Osmand by osmandapp.
the class VoiceRouter method announceAlarm.
public void announceAlarm(AlarmInfo info, float speed) {
AlarmInfoType type = info.getType();
if (type == AlarmInfoType.SPEED_LIMIT) {
announceSpeedAlarm(info.getIntValue(), speed);
} else if (type == AlarmInfoType.SPEED_CAMERA) {
if (router.getSettings().SPEAK_SPEED_CAMERA.get()) {
CommandBuilder p = getNewCommandPlayerToPlay();
if (p != null) {
notifyOnVoiceMessage();
p.attention(type + "").play();
}
}
} else if (type == AlarmInfoType.PEDESTRIAN) {
if (router.getSettings().SPEAK_PEDESTRIAN.get()) {
CommandBuilder p = getNewCommandPlayerToPlay();
if (p != null) {
notifyOnVoiceMessage();
p.attention(type + "").play();
}
}
} else {
if (router.getSettings().SPEAK_TRAFFIC_WARNINGS.get()) {
CommandBuilder p = getNewCommandPlayerToPlay();
if (p != null) {
notifyOnVoiceMessage();
p.attention(type + "").play();
}
// See Issue 2377: Announce destination again - after some motorway tolls roads split shortly after the toll
if (type == AlarmInfoType.TOLL_BOOTH) {
suppressDest = false;
}
}
}
}
use of net.osmand.plus.voice.CommandBuilder in project Osmand by osmandapp.
the class VoiceRouter method announcePoi.
public void announcePoi(List<LocationPointWrapper> points) {
CommandBuilder p = getNewCommandPlayerToPlay();
if (p == null) {
return;
}
notifyOnVoiceMessage();
String text = getText(null, points, null);
p.arrivedAtPoi(text).play();
}
Aggregations