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