From: yukihane Date: Sun, 21 Aug 2011 19:46:13 +0000 (+0900) Subject: プロファイルインタフェースにコメントを付与 X-Git-Tag: test20110903_ver2.a.0~189 X-Git-Url: http://git.sourceforge.jp/view?p=coroid%2Finqubus.git;a=commitdiff_plain;h=8e8b3965c7fdd02d8760f6ffff3eba893f891e6f プロファイルインタフェースにコメントを付与 --- diff --git a/frontend/src/saccubus/converter/Converter.java b/frontend/src/saccubus/converter/Converter.java index 8050731..809f59b 100644 --- a/frontend/src/saccubus/converter/Converter.java +++ b/frontend/src/saccubus/converter/Converter.java @@ -121,8 +121,8 @@ public class Converter extends AbstractCommand implements Callable { 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(); } diff --git a/frontend/src/saccubus/converter/FfmpegCommand.java b/frontend/src/saccubus/converter/FfmpegCommand.java index 89b113a..a136c57 100644 --- a/frontend/src/saccubus/converter/FfmpegCommand.java +++ b/frontend/src/saccubus/converter/FfmpegCommand.java @@ -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("|"); } diff --git a/frontend/src/saccubus/converter/classic/profile/Ffmpeg.java b/frontend/src/saccubus/converter/classic/profile/Ffmpeg.java index 47318e5..94498ff 100644 --- a/frontend/src/saccubus/converter/classic/profile/Ffmpeg.java +++ b/frontend/src/saccubus/converter/classic/profile/Ffmpeg.java @@ -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() { diff --git a/frontend/src/saccubus/converter/classic/profile/InputFileSetting.java b/frontend/src/saccubus/converter/classic/profile/InputFileSetting.java index 8ba8e93..630d99b 100644 --- a/frontend/src/saccubus/converter/classic/profile/InputFileSetting.java +++ b/frontend/src/saccubus/converter/classic/profile/InputFileSetting.java @@ -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; + } } diff --git a/frontend/src/saccubus/converter/classic/profile/OutputFileSetting.java b/frontend/src/saccubus/converter/classic/profile/OutputFileSetting.java index 2c15a49..96dd5c2 100644 --- a/frontend/src/saccubus/converter/classic/profile/OutputFileSetting.java +++ b/frontend/src/saccubus/converter/classic/profile/OutputFileSetting.java @@ -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; } diff --git a/frontend/src/yukihane/saccubus/converter/profile/CommentProfile.java b/frontend/src/yukihane/saccubus/converter/profile/CommentProfile.java index 0ff200f..3306b7f 100644 --- a/frontend/src/yukihane/saccubus/converter/profile/CommentProfile.java +++ b/frontend/src/yukihane/saccubus/converter/profile/CommentProfile.java @@ -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(); } diff --git a/frontend/src/yukihane/saccubus/converter/profile/FfmpegProfile.java b/frontend/src/yukihane/saccubus/converter/profile/FfmpegProfile.java index 272c496..7729114 100644 --- a/frontend/src/yukihane/saccubus/converter/profile/FfmpegProfile.java +++ b/frontend/src/yukihane/saccubus/converter/profile/FfmpegProfile.java @@ -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(); diff --git a/frontend/src/yukihane/saccubus/converter/profile/GeneralProfile.java b/frontend/src/yukihane/saccubus/converter/profile/GeneralProfile.java index 4b783f0..8ecce9e 100644 --- a/frontend/src/yukihane/saccubus/converter/profile/GeneralProfile.java +++ b/frontend/src/yukihane/saccubus/converter/profile/GeneralProfile.java @@ -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(); } diff --git a/frontend/src/yukihane/saccubus/converter/profile/Inputable.java b/frontend/src/yukihane/saccubus/converter/profile/Inputable.java index b289e7a..e1386ed 100644 --- a/frontend/src/yukihane/saccubus/converter/profile/Inputable.java +++ b/frontend/src/yukihane/saccubus/converter/profile/Inputable.java @@ -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()}がfalseの場合、使用するローカルファイルを返します. - * trueの場合はnull. + * @return {@link #isDownload()}がfalseの場合に, 使用するローカルファイルを返します. + * trueの場合は未定義. */ File getLocalFile(); } diff --git a/frontend/src/yukihane/saccubus/converter/profile/LoinProfile.java b/frontend/src/yukihane/saccubus/converter/profile/LoinProfile.java index bfedf76..13a0a4f 100644 --- a/frontend/src/yukihane/saccubus/converter/profile/LoinProfile.java +++ b/frontend/src/yukihane/saccubus/converter/profile/LoinProfile.java @@ -1,12 +1,14 @@ package yukihane.saccubus.converter.profile; /** - * + * ニコニコ動画サービスへのログイン情報を保持するためのプロファイルです. * @author yuki */ public interface LoinProfile { + /** @return ログインID(メールアドレス). */ public String getMail(); + /** @return ログインパスワード. */ public String getPass(); } diff --git a/frontend/src/yukihane/saccubus/converter/profile/OutputProfile.java b/frontend/src/yukihane/saccubus/converter/profile/OutputProfile.java index 7704a88..c10abb5 100644 --- a/frontend/src/yukihane/saccubus/converter/profile/OutputProfile.java +++ b/frontend/src/yukihane/saccubus/converter/profile/OutputProfile.java @@ -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(); } diff --git a/frontend/src/yukihane/saccubus/converter/profile/Profile.java b/frontend/src/yukihane/saccubus/converter/profile/Profile.java index 6e9dd69..fbd2d28 100644 --- a/frontend/src/yukihane/saccubus/converter/profile/Profile.java +++ b/frontend/src/yukihane/saccubus/converter/profile/Profile.java @@ -1,7 +1,9 @@ package yukihane.saccubus.converter.profile; /** - * + * {@link saccubus.converter.Converter.Converter}が必要とするプロファイルです. + * Converterを使用するクライアントは, このインタフェースを実装するクラスのインスタンスで + * Converterへ処理させる内容を通知します. * @author yuki */ public interface Profile { diff --git a/frontend/src/yukihane/saccubus/converter/profile/ProxyProfile.java b/frontend/src/yukihane/saccubus/converter/profile/ProxyProfile.java index f825e22..595b06f 100644 --- a/frontend/src/yukihane/saccubus/converter/profile/ProxyProfile.java +++ b/frontend/src/yukihane/saccubus/converter/profile/ProxyProfile.java @@ -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(); } diff --git a/frontend/src/yukihane/saccubus/converter/profile/VideoProfile.java b/frontend/src/yukihane/saccubus/converter/profile/VideoProfile.java index 85d9d8c..a2f6b55 100644 --- a/frontend/src/yukihane/saccubus/converter/profile/VideoProfile.java +++ b/frontend/src/yukihane/saccubus/converter/profile/VideoProfile.java @@ -1,7 +1,7 @@ package yukihane.saccubus.converter.profile; /** - * + * 変換対象となる動画ファイル情報を保持するためのプロファイルです. * @author yuki */ public interface VideoProfile extends Inputable {