OSDN Git Service

テストコード実装
authoryukihane <yukihane.feather@gmail.com>
Mon, 22 Aug 2011 22:41:27 +0000 (07:41 +0900)
committeryukihane <yukihane.feather@gmail.com>
Mon, 22 Aug 2011 22:41:27 +0000 (07:41 +0900)
frontend/src/saccubus/worker/TestFrame.java

index 8f5a06e..e2f2848 100644 (file)
@@ -46,13 +46,21 @@ public class TestFrame extends JFrame {
         GroupLayout lo = new GroupLayout(panel);
         panel.setLayout(lo);
 
-        lo.setHorizontalGroup(lo.createParallelGroup().addGroup(lo.createSequentialGroup().addComponent(fldVideoId).
-                addComponent(btnDownload)).addGroup(lo.createSequentialGroup().addComponent(fldStatus).addComponent(
-                btnCancel)));
-
-        lo.setVerticalGroup(lo.createSequentialGroup().addGroup(lo.createParallelGroup().addComponent(fldVideoId).
-                addComponent(btnDownload)).addGroup(lo.createParallelGroup().addComponent(fldStatus).addComponent(
-                btnCancel)));
+        lo.setHorizontalGroup(lo.createParallelGroup()
+                .addGroup(lo.createSequentialGroup()
+                    .addComponent(fldVideoId).addComponent(btnDownload))
+                .addGroup(lo.createSequentialGroup()
+                    .addComponent(fldStatus).addComponent(btnCancel))
+                .addGroup(lo.createSequentialGroup()
+                    .addComponent(btnConv).addComponent(btnConvCancel)));
+
+        lo.setVerticalGroup(lo.createSequentialGroup()
+                .addGroup(lo.createParallelGroup()
+                    .addComponent(fldVideoId).addComponent(btnDownload))
+                .addGroup(lo.createParallelGroup()
+                    .addComponent(fldStatus).addComponent(btnCancel))
+                .addGroup(lo.createParallelGroup()
+                    .addComponent(btnConv).addComponent(btnConvCancel)));
 
         setContentPane(panel);
         pack();
@@ -78,7 +86,7 @@ public class TestFrame extends JFrame {
 
         @Override
         public void actionPerformed(ActionEvent e) {
-            converter = new Convert(new MyConvProfile(), new File("out/sm9.flv"), new File("out/sm9.xml")) {
+            converter = new Convert(new MyConvProfile(), new File("out/sm8994079.mp4"), new File("out/sm9.xml")) {
 
                 @Override
                 protected void process(List<ConvertProgress> chunks) {
@@ -213,7 +221,7 @@ public class TestFrame extends JFrame {
 
                 @Override
                 public String getFileName() {
-                    return "{id}_{title}";
+                    return "{id}";
                 }
 
                 @Override
@@ -315,17 +323,68 @@ public class TestFrame extends JFrame {
 
         @Override
         public FfmpegProfile getFfmpegOption() {
-            throw new UnsupportedOperationException("Not supported yet.");
+            return new FfmpegProfile() {
+
+                @Override
+                public String getExtOption() {
+                    return "";
+                }
+
+                @Override
+                public String getInOption() {
+                    return "";
+                }
+
+                @Override
+                public String getMainOption() {
+                    return "";
+                }
+
+                @Override
+                public String getOutOption() {
+                    return "-f ipod -g 150 -qcomp 0.7 -qmin 20 -qmax 30 -qdiff 4 -subq 6 -me_range 16 -i_qfactor 0.714286";
+                }
+
+                @Override
+                public String getAvfilterOption() {
+                    return "";
+                }
+
+                @Override
+                public boolean isResize() {
+                    return false;
+                }
+
+                @Override
+                public int getResizeWidth() {
+                    throw new UnsupportedOperationException("Not supported yet.");
+                }
+
+                @Override
+                public int getResizeHeight() {
+                    throw new UnsupportedOperationException("Not supported yet.");
+                }
+
+                @Override
+                public boolean isAdjustRatio() {
+                    throw new UnsupportedOperationException("Not supported yet.");
+                }
+
+                @Override
+                public GeneralProfile getGeneralSetting() {
+                    throw new UnsupportedOperationException("Not supported yet.");
+                }
+            };
         }
 
         @Override
         public File getFfmpeg() {
-            throw new UnsupportedOperationException("Not supported yet.");
+           return new File("bin/ffmpeg.exe");
         }
 
         @Override
         public boolean isVhookDisabled() {
-            throw new UnsupportedOperationException("Not supported yet.");
+            return true;
         }
 
         @Override
@@ -335,7 +394,7 @@ public class TestFrame extends JFrame {
 
         @Override
         public File getTempDir() {
-            throw new UnsupportedOperationException("Not supported yet.");
+            return new File("out");
         }
 
         @Override
@@ -380,12 +439,54 @@ public class TestFrame extends JFrame {
 
         @Override
         public OutputProfile getOutputProfile() {
-            throw new UnsupportedOperationException("Not supported yet.");
+            return new OutputProfile() {
+
+                @Override
+                public boolean isConvert() {
+                    return true;
+                }
+
+                @Override
+                public boolean isAddComment() {
+                    return false;
+                }
+
+                @Override
+                public File getDir() {
+                    return new File("out");
+                }
+
+                @Override
+                public String getFileName() {
+                    return "outconv";
+                }
+
+                @Override
+                public String getVideoId() {
+                    return "";
+                }
+
+                @Override
+                public String getTitile() {
+                    return "";
+                }
+            };
         }
 
         @Override
         public GeneralProfile getGeneralProfile() {
-            throw new UnsupportedOperationException("Not supported yet.");
+            return new GeneralProfile() {
+
+                @Override
+                public String getReplaceFrom() {
+                    return "";
+                }
+
+                @Override
+                public String getReplaceTo() {
+                    return "";
+                }
+            };
         }
     }
 }