Ticket #9977: mychanges.patch
File mychanges.patch, 1.5 KB (added by , 10 years ago) |
---|
-
src/org/openstreetmap/josm/gui/layer/markerlayer/PlayHeadMarker.java
43 43 private boolean enabled; 44 44 private boolean wasPlaying = false; 45 45 private int dropTolerance; /* pixels */ 46 private boolean jumpToMarker=false; 46 47 48 47 49 /** 48 50 * Returns the unique instance of {@code PlayHeadMarker}. 49 51 * @return The unique instance of {@code PlayHeadMarker}. … … 279 281 */ 280 282 public void animate() { 281 283 if (! enabled) return; 284 jumpToMarker=true; 282 285 if (timer == null) { 283 286 animationInterval = Main.pref.getDouble("marker.audioanimationinterval", 1.0); //milliseconds 284 287 timer = new Timer((int)(animationInterval * 1000.0), new ActionListener() { … … 294 297 timer.start(); 295 298 } 296 299 300 301 297 302 /** 298 303 * callback for moving play head marker according to audio player position 299 304 */ … … 342 347 w1.getEastNorth().interpolate(w2.getEastNorth(), 343 348 (audioTime - w1.time)/(w2.time - w1.time))); 344 349 time = audioTime; 350 if(jumpToMarker) 351 { 352 jumpToMarker=false; 353 Main.map.mapView.zoomTo(w1.getEastNorth()); 354 } 345 355 Main.map.mapView.repaint(); 346 356 } 347 357 }