package saccubus;
+import java.io.IOException;
+import saccubus.converter.Converter;
import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.GridBagConstraints;
import javax.swing.JTextField;
import javax.swing.SwingUtilities;
import nicobrowser.entity.NicoContent;
-import org.apache.commons.io.FilenameUtils;
+import org.apache.commons.lang.StringUtils;
import saccubus.ConvertStopFlag.State;
-import saccubus.ConvertingSetting.TcommentSetting;
+import saccubus.converter.profile.FfmpegOption;
+import saccubus.converter.profile.NgSetting;
import saccubus.net.TextProgressListener;
+import saccubus.properties.BasicSetting;
+import saccubus.properties.ConvertSetting;
+import saccubus.properties.InputCommentSetting;
+import saccubus.properties.InputVideoSetting;
+import saccubus.properties.SProperties;
+import saccubus.properties.InputTcommentSetting;
+import saccubus.properties.MovieSetting;
+import saccubus.properties.OutputVideoSetting;
import saccubus.util.FileDropTarget;
import saccubus.util.PopupRightClick;
import yukihane.nicovideo.NicoDBFinder;
public class MainFrame extends JFrame {
private static final long serialVersionUID = 2564486741331062989L;
- public static final String VERSION = "1.22r NicoBrowser\8ag\92£ 1.0.0";
+ public static final String VERSION = "1.22r NicoBrowser\8ag\92£ 1.3.3";
public static final Image WinIcon = Toolkit.getDefaultToolkit().createImage(saccubus.MainFrame.class.getResource(
"icon32.png"));
JPanel contentPane;
jbInit();
setPopup();
setDropTarget();
- ConvertingSetting setting = ConvertingSetting.loadSetting(null,
+ SProperties setting = SProperties.loadSetting(null,
null);
this.setSetting(setting);
} catch (Exception exception) {
}
}
- private ConvertingSetting getSetting() {
- int back_comment;
- try {
- back_comment = Integer.parseInt(savePanel.getCommentNumField().getText());
- } catch (NumberFormatException ex) {
- back_comment = 500;
- }
- int proxy_port;
- try {
- proxy_port = Integer.parseInt(ProxyPortTextField.getText());
- } catch (NumberFormatException e) {
- proxy_port = -1;
- }
-
- VideoSaveKind kind;
- String savedFileName;
- if (videoSaveInfoPanel.getVideoNoSaveButton().isSelected() == true) {
- kind = VideoSaveKind.NO_SAVE;
- savedFileName = videoSaveInfoPanel.getVideoSavedFileField().getText();
- } else if (videoSaveInfoPanel.getVideoUseNiBrButton().isSelected() == true) {
- kind = VideoSaveKind.NICOBROWSER;
- savedFileName = videoSaveInfoPanel.getNibrFileField().getText();
- } else {
- kind = VideoSaveKind.SAVE;
- savedFileName = videoSaveInfoPanel.getVideoSavedFileField().getText();
- }
-
- final ConvertingSetting.TcommentSetting tcommentSetting = getTcommentSetting();
-
- ConvertingSetting setting = new ConvertingSetting(
- MailAddrField.getText(),
- new String(PasswordField.getPassword()),
- kind,
- savedFileName,
- savePanel.getSavingCommentCheckBox().isSelected(),
- savePanel.getCommentSavedFileField().getText(),
- savePanel.getSavingConvertedVideoCheckBox().isSelected(),
- savePanel.getAddCommentCheckBox().isSelected(),
- savePanel.getAddTcommentCheckBox().isSelected(),
- savePanel.getConvertedVideoSavedFileField().getText(),
- ViewCommentField.getText(),
- FFmpegPathField.getText(),
- VhookPathField.getText(),
- ExtOptionField.getText(),
- MainOptionField.getText(),
- CommandLineInOptionField.getText(),
- CommandLineOutOptionField.getText(),
- Integer.toString(back_comment),
- FontPathField.getText(),
- Integer.parseInt(FontIndexField.getText()),
- ShowConvVideoCheckBox.isSelected(),
- videoSaveInfoPanel.getDelVideoCheckBox().isSelected(),
- videoSaveInfoPanel.getSaveFolderRadioButton().isSelected(),
- videoSaveInfoPanel.getVideoSavedFolderField().getText(),
- savePanel.getDelCommentCheckBox().isSelected(),
- savePanel.getCommentSaveFolderRadioButton().isSelected(),
- savePanel.getCommentSavedFolderField().getText(),
- tcommentSetting,
- savePanel.getNotAddVideoIdConvVideoCheckBox().isSelected(),
- savePanel.getConvSaveFolderRadioButton().isSelected(),
- savePanel.getConvertedVideoSavedFolderField().getText(),
- NGWordTextField.getText(),
- NGIDTextField.getText(),
- UseProxyCheckBox.isSelected(),
- ProxyTextField.getText(),
- proxy_port,
- FixFontSizeCheckBox.isSelected(),
- savePanel.getFixCommentNumCheckBox().isSelected(),
- OpaqueCommentCheckBox.isSelected(),
- FFmpegOptionModel.getSelectedFile(),
- NotUseVhookCheckBox.isSelected(),
- ShadowComboBox.getSelectedIndex());
+ private SProperties getSetting() {
+ SProperties setting = new SProperties(
+ getBasicSetting(),
+ getInputVideoSetting(),
+ getInputCommentSetting(),
+ getTcommentSetting(),
+ getOutputVideoSetting(),
+ getMovieSetting(),
+ getConvertSetting());
return setting;
}
* \90Ý\92è\82ð\89æ\96Ê\82É\94½\89f\82·\82é.
* @param setting \94½\89f\82·\82é\90Ý\92è.
*/
- private void setSetting(ConvertingSetting setting) {
- MailAddrField.setText(setting.getMailAddress());
- PasswordField.setText(setting.getPassword());
+ private void setSetting(SProperties setting) {
+ // \8aî\96{\90Ý\92è
+ final BasicSetting basic = setting.getBasicSetting();
+ MailAddrField.setText(basic.getUser().getMail());
+ PasswordField.setText(basic.getUser().getPassword());
+ // \83v\83\8d\83L\83V\8aÖ\98A
+ UseProxyCheckBox.setSelected(basic.isProxyUse());
+ ProxyTextField.setText(basic.getProxyHost());
+ int proxy_port = basic.getProxyPort();
+ if (proxy_port >= 0 && proxy_port <= 65535) {
+ ProxyPortTextField.setText(Integer.toString(proxy_port));
+ } else {
+ ProxyPortTextField.setText("");
+ }
+ // \95Û\91¶\90Ý\92è - \93ü\97Í\93®\89æ
+ final InputVideoSetting inVideo = setting.getInputVideoSetting();
JRadioButton activeButton;
- switch (setting.getVideoSaveKind()) {
+ switch (inVideo.getProcessKind()) {
case NO_SAVE:
activeButton = videoSaveInfoPanel.getVideoNoSaveButton();
break;
activeButton = videoSaveInfoPanel.getVideoSaveButton();
break;
}
- activeButton.setSelected(true);
- ActionListener[] listeners = activeButton.getActionListeners();
- for (ActionListener l : listeners) {
- l.actionPerformed(new ActionEvent(activeButton, ActionEvent.ACTION_PERFORMED, activeButton.getText()));
- }
+ activeButton.doClick();
-
- videoSaveInfoPanel.getVideoSavedFileField().setText(setting.getVideoFile().getPath());
- savePanel.getSavingCommentCheckBox().setSelected(setting.isSaveComment());
- savePanel.getCommentSavedFileField().setText(setting.getCommentFile().getPath());
- savePanel.getSavingConvertedVideoCheckBox().setSelected(setting.isSaveConverted());
- savePanel.getAddCommentCheckBox().setSelected(setting.getAddComment());
- savePanel.getAddTcommentCheckBox().setSelected(setting.getAddTcomment());
- savePanel.getConvertedVideoSavedFileField().setText(setting.getConvertedVideoFile().getPath());
- ViewCommentField.setText(setting.getVideoShowNum());
- FFmpegPathField.setText(setting.getFFmpegPath());
- VhookPathField.setText(setting.getVhookPath());
- ExtOptionField.setText(setting.getCmdLineOptionExt());
- MainOptionField.setText(setting.getCmdLineOptionMain());
- CommandLineOutOptionField.setText(setting.getCmdLineOptionOut());
- CommandLineInOptionField.setText(setting.getCmdLineOptionIn());
- savePanel.getCommentNumField().setText(setting.getBackComment());
- FontPathField.setText(setting.getFontPath());
- FontIndexField.setText(setting.getFontIndex());
- ShowConvVideoCheckBox.setSelected(setting.isVhook_ShowConvertingVideo());
- videoSaveInfoPanel.getVideoSavedFolderField().setText(setting.getVideoFixFileNameFolder().getPath());
- savePanel.getCommentSavedFolderField().setText(setting.getCommentFixFileNameFolder().getPath());
- savePanel.getConvertedVideoSavedFolderField().setText(setting.getConvFixFileNameFolder().getPath());
- videoSaveInfoPanel.getDelVideoCheckBox().setSelected(setting.isDeleteVideoAfterConverting());
- savePanel.getDelCommentCheckBox().setSelected(setting.isDeleteCommentAfterConverting());
- savePanel.getNotAddVideoIdConvVideoCheckBox().setSelected(setting.isNotAddVideoID_Conv());
-
- boolean videoFixName = setting.isVideoFixFileName();
+ videoSaveInfoPanel.getVideoSavedFileField().setText(inVideo.getFile().getPath());
+ videoSaveInfoPanel.getVideoSavedFolderField().setText(inVideo.getFolder().getPath());
+ videoSaveInfoPanel.getDelVideoCheckBox().setSelected(inVideo.isDeleteAfterConvert());
+ final boolean videoFixName = inVideo.isAutoNaming();
videoSaveInfoPanel.getSaveFileRadioButton().setSelected(!videoFixName);
videoSaveInfoPanel.getSaveFolderRadioButton().setSelected(videoFixName);
-
- boolean commentFixName = setting.isCommentFixFileName();
+ videoSaveInfoPanel.getNibrFileField().setText(inVideo.getNicoBrowserFile().getPath());
+
+ // \95Û\91¶\90Ý\92è - \93ü\97Í\83R\83\81\83\93\83g
+ final InputCommentSetting inputComment = setting.getInputCommentSetting();
+ savePanel.getSavingCommentCheckBox().setSelected(inputComment.getProcessKind());
+ savePanel.getCommentSavedFileField().setText(inputComment.getFile().getPath());
+ savePanel.getDelCommentCheckBox().setSelected(inputComment.isDeleteAfterConvert());
+ savePanel.getCommentSavedFolderField().setText(inputComment.getFolder().getPath());
+ savePanel.getCommentNumField().setText(Integer.toString(inputComment.getNumOfComment()));
+ savePanel.getFixCommentNumCheckBox().setSelected(inputComment.isSelfAdjustNumOfComment());
+ boolean commentFixName = inputComment.isAutoNaming();
savePanel.getCommentSaveFileRadioButton().setSelected(!commentFixName);
savePanel.getCommentSaveFolderRadioButton().setSelected(commentFixName);
- boolean convFixName = setting.isConvFixFileName();
+ // \93\8a\8de\8eÒ\83R\83\81\83\93\83g
+ InputTcommentSetting tcom = setting.getInputTcommentSetting();
+ savePanel.setTcommentDownload(tcom.getProcessKind());
+ savePanel.setTcommentDelete(tcom.isDeleteAfterConvert());
+ savePanel.setTcommentAutoFileName(tcom.isAutoNaming());
+ savePanel.setTcommentDirectoryName(tcom.getFolder().getPath());
+ savePanel.setTcommentFileName(tcom.getFile().getPath());
+
+ // \95Û\91¶\90Ý\92è - \8fo\97Í\83R\83\81\83\93\83g\95t\82«\93®\89æ
+ final OutputVideoSetting outputVideo = setting.getOutputVideoSetting();
+ savePanel.getSavingConvertedVideoCheckBox().setSelected(outputVideo.getProcessKind());
+ savePanel.getAddCommentCheckBox().setSelected(outputVideo.isAddComment());
+ savePanel.getAddTcommentCheckBox().setSelected(outputVideo.isAddTcomment());
+ savePanel.getConvertedVideoSavedFileField().setText(outputVideo.getFile().getPath());
+ savePanel.getConvertedVideoSavedFolderField().setText(outputVideo.getFolder().getPath());
+ savePanel.getNotAddVideoIdConvVideoCheckBox().setSelected(outputVideo.isCutIdName());
+ boolean convFixName = outputVideo.isAutoNaming();
savePanel.getConvSaveFileRadioButton().setSelected(!convFixName);
savePanel.getConvSaveFolderRadioButton().setSelected(convFixName);
- NGWordTextField.setText(setting.getNG_Word());
- NGIDTextField.setText(setting.getNG_ID());
- // \83v\83\8d\83L\83V\8aÖ\98A
- UseProxyCheckBox.setSelected(setting.useProxy());
- ProxyTextField.setText(setting.getProxy());
- int proxy_port = setting.getProxyPort();
- if (proxy_port >= 0 && proxy_port <= 65535) {
- ProxyPortTextField.setText(Integer.toString(proxy_port));
- } else {
- ProxyPortTextField.setText("");
- }
- FixFontSizeCheckBox.setSelected(setting.isFixFontSize());
- savePanel.getFixCommentNumCheckBox().setSelected(setting.isFixCommentNum());
- OpaqueCommentCheckBox.setSelected(setting.isOpaqueComment());
- FFmpegOptionModel.reload(setting.getOptionFile());
- NotUseVhookCheckBox.setSelected(setting.isVhookDisabled());
- ShadowComboBox.setSelectedIndex(setting.getShadowIndex());
-
- // \93\8a\8de\8eÒ\83R\83\81\83\93\83g
- TcommentSetting tcom = setting.getTcommentSetting();
- savePanel.setTcommentDownload(tcom.isDownload());
- savePanel.setTcommentDelete(tcom.isDelete());
- savePanel.setTcommentAutoFileName(tcom.isAutoFileName());
- savePanel.setTcommentDirectoryName(tcom.getInputDirectory());
- savePanel.setTcommentFileName(tcom.getInputFile());
+ // \93®\89æ\90Ý\92è
+ final MovieSetting movie = setting.getMovieSetting();
+ FFmpegPathField.setText(movie.getFfmpeg().toString());
+ VhookPathField.setText(movie.getVhook().toString());
+ ExtOptionField.setText(movie.getFfmpegOption().getExtOption());
+ MainOptionField.setText(movie.getFfmpegOption().getMainOption());
+ CommandLineOutOptionField.setText(movie.getFfmpegOption().getOutOption());
+ CommandLineInOptionField.setText(movie.getFfmpegOption().getInOption());
+ FFmpegOptionModel.reload(movie.getOptionFile());
+
+ // \95Ï\8a·\90Ý\92è
+ final ConvertSetting conv = setting.getConvertSetting();
+ NotUseVhookCheckBox.setSelected(conv.isVhookDisabled());
+ ViewCommentField.setText(Integer.toString(conv.getMaxNumOfComment()));
+ FontPathField.setText(conv.getFont().toString());
+ FontIndexField.setText(Integer.toString(conv.getFontIndex()));
+ ShadowComboBox.setSelectedIndex(conv.getShadowIndex());
+ ShowConvVideoCheckBox.setSelected(conv.isShowConverting());
+ FixFontSizeCheckBox.setSelected(conv.isSelfAdjustFontSize());
+ OpaqueCommentCheckBox.setSelected(conv.isCommentOpaque());
+ NGWordTextField.setText(conv.getNgSetting().getWord());
+ NGIDTextField.setText(conv.getNgSetting().getId());
}
/**
* ActionEvent
*/
void jMenuFileExit_actionPerformed(ActionEvent actionEvent) {
- ConvertingSetting setting = this.getSetting();
- ConvertingSetting.saveSetting(setting);
+ SProperties setting = getSetting();
+ SProperties.saveSetting(setting);
System.exit(0);
}
public void DoButton_actionPerformed(ActionEvent e) {
if (Converter == null || Converter.isConverted()) {
- String url;
-
- // NicoBrowser\83t\83@\83C\83\8b\82ð\97\98\97p\82·\82é\8fê\8d\87\82Í\81A\83t\83@\83C\83\8b\96¼\82©\82ç\83r\83f\83IID\82ð\93Á\92è.
- if (videoSaveInfoPanel.getVideoUseNiBrButton().isSelected()) {
- try {
- String fileName = videoSaveInfoPanel.getNibrFileField().getText();
- NicoDBFinder finder = NicoDBFinder.getInstance();
- NicoContent info = finder.findNicoContent(fileName);
- if (info != null) {
- url = info.getNicoId();
- } else {
- url = "";
- }
- } catch (Exception ex) {
- JOptionPane.showMessageDialog(this, ex.getMessage(), "\83G\83\89\81[", JOptionPane.ERROR_MESSAGE);
- return;
+ try {
+ executeConvert();
+ } catch (Exception ex) {
+ String text = ex.getMessage();
+ if (StringUtils.isEmpty(text)) {
+ text = "\97\\8aú\82µ\82È\82¢\83G\83\89\81[\82Ì\82½\82ß\92\86\92f\82µ\82Ü\82µ\82½\81B";
}
- } else {
- url = VideoID_TextField.getText();
+ statusBar.setText(text);
}
-
- TextProgressListener sl = new TextProgressListener() {
-
- public void setText(final String text) {
- SwingUtilities.invokeLater(new Runnable() {
-
- public void run() {
- statusBar.setText(text);
- }
- });
- }
- };
-
- ConvertStopFlag.StateChangeListener scl = new ConvertStopFlag.StateChangeListener() {
-
- public void changeState(final State s) {
- SwingUtilities.invokeLater(new Runnable() {
-
- public void run() {
- switch (s) {
- case PROCESSING:
- DoButton.setText(DoButtonStopString);
- break;
- case STOPPING:
- DoButton.setText(DoButtonWaitString);
- break;
- case FINISHED:
- DoButton.setText(DoButtonDefString);
- }
- }
- });
- }
- };
-
- Converter = new Converter(url, WayBackField.getText(), this.getSetting(), sl, new ConvertStopFlag(scl));
-// new ConvertStopFlag(this.DoButton, DoButtonStopString,
-// DoButtonWaitString, DoButtonDefString));
- Converter.start();
} else { /* \8aJ\8en\82µ\82Ä\82¢\82é\82Ì\82Å\81A\83X\83g\83b\83v\82·\82é\81B */
final ConvertStopFlag flag = Converter.getStopFlag();
if (!flag.needStop()) { /* \82Ü\82¾\83X\83g\83b\83v\82µ\82Ä\82¢\82È\82¢\81B */
}
}
+ private void executeConvert() throws IOException {
+ String url;
+
+ // NicoBrowser\83t\83@\83C\83\8b\82ð\97\98\97p\82·\82é\8fê\8d\87\82Í\81A\83t\83@\83C\83\8b\96¼\82©\82ç\83r\83f\83IID\82ð\93Á\92è.
+ if (videoSaveInfoPanel.getVideoUseNiBrButton().isSelected()) {
+ try {
+ String fileName = videoSaveInfoPanel.getNibrFileField().getText();
+ NicoDBFinder finder = NicoDBFinder.getInstance();
+ NicoContent info = finder.findNicoContent(fileName);
+ if (info != null) {
+ url = info.getNicoId();
+ } else {
+ url = "";
+ }
+ } catch (Exception ex) {
+ JOptionPane.showMessageDialog(this, ex.getMessage(), "\83G\83\89\81[", JOptionPane.ERROR_MESSAGE);
+ return;
+ }
+ } else {
+ url = VideoID_TextField.getText();
+ }
+
+ TextProgressListener sl = new TextProgressListener() {
+
+ public void setText(final String text) {
+ SwingUtilities.invokeLater(new Runnable() {
+
+ public void run() {
+ statusBar.setText(text);
+ }
+ });
+ }
+ };
+
+ ConvertStopFlag.StateChangeListener scl = new ConvertStopFlag.StateChangeListener() {
+
+ public void changeState(final State s) {
+ SwingUtilities.invokeLater(new Runnable() {
+
+ public void run() {
+ switch (s) {
+ case STOPPING:
+ DoButton.setText(DoButtonWaitString);
+ break;
+ case FINISHED:
+ DoButton.setText(DoButtonDefString);
+ }
+ }
+ });
+ }
+ };
+
+ Converter = new Converter(url, WayBackField.getText(), getSetting().toProfile(), sl,
+ new ConvertStopFlag(scl));
+ DoButton.setText(DoButtonStopString);
+ new Thread(Converter).start();
+
+ }
+
/* FFmpeg\82Ö\82Ì\83p\83X */
public void SettingFFmpegPathButton_actionPerformed(ActionEvent e) {
showSaveDialog("FFmpeg\82Ö\82Ì\83p\83X", FFmpegPathField, false, false);
*/
private JComboBox getShadowComboBox() {
if (ShadowComboBox == null) {
- ShadowComboBox = new JComboBox(ConvertingSetting.ShadowKindArray);
+ ShadowComboBox = new JComboBox(SProperties.ShadowKindArray);
}
return ShadowComboBox;
}
+ private BasicSetting getBasicSetting() {
+ String mail = MailAddrField.getText();
+ String pass = String.valueOf(PasswordField.getPassword());
+ boolean proxyUse = UseProxyCheckBox.isSelected();
+ String proxyHost = ProxyTextField.getText();
+ int proxyPort;
+ try {
+ proxyPort = Integer.parseInt(ProxyPortTextField.getText());
+ } catch (NumberFormatException e) {
+ proxyPort = -1;
+ }
+ return new BasicSetting(mail, pass, proxyUse, proxyHost, proxyPort);
+ }
+
+ private InputVideoSetting getInputVideoSetting() {
+ VideoSaveKind kind;
+ if (videoSaveInfoPanel.getVideoNoSaveButton().isSelected() == true) {
+ kind = VideoSaveKind.NO_SAVE;
+ } else if (videoSaveInfoPanel.getVideoUseNiBrButton().isSelected() == true) {
+ kind = VideoSaveKind.NICOBROWSER;
+ } else {
+ kind = VideoSaveKind.SAVE;
+ }
+ boolean autoNaming = videoSaveInfoPanel.getSaveFolderRadioButton().isSelected();
+ String folder = videoSaveInfoPanel.getVideoSavedFolderField().getText();
+ String file = videoSaveInfoPanel.getVideoSavedFileField().getText();
+ boolean delete = videoSaveInfoPanel.getDelVideoCheckBox().isSelected();
+ String nibrFile = videoSaveInfoPanel.getNibrFileField().getText();
+
+ return new InputVideoSetting(kind, autoNaming, new File(folder), new File(file), delete, new File(nibrFile));
+ }
+
+ private InputCommentSetting getInputCommentSetting() {
+ boolean download = savePanel.getSavingCommentCheckBox().isSelected();
+ String file = savePanel.getCommentSavedFileField().getText();
+ int back_comment;
+ try {
+ back_comment = Integer.parseInt(savePanel.getCommentNumField().getText());
+ } catch (NumberFormatException ex) {
+ back_comment = 500;
+ }
+ boolean delete = savePanel.getDelCommentCheckBox().isSelected();
+ boolean autoNaming = savePanel.getCommentSaveFolderRadioButton().isSelected();
+ String folder = savePanel.getCommentSavedFolderField().getText();
+ boolean adjustNumOfCom = savePanel.getFixCommentNumCheckBox().isSelected();
+
+ return new InputCommentSetting(download, autoNaming, new File(folder), new File(file), delete, adjustNumOfCom,
+ back_comment);
+ }
+
/**
* \89æ\96Ê\93ü\97Í\92l\82©\82ç\93\8a\8de\8eÒ\83R\83\81\83\93\83g\90Ý\92è\82ð\8dì\90¬\82·\82é.
* @return \8dì\90¬\82µ\82½\93\8a\8de\8eÒ\83R\83\81\83\93\83g\90Ý\92è.
*/
- private TcommentSetting getTcommentSetting() {
-// TcommentSetting res;
+ private InputTcommentSetting getTcommentSetting() {
boolean down = savePanel.isTcommentDownload();
boolean del = savePanel.isTcommentDelete();
boolean naming = savePanel.isTcommentAutoFileName();
String dir = savePanel.getTcommentDirectoryName();
String f = savePanel.getTcommentFileName();
- return new TcommentSetting(down, del, naming, dir, f);
+ return new InputTcommentSetting(down, naming, dir, f, del);
+ }
+
+ private OutputVideoSetting getOutputVideoSetting() {
+ boolean process = savePanel.getSavingConvertedVideoCheckBox().isSelected();
+ boolean addComment = savePanel.getAddCommentCheckBox().isSelected();
+ boolean addTcomment = savePanel.getAddTcommentCheckBox().isSelected();
+ String file = savePanel.getConvertedVideoSavedFileField().getText();
+ boolean cutId = savePanel.getNotAddVideoIdConvVideoCheckBox().isSelected();
+ boolean autoNaming = savePanel.getConvSaveFolderRadioButton().isSelected();
+ String folder = savePanel.getConvertedVideoSavedFolderField().getText();
+
+ return new OutputVideoSetting(process, autoNaming, new File(folder), new File(file), cutId, addComment,
+ addTcomment);
+ }
+
+ private MovieSetting getMovieSetting() {
+ String ffmpeg = FFmpegPathField.getText();
+ String vhook = VhookPathField.getText();
+ String ext = ExtOptionField.getText();
+ String main = MainOptionField.getText();
+ String in = CommandLineInOptionField.getText();
+ String out = CommandLineOutOptionField.getText();
+ File optionFile = FFmpegOptionModel.getSelectedFile();
+
+ FfmpegOption opt = new FfmpegOption(ext, main, in, out);
+ return new MovieSetting(new File(ffmpeg), new File(vhook), optionFile, opt);
+ }
+
+ private ConvertSetting getConvertSetting() {
+ boolean vhookDisabled = NotUseVhookCheckBox.isSelected();
+ int maxComment = 30;
+ try {
+ maxComment = Integer.parseInt(ViewCommentField.getText());
+ } catch (NumberFormatException ex) {
+ }
+ File font = new File(FontPathField.getText());
+ int fontIndex = Integer.parseInt(FontIndexField.getText());
+ int shadowIndex = ShadowComboBox.getSelectedIndex();
+ boolean showConv = ShowConvVideoCheckBox.isSelected();
+ boolean adjustFont = FixFontSizeCheckBox.isSelected();
+ boolean commentOpaque = OpaqueCommentCheckBox.isSelected();
+ NgSetting ngSetting = new NgSetting(NGWordTextField.getText(), NGIDTextField.getText());
+
+ return new ConvertSetting(vhookDisabled, maxComment, font, fontIndex, shadowIndex, showConv, adjustFont,
+ commentOpaque, ngSetting);
}
private class InputVideoPanelButtonListener implements ActionListener {