001package net.bramp.ffmpeg.job; 002 003import static com.google.common.base.Preconditions.checkNotNull; 004 005import javax.annotation.Nullable; 006import net.bramp.ffmpeg.FFmpeg; 007import net.bramp.ffmpeg.progress.ProgressListener; 008 009/** 010 * @author bramp 011 */ 012public abstract class FFmpegJob implements Runnable { 013 014 public enum State { 015 WAITING, 016 RUNNING, 017 FINISHED, 018 FAILED, 019 } 020 021 final FFmpeg ffmpeg; 022 final ProgressListener listener; 023 024 State state = State.WAITING; 025 026 public FFmpegJob(FFmpeg ffmpeg) { 027 this(ffmpeg, null); 028 } 029 030 public FFmpegJob(FFmpeg ffmpeg, @Nullable ProgressListener listener) { 031 this.ffmpeg = checkNotNull(ffmpeg); 032 this.listener = listener; 033 } 034 035 public State getState() { 036 return state; 037 } 038}