Changeset 25742 in osm for applications/editors/josm/plugins/videomapping/src
- Timestamp:
- 2011-03-29T10:23:18+02:00 (14 years ago)
- Location:
- applications/editors/josm/plugins/videomapping/src/org/openstreetmap/josm/plugins/videomapping
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/videomapping/src/org/openstreetmap/josm/plugins/videomapping/GpsPlayer.java
r25385 r25742 15 15 private WayPoint prev,curr,next; 16 16 private WayPoint start; 17 private boolean autoCenter; 17 private boolean autoCenter; 18 private List<WayPoint> ipos; //TODO can become optiized hashtable 19 private WayPoint ipo; 18 20 19 21 … … 45 47 curr=ls.get(0); 46 48 next=ls.get(1); 49 ipo=curr; 47 50 } 48 51 … … 230 233 timeSeg=-(getPrev().getTime().getTime()-getCurr().getTime().getTime()); 231 234 } 232 WayPoint w =new WayPoint(Main.map.mapView.getLatLon(m.x, m.y)); 235 WayPoint w =new WayPoint(Main.map.mapView.getLatLon(m.x, m.y)); 233 236 //calc total traversal length 234 237 lengthSeg = getTraversalLength(p2, curr); … … 329 332 return p.getTime().getTime()-start.getTime().getTime(); //TODO assumes timeintervall is constant!!!! 330 333 } 331 332 333 334 //toggles walking along the track335 /* public void play(){336 337 if (t==null)338 {339 //start340 t= new Timer();341 ani=new TimerTask() {342 @Override343 //some cheap animation stuff344 public void run() {345 next();346 if(autoCenter) Main.map.mapView.zoomTo(getCurr().getEastNorth());347 Main.map.mapView.repaint();348 }349 };350 t.schedule(ani,1000,1000);351 }352 else353 {354 //stop355 ani.cancel();356 ani=null;357 t.cancel();358 t=null;359 }360 }*/361 334 362 335 public long getLength() { … … 374 347 } 375 348 349 public List<WayPoint> interpolate() { 350 ipos = new LinkedList<WayPoint>(); 351 WayPoint old = getCurr(); 352 for (int i=1;i<ls.size();i++) 353 { 354 ipos.addAll(getInterpolatedLine(5)); 355 next(); 356 } 357 goTo(old); 358 return ipos; 359 } 360 361 public void jumpIPO(long relTime) { 362 int pos = Math.round(relTime/1000);//TODO assumes the time is constant 363 goTo(pos); 364 pos=Math.round(relTime/200); 365 ipo= ipos.get(pos); 366 if (autoCenter) Main.map.mapView.zoomTo(curr.getCoor()); 367 368 } 369 370 public WayPoint getIPO() 371 { 372 return ipo; 373 } 374 376 375 377 376 -
applications/editors/josm/plugins/videomapping/src/org/openstreetmap/josm/plugins/videomapping/PositionLayer.java
r25385 r25742 38 38 public class PositionLayer extends Layer implements MouseListener,MouseMotionListener { 39 39 private List<WayPoint> ls; 40 private List<WayPoint> ipos; 40 41 public GpsPlayer gps; 41 42 private boolean dragIcon=false; //do we move the icon by hand? … … 48 49 public PositionLayer(File video, GpxLayer GpsLayer) { 49 50 super(video.getName()); 50 ls=copyGPSLayer(GpsLayer.data); //TODO This might be outsourced to a seperated track 51 gps= new GpsPlayer(ls); 51 ls=copyGPSLayer(GpsLayer.data); //TODO This might be outsourced to a seperated track 52 gps= new GpsPlayer(ls); 52 53 icon = new ImageIcon("images/videomapping.png"); 53 54 gpsTimeCode= new SimpleDateFormat("HH:mm:ss");//TODO replace with DF small … … 55 56 Main.map.mapView.addMouseMotionListener(this); 56 57 gpsVP = new GPSVideoPlayer(video, gps); 57 iconPosition=gps.getCurr(); 58 gps.goTo(0); 59 ipos=gps.interpolate(); 60 iconPosition=gps.getCurr(); 58 61 } 59 62 … … 158 161 g.setColor(Color.CYAN); 159 162 g.setBackground(Color.CYAN); 160 LinkedList<WayPoint> ipo=(LinkedList<WayPoint>) gps.getInterpolatedLine(5); 161 for (WayPoint wp : ipo) { 163 //LinkedList<WayPoint> ipo=(LinkedList<WayPoint>) gps.getInterpolatedLine(5); 164 for (WayPoint wp : ipos) { 162 165 p=Main.map.mapView.getPoint(wp.getEastNorth()); 163 166 g.fillArc(p.x, p.y, 4, 4, 0, 360); … … 179 182 { 180 183 if (gps.getCurr()!=null){ 181 p=Main.map.mapView.getPoint(gps.get Curr().getEastNorth());184 p=Main.map.mapView.getPoint(gps.getIPO().getEastNorth()); 182 185 icon.paintIcon(null, g, p.x-icon.getIconWidth()/2, p.y-icon.getIconHeight()/2); 183 186 g.drawString(gpsTimeCode.format(gps.getCurr().getTime()),p.x-15,p.y-15); … … 289 292 //restrict to GPS track 290 293 iconPosition=gps.getInterpolatedWaypoint(mouse); 291 292 294 Main.map.mapView.repaint(); 293 295 } -
applications/editors/josm/plugins/videomapping/src/org/openstreetmap/josm/plugins/videomapping/VideoMappingPlugin.java
r25385 r25742 34 34 import org.openstreetmap.josm.gui.MapView.LayerChangeListener; 35 35 import org.openstreetmap.josm.gui.layer.*; 36 37 import uk.co.caprica.vlcj.runtime.windows.WindowsRuntimeUtil; 38 39 import com.sun.jna.NativeLibrary; 36 40 37 41 import static org.openstreetmap.josm.tools.I18n.*; … … 78 82 applySettings(); 79 83 //further plugin informations are provided by build.xml properties 84 //NativeLibrary.addSearchPath("vlc", "C:\\Programme\\Video\\VLC"); // this should be the directory that contains libvlc.dll 85 NativeLibrary.addSearchPath("libvlc", WindowsRuntimeUtil.getVlcInstallDir()); 80 86 } 81 87 -
applications/editors/josm/plugins/videomapping/src/org/openstreetmap/josm/plugins/videomapping/video/GPSVideoPlayer.java
r25385 r25742 77 77 if(synced) { 78 78 gps.jump(getGPSTime(time)); 79 gps.jumpIPO(getGPSTime(time)); 79 80 } 80 81 -
applications/editors/josm/plugins/videomapping/src/org/openstreetmap/josm/plugins/videomapping/video/SimpleVideoPlayer.java
r25385 r25742 118 118 }); 119 119 } 120 }, 0L, 200L, TimeUnit.MILLISECONDS);120 }, 0L, 500L, TimeUnit.MILLISECONDS); 121 121 //setDefaultCloseOperation(EXIT_ON_CLOSE); 122 122 addWindowListener(this); … … 512 512 513 513 public void buffering(MediaPlayer arg0) { 514 // TODO Auto-generated method stub514 System.out.println("buffering!"); 515 515 516 516 } … … 523 523 public void opening(MediaPlayer arg0) { 524 524 // TODO Auto-generated method stub 525 System.out.println("opening!"); 525 526 526 527 } … … 532 533 533 534 public void seekableChanged(MediaPlayer arg0, int arg1) { 534 // TODO Auto-generated method stub535 System.out.println("seeking!"); 535 536 536 537 }
Note:
See TracChangeset
for help on using the changeset viewer.