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 23173)
+++ applications/editors/josm/plugins/videomapping/src/org/openstreetmap/josm/plugins/videomapping/GpsPlayer.java	(revision 23193)
@@ -17,382 +17,382 @@
 //for GPS play control, secure stepping through list and interpolation work in current projection
 public class GpsPlayer {
-	private List<WayPoint> ls;
-	private WayPoint prev,curr,next;
-	private WayPoint start;
-	private Timer t;
-	private TimerTask ani; //for moving trough the list
-	private boolean autoCenter;
-	
-
-	public WayPoint getPrev() {
-		return prev;
-	}
-
-	public WayPoint getCurr() {
-		return curr;
-	}
-
-	public WayPoint getNext() {
-		return next;
-	}
-	
-	public WayPoint getWaypoint(long relTime)
-	{
-		int pos = Math.round(relTime/1000);//TODO ugly quick hack	
-		return ls.get(pos);
-	}
-
-	public GpsPlayer(List<WayPoint> l) {
-		super();
-		this.ls = l;
-		//set start position
-		start=ls.get(0);
-		prev=null;
-		curr=ls.get(0);
-		next=ls.get(1);
-	}
-	
-	// one secure step forward
-	public void next() {		
-		if(ls.indexOf(curr)+1<ls.size())
-		{
-			prev=curr;
-			curr=next;
-			if(ls.indexOf(curr)+1==ls.size()) next=null;
-			else next=ls.get(ls.indexOf(curr)+1);
-		}
-		else next=null;
-		
-	}
-	
-	//one secure step backward
-	public void prev()
-	{
-		if(ls.indexOf(curr)>0)
-		{			
-			next =curr;
-			curr=prev;
-			if(ls.indexOf(curr)==0) prev=null;else 	prev=ls.get(ls.indexOf(curr)-1);
-		}
-		else prev=null;		
-	}
-	
-	//select the given waypoint as center
-	public void jump(WayPoint p)
-	{
-		if(ls.contains(p))
-		{
-			curr=p;
-			if(ls.indexOf(curr)>0)
-			{
-				prev=ls.get(ls.indexOf(curr)-1);
-			}
-			else prev=null;
-			if(ls.indexOf(curr)+1<ls.size())
-			{
-				next=ls.get(ls.indexOf(curr)+1);
-			}
-			else next=null;
-		}
-	}
-	
-	//walk k waypoints forward/backward
-	public void jumpRel(int k)
-	{
-
-		if ((ls.indexOf(curr)+k>0)&&(ls.indexOf(curr)<ls.size())) //check range
-		{
-			jump(ls.get(ls.indexOf(curr)+k));
-		}
-		Main.map.mapView.repaint(); //seperate modell and view logic...
-	}
-	
-	//select the k-th waypoint
-	public void jump(int k)
-	{
-		if (k>0)
-		{
-			if ((ls.indexOf(curr)+k>0)&&(ls.indexOf(curr)<ls.size())) //check range
-			{
-				jump(ls.get(k));
-			}
-			Main.map.mapView.repaint();
-		}
-	}
-	
-	//go to the position at the timecode e.g.g "14:00:01";
-	public void jump(Time GPSAbsTime)
-	{
-		jump(getWaypoint(GPSAbsTime.getTime()-start.getTime().getTime())); //TODO replace Time by Date?
-	}
-	
-	//go to the position at 
-	public void jump(Date GPSDate)
-	{
-		long s,m,h,diff;
-		//calculate which waypoint is at the offset
-		System.out.println(start.getTime());
-		System.out.println(start.getTime().getHours()+":"+start.getTime().getMinutes()+":"+start.getTime().getSeconds());
-		s=GPSDate.getSeconds()-start.getTime().getSeconds();
-		m=GPSDate.getMinutes()-start.getTime().getMinutes();
-		h=GPSDate.getHours()-start.getTime().getHours();
-		diff=s*1000+m*60*1000+h*60*60*1000; //TODO ugly hack but nothing else works right
-		jump(getWaypoint(diff)); 
-	}
-	
-	//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; //when we leave this segment
-		Point p1 = Main.map.mapView.getPoint(getCurr().getEastNorth());
-		Point p2 = getEndpoint();
-		//determine which point is what
-		leftP=getLeftPoint(p1, p2);
-		rightP=getRightPoint(p1,p2);
-		highP=getHighPoint(p1, p2);
-		lowP=getLowPoint(p1, p2);
-		if(getNext()!=null)
-		{
-			//we might switch to one 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");
-			}
-			if(!invalid)
-			{
-				float slope = getSlope(highP, lowP);
-				m.y = highP.y+Math.round(slope*(m.x-highP.x));
-			}
-		}
-		else
-		{
-			//currently we are at the end
-			if(m.x>rightP.x)
-			{
-				m=rightP; //we can't move anywhere
-			}
-			else
-			{
-				prev(); //walk back to the segment before
-			}			
-		}
-		return m;
-	}
-	
-	//returns a point on the p% of the current selected segment
-	private Point getInterpolated(float percent)
-	{
-
-		int dX,dY;
-		Point p;
-		Point leftP,rightP;
-		Point c = Main.map.mapView.getPoint(getCurr().getEastNorth());
-		Point p1 = Main.map.mapView.getPoint(getCurr().getEastNorth());
-		Point p2 = getEndpoint();		
-		//determine which point is what
-		leftP=getLeftPoint(p1, p2);
-		rightP=getRightPoint(p1,p2);
-		//we will never go over the segment
-		percent=percent/100;
-		dX=Math.round((rightP.x-leftP.x)*percent);
-		dY=Math.round((rightP.y-leftP.y)*percent);
-		//move in the right direction
-		p=new Point(rightP.x-dX,rightP.y-dY);
-
-		return p;
-	}
-
-	//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); //get the right position
-		//get the right time
-		p2=getEndpoint();
-		if (getNext()!=null)
-		{
-			timeSeg=getNext().getTime().getTime()-getCurr().getTime().getTime();
-		}
-		else
-		{
-			timeSeg=-(getPrev().getTime().getTime()-getCurr().getTime().getTime());
-		}
-		WayPoint w =new WayPoint(Main.map.mapView.getLatLon(m.x, m.y));
-		//calc total traversal length
-		lengthSeg = getTraversalLength(p2, curr);
-		length = getTraversalLength(p2, m);
-		length=lengthSeg-length;
-		//calc time difference
-		ratio=(float)length/(float)lengthSeg;
-		long inc=(long) (timeSeg*ratio);		
-		long old = getCurr().getTime().getTime();
-		old=old+inc;
-		Date t = new Date(old);
-		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...
-		return w;
-	}
-
-	//returns a point and time for the current segment
-	private WayPoint getInterpolatedWaypoint(float percentage)
-	{
-		Point p = getInterpolated(percentage);
-		WayPoint w =new WayPoint(Main.map.mapView.getLatLon(p.x, p.y));
-		return w;
-	}
-	
-	//returns n points on the current segment
-	public List<WayPoint> getInterpolatedLine(int interval)
-	{
-		List<WayPoint> ls;
-		Point p2;
-		float step;
-		int length;
-		
-		step=100/(float)interval;
-		ls=new LinkedList<WayPoint>();
-		for(float i=step;i<100;i+=step)
-		{
-			ls.add(getInterpolatedWaypoint(i));
-		}
-		return ls;
-	}
-	
-	private Point getLeftPoint(Point p1,Point p2)
-	{
-		if(p1.x<p2.x) return p1; else return p2;
-	}
-	
-	private Point getRightPoint(Point p1, Point p2)
-	{
-		if(p1.x>p2.x) return p1; else return p2;
-	}
-	
-	private Point getHighPoint(Point p1, Point p2)
-	{
-		if(p1.y<p2.y)return p1; else return p2;
-	}
-	
-	private Point getLowPoint(Point p1, Point p2)
-	{
-		if(p1.y>p2.y)return p1; else return p2;
-	}
-
-	private Point getEndpoint() {
-		if(getNext()!=null)
-		{
-			return Main.map.mapView.getPoint(getNext().getEastNorth());
-		}
-		else
-		{
-			return Main.map.mapView.getPoint(getPrev().getEastNorth());
-		}
-		
-	}
-
-	private float getSlope(Point highP, Point lowP) {
-		float slope=(float)(highP.y-lowP.y) / (float)(highP.x - lowP.x);
-		return slope;
-	}
-
-	private int getTraversalLength(Point p2, Point curr) {
-		int a;
-		int b;
-		int lengthSeg;
-		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));
-		return lengthSeg;
-	}
-
-	//returns time in ms relatie to startpoint
-	public long getRelativeTime()
-	{
-		return getRelativeTime(curr);
-	}
-	
-	public long getRelativeTime(WayPoint p)
-	{
-		return p.getTime().getTime()-start.getTime().getTime(); //TODO assumes timeintervall is constant!!!!
-	}
-	
-	
-	//jumps to a specific time
-	public void jump(long relTime) {
-		int pos = Math.round(relTime/1000);//TODO ugly quick hack	
-		jump(pos);
-		//if (autoCenter) Main.map.mapView.
-	}
-	
-	//toggles walking along the track
-	public void play()
-	{ /*
-		if (t==null)
-		{
-			//start
-			t= new Timer();
-			ani=new TimerTask() {			
-				@Override
-				//some cheap animation stuff
-				public void run() {				
-					next();
-					if(autoCenter) Main.map.mapView.zoomTo(getCurr().getEastNorth());
-					Main.map.mapView.repaint();
-				}
-			};
-			t.schedule(ani,1000,1000);			
-		}
-		else
-		{
-			//stop
-			ani.cancel();
-			ani=null;
-			t.cancel();
-			t=null;					
-		}*/
-	}
-
-	public long getLength() {
-		return ls.size()*1000; //FIXME this is a poor hack
-	}
-	
-	public void setAutoCenter(boolean b)
-	{
-		this.autoCenter=b;
-	}
-	
-	public List<WayPoint> getTrack()
-	{
-		return ls;
-	}
-
-
-
-	
+    private List<WayPoint> ls;
+    private WayPoint prev,curr,next;
+    private WayPoint start;
+    private Timer t;
+    private TimerTask ani; //for moving trough the list
+    private boolean autoCenter;
+    
+
+    public WayPoint getPrev() {
+        return prev;
+    }
+
+    public WayPoint getCurr() {
+        return curr;
+    }
+
+    public WayPoint getNext() {
+        return next;
+    }
+    
+    public WayPoint getWaypoint(long relTime)
+    {
+        int pos = Math.round(relTime/1000);//TODO ugly quick hack   
+        return ls.get(pos);
+    }
+
+    public GpsPlayer(List<WayPoint> l) {
+        super();
+        this.ls = l;
+        //set start position
+        start=ls.get(0);
+        prev=null;
+        curr=ls.get(0);
+        next=ls.get(1);
+    }
+    
+    // one secure step forward
+    public void next() {        
+        if(ls.indexOf(curr)+1<ls.size())
+        {
+            prev=curr;
+            curr=next;
+            if(ls.indexOf(curr)+1==ls.size()) next=null;
+            else next=ls.get(ls.indexOf(curr)+1);
+        }
+        else next=null;
+        
+    }
+    
+    //one secure step backward
+    public void prev()
+    {
+        if(ls.indexOf(curr)>0)
+        {           
+            next =curr;
+            curr=prev;
+            if(ls.indexOf(curr)==0) prev=null;else  prev=ls.get(ls.indexOf(curr)-1);
+        }
+        else prev=null;     
+    }
+    
+    //select the given waypoint as center
+    public void jump(WayPoint p)
+    {
+        if(ls.contains(p))
+        {
+            curr=p;
+            if(ls.indexOf(curr)>0)
+            {
+                prev=ls.get(ls.indexOf(curr)-1);
+            }
+            else prev=null;
+            if(ls.indexOf(curr)+1<ls.size())
+            {
+                next=ls.get(ls.indexOf(curr)+1);
+            }
+            else next=null;
+        }
+    }
+    
+    //walk k waypoints forward/backward
+    public void jumpRel(int k)
+    {
+
+        if ((ls.indexOf(curr)+k>0)&&(ls.indexOf(curr)<ls.size())) //check range
+        {
+            jump(ls.get(ls.indexOf(curr)+k));
+        }
+        Main.map.mapView.repaint(); //seperate modell and view logic...
+    }
+    
+    //select the k-th waypoint
+    public void jump(int k)
+    {
+        if (k>0)
+        {
+            if ((ls.indexOf(curr)+k>0)&&(ls.indexOf(curr)<ls.size())) //check range
+            {
+                jump(ls.get(k));
+            }
+            Main.map.mapView.repaint();
+        }
+    }
+    
+    //go to the position at the timecode e.g.g "14:00:01";
+    public void jump(Time GPSAbsTime)
+    {
+        jump(getWaypoint(GPSAbsTime.getTime()-start.getTime().getTime())); //TODO replace Time by Date?
+    }
+    
+    //go to the position at 
+    public void jump(Date GPSDate)
+    {
+        long s,m,h,diff;
+        //calculate which waypoint is at the offset
+        System.out.println(start.getTime());
+        System.out.println(start.getTime().getHours()+":"+start.getTime().getMinutes()+":"+start.getTime().getSeconds());
+        s=GPSDate.getSeconds()-start.getTime().getSeconds();
+        m=GPSDate.getMinutes()-start.getTime().getMinutes();
+        h=GPSDate.getHours()-start.getTime().getHours();
+        diff=s*1000+m*60*1000+h*60*60*1000; //TODO ugly hack but nothing else works right
+        jump(getWaypoint(diff)); 
+    }
+    
+    //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; //when we leave this segment
+        Point p1 = Main.map.mapView.getPoint(getCurr().getEastNorth());
+        Point p2 = getEndpoint();
+        //determine which point is what
+        leftP=getLeftPoint(p1, p2);
+        rightP=getRightPoint(p1,p2);
+        highP=getHighPoint(p1, p2);
+        lowP=getLowPoint(p1, p2);
+        if(getNext()!=null)
+        {
+            //we might switch to one 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");
+            }
+            if(!invalid)
+            {
+                float slope = getSlope(highP, lowP);
+                m.y = highP.y+Math.round(slope*(m.x-highP.x));
+            }
+        }
+        else
+        {
+            //currently we are at the end
+            if(m.x>rightP.x)
+            {
+                m=rightP; //we can't move anywhere
+            }
+            else
+            {
+                prev(); //walk back to the segment before
+            }           
+        }
+        return m;
+    }
+    
+    //returns a point on the p% of the current selected segment
+    private Point getInterpolated(float percent)
+    {
+
+        int dX,dY;
+        Point p;
+        Point leftP,rightP;
+        Point c = Main.map.mapView.getPoint(getCurr().getEastNorth());
+        Point p1 = Main.map.mapView.getPoint(getCurr().getEastNorth());
+        Point p2 = getEndpoint();       
+        //determine which point is what
+        leftP=getLeftPoint(p1, p2);
+        rightP=getRightPoint(p1,p2);
+        //we will never go over the segment
+        percent=percent/100;
+        dX=Math.round((rightP.x-leftP.x)*percent);
+        dY=Math.round((rightP.y-leftP.y)*percent);
+        //move in the right direction
+        p=new Point(rightP.x-dX,rightP.y-dY);
+
+        return p;
+    }
+
+    //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); //get the right position
+        //get the right time
+        p2=getEndpoint();
+        if (getNext()!=null)
+        {
+            timeSeg=getNext().getTime().getTime()-getCurr().getTime().getTime();
+        }
+        else
+        {
+            timeSeg=-(getPrev().getTime().getTime()-getCurr().getTime().getTime());
+        }
+        WayPoint w =new WayPoint(Main.map.mapView.getLatLon(m.x, m.y));
+        //calc total traversal length
+        lengthSeg = getTraversalLength(p2, curr);
+        length = getTraversalLength(p2, m);
+        length=lengthSeg-length;
+        //calc time difference
+        ratio=(float)length/(float)lengthSeg;
+        long inc=(long) (timeSeg*ratio);        
+        long old = getCurr().getTime().getTime();
+        old=old+inc;
+        Date t = new Date(old);
+        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...
+        return w;
+    }
+
+    //returns a point and time for the current segment
+    private WayPoint getInterpolatedWaypoint(float percentage)
+    {
+        Point p = getInterpolated(percentage);
+        WayPoint w =new WayPoint(Main.map.mapView.getLatLon(p.x, p.y));
+        return w;
+    }
+    
+    //returns n points on the current segment
+    public List<WayPoint> getInterpolatedLine(int interval)
+    {
+        List<WayPoint> ls;
+        Point p2;
+        float step;
+        int length;
+        
+        step=100/(float)interval;
+        ls=new LinkedList<WayPoint>();
+        for(float i=step;i<100;i+=step)
+        {
+            ls.add(getInterpolatedWaypoint(i));
+        }
+        return ls;
+    }
+    
+    private Point getLeftPoint(Point p1,Point p2)
+    {
+        if(p1.x<p2.x) return p1; else return p2;
+    }
+    
+    private Point getRightPoint(Point p1, Point p2)
+    {
+        if(p1.x>p2.x) return p1; else return p2;
+    }
+    
+    private Point getHighPoint(Point p1, Point p2)
+    {
+        if(p1.y<p2.y)return p1; else return p2;
+    }
+    
+    private Point getLowPoint(Point p1, Point p2)
+    {
+        if(p1.y>p2.y)return p1; else return p2;
+    }
+
+    private Point getEndpoint() {
+        if(getNext()!=null)
+        {
+            return Main.map.mapView.getPoint(getNext().getEastNorth());
+        }
+        else
+        {
+            return Main.map.mapView.getPoint(getPrev().getEastNorth());
+        }
+        
+    }
+
+    private float getSlope(Point highP, Point lowP) {
+        float slope=(float)(highP.y-lowP.y) / (float)(highP.x - lowP.x);
+        return slope;
+    }
+
+    private int getTraversalLength(Point p2, Point curr) {
+        int a;
+        int b;
+        int lengthSeg;
+        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));
+        return lengthSeg;
+    }
+
+    //returns time in ms relatie to startpoint
+    public long getRelativeTime()
+    {
+        return getRelativeTime(curr);
+    }
+    
+    public long getRelativeTime(WayPoint p)
+    {
+        return p.getTime().getTime()-start.getTime().getTime(); //TODO assumes timeintervall is constant!!!!
+    }
+    
+    
+    //jumps to a specific time
+    public void jump(long relTime) {
+        int pos = Math.round(relTime/1000);//TODO ugly quick hack   
+        jump(pos);
+        //if (autoCenter) Main.map.mapView.
+    }
+    
+    //toggles walking along the track
+    public void play()
+    { /*
+        if (t==null)
+        {
+            //start
+            t= new Timer();
+            ani=new TimerTask() {           
+                @Override
+                //some cheap animation stuff
+                public void run() {             
+                    next();
+                    if(autoCenter) Main.map.mapView.zoomTo(getCurr().getEastNorth());
+                    Main.map.mapView.repaint();
+                }
+            };
+            t.schedule(ani,1000,1000);          
+        }
+        else
+        {
+            //stop
+            ani.cancel();
+            ani=null;
+            t.cancel();
+            t=null;                 
+        }*/
+    }
+
+    public long getLength() {
+        return ls.size()*1000; //FIXME this is a poor hack
+    }
+    
+    public void setAutoCenter(boolean b)
+    {
+        this.autoCenter=b;
+    }
+    
+    public List<WayPoint> getTrack()
+    {
+        return ls;
+    }
+
+
+
+    
 }
Index: applications/editors/josm/plugins/videomapping/src/org/openstreetmap/josm/plugins/videomapping/PlayerObserver.java
===================================================================
--- applications/editors/josm/plugins/videomapping/src/org/openstreetmap/josm/plugins/videomapping/PlayerObserver.java	(revision 23173)
+++ applications/editors/josm/plugins/videomapping/src/org/openstreetmap/josm/plugins/videomapping/PlayerObserver.java	(revision 23193)
@@ -3,7 +3,7 @@
 //an Interface for communication for both players
 public interface PlayerObserver {
-	void playing(long time);
-	void jumping(long time);
-	void metadata(long time,boolean subtitles);
+    void playing(long time);
+    void jumping(long time);
+    void metadata(long time,boolean subtitles);
 
 }
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 23173)
+++ applications/editors/josm/plugins/videomapping/src/org/openstreetmap/josm/plugins/videomapping/PositionLayer.java	(revision 23193)
@@ -55,46 +55,46 @@
 //Basic rendering and GPS layer interaction
 public class PositionLayer extends Layer implements MouseListener,MouseMotionListener {
-	private static Set<PlayerObserver> observers = new HashSet<PlayerObserver>(); //we have to implement our own Observer pattern
-	private List<WayPoint> ls;
-	public GpsPlayer player;
-	private boolean dragIcon=false; //do we move the icon by hand?
-	private WayPoint iconPosition;
-	private Point mouse;
-	private ImageIcon icon;
-	private SimpleDateFormat mins;
-	private SimpleDateFormat ms;
-	private SimpleDateFormat gpsTimeCode;
-	private GPSVideoPlayer gps;
-		
-	public PositionLayer(String name, final List<WayPoint> ls) {
-		super(name);
-		this.ls=ls;
-		player= new GpsPlayer(ls);
-		icon = new ImageIcon("images/videomapping.png");
-		mins = new SimpleDateFormat("hh:mm:ss:S");
-		ms= new SimpleDateFormat("mm:ss");
-		gpsTimeCode= new SimpleDateFormat("hh:mm:ss");
-		Main.map.mapView.addMouseListener(this);
-		Main.map.mapView.addMouseMotionListener(this);							
-		
-	}
-
-
-	@Override
-	public Icon getIcon() {
-		return icon;
-	}
-
-	@Override
-	public Object getInfoComponent() {
-		String temp;
-		String sep=System.getProperty("line.separator");
-		temp=tr("{0} {1}% of GPS track",gps.getVideo().getName(),gps.getCoverage()*10+sep);
-		temp=temp+gps.getNativePlayerInfos();
-		return temp;
-	}
-
-	@Override
-	public Component[] getMenuEntries() {
+    private static Set<PlayerObserver> observers = new HashSet<PlayerObserver>(); //we have to implement our own Observer pattern
+    private List<WayPoint> ls;
+    public GpsPlayer player;
+    private boolean dragIcon=false; //do we move the icon by hand?
+    private WayPoint iconPosition;
+    private Point mouse;
+    private ImageIcon icon;
+    private SimpleDateFormat mins;
+    private SimpleDateFormat ms;
+    private SimpleDateFormat gpsTimeCode;
+    private GPSVideoPlayer gps;
+        
+    public PositionLayer(String name, final List<WayPoint> ls) {
+        super(name);
+        this.ls=ls;
+        player= new GpsPlayer(ls);
+        icon = new ImageIcon("images/videomapping.png");
+        mins = new SimpleDateFormat("hh:mm:ss:S");
+        ms= new SimpleDateFormat("mm:ss");
+        gpsTimeCode= new SimpleDateFormat("hh:mm:ss");
+        Main.map.mapView.addMouseListener(this);
+        Main.map.mapView.addMouseMotionListener(this);                          
+        
+    }
+
+
+    @Override
+    public Icon getIcon() {
+        return icon;
+    }
+
+    @Override
+    public Object getInfoComponent() {
+        String temp;
+        String sep=System.getProperty("line.separator");
+        temp=tr("{0} {1}% of GPS track",gps.getVideo().getName(),gps.getCoverage()*10+sep);
+        temp=temp+gps.getNativePlayerInfos();
+        return temp;
+    }
+
+    @Override
+    public Component[] getMenuEntries() {
         return new Component[]{
                 new JMenuItem(LayerListDialog.getInstance().createShowHideLayerAction(this)),
@@ -104,214 +104,214 @@
                 new JSeparator(),
                 new JMenuItem(new LayerListPopup.InfoAction(this))};//TODO here infos about the linked videos
-	}
-	  
-
-
-	@Override
-	public String getToolTipText() {
-		return tr("Shows current position in the video");
-	}
-
-	// no merging necessary
-	@Override
-	public boolean isMergable(Layer arg0) {
-		return false;
-	}
-
-	@Override
-	public void mergeFrom(Layer arg0) {
-		
-	}
-
-	
-	
-	@Override
-	//Draw the current position, infos, waypoints
-	public void paint(Graphics2D g, MapView map, Bounds bound) {
-		Point p;
-		//TODO Source out redundant calculations
-		//TODO make icon transparent
-		//draw all GPS points
-		g.setColor(Color.YELLOW); //new Color(0,255,0,128)
-		for(WayPoint n: ls) {
-			p = Main.map.mapView.getPoint(n.getEastNorth());
-			g.drawOval(p.x - 2, p.y - 2, 4, 4);
-		}
-		//draw synced points
-		g.setColor(Color.GREEN);
-		for(WayPoint n: ls) {
-			if(n.attr.containsKey("synced"))
-			{
-				p = Main.map.mapView.getPoint(n.getEastNorth());
-				g.drawOval(p.x - 2, p.y - 2, 4, 4);
-			}
-		}
-		//draw current segment points
-		g.setColor(Color.YELLOW);
-		if(player.getPrev()!=null)
-		{
-			p = Main.map.mapView.getPoint(player.getPrev().getEastNorth());
-			g.drawOval(p.x - 2, p.y - 2, 4, 4);
-			Point p2 = Main.map.mapView.getPoint(player.getCurr().getEastNorth());
-			g.drawLine(p.x, p.y, p2.x, p2.y);
-		}
-		if(player.getNext()!=null)
-		{
-			p = Main.map.mapView.getPoint(player.getNext().getEastNorth());
-			g.drawOval(p.x - 2, p.y - 2, 4, 4);
-			Point p2 = Main.map.mapView.getPoint(player.getCurr().getEastNorth());
-			g.drawLine(p.x, p.y, p2.x, p2.y);
-		}
-		//draw interpolated points
-		g.setColor(Color.CYAN);
-		g.setBackground(Color.CYAN);
-		LinkedList<WayPoint> ipo=(LinkedList<WayPoint>) player.getInterpolatedLine(5);
-		for (WayPoint wp : ipo) {
-			p=Main.map.mapView.getPoint(wp.getEastNorth());
-			g.fillArc(p.x, p.y, 4, 4, 0, 360);
-			//g.drawOval(p.x - 2, p.y - 2, 4, 4);
-		}
-		//draw cam icon
-		g.setColor(Color.RED);
-		if(dragIcon)
-		{
-			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(mins.format(iconPosition.getTime()),p.x-10,p.y-10); //TODO when synced we might wan't to use a different layout
-				g.drawString(gpsTimeCode.format(iconPosition.getTime()),p.x-10,p.y-10);
-			}
-		}
-		else
-		{
-			if (player.getCurr()!=null){
-			p=Main.map.mapView.getPoint(player.getCurr().getEastNorth());
-			icon.paintIcon(null, g, p.x-icon.getIconWidth()/2, p.y-icon.getIconHeight()/2);			
-			g.drawString(gpsTimeCode.format(player.getCurr().getTime()),p.x-10,p.y-10);
-			}
-		}
-	}
-	
-	//finds the first waypoint that is nearby the given point
-	private WayPoint getNearestWayPoint(Point mouse)
-	{
-		final int MAX=10;
-		Point p;
-		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? Hashmaps? Divide and Conquer?
-		{
-			p = Main.map.mapView.getPoint(n.getEastNorth());
-			if (rect.contains(p))
-			{				
-				return n;
-			}
-			
-		}
-		return null;
-		
-	}
-	
-	//upper left corner like rectangle
-	private Rectangle getIconRect()
-	{
-		Point p = Main.map.mapView.getPoint(player.getCurr().getEastNorth());
-		return new Rectangle(p.x-icon.getIconWidth()/2,p.y-icon.getIconHeight()/2,icon.getIconWidth(),icon.getIconHeight());
-	}
-
-
-	@Override
-	public void visitBoundingBox(BoundingXYVisitor arg0) {
-		// TODO don't know what to do here
-
-	}
-
-	public void mouseClicked(MouseEvent e) {		
-	}
-
-	public void mouseEntered(MouseEvent arg0) {	
-	}
-
-	public void mouseExited(MouseEvent arg0) {
-	}
-
-	//init drag&drop
-	public void mousePressed(MouseEvent e) {
-		if(e.getButton() == MouseEvent.BUTTON1) {
-			//is it on the cam icon?
-			if (player.getCurr()!=null)
-			{
-				if (getIconRect().contains(e.getPoint()))
-				{
-					mouse=e.getPoint();
-					dragIcon=true;
-				}
-			}
-		}
-		
-	}
-	
-	//
-	public void mouseReleased(MouseEvent e) {		
-		//only leftclicks on our layer
-		if(e.getButton() == MouseEvent.BUTTON1) {
-			if(dragIcon)
-			{
-				dragIcon=false;
-			}
-			else
-			{
-				//simple click
-				WayPoint wp = getNearestWayPoint(e.getPoint());
-				if(wp!=null)
-				{
-					player.jump(wp);
-					//jump if we know position
-					if(wp.attr.containsKey("synced"))
-					{						
-						if(gps!=null) notifyObservers(player.getRelativeTime()); //call videoplayers to set right position
-					}
-				}
-			}
-			Main.map.mapView.repaint();
-		}
-		
-	}
-	
-	//slide and restrict during movement
-	public void mouseDragged(MouseEvent e) {		
-		if(dragIcon)
-		{			
-			mouse=e.getPoint();
-			//restrict to GPS track
-			iconPosition=player.getInterpolatedWaypoint(mouse);
-
-			Main.map.mapView.repaint();
-		}
-	}
-
-	//visualize drag&drop
-	public void mouseMoved(MouseEvent e) {		
-		if (player.getCurr()!=null)
-		{						
-			if (getIconRect().contains(e.getPoint()))
-			{
-				Main.map.mapView.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
-			}
-			else
-			{
-				Main.map.mapView.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
-			}
-		}
-		
-	}
-
-	public void setGPSPlayer(GPSVideoPlayer player) {
-		this.gps = player;
-		
-	}
-	
-	public static void addObserver(PlayerObserver observer) {
+    }
+      
+
+
+    @Override
+    public String getToolTipText() {
+        return tr("Shows current position in the video");
+    }
+
+    // no merging necessary
+    @Override
+    public boolean isMergable(Layer arg0) {
+        return false;
+    }
+
+    @Override
+    public void mergeFrom(Layer arg0) {
+        
+    }
+
+    
+    
+    @Override
+    //Draw the current position, infos, waypoints
+    public void paint(Graphics2D g, MapView map, Bounds bound) {
+        Point p;
+        //TODO Source out redundant calculations
+        //TODO make icon transparent
+        //draw all GPS points
+        g.setColor(Color.YELLOW); //new Color(0,255,0,128)
+        for(WayPoint n: ls) {
+            p = Main.map.mapView.getPoint(n.getEastNorth());
+            g.drawOval(p.x - 2, p.y - 2, 4, 4);
+        }
+        //draw synced points
+        g.setColor(Color.GREEN);
+        for(WayPoint n: ls) {
+            if(n.attr.containsKey("synced"))
+            {
+                p = Main.map.mapView.getPoint(n.getEastNorth());
+                g.drawOval(p.x - 2, p.y - 2, 4, 4);
+            }
+        }
+        //draw current segment points
+        g.setColor(Color.YELLOW);
+        if(player.getPrev()!=null)
+        {
+            p = Main.map.mapView.getPoint(player.getPrev().getEastNorth());
+            g.drawOval(p.x - 2, p.y - 2, 4, 4);
+            Point p2 = Main.map.mapView.getPoint(player.getCurr().getEastNorth());
+            g.drawLine(p.x, p.y, p2.x, p2.y);
+        }
+        if(player.getNext()!=null)
+        {
+            p = Main.map.mapView.getPoint(player.getNext().getEastNorth());
+            g.drawOval(p.x - 2, p.y - 2, 4, 4);
+            Point p2 = Main.map.mapView.getPoint(player.getCurr().getEastNorth());
+            g.drawLine(p.x, p.y, p2.x, p2.y);
+        }
+        //draw interpolated points
+        g.setColor(Color.CYAN);
+        g.setBackground(Color.CYAN);
+        LinkedList<WayPoint> ipo=(LinkedList<WayPoint>) player.getInterpolatedLine(5);
+        for (WayPoint wp : ipo) {
+            p=Main.map.mapView.getPoint(wp.getEastNorth());
+            g.fillArc(p.x, p.y, 4, 4, 0, 360);
+            //g.drawOval(p.x - 2, p.y - 2, 4, 4);
+        }
+        //draw cam icon
+        g.setColor(Color.RED);
+        if(dragIcon)
+        {
+            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(mins.format(iconPosition.getTime()),p.x-10,p.y-10); //TODO when synced we might wan't to use a different layout
+                g.drawString(gpsTimeCode.format(iconPosition.getTime()),p.x-10,p.y-10);
+            }
+        }
+        else
+        {
+            if (player.getCurr()!=null){
+            p=Main.map.mapView.getPoint(player.getCurr().getEastNorth());
+            icon.paintIcon(null, g, p.x-icon.getIconWidth()/2, p.y-icon.getIconHeight()/2);         
+            g.drawString(gpsTimeCode.format(player.getCurr().getTime()),p.x-10,p.y-10);
+            }
+        }
+    }
+    
+    //finds the first waypoint that is nearby the given point
+    private WayPoint getNearestWayPoint(Point mouse)
+    {
+        final int MAX=10;
+        Point p;
+        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? Hashmaps? Divide and Conquer?
+        {
+            p = Main.map.mapView.getPoint(n.getEastNorth());
+            if (rect.contains(p))
+            {               
+                return n;
+            }
+            
+        }
+        return null;
+        
+    }
+    
+    //upper left corner like rectangle
+    private Rectangle getIconRect()
+    {
+        Point p = Main.map.mapView.getPoint(player.getCurr().getEastNorth());
+        return new Rectangle(p.x-icon.getIconWidth()/2,p.y-icon.getIconHeight()/2,icon.getIconWidth(),icon.getIconHeight());
+    }
+
+
+    @Override
+    public void visitBoundingBox(BoundingXYVisitor arg0) {
+        // TODO don't know what to do here
+
+    }
+
+    public void mouseClicked(MouseEvent e) {        
+    }
+
+    public void mouseEntered(MouseEvent arg0) { 
+    }
+
+    public void mouseExited(MouseEvent arg0) {
+    }
+
+    //init drag&drop
+    public void mousePressed(MouseEvent e) {
+        if(e.getButton() == MouseEvent.BUTTON1) {
+            //is it on the cam icon?
+            if (player.getCurr()!=null)
+            {
+                if (getIconRect().contains(e.getPoint()))
+                {
+                    mouse=e.getPoint();
+                    dragIcon=true;
+                }
+            }
+        }
+        
+    }
+    
+    //
+    public void mouseReleased(MouseEvent e) {       
+        //only leftclicks on our layer
+        if(e.getButton() == MouseEvent.BUTTON1) {
+            if(dragIcon)
+            {
+                dragIcon=false;
+            }
+            else
+            {
+                //simple click
+                WayPoint wp = getNearestWayPoint(e.getPoint());
+                if(wp!=null)
+                {
+                    player.jump(wp);
+                    //jump if we know position
+                    if(wp.attr.containsKey("synced"))
+                    {                       
+                        if(gps!=null) notifyObservers(player.getRelativeTime()); //call videoplayers to set right position
+                    }
+                }
+            }
+            Main.map.mapView.repaint();
+        }
+        
+    }
+    
+    //slide and restrict during movement
+    public void mouseDragged(MouseEvent e) {        
+        if(dragIcon)
+        {           
+            mouse=e.getPoint();
+            //restrict to GPS track
+            iconPosition=player.getInterpolatedWaypoint(mouse);
+
+            Main.map.mapView.repaint();
+        }
+    }
+
+    //visualize drag&drop
+    public void mouseMoved(MouseEvent e) {      
+        if (player.getCurr()!=null)
+        {                       
+            if (getIconRect().contains(e.getPoint()))
+            {
+                Main.map.mapView.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
+            }
+            else
+            {
+                Main.map.mapView.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
+            }
+        }
+        
+    }
+
+    public void setGPSPlayer(GPSVideoPlayer player) {
+        this.gps = player;
+        
+    }
+    
+    public static void addObserver(PlayerObserver observer) {
 
         observers.add(observer);
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 23173)
+++ applications/editors/josm/plugins/videomapping/src/org/openstreetmap/josm/plugins/videomapping/VideoMappingPlugin.java	(revision 23193)
@@ -49,310 +49,310 @@
 //Here we manage properties and start the other classes
 public class VideoMappingPlugin extends Plugin implements LayerChangeListener{
-	  private JMenu VMenu,VDeinterlacer;
-	  private GpxData GPSTrack;
-	  private List<WayPoint> ls;
-	  private JosmAction VAdd,VRemove,VStart,Vbackward,Vforward,VJump,Vfaster,Vslower,Vloop;
-	  private JRadioButtonMenuItem VIntBob,VIntNone,VIntLinear;
-	  private JCheckBoxMenuItem VCenterIcon,VSubTitles;
-	  private JMenuItem VJumpLength,VLoopLength;
-	  private GPSVideoPlayer player;
-	  private PositionLayer layer;
-	  private final String VM_DEINTERLACER="videomapping.deinterlacer"; //where we store settings
-	  private final String VM_MRU="videomapping.mru";
-	  private final String VM_AUTOCENTER="videomapping.autocenter";
-	  private final String VM_JUMPLENGTH="videomapping.jumplength";
-	  private final String VM_LOOPLENGTH="videomapping.looplength";
-	  private boolean autocenter;
-	  private String deinterlacer;
-	  private Integer jumplength,looplength;
-	  private String mru;
-	  //TODO What more to store during sessions? Size/Position
-	  
-
-	public VideoMappingPlugin(PluginInformation info) {
-		super(info);
-		MapView.addLayerChangeListener(this);
-		//Register for GPS menu
-		VMenu = Main.main.menu.addMenu(" Video", KeyEvent.VK_V, Main.main.menu.defaultMenuPos,ht("/Plugin/Videomapping"));//TODO no more ugly " video" hack
-		addMenuItems();
-		enableControlMenus(true);
-		loadSettings();
-		applySettings();
-		//further plugin informations are provided by build.xml properties
-	}
-			
-	//only use with GPS and own layers
-	public void activeLayerChange(Layer oldLayer, Layer newLayer) {
-		System.out.println(newLayer);
-		if (newLayer instanceof GpxLayer)
-		{
-			VAdd.setEnabled(true);
-			GPSTrack=((GpxLayer) newLayer).data;			
-			//TODO append to GPS Layer menu
-		}
-		else
-		{/*
-			VAdd.setEnabled(false);
-			if(newLayer instanceof PositionLayer)
-			{
-				enableControlMenus(true);
-			}
-			else
-			{
-				enableControlMenus(false);
-			}*/
-		}
-		
-	}
-
-	public void layerAdded(Layer arg0) {
-		activeLayerChange(null,arg0);
-	}
-
-	public void layerRemoved(Layer arg0) {	
-	} //well ok we have a local copy of the GPS track....
-
-	//register main controls
-	private void addMenuItems() {
-		VAdd= new JosmAction(tr("Import Video"),"videomapping",tr("Sync a video against this GPS track"),null,false) {
-			private static final long serialVersionUID = 1L;
-
-			public void actionPerformed(ActionEvent arg0) {					
-					JFileChooser fc = new JFileChooser("C:\\TEMP\\");
-					//fc.setSelectedFile(new File(mru));
-					if(fc.showOpenDialog(Main.main.parent)!=JFileChooser.CANCEL_OPTION)
-					{
-						saveSettings();
-						ls=copyGPSLayer(GPSTrack);
-						enableControlMenus(true);
-						layer = new PositionLayer(fc.getSelectedFile().getName(),ls);
-						Main.main.addLayer(layer);
-						player = new GPSVideoPlayer(fc.getSelectedFile(), layer.player);
-						//TODO Check here if we can sync allready now
-						layer.setGPSPlayer(player);
-						layer.addObserver(player);
-						VAdd.setEnabled(false);
-						VRemove.setEnabled(true);
-						player.setSubtitleAction(VSubTitles);
-					}
-				}
-		
-		};
-		VRemove= new JosmAction(tr("Remove Video"),"videomapping",tr("removes current video from layer"),null,false) {
-			private static final long serialVersionUID = 1L;
-
-			public void actionPerformed(ActionEvent arg0) {
-				player.removeVideo();
-			}
-		};
-		
-		VStart = new JosmAction(tr("Play/Pause"), "audio-playpause", tr("starts/pauses video playback"),
-				Shortcut.registerShortcut("videomapping:startstop","",KeyEvent.VK_NUMPAD5, Shortcut.GROUP_DIRECT), false) {
-			
-			public void actionPerformed(ActionEvent e) {								
-				if(player.playing()) player.pause(); else player.play();
-			}
-		};
-		Vbackward = new JosmAction(tr("Backward"), "audio-prev", tr("jumps n sec back"),
-				Shortcut.registerShortcut("videomapping:backward","",KeyEvent.VK_NUMPAD4, Shortcut.GROUP_DIRECT), false) {
-			public void actionPerformed(ActionEvent e) {
-				player.backward();
-							
-			}
-		};
-		Vbackward = new JosmAction(tr("Jump To"), null, tr("jumps to the entered gps time"),null, false) {			
-			public void actionPerformed(ActionEvent e) {
-				String s =JOptionPane.showInputDialog(tr("please enter GPS timecode"),"10:07:57");
-				SimpleDateFormat format= new SimpleDateFormat("hh:mm:ss");
-				Date t;
-				try {
-					t = format.parse(s);
-					if (t!=null)
-						{							
-							player.jumpToGPSTime(t.getTime());
-						}						
-				} catch (ParseException e1) {
-					// TODO Auto-generated catch block
-					e1.printStackTrace();
-				}
-							
-			}
-		};
-		Vforward= new JosmAction(tr("Forward"), "audio-next", tr("jumps n sec forward"),
-				Shortcut.registerShortcut("videomapping:forward","",KeyEvent.VK_NUMPAD6, Shortcut.GROUP_DIRECT), false) {
-			
-			public void actionPerformed(ActionEvent e) {
-				player.forward();
-							
-			}
-		};
-		Vfaster= new JosmAction(tr("Faster"), "audio-faster", tr("faster playback"),
-				Shortcut.registerShortcut("videomapping:faster","",KeyEvent.VK_NUMPAD8, Shortcut.GROUP_DIRECT), false) {
-			
-			public void actionPerformed(ActionEvent e) {
-				player.faster();
-							
-			}
-		};
-		Vslower= new JosmAction(tr("Slower"), "audio-slower", tr("slower playback"),
-				Shortcut.registerShortcut("videomapping:slower","",KeyEvent.VK_NUMPAD2, Shortcut.GROUP_DIRECT), false) {
-			
-			public void actionPerformed(ActionEvent e) {
-				player.slower();
-							
-			}
-		};
-		Vloop= new JosmAction(tr("Loop"), null, tr("loops n sec around current position"),
-				Shortcut.registerShortcut("videomapping:loop","",KeyEvent.VK_NUMPAD7, Shortcut.GROUP_DIRECT), false) {
-			
-			public void actionPerformed(ActionEvent e) {
-				player.loop();
-							
-			}
-		};
-		
-		//now the options menu
-		VCenterIcon = new JCheckBoxMenuItem(new JosmAction(tr("Keep centered"), null, tr("follows the video icon automaticly"),null, false) {
-			
-			public void actionPerformed(ActionEvent e) {
-				autocenter=VCenterIcon.isSelected();
-				player.setAutoCenter(autocenter);
-				applySettings();
-				saveSettings();
-							
-			}
-		});
-		//now the options menu
-		VSubTitles = new JCheckBoxMenuItem(new JosmAction(tr("Subtitles"), null, tr("Show subtitles in video"),null, false) {
-			
-			public void actionPerformed(ActionEvent e) {
-				player.toggleSubtitles();
-							
-			}
-		});
-		
-		VJumpLength = new JMenuItem(new JosmAction(tr("Jump length"), null, tr("Set the length of a jump"),null, false) {
-			
-			public void actionPerformed(ActionEvent e) {
-				Object[] possibilities = {"200", "500", "1000", "2000", "10000"};
-				String s = (String)JOptionPane.showInputDialog(Main.parent,tr("Jump in video for x ms"),tr("Jump length"),JOptionPane.QUESTION_MESSAGE,null,possibilities,jumplength);
-				jumplength=Integer.getInteger(s);
-				applySettings();
-				saveSettings();			
-			}
-		});
-		
-		VLoopLength = new JMenuItem(new JosmAction(tr("Loop length"), null, tr("Set the length around a looppoint"),null, false) {
-			
-			public void actionPerformed(ActionEvent e) {
-				Object[] possibilities = {"500", "1000", "3000", "5000", "10000"};
-				String s = (String)JOptionPane.showInputDialog(Main.parent,tr("Jump in video for x ms"),tr("Loop length"),JOptionPane.QUESTION_MESSAGE,null,possibilities,looplength);
-				looplength=Integer.getInteger(s);
-				applySettings();
-				saveSettings();
-							
-			}
-		});
-		
-		VDeinterlacer= new JMenu("Deinterlacer");
-		VIntNone= new JRadioButtonMenuItem(new JosmAction(tr("none"), null, tr("no deinterlacing"),null, false) {
-			
-			public void actionPerformed(ActionEvent e) {
-				deinterlacer=null;
-				applySettings();
-				saveSettings();
-			}
-		});
-		VIntBob= new JRadioButtonMenuItem(new JosmAction("bob", null, tr("deinterlacing using line doubling"),null, false) {
-			
-			public void actionPerformed(ActionEvent e) {
-				deinterlacer="bob";
-				applySettings();
-				saveSettings();
-			}
-		});
-		VIntLinear= new JRadioButtonMenuItem(new JosmAction("linear", null, tr("deinterlacing using linear interpolation"),null, false) {
-			
-			public void actionPerformed(ActionEvent e) {
-				deinterlacer="linear";
-				applySettings();
-				saveSettings();
-			}
-		});
-		VDeinterlacer.add(VIntNone);
-		VDeinterlacer.add(VIntBob);
-		VDeinterlacer.add(VIntLinear);
-		
-		VMenu.add(VAdd);		
-		VMenu.add(VStart);
-		VMenu.add(Vbackward);
-		VMenu.add(Vforward);
-		VMenu.add(Vfaster);
-		VMenu.add(Vslower);
-		VMenu.add(Vloop);
-		VMenu.addSeparator();
-		VMenu.add(VCenterIcon);
-		VMenu.add(VJumpLength);
-		VMenu.add(VLoopLength);
-		VMenu.add(VDeinterlacer);
-		VMenu.add(VSubTitles);
-		
-	}
-	
-	
-	
-	//we can only work on our own layer
-	private void enableControlMenus(boolean enabled)
-	{
-		VStart.setEnabled(enabled);
-		Vbackward.setEnabled(enabled);
-		Vforward.setEnabled(enabled);
-		Vloop.setEnabled(enabled);
-	}
-	
-	//load all properties or set defaults
-	private void loadSettings() {
-		String temp;		
-		temp=Main.pref.get(VM_AUTOCENTER);
-		if((temp!=null)&&(temp.length()!=0))autocenter=Boolean.getBoolean(temp); else autocenter=false;
-		temp=Main.pref.get(VM_DEINTERLACER);
-		if((temp!=null)&&(temp.length()!=0)) deinterlacer=Main.pref.get(temp);
-		temp=Main.pref.get(VM_JUMPLENGTH);
-		if((temp!=null)&&(temp.length()!=0)) jumplength=Integer.valueOf(temp); else jumplength=1000; 
-		temp=Main.pref.get(VM_LOOPLENGTH);
-		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");
-	}
-	
-	private void applySettings(){
-		//Internals
-		if(player!=null)
-		{
-			player.setAutoCenter(autocenter);
-			player.setDeinterlacer(deinterlacer);
-			player.setJumpLength(jumplength);
-			player.setLoopLength(looplength);
-		}
-		//GUI
-		VCenterIcon.setSelected(autocenter);
-		VIntNone.setSelected(true);
-		if(deinterlacer=="bob")VIntBob.setSelected(true);
-		if(deinterlacer=="linear")VIntLinear.setSelected(true);
-		
-	}
-	
-	private void saveSettings(){
-		Main.pref.put(VM_AUTOCENTER, autocenter);
-		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);
-	}
-	
-	//make a flat copy
-	private List<WayPoint> copyGPSLayer(GpxData route)
-	{ 
-		ls = new LinkedList<WayPoint>();
+      private JMenu VMenu,VDeinterlacer;
+      private GpxData GPSTrack;
+      private List<WayPoint> ls;
+      private JosmAction VAdd,VRemove,VStart,Vbackward,Vforward,VJump,Vfaster,Vslower,Vloop;
+      private JRadioButtonMenuItem VIntBob,VIntNone,VIntLinear;
+      private JCheckBoxMenuItem VCenterIcon,VSubTitles;
+      private JMenuItem VJumpLength,VLoopLength;
+      private GPSVideoPlayer player;
+      private PositionLayer layer;
+      private final String VM_DEINTERLACER="videomapping.deinterlacer"; //where we store settings
+      private final String VM_MRU="videomapping.mru";
+      private final String VM_AUTOCENTER="videomapping.autocenter";
+      private final String VM_JUMPLENGTH="videomapping.jumplength";
+      private final String VM_LOOPLENGTH="videomapping.looplength";
+      private boolean autocenter;
+      private String deinterlacer;
+      private Integer jumplength,looplength;
+      private String mru;
+      //TODO What more to store during sessions? Size/Position
+      
+
+    public VideoMappingPlugin(PluginInformation info) {
+        super(info);
+        MapView.addLayerChangeListener(this);
+        //Register for GPS menu
+        VMenu = Main.main.menu.addMenu(" Video", KeyEvent.VK_V, Main.main.menu.defaultMenuPos,ht("/Plugin/Videomapping"));//TODO no more ugly " video" hack
+        addMenuItems();
+        enableControlMenus(true);
+        loadSettings();
+        applySettings();
+        //further plugin informations are provided by build.xml properties
+    }
+            
+    //only use with GPS and own layers
+    public void activeLayerChange(Layer oldLayer, Layer newLayer) {
+        System.out.println(newLayer);
+        if (newLayer instanceof GpxLayer)
+        {
+            VAdd.setEnabled(true);
+            GPSTrack=((GpxLayer) newLayer).data;            
+            //TODO append to GPS Layer menu
+        }
+        else
+        {/*
+            VAdd.setEnabled(false);
+            if(newLayer instanceof PositionLayer)
+            {
+                enableControlMenus(true);
+            }
+            else
+            {
+                enableControlMenus(false);
+            }*/
+        }
+        
+    }
+
+    public void layerAdded(Layer arg0) {
+        activeLayerChange(null,arg0);
+    }
+
+    public void layerRemoved(Layer arg0) {  
+    } //well ok we have a local copy of the GPS track....
+
+    //register main controls
+    private void addMenuItems() {
+        VAdd= new JosmAction(tr("Import Video"),"videomapping",tr("Sync a video against this GPS track"),null,false) {
+            private static final long serialVersionUID = 1L;
+
+            public void actionPerformed(ActionEvent arg0) {                 
+                    JFileChooser fc = new JFileChooser("C:\\TEMP\\");
+                    //fc.setSelectedFile(new File(mru));
+                    if(fc.showOpenDialog(Main.main.parent)!=JFileChooser.CANCEL_OPTION)
+                    {
+                        saveSettings();
+                        ls=copyGPSLayer(GPSTrack);
+                        enableControlMenus(true);
+                        layer = new PositionLayer(fc.getSelectedFile().getName(),ls);
+                        Main.main.addLayer(layer);
+                        player = new GPSVideoPlayer(fc.getSelectedFile(), layer.player);
+                        //TODO Check here if we can sync allready now
+                        layer.setGPSPlayer(player);
+                        layer.addObserver(player);
+                        VAdd.setEnabled(false);
+                        VRemove.setEnabled(true);
+                        player.setSubtitleAction(VSubTitles);
+                    }
+                }
+        
+        };
+        VRemove= new JosmAction(tr("Remove Video"),"videomapping",tr("removes current video from layer"),null,false) {
+            private static final long serialVersionUID = 1L;
+
+            public void actionPerformed(ActionEvent arg0) {
+                player.removeVideo();
+            }
+        };
+        
+        VStart = new JosmAction(tr("Play/Pause"), "audio-playpause", tr("starts/pauses video playback"),
+                Shortcut.registerShortcut("videomapping:startstop","",KeyEvent.VK_NUMPAD5, Shortcut.GROUP_DIRECT), false) {
+            
+            public void actionPerformed(ActionEvent e) {                                
+                if(player.playing()) player.pause(); else player.play();
+            }
+        };
+        Vbackward = new JosmAction(tr("Backward"), "audio-prev", tr("jumps n sec back"),
+                Shortcut.registerShortcut("videomapping:backward","",KeyEvent.VK_NUMPAD4, Shortcut.GROUP_DIRECT), false) {
+            public void actionPerformed(ActionEvent e) {
+                player.backward();
+                            
+            }
+        };
+        Vbackward = new JosmAction(tr("Jump To"), null, tr("jumps to the entered gps time"),null, false) {          
+            public void actionPerformed(ActionEvent e) {
+                String s =JOptionPane.showInputDialog(tr("please enter GPS timecode"),"10:07:57");
+                SimpleDateFormat format= new SimpleDateFormat("hh:mm:ss");
+                Date t;
+                try {
+                    t = format.parse(s);
+                    if (t!=null)
+                        {                           
+                            player.jumpToGPSTime(t.getTime());
+                        }                       
+                } catch (ParseException e1) {
+                    // TODO Auto-generated catch block
+                    e1.printStackTrace();
+                }
+                            
+            }
+        };
+        Vforward= new JosmAction(tr("Forward"), "audio-next", tr("jumps n sec forward"),
+                Shortcut.registerShortcut("videomapping:forward","",KeyEvent.VK_NUMPAD6, Shortcut.GROUP_DIRECT), false) {
+            
+            public void actionPerformed(ActionEvent e) {
+                player.forward();
+                            
+            }
+        };
+        Vfaster= new JosmAction(tr("Faster"), "audio-faster", tr("faster playback"),
+                Shortcut.registerShortcut("videomapping:faster","",KeyEvent.VK_NUMPAD8, Shortcut.GROUP_DIRECT), false) {
+            
+            public void actionPerformed(ActionEvent e) {
+                player.faster();
+                            
+            }
+        };
+        Vslower= new JosmAction(tr("Slower"), "audio-slower", tr("slower playback"),
+                Shortcut.registerShortcut("videomapping:slower","",KeyEvent.VK_NUMPAD2, Shortcut.GROUP_DIRECT), false) {
+            
+            public void actionPerformed(ActionEvent e) {
+                player.slower();
+                            
+            }
+        };
+        Vloop= new JosmAction(tr("Loop"), null, tr("loops n sec around current position"),
+                Shortcut.registerShortcut("videomapping:loop","",KeyEvent.VK_NUMPAD7, Shortcut.GROUP_DIRECT), false) {
+            
+            public void actionPerformed(ActionEvent e) {
+                player.loop();
+                            
+            }
+        };
+        
+        //now the options menu
+        VCenterIcon = new JCheckBoxMenuItem(new JosmAction(tr("Keep centered"), null, tr("follows the video icon automaticly"),null, false) {
+            
+            public void actionPerformed(ActionEvent e) {
+                autocenter=VCenterIcon.isSelected();
+                player.setAutoCenter(autocenter);
+                applySettings();
+                saveSettings();
+                            
+            }
+        });
+        //now the options menu
+        VSubTitles = new JCheckBoxMenuItem(new JosmAction(tr("Subtitles"), null, tr("Show subtitles in video"),null, false) {
+            
+            public void actionPerformed(ActionEvent e) {
+                player.toggleSubtitles();
+                            
+            }
+        });
+        
+        VJumpLength = new JMenuItem(new JosmAction(tr("Jump length"), null, tr("Set the length of a jump"),null, false) {
+            
+            public void actionPerformed(ActionEvent e) {
+                Object[] possibilities = {"200", "500", "1000", "2000", "10000"};
+                String s = (String)JOptionPane.showInputDialog(Main.parent,tr("Jump in video for x ms"),tr("Jump length"),JOptionPane.QUESTION_MESSAGE,null,possibilities,jumplength);
+                jumplength=Integer.getInteger(s);
+                applySettings();
+                saveSettings();         
+            }
+        });
+        
+        VLoopLength = new JMenuItem(new JosmAction(tr("Loop length"), null, tr("Set the length around a looppoint"),null, false) {
+            
+            public void actionPerformed(ActionEvent e) {
+                Object[] possibilities = {"500", "1000", "3000", "5000", "10000"};
+                String s = (String)JOptionPane.showInputDialog(Main.parent,tr("Jump in video for x ms"),tr("Loop length"),JOptionPane.QUESTION_MESSAGE,null,possibilities,looplength);
+                looplength=Integer.getInteger(s);
+                applySettings();
+                saveSettings();
+                            
+            }
+        });
+        
+        VDeinterlacer= new JMenu("Deinterlacer");
+        VIntNone= new JRadioButtonMenuItem(new JosmAction(tr("none"), null, tr("no deinterlacing"),null, false) {
+            
+            public void actionPerformed(ActionEvent e) {
+                deinterlacer=null;
+                applySettings();
+                saveSettings();
+            }
+        });
+        VIntBob= new JRadioButtonMenuItem(new JosmAction("bob", null, tr("deinterlacing using line doubling"),null, false) {
+            
+            public void actionPerformed(ActionEvent e) {
+                deinterlacer="bob";
+                applySettings();
+                saveSettings();
+            }
+        });
+        VIntLinear= new JRadioButtonMenuItem(new JosmAction("linear", null, tr("deinterlacing using linear interpolation"),null, false) {
+            
+            public void actionPerformed(ActionEvent e) {
+                deinterlacer="linear";
+                applySettings();
+                saveSettings();
+            }
+        });
+        VDeinterlacer.add(VIntNone);
+        VDeinterlacer.add(VIntBob);
+        VDeinterlacer.add(VIntLinear);
+        
+        VMenu.add(VAdd);        
+        VMenu.add(VStart);
+        VMenu.add(Vbackward);
+        VMenu.add(Vforward);
+        VMenu.add(Vfaster);
+        VMenu.add(Vslower);
+        VMenu.add(Vloop);
+        VMenu.addSeparator();
+        VMenu.add(VCenterIcon);
+        VMenu.add(VJumpLength);
+        VMenu.add(VLoopLength);
+        VMenu.add(VDeinterlacer);
+        VMenu.add(VSubTitles);
+        
+    }
+    
+    
+    
+    //we can only work on our own layer
+    private void enableControlMenus(boolean enabled)
+    {
+        VStart.setEnabled(enabled);
+        Vbackward.setEnabled(enabled);
+        Vforward.setEnabled(enabled);
+        Vloop.setEnabled(enabled);
+    }
+    
+    //load all properties or set defaults
+    private void loadSettings() {
+        String temp;        
+        temp=Main.pref.get(VM_AUTOCENTER);
+        if((temp!=null)&&(temp.length()!=0))autocenter=Boolean.getBoolean(temp); else autocenter=false;
+        temp=Main.pref.get(VM_DEINTERLACER);
+        if((temp!=null)&&(temp.length()!=0)) deinterlacer=Main.pref.get(temp);
+        temp=Main.pref.get(VM_JUMPLENGTH);
+        if((temp!=null)&&(temp.length()!=0)) jumplength=Integer.valueOf(temp); else jumplength=1000; 
+        temp=Main.pref.get(VM_LOOPLENGTH);
+        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");
+    }
+    
+    private void applySettings(){
+        //Internals
+        if(player!=null)
+        {
+            player.setAutoCenter(autocenter);
+            player.setDeinterlacer(deinterlacer);
+            player.setJumpLength(jumplength);
+            player.setLoopLength(looplength);
+        }
+        //GUI
+        VCenterIcon.setSelected(autocenter);
+        VIntNone.setSelected(true);
+        if(deinterlacer=="bob")VIntBob.setSelected(true);
+        if(deinterlacer=="linear")VIntLinear.setSelected(true);
+        
+    }
+    
+    private void saveSettings(){
+        Main.pref.put(VM_AUTOCENTER, autocenter);
+        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);
+    }
+    
+    //make a flat copy
+    private List<WayPoint> copyGPSLayer(GpxData route)
+    { 
+        ls = new LinkedList<WayPoint>();
         for (GpxTrack trk : route.tracks) {
             for (GpxTrackSegment segment : trk.getSegments()) {
@@ -362,4 +362,4 @@
         Collections.sort(ls); //sort basing upon time
         return ls;
-	}
+    }
   }
Index: applications/editors/josm/plugins/videomapping/src/org/openstreetmap/josm/plugins/videomapping/video/GPSVideoFile.java
===================================================================
--- applications/editors/josm/plugins/videomapping/src/org/openstreetmap/josm/plugins/videomapping/video/GPSVideoFile.java	(revision 23173)
+++ applications/editors/josm/plugins/videomapping/src/org/openstreetmap/josm/plugins/videomapping/video/GPSVideoFile.java	(revision 23193)
@@ -4,10 +4,10 @@
 // a specific synced video
 public class GPSVideoFile extends File{
-	public long offset; //time difference in ms between GPS and Video track
-	
-	public GPSVideoFile(File f, long offset) {
-		super(f.getAbsoluteFile().toString());
-		this.offset=offset;
-	}
+    public long offset; //time difference in ms between GPS and Video track
+    
+    public GPSVideoFile(File f, long offset) {
+        super(f.getAbsoluteFile().toString());
+        this.offset=offset;
+    }
 
 }
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 23173)
+++ applications/editors/josm/plugins/videomapping/src/org/openstreetmap/josm/plugins/videomapping/video/GPSVideoPlayer.java	(revision 23193)
@@ -22,267 +22,267 @@
 //combines video and GPS playback, major control has the video player
 public class GPSVideoPlayer implements PlayerObserver{
-	Timer t;
-	TimerTask updateGPSTrack;
-	private GpsPlayer gps;
-	private SimpleVideoPlayer video;
-	private JButton syncBtn;
-	private GPSVideoFile file;
-	private boolean synced=false; //do we playback the players together?
-	private JCheckBoxMenuItem subtTitleComponent;
-	
-
-	public GPSVideoPlayer(File f, final GpsPlayer pl) {
-		super();
-		this.gps = pl;
-		//test sync
-		video = new SimpleVideoPlayer();
-		/*
-		long gpsT=(9*60+20)*1000;
-		long videoT=10*60*1000+5*1000;
-		setFile(new GPSVideoFile(f, gpsT-videoT)); */
-		setFile(new GPSVideoFile(f, 0L));
-		//add Sync Button to the Player
-		syncBtn= new JButton("sync");
-		syncBtn.setBackground(Color.RED);
-		syncBtn.addActionListener(new ActionListener() {
-			//do a sync
-			public void actionPerformed(ActionEvent e) {
-				long diff=gps.getRelativeTime()-video.getTime();
-				file= new GPSVideoFile(file, diff);
-				syncBtn.setBackground(Color.GREEN);
-				synced=true;
-				markSyncedPoints();
-				video.play();
-				//gps.play();
-			}
-		});
-		setAsyncMode(true);
-		video.addComponent(syncBtn);
-		//a observer to communicate
-		SimpleVideoPlayer.addObserver(new PlayerObserver() { //TODO has o become this
-
-			public void playing(long time) {
-				//sync the GPS back
-				if(synced) gps.jump(getGPSTime(time));
-				
-			}
-
-			public void jumping(long time) {
-			
-			}
-
-			//a push way to set video attirbutes
-			public void metadata(long time, boolean subtitles) {
-				if(subtTitleComponent!=null) subtTitleComponent.setSelected(subtitles);				
-			}
-			
-		});
-		t = new Timer();		
-	}
-	
-	//marks all points that are covered by video AND GPS track
-	private void markSyncedPoints() {
-		//GPS or video stream starts first in time?
-		WayPoint start,end;
-		long t;
-		if(gps.getLength()<video.getLength())
-		{
-			//GPS is within video timeperiod
-			start=gps.getWaypoint(0);
-			end=gps.getWaypoint(gps.getLength());			
-		}
-		else
-		{
-			//video is within gps timeperiod
-			t=getGPSTime(0);
-			if(t<0) t=0;
-			start=gps.getWaypoint(t);
-			end=gps.getWaypoint(getGPSTime(video.getLength()));
-		}
-		//mark as synced
-		List<WayPoint> ls = gps.getTrack().subList(gps.getTrack().indexOf(start), gps.getTrack().indexOf(end));
-		
-		for (WayPoint wp : ls) {
-			wp.attr.put("synced", "true");
-		}	
-	}
-
-	public void setAsyncMode(boolean b)
-	{
-		if(b)
-		{
-			syncBtn.setVisible(true);
-		}
-		else
-		{
-			syncBtn.setVisible(false);
-		}
-	}
-	
-		
-	public void setFile(GPSVideoFile f)
-	{
-		
-		file=f;
-		video.setFile(f.getAbsoluteFile());
-		//video.play();
-	}
-	
-	public void play(long gpsstart)
-	{
-		//video is already playing
-		jumpToGPSTime(gpsstart);
-		gps.jump(gpsstart);
-		//gps.play();
-	}
-	
-	public void play()
-	{
-		video.play();
-	}
-	
-	public void pause()
-	{
-		video.pause();
-	}
-	
-	//jumps in video to the corresponding linked time
-	public void jumpToGPSTime(Time GPSTime)
-	{
-		gps.jump(GPSTime);
-	}
-	
-	//jumps in video to the corresponding linked time
-	public void jumpToGPSTime(long gpsT)
-	{
-		if(!synced)
-		{
-			//when not synced we can just move the icon to the right position			
-			gps.jump(new Date(gpsT));
-			Main.map.mapView.repaint();
-		}
-		video.jump(getVideoTime(gpsT));
-	}
-	
-	//calc synced timecode from video
-	private long getVideoTime(long GPStime)
-	{
-		return GPStime-file.offset;
-	}
-	
-	//calc corresponding GPS time
-	private long getGPSTime(long videoTime)
-	{
-		return videoTime+file.offset;
-	}
-
-	
-
-	public void setJumpLength(Integer integer) {
-		video.setJumpLength(integer);
-		
-	}
-
-	public void setLoopLength(Integer integer) {
-		video.setLoopLength(integer);
-		
-	}
-	
-	public boolean isSynced()
-	{
-		return isSynced();
-	}
-
-	public void loop() {
-		video.loop();
-		
-	}
-
-	public void forward() {
-		video.forward();
-		
-	}
-
-	public void backward() {
-		video.backward();
-		
-	}
-
-	public void removeVideo() {
-		video.removeVideo();
-		
-	}
-
-	public File getVideo() {
-		return file;
-	}
-
-	public float getCoverage() {
-		return gps.getLength()/video.getLength();
-	}
-
-	public void setDeinterlacer(String string) {
-		video.setDeinterlacer(string);
-		
-	}
-
-	public void setAutoCenter(boolean selected) {
-		gps.setAutoCenter(selected);
-		
-	}
-
-	
-	//not called by GPS
-	public boolean playing() {
-		return video.playing();
-	}
-
-	//when we clicked on the layer, here we update the video position
-	public void jumping(long time) {
-		if(synced) jumpToGPSTime(gps.getRelativeTime());
-		
-	}
-
-	public String getNativePlayerInfos() {
-		return video.getNativePlayerInfos();
-	}
-
-	public void faster() {
-		video.faster();
-		
-	}
-
-	public void slower() {
-		video.slower();
-		
-	}
-
-	public void playing(long time) {
-		// TODO Auto-generated method stub
-		
-	}
-
-	public void toggleSubtitles() {
-		video.toggleSubs();
-		
-	}
-	
-	public boolean hasSubtitles(){
-		return video.hasSubtitles();
-	}
-
-	public void setSubtitleAction(JCheckBoxMenuItem a)
-	{
-		subtTitleComponent=a;
-	}
-
-	public void metadata(long time, boolean subtitles) {
-		// TODO Auto-generated method stub
-		
-	}
-
-	
-	
-
-	
+    Timer t;
+    TimerTask updateGPSTrack;
+    private GpsPlayer gps;
+    private SimpleVideoPlayer video;
+    private JButton syncBtn;
+    private GPSVideoFile file;
+    private boolean synced=false; //do we playback the players together?
+    private JCheckBoxMenuItem subtTitleComponent;
+    
+
+    public GPSVideoPlayer(File f, final GpsPlayer pl) {
+        super();
+        this.gps = pl;
+        //test sync
+        video = new SimpleVideoPlayer();
+        /*
+        long gpsT=(9*60+20)*1000;
+        long videoT=10*60*1000+5*1000;
+        setFile(new GPSVideoFile(f, gpsT-videoT)); */
+        setFile(new GPSVideoFile(f, 0L));
+        //add Sync Button to the Player
+        syncBtn= new JButton("sync");
+        syncBtn.setBackground(Color.RED);
+        syncBtn.addActionListener(new ActionListener() {
+            //do a sync
+            public void actionPerformed(ActionEvent e) {
+                long diff=gps.getRelativeTime()-video.getTime();
+                file= new GPSVideoFile(file, diff);
+                syncBtn.setBackground(Color.GREEN);
+                synced=true;
+                markSyncedPoints();
+                video.play();
+                //gps.play();
+            }
+        });
+        setAsyncMode(true);
+        video.addComponent(syncBtn);
+        //a observer to communicate
+        SimpleVideoPlayer.addObserver(new PlayerObserver() { //TODO has o become this
+
+            public void playing(long time) {
+                //sync the GPS back
+                if(synced) gps.jump(getGPSTime(time));
+                
+            }
+
+            public void jumping(long time) {
+            
+            }
+
+            //a push way to set video attirbutes
+            public void metadata(long time, boolean subtitles) {
+                if(subtTitleComponent!=null) subtTitleComponent.setSelected(subtitles);             
+            }
+            
+        });
+        t = new Timer();        
+    }
+    
+    //marks all points that are covered by video AND GPS track
+    private void markSyncedPoints() {
+        //GPS or video stream starts first in time?
+        WayPoint start,end;
+        long t;
+        if(gps.getLength()<video.getLength())
+        {
+            //GPS is within video timeperiod
+            start=gps.getWaypoint(0);
+            end=gps.getWaypoint(gps.getLength());           
+        }
+        else
+        {
+            //video is within gps timeperiod
+            t=getGPSTime(0);
+            if(t<0) t=0;
+            start=gps.getWaypoint(t);
+            end=gps.getWaypoint(getGPSTime(video.getLength()));
+        }
+        //mark as synced
+        List<WayPoint> ls = gps.getTrack().subList(gps.getTrack().indexOf(start), gps.getTrack().indexOf(end));
+        
+        for (WayPoint wp : ls) {
+            wp.attr.put("synced", "true");
+        }   
+    }
+
+    public void setAsyncMode(boolean b)
+    {
+        if(b)
+        {
+            syncBtn.setVisible(true);
+        }
+        else
+        {
+            syncBtn.setVisible(false);
+        }
+    }
+    
+        
+    public void setFile(GPSVideoFile f)
+    {
+        
+        file=f;
+        video.setFile(f.getAbsoluteFile());
+        //video.play();
+    }
+    
+    public void play(long gpsstart)
+    {
+        //video is already playing
+        jumpToGPSTime(gpsstart);
+        gps.jump(gpsstart);
+        //gps.play();
+    }
+    
+    public void play()
+    {
+        video.play();
+    }
+    
+    public void pause()
+    {
+        video.pause();
+    }
+    
+    //jumps in video to the corresponding linked time
+    public void jumpToGPSTime(Time GPSTime)
+    {
+        gps.jump(GPSTime);
+    }
+    
+    //jumps in video to the corresponding linked time
+    public void jumpToGPSTime(long gpsT)
+    {
+        if(!synced)
+        {
+            //when not synced we can just move the icon to the right position           
+            gps.jump(new Date(gpsT));
+            Main.map.mapView.repaint();
+        }
+        video.jump(getVideoTime(gpsT));
+    }
+    
+    //calc synced timecode from video
+    private long getVideoTime(long GPStime)
+    {
+        return GPStime-file.offset;
+    }
+    
+    //calc corresponding GPS time
+    private long getGPSTime(long videoTime)
+    {
+        return videoTime+file.offset;
+    }
+
+    
+
+    public void setJumpLength(Integer integer) {
+        video.setJumpLength(integer);
+        
+    }
+
+    public void setLoopLength(Integer integer) {
+        video.setLoopLength(integer);
+        
+    }
+    
+    public boolean isSynced()
+    {
+        return isSynced();
+    }
+
+    public void loop() {
+        video.loop();
+        
+    }
+
+    public void forward() {
+        video.forward();
+        
+    }
+
+    public void backward() {
+        video.backward();
+        
+    }
+
+    public void removeVideo() {
+        video.removeVideo();
+        
+    }
+
+    public File getVideo() {
+        return file;
+    }
+
+    public float getCoverage() {
+        return gps.getLength()/video.getLength();
+    }
+
+    public void setDeinterlacer(String string) {
+        video.setDeinterlacer(string);
+        
+    }
+
+    public void setAutoCenter(boolean selected) {
+        gps.setAutoCenter(selected);
+        
+    }
+
+    
+    //not called by GPS
+    public boolean playing() {
+        return video.playing();
+    }
+
+    //when we clicked on the layer, here we update the video position
+    public void jumping(long time) {
+        if(synced) jumpToGPSTime(gps.getRelativeTime());
+        
+    }
+
+    public String getNativePlayerInfos() {
+        return video.getNativePlayerInfos();
+    }
+
+    public void faster() {
+        video.faster();
+        
+    }
+
+    public void slower() {
+        video.slower();
+        
+    }
+
+    public void playing(long time) {
+        // TODO Auto-generated method stub
+        
+    }
+
+    public void toggleSubtitles() {
+        video.toggleSubs();
+        
+    }
+    
+    public boolean hasSubtitles(){
+        return video.hasSubtitles();
+    }
+
+    public void setSubtitleAction(JCheckBoxMenuItem a)
+    {
+        subtTitleComponent=a;
+    }
+
+    public void metadata(long time, boolean subtitles) {
+        // TODO Auto-generated method stub
+        
+    }
+
+    
+    
+
+    
 }
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 23173)
+++ applications/editors/josm/plugins/videomapping/src/org/openstreetmap/josm/plugins/videomapping/video/SimpleVideoPlayer.java	(revision 23193)
@@ -49,231 +49,231 @@
 //basic class of a videoplayer for one video
 public class SimpleVideoPlayer extends JFrame implements MediaPlayerEventListener, WindowListener{
-	private EmbeddedMediaPlayer mp;
-	private Timer t;
-	private JPanel screenPanel,controlsPanel;
-	private JSlider timeline;
-	private JButton play,back,forward;
-	private JToggleButton loop,mute;
-	private JSlider speed;
-	private Canvas scr;
-	private final String[] mediaOptions = {""};
-	private boolean syncTimeline=false;
-	private boolean looping=false;
-	private SimpleDateFormat ms;
-	private static final Logger LOG = Logger.getLogger(MediaPlayerFactory.class);
-	private int jumpLength=1000;
-	private int  loopLength=6000;
-	private static Set<PlayerObserver> observers = new HashSet<PlayerObserver>(); //we have to implement our own Observer pattern
-	
-	public SimpleVideoPlayer() {
-		super();
-		/*TODO new EnvironmentCheckerFactory().newEnvironmentChecker().checkEnvironment();
-		 * if(RuntimeUtil.isWindows()) {
-	  			vlcArgs.add("--plugin-path=" + WindowsRuntimeUtil.getVlcInstallDir() + "\\plugins");
-			}
-		 */
-		try
-		{
-			//we don't need any options
-			String[] libvlcArgs = {""};
-			String[] standardMediaOptions = {""}; 
-			
-			//System.out.println("libvlc version: " + LibVlc.INSTANCE.libvlc_get_version());
-			//setup Media Player
-			//TODO we have to deal with unloading things....
-			MediaPlayerFactory mediaPlayerFactory = new MediaPlayerFactory(libvlcArgs);
-		    FullScreenStrategy fullScreenStrategy = new DefaultFullScreenStrategy(this);
-		    mp = mediaPlayerFactory.newMediaPlayer(fullScreenStrategy);
-		    mp.setStandardMediaOptions(standardMediaOptions);
-		    //setup GUI
-		    setSize(400, 300); //later we apply movie size
-		    setAlwaysOnTop(true);
-		    createUI();
-		    setLayout();
-			addListeners(); //registering shortcuts is task of the outer plugin class!
-		    //embed vlc player
-			scr.setVisible(true);
-			setVisible(true);
-			mp.setVideoSurface(scr);
-			mp.addMediaPlayerEventListener(this);
-			//mp.pause();
-			//jump(0);
-			//create updater
-			ScheduledExecutorService executorService = Executors.newSingleThreadScheduledExecutor();
-			executorService.scheduleAtFixedRate(new Syncer(this), 0L, 1000L, TimeUnit.MILLISECONDS);
-		    //setDefaultCloseOperation(EXIT_ON_CLOSE);
-			addWindowListener(this);
-		}
-		catch (NoClassDefFoundError e)
-		{
-			System.err.println(tr("Unable to find JNA Java library!"));
-		}
-		catch (UnsatisfiedLinkError e)
-		{
-			System.err.println(tr("Unable to find native libvlc library!"));
-		}
-		
-	}
-
-	private void createUI() {
-		//setIconImage();
-		ms = new SimpleDateFormat("hh:mm:ss");
-		scr=new Canvas();
-		timeline = new JSlider(0,100,0);
-		timeline.setMajorTickSpacing(10);
-		timeline.setMajorTickSpacing(5);
-		timeline.setPaintTicks(true);
-		//TODO we need Icons instead
-		play= new JButton(tr("play"));
-		back= new JButton("<");
-		forward= new JButton(">");
-		loop= new JToggleButton(tr("loop"));
-		mute= new JToggleButton(tr("mute"));
-		speed = new JSlider(-200,200,0);
-		speed.setMajorTickSpacing(100);
-		speed.setPaintTicks(true);			
-		speed.setOrientation(Adjustable.VERTICAL);
-		Hashtable labelTable = new Hashtable();
-		labelTable.put( new Integer( 0 ), new JLabel("1x") );
-		labelTable.put( new Integer( -200 ), new JLabel("-2x") );
-		labelTable.put( new Integer( 200 ), new JLabel("2x") );
-		speed.setLabelTable( labelTable );
-		speed.setPaintLabels(true);
-	}
-	
-	//creates a layout like the most mediaplayers are...
-	private void setLayout() {
-		this.setLayout(new BorderLayout());
-		screenPanel=new JPanel();
-		screenPanel.setLayout(new BorderLayout());
-		controlsPanel=new JPanel();
-		controlsPanel.setLayout(new FlowLayout());
-		add(screenPanel,BorderLayout.CENTER);
-		add(controlsPanel,BorderLayout.SOUTH);
-		//fill screen panel
-		screenPanel.add(scr,BorderLayout.CENTER);
-		screenPanel.add(timeline,BorderLayout.SOUTH);
-		screenPanel.add(speed,BorderLayout.EAST);
-		controlsPanel.add(play);
-		controlsPanel.add(back);
-		controlsPanel.add(forward);
-		controlsPanel.add(loop);
-		controlsPanel.add(mute);
-		loop.setSelected(false);
-		mute.setSelected(false);
-	}
-
-	//add UI functionality
-	private void addListeners() {
-		timeline.addChangeListener(new ChangeListener() {
-			public void stateChanged(ChangeEvent e) {
-				if(!syncTimeline) //only if user moves the slider by hand
-				{
-					if(!timeline.getValueIsAdjusting()) //and the slider is fixed
-					{
-						//recalc to 0.x percent value
-						mp.setPosition((float)timeline.getValue()/100.0f);
-					}					
-				}
-			}
-		    });
-		
-		play.addActionListener(new ActionListener() {
-			
-			public void actionPerformed(ActionEvent arg0) {
-				if(mp.isPlaying()) mp.pause(); else mp.play();				
-			}
-		});
-		
-		back.addActionListener(new ActionListener() {
-			
-			public void actionPerformed(ActionEvent arg0) {
-				backward();
-			}
-		});
-		
-		forward.addActionListener(new ActionListener() {
-			
-			public void actionPerformed(ActionEvent arg0) {
-				forward();
-			}
-		});
-		
-		loop.addActionListener(new ActionListener() {
-
-			public void actionPerformed(ActionEvent arg0) {
-				loop();
-			}
-		});
-		
-		mute.addActionListener(new ActionListener() {
-
-			public void actionPerformed(ActionEvent arg0) {
-				mute();
-			}
-		});
-		
-		speed.addChangeListener(new ChangeListener() {
-			
-			public void stateChanged(ChangeEvent arg0) {
-				if(!speed.getValueIsAdjusting()&&(mp.isPlaying()))
-				{
-					int perc = speed.getValue();
-					float ratio= (float) (perc/400f*1.75);
-					ratio=ratio+(9/8);
-					mp.setRate(ratio);
-				}
-				
-			}
-		});
-		
-	}	
-
-	public void finished(MediaPlayer arg0) {
-			
-	}
-
-	public void lengthChanged(MediaPlayer arg0, long arg1) {
-
-	}
-
-	public void metaDataAvailable(MediaPlayer arg0, VideoMetaData data) {
-		final float perc = 0.5f;
-		Dimension org=data.getVideoDimension();
-		scr.setSize(new Dimension((int)(org.width*perc), (int)(org.height*perc)));
-		pack();
-		//send out metadatas to all observers
-		for (PlayerObserver o : observers) {
+    private EmbeddedMediaPlayer mp;
+    private Timer t;
+    private JPanel screenPanel,controlsPanel;
+    private JSlider timeline;
+    private JButton play,back,forward;
+    private JToggleButton loop,mute;
+    private JSlider speed;
+    private Canvas scr;
+    private final String[] mediaOptions = {""};
+    private boolean syncTimeline=false;
+    private boolean looping=false;
+    private SimpleDateFormat ms;
+    private static final Logger LOG = Logger.getLogger(MediaPlayerFactory.class);
+    private int jumpLength=1000;
+    private int  loopLength=6000;
+    private static Set<PlayerObserver> observers = new HashSet<PlayerObserver>(); //we have to implement our own Observer pattern
+    
+    public SimpleVideoPlayer() {
+        super();
+        /*TODO new EnvironmentCheckerFactory().newEnvironmentChecker().checkEnvironment();
+         * if(RuntimeUtil.isWindows()) {
+                vlcArgs.add("--plugin-path=" + WindowsRuntimeUtil.getVlcInstallDir() + "\\plugins");
+            }
+         */
+        try
+        {
+            //we don't need any options
+            String[] libvlcArgs = {""};
+            String[] standardMediaOptions = {""}; 
+            
+            //System.out.println("libvlc version: " + LibVlc.INSTANCE.libvlc_get_version());
+            //setup Media Player
+            //TODO we have to deal with unloading things....
+            MediaPlayerFactory mediaPlayerFactory = new MediaPlayerFactory(libvlcArgs);
+            FullScreenStrategy fullScreenStrategy = new DefaultFullScreenStrategy(this);
+            mp = mediaPlayerFactory.newMediaPlayer(fullScreenStrategy);
+            mp.setStandardMediaOptions(standardMediaOptions);
+            //setup GUI
+            setSize(400, 300); //later we apply movie size
+            setAlwaysOnTop(true);
+            createUI();
+            setLayout();
+            addListeners(); //registering shortcuts is task of the outer plugin class!
+            //embed vlc player
+            scr.setVisible(true);
+            setVisible(true);
+            mp.setVideoSurface(scr);
+            mp.addMediaPlayerEventListener(this);
+            //mp.pause();
+            //jump(0);
+            //create updater
+            ScheduledExecutorService executorService = Executors.newSingleThreadScheduledExecutor();
+            executorService.scheduleAtFixedRate(new Syncer(this), 0L, 1000L, TimeUnit.MILLISECONDS);
+            //setDefaultCloseOperation(EXIT_ON_CLOSE);
+            addWindowListener(this);
+        }
+        catch (NoClassDefFoundError e)
+        {
+            System.err.println(tr("Unable to find JNA Java library!"));
+        }
+        catch (UnsatisfiedLinkError e)
+        {
+            System.err.println(tr("Unable to find native libvlc library!"));
+        }
+        
+    }
+
+    private void createUI() {
+        //setIconImage();
+        ms = new SimpleDateFormat("hh:mm:ss");
+        scr=new Canvas();
+        timeline = new JSlider(0,100,0);
+        timeline.setMajorTickSpacing(10);
+        timeline.setMajorTickSpacing(5);
+        timeline.setPaintTicks(true);
+        //TODO we need Icons instead
+        play= new JButton(tr("play"));
+        back= new JButton("<");
+        forward= new JButton(">");
+        loop= new JToggleButton(tr("loop"));
+        mute= new JToggleButton(tr("mute"));
+        speed = new JSlider(-200,200,0);
+        speed.setMajorTickSpacing(100);
+        speed.setPaintTicks(true);          
+        speed.setOrientation(Adjustable.VERTICAL);
+        Hashtable labelTable = new Hashtable();
+        labelTable.put( new Integer( 0 ), new JLabel("1x") );
+        labelTable.put( new Integer( -200 ), new JLabel("-2x") );
+        labelTable.put( new Integer( 200 ), new JLabel("2x") );
+        speed.setLabelTable( labelTable );
+        speed.setPaintLabels(true);
+    }
+    
+    //creates a layout like the most mediaplayers are...
+    private void setLayout() {
+        this.setLayout(new BorderLayout());
+        screenPanel=new JPanel();
+        screenPanel.setLayout(new BorderLayout());
+        controlsPanel=new JPanel();
+        controlsPanel.setLayout(new FlowLayout());
+        add(screenPanel,BorderLayout.CENTER);
+        add(controlsPanel,BorderLayout.SOUTH);
+        //fill screen panel
+        screenPanel.add(scr,BorderLayout.CENTER);
+        screenPanel.add(timeline,BorderLayout.SOUTH);
+        screenPanel.add(speed,BorderLayout.EAST);
+        controlsPanel.add(play);
+        controlsPanel.add(back);
+        controlsPanel.add(forward);
+        controlsPanel.add(loop);
+        controlsPanel.add(mute);
+        loop.setSelected(false);
+        mute.setSelected(false);
+    }
+
+    //add UI functionality
+    private void addListeners() {
+        timeline.addChangeListener(new ChangeListener() {
+            public void stateChanged(ChangeEvent e) {
+                if(!syncTimeline) //only if user moves the slider by hand
+                {
+                    if(!timeline.getValueIsAdjusting()) //and the slider is fixed
+                    {
+                        //recalc to 0.x percent value
+                        mp.setPosition((float)timeline.getValue()/100.0f);
+                    }                   
+                }
+            }
+            });
+        
+        play.addActionListener(new ActionListener() {
+            
+            public void actionPerformed(ActionEvent arg0) {
+                if(mp.isPlaying()) mp.pause(); else mp.play();              
+            }
+        });
+        
+        back.addActionListener(new ActionListener() {
+            
+            public void actionPerformed(ActionEvent arg0) {
+                backward();
+            }
+        });
+        
+        forward.addActionListener(new ActionListener() {
+            
+            public void actionPerformed(ActionEvent arg0) {
+                forward();
+            }
+        });
+        
+        loop.addActionListener(new ActionListener() {
+
+            public void actionPerformed(ActionEvent arg0) {
+                loop();
+            }
+        });
+        
+        mute.addActionListener(new ActionListener() {
+
+            public void actionPerformed(ActionEvent arg0) {
+                mute();
+            }
+        });
+        
+        speed.addChangeListener(new ChangeListener() {
+            
+            public void stateChanged(ChangeEvent arg0) {
+                if(!speed.getValueIsAdjusting()&&(mp.isPlaying()))
+                {
+                    int perc = speed.getValue();
+                    float ratio= (float) (perc/400f*1.75);
+                    ratio=ratio+(9/8);
+                    mp.setRate(ratio);
+                }
+                
+            }
+        });
+        
+    }   
+
+    public void finished(MediaPlayer arg0) {
+            
+    }
+
+    public void lengthChanged(MediaPlayer arg0, long arg1) {
+
+    }
+
+    public void metaDataAvailable(MediaPlayer arg0, VideoMetaData data) {
+        final float perc = 0.5f;
+        Dimension org=data.getVideoDimension();
+        scr.setSize(new Dimension((int)(org.width*perc), (int)(org.height*perc)));
+        pack();
+        //send out metadatas to all observers
+        for (PlayerObserver o : observers) {
             o.metadata(0, hasSubtitles());
         }
-	}
-
-	public void paused(MediaPlayer arg0) {
-
-	}
-
-	public void playing(MediaPlayer arg0) {
-
-	}
-
-	public void positionChanged(MediaPlayer arg0, float arg1) {
-		
-	}
-
-	public void stopped(MediaPlayer arg0) {
-				
-	}
-
-	public void timeChanged(MediaPlayer arg0, long arg1) {
-
-	}
-	
-
-	public void windowActivated(WindowEvent arg0) {	}
-
-	public void windowClosed(WindowEvent arg0) {	}
-
-	//we have to unload and disconnect to the VLC engine
-	public void windowClosing(WindowEvent evt) {
+    }
+
+    public void paused(MediaPlayer arg0) {
+
+    }
+
+    public void playing(MediaPlayer arg0) {
+
+    }
+
+    public void positionChanged(MediaPlayer arg0, float arg1) {
+        
+    }
+
+    public void stopped(MediaPlayer arg0) {
+                
+    }
+
+    public void timeChanged(MediaPlayer arg0, long arg1) {
+
+    }
+    
+
+    public void windowActivated(WindowEvent arg0) { }
+
+    public void windowClosed(WindowEvent arg0) {    }
+
+    //we have to unload and disconnect to the VLC engine
+    public void windowClosing(WindowEvent evt) {
         if(LOG.isDebugEnabled()) {LOG.debug("windowClosing(evt=" + evt + ")");}
         mp.release();
@@ -282,132 +282,132 @@
       }
 
-	public void windowDeactivated(WindowEvent arg0) {	}
-
-	public void windowDeiconified(WindowEvent arg0) {	}
-
-	public void windowIconified(WindowEvent arg0) {	}
-
-	public void windowOpened(WindowEvent arg0) {	}	
-	
-	public void setFile(File f)
-	{
-		String mediaPath = f.getAbsoluteFile().toString();
-		mp.playMedia(mediaPath, mediaOptions);
-		pack();	
-	}
-	
-	public void play()
-	{
-		mp.play();
-	}
-	
-	public void jump(long time)
-	{
-		/*float pos = (float)mp.getLength()/(float)time;
-		mp.setPosition(pos);*/
-		mp.setTime(time);
-	}
-	
-	public long getTime()
-	{
-		return mp.getTime();
-	}
-	
-	public float getPosition()
-	{
-		return mp.getPosition();
-	}
-	
-	public boolean isPlaying()
-	{
-		return mp.isPlaying();
-	}
-	
-	//gets called by the Syncer thread to update all observers
-	public void updateTime ()
-	{
-		if(mp.isPlaying())
-		{
-			setTitle(ms.format(new Date(mp.getTime())));
-			syncTimeline=true;
-			timeline.setValue(Math.round(mp.getPosition()*100));
-			syncTimeline=false;
-			notifyObservers(mp.getTime());
-		}
-	}
-	
-	//allow externals to extend the ui
-	public void addComponent(JComponent c)
-	{
-		controlsPanel.add(c);
-		pack();
-	}
-
-	public long getLength() {		
-		return mp.getLength();
-	}
-
-	public void setDeinterlacer(String string) {
-		mp.setDeinterlace(string);
-		
-	}
-
-	public void setJumpLength(Integer integer) {
-		jumpLength=integer;
-		
-	}
-
-	public void setLoopLength(Integer integer) {
-		loopLength = integer;
-		
-	}
-
-	public void loop() {
-		if(looping)
-		{
-			t.cancel();
-			looping=false;
-		}
-		else			
-		{
-			final long resetpoint=(long) mp.getTime()-loopLength/2;
-			TimerTask ani=new TimerTask() {
-				
-				@Override
-				public void run() {
-					mp.setTime(resetpoint);
-				}
-			};
-			t= new Timer();
-			t.schedule(ani,loopLength/2,loopLength); //first run a half looptime till reset
-			looping=true;
-			}
-		
-	}
-	
-	protected void mute() {
-		mp.mute();
-		
-	}
-
-	public void forward() {
-		mp.setTime((long) (mp.getTime()+jumpLength));
-	}
-
-	public void backward() {
-		mp.setTime((long) (mp.getTime()-jumpLength));
-		
-	}
-
-	public void removeVideo() {
-		if (mp.isPlaying()) mp.stop();
-		mp.release();
-		
-	}
-	
-	public void toggleSubs()
-	{
-		//vlc manages it's subtitles in a own list so we have to cycle trough
-		int spu = mp.getSpu();
+    public void windowDeactivated(WindowEvent arg0) {   }
+
+    public void windowDeiconified(WindowEvent arg0) {   }
+
+    public void windowIconified(WindowEvent arg0) { }
+
+    public void windowOpened(WindowEvent arg0) {    }   
+    
+    public void setFile(File f)
+    {
+        String mediaPath = f.getAbsoluteFile().toString();
+        mp.playMedia(mediaPath, mediaOptions);
+        pack(); 
+    }
+    
+    public void play()
+    {
+        mp.play();
+    }
+    
+    public void jump(long time)
+    {
+        /*float pos = (float)mp.getLength()/(float)time;
+        mp.setPosition(pos);*/
+        mp.setTime(time);
+    }
+    
+    public long getTime()
+    {
+        return mp.getTime();
+    }
+    
+    public float getPosition()
+    {
+        return mp.getPosition();
+    }
+    
+    public boolean isPlaying()
+    {
+        return mp.isPlaying();
+    }
+    
+    //gets called by the Syncer thread to update all observers
+    public void updateTime ()
+    {
+        if(mp.isPlaying())
+        {
+            setTitle(ms.format(new Date(mp.getTime())));
+            syncTimeline=true;
+            timeline.setValue(Math.round(mp.getPosition()*100));
+            syncTimeline=false;
+            notifyObservers(mp.getTime());
+        }
+    }
+    
+    //allow externals to extend the ui
+    public void addComponent(JComponent c)
+    {
+        controlsPanel.add(c);
+        pack();
+    }
+
+    public long getLength() {       
+        return mp.getLength();
+    }
+
+    public void setDeinterlacer(String string) {
+        mp.setDeinterlace(string);
+        
+    }
+
+    public void setJumpLength(Integer integer) {
+        jumpLength=integer;
+        
+    }
+
+    public void setLoopLength(Integer integer) {
+        loopLength = integer;
+        
+    }
+
+    public void loop() {
+        if(looping)
+        {
+            t.cancel();
+            looping=false;
+        }
+        else            
+        {
+            final long resetpoint=(long) mp.getTime()-loopLength/2;
+            TimerTask ani=new TimerTask() {
+                
+                @Override
+                public void run() {
+                    mp.setTime(resetpoint);
+                }
+            };
+            t= new Timer();
+            t.schedule(ani,loopLength/2,loopLength); //first run a half looptime till reset
+            looping=true;
+            }
+        
+    }
+    
+    protected void mute() {
+        mp.mute();
+        
+    }
+
+    public void forward() {
+        mp.setTime((long) (mp.getTime()+jumpLength));
+    }
+
+    public void backward() {
+        mp.setTime((long) (mp.getTime()-jumpLength));
+        
+    }
+
+    public void removeVideo() {
+        if (mp.isPlaying()) mp.stop();
+        mp.release();
+        
+    }
+    
+    public void toggleSubs()
+    {
+        //vlc manages it's subtitles in a own list so we have to cycle trough
+        int spu = mp.getSpu();
         if(spu > -1) {
           spu++;
@@ -420,66 +420,66 @@
         }
         mp.setSpu(spu);
-	}
-
-	public static void addObserver(PlayerObserver observer) {
-
-	        observers.add(observer);
-
-	    }
-
-	 
-
-	    public static void removeObserver(PlayerObserver observer) {
-
-	        observers.remove(observer);
-
-	    }
-
-	    private static void notifyObservers(long newTime) {
-
-	        for (PlayerObserver o : observers) {
-	            o.playing(newTime);
-	        }
-
-	    }
-
-		public String getNativePlayerInfos() {
-			return "VLC "+LibVlc.INSTANCE.libvlc_get_version();
-		}
-
-		public void faster() {
-			speed.setValue(speed.getValue()+100);
-			
-		}
-
-		public void slower() {
-			speed.setValue(speed.getValue()-100);
-			
-		}
-
-		public void pause() {
-			if (mp.isPlaying()) mp.pause();
-			
-		}
-
-		public boolean playing() {
-			return mp.isPlaying();
-		}
-
-		public void error(MediaPlayer arg0) {
-			// TODO Auto-generated method stub
-			
-		}
-
-		public void mediaChanged(MediaPlayer arg0) {
-			// TODO Auto-generated method stub
-			
-		}
-
-		public boolean hasSubtitles() {
-			if (mp.getSpuCount()==0) return false; else   return true;
-		}
-
-	
+    }
+
+    public static void addObserver(PlayerObserver observer) {
+
+            observers.add(observer);
+
+        }
+
+     
+
+        public static void removeObserver(PlayerObserver observer) {
+
+            observers.remove(observer);
+
+        }
+
+        private static void notifyObservers(long newTime) {
+
+            for (PlayerObserver o : observers) {
+                o.playing(newTime);
+            }
+
+        }
+
+        public String getNativePlayerInfos() {
+            return "VLC "+LibVlc.INSTANCE.libvlc_get_version();
+        }
+
+        public void faster() {
+            speed.setValue(speed.getValue()+100);
+            
+        }
+
+        public void slower() {
+            speed.setValue(speed.getValue()-100);
+            
+        }
+
+        public void pause() {
+            if (mp.isPlaying()) mp.pause();
+            
+        }
+
+        public boolean playing() {
+            return mp.isPlaying();
+        }
+
+        public void error(MediaPlayer arg0) {
+            // TODO Auto-generated method stub
+            
+        }
+
+        public void mediaChanged(MediaPlayer arg0) {
+            // TODO Auto-generated method stub
+            
+        }
+
+        public boolean hasSubtitles() {
+            if (mp.getSpuCount()==0) return false; else   return true;
+        }
+
+    
 
 }
Index: applications/editors/josm/plugins/videomapping/src/org/openstreetmap/josm/plugins/videomapping/video/Syncer.java
===================================================================
--- applications/editors/josm/plugins/videomapping/src/org/openstreetmap/josm/plugins/videomapping/video/Syncer.java	(revision 23173)
+++ applications/editors/josm/plugins/videomapping/src/org/openstreetmap/josm/plugins/videomapping/video/Syncer.java	(revision 23193)
@@ -17,7 +17,7 @@
     public void run() {
       SwingUtilities.invokeLater(new Runnable() {
-    	  //here we update
+          //here we update
         public void run() {
-        	if (pl.isPlaying())	pl.updateTime(); //if the video is seeking we get a mess
+            if (pl.isPlaying()) pl.updateTime(); //if the video is seeking we get a mess
         }
       });
