OSDN Git Service

ConfigからOutputProfileを生成するためのデフォルト実装クラス
[coroid/inqubus.git] / frontend / src / yukihane / inqubus / config / ConfigFfmpegProfile.java
diff --git a/frontend/src/yukihane/inqubus/config/ConfigFfmpegProfile.java b/frontend/src/yukihane/inqubus/config/ConfigFfmpegProfile.java
new file mode 100644 (file)
index 0000000..e1ef96b
--- /dev/null
@@ -0,0 +1,78 @@
+package yukihane.inqubus.config;
+
+import saccubus.worker.profile.FfmpegProfile;
+
+/**
+ *
+ * @author user
+ */
+public class ConfigFfmpegProfile implements FfmpegProfile {
+
+    private final String extOption;
+    private final String inOption;
+    private final String mainOption;
+    private final String outOption;
+    private final String avFilterOption;
+    private final boolean resize;
+    private final int resizeWidth;
+    private final int resizeHeight;
+    private final boolean adjustRatio;
+
+    public ConfigFfmpegProfile() {
+        final Config p = Config.INSTANCE;
+        this.extOption = p.getFfmpegExtension();
+        this.inOption = p.getFfmpegInOption();
+        this.mainOption = p.getFfmpegMainOption();
+        this.outOption = p.getFfmpegOutOption();
+        this.avFilterOption = 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 getExtOption() {
+        return extOption;
+    }
+
+    @Override
+    public String getInOption() {
+        return inOption;
+    }
+
+    @Override
+    public String getMainOption() {
+        return mainOption;
+    }
+
+    @Override
+    public String getOutOption() {
+        return outOption;
+    }
+
+    @Override
+    public String getAvfilterOption() {
+        return avFilterOption;
+    }
+
+    @Override
+    public boolean isResize() {
+        return resize;
+    }
+
+    @Override
+    public int getResizeWidth() {
+        return resizeWidth;
+    }
+
+    @Override
+    public int getResizeHeight() {
+        return resizeHeight;
+    }
+
+    @Override
+    public boolean isAdjustRatio() {
+        return adjustRatio;
+    }
+}