Changeset 12565 in josm for trunk


Ignore:
Timestamp:
2017-08-03T23:51:18+02:00 (7 years ago)
Author:
Don-vip
Message:

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

Location:
trunk/src/org/openstreetmap/josm
Files:
1 added
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/actions/audio/AudioBackAction.java

    r12328 r12565  
    1111
    1212import org.openstreetmap.josm.Main;
    13 import org.openstreetmap.josm.actions.JosmAction;
    1413import org.openstreetmap.josm.gui.layer.markerlayer.MarkerLayer;
    1514import org.openstreetmap.josm.io.audio.AudioPlayer;
     
    2120 * @since 547
    2221 */
    23 public class AudioBackAction extends JosmAction {
     22public class AudioBackAction extends AbstractAudioAction {
    2423
    2524    /**
  • trunk/src/org/openstreetmap/josm/actions/audio/AudioFastSlowAction.java

    r12328 r12565  
    66
    77import org.openstreetmap.josm.Main;
    8 import org.openstreetmap.josm.actions.JosmAction;
    98import org.openstreetmap.josm.io.audio.AudioPlayer;
    109import org.openstreetmap.josm.io.audio.AudioUtil;
     
    1514 * @since 563
    1615 */
    17 public abstract class AudioFastSlowAction extends JosmAction {
     16public abstract class AudioFastSlowAction extends AbstractAudioAction {
    1817
    1918    private double multiplier;
  • trunk/src/org/openstreetmap/josm/actions/audio/AudioFwdAction.java

    r12328 r12565  
    1010
    1111import org.openstreetmap.josm.Main;
    12 import org.openstreetmap.josm.actions.JosmAction;
    1312import org.openstreetmap.josm.gui.layer.markerlayer.MarkerLayer;
    1413import org.openstreetmap.josm.io.audio.AudioPlayer;
     
    2019 * @since 547
    2120 */
    22 public class AudioFwdAction extends JosmAction {
     21public class AudioFwdAction extends AbstractAudioAction {
    2322
    2423    /**
  • trunk/src/org/openstreetmap/josm/actions/audio/AudioNextAction.java

    r6830 r12565  
    88import java.awt.event.KeyEvent;
    99
    10 import org.openstreetmap.josm.actions.JosmAction;
    1110import org.openstreetmap.josm.gui.layer.markerlayer.MarkerLayer;
    1211import org.openstreetmap.josm.tools.Shortcut;
     
    1716 * @since 547
    1817 */
    19 public class AudioNextAction extends JosmAction {
     18public class AudioNextAction extends AbstractAudioAction {
    2019
    2120    /**
  • trunk/src/org/openstreetmap/josm/actions/audio/AudioPlayPauseAction.java

    r12328 r12565  
    1010import java.net.URL;
    1111
    12 import org.openstreetmap.josm.actions.JosmAction;
    1312import org.openstreetmap.josm.gui.layer.markerlayer.AudioMarker;
    1413import org.openstreetmap.josm.gui.layer.markerlayer.MarkerLayer;
     
    2423 * @since 547
    2524 */
    26 public class AudioPlayPauseAction extends JosmAction {
     25public class AudioPlayPauseAction extends AbstractAudioAction {
    2726
    2827    /**
  • trunk/src/org/openstreetmap/josm/actions/audio/AudioPrevAction.java

    r6830 r12565  
    88import java.awt.event.KeyEvent;
    99
    10 import org.openstreetmap.josm.actions.JosmAction;
    1110import org.openstreetmap.josm.gui.layer.markerlayer.MarkerLayer;
    1211import org.openstreetmap.josm.tools.Shortcut;
     
    1716 * @since 547
    1817 */
    19 public class AudioPrevAction extends JosmAction {
     18public class AudioPrevAction extends AbstractAudioAction {
    2019
    2120    /**
  • trunk/src/org/openstreetmap/josm/io/audio/AudioPlayer.java

    r12328 r12565  
    168168    public static boolean paused() {
    169169        AudioPlayer instance = AudioPlayer.getInstance();
    170         return instance == null ? false : (instance.state == State.PAUSED);
     170        return instance != null && instance.state == State.PAUSED;
    171171    }
    172172
     
    177177    public static boolean playing() {
    178178        AudioPlayer instance = AudioPlayer.getInstance();
    179         return instance == null ? false : (instance.state == State.PLAYING);
     179        return instance != null && instance.state == State.PLAYING;
    180180    }
    181181
Note: See TracChangeset for help on using the changeset viewer.