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 21468)
+++ applications/editors/josm/plugins/videomapping/src/org/openstreetmap/josm/plugins/videomapping/GpsPlayer.java	(revision 21519)
@@ -1,4 +1,8 @@
 package org.openstreetmap.josm.plugins.videomapping;
 
+import java.awt.Point;
+import java.sql.Time;
+import java.text.SimpleDateFormat;
+import java.util.Date;
 import java.util.List;
 import java.util.ListIterator;
@@ -9,5 +13,5 @@
 import org.openstreetmap.josm.data.gpx.WayPoint;
 
-//for GPS play control secure stepping througt list
+//for GPS play control, secure stepping through list and interpolation work in current projection
 public class GpsPlayer {
 	private List<WayPoint> ls;
@@ -53,5 +57,5 @@
 			next =curr;
 			curr=prev;
-			prev=ls.get(ls.indexOf(curr)-1);;
+			if(ls.indexOf(curr)==0) prev=null;else 	prev=ls.get(ls.indexOf(curr)-1);
 		}
 		else prev=null;		
@@ -68,5 +72,5 @@
 			}
 			else prev=null;
-			if(ls.indexOf(curr)<ls.size())
+			if(ls.indexOf(curr)+1<ls.size())
 			{
 				next=ls.get(ls.indexOf(curr)+1);
@@ -85,4 +89,153 @@
 	}
 	
+	//gets only points on the line of the GPS track between waypoints nearby the point m
+	private Point getInterpolated(Point m)
+	{
+		Point leftP,rightP,highP,lowP;
+		boolean invalid = false;
+		Point p1 = Main.map.mapView.getPoint(getCurr().getEastNorth());
+		if(getNext()!=null) //TODO outsource certain dub routines
+		{
+			Point p2 = Main.map.mapView.getPoint(getNext().getEastNorth());
+			//determine which point is what
+			if(p1.x<p2.x)
+			{
+				leftP=p1;
+				rightP=p2;
+			}
+			else
+			{
+				leftP=p2;
+				rightP=p1;
+			}
+			if(p1.y<p2.y)
+			{
+				highP=p1;
+				lowP=p2;
+			}
+			else
+			{
+				highP=p2;
+				lowP=p1;
+			}
+			//we might switch to neighbor segment
+			if(m.x<leftP.x)
+			{
+				Point c = Main.map.mapView.getPoint(getCurr().getEastNorth());
+				Point n = Main.map.mapView.getPoint(getNext().getEastNorth());
+				if(n.x<c.x)	next(); else prev();
+				invalid=true;
+				m=leftP;
+				System.out.println("entering left segment");
+			}
+			if(m.x>rightP.x)
+			{
+				Point c = Main.map.mapView.getPoint(getCurr().getEastNorth());
+				Point n = Main.map.mapView.getPoint(getNext().getEastNorth());
+				if(n.x>c.x)	next(); else prev();
+				invalid=true;
+				m=rightP;
+				System.out.println("entering right segment");
+			}
+			//highP = Main.map.mapView.getPoint(l.getCurr().getEastNorth());
+			//lowP = Main.map.mapView.getPoint(l.getNext().getEastNorth());
+			if(!invalid)
+			{
+				float slope=(float)(highP.y-lowP.y) / (float)(highP.x - lowP.x);
+				m.y = highP.y+Math.round(slope*(m.x-highP.x));
+			}
+		}
+		else
+		{
+			//currently we are at the end
+			Point p2 = Main.map.mapView.getPoint(getPrev().getEastNorth());
+			if (p1.x>p2.x)
+			{
+				leftP=p2;
+				rightP=p1;
+			}
+			else
+			{
+				leftP=p1;
+				rightP=p2;
+			}
+			if(m.x>rightP.x)
+			{
+				m=rightP; //we can't move anywhere
+			}
+			else
+			{
+				prev();
+			}
+			
+			
+		}
+		//System.out.println((m));
+		return m;
+	}
+	
+	//gets further infos for a point between two Waypoints
+	public WayPoint getInterpolatedWaypoint(Point m)
+	{	int a,b,length,lengthSeg;
+		long timeSeg;
+		float ratio;
+		Time base;
+		Point p2;
+		
+		Point curr =Main.map.mapView.getPoint(getCurr().getEastNorth());
+		m =getInterpolated(m);
+		if (getNext()!=null)
+		{
+			p2 =Main.map.mapView.getPoint(getNext().getEastNorth());
+			timeSeg=getNext().getTime().getTime()-getCurr().getTime().getTime();
+		}
+		else
+		{
+			p2 =Main.map.mapView.getPoint(getPrev().getEastNorth());
+			timeSeg=-(getPrev().getTime().getTime()-getCurr().getTime().getTime());
+		}
+		WayPoint w =new WayPoint(Main.map.mapView.getLatLon(m.x, m.y));
+		//calc total traversal length
+		a=Math.abs(curr.x-p2.x);
+		b=Math.abs(curr.y-p2.y);
+		lengthSeg= (int) Math.sqrt(Math.pow(a, 2)+Math.pow(b, 2));
+		a=Math.abs(m.x-p2.x);
+		b=Math.abs(m.y-p2.y);
+		length= (int) Math.sqrt(Math.pow(a, 2)+Math.pow(b, 2));
+		length=lengthSeg-length;
+		ratio=(float)length/(float)lengthSeg;
+		long inc=(long) (timeSeg*ratio);
+		SimpleDateFormat df = new SimpleDateFormat("hh:mm:ss:S");
+		long old = getCurr().getTime().getTime();
+		old=old+inc;
+		System.out.print(length+"px ");
+		System.out.print(ratio+"% ");
+		System.out.print(inc+"ms ");
+		System.out.println(df.format(old));
+		Date t = new Date(old);
+		//TODO we have to publish the new date to the node...
+		return w;
+	}
+	
+	public List<WayPoint> getInterpolatedLine(int interval)
+	{
+		Point p2;
+		Point curr =Main.map.mapView.getPoint(getCurr().getEastNorth());
+		if (getNext()!=null)
+		{
+			p2 =Main.map.mapView.getPoint(getNext().getEastNorth());
+		}
+		else
+		{
+			p2 =Main.map.mapView.getPoint(getPrev().getEastNorth());
+		}
+		int a=Math.abs(curr.x-p2.x);
+		int b=Math.abs(curr.y-p2.y);
+		int length= (int) Math.sqrt(Math.pow(a, 2)+Math.pow(b, 2));
+		float step=length/interval;
+		//TODO here we go
+		return null;
+	}
+	
 
 }
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 21468)
+++ applications/editors/josm/plugins/videomapping/src/org/openstreetmap/josm/plugins/videomapping/PositionLayer.java	(revision 21519)
@@ -2,6 +2,10 @@
 
 
+import java.sql.Time;
+import java.text.DateFormat;
+import java.text.SimpleDateFormat;
 import java.util.ArrayList;
 import java.util.Collection;
+import java.util.Date;
 import java.util.Iterator;
 import java.util.List;
@@ -47,4 +51,5 @@
 	private TimerTask ani;
 	private boolean dragIcon=false; //do we move the icon by hand?
+	private WayPoint iconPosition;
 	private Point mouse;
 	private ImageIcon icon;
@@ -55,15 +60,10 @@
 		l= new GpsPlayer(ls);
 		selected = new ArrayList<WayPoint>();
-		icon=ImageProvider.get("videomapping.png");
-		Action a = new AbstractAction() {
-			public void actionPerformed(ActionEvent e) {
-				// TODO Auto-generated method stub
-				System.err.println("!!!boom!!!");
-			}};		
+		icon=ImageProvider.get("videomapping.png");		
 		Main.map.mapView.addMouseListener(this);
 		Main.map.mapView.addMouseMotionListener(this);
-		
+		Main.map.mapView.getRootPane().getGlassPane().addKeyListener(this);
 		//Main.panel.addKeyListener(this);
-		Main.map.mapView.addKeyListener(this);
+		//Main.map.mapView.addKeyListener(this);
 		//Main.contentPane.getInputMap().put(KeyStroke.getKeyStroke("SPACE"),"pressed");
 		//Main.contentPane.getActionMap().put("pressed",a);
@@ -83,5 +83,5 @@
 		Timer t= new Timer();
 		//t.schedule(ani,2000,2000);
-		l.next();l.next();
+		//l.next();
 		
 	}
@@ -167,8 +167,9 @@
 		if(dragIcon)
 		{
-			if(mouse!=null)
-			{
-				p=mouse;
+			if(iconPosition!=null)
+			{
+				p=Main.map.mapView.getPoint(iconPosition.getEastNorth());
 				icon.paintIcon(null, g, p.x-icon.getIconWidth()/2, p.y-icon.getIconHeight()/2);
+				g.drawString(iconPosition.getTime().toString(),p.x,p.y);
 			}
 		}
@@ -183,8 +184,8 @@
 	}
 
-	private void markNearestNode(Point mouse) {
+	private void markNearestWayPoints(Point mouse) {
 		final int MAX=10; 
 		Point p;		
-		Rectangle rect = new Rectangle(mouse.x-MAX/2,mouse.y-MAX/2,mouse.x+MAX/2,mouse.y+MAX/2);
+		Rectangle rect = new Rectangle(mouse.x-MAX/2,mouse.y-MAX/2,MAX,MAX);
 		//iterate through all possible notes
 		for(WayPoint n : ls)
@@ -199,9 +200,9 @@
 	}
 	
-	private WayPoint getNearestPoint(Point mouse)
+	private WayPoint getNearestWayPoint(Point mouse)
 	{
 		final int MAX=10;
 		Point p;
-		Rectangle rect = new Rectangle(mouse.x-MAX/2,mouse.y-MAX/2,mouse.x+MAX/2,mouse.y+MAX/2);
+		Rectangle rect = new Rectangle(mouse.x-MAX/2,mouse.y-MAX/2,MAX,MAX);
 		//iterate through all possible notes
 		for(WayPoint n : ls) //TODO this is not very clever, what better way to find this WP?
@@ -261,6 +262,6 @@
 			{
 				//JOptionPane.showMessageDialog(Main.parent,"test");
-				markNearestNode(e.getPoint());
-				WayPoint wp = getNearestPoint(e.getPoint());
+				markNearestWayPoints(e.getPoint());
+				WayPoint wp = getNearestWayPoint(e.getPoint());
 				if(wp!=null)
 				{
@@ -273,20 +274,4 @@
 	}
 	
-	//gets point on the line between
-	private Point getInterpolated(Point m)
-	{		
-		Point highest = Main.map.mapView.getPoint(l.getCurr().getEastNorth());
-		Point smallest = Main.map.mapView.getPoint(l.getNext().getEastNorth());
-		float slope=(float)(highest.y-smallest.y) / (float)(highest.x - smallest.x);
-		
-		m.y = highest.y+Math.round(slope*(m.x-highest.x));
-		if(m.x<smallest.x)
-		{
-			m=smallest;
-		}
-		if(m.x>highest.x) m=highest;
-		System.out.println((m));
-		return m;
-	}
 	
 	public void mouseDragged(MouseEvent e) {		
@@ -295,5 +280,5 @@
 			mouse=e.getPoint();
 			//restrict to GPS track
-			mouse=getInterpolated(mouse);
+			iconPosition=l.getInterpolatedWaypoint(mouse);
 
 			Main.map.mapView.repaint();
@@ -330,9 +315,9 @@
 			case KeyEvent.VK_RIGHT:
 				{
-					l.jump(10);
+					l.jump(1);
 				};break;
 			case KeyEvent.VK_LEFT:
 			{
-				l.jump(-10);
+				l.jump(-1);
 
 			};break;
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 21468)
+++ applications/editors/josm/plugins/videomapping/src/org/openstreetmap/josm/plugins/videomapping/VideoMappingPlugin.java	(revision 21519)
@@ -36,8 +36,9 @@
 		//setup
 		MapView.addLayerChangeListener(this);
-		
+		//plugin informations are provided by build.xml properties
 	}
 		
 	
+	//only used with GPS layers
 	public void activeLayerChange(Layer oldLayer, Layer newLayer) {
 		if (newLayer instanceof GpxLayer)
