+++ /dev/null
-package saccubus;
-
-/**
- * <p>
- * タイトル: さきゅばす
- * </p>
- *
- * <p>
- * 説明: ニコニコ動画の動画をコメントつきで保存
- * </p>
- *
- * <p>
- * 著作権: Copyright (c) 2007 PSI
- * </p>
- *
- * <p>
- * 会社名:
- * </p>
- *
- * @author 未入力
- * @version 1.0
- */
-// TODO 不要になる予定
-public class ConvertStopFlag {
-
- public interface StateChangeListener {
-
- void changeState(State s);
- /**
- * StateChangeListenerの何もしないバージョンの実装.
- */
- static final ConvertStopFlag.StateChangeListener EMPTY_LISTENER = new ConvertStopFlag.StateChangeListener() {
-
- public void changeState(State s) {
- }
- };
- }
-
- public enum State {
-
- STOPPING, FINISHED;
- }
- private volatile boolean needStop = false;
- private volatile boolean finished = false;
- private final StateChangeListener listener;
-
- public ConvertStopFlag(StateChangeListener listener) {
- this.listener = listener;
- }
-
- public void requestStop() {
- needStop = true;
- listener.changeState(State.STOPPING);
- }
-
- public boolean needStop() {
- return needStop;
- }
-
- public boolean isFinished() {
- return finished;
- }
-
- public void finished() {
- finished = true;
- listener.changeState(State.FINISHED);
- }
-}
import nicobrowser.WayBackInfo;
import nicobrowser.entity.NicoContent.Status;
import org.apache.http.HttpException;
-import saccubus.ConvertStopFlag;
-import saccubus.net.TextProgressListener;
import saccubus.converter.profile.CommentProfile;
import saccubus.converter.profile.FfmpegProfile;
import saccubus.converter.profile.GeneralProfile;
* @author 未入力
* @version 1.0
*/
-public abstract class Converter extends SwingWorker<ConvertResult, ConvertProgress> implements Callable<Boolean> {
+public class Converter extends SwingWorker<ConvertResult, ConvertProgress> implements Callable<Boolean> {
private static final Logger logger = Logger.getLogger(Converter.class.getName());
private final Profile profile;
* @param listener
* @param flag
*/
- public Converter(String id, Profile profile,
- TextProgressListener listener, ConvertStopFlag flag) {
+ public Converter(String id, Profile profile) {
this.movieId = id;
this.profile = profile;
}
import java.util.logging.Logger;
import javax.swing.SwingWorker;
import org.apache.commons.lang.StringUtils;
-import saccubus.ConvertStopFlag;
import saccubus.conv.ConvertToVideoHook;
import saccubus.converter.profile.ConvertProfile;
import saccubus.converter.profile.FfmpegProfile;
import saccubus.converter.profile.GeneralProfile;
-import saccubus.net.TextProgressListener;
import yukihane.mediainfowrapper.Info;
import yukihane.mediainfowrapper.MediaInfo;
import yukihane.mediainfowrapper.Size;
private final File convertedVideoFile;
private final ConvertProfile ffmpeg;
- FfmpegCommand(TextProgressListener listener, ConvertStopFlag flag, File commentFile,
- File videoFile, File convertedVideoFile, ConvertProfile ffmpeg, GeneralProfile general) throws IOException {
+ FfmpegCommand(File commentFile, File videoFile, File convertedVideoFile, ConvertProfile ffmpeg,
+ GeneralProfile general) throws IOException {
this.commentFile = commentFile;
this.videoFile = videoFile;
this.convertedVideoFile = convertedVideoFile;
+++ /dev/null
-package saccubus.net;
-
-/**
- *
- * @author yuki
- */
-public interface TextProgressListener {
-
- void setText(String text);
- /**
- * TextProgressListenerの何もしないバージョンの実装.
- */
- static final TextProgressListener EMPTY_LISTENER = new TextProgressListener() {
-
- public void setText(String text) {
- }
- };
-}
package saccubus.prompt;
-import java.io.File;
import java.io.IOException;
import java.util.concurrent.Callable;
import java.util.concurrent.ExecutorService;
import org.apache.commons.cli.Option;
import org.apache.commons.cli.OptionBuilder;
import org.apache.commons.cli.Options;
-import saccubus.ConvertStopFlag;
-import saccubus.ConvertStopFlag.State;
import saccubus.converter.Converter;
-import saccubus.converter.classic.profile.LoginInfo;
-import saccubus.converter.classic.profile.CommentGetInfo;
-import saccubus.converter.classic.profile.Ffmpeg;
-import saccubus.converter.classic.profile.FfmpegOption;
-import saccubus.converter.classic.profile.GeneralSetting;
-import saccubus.converter.classic.profile.InputFileSetting;
-import saccubus.converter.classic.profile.OutputFileSetting;
import saccubus.converter.classic.profile.Profile;
-import saccubus.net.TextProgressListener;
/**
* <p>
}
public void execute(String[] args) throws IOException {
- execute(args, TextProgressListener.EMPTY_LISTENER, ConvertStopFlag.StateChangeListener.EMPTY_LISTENER);
- }
-
- public void execute(String[] args, TextProgressListener tpl, ConvertStopFlag.StateChangeListener scl) throws
- IOException {
Options options = createOptions(args);
Profile profile;
try {
throw new IOException(e);
}
- Converter conv = new Converter("dummy0", profile, tpl, new ConvertStopFlag(scl));
+ Converter conv = new Converter("dummy0", profile);
ExecutorService es = Executors.newSingleThreadExecutor();
Future<Boolean> future = es.submit((Callable<Boolean>) conv);
try {
// SProperties setting = SProperties.loadSetting(mail, pass);
// Converter conv = new Converter(tag, setting.toProfile(), TextProgressListener.EMPTY_LISTENER, new ConvertStopFlag(
// ConvertStopFlag.StateChangeListener.EMPTY_LISTENER));
- Converter conv = new Converter(tag, null/*この部分*/, TextProgressListener.EMPTY_LISTENER, new ConvertStopFlag(
- ConvertStopFlag.StateChangeListener.EMPTY_LISTENER));
+ Converter conv = new Converter(tag, null/*この部分*/);
System.out.println("-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-");
System.out.println("Saccubus on CUI");
System.out.println("-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-");
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
-import saccubus.ConvertStopFlag;
-import saccubus.net.TextProgressListener;
/**
*
@Test
public void testConverter() throws Exception {
- TextProgressListener listener = new TextProgressListener() {
-
- @Override
- public void setText(String text) {
- System.out.println(text);
- }
- };
- ConvertStopFlag flag = new ConvertStopFlag(ConvertStopFlag.StateChangeListener.EMPTY_LISTENER);
-
- Converter conv = new Converter("sm7139747", null, listener, flag);
+ Converter conv = new Converter("sm7139747", null);
conv.call();
}
// /**