Index: /applications/editors/josm/plugins/videomapping/src/org/openstreetmap/josm/plugins/videomapping/GpsPlayer.java
===================================================================
--- /applications/editors/josm/plugins/videomapping/src/org/openstreetmap/josm/plugins/videomapping/GpsPlayer.java	(revision 25384)
+++ /applications/editors/josm/plugins/videomapping/src/org/openstreetmap/josm/plugins/videomapping/GpsPlayer.java	(revision 25385)
@@ -30,4 +30,5 @@
     }
     
+    //jumps to the waypoint x ms from the beginning
     public WayPoint getWaypoint(long relTime)
     {
@@ -115,12 +116,16 @@
     //go to the position e.g.  "14.4.2010 14:00:01";
     public void jump(Date GPSAbsTime)
-    {
+    {  
     	Date zero=start.getTime();//TODO better Time wayfinding
-    	Date starttime = new Date(zero.getHours(),zero.getMinutes(),zero.getSeconds());
+    	//patch to get same datebase
+    	Date starttime = (Date) GPSAbsTime.clone();
+    	starttime.setHours(zero.getHours());
+    	starttime.setMinutes(zero.getMinutes());
+    	starttime.setSeconds(zero.getSeconds());  	
     	long diff=GPSAbsTime.getTime()-starttime.getTime();
-        goTo(getWaypoint(diff)); 
-    }
-    
-    //jumps to a specific time since the beginning
+        goTo(getWaypoint(diff));
+    }
+    
+    //jumps to a specific time since the beginning, called by Video
     public void jump(long relTime) {
         int pos = Math.round(relTime/1000);//TODO assumes the time is constant
@@ -128,5 +133,5 @@
         if (autoCenter) Main.map.mapView.zoomTo(curr.getCoor());
     }
-    
+      
  
     //gets only points on the line of the GPS track (between waypoints) nearby the point m
@@ -238,8 +243,4 @@
         w.time = t.getTime()/1000; //TODO need better way to set time and sync it
         SimpleDateFormat df = new SimpleDateFormat("hh:mm:ss:S");
-        /*System.out.print(length+"px ");
-        System.out.print(ratio+"% ");
-        System.out.print(inc+"ms ");
-        System.out.println(df.format(t.getTime()));+*/
         System.out.println(df.format(w.getTime()));
         //TODO we have to publish the new date to the node...
@@ -374,5 +375,4 @@
 
 
-
     
 }
Index: /applications/editors/josm/plugins/videomapping/src/org/openstreetmap/josm/plugins/videomapping/PositionLayer.java
===================================================================
--- /applications/editors/josm/plugins/videomapping/src/org/openstreetmap/josm/plugins/videomapping/PositionLayer.java	(revision 25384)
+++ /applications/editors/josm/plugins/videomapping/src/org/openstreetmap/josm/plugins/videomapping/PositionLayer.java	(revision 25385)
@@ -51,8 +51,9 @@
         gps= new GpsPlayer(ls);
         icon = new ImageIcon("images/videomapping.png");
-        gpsTimeCode= new SimpleDateFormat("hh:mm:ss");//TODO replace with DF small
+        gpsTimeCode= new SimpleDateFormat("HH:mm:ss");//TODO replace with DF small
         Main.map.mapView.addMouseListener(this);
         Main.map.mapView.addMouseMotionListener(this);                          
         gpsVP = new GPSVideoPlayer(video, gps);
+        iconPosition=gps.getCurr();
     }
     
@@ -253,15 +254,25 @@
             }
             else
-            {
+            {            	
                 //simple click
-                WayPoint wp = getNearestWayPoint(e.getPoint());
+            	WayPoint wp = getNearestWayPoint(e.getPoint());            	
                 if(wp!=null)
                 {
-                    gps.goTo(wp);
-                    //jump if we know position
-                    if(wp.attr.containsKey("synced"))
-                    {
-                        if(gpsVP!=null) gpsVP.jumpToGPSTime(new Date(gps.getRelativeTime())); //call videoplayers to set right position
-                    }
+                	//jump if unsynced
+                	if (gpsVP.isSynced())
+                	{
+                		//jump if we know position
+                        if(wp.attr.containsKey("synced"))
+                        {
+                        	gps.goTo(wp);
+                            if(gpsVP!=null) gpsVP.jumpToGPSTime(new Date(gps.getRelativeTime())); //call videoplayers to set right position
+                        }
+                	}
+                	else
+                	{
+                		//otherwise let user mark possible sync point
+                		gps.goTo(wp);
+                	}
+                    
                 }
             }
@@ -308,3 +319,8 @@
 		return gpsVP;
 	}
+	
+	public String getGPSTime()
+	{
+		return gpsTimeCode.format(iconPosition.getTime());
+	}
 }
Index: /applications/editors/josm/plugins/videomapping/src/org/openstreetmap/josm/plugins/videomapping/VideoMappingPlugin.java
===================================================================
--- /applications/editors/josm/plugins/videomapping/src/org/openstreetmap/josm/plugins/videomapping/VideoMappingPlugin.java	(revision 25384)
+++ /applications/editors/josm/plugins/videomapping/src/org/openstreetmap/josm/plugins/videomapping/VideoMappingPlugin.java	(revision 25385)
@@ -5,4 +5,5 @@
 import java.awt.event.ActionEvent;
 import java.awt.event.KeyEvent;
+import java.io.File;
 import java.text.ParseException;
 import java.text.SimpleDateFormat;
@@ -73,5 +74,5 @@
         VMenu.setEnabled(false);
         addMenuItems();
-        enableControlMenus(true);
+        enableControlMenus(false);
         loadSettings();
         applySettings();
@@ -87,18 +88,5 @@
             GpsLayer=((GpxLayer) newLayer);            
             //TODO append to GPS Layer menu
-        }
-        else
-        {/*
-            VAdd.setEnabled(false);
-            if(newLayer instanceof PositionLayer)
-            {
-                enableControlMenus(true);
-            }
-            else
-            {
-                enableControlMenus(false);
-            }*/
-        }
-        
+        }        
     }
 
@@ -109,5 +97,5 @@
     public void layerRemoved(Layer arg0) {
     	if(Main.main.getActiveLayer()==null)	VMenu.setEnabled(false);
-    } //well ok we have a local copy of the GPS track....
+    } //well ok we have allready a local copy of the GPS track....
 
     //register main controls
@@ -117,9 +105,11 @@
 
             public void actionPerformed(ActionEvent arg0) {                 
-                    JFileChooser fc = new JFileChooser("C:\\TEMP\\");
-                    //fc.setSelectedFile(new File(mru));
+                    JFileChooser fc = new JFileChooser(mru);
+                    fc.setSelectedFile(new File(mru));
                     if(fc.showOpenDialog(Main.main.parent)!=JFileChooser.CANCEL_OPTION)
                     {
-                        saveSettings();
+                    	//save selected path
+                    	mru=fc.getSelectedFile().getAbsolutePath();
+                    	Main.pref.put(VM_MRU, mru);
                         enableControlMenus(true);
                         layer = new PositionLayer(fc.getSelectedFile(),GpsLayer);
@@ -185,12 +175,12 @@
             	JOptionPane d=new JOptionPane(tr("Jump to"), JOptionPane.QUESTION_MESSAGE, JOptionPane.OK_CANCEL_OPTION);
             	final JFormattedTextField inp = new JFormattedTextField(new MaskFormatter("##:##:##"));
-            	inp.setText("00:00:01");
+            	inp.setText(layer.getGPSTime());
             	inp.setInputVerifier(new InputVerifier() {					
 					@Override
 					public boolean verify(JComponent input) {
-						// TODO Auto-generated method stub
 						return false;
 					}
 				});
+            	//hack to set the focus
             	SwingUtilities.invokeLater(new Runnable() {
                     public void run() {
@@ -202,5 +192,5 @@
             	{
 	            	Date t;
-	                SimpleDateFormat sdf= new SimpleDateFormat("hh:mm:ss");
+	                SimpleDateFormat sdf= new SimpleDateFormat("HH:mm:ss");
 	                t = sdf.parse(inp.getText());
 	                if (t!=null)
@@ -324,4 +314,8 @@
         Vforward.setEnabled(enabled);
         Vloop.setEnabled(enabled);
+        Vfaster.setEnabled(enabled);
+        Vslower.setEnabled(enabled);
+        VJump.setEnabled(enabled);
+        
     }
     
@@ -338,5 +332,5 @@
         if((temp!=null)&&(temp.length()!=0)) looplength=Integer.valueOf(temp); else looplength=6000;
         temp=Main.pref.get(VM_MRU);
-        if((temp!=null)&&(temp.length()!=0)) mru=Main.pref.get(VM_MRU);else mru=System.getProperty("user.home");
+        if((temp!=null)&&(temp.length()!=0)) mru=Main.pref.get(VM_MRU);else mru=System.getProperty("user.home");        
     }
     
@@ -362,6 +356,5 @@
         Main.pref.put(VM_DEINTERLACER, deinterlacer);
         Main.pref.put(VM_JUMPLENGTH, jumplength.toString());
-        Main.pref.put(VM_LOOPLENGTH, looplength.toString());
-        Main.pref.put(VM_MRU, mru);
+        Main.pref.put(VM_LOOPLENGTH, looplength.toString());        
     }
     
Index: /applications/editors/josm/plugins/videomapping/src/org/openstreetmap/josm/plugins/videomapping/video/GPSVideoPlayer.java
===================================================================
--- /applications/editors/josm/plugins/videomapping/src/org/openstreetmap/josm/plugins/videomapping/video/GPSVideoPlayer.java	(revision 25384)
+++ /applications/editors/josm/plugins/videomapping/src/org/openstreetmap/josm/plugins/videomapping/video/GPSVideoPlayer.java	(revision 25385)
@@ -3,4 +3,5 @@
 import java.awt.event.ActionEvent;
 import java.awt.event.ActionListener;
+import java.awt.event.WindowEvent;
 import java.io.File;
 import java.sql.Date;
@@ -47,11 +48,22 @@
             //do a sync
             public void actionPerformed(ActionEvent e) {
-                long diff=gps.getRelativeTime()-video.getTime(); //FIXME differenzierter betrachten
-                file= new GPSVideoFile(file, diff);
-                syncBtn.setBackground(Color.GREEN);
-                synced=true;
-                markSyncedPoints();
-                video.play();
-                //gps.play();
+            	if (!synced)
+            	{
+            		//FIXME doesn't work correctly after a resync
+            		//determine time offset
+	                long diff=gps.getRelativeTime()-video.getTime(); //FIXME differenzierter betrachten
+	                file= new GPSVideoFile(file, diff);
+	                syncBtn.setBackground(Color.GREEN);
+	                synced=true;
+	                markSyncedPoints();
+	                video.play();
+	                //gps.play();
+            	}
+            	else
+            	{
+            		//let user resync again
+            		synced=false;
+            		syncBtn.setBackground(null);
+            	}
             }
         });
@@ -190,5 +202,5 @@
     public boolean isSynced()
     {
-        return isSynced();
+        return synced;
     }
 
@@ -266,4 +278,10 @@
         subtTitleComponent=a;
     }
+    
+    public void close()
+    {
+    	video.windowClosing(new WindowEvent(video,1));
+    }
+    
 
 
Index: /applications/editors/josm/plugins/videomapping/src/org/openstreetmap/josm/plugins/videomapping/video/SimpleVideoPlayer.java
===================================================================
--- /applications/editors/josm/plugins/videomapping/src/org/openstreetmap/josm/plugins/videomapping/video/SimpleVideoPlayer.java	(revision 25384)
+++ /applications/editors/josm/plugins/videomapping/src/org/openstreetmap/josm/plugins/videomapping/video/SimpleVideoPlayer.java	(revision 25385)
@@ -118,5 +118,5 @@
 				      });
 				}
-			}, 0L, 1000L, TimeUnit.MILLISECONDS);
+			}, 0L, 200L, TimeUnit.MILLISECONDS);
             //setDefaultCloseOperation(EXIT_ON_CLOSE);
             addWindowListener(this);
@@ -294,7 +294,8 @@
     public void windowClosing(WindowEvent evt) {
         if(LOG.isDebugEnabled()) {LOG.debug("windowClosing(evt=" + evt + ")");}
+        pause();
+        //FIXME stop timers etc.
         mp.release();
         mp = null;
-        System.exit(0);
       }
 
