1 | // License: GPL. For details, see LICENSE file.
|
---|
2 | package org.openstreetmap.josm.actions.audio;
|
---|
3 |
|
---|
4 | import static org.openstreetmap.josm.tools.I18n.tr;
|
---|
5 | import static org.openstreetmap.josm.tools.I18n.trc;
|
---|
6 |
|
---|
7 | import java.awt.event.ActionEvent;
|
---|
8 | import java.awt.event.KeyEvent;
|
---|
9 |
|
---|
10 | import org.openstreetmap.josm.actions.JosmAction;
|
---|
11 | import org.openstreetmap.josm.gui.layer.markerlayer.MarkerLayer;
|
---|
12 | import org.openstreetmap.josm.tools.Shortcut;
|
---|
13 |
|
---|
14 | /**
|
---|
15 | * Play the sound track from the Audio Marker after the one most recently played.<br>
|
---|
16 | * Play from the first such Marker if none has been played, or repeat the last marker if at the end.
|
---|
17 | * @since 547
|
---|
18 | */
|
---|
19 | public class AudioNextAction extends JosmAction {
|
---|
20 |
|
---|
21 | /**
|
---|
22 | * Constructs a new {@code AudioNextAction}.
|
---|
23 | */
|
---|
24 | public AudioNextAction() {
|
---|
25 | super(trc("audio", "Next Marker"), "audio-next", trc("audio", "Play next marker."),
|
---|
26 | Shortcut.registerShortcut("audio:next", tr("Audio: {0}", trc("audio", "Next Marker")), KeyEvent.VK_F8, Shortcut.DIRECT), true);
|
---|
27 | }
|
---|
28 |
|
---|
29 | @Override
|
---|
30 | public void actionPerformed(ActionEvent e) {
|
---|
31 | MarkerLayer.playNextMarker();
|
---|
32 | }
|
---|
33 | }
|
---|