OSDN Git Service

プロファイルインタフェースにコメントを付与
authoryukihane <yukihane.feather@gmail.com>
Sun, 21 Aug 2011 19:46:13 +0000 (04:46 +0900)
committeryukihane <yukihane.feather@gmail.com>
Sun, 21 Aug 2011 19:46:13 +0000 (04:46 +0900)
14 files changed:
frontend/src/saccubus/converter/Converter.java
frontend/src/saccubus/converter/FfmpegCommand.java
frontend/src/saccubus/converter/classic/profile/Ffmpeg.java
frontend/src/saccubus/converter/classic/profile/InputFileSetting.java
frontend/src/saccubus/converter/classic/profile/OutputFileSetting.java
frontend/src/yukihane/saccubus/converter/profile/CommentProfile.java
frontend/src/yukihane/saccubus/converter/profile/FfmpegProfile.java
frontend/src/yukihane/saccubus/converter/profile/GeneralProfile.java
frontend/src/yukihane/saccubus/converter/profile/Inputable.java
frontend/src/yukihane/saccubus/converter/profile/LoinProfile.java
frontend/src/yukihane/saccubus/converter/profile/OutputProfile.java
frontend/src/yukihane/saccubus/converter/profile/Profile.java
frontend/src/yukihane/saccubus/converter/profile/ProxyProfile.java
frontend/src/yukihane/saccubus/converter/profile/VideoProfile.java

index 8050731..809f59b 100644 (file)
@@ -121,8 +121,8 @@ public class Converter extends AbstractCommand implements Callable<Boolean> {
             final String name = pattern.createFileName(movieId, true);
             final File file = new File(profile.getCommentSetting().getDir(), name);
 
-            commentFile = client.getCommentFile(vi, file.getPath(), wbi, profile.getCommentSetting().getBackComment(),
-                    profile.getCommentSetting().isReduceComment());
+            commentFile = client.getCommentFile(vi, file.getPath(), wbi, profile.getCommentSetting().getLengthRelatedCommentSize(),
+                    profile.getCommentSetting().isDisablePerMinComment());
         } else {
             commentFile = profile.getCommentSetting().getLocalFile();
         }
index 89b113a..a136c57 100644 (file)
@@ -239,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("|");
         }
index 47318e5..94498ff 100644 (file)
@@ -60,8 +60,9 @@ public class Ffmpeg implements yukihane.saccubus.converter.profile.FfmpegProfile
         return commentOpaque;
     }
 
-    public boolean isSelfAdjustFontSize() {
-        return selfAdjustFontSize;
+    @Override
+    public boolean isDisableFontSizeArrange() {
+        return !selfAdjustFontSize;
     }
 
     public int getShadowIndex() {
index 8ba8e93..630d99b 100644 (file)
@@ -42,18 +42,20 @@ public class InputFileSetting implements VideoProfile, CommentProfile {
         return delete;
     }
 
-    @Override
-    public boolean isSelfAdjustCommentNum() {
+    private boolean isSelfAdjustCommentNum() {
         return commentGetInfo.isSelfAdjustCommentNum();
     }
 
     @Override
-    public int getBackComment() {
-        return commentGetInfo.getBackComment();
+    public int getLengthRelatedCommentSize() {
+        if (isSelfAdjustCommentNum()) {
+            return commentGetInfo.getBackComment();
+        }
+        return -1;
     }
 
     @Override
-    public boolean isReduceComment() {
+    public boolean isDisablePerMinComment() {
         return commentGetInfo.isReduceComment();
     }
 
@@ -71,4 +73,9 @@ public class InputFileSetting implements VideoProfile, CommentProfile {
     public File getLocalFile() {
         throw new UnsupportedOperationException("Not supported yet.");
     }
+
+    @Override
+    public int getPerMinCommentSize() {
+        return -1;
+    }
 }
index 2c15a49..96dd5c2 100644 (file)
@@ -26,7 +26,6 @@ public class OutputFileSetting implements yukihane.saccubus.converter.profile.Ou
         return convert;
     }
 
-    @Override
     public boolean isAppendPrefixVideoId() {
         return appendPrefixVideoId;
     }
@@ -36,7 +35,6 @@ public class OutputFileSetting implements yukihane.saccubus.converter.profile.Ou
         return addComment;
     }
 
-    @Override
     public boolean isAddTcomment() {
         return addTcomment;
     }
index 0ff200f..3306b7f 100644 (file)
@@ -1,24 +1,41 @@
 package yukihane.saccubus.converter.profile;
 
 /**
- *
+ * 変換対象となるコメントファイル情報を保持するためのプロファイルです.
  * @author yuki
  */
 public interface CommentProfile extends Inputable {
 
-    boolean isSelfAdjustCommentNum();
+    /**
+     * @return {@link #isDownload()}がtrueの場合に
+     * 取得する「再生時間に応じたコメント」数. 負値の場合は再生時間に応じた
+     * 既定数を取得します.
+     * {@link #isDownload()}がfalseの場合未定義.
+     */
+    int getLengthRelatedCommentSize();
 
-    int getBackComment();
+    /**
+     * @return {@link #isDownload()}がtrueの場合に,
+     * 昔の仕様でコメントダウンロードを行う場合はtrue. 現在の仕様で行う場合はfalse.
+     * {@link #isDownload()}がfalseの場合未定義.
+     */
+    boolean isDisablePerMinComment();
 
     /**
-     * @return 昔の仕様でコメントダウンロードを行う場合はtrue. 現在の仕様で行う場合はfalse.
-     * {@link #isDownload()}がtrueの場合のみ必要です.
+     * @return {@link #isDownload()}がtrue, かつ
+     * {@link #isDisablePerMinComment()}がfalseの場合に
+     * 取得する「1分当たりコメント」数. 負値の場合は再生時間に応じた
+     * 既定数を取得します.
+     * {@link #isDownload()}がfalse, または
+     * {@link #isDisablePerMinComment()}がtrueの場合未定義.
      */
-    boolean isReduceComment();
+    int getPerMinCommentSize();
 
     /**
-     * @return 過去ログを取得する時点. 1970/1/1 00:00:00 GMT からの経過秒数(ミリ秒ではない).
-     * マイナス値指定の場合は過去ログ取得ではない.
+     * @return {@link #isDownload()}がtrueの場合に,過去ログを取得する時点.
+     * 1970/1/1 00:00:00 GMT からの経過秒数(ミリ秒ではない).
+     * 負値の場合は過去ログ取得ではない.
+     * {@link #isDownload()}がfalseの場合未定義.
      */
     long getBackLogPoint();
 }
index 272c496..7729114 100644 (file)
@@ -10,24 +10,34 @@ public interface FfmpegProfile {
 
     FfmpegOption getFfmpegOption();
 
+    /** @return ffmpeg実行ファイル. */
     File getFfmpeg();
 
-    int getFontIndex();
+    /** @return 拡張ライブラリを無効にするのであればtrue. */
+    boolean isVhookDisabled();
 
+    /** @return 拡張ライブラリファイル. */
+    File getVhook();
+
+    /** @return 使用するフォントファイル. */
     File getFont();
 
+    /** @return フォント番号. */
+    int getFontIndex();
+
+    /** @return 全てのコメントを不透明にするのであればtrue. */
     boolean isCommentOpaque();
 
-    boolean isSelfAdjustFontSize();
+    /** @return コメントのフォントサイズを自動調整するのであればfalse. */
+    boolean isDisableFontSizeArrange();
 
+    /** @return 影の種類 */
     int getShadowIndex();
 
+    /** @return 変換中に変換中画像を画面に表示するのであればtrue. */
     boolean isShowConverting();
 
-    boolean isVhookDisabled();
-
-    File getVhook();
-
+    /** @return 1画面中に表示する最大コメント数. 負値の場合は既定値(30)と同等. */
     int getMaxNumOfComment();
 
     NgSetting getNgSetting();
index 4b783f0..8ecce9e 100644 (file)
@@ -3,7 +3,7 @@ package yukihane.saccubus.converter.profile;
 import java.io.File;
 
 /**
- *
+ * 一般的な設定を保持するプロファイル.
  * @author yuki
  */
 public interface GeneralProfile {
@@ -17,5 +17,6 @@ public interface GeneralProfile {
      */
     String getReplaceTo();
 
+    /** @return 作業用一時ディレクトリ. */
     File getTempDir();
 }
index b289e7a..e1386ed 100644 (file)
@@ -3,20 +3,32 @@ package yukihane.saccubus.converter.profile;
 import java.io.File;
 
 /**
- *
+ * 変換元情報(入力情報)のプロファイルが実現すべきインタフェースです.
  * @author yuki
  */
 interface Inputable {
 
+    /**
+     * @return 変換する動画ファイルをニコニコ動画サービスから取得するのであればtrue.
+     * ローカルにあるファイルを使用するのであればfalse.
+     */
     boolean isDownload();
 
+    /**
+     * @return {@link #isDownload()}がtrueの場合に, 取得したファイルを保存するディレクトリを返します.
+     * falseの場合は未定義.
+     */
     File getDir();
 
+    /**
+     * @return {@link #isDownload()}がtrueの場合に, 取得したファイルを保存するファイル名のパターンを返します.
+     * falseの場合は未定義.
+     */
     String getFileName();
 
     /**
-     * @return {@link #isDownload()}ã\81\8cfalseã\81®å ´å\90\88ã\80\81使用するローカルファイルを返します.
-     * trueの場合はnull.
+     * @return {@link #isDownload()}ã\81\8cfalseã\81®å ´å\90\88ã\81«, 使用するローカルファイルを返します.
+     * trueの場合は未定義.
      */
     File getLocalFile();
 }
index bfedf76..13a0a4f 100644 (file)
@@ -1,12 +1,14 @@
 package yukihane.saccubus.converter.profile;
 
 /**
- *
+ * ニコニコ動画サービスへのログイン情報を保持するためのプロファイルです.
  * @author yuki
  */
 public interface LoinProfile {
 
+    /** @return ログインID(メールアドレス). */
     public String getMail();
 
+    /** @return ログインパスワード. */
     public String getPass();
 }
index 7704a88..c10abb5 100644 (file)
@@ -2,18 +2,33 @@ package yukihane.saccubus.converter.profile;
 
 import java.io.File;
 
+/**
+ * 変換後の動画ファイルに関する情報を保持するプロファイル.
+ * @author yuki
+ */
 public interface OutputProfile {
 
     /** @return 動画変換処理を行う必要があればtrue. */
     boolean isConvert();
 
-    boolean isAppendPrefixVideoId();
-
+    /**
+     * @return {@link #isConvert()}がtrueの場合に
+     * コメントを付与して変換を行うのであればtrue.
+     * {@link #isConvert()}がfalseの場合未定義.
+     */
     boolean isAddComment();
 
-    boolean isAddTcomment();
-
+    /**
+     * @return {@link #isConvert()}がtrueの場合に
+     * 変換した動画を保存するディレクトリ.
+     * {@link #isConvert()}がfalseの場合未定義.
+     */
     public File getDir();
 
+    /**
+     * @return {@link #isConvert()}がtrueの場合に
+     * 変換した動画のファイル名パターン.
+     * {@link #isConvert()}がfalseの場合未定義.
+     */
     public String getFileName();
 }
index 6e9dd69..fbd2d28 100644 (file)
@@ -1,7 +1,9 @@
 package yukihane.saccubus.converter.profile;
 
 /**
- *
+ * {@link saccubus.converter.Converter.Converter}が必要とするプロファイルです.
+ * Converterを使用するクライアントは, このインタフェースを実装するクラスのインスタンスで
+ * Converterへ処理させる内容を通知します.
  * @author yuki
  */
 public interface Profile {
index f825e22..595b06f 100644 (file)
@@ -1,14 +1,24 @@
 package yukihane.saccubus.converter.profile;
 
 /**
- *
+ * プロキシ設定を保持するためのプロファイルです.
  * @author yuki
  */
 public interface ProxyProfile {
 
+    /**
+     * @return プロキシを使用してインターネット接続(ニコニコ動画サービスへの接続)を
+     * 行うのであればtrue. 直接接続するのであればfalse.
+     */
     boolean use();
 
+    /**
+     * @return プロキシサーバホスト名.
+     */
     String getHost();
 
+    /**
+     * @return プロキシサーバポート番号.
+     */
     int getPort();
 }
index 85d9d8c..a2f6b55 100644 (file)
@@ -1,7 +1,7 @@
 package yukihane.saccubus.converter.profile;
 
 /**
- *
+ * 変換対象となる動画ファイル情報を保持するためのプロファイルです.
  * @author yuki
  */
 public interface VideoProfile extends Inputable {