source: josm/trunk/src/org/openstreetmap/josm/actions/audio/AudioPrevAction.java@ 14397

Last change on this file since 14397 was 12565, checked in by Don-vip, 7 years ago

fix #15110 - Disable audio actions when no audio is present (patch by bafonins, modified)

  • Property svn:eol-style set to native
File size: 1.1 KB
Line 
1// License: GPL. For details, see LICENSE file.
2package org.openstreetmap.josm.actions.audio;
3
4import static org.openstreetmap.josm.tools.I18n.tr;
5import static org.openstreetmap.josm.tools.I18n.trc;
6
7import java.awt.event.ActionEvent;
8import java.awt.event.KeyEvent;
9
10import org.openstreetmap.josm.gui.layer.markerlayer.MarkerLayer;
11import org.openstreetmap.josm.tools.Shortcut;
12
13/**
14 * Play the sound track from the Audio Marker before the one most recently played.<br>
15 * Play from the first such Marker if none has been played or already at the first marker.
16 * @since 547
17 */
18public class AudioPrevAction extends AbstractAudioAction {
19
20 /**
21 * Constructs a new {@code AudioPrevAction}.
22 */
23 public AudioPrevAction() {
24 super(trc("audio", "Previous Marker"), "audio-prev", trc("audio", "Play previous marker."),
25 Shortcut.registerShortcut("audio:prev", tr("Audio: {0}", trc("audio", "Previous Marker")), KeyEvent.VK_F5, Shortcut.DIRECT), true);
26 }
27
28 @Override
29 public void actionPerformed(ActionEvent e) {
30 MarkerLayer.playPreviousMarker();
31 }
32}
Note: See TracBrowser for help on using the repository browser.