resizeHeigitField.setEnabled(resizable);
adjustRatioCheckBox.setEnabled(resizable);
- boolean adjustable = (adjustRatioCheckBox.isEnabled() && adjustRatioCheckBox.isSelected());
- paddingCheckBox.setEnabled(adjustable);
}
private void setNames() {
.addComponent(adjustRatioCheckBox))
.addGroup(layout.createSequentialGroup()
.addGap(20)
- .addComponent(paddingCheckBox))
+ )
);
layout.setVerticalGroup(layout.createSequentialGroup()
.addComponent(resizeHeightLabel)
.addComponent(resizeHeigitField))
.addComponent(adjustRatioCheckBox)
- .addComponent(paddingCheckBox)));
+ )
+ );
resizeCheckBox.addActionListener(ffmpegOptionCheckBoxListener);
adjustRatioCheckBox.addActionListener(ffmpegOptionCheckBoxListener);
- paddingCheckBox.addActionListener(ffmpegOptionCheckBoxListener);
setFFMpegOptionCheckbox();
resizeWidthField.setText(Integer.toString(movie.getFfmpegOption().getResizeWidth()));
resizeHeigitField.setText(Integer.toString(movie.getFfmpegOption().getResizeHeight()));
adjustRatioCheckBox.setSelected(movie.getFfmpegOption().isAdjustRatio());
- paddingCheckBox.setSelected(movie.getFfmpegOption().isPadding());
FFmpegOptionModel.reload(movie.getOptionFile());
// 変換設定
private final JLabel resizeHeightLabel = new JLabel("縦");
private final JTextField resizeHeigitField = new NumberFormattedTextField();
private final JCheckBox adjustRatioCheckBox = new JCheckBox("アスペクト比を維持");
- private final JCheckBox paddingCheckBox = new JCheckBox("黒幕を付与");
// FFmpegの設定 ここまで
private JLabel FontIndexLabel = new JLabel();
private JTextField fontIndexField = new JTextField();
resizeWidthField.setEnabled(enable);
resizeHeigitField.setEditable(enable);
adjustRatioCheckBox.setEnabled(enable);
- paddingCheckBox.setEnabled(enable);
}
});
}
String width = resizeWidthField.getText();
String height = resizeHeigitField.getText();
boolean adjust = adjustRatioCheckBox.isSelected();
- boolean pad = paddingCheckBox.isSelected();
File optionFile = FFmpegOptionModel.getSelectedFile();
- FfmpegOption opt = new FfmpegOption(ext, main, in, out, avfilter, resize, width, height, adjust, pad);
+ FfmpegOption opt = new FfmpegOption(ext, main, in, out, avfilter, resize, width, height, adjust);
return new MovieSetting(new File(ffmpeg), new File(vhook), optionFile, opt);
}
private final int resizeWidth;
private final int resizeHeight;
private final boolean adjustRatio;
- private final boolean padding;
public static FfmpegOption load(File file) throws IOException {
Properties prop = new Properties();
String width = prop.getProperty("WIDTH", "");
String height = prop.getProperty("HEIGHT", "");
boolean adjust = Boolean.getBoolean(prop.getProperty("ADJST_RATIO", "true"));
- boolean pad = Boolean.getBoolean(prop.getProperty("ADJST_RATIO", "false"));
if (StringUtils.isBlank(ext)) {
throw new IOException("変換オプションファイル書式誤り ext: "
+ ext + ", main: " + main + ", in: " + in + ", out: " + out + ", avfilter: " + avfilter);
}
- return new FfmpegOption(ext, main, in, out, avfilter, resize, width, height, adjust, pad);
+ return new FfmpegOption(ext, main, in, out, avfilter, resize, width, height, adjust);
}
public FfmpegOption(String extOption, String mainOption, String inOption, String outOption, String avfilterOption,
- boolean resize, String width, String height, boolean adjust, boolean pad) {
+ boolean resize, String width, String height, boolean adjust) {
this.extOption = (extOption.startsWith(".")) ? extOption : "." + extOption;
this.mainOption = mainOption;
this.inOption = inOption;
this.resizeWidth = (width.isEmpty()) ? 0 : Integer.parseInt(width);
this.resizeHeight = (height.isEmpty()) ? 0 : Integer.parseInt(height);
this.adjustRatio = adjust;
- this.padding = pad;
}
public boolean isAdjustRatio() {
return adjustRatio;
}
-
- public boolean isPadding() {
- return padding;
- }
-
}
Ffmpeg ffmpeg = p.getFfmpeg();
FfmpegOption newFfmpegOption = new FfmpegOption(ffmpeg.getFfmpegOption().getExtOption(), "", "", ff, "", false,
- "", "", false, false);
+ "", "", false);
InputFileSetting newVideoSetting = new InputFileSetting(new SFile(true, new File(video)), false, false);
InputFileSetting newCommentSetting = new InputFileSetting(new SFile(true, new File(comm)), false, false);
InputFileSetting newTcommentSetting = new InputFileSetting(new SFile(true, new File(tcomm)), false, false);
private static final String PROP_RESIZE_WIDTH = "CMD_RESIZE_WIDTH";
private static final String PROP_RESIZE_HEIGHT = "CMD_RESIZE_HEIGHT";
private static final String PROP_ADJUST_RATIO = "CMD_ADJUST_RATIO";
- private static final String PROP_PADDING = "CMD_PADDING";
private final File ffmpeg;
private final File vhook;
private final File optionFile;
prop.setProperty(PROP_RESIZE_WIDTH, Integer.toString(getFfmpegOption().getResizeWidth()));
prop.setProperty(PROP_RESIZE_HEIGHT, Integer.toString(getFfmpegOption().getResizeHeight()));
prop.setProperty(PROP_ADJUST_RATIO, Boolean.toString(getFfmpegOption().isAdjustRatio()));
- prop.setProperty(PROP_PADDING, Boolean.toString(getFfmpegOption().isPadding()));
if (getOptionFile() != null) {
prop.setProperty(PROP_OPTION_FILE, getOptionFile().getPath());
} else {
String width = prop.getProperty(PROP_RESIZE_WIDTH, "512");
String height = prop.getProperty(PROP_RESIZE_HEIGHT, "384");
boolean adjust = Boolean.getBoolean(prop.getProperty(PROP_ADJUST_RATIO, "false"));
- boolean pad = Boolean.getBoolean(prop.getProperty(PROP_PADDING, "false"));
- FfmpegOption opt = new FfmpegOption(ext, main, in, out, avfilter, resize, width, height, adjust, pad);
+ FfmpegOption opt = new FfmpegOption(ext, main, in, out, avfilter, resize, width, height, adjust);
return new MovieSetting(new File(ffmpeg), new File(vhook), optionFile, opt);
}