Search in sources :

Example 11 with CommandBuilder

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();
}
Also used : CommandBuilder(net.osmand.plus.voice.CommandBuilder)

Example 12 with CommandBuilder

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;
    }
}
Also used : CommandBuilder(net.osmand.plus.voice.CommandBuilder)

Example 13 with CommandBuilder

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();
}
Also used : CommandBuilder(net.osmand.plus.voice.CommandBuilder)

Example 14 with CommandBuilder

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;
    }
}
Also used : CommandBuilder(net.osmand.plus.voice.CommandBuilder)

Example 15 with CommandBuilder

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();
    }
}
Also used : CommandBuilder(net.osmand.plus.voice.CommandBuilder)

Aggregations

CommandBuilder (net.osmand.plus.voice.CommandBuilder)22 AlarmInfoType (net.osmand.plus.routing.AlarmInfo.AlarmInfoType)1 TurnType (net.osmand.router.TurnType)1