import java.io.IOException;
import java.io.FileOutputStream;
import java.io.FileInputStream;
+import java.util.logging.Level;
+import java.util.logging.Logger;
import saccubus.VideoSaveKind;
-import saccubus.converter.filegetter.LoginInfo;
-import saccubus.converter.profile.CommentGetInfo;
-import saccubus.converter.profile.Ffmpeg;
-import saccubus.converter.profile.FfmpegOption;
-import saccubus.converter.profile.GeneralSetting;
-import saccubus.converter.profile.InputFileSetting;
-import saccubus.converter.profile.OutputFileSetting;
-import saccubus.converter.profile.Profile;
-import saccubus.converter.profile.Proxy;
-import saccubus.converter.profile.SFile;
+import saccubus.converter.classic.profile.LoginInfo;
+import saccubus.converter.classic.profile.CommentGetInfo;
+import saccubus.converter.classic.profile.Ffmpeg;
+import saccubus.converter.classic.profile.FfmpegOption;
+import saccubus.converter.classic.profile.GeneralSetting;
+import saccubus.converter.classic.profile.InputFileSetting;
+import saccubus.converter.classic.profile.OutputFileSetting;
+import saccubus.converter.classic.profile.Profile;
+import saccubus.converter.classic.profile.Proxy;
+import saccubus.converter.classic.profile.SFile;
/**
* <p>
- * \83^\83C\83g\83\8b: \82³\82«\82ã\82Î\82·
+ * タイトル: さきゅばす
* </p>
- *
+ *
* <p>
- * \90à\96¾: \83j\83R\83j\83R\93®\89æ\82Ì\93®\89æ\82ð\83R\83\81\83\93\83g\82Â\82«\82Å\95Û\91¶
+ * 説明: ニコニコ動画の動画をコメントつきで保存
* </p>
- *
+ *
* <p>
- * \92\98\8dì\8c : Copyright (c) 2007 PSI
+ * 著作権: Copyright (c) 2007 PSI
* </p>
- *
+ *
* <p>
- * \89ï\8eÐ\96¼:
+ * 会社名:
* </p>
- *
- * @author \96¢\93ü\97Í
+ *
+ * @author 未入力
* @version 1.0
*/
public class SProperties {
private static final String PROP_FILE = "./saccubus.xml";
public static final String[] ShadowKindArray = {
- "00:\82È\82µ",
- "01:\83j\83R\83j\83R\93®\89æ\95\97",
- "02:\89E\89º",
- "03:\88Í\82¢\8d\9e\82Ý"
+ "00:なし",
+ "01:ニコニコ動画風",
+ "02:右下",
+ "03:囲い込み"
};
private final BasicSetting basicSetting;
private final InputVideoSetting inputVideoSetting;
private InputFileSetting buildVideoSetting() {
final InputVideoSetting setting = getInputVideoSetting();
- // Nicobrowser\83_\83E\83\93\83\8d\81[\83h\83t\83@\83C\83\8b\82Ì\8fê\8d\87\82Í\8fí\82É\83t\83@\83C\83\8b\8ew\92è.
+ // Nicobrowserダウンロードファイルの場合は常にファイル指定.
final boolean isFile = (!setting.isAutoNaming() || setting.getProcessKind() == VideoSaveKind.NICOBROWSER);
File video;
if (setting.getProcessKind() == VideoSaveKind.NICOBROWSER) {
- video = setting.getFile();
+ video = setting.getNicoBrowserFile();
} else {
if (setting.isAutoNaming()) {
video = setting.getFolder();
}
}
final SFile videoFile = new SFile(isFile, video);
- // Nicobrowser\83_\83E\83\93\83\8d\81[\83h\83t\83@\83C\83\8b\82Í\8dí\8f\9c\91Î\8fÛ\82É\82È\82ç\82È\82¢.
+ // Nicobrowserダウンロードファイルは削除対象にならない.
boolean delete = setting.isDeleteAfterConvert() && (setting.getProcessKind() != VideoSaveKind.NICOBROWSER);
- return new InputFileSetting(videoFile, (setting.getProcessKind() == VideoSaveKind.SAVE), delete);
+ return new InputFileSetting(videoFile, (setting.getProcessKind() == VideoSaveKind.SAVE), delete,
+ buildCommentGetInfo(), inputCommentSetting.getBackLogPoint());
}
private InputFileSetting buildCommentSetting() {
private CommentGetInfo buildCommentGetInfo() {
final InputCommentSetting setting = getInputCommentSetting();
- return new CommentGetInfo(setting.isSelfAdjustNumOfComment(), setting.getNumOfComment());
+ return new CommentGetInfo(setting.isSelfAdjustNumOfComment(), setting.getNumOfComment(), setting.
+ isReduceComment());
}
private InputFileSetting buildTcommentSetting() {
private InputFileSetting createCommentSetting(saccubus.properties.InputFileSetting<Boolean> setting) {
SFile file = createSFile(setting);
- return new InputFileSetting(file, setting.getProcessKind().booleanValue(), setting.isDeleteAfterConvert());
+ return new InputFileSetting(file, setting.getProcessKind().booleanValue(), setting.isDeleteAfterConvert(),
+ buildCommentGetInfo(), inputCommentSetting.getBackLogPoint());
}
try {
fo = FfmpegOption.load(movie.getOptionFile());
} catch (IOException ex) {
- throw new IOException("\83I\83v\83V\83\87\83\93\83t\83@\83C\83\8b\82Ì\8f\91\8e®\82ª\8cë\82Á\82Ä\82¢\82Ü\82·\81F" + movie.getOptionFile().getName(), ex);
+ throw new IOException("オプションファイルの書式が誤っています:" + movie.getOptionFile().getName(), ex);
}
}
try {
prop.storeToXML(new FileOutputStream(PROP_FILE), "settings");
} catch (IOException ex) {
- ex.printStackTrace();
+ Logger.getLogger(SProperties.class.getName()).log(Level.SEVERE, "コンフィグファイルの保存に失敗", ex);
}
}
try {
prop.loadFromXML(new FileInputStream(PROP_FILE));
} catch (IOException ex) {
- ex.printStackTrace();
+ Logger.getLogger(SProperties.class.getName()).log(Level.INFO, "コンフィグファイルが存在しないため自動生成します", ex);
}
return new SProperties(