OSDN Git Service

不要クラス削除, レンダラのパッケージ移動
[coroid/inqubus.git] / frontend / src / yukihane / inqubus / gui / MainFrame.java
index 213f62d..898a4e2 100644 (file)
@@ -13,9 +13,11 @@ import java.awt.datatransfer.Transferable;
 import java.awt.event.ActionEvent;
 import java.awt.event.ActionListener;
 import java.awt.event.ItemEvent;
+import java.awt.event.ItemListener;
 import java.awt.event.KeyEvent;
 import java.io.File;
 import java.io.FilenameFilter;
+import java.io.IOException;
 import java.net.URL;
 import java.util.ArrayList;
 import java.util.Collection;
@@ -41,19 +43,34 @@ import javax.swing.JTable;
 import javax.swing.JTextField;
 import javax.swing.KeyStroke;
 import javax.swing.LayoutStyle.ComponentPlacement;
+import javax.swing.SwingUtilities;
 import javax.swing.TransferHandler;
 import javax.swing.WindowConstants;
 import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang.builder.ToStringBuilder;
 import saccubus.MainFrame_AboutBox;
-import saccubus.worker.Download;
+import saccubus.util.WayBackTimeParser;
+import saccubus.worker.impl.convert.ConvertProgress;
+import saccubus.worker.impl.download.DownloadProgress;
+import saccubus.worker.WorkerListener;
+import saccubus.worker.impl.convert.ConvertResult;
+import saccubus.worker.impl.download.DownloadResult;
 import saccubus.worker.profile.CommentProfile;
+import saccubus.worker.profile.ConvertProfile;
 import saccubus.worker.profile.DownloadProfile;
+import saccubus.worker.profile.FfmpegProfile;
 import saccubus.worker.profile.GeneralProfile;
 import saccubus.worker.profile.LoginProfile;
+import saccubus.worker.profile.OutputProfile;
 import saccubus.worker.profile.ProxyProfile;
 import saccubus.worker.profile.VideoProfile;
 import yukihane.Util;
 import yukihane.inqubus.Config;
+import yukihane.inqubus.manager.RequestProcess;
+import yukihane.inqubus.manager.TaskKind;
+import yukihane.inqubus.manager.TaskManage;
+import yukihane.inqubus.manager.TaskManageListener;
+import yukihane.inqubus.manager.TaskStatus;
 import yukihane.inqubus.model.Target;
 import yukihane.inqubus.model.TargetsTableModel;
 
@@ -74,6 +91,7 @@ public class MainFrame extends JFrame {
     private static final String FILE_OUTPUTFIELD_TOOLTIP
             = "ファイル命名規則入力します。";
     private final TargetsTableModel targetModel = new TargetsTableModel();
+    private final TaskManage taskManager;
 
     /** Creates new form MainFrame */
     public MainFrame() {
@@ -88,7 +106,7 @@ public class MainFrame extends JFrame {
 
         final JPanel pnlMain = new JPanel();
         final JScrollPane scrDisplay = new JScrollPane();
-        tblDisplay = new JTable();
+        tblDisplay = new JTable(targetModel, new TargetsColumnModel());
         final JPanel pnlButton = new JPanel();
         btnStart = new JButton();
         btnStop = new JButton();
@@ -106,6 +124,18 @@ public class MainFrame extends JFrame {
         final JLabel lblComment = new JLabel();
         cbCommentLocal = new JCheckBox();
         cbCommentLocal.setToolTipText(FILE_LOCALBUTTON_TOOLTIP);
+        cbCommentLocal.addItemListener(new ItemListener() {
+
+            @Override
+            public void itemStateChanged(ItemEvent e) {
+                final boolean selected = (e.getStateChange() == ItemEvent.SELECTED);
+                cbBackLogReduce.setEnabled(!selected);
+                cbBackLog.setEnabled(!selected);
+                if(selected) {
+                    cbBackLog.setSelected(false);
+                }
+            }
+        });
         fldComment = new JTextField();
         fldComment.setToolTipText(FILE_INPUTFIELD_TOOLTIP);
         btnComment = new JButton();
@@ -120,7 +150,6 @@ public class MainFrame extends JFrame {
 
         pnlMain.setBorder(BorderFactory.createEtchedBorder());
 
-        tblDisplay.setModel(targetModel);
         tblDisplay.setDropMode(DropMode.INSERT_ROWS);
         scrDisplay.setViewportView(tblDisplay);
 
@@ -223,7 +252,13 @@ public class MainFrame extends JFrame {
                                 .addComponent(fldVideo, GroupLayout.DEFAULT_SIZE, 317, Short.MAX_VALUE)
                                 .addPreferredGap(ComponentPlacement.RELATED)
                                 .addComponent(btnVideo))
-                            .addComponent(fldId, GroupLayout.PREFERRED_SIZE, 100, GroupLayout.PREFERRED_SIZE)
+                            .addGroup(gl_pnlInputMain.createSequentialGroup()
+                                .addComponent(fldId, GroupLayout.PREFERRED_SIZE, 100, GroupLayout.PREFERRED_SIZE)
+                                .addPreferredGap(ComponentPlacement.UNRELATED)
+                                .addComponent(cbBackLogReduce)
+                                .addComponent(cbBackLog)
+                                .addComponent(fldBackLog, GroupLayout.PREFERRED_SIZE, 150, GroupLayout.PREFERRED_SIZE)
+                            )
                             .addGroup(Alignment.TRAILING, gl_pnlInputMain.createSequentialGroup()
                                 .addGroup(gl_pnlInputMain.createParallelGroup(Alignment.TRAILING)
                                     .addGroup(Alignment.LEADING, gl_pnlInputMain.createSequentialGroup()
@@ -245,7 +280,11 @@ public class MainFrame extends JFrame {
                 .addContainerGap()
                 .addGroup(gl_pnlInputMain.createParallelGroup(Alignment.BASELINE)
                     .addComponent(fldId, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
-                    .addComponent(lblId))
+                    .addComponent(lblId)
+                    .addComponent(cbBackLogReduce)
+                    .addComponent(cbBackLog)
+                    .addComponent(fldBackLog)
+                )
                 .addPreferredGap(ComponentPlacement.RELATED)
                 .addGroup(gl_pnlInputMain.createParallelGroup(Alignment.BASELINE)
                     .addComponent(lblVideo)
@@ -311,16 +350,39 @@ public class MainFrame extends JFrame {
         initInputPanel();
         pnlMain.setTransferHandler(new DownloadListTransferHandler());
         tblDisplay.setTransferHandler(new TableTransferHandler());
+
+        final Config p = Config.INSTANCE;
+        // TODO コンフィグからスレッド数
+        taskManager = new TaskManage(1, 1, new GuiTaskManageListener());
+    }
+
+    private class GuiTaskManageListener implements TaskManageListener {
+
+        @Override
+        public void process(final int id, final TaskKind kind, final TaskStatus status, final double percentage,
+                final String message) {
+            SwingUtilities.invokeLater(new Runnable() {
+
+                @Override
+                public void run() {
+                    targetModel.setStatus(id, kind, status, percentage, message);
+                }
+            });
+        }
     }
 
     private class ApplyActionListener implements ActionListener {
 
         @Override
         public void actionPerformed(ActionEvent e) {
-            final DownloadProfile prof = new InqubusDownloadProfile();
+            final DownloadProfile downProf = new InqubusDownloadProfile();
             final String id = Util.getVideoId(fldId.getText());
-
-            new Download(prof, id).execute();
+            final InqubusConvertProfile convProf = new InqubusConvertProfile();
+            logger.log(Level.INFO, downProf.toString());
+            logger.log(Level.INFO, convProf.toString());
+            final RequestProcess rp = new RequestProcess(downProf, id, convProf);
+            taskManager.add(rp);
+            targetModel.addTarget(new Target(rp));
         }
     }
     /** This method is called from within the constructor to
@@ -333,7 +395,7 @@ public class MainFrame extends JFrame {
     private void initComponents() {
     }// </editor-fold>//GEN-END:initComponents
 
-    private File searchFileMatchId(final File dir, final String id) throws UnsupportedOperationException {
+    private File searchFileMatchId(final File dir, final String id) {
         // TODO 候補は複数返すようにして、その後の対処は呼び出しもとで行ってもらった方が良いかも
         if (id.isEmpty()) {
             return null;
@@ -391,6 +453,9 @@ public class MainFrame extends JFrame {
             text = p.getVideoFileNamePattern();
         }
         field.setText(text);
+
+        fldId.setEnabled(!(cbVideoLocal.isSelected() && cbCommentLocal.isSelected()));
+
     }//GEN-LAST:event_useMovieLocalCheckBoxItemStateChanged
 
     private void outputConvertCheckBoxItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_outputConvertCheckBoxItemStateChanged
@@ -430,6 +495,9 @@ public class MainFrame extends JFrame {
     private final JButton btnDeselect;
     //入力領域 - 標準
     private final JTextField fldId;
+    private final JCheckBox cbBackLogReduce = new JCheckBox("コメ数減少");
+    private final JCheckBox cbBackLog = new JCheckBox("過去ログ");
+    private final JTextField fldBackLog = new JTextField();
     private final JCheckBox cbVideoLocal;
     private final JTextField fldVideo;
     private final JButton btnVideo;
@@ -443,9 +511,21 @@ public class MainFrame extends JFrame {
     // End of variables declaration//GEN-END:variables
 
     private void initInputPanel() {
+        final Config p = Config.INSTANCE;
+
         fldId.setText("");
+        fldBackLog.setEnabled(false);
+        fldBackLog.setToolTipText("YYYY/MM/DD hh:mm:ss形式、あるいは1970/01/01からの経過秒を入力します。");
+        cbBackLog.setEnabled(true);
+        cbBackLog.addItemListener(new ItemListener() {
 
-        final Config p = Config.INSTANCE;
+            @Override
+            public void itemStateChanged(ItemEvent e) {
+                final boolean selected = (e.getStateChange() == ItemEvent.SELECTED);
+                fldBackLog.setEnabled(selected);
+            }
+        });
+        cbBackLogReduce.setToolTipText("「コメントの量を減らす」場合はチェックを付けます。");
 
         final boolean movieLocal = p.getVideoUseLocal();
         cbVideoLocal.setSelected(movieLocal);
@@ -522,6 +602,54 @@ public class MainFrame extends JFrame {
         return menuBar;
     }
 
+    private class DownloadProgressListener implements WorkerListener<DownloadResult, DownloadProgress> {
+
+        @Override
+        public void process(DownloadProgress progress) {
+            throw new UnsupportedOperationException("Not supported yet.");
+        }
+
+        @Override
+        public void cancelled() {
+            throw new UnsupportedOperationException("Not supported yet.");
+        }
+
+        @Override
+        public void done(DownloadResult result) {
+            throw new UnsupportedOperationException("Not supported yet.");
+        }
+
+        @Override
+        public void error(Throwable th) {
+            throw new UnsupportedOperationException("Not supported yet.");
+        }
+    }
+
+    private class ConvertProgressListener implements WorkerListener<ConvertResult, ConvertProgress> {
+
+        @Override
+        public void process(ConvertProgress progress) {
+            throw new UnsupportedOperationException("Not supported yet.");
+        }
+
+        @Override
+        public void cancelled() {
+            throw new UnsupportedOperationException("Not supported yet.");
+        }
+
+        @Override
+        public void done(ConvertResult result) {
+            throw new UnsupportedOperationException("Not supported yet.");
+        }
+
+        @Override
+        public void error(Throwable th) {
+            throw new UnsupportedOperationException("Not supported yet.");
+        }
+    }
+
+
+
     private class DownloadListTransferHandler extends TransferHandler {
 
         private static final long serialVersionUID = 1L;
@@ -539,30 +667,32 @@ public class MainFrame extends JFrame {
 
         @Override
         public boolean importData(TransferHandler.TransferSupport support) {
-            try {
-                Transferable transferable = support.getTransferable();
-                if (transferable.isDataFlavorSupported(DataFlavor.javaFileListFlavor)) {
-                    @SuppressWarnings("unchecked")
-                    final List<File> data = (List<File>) transferable.getTransferData(DataFlavor.javaFileListFlavor);
-                    Collection<Target> targets = Target.from(data);
-                    targetModel.addTarget(targets);
-                } else if (transferable.isDataFlavorSupported(DataFlavor.stringFlavor)) {
-                    String data = (String) transferable.getTransferData(DataFlavor.stringFlavor);
-                    Matcher matcher = movieIdPattern.matcher(data);
-                    if (matcher.find()) {
-                        String movieId = matcher.group(1);
-                        Target target = Target.fromId(movieId);
-                        targetModel.addTarget(target);
-                    } else {
-                        return false;
-                    }
-
-                }
-                return false;
-            } catch (Exception e) {
-                logger.log(Level.SEVERE, null, e);
-                return false;
-            }
+//            try {
+//                Transferable transferable = support.getTransferable();
+//                if (transferable.isDataFlavorSupported(DataFlavor.javaFileListFlavor)) {
+//                    @SuppressWarnings("unchecked")
+//                    final List<File> data = (List<File>) transferable.getTransferData(DataFlavor.javaFileListFlavor);
+//                    Collection<Target> targets = Target.from(data);
+//                    targetModel.addTarget(targets);
+//                } else if (transferable.isDataFlavorSupported(DataFlavor.stringFlavor)) {
+//                    String data = (String) transferable.getTransferData(DataFlavor.stringFlavor);
+//                    Matcher matcher = movieIdPattern.matcher(data);
+//                    if (matcher.find()) {
+//                        String movieId = matcher.group(1);
+//                        Target target = Target.fromId(movieId);
+//                        targetModel.addTarget(target);
+//                    } else {
+//                        return false;
+//                    }
+//
+//                }
+//                return false;
+//            } catch (Exception e) {
+//                logger.log(Level.SEVERE, null, e);
+//                return false;
+//            }
+            // TODO 上記実装見直し(Locationは削除された)
+            return false;
         }
     }
 
@@ -581,6 +711,9 @@ public class MainFrame extends JFrame {
         }
     }
 
+    /*
+     * ここからDownloadProfile作成用クラスの定義
+     */
 
     private class InqubusDownloadProfile implements DownloadProfile {
 
@@ -622,6 +755,11 @@ public class MainFrame extends JFrame {
         public GeneralProfile getGeneralProfile() {
             return this.generalProfile;
         }
+
+        @Override
+        public String toString(){
+            return ToStringBuilder.reflectionToString(this);
+        }
     }
 
     private class InqubusLoginProfile implements LoginProfile {
@@ -643,6 +781,11 @@ public class MainFrame extends JFrame {
         public String getPassword() {
             return this.password;
         }
+
+        @Override
+        public String toString(){
+            return ToStringBuilder.reflectionToString(this);
+        }
     }
 
     private class InqubusProxyProfile implements ProxyProfile {
@@ -672,6 +815,11 @@ public class MainFrame extends JFrame {
         public int getPort() {
             return this.port;
         }
+
+        @Override
+        public String toString(){
+            return ToStringBuilder.reflectionToString(this);
+        }
     }
 
     private class InqubusVideoProfile implements VideoProfile {
@@ -681,11 +829,11 @@ public class MainFrame extends JFrame {
         private final File localFile;
 
         private InqubusVideoProfile(){
+            final Config p = Config.INSTANCE;
             this.download = !cbVideoLocal.isSelected();
             if (this.download) {
-                this.dir = new File(fldVideo.getText());
-                // TODO ディレクトリとファイル名の入力欄を分ける
-                this.fileName = "{id}_{title}";
+                this.dir = new File(p.getVideoDir());
+                this.fileName = fldVideo.getText();
                 this.localFile = null;
             } else {
                 this.dir = null;
@@ -713,70 +861,397 @@ public class MainFrame extends JFrame {
         public File getLocalFile() {
             return this.localFile;
         }
+
+        @Override
+        public String toString(){
+            return ToStringBuilder.reflectionToString(this);
+        }
     }
 
     private class InqubusCommentProfile implements CommentProfile {
+        private final boolean download;
+        private final File dir;
+        private final String fileName;
+        private final File localFile;
+        private final int lengthRelatedCommentSize;
+        private final boolean disablePerMinComment;
+        private final int perMinCommentSize;
+        private final long backLogPoint;
+
+        private InqubusCommentProfile() {
+            final Config p = Config.INSTANCE;
+            this.download = !cbVideoLocal.isSelected();
+            if (this.download) {
+                this.dir = new File(p.getVideoDir());
+                this.fileName = fldVideo.getText();
+                this.localFile = null;
+            } else {
+                this.dir = null;
+                this.fileName = null;
+                this.localFile = new File(fldVideo.getText());
+            }
+
+            if(cbBackLog.isSelected()) {
+                try {
+                    this.backLogPoint = WayBackTimeParser.parse(fldBackLog.getText());
+                } catch (IOException ex) {
+                    throw new IllegalArgumentException("過去ログ時刻指定が誤っています。", ex);
+                }
+            } else {
+                this.backLogPoint = -1L;
+            }
+
+            this.disablePerMinComment = cbBackLogReduce.isSelected();
+            this.lengthRelatedCommentSize
+                    = (p.getCommentSizeAutosize()) ? -1 : Integer.parseInt(p.getCommentSizeManual());
+            this.perMinCommentSize
+                    = (p.getCommentMinSizeAutosize()) ? -1 : Integer.parseInt(p.getCommentMinSizeManual());
+        }
+
+        @Override
+        public boolean isDownload() {
+            return this.download;
+        }
+
+        @Override
+        public File getDir() {
+            return this.dir;
+        }
+
+        @Override
+        public String getFileName() {
+            return this.fileName;
+        }
+
+        @Override
+        public File getLocalFile() {
+            return this.localFile;
+        }
 
         @Override
         public int getLengthRelatedCommentSize() {
-            throw new UnsupportedOperationException("Not supported yet.");
+            return this.lengthRelatedCommentSize;
         }
 
         @Override
         public boolean isDisablePerMinComment() {
-            throw new UnsupportedOperationException("Not supported yet.");
+            return this.disablePerMinComment;
         }
 
         @Override
         public int getPerMinCommentSize() {
-            throw new UnsupportedOperationException("Not supported yet.");
+            return this.perMinCommentSize;
         }
 
         @Override
         public long getBackLogPoint() {
-            throw new UnsupportedOperationException("Not supported yet.");
+            return this.backLogPoint;
         }
 
         @Override
-        public boolean isDownload() {
-            throw new UnsupportedOperationException("Not supported yet.");
+        public String toString(){
+            return ToStringBuilder.reflectionToString(this);
+        }
+    }
+
+    private class InqubusGeneralProfile implements GeneralProfile {
+        private final String replaceFrom;
+        private final String replaceTo;
+        private InqubusGeneralProfile() {
+            final Config p = Config.INSTANCE;
+            this.replaceFrom = p.getReplaceFrom();
+            this.replaceTo = p.getReplaceTo();
+        }
+
+        @Override
+        public String getReplaceFrom() {
+            return this.replaceFrom;
+        }
+
+        @Override
+        public String getReplaceTo() {
+            return this.replaceTo;
+        }
+
+        @Override
+        public String toString(){
+            return ToStringBuilder.reflectionToString(this);
+        }
+    }
+
+    /*
+     * ここからConvertProfile作成用クラスの定義
+     */
+    private class InqubusConvertProfile implements ConvertProfile {
+        private final OutputProfile outputProfile;
+        private final GeneralProfile generalProfile;
+        private final FfmpegProfile ffmpegProfile;
+        private final boolean convert;
+        private final File ffmpeg;
+        private final boolean vhookDisabled;
+        private final boolean commentOverlay;
+        private final File vhook;
+        private final File tmpDir;
+        private final File font;
+        private final int fontIndex;
+        private final boolean commentOpaque;
+        private final boolean disableFontSizeArrange;
+        private final int shadowIndex;
+        private final boolean showConvrting;
+        private final int maxNumOfComment;
+        private final HideCondition ngSetting;
+
+        private InqubusConvertProfile() {
+            final Config p = Config.INSTANCE;
+            this.outputProfile = new InqubusOutputProfile();
+            this.generalProfile = new InqubusGeneralProfile();
+            this.ffmpegProfile = new InqubusFfmpegProfile();
+            this.convert = cbOutputEnable.isSelected();
+            this.ffmpeg = new File(p.getFfmpegPath());
+            // TODO コンフィグに設定なし
+            this.vhookDisabled = false;
+            this.commentOverlay = p.getOutputCommentOverlay();
+            this.vhook = new File(p.getFfmpegDllPath());
+            // TODO コンフィグに設定なし
+            this.tmpDir = new File(".");
+            this.font = new File(p.getFontPath());
+            this.fontIndex = Integer.parseInt(p.getFontIndex());
+            this.commentOpaque = p.getCommentOpaque();
+            this.disableFontSizeArrange = p.getFontSizeArrangeDisable();
+            this.shadowIndex = p.getFontShadow();
+            // TODO コンフィグに設定なし
+            this.showConvrting = true;
+            this.maxNumOfComment = (p.getCommentDisplaySizeDefault()) ? -1 : Integer.parseInt(p.
+                    getCommentDisplaySizeManual());
+            this.ngSetting = new InqubusHideCondition();
+        }
+
+        @Override
+        public OutputProfile getOutputProfile() {
+            return this.outputProfile;
+        }
+
+        @Override
+        public GeneralProfile getGeneralProfile() {
+            return this.generalProfile;
+        }
+
+        @Override
+        public FfmpegProfile getFfmpegOption() {
+            return this.ffmpegProfile;
+        }
+
+        @Override
+        public boolean isConvert() {
+            return this.convert;
+        }
+
+        @Override
+        public File getFfmpeg() {
+            return this.ffmpeg;
+        }
+
+        @Override
+        public boolean isVhookDisabled() {
+            return this.vhookDisabled;
+        }
+
+        @Override
+        public boolean isCommentOverlay() {
+            return this.commentOverlay;
+        }
+
+        @Override
+        public File getVhook() {
+            return this.vhook;
+        }
+
+        @Override
+        public File getTempDir() {
+            return this.tmpDir;
+        }
+
+        @Override
+        public File getFont() {
+            return this.font;
+        }
+
+        @Override
+        public int getFontIndex() {
+            return this.fontIndex;
+        }
+
+        @Override
+        public boolean isCommentOpaque() {
+            return this.commentOpaque;
+        }
+
+        @Override
+        public boolean isDisableFontSizeArrange() {
+            return this.disableFontSizeArrange;
+        }
+
+        @Override
+        public int getShadowIndex() {
+            return this.shadowIndex;
+        }
+
+        @Override
+        public boolean isShowConverting() {
+            return this.showConvrting;
+        }
+
+        @Override
+        public int getMaxNumOfComment() {
+            return this.maxNumOfComment;
+        }
+
+        @Override
+        public HideCondition getNgSetting() {
+            return this.ngSetting;
+        }
+
+        @Override
+        public String toString(){
+            return ToStringBuilder.reflectionToString(this);
+        }
+    }
+
+    private class InqubusOutputProfile implements OutputProfile {
+        private final File dir;
+        private final String fileName;
+        private final String videoId;
+        private final String title;
+
+
+        private InqubusOutputProfile(){
+            final Config p = Config.INSTANCE;
+            this.dir = new File(p.getOutputDir());
+            this.fileName = fldOutput.getText();
+            // TODO この時点でのID/Titleはどうするか…
+            this.videoId = "";
+            this.title = "";
         }
 
         @Override
         public File getDir() {
-            throw new UnsupportedOperationException("Not supported yet.");
+            return this.dir;
         }
 
         @Override
         public String getFileName() {
-            throw new UnsupportedOperationException("Not supported yet.");
+            return this.fileName;
         }
 
         @Override
-        public File getLocalFile() {
-            throw new UnsupportedOperationException("Not supported yet.");
+        public String getVideoId() {
+            return this.videoId;
         }
 
+        @Override
+        public String getTitile() {
+            return this.title;
+        }
+
+        @Override
+        public String toString(){
+            return ToStringBuilder.reflectionToString(this);
+        }
     }
 
-    private class InqubusGeneralProfile implements GeneralProfile {
-//        private final String replaceFrom;
-        private InqubusGeneralProfile() {
+    private class InqubusFfmpegProfile implements FfmpegProfile {
+        private final String extOption;
+        private final String inOption;
+        private final String mainOption;
+        private final String outOption;
+        private final String avOption;
+        private final boolean resize;
+        private final int resizeWidth;
+        private final int resizeHeight;
+        private final boolean adjustRatio;
+
+        private InqubusFfmpegProfile() {
+            // TODO FFMPEGオプションは、後でメイン画面でも設定できるようにするかも
             final Config p = Config.INSTANCE;
-            // TODO 置換文字設定コンフィグが無い
-//            this.replaceFrom = p.get
+            this.extOption = p.getFfmpegExtension();
+            this.inOption = p.getFfmpegInOption();
+            this.mainOption = p.getFfmpegMainOption();
+            this.outOption = p.getFfmpegOutOption();
+            this.avOption = p.getFfmpegAvOption();
+            this.resize = p.getFfmpegResizeEnable();
+            this.resizeWidth = Integer.parseInt(p.getFfmpegResizeWidth());
+            this.resizeHeight = Integer.parseInt(p.getFfmpegResizeHeight());
+            this.adjustRatio = p.getFfmpegKeepAspect();
         }
 
         @Override
-        public String getReplaceFrom() {
-//            return this.replaceFrom;
-            throw new UnsupportedOperationException("Not supported yet.");
+        public String getExtOption() {
+            return this.extOption;
         }
 
         @Override
-        public String getReplaceTo() {
-            throw new UnsupportedOperationException("Not supported yet.");
+        public String getInOption() {
+            return this.inOption;
+        }
+
+        @Override
+        public String getMainOption() {
+            return this.mainOption;
+        }
+
+        @Override
+        public String getOutOption() {
+            return this.outOption;
+        }
+
+        @Override
+        public String getAvfilterOption() {
+            return this.avOption;
+        }
+
+        @Override
+        public boolean isResize() {
+            return this.resize;
+        }
+
+        @Override
+        public int getResizeWidth() {
+            return this.resizeWidth;
+        }
+
+        @Override
+        public int getResizeHeight() {
+            return this.resizeHeight;
         }
 
+        @Override
+        public boolean isAdjustRatio() {
+            return this.adjustRatio;
+        }
+
+        @Override
+        public String toString(){
+            return ToStringBuilder.reflectionToString(this);
+        }
+    }
+
+    private class InqubusHideCondition implements ConvertProfile.HideCondition{
+
+        @Override
+        public String getWord() {
+            // TODO
+            return "";
+        }
+
+        @Override
+        public String getId() {
+            // TODO
+            return "";
+        }
+
+        @Override
+        public String toString(){
+            return ToStringBuilder.reflectionToString(this);
+        }
     }
 }