Last change
on this file 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.
|
---|
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.gui.layer.markerlayer.MarkerLayer;
|
---|
11 | import 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 | */
|
---|
18 | public 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.