Index: applications/editors/josm/plugins/videomapping/src/org/openstreetmap/josm/plugins/videomapping/VideoPlugin.java
===================================================================
--- applications/editors/josm/plugins/videomapping/src/org/openstreetmap/josm/plugins/videomapping/VideoPlugin.java	(revision 25865)
+++ applications/editors/josm/plugins/videomapping/src/org/openstreetmap/josm/plugins/videomapping/VideoPlugin.java	(revision 25894)
@@ -176,5 +176,6 @@
                 saveProperties();
             }
-        });        
+        });
+        //TODO read deinterlacers list out of videoengine
         VDeinterlacer= new JMenu("Deinterlacer");
         VIntNone= new JRadioButtonMenuItem(new JosmAction(tr("none"), null, tr("no deinterlacing"),null, false) {            
@@ -217,13 +218,16 @@
         fc.setSelectedFile(new File(mostRecentFolder));
         if(fc.showOpenDialog(Main.main.parent)!=JFileChooser.CANCEL_OPTION)
-        {
+        {        	
         	mostRecentFolder=fc.getSelectedFile().getAbsolutePath();
         	saveProperties();
-        	videoPositionLayer= new VideoPositionLayer(gpsLayer);
-        	gpsVideoPlayer = new GPSVideoPlayer(new SimpleDateFormat("hh:mm:ss") ,videoPositionLayer);
-        	gpsVideoPlayer.setJumpLength(jumpLength);
-        	gpsVideoPlayer.setLoopLength(loopLength);
-        	gpsVideoPlayer.addVideo(fc.getSelectedFile());
-        	enableVideoControlMenus(true);
+        	if(videoPositionLayer==null)
+        	{
+        		videoPositionLayer= new VideoPositionLayer(gpsLayer);
+            	gpsVideoPlayer = new GPSVideoPlayer(new SimpleDateFormat("hh:mm:ss") ,videoPositionLayer);
+            	gpsVideoPlayer.setJumpLength(jumpLength);
+            	gpsVideoPlayer.setLoopLength(loopLength);
+            	enableVideoControlMenus(true);
+        	}        	
+        	gpsVideoPlayer.addVideo(fc.getSelectedFile());        	
         }
 		
@@ -272,17 +276,5 @@
     }
 	
-	private void applySettings()
-	{
-		//GUI
-        VCenterIcon.setSelected(autoCenter);
-        VIntNone.setSelected(true);
-        if(deinterlacer=="")
-        	VIntNone.setSelected(true);
-        if(deinterlacer=="bob")
-        	VIntBob.setSelected(true);
-        if(deinterlacer=="linear")
-        	VIntLinear.setSelected(true);
-	}
-	
+
 	private void showJumpTo()
 	{
@@ -345,4 +337,6 @@
 
 	public void layerRemoved(Layer arg0) {
+		if(arg0 instanceof VideoPositionLayer)
+			enableVideoControlMenus(false);
 		activeLayerChange(null,arg0);
 		
Index: applications/editors/josm/plugins/videomapping/src/org/openstreetmap/josm/plugins/videomapping/video/GPSVideo.java
===================================================================
--- applications/editors/josm/plugins/videomapping/src/org/openstreetmap/josm/plugins/videomapping/video/GPSVideo.java	(revision 25865)
+++ applications/editors/josm/plugins/videomapping/src/org/openstreetmap/josm/plugins/videomapping/video/GPSVideo.java	(revision 25894)
@@ -14,4 +14,5 @@
 // a specific synced video
 public class GPSVideo extends Video{
+	private static final String SYNC_KEY = "synced";
 	public JComponent SyncComponent;
 	private WayPoint syncWayPoint;
@@ -23,16 +24,19 @@
 	private VideoPositionLayer videoPositionLayer;
 	
-	public GPSVideo(File filename) {
-		super(filename);
+	public GPSVideo(File filename, String id) {
+		super(filename,id);
 	}
 	
 	public GPSVideo(Video video)
 	{
-		super(video.filename);
+		super(video.filename,video.id);
 		this.player=video.player;
 	}
 	
+	//calculates attributes basing upon the current position
 	public void doSync(VideoPositionLayer layer) {
 		this.videoPositionLayer=layer;
+		if (isSynced())
+			removeSyncedWayPoints();
 		syncWayPoint=layer.getCurrentWayPoint();
 		syncVideoTime=getCurrentTime();
@@ -44,7 +48,4 @@
 		markSyncedWayPoints();
 		Main.map.mapView.repaint();
-		System.out.println(firstWayPoint.getTime());
-		System.out.println(lastWayPoint.getTime());
-
 	}
 
@@ -72,4 +73,14 @@
 		}
 	}
+	
+	private void removeSyncedWayPoints() {
+		List <WayPoint> track =videoPositionLayer.getTrack();
+		int start=track.indexOf(firstWayPoint);
+		int end=track.indexOf(lastWayPoint);
+		List <WayPoint> ls =videoPositionLayer.getTrack().subList(start, end);
+		for (WayPoint n : ls) {
+			n.attr.keySet().remove(SYNC_KEY);
+		}				
+	}
 
 	private void markSyncedWayPoints() {
@@ -79,8 +90,6 @@
 		List <WayPoint> ls =videoPositionLayer.getTrack().subList(start, end);
 		for (WayPoint n : ls) {
-			n.attr.put("synced", Boolean.TRUE);
-		}
-		
-		
+			n.attr.put(SYNC_KEY, id);
+		}				
 	}
 
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 25865)
+++ applications/editors/josm/plugins/videomapping/src/org/openstreetmap/josm/plugins/videomapping/video/GPSVideoPlayer.java	(revision 25894)
@@ -43,23 +43,35 @@
 
 
-	@Override
 	public GPSVideo addVideo(File Videofile) {		
-		GPSVideo video = new GPSVideo(super.addVideo(Videofile));
+		GPSVideo video = new GPSVideo(super.addVideo(Videofile,Integer.toString(videos.size())));
+		enableSingleVideoMode(true);
 		videos.add(video);
+		addSyncButton(video);
+		return video;
+	}
+
+
+	private void addSyncButton(GPSVideo video) {
 		JButton syncButton= new JButton(tr("Sync"));
 		syncButton.setBackground(Color.RED);		
 		syncButton.addActionListener(new ActionListener() {
-            //do a sync
             public void actionPerformed(ActionEvent e) {
-            	GPSVideo v=findVideo((JButton)e.getSource());
-            	v.doSync(videoPositionLayer);
-            }
+            	resync(e);
+            }			
 		});
 		video.SyncComponent=syncButton;
 		//video.panel.add(syncButton,BorderLayout.SOUTH);
 		controlsPanel.add(syncButton);
-		return video;
 	}	
 
+	//do a (re)sync
+	private void resync(ActionEvent e) {
+		JButton btn =(JButton)e.getSource();
+    	GPSVideo v=findVideo(btn);
+    	v.doSync(videoPositionLayer);
+    	btn.setBackground(Color.GREEN);
+    	enableSingleVideoMode(false);
+	}
+	
 	protected GPSVideo findVideo(JButton source) {
 		for (GPSVideo v : videos) {
Index: applications/editors/josm/plugins/videomapping/src/org/openstreetmap/josm/plugins/videomapping/video/Video.java
===================================================================
--- applications/editors/josm/plugins/videomapping/src/org/openstreetmap/josm/plugins/videomapping/video/Video.java	(revision 25865)
+++ applications/editors/josm/plugins/videomapping/src/org/openstreetmap/josm/plugins/videomapping/video/Video.java	(revision 25894)
@@ -12,10 +12,12 @@
 public class Video {
 	public File filename;
+	public String id; //unique id to make it easy to identify
 	public MediaPlayer player;
 	public Canvas canvas;
-	public JPanel panel;
+	public JPanel panel;	
 	
-	public Video(File filename) {
+	public Video(File filename, String id) {
 		this.filename=filename;
+		this.id=id;
 		canvas=new Canvas();
 		panel=new JPanel();
Index: applications/editors/josm/plugins/videomapping/src/org/openstreetmap/josm/plugins/videomapping/video/VideoEngine.java
===================================================================
--- applications/editors/josm/plugins/videomapping/src/org/openstreetmap/josm/plugins/videomapping/video/VideoEngine.java	(revision 25865)
+++ applications/editors/josm/plugins/videomapping/src/org/openstreetmap/josm/plugins/videomapping/video/VideoEngine.java	(revision 25894)
@@ -31,6 +31,8 @@
 	private final String[] libvlcArgs = {""};
     private final String[] standardMediaOptions = {""};
-    private final String[] deinterlacers = {"bob","linear"};
+    private final static String[] deinterlacers = {"bob","linear"};
     private final float initialCanvasFactor = 0.5f;
+	private boolean singleVideoMode; //commands will only affect the last added video
+	private Video lastAddedVideo;
 	
 	//called at plugin start to setup library
@@ -69,4 +71,5 @@
 			mp.setStandardMediaOptions(standardMediaOptions);
 			videos.add(video);
+			lastAddedVideo=video;
 			mp.setVideoSurface(video.canvas);
 	        mp.addMediaPlayerEventListener(this);
@@ -97,25 +100,57 @@
 	}
 
-	public void play()
-	{
-		for (Video video : videos) {
-			video.player.play();
+	public void play()	
+	{
+		if (singleVideoMode)
+		{
+			lastAddedVideo.player.play();
+		}
+		else
+		{
+			for (Video video : videos) {
+				video.player.play();
+			}
 		}
 		System.out.println("abspielen");
 	}
 	
+	//toggles pause and play 
 	public void pause()
 	{
-		for (Video video : videos) {
-			video.player.pause();
-		}
-	}
-	
+		if (singleVideoMode)
+		{
+			lastAddedVideo.player.pause();
+		}
+		else
+		{
+			for (Video video : videos) {
+				video.player.pause();
+			}
+		}
+	}
+	
+	//ensures that all stop
+	public void pauseAll() {
+		for (Video video : videos) {
+			if (video.player.isPlaying())
+				video.player.pause();
+		}	
+	}
+
 	//jumps relative for ms in all videos
-	public void jump(long ms) {
-		for (Video video : videos) {
-			long start=video.player.getTime();
-			video.player.setTime(start+ms);
-		}
+	public void jumpFor(long ms) {
+		if (singleVideoMode)
+		{
+			long start=lastAddedVideo.player.getTime();
+			lastAddedVideo.player.setTime(start+ms);
+		}
+		else
+		{
+			for (Video video : videos) {
+				long start=video.player.getTime();
+				video.player.setTime(start+ms);
+			}
+		}
+		notifyObservers(VideoObserversEvents.jumping);
 		
 	}
@@ -124,11 +159,18 @@
 	public void jumpTo(long msVideo)
 	{
-		for (Video video : videos) {
-			video.player.setTime(msVideo);
+		if (singleVideoMode)
+		{
+			lastAddedVideo.player.setTime(msVideo);
+		}
+		else
+		{
+			for (Video video : videos) {
+				video.player.setTime(msVideo);
+			}
 		}
 		notifyObservers(VideoObserversEvents.jumping);
 	}
 			
-	//TODO muss auf Rückgabe für alle Videos erweitert werden
+	//TODO muss evtl. auf Rückgabe für alle Videos erweitert werden
 	public long getVideoTime()
 	{
@@ -139,11 +181,19 @@
 	public void jumpToPosition(int percent)
 	{
-		for (Video video : videos) {
-			float position = ((float)percent/100f);
-			video.player.setPosition(position);
+		float position = ((float)percent/100f);
+		if (singleVideoMode)
+		{
+			lastAddedVideo.player.setPosition(position);
+		}
+		else
+		{
+			for (Video video : videos) {
+				video.player.setPosition(position);
+			}
 		}
 		notifyObservers(VideoObserversEvents.jumping);
 	}
 	
+	//TODO has to be for every video
 	public int getPosition()
 	{
@@ -155,4 +205,8 @@
 	public void setSpeed(int percent)
 	{
+		if (singleVideoMode)
+		{
+			lastAddedVideo.player.setRate((float)(percent/100f));
+		}
 		for (Video video : videos) {
 			video.player.setRate((float)(percent/100f));
@@ -196,10 +250,17 @@
 	public void setDeinterlacer (String deinterlacer)
 	{
-		for (Video video : videos) {
-			video.player.setDeinterlace(deinterlacer);
-		}
-	}
-	
-	public String[] getDeinterlacers()
+		if (singleVideoMode)
+		{
+			lastAddedVideo.player.setDeinterlace(deinterlacer);
+		}
+		else
+		{
+			for (Video video : videos) {
+				video.player.setDeinterlace(deinterlacer);
+			}
+		}
+	}
+	
+	public static String[] getDeinterlacers()
 	{
 		return deinterlacers;
@@ -208,4 +269,8 @@
 	public void mute()
 	{
+		if (singleVideoMode)
+		{
+			lastAddedVideo.player.mute();
+		}
 		for (Video video : videos) {
 			video.player.mute();
@@ -310,3 +375,16 @@
 	}
 
+	public boolean isNoVideoPlaying() {
+		for (Video video : videos) {
+			if (video.player.isPlaying())
+				return false;
+		}
+		return true;
+	}
+
+	public void enableSingleVideoMode(boolean enabled) {
+		singleVideoMode = true;
+		
+	}
+
 }
Index: applications/editors/josm/plugins/videomapping/src/org/openstreetmap/josm/plugins/videomapping/video/VideoPlayer.java
===================================================================
--- applications/editors/josm/plugins/videomapping/src/org/openstreetmap/josm/plugins/videomapping/video/VideoPlayer.java	(revision 25865)
+++ applications/editors/josm/plugins/videomapping/src/org/openstreetmap/josm/plugins/videomapping/video/VideoPlayer.java	(revision 25894)
@@ -94,7 +94,7 @@
 	}
 	
-	public Video addVideo(File Videofile)
-	{
-		Video video = new Video(Videofile);		
+	public Video addVideo(File Videofile,String id)
+	{
+		Video video = new Video(Videofile,id);		
 		canvasPanel.add(video.panel);
 		video.canvas.setSize(new Dimension(300, 300)); // will be updated by the video engine itself
@@ -112,22 +112,23 @@
 	
 	public void pause(){
-		if (notificationTimer!=null)
-		{
-			notificationTimer.cancel();
-			notificationTimer=null;
-		}
+		videoengine.pause();
+		if (videoengine.isNoVideoPlaying())
+			stopNotificationTimer();
 		else
-		{
 			startNotificationTimer();
-		}
-		videoengine.pause();
+	}
+	
+	public void pauseAll()
+	{
+		stopNotificationTimer();
+		videoengine.pauseAll();
 	}
 
 	public void backward() {
-		videoengine.jump(-jumpLength);	
+		videoengine.jumpFor(-jumpLength);	
 	}
 
 	public void forward() {
-		videoengine.jump(jumpLength);	
+		videoengine.jumpFor(jumpLength);	
 	}
 
@@ -157,4 +158,5 @@
 	}
 
+	//TODO auf mehrere Videos umstellen
 	public void toggleLooping() {
 		if(loopingTimer==null)
@@ -299,4 +301,10 @@
     }
     
+    public void enableSingleVideoMode(boolean enabled)
+    {
+    	pauseAll();
+    	videoengine.enableSingleVideoMode(enabled);
+    }
+    
     public void addObserver(VideoPlayerObserver observer)
     {
@@ -305,16 +313,23 @@
 	
 	
+	private void stopNotificationTimer() {
+		/*
+		if(notificationTimer!=null)
+		{
+			notificationTimer.cancel();
+			notificationTimer=null;
+		}
+		*/
+	}
+
 	private void startNotificationTimer() {
-		if(notificationTimer==null)
-		{
-			notificationTimer= new Timer();
-		    notificationTimer.schedule(new TimerTask() {				
-				@Override
-				public void run() {
-					notifyObservers();
-					
-				}
-			},notificationIntervall,notificationIntervall);
-		}
+		notificationTimer= new Timer();
+		notificationTimer.schedule(new TimerTask() {				
+			@Override
+			public void run() {
+				notifyObservers();
+				
+			}
+		},notificationIntervall,notificationIntervall);
 	}
 	
@@ -369,7 +384,9 @@
 			{
 				speed.setValue(videoengine.getSpeed());
+				break;
 			}
 			case jumping:
-			{				
+			{			
+				break;
 			}
 		}		
