use of net.osmand.plus.voice.CommandBuilder in project Osmand by osmandapp.
the class VoiceRouter method approachPoi.
public void approachPoi(Location location, List<LocationPointWrapper> points) {
CommandBuilder p = getNewCommandPlayerToPlay();
if (p == null) {
return;
}
notifyOnVoiceMessage();
double[] dist = new double[1];
String text = getText(location, points, dist);
p.goAhead(dist[0], null).andArriveAtPoi(text).play();
}
use of net.osmand.plus.voice.CommandBuilder in project Osmand by osmandapp.
the class VoiceRouter method setPlayer.
public void setPlayer(CommandPlayer player) {
this.player = player;
if (pendingCommand != null && player != null) {
CommandBuilder newCommand = getNewCommandPlayerToPlay();
if (newCommand != null) {
pendingCommand.play(newCommand);
}
pendingCommand = null;
}
}
use of net.osmand.plus.voice.CommandBuilder in project Osmand by osmandapp.
the class VoiceRouter method announceFavorite.
public void announceFavorite(List<LocationPointWrapper> points) {
CommandBuilder p = getNewCommandPlayerToPlay();
if (p == null) {
return;
}
notifyOnVoiceMessage();
makeSound();
String text = getText(null, points, null);
p.arrivedAtFavorite(text).play();
}
use of net.osmand.plus.voice.CommandBuilder in project Osmand by osmandapp.
the class VoiceRouter method announceOffRoute.
public void announceOffRoute(double dist) {
long ms = System.currentTimeMillis();
if (waitAnnouncedOffRoute == 0 || ms - lastAnnouncedOffRoute > waitAnnouncedOffRoute) {
CommandBuilder p = getNewCommandPlayerToPlay();
if (p != null) {
notifyOnVoiceMessage();
p.offRoute(dist).play();
announceBackOnRoute = true;
}
if (waitAnnouncedOffRoute == 0) {
waitAnnouncedOffRoute = 60000;
} else {
waitAnnouncedOffRoute *= 2.5;
}
lastAnnouncedOffRoute = ms;
}
}
use of net.osmand.plus.voice.CommandBuilder in project Osmand by osmandapp.
the class VoiceRouter method playThen.
private void playThen() {
CommandBuilder play = getNewCommandPlayerToPlay();
if (play != null) {
notifyOnVoiceMessage();
play.then().play();
}
}
Aggregations