Ignore:
Timestamp:
2012-11-18T20:37:02+01:00 (12 years ago)
Author:
donvip
Message:

[josm_videomapping] Safeguards and error messages when the VLC library is not correctly initialized

Location:
applications/editors/josm/plugins/videomapping/src/org/openstreetmap/josm/plugins/videomapping
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/videomapping/src/org/openstreetmap/josm/plugins/videomapping/VideoPlugin.java

    r28924 r28949  
    6464        private VideoPositionLayer videoPositionLayer;
    6565        private GPSVideoPlayer gpsVideoPlayer;
     66       
     67        public static String VLC_VERSION = "2.0.x";
    6668
    6769        public VideoPlugin(PluginInformation info) {
     
    236238                enableVideoControlMenus(true);
    237239                }
    238                 if (gpsVideoPlayer != null) {
     240                if (gpsVideoPlayer != null && gpsVideoPlayer.isCorrectlyInitiliazed()) {
    239241                    gpsVideoPlayer.addVideo(fc.getSelectedFile());
     242                } else {
     243                JOptionPane.showMessageDialog(Main.parent,
     244                        tr("VLC library is not correctly initialized."+
     245                                " Please check that VLC {0} is correctly installed on your system."+
     246                                " Its architecture (32/64 bits) must also be the same as the JRE that runs JOSM.", VLC_VERSION),
     247                        tr("Error"), JOptionPane.ERROR_MESSAGE
     248                        );
    240249                }
    241250        }               
  • applications/editors/josm/plugins/videomapping/src/org/openstreetmap/josm/plugins/videomapping/video/GPSVideoPlayer.java

    r28924 r28949  
    3030        }
    3131
    32         public GPSVideo addVideo(File Videofile) {             
    33                 GPSVideo video = new GPSVideo(super.addVideo(Videofile,Integer.toString(videos.size())));
     32        public GPSVideo addVideo(File videofile) {             
     33                GPSVideo video = new GPSVideo(super.addVideo(videofile,Integer.toString(videos.size())));
    3434                enableSingleVideoMode(true);
    3535                videos.add(video);
  • applications/editors/josm/plugins/videomapping/src/org/openstreetmap/josm/plugins/videomapping/video/VideoPlayer.java

    r28924 r28949  
    6666        }
    6767       
    68         public Video addVideo(File Videofile, String id)
    69         {
    70                 Video video = new Video(Videofile,id,videoengine.mediaPlayerFactory);
     68        public Video addVideo(File videofile, String id) {
     69                Video video = new Video(videofile,id,videoengine.mediaPlayerFactory);
    7170                canvasPanel.add(video.panel);
    7271                video.canvas.setSize(new Dimension(300, 300)); // will be updated by the video engine itself
     
    374373        }
    375374   
    376 
    377    
    378 
     375        public boolean isCorrectlyInitiliazed() {
     376            return videoengine != null && videoengine.mediaPlayerFactory != null;
     377        }
    379378}
Note: See TracChangeset for help on using the changeset viewer.