Changeset 5945 in josm for trunk


Ignore:
Timestamp:
2013-05-08T13:22:46+02:00 (7 years ago)
Author:
stoecker
Message:

fix #8522 - remember and play last played audio marker for start/stop

File:
1 edited

Legend:

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

    r5871 r5945  
    99
    1010import org.openstreetmap.josm.actions.JosmAction;
     11import org.openstreetmap.josm.gui.layer.markerlayer.AudioMarker;
    1112import org.openstreetmap.josm.gui.layer.markerlayer.MarkerLayer;
    1213import org.openstreetmap.josm.tools.AudioPlayer;
     
    4041                    AudioPlayer.pause();
    4142            } else {
    42                 // find first audio marker to play
    43                 MarkerLayer.playAudio();
     43                // play the last-played marker again, if there is one
     44                AudioMarker lastPlayed = AudioMarker.recentlyPlayedMarker();
     45                if (lastPlayed != null) {
     46                    lastPlayed.play();
     47                } else {
     48                    // If no marker was played recently, play the first one
     49                    MarkerLayer.playAudio();
     50                }
    4451            }
    4552        } catch (Exception ex) {
Note: See TracChangeset for help on using the changeset viewer.