Changeset 31877 in osm for applications/editors/josm/plugins/videomapping
- Timestamp:
- 2015-12-28T02:40:06+01:00 (9 years ago)
- Location:
- applications/editors/josm/plugins/videomapping
- Files:
-
- 3 added
- 3 deleted
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/videomapping/.classpath
r30821 r31877 7 7 <classpathentry combineaccessrules="false" kind="src" path="/JOSM-jna"/> 8 8 <classpathentry combineaccessrules="false" kind="src" path="/JOSM-log4j"/> 9 <classpathentry kind="lib" path="lib/vlcj-3.1.0.jar" sourcepath="lib/vlcj-3.1.0-sources.jar"> 9 <classpathentry kind="lib" path="lib/vlcj-3.10.0.jar" sourcepath="lib/vlcj-3.10.0-sources.jar"> 10 10 <attributes> 11 <attribute name="javadoc_location" value="jar:platform:/resource/JOSM-videomapping/lib/vlcj-3.1.0-javadoc.jar!/"/> 11 <attribute name="javadoc_location" value="jar:platform:/resource/JOSM-videomapping/lib/vlcj-3.10.0-javadoc.jar!/"/> 12 12 </attributes> 13 13 </classpathentry> -
applications/editors/josm/plugins/videomapping/src/org/openstreetmap/josm/plugins/videomapping/video/VideoEngine.java
r30816 r31877 36 36 private boolean singleVideoMode; //commands will only affect the last added video 37 37 private Video lastAddedVideo; 38 38 39 39 //called at plugin start to setup library 40 40 public static void setupPlayer() { 41 41 String vlcInstallDir = null; 42 42 43 43 if (RuntimeUtil.isWindows()) { 44 44 vlcInstallDir = WindowsRuntimeUtil.getVlcInstallDir(); … … 46 46 if (vlcInstallDir == null && arch.equals("amd64")) { 47 47 try { 48 vlcInstallDir = Advapi32Util.registryGetStringValue(WinReg.HKEY_LOCAL_MACHINE, 49 WindowsRuntimeUtil.VLC_REGISTRY_KEY.replaceFirst("\\\\", "\\\\Wow6432Node\\\\"), 48 vlcInstallDir = Advapi32Util.registryGetStringValue(WinReg.HKEY_LOCAL_MACHINE, 49 WindowsRuntimeUtil.VLC_REGISTRY_KEY.replaceFirst("\\\\", "\\\\Wow6432Node\\\\"), 50 50 WindowsRuntimeUtil.VLC_INSTALL_DIR_KEY); 51 51 } catch (RuntimeException e) { … … 58 58 // TODO 59 59 } 60 60 61 61 if (vlcInstallDir != null) { 62 62 Main.info("videomapping: found VLC install dir: "+vlcInstallDir); … … 66 66 } 67 67 } 68 68 69 69 public VideoEngine(Window parent) { 70 70 System.setProperty("logj4.configuration","file:log4j.xml"); //TODO still unsure if we can't link this to the JOSM log4j instance … … 82 82 } 83 83 } 84 84 85 85 public void add(Video video) { 86 86 try { … … 93 93 mp.addMediaPlayerEventListener(this); 94 94 String mediaPath = video.filename.getAbsoluteFile().toString(); 95 mp.playMedia(mediaPath); 96 //now fetching and playback starts automatically 95 mp.playMedia(mediaPath); 96 //now fetching and playback starts automatically 97 97 } catch (NoClassDefFoundError e) { 98 98 Main.error(tr("Unable to find JNA Java library!")); … … 110 110 } 111 111 */ 112 public List<Video> getVideos() { 112 public List<Video> getVideos() { 113 113 return videos; 114 114 } … … 123 123 } 124 124 } 125 126 //toggles pause and play 125 126 //toggles pause and play 127 127 public void pause() { 128 128 if (singleVideoMode) { … … 134 134 } 135 135 } 136 136 137 137 //ensures that all stop 138 138 public void pauseAll() { … … 140 140 if (video.player.isPlaying()) 141 141 video.player.pause(); 142 } 142 } 143 143 } 144 144 … … 154 154 } 155 155 } 156 notifyObservers(VideoObserversEvents.jumping); 156 notifyObservers(VideoObserversEvents.jumping); 157 157 } 158 158 … … 168 168 notifyObservers(VideoObserversEvents.jumping); 169 169 } 170 170 171 171 //TODO muss evtl. auf Rückgabe für alle Videos erweitert werden 172 172 public long getVideoTime() { 173 173 return videos.get(0).player.getTime(); 174 174 } 175 175 176 176 //jumps in all videos to this absolute video time percentage 177 177 public void jumpToPosition(int percent) { 178 float position = ( (float)percent/100f);178 float position = (percent/100f); 179 179 if (singleVideoMode) { 180 180 lastAddedVideo.player.setPosition(position); … … 186 186 notifyObservers(VideoObserversEvents.jumping); 187 187 } 188 188 189 189 //TODO muss evtl. auf Rückgabe für alle Videos erweitert werden 190 190 public int getPosition() { 191 191 return (int) (videos.get(0).player.getPosition()*100); 192 } 193 192 } 193 194 194 public void setSpeed(int percent) { 195 195 if (singleVideoMode) { 196 lastAddedVideo.player.setRate( (float)(percent/100f));197 } 198 for (Video video : videos) { 199 video.player.setRate( (float)(percent/100f));196 lastAddedVideo.player.setRate(percent/100f); 197 } 198 for (Video video : videos) { 199 video.player.setRate(percent/100f); 200 200 } 201 201 notifyObservers(VideoObserversEvents.speeding); 202 202 } 203 203 204 204 //TODO muss evtl. auf Rückgabe für alle Videos erweitert werden 205 205 public int getSpeed() { 206 206 return (int) (videos.get(0).player.getRate()*100); 207 207 } 208 208 209 209 //returns if at least one video has subtitles 210 210 public boolean hasSubtitles() { … … 214 214 return false; 215 215 } 216 216 217 217 public void setSubtitles (boolean enabled) { 218 218 if (enabled) { … … 227 227 } 228 228 } 229 229 230 230 public void setDeinterlacer (DeinterlaceMode deinterlacer) { 231 231 if (singleVideoMode) { … … 237 237 } 238 238 } 239 239 240 240 public static String[] getDeinterlacers() { 241 241 return deinterlacers; 242 242 } 243 243 244 244 public void mute() { 245 245 if (singleVideoMode) { … … 250 250 } 251 251 } 252 252 253 253 public void unload() { 254 254 for (Video video : videos) { … … 259 259 video.canvas=null; 260 260 } 261 mediaPlayerFactory.release(); 261 mediaPlayerFactory.release(); 262 262 } 263 263 … … 276 276 /* 277 277 public void buffering(MediaPlayer arg0) { 278 278 279 279 } 280 280 */ … … 292 292 /* 293 293 public void mediaChanged(MediaPlayer arg0) { 294 294 295 295 } 296 296 … … 298 298 Dimension org=data.getVideoDimension(); 299 299 getVideo(mp).canvas.setSize(new Dimension((int)(org.width*initialCanvasFactor), (int)(org.height*initialCanvasFactor))); 300 notifyObservers(VideoObserversEvents.resizing); 300 notifyObservers(VideoObserversEvents.resizing); 301 301 } 302 302 */ … … 427 427 // TODO Auto-generated method stub 428 428 } 429 430 @Override 431 public void corked(MediaPlayer mediaPlayer, boolean corked) { 432 // TODO Auto-generated method stub 433 434 } 435 436 @Override 437 public void muted(MediaPlayer mediaPlayer, boolean muted) { 438 // TODO Auto-generated method stub 439 440 } 441 442 @Override 443 public void volumeChanged(MediaPlayer mediaPlayer, float volume) { 444 // TODO Auto-generated method stub 445 446 } 447 448 @Override 449 public void audioDeviceChanged(MediaPlayer mediaPlayer, String audioDevice) { 450 // TODO Auto-generated method stub 451 452 } 453 454 @Override 455 public void chapterChanged(MediaPlayer mediaPlayer, int newChapter) { 456 // TODO Auto-generated method stub 457 458 } 459 460 @Override 461 public void mediaSubItemTreeAdded(MediaPlayer mediaPlayer, libvlc_media_t item) { 462 // TODO Auto-generated method stub 463 464 } 429 465 }
Note:
See TracChangeset
for help on using the changeset viewer.