Search in sources :

Example 16 with CommandBuilder

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

Example 17 with CommandBuilder

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

Example 18 with CommandBuilder

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

Example 19 with CommandBuilder

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

Example 20 with CommandBuilder

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();
}
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