いんきゅばす(仮称; 旧名: さきゅばすのNicoBrowser拡張版)
Révision | 96643d75322ce44e55a0ca75d0c3aff95a3d0eed (tree) |
---|---|
l'heure | 2011-09-11 07:41:44 |
Auteur | yukihane <yukihane.feather@gmai...> |
Commiter | yukihane |
デバッグ出力を追加
@@ -46,6 +46,7 @@ import org.apache.commons.lang.StringUtils; | ||
46 | 46 | import saccubus.ConvertStopFlag.State; |
47 | 47 | import saccubus.converter.profile.FfmpegOption; |
48 | 48 | import saccubus.converter.profile.NgSetting; |
49 | +import saccubus.converter.profile.Profile; | |
49 | 50 | import saccubus.net.TextProgressListener; |
50 | 51 | import saccubus.properties.BasicSetting; |
51 | 52 | import saccubus.properties.ConvertSetting; |
@@ -83,7 +84,7 @@ public class MainFrame extends JFrame { | ||
83 | 84 | |
84 | 85 | private static final long serialVersionUID = 2564486741331062989L; |
85 | 86 | public static final String PRODUCT_NAME = "いんきゅばす"; |
86 | - public static final String VERSION = "1.7.2 (NicoBrowser" + Main.VERSION + ")"; | |
87 | + public static final String VERSION = "1.7.3 (NicoBrowser" + Main.VERSION + ")"; | |
87 | 88 | public static final Image WinIcon = Toolkit.getDefaultToolkit().createImage(saccubus.MainFrame.class.getResource( |
88 | 89 | "icon32.png")); |
89 | 90 | // TODO GUIが無いためフィールドに保持. |
@@ -366,6 +367,7 @@ public class MainFrame extends JFrame { | ||
366 | 367 | contentPane.setLayout(borderLayout1); |
367 | 368 | setSize(new Dimension(400, 450)); |
368 | 369 | setTitle(PRODUCT_NAME + " " + VERSION); |
370 | + System.out.println(getTitle()); | |
369 | 371 | this.addWindowListener(new MainFrame_this_windowAdapter(this)); |
370 | 372 | statusBar.setText(" "); |
371 | 373 | jMenuFile.setText("ファイル"); |
@@ -896,6 +898,8 @@ public class MainFrame extends JFrame { | ||
896 | 898 | private JPanel FFmpegOptionComboBoxPanel = null; |
897 | 899 | |
898 | 900 | public void DoButton_actionPerformed(ActionEvent e) { |
901 | + System.out.println("doButton: " + doButton.getText()); | |
902 | + System.out.println("Converter: " + (Converter == null ? "null" : Converter.isConverted())); | |
899 | 903 | if (Converter == null || Converter.isConverted()) { |
900 | 904 | try { |
901 | 905 | executeConvert(); |
@@ -910,6 +914,7 @@ public class MainFrame extends JFrame { | ||
910 | 914 | } else { /* 開始しているので、ストップする。 */ |
911 | 915 | final ConvertStopFlag flag = Converter.getStopFlag(); |
912 | 916 | if (!flag.needStop()) { /* まだストップしていない。 */ |
917 | + System.out.println("request stop"); | |
913 | 918 | flag.requestStop(); |
914 | 919 | } |
915 | 920 | } |
@@ -919,6 +924,7 @@ public class MainFrame extends JFrame { | ||
919 | 924 | String url; |
920 | 925 | |
921 | 926 | // NicoBrowserファイルを利用する場合は、ファイル名からビデオIDを特定. |
927 | + System.out.println("kind: " + videoSaveInfoPanel.getVideoUseNiBrButton().isSelected()); | |
922 | 928 | if (videoSaveInfoPanel.getVideoUseNiBrButton().isSelected()) { |
923 | 929 | try { |
924 | 930 | String fileName = videoSaveInfoPanel.getNibrFileField().getText(); |
@@ -935,6 +941,7 @@ public class MainFrame extends JFrame { | ||
935 | 941 | } |
936 | 942 | } else { |
937 | 943 | url = videoIdField.getText(); |
944 | + System.out.println("VIDEO ID: " + url); | |
938 | 945 | } |
939 | 946 | |
940 | 947 | TextProgressListener sl = new TextProgressListener() { |
@@ -967,11 +974,14 @@ public class MainFrame extends JFrame { | ||
967 | 974 | } |
968 | 975 | }; |
969 | 976 | |
970 | - Converter = new Converter(url, wayBackField.getText(), getSetting().toProfile(), sl, | |
977 | + final Profile profile = getSetting().toProfile(); | |
978 | + System.out.println(profile); | |
979 | + | |
980 | + Converter = new Converter(url, wayBackField.getText(), profile, sl, | |
971 | 981 | new ConvertStopFlag(scl)); |
972 | 982 | doButton.setText(DoButtonStopString); |
973 | 983 | new Thread(Converter).start(); |
974 | - | |
984 | + System.out.println("Thread invoked"); | |
975 | 985 | } |
976 | 986 | |
977 | 987 | /* FFmpegへのパス */ |
@@ -1634,6 +1644,7 @@ class MainFrame_DoButton_actionAdapter implements ActionListener { | ||
1634 | 1644 | private MainFrame adaptee; |
1635 | 1645 | |
1636 | 1646 | MainFrame_DoButton_actionAdapter(MainFrame adaptee) { |
1647 | + System.out.println("MainFrame_DoButton_actionAdapter コンストラクタ"); | |
1637 | 1648 | this.adaptee = adaptee; |
1638 | 1649 | } |
1639 | 1650 |
@@ -25,7 +25,14 @@ public abstract class AbstractCommand { | ||
25 | 25 | } |
26 | 26 | |
27 | 27 | protected void sendText(String text) { |
28 | + sendText(text, true); | |
29 | + } | |
30 | + | |
31 | + protected void sendText(String text, boolean debugOut) { | |
28 | 32 | getListener().setText(text); |
33 | + if (debugOut) { | |
34 | + System.out.println(text); | |
35 | + } | |
29 | 36 | } |
30 | 37 | |
31 | 38 | /** |
@@ -48,7 +48,9 @@ public class Converter extends AbstractCommand implements Runnable, Callable<Boo | ||
48 | 48 | Setting = setting; |
49 | 49 | } |
50 | 50 | |
51 | + @Override | |
51 | 52 | public Boolean call() throws Exception { |
53 | + System.out.println("Convert Thread Start"); | |
52 | 54 | boolean result = false; |
53 | 55 | try { |
54 | 56 | result = runConvert(); |
@@ -58,6 +60,7 @@ public class Converter extends AbstractCommand implements Runnable, Callable<Boo | ||
58 | 60 | return Boolean.valueOf(result); |
59 | 61 | } |
60 | 62 | |
63 | + @Override | |
61 | 64 | public void run() { |
62 | 65 | try { |
63 | 66 | call(); |
@@ -179,7 +179,7 @@ public class FfmpegCommand extends AbstractCommand { | ||
179 | 179 | while ((e = ebr.readLine()) != null) { |
180 | 180 | String state = e; |
181 | 181 | if (state.startsWith("frame=")) { |
182 | - sendText(state); | |
182 | + sendText(state, false); | |
183 | 183 | } else if (!state.endsWith("No accelerated colorspace conversion found")) { |
184 | 184 | logger.log(Level.INFO, e); |
185 | 185 | } |
@@ -4,6 +4,7 @@ | ||
4 | 4 | */ |
5 | 5 | package saccubus.converter.filegetter; |
6 | 6 | |
7 | +import org.apache.commons.lang.builder.ToStringBuilder; | |
7 | 8 | import saccubus.converter.profile.Proxy; |
8 | 9 | |
9 | 10 | /** |
@@ -33,4 +34,10 @@ public class LoginInfo { | ||
33 | 34 | public Proxy getProxy() { |
34 | 35 | return proxy; |
35 | 36 | } |
37 | + | |
38 | + @Override | |
39 | + public String toString() { | |
40 | + return new ToStringBuilder(this).append("mail: " + !mail.isEmpty()).append("pass: " + !pass.isEmpty()).append( | |
41 | + proxy).toString(); | |
42 | + } | |
36 | 43 | } |
@@ -4,6 +4,8 @@ | ||
4 | 4 | */ |
5 | 5 | package saccubus.converter.profile; |
6 | 6 | |
7 | +import org.apache.commons.lang.builder.ToStringBuilder; | |
8 | + | |
7 | 9 | /** |
8 | 10 | * コメント取得に関するプロファイルです. |
9 | 11 | * @author yuki |
@@ -34,4 +36,9 @@ public class CommentGetInfo { | ||
34 | 36 | public boolean isReduceComment() { |
35 | 37 | return reduceComment; |
36 | 38 | } |
39 | + | |
40 | + @Override | |
41 | + public String toString() { | |
42 | + return ToStringBuilder.reflectionToString(this); | |
43 | + } | |
37 | 44 | } |
@@ -2,6 +2,7 @@ | ||
2 | 2 | package saccubus.converter.profile; |
3 | 3 | |
4 | 4 | import java.io.File; |
5 | +import org.apache.commons.lang.builder.ToStringBuilder; | |
5 | 6 | |
6 | 7 | /** |
7 | 8 | * |
@@ -86,4 +87,9 @@ public class Ffmpeg { | ||
86 | 87 | public NgSetting getNgSetting() { |
87 | 88 | return ngSetting; |
88 | 89 | } |
90 | + | |
91 | + @Override | |
92 | + public String toString() { | |
93 | + return ToStringBuilder.reflectionToString(this); | |
94 | + } | |
89 | 95 | } |
@@ -2,6 +2,7 @@ | ||
2 | 2 | package saccubus.converter.profile; |
3 | 3 | |
4 | 4 | import java.io.File; |
5 | +import org.apache.commons.lang.builder.ToStringBuilder; | |
5 | 6 | |
6 | 7 | public class GeneralSetting { |
7 | 8 |
@@ -14,4 +15,9 @@ public class GeneralSetting { | ||
14 | 15 | public File getTempDir() { |
15 | 16 | return tempDir; |
16 | 17 | } |
18 | + | |
19 | + @Override | |
20 | + public String toString() { | |
21 | + return ToStringBuilder.reflectionToString(this); | |
22 | + } | |
17 | 23 | } |
@@ -1,6 +1,8 @@ | ||
1 | 1 | /* $Id$ */ |
2 | 2 | package saccubus.converter.profile; |
3 | 3 | |
4 | +import org.apache.commons.lang.builder.ToStringBuilder; | |
5 | + | |
4 | 6 | /** |
5 | 7 | * |
6 | 8 | * @author yuki |
@@ -33,5 +35,9 @@ public class InputFileSetting { | ||
33 | 35 | public boolean isDelete() { |
34 | 36 | return delete; |
35 | 37 | } |
36 | -} | |
37 | 38 | |
39 | + @Override | |
40 | + public String toString() { | |
41 | + return ToStringBuilder.reflectionToString(this); | |
42 | + } | |
43 | +} |
@@ -1,6 +1,8 @@ | ||
1 | 1 | /* $Id$ */ |
2 | 2 | package saccubus.converter.profile; |
3 | 3 | |
4 | +import org.apache.commons.lang.builder.ToStringBuilder; | |
5 | + | |
4 | 6 | /** |
5 | 7 | * NG設定. |
6 | 8 | * @author yuki |
@@ -22,4 +24,9 @@ public class NgSetting { | ||
22 | 24 | public String getId() { |
23 | 25 | return id; |
24 | 26 | } |
27 | + | |
28 | + @Override | |
29 | + public String toString() { | |
30 | + return ToStringBuilder.reflectionToString(this); | |
31 | + } | |
25 | 32 | } |
@@ -4,6 +4,8 @@ | ||
4 | 4 | */ |
5 | 5 | package saccubus.converter.profile; |
6 | 6 | |
7 | +import org.apache.commons.lang.builder.ToStringBuilder; | |
8 | + | |
7 | 9 | /** |
8 | 10 | * |
9 | 11 | * @author yuki |
@@ -44,4 +46,9 @@ public class OutputFileSetting { | ||
44 | 46 | public SFile getFile() { |
45 | 47 | return file; |
46 | 48 | } |
49 | + | |
50 | + @Override | |
51 | + public String toString() { | |
52 | + return ToStringBuilder.reflectionToString(this); | |
53 | + } | |
47 | 54 | } |
@@ -1,6 +1,7 @@ | ||
1 | 1 | /* $Id$ */ |
2 | 2 | package saccubus.converter.profile; |
3 | 3 | |
4 | +import org.apache.commons.lang.builder.ToStringBuilder; | |
4 | 5 | import saccubus.converter.filegetter.LoginInfo; |
5 | 6 | |
6 | 7 | /** |
@@ -82,4 +83,9 @@ public class Profile { | ||
82 | 83 | public GeneralSetting getGeneralSetting() { |
83 | 84 | return generalSetting; |
84 | 85 | } |
86 | + | |
87 | + @Override | |
88 | + public String toString(){ | |
89 | + return ToStringBuilder.reflectionToString(this); | |
90 | + } | |
85 | 91 | } |
@@ -2,6 +2,7 @@ | ||
2 | 2 | package saccubus.converter.profile; |
3 | 3 | |
4 | 4 | import org.apache.commons.lang.StringUtils; |
5 | +import org.apache.commons.lang.builder.ToStringBuilder; | |
5 | 6 | |
6 | 7 | /** |
7 | 8 | * |
@@ -33,4 +34,9 @@ public class Proxy { | ||
33 | 34 | public int getPort() { |
34 | 35 | return port; |
35 | 36 | } |
37 | + | |
38 | + @Override | |
39 | + public String toString() { | |
40 | + return ToStringBuilder.reflectionToString(this); | |
41 | + } | |
36 | 42 | } |
@@ -2,6 +2,7 @@ | ||
2 | 2 | package saccubus.converter.profile; |
3 | 3 | |
4 | 4 | import java.io.File; |
5 | +import org.apache.commons.lang.builder.ToStringBuilder; | |
5 | 6 | |
6 | 7 | /** |
7 | 8 | * さきゅばすで扱うファイルは、「保存するディレクトリ」と、「保存されたファイルそのもの」の2パターンある。 |
@@ -40,4 +41,9 @@ public class SFile { | ||
40 | 41 | public File getFile() { |
41 | 42 | return file; |
42 | 43 | } |
44 | + | |
45 | + @Override | |
46 | + public String toString() { | |
47 | + return ToStringBuilder.reflectionToString(this); | |
48 | + } | |
43 | 49 | } |