Ticket #9977: mychanges.patch

File mychanges.patch, 1.5 KB (added by MatthiasN, 10 years ago)

implements the jump

  • src/org/openstreetmap/josm/gui/layer/markerlayer/PlayHeadMarker.java

     
    4343    private boolean enabled;
    4444    private boolean wasPlaying = false;
    4545    private int dropTolerance; /* pixels */
     46    private boolean jumpToMarker=false;
    4647
     48
    4749    /**
    4850     * Returns the unique instance of {@code PlayHeadMarker}.
    4951     * @return The unique instance of {@code PlayHeadMarker}.
     
    279281     */
    280282    public void animate() {
    281283        if (! enabled) return;
     284        jumpToMarker=true;
    282285        if (timer == null) {
    283286            animationInterval = Main.pref.getDouble("marker.audioanimationinterval", 1.0); //milliseconds
    284287            timer = new Timer((int)(animationInterval * 1000.0), new ActionListener() {
     
    294297        timer.start();
    295298    }
    296299
     300   
     301   
    297302    /**
    298303     * callback for moving play head marker according to audio player position
    299304     */
     
    342347                    w1.getEastNorth().interpolate(w2.getEastNorth(),
    343348                            (audioTime - w1.time)/(w2.time - w1.time)));
    344349        time = audioTime;
     350        if(jumpToMarker)
     351        {
     352            jumpToMarker=false;
     353            Main.map.mapView.zoomTo(w1.getEastNorth());
     354        }
    345355        Main.map.mapView.repaint();
    346356    }
    347357}