Search in sources :

Example 6 with CommandBuilder

use of net.osmand.plus.voice.CommandBuilder in project Osmand by osmandapp.

the class VoiceRouter method playPrepareTurn.

private void playPrepareTurn(RouteSegmentResult currentSegment, RouteDirectionInfo next, int dist) {
    CommandBuilder play = getNewCommandPlayerToPlay();
    if (play != null) {
        String tParam = getTurnType(next.getTurnType());
        if (tParam != null) {
            notifyOnVoiceMessage();
            play.prepareTurn(tParam, dist, getSpeakableStreetName(currentSegment, next, true)).play();
        } else if (next.getTurnType().isRoundAbout()) {
            notifyOnVoiceMessage();
            play.prepareRoundAbout(dist, next.getTurnType().getExitOut(), getSpeakableStreetName(currentSegment, next, true)).play();
        } else if (next.getTurnType().getValue() == TurnType.TU || next.getTurnType().getValue() == TurnType.TRU) {
            notifyOnVoiceMessage();
            play.prepareMakeUT(dist, getSpeakableStreetName(currentSegment, next, true)).play();
        }
    }
}
Also used : CommandBuilder(net.osmand.plus.voice.CommandBuilder)

Example 7 with CommandBuilder

use of net.osmand.plus.voice.CommandBuilder in project Osmand by osmandapp.

the class VoiceRouter method arrivedIntermediatePoint.

public void arrivedIntermediatePoint(String name) {
    CommandBuilder play = getNewCommandPlayerToPlay();
    if (play != null) {
        notifyOnVoiceMessage();
        play.arrivedAtIntermediatePoint(getSpeakablePointName(name)).play();
    }
}
Also used : CommandBuilder(net.osmand.plus.voice.CommandBuilder)

Example 8 with CommandBuilder

use of net.osmand.plus.voice.CommandBuilder in project Osmand by osmandapp.

the class VoiceRouter method playMakeTurn.

private void playMakeTurn(RouteSegmentResult currentSegment, RouteDirectionInfo next, NextDirectionInfo nextNextInfo) {
    CommandBuilder play = getNewCommandPlayerToPlay();
    if (play != null) {
        String tParam = getTurnType(next.getTurnType());
        boolean isplay = true;
        if (tParam != null) {
            play.turn(tParam, getSpeakableStreetName(currentSegment, next, !suppressDest));
        } else if (next.getTurnType().isRoundAbout()) {
            play.roundAbout(next.getTurnType().getTurnAngle(), next.getTurnType().getExitOut(), getSpeakableStreetName(currentSegment, next, !suppressDest));
        } else if (next.getTurnType().getValue() == TurnType.TU || next.getTurnType().getValue() == TurnType.TRU) {
            play.makeUT(getSpeakableStreetName(currentSegment, next, !suppressDest));
        // Do not announce goAheads
        // } else if (next.getTurnType().getValue() == TurnType.C)) {
        // play.goAhead();
        } else {
            isplay = false;
        }
        // Add turn after next
        if ((nextNextInfo != null) && (nextNextInfo.directionInfo != null)) {
            // This case only needed should we want a prompt at the end of straight segments (equivalent of makeTurn) when nextNextInfo should be announced again there.
            if (nextNextInfo.directionInfo.getTurnType().getValue() != TurnType.C && next.getTurnType().getValue() == TurnType.C) {
                play.goAhead();
                isplay = true;
            }
            String t2Param = getTurnType(nextNextInfo.directionInfo.getTurnType());
            if (t2Param != null) {
                if (isplay) {
                    play.then();
                    play.turn(t2Param, nextNextInfo.distanceTo, empty);
                }
            } else if (nextNextInfo.directionInfo.getTurnType().isRoundAbout()) {
                if (isplay) {
                    play.then();
                    play.roundAbout(nextNextInfo.distanceTo, nextNextInfo.directionInfo.getTurnType().getTurnAngle(), nextNextInfo.directionInfo.getTurnType().getExitOut(), empty);
                }
            } else if (nextNextInfo.directionInfo.getTurnType().getValue() == TurnType.TU) {
                if (isplay) {
                    play.then();
                    play.makeUT(nextNextInfo.distanceTo, empty);
                }
            }
        }
        if (isplay) {
            notifyOnVoiceMessage();
            play.play();
        }
    }
}
Also used : CommandBuilder(net.osmand.plus.voice.CommandBuilder)

Example 9 with CommandBuilder

use of net.osmand.plus.voice.CommandBuilder in project Osmand by osmandapp.

the class VoiceRouter method playGoAhead.

private void playGoAhead(int dist, Term streetName) {
    CommandBuilder play = getNewCommandPlayerToPlay();
    if (play != null) {
        notifyOnVoiceMessage();
        play.goAhead(dist, streetName).play();
    }
}
Also used : CommandBuilder(net.osmand.plus.voice.CommandBuilder)

Example 10 with CommandBuilder

use of net.osmand.plus.voice.CommandBuilder in project Osmand by osmandapp.

the class VoiceRouter method gpsLocationLost.

public void gpsLocationLost() {
    CommandBuilder play = getNewCommandPlayerToPlay();
    if (play != null) {
        notifyOnVoiceMessage();
        play.gpsLocationLost().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