コード例 #1
0
    public void beforeConvert() {
      if (FFMpegUI.getFFmpeg() == null && !quickCopy.getSelection()) {
        log.warn("this never happend:must filtered by canConvert");
        return;
      }

      //			TODO if use pure_ffmpeg use it.if can handle codec.
      String ffmpegPath = FFMpegUI.getFFmpeg();
      if (ffmpegPath == null) {
        ffmpegPath = FFMpegUI.getPureFFmpeg();
      }

      // should initialize first.
      fileOverwriteControler = new FileOverwriteControler(tab.getShell());

      ffmpegExecuter = new FFMpegExecuter();
      ffmpegExecuter.setAllowDemuxingFLV(false); // if true newer ffmpeg.exe make problem.
      ffmpegExecuter.setIgnoreAvisynthExtensions(new String[0]); // use any file
      ffmpegExecuter.setExecuteListener(new FFMpegMonitor());

      MP3FFMpegPreference preference = new MP3FFMpegPreference();
      ffmpegExecuter.setFfmpegPreference(preference);

      preference.setFfmpegPath(ffmpegPath);
      preference.setExtension(FFMpegOptions.EXTENSION_MP3);

      // support thread.//no it crash
      /*
      boolean threads = Akj_betasPlugin.getDefault().getPreferenceStore()
      .getBoolean(FFMpegPage.USE_THREAD);
      */

      ffmpegExecuter.setSameDirectory(samefolder.getSelection());
      ffmpegExecuter.setBackup(backup.getSelection());
      if (!samefolder.getSelection()) {
        ffmpegExecuter.setExportDir(directoryChooser.getAbsoluteFilePath());
      }

      // copy settings
      preference.setForceConvert(forceConvert.getSelection());
      preference.setUseCopy(quickCopy.getSelection());
      preference.setDefaultBitrate(
          Integer.parseInt(defaultBitrate.getItem(defaultBitrate.getSelectionIndex())));
      ffmpegExecuter.setUseAvisynth(useAvisynth.getSelection());
      preference.setConvertBitrate(mp3setting.getBitrate());
      preference.setConvertFramerate(mp3setting.getFramerate());
      preference.setConvertChannel(mp3setting.getChannel());
    }
コード例 #2
0
    public void updateStatus() {
      if (quickCopy == null) {
        // this called before createPart from preference monitor.
        // ignore it
      }

      String ffmpegPath = FFMpegUI.getFFmpeg();
      if (ffmpegPath == null) {
        if (noFFMpegImage != null) { // initial call,there are null image
          dragHere.setImage(noFFMpegImage);
        }
        setMessage(""); // setMessage(Messages.getString(""));
        if (quickCopy != null) {

          setCanConvert(quickCopy.getSelection()); // enable only if copy on
          setCantConvertStatusbarMessage(Messages.getString("ffmpeg_statusbar.no_ffmpeg"));
        } else {
          log.warn("this never called");
          // before initialize
          setCanConvert(getPreferenceStore().getBoolean(getPreferenceKey() + "." + "quickcopy"));
        }
      } else {
        if (canConvertImage != null) dragHere.setImage(canConvertImage);
        if (samefolder.getSelection() || directoryChooser.getFile() != null) {
          setMessage(Messages.getString("dropsomething.drag_folder"));
          setCanConvert(true);
        } else {
          setErrorMessage(Messages.getString("dropsomething.choose_folder"));
          setCanConvert(false);
        }
      }
      log.info("currentStatus:" + isCanConvert());
    }