Changeset 12414 in josm for trunk/src/org/openstreetmap/josm/io
- Timestamp:
- 2017-06-18T01:36:38+02:00 (7 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/io/audio
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/io/audio/JavaFxMediaPlayer.java
r12413 r12414 35 35 private final ListenerList<AudioListener> listeners = ListenerList.create(); 36 36 37 private URL url;38 37 private MediaPlayer mediaPlayer; 39 38 … … 50 49 51 50 // Note, this method is called on the FX Application Thread 52 PlatformImpl.startup( () -> startupLatch.countDown());51 PlatformImpl.startup(startupLatch::countDown); 53 52 54 53 // Wait for FX platform to start … … 59 58 public void play(Execute command, State stateChange, URL playingUrl) throws AudioException, IOException { 60 59 try { 61 url = command.url();60 final URL url = command.url(); 62 61 if (playingUrl != url) { 63 62 if (mediaPlayer != null) { … … 69 68 } 70 69 mediaPlayer = new MediaPlayer(new Media(url.toString())); 71 mediaPlayer.setOnPlaying(() -> {72 listeners.fireEvent(l -> l.playing(url)) ;73 });70 mediaPlayer.setOnPlaying(() -> 71 listeners.fireEvent(l -> l.playing(url)) 72 ); 74 73 } 75 74 mediaPlayer.setRate(command.speed()); -
trunk/src/org/openstreetmap/josm/io/audio/JavaSoundPlayer.java
r12413 r12414 37 37 38 38 private double bytesPerSecond; 39 private byte[] abData = new byte[chunk];39 private final byte[] abData = new byte[chunk]; 40 40 41 41 private double position; // seconds
Note:
See TracChangeset
for help on using the changeset viewer.