2 package saccubus.converter.profile;
4 import org.apache.commons.lang.builder.ToStringBuilder;
5 import saccubus.converter.filegetter.LoginInfo;
8 * Converterに処理させるための設定.
11 public class Profile {
13 private final GeneralSetting generalSetting;
14 private final LoginInfo loginInfo;
15 private final InputFileSetting videoSetting;
16 private final InputFileSetting commentSetting;
17 private final CommentGetInfo commentGetInfo;
18 private final InputFileSetting tcommentSetting;
19 private final OutputFileSetting outputFileSetting;
20 private final Ffmpeg ffmpeg;
23 GeneralSetting generalSetting,
25 InputFileSetting videoSetting,
26 InputFileSetting commentSetting,
27 CommentGetInfo commentGetInfo,
28 InputFileSetting tcommentSetting,
29 OutputFileSetting outputFileSetting,
31 this.generalSetting = generalSetting;
32 this.loginInfo = loginInfo;
33 this.videoSetting = videoSetting;
34 this.commentSetting = commentSetting;
35 this.commentGetInfo = commentGetInfo;
36 this.tcommentSetting = tcommentSetting;
37 this.outputFileSetting = outputFileSetting;
41 public LoginInfo getLoginInfo() {
45 /** @return 何か実行すべき処理があればtrue. */
46 public boolean shouldRun() {
47 return getOutputFileSetting().isConvert() || needsDownload();
50 /** @return 何かダウンロードするものがあればtrue. */
51 public boolean needsDownload() {
52 return (videoSetting.isDownload() || commentSetting.isDownload() || tcommentSetting.isDownload());
55 public InputFileSetting getVideoSetting() {
59 public InputFileSetting getCommentSetting() {
60 return commentSetting;
63 public InputFileSetting getTcommentSetting() {
64 return tcommentSetting;
67 public OutputFileSetting getOutputFileSetting() {
68 return outputFileSetting;
71 public CommentGetInfo getCommentGetInfo() {
72 return commentGetInfo;
75 public boolean needsConvert() {
76 return getOutputFileSetting().isConvert();
79 public Ffmpeg getFfmpeg() {
83 public GeneralSetting getGeneralSetting() {
84 return generalSetting;
88 public String toString(){
89 return ToStringBuilder.reflectionToString(this);