001// License: GPL. For details, see LICENSE file.
002package org.openstreetmap.josm.actions.audio;
003
004import static org.openstreetmap.josm.tools.I18n.tr;
005import static org.openstreetmap.josm.tools.I18n.trc;
006
007import java.awt.event.ActionEvent;
008import java.awt.event.KeyEvent;
009
010import org.openstreetmap.josm.gui.layer.markerlayer.MarkerLayer;
011import org.openstreetmap.josm.tools.Shortcut;
012
013/**
014 * Play the sound track from the Audio Marker after the one most recently played.<br>
015 * Play from the first such Marker if none has been played, or repeat the last marker if at the end.
016 * @since 547
017 */
018public class AudioNextAction extends AbstractAudioAction {
019
020    /**
021     * Constructs a new {@code AudioNextAction}.
022     */
023    public AudioNextAction() {
024        super(trc("audio", "Next Marker"), "audio-next", trc("audio", "Play next marker."),
025        Shortcut.registerShortcut("audio:next", tr("Audio: {0}", trc("audio", "Next Marker")), KeyEvent.VK_F8, Shortcut.DIRECT), true);
026    }
027
028    @Override
029    public void actionPerformed(ActionEvent e) {
030        MarkerLayer.playNextMarker();
031    }
032}