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 before the one most recently played.<br>
015 * Play from the first such Marker if none has been played or already at the first marker.
016 * @since 547
017 */
018public class AudioPrevAction extends AbstractAudioAction {
019
020    /**
021     * Constructs a new {@code AudioPrevAction}.
022     */
023    public AudioPrevAction() {
024        super(trc("audio", "Previous Marker"), "audio-prev", trc("audio", "Play previous marker."),
025        Shortcut.registerShortcut("audio:prev", tr("Audio: {0}", trc("audio", "Previous Marker")), KeyEvent.VK_F5, Shortcut.DIRECT), true);
026    }
027
028    @Override
029    public void actionPerformed(ActionEvent e) {
030        MarkerLayer.playPreviousMarker();
031    }
032}