OSDN Git Service

システムコンフィグの型を変更
[coroid/inqubus.git] / frontend / src / yukihane / inqubus / Config.java
index f5b91e0..ea651cf 100644 (file)
@@ -74,7 +74,7 @@ public enum Config {
     private static final String FILE_VIDEO_DIR = "file.video.dir";
 
     public String getVideoDir() {
-        return config.getString(FILE_VIDEO_DIR, "in/video");
+        return config.getString(FILE_VIDEO_DIR, "_video");
     }
 
     public void setVideoDir(String s) {
@@ -105,7 +105,7 @@ public enum Config {
     private static final String FILE_COMMENT_DIR = "file.comment.dir";
 
     public String getCommentDir() {
-        return config.getString(FILE_COMMENT_DIR, "in/comment");
+        return config.getString(FILE_COMMENT_DIR, "_comment");
     }
 
     public void setCommentDir(String s) {
@@ -136,7 +136,7 @@ public enum Config {
     private static final String FILE_OUTPUT_DIR = "file.output.dir";
 
     public String getOutputDir() {
-        return config.getString(FILE_OUTPUT_DIR, "out");
+        return config.getString(FILE_OUTPUT_DIR, "__converted");
     }
 
     public void setOutputDir(String s) {
@@ -340,7 +340,7 @@ public enum Config {
     private static final String FFMPEG_PARAM_EXT = "ffmpeg.param.ext";
 
     public String getFfmpegExtension() {
-        return config.getString(FFMPEG_PARAM_EXT, "");
+        return config.getString(FFMPEG_PARAM_EXT, ".m4v");
     }
 
     public void setFfmpegExtension(String s) {
@@ -367,7 +367,8 @@ public enum Config {
     private static final String FFMPEG_PARAM_OUT = "ffmpeg.param.out";
 
     public String getFfmpegOutOption() {
-        return config.getString(FFMPEG_PARAM_OUT, "");
+        return config.getString(FFMPEG_PARAM_OUT,
+                "-f ipod -g 150 -qcomp 0.7 -qmin 20 -qmax 30 -qdiff 4 -subq 6 -me_range 16 -i_qfactor 0.714286");
     }
 
     public void setFfmpegOutOption(String s) {
@@ -441,6 +442,46 @@ public enum Config {
     }
 
     /*
+     * システム
+     */
+    private static final String SYSTEM_DOWNLOAD_THREAD = "system.download.thread";
+
+    public int getSystemDownloadThread() {
+        return config.getInt(SYSTEM_DOWNLOAD_THREAD, 1);
+    }
+
+    public void setSystemDownloadThread(int s) {
+        config.setProperty(SYSTEM_DOWNLOAD_THREAD, s);
+    }
+    private static final String SYSTEM_DOWNLOAD_WAIT = "system.download.wait";
+
+    public int getSystemDownloadWait() {
+        return config.getInt(SYSTEM_DOWNLOAD_WAIT, 30);
+    }
+
+    public void setSystemDownloadWait(int s) {
+        config.setProperty(SYSTEM_DOWNLOAD_WAIT, s);
+    }
+    private static final String SYSTEM_CONVERT_THREAD = "system.convert.thread";
+
+    public int getSystemConvertThread() {
+        return config.getInt(SYSTEM_CONVERT_THREAD, 2);
+    }
+
+    public void setSystemConvertThread(int s) {
+        config.setProperty(SYSTEM_CONVERT_THREAD, s);
+    }
+    private static final String SYSTEM_TEMPDIR = "system.tempdir";
+
+    public String getSystemTempDir() {
+        return config.getString(SYSTEM_TEMPDIR, ".");
+    }
+
+    public void setSystemTempDir(String s) {
+        config.setProperty(SYSTEM_TEMPDIR, s);
+    }
+
+    /*
      *
      */
     public void load(String fileName) throws ConfigurationException {
@@ -454,18 +495,7 @@ public enum Config {
     }
 
     public void save() throws ConfigurationException {
-        throw new UnsupportedOperationException();
-//        try {
-//            final Class<? extends Properties> clazz = this.getClass();
-//            final Field[] fields = clazz.getDeclaredFields();
-//            final Field[] propertyFields = getPropertyFields(fields);
-//            for (Field f : propertyFields) {
-//                config.setProperty(getPropertyName(f), getPropertyValue(f));
-//            }
-//            config.save();
-//        } catch (SecurityException | IllegalArgumentException | IllegalAccessException | ConfigurationException ex) {
-//            throw new ConfigurationException(ex);
-//        }
+        config.save();
     }
 //    private Field[] getPropertyFields(Field[] fields) {
 //        List<Field> res = new ArrayList<Field>();