Search in sources :

Example 1 with CommandBuilder

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

Example 2 with CommandBuilder

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

Example 3 with CommandBuilder

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

Example 4 with CommandBuilder

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

Example 5 with CommandBuilder

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

Aggregations

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