OSDN Git Service

プロファイル編集
[coroid/inqubus.git] / frontend / src / saccubus / converter / FfmpegCommand.java
index ec5166b..d66a9bd 100644 (file)
@@ -14,14 +14,14 @@ import java.util.logging.Logger;
 import org.apache.commons.lang.StringUtils;
 import saccubus.ConvertStopFlag;
 import saccubus.conv.ConvertToVideoHook;
-import yukihane.saccubus.converter.profile.NgSetting;
-import yukihane.saccubus.converter.profile.Ffmpeg;
-import yukihane.saccubus.converter.profile.FfmpegOption;
-import yukihane.saccubus.converter.profile.GeneralSetting;
+import yukihane.saccubus.converter.profile.ConvertProfile;
+import yukihane.saccubus.converter.profile.FfmpegProfile;
+import yukihane.saccubus.converter.profile.GeneralProfile;
 import saccubus.net.TextProgressListener;
 import yukihane.mediainfowrapper.Info;
 import yukihane.mediainfowrapper.MediaInfo;
 import yukihane.mediainfowrapper.Size;
+import yukihane.saccubus.converter.profile.ConvertProfile.HideCondition;
 import yukihane.swf.Cws2Fws;
 
 /**
@@ -34,16 +34,14 @@ public class FfmpegCommand extends AbstractCommand {
     private final File tcommMiddleFile;
     private final File TMP_CWS;
     private final File commentFile;
-    private final File tcommFile;
     private final File videoFile;
     private final File convertedVideoFile;
-    private final Ffmpeg ffmpeg;
+    private final ConvertProfile ffmpeg;
 
-    FfmpegCommand(TextProgressListener listener, ConvertStopFlag flag, File commentFile, File tcommFile,
-            File videoFile, File convertedVideoFile, Ffmpeg ffmpeg, GeneralSetting general) throws IOException {
+    FfmpegCommand(TextProgressListener listener, ConvertStopFlag flag, File commentFile,
+            File videoFile, File convertedVideoFile, ConvertProfile ffmpeg, GeneralProfile general) throws IOException {
         super(listener, flag);
         this.commentFile = commentFile;
-        this.tcommFile = tcommFile;
         this.videoFile = videoFile;
         this.convertedVideoFile = convertedVideoFile;
         this.ffmpeg = ffmpeg;
@@ -71,7 +69,7 @@ public class FfmpegCommand extends AbstractCommand {
     }
 
     private boolean exec() throws InterruptedException, IOException {
-        final NgSetting ngSetting = getFfmpeg().getNgSetting();
+        final HideCondition ngSetting = getFfmpeg().getNgSetting();
         if (commentFile != null) {
             sendText("コメントの中間ファイルへの変換中");
             boolean conv = ConvertToVideoHook.convert(commentFile, commentMiddleFile, ngSetting.getId(), ngSetting.
@@ -82,20 +80,19 @@ public class FfmpegCommand extends AbstractCommand {
             }
         }
         stopFlagReturn();
-        if (tcommFile != null) {
-            sendText("投稿者コメントの中間ファイルへの変換中");
-            boolean conv = ConvertToVideoHook.convert(tcommFile, tcommMiddleFile, ngSetting.getId(), ngSetting.getWord());
-            if (!conv) {
-                sendText("コメント変換に失敗。ファイル名に使用できない文字が含まれているか正規表現の間違い?");
-                return false;
-            }
-        }
+//        if (tcommFile != null) {
+//            sendText("投稿者コメントの中間ファイルへの変換中");
+//            boolean conv = ConvertToVideoHook.convert(tcommFile, tcommMiddleFile, ngSetting.getId(), ngSetting.getWord());
+//            if (!conv) {
+//                sendText("コメント変換に失敗。ファイル名に使用できない文字が含まれているか正規表現の間違い?");
+//                return false;
+//            }
+//        }
         stopFlagReturn();
         sendText("動画の変換を開始");
         int code;
         if ((code = converting_video(videoFile, convertedVideoFile, (commentFile != null), commentMiddleFile.getPath(),
-                (tcommFile
-                != null), tcommMiddleFile.getPath(), getFfmpeg().getFfmpegOption())) == 0) {
+                false, tcommMiddleFile.getPath(), getFfmpeg().getFfmpegOption())) == 0) {
             sendText("変換が正常に終了しました。");
             return true;
         } else {
@@ -105,7 +102,7 @@ public class FfmpegCommand extends AbstractCommand {
     }
 
     private int converting_video(File videoFile, File convertedVideoFile, boolean addComment, String commPath,
-            boolean addTcomment, String tcommPath, FfmpegOption ov) throws InterruptedException, IOException {
+            boolean addTcomment, String tcommPath, FfmpegProfile ov) throws InterruptedException, IOException {
         File fwsFile = Cws2Fws.createFws(videoFile, TMP_CWS);
 
         List<String> cmdList = new ArrayList<String>();
@@ -242,7 +239,7 @@ public class FfmpegCommand extends AbstractCommand {
             sb.append("--enable-show-video");
             sb.append("|");
         }
-        if (getFfmpeg().isSelfAdjustFontSize()) {
+        if (!getFfmpeg().isDisableFontSizeArrange()) {
             sb.append("--enable-fix-font-size");
             sb.append("|");
         }
@@ -257,7 +254,7 @@ public class FfmpegCommand extends AbstractCommand {
         return sb.toString();
     }
 
-    private Ffmpeg getFfmpeg() {
+    private ConvertProfile getFfmpeg() {
         return ffmpeg;
     }
 }