/**
 * CS400 3DMotionCapture
 * 
 * CMCThreadInfo
 * Container class for necessary information for the threads
 * All methods must be implemented with synchronized to be thread-safe.
 * 
 * @author Kohei Shinkawa
 * @version 3-11-2010
 * */
public class CMCThreadInfo {
	
	//Info for canvas
	private double height; 
	private double width;
	private double[] rotation = {0,0,0}; /*Rotation information passed from CMCgui*/
	private float[] curMatrix;
	
	
	private boolean init; //Flag for blacking the canvas at the first step
	private boolean rewind; //Flag for rewinding
	private boolean done; //Flag for initialization
	private boolean play; //Flag for play and pause
	private boolean ready; //Flag for video and animation thread to synchronize
	private boolean destroy; //Flag to terminate the threads 
	
	private int curFrame; 
	private int endFrame;
	private int mode; /*Indicator for the camera position*/
	int skin; /*Indicator for which skin to use*/
	
	public CMCThreadInfo(double height, double width, boolean rewind, int curFrame, int endFrame) {
		this.height = height;
		this.width = width;

		this.init = true;
		this.rewind = rewind;
		this.done = false;
		this.play = false;
		this.ready = false;
		this.curFrame = curFrame;
		this.endFrame = endFrame;
		this.mode = 1;
		this.skin = 0;
	}
	
	
	/**Getters and setters for all the fields above*/
	public synchronized double getHeight() {
		return height;
	}
	public synchronized double getWidth() {
		return width;
	}
	public synchronized boolean isRewind() {
		return rewind;
	}
	public synchronized boolean isDone() {
		return done;
	}
	public synchronized int getCurFrame() {
		return curFrame;
	}
	public synchronized int getEndFrame() {
		return endFrame;
	}
	public synchronized void setHeight(double height) {
		this.height = height;
	}
	public synchronized void setWidth(double width) {
		this.width = width;
	}
	public synchronized void setRewind(boolean rewind) {
		this.rewind = rewind;
	}
	public synchronized void setDone(boolean done) {
		this.done = done;
	}
	public synchronized void setCurFrame(int curFrame) {
		this.curFrame = curFrame;
	}
	public synchronized void setEndFrame(int endFrame) {
		this.endFrame = endFrame;
	}

	public synchronized boolean isPlay() {
		return play;
	}

	public synchronized void setPlay(boolean play) {
		this.play = play;
	}

	public synchronized boolean isReady() {
		return ready;
	} 

	public synchronized void setReady(boolean ready) {
		this.ready = ready;
	}

	public synchronized boolean isDestroy() {
		return destroy;
	}

	public synchronized void setDestroy(boolean destroy) {
		this.destroy = destroy;
	}


	public synchronized boolean isInit() {
		return init;
	}


	public synchronized void setInit(boolean init) {
		this.init = init;
	}


	public synchronized int getMode() {
		return mode;
	}


	public synchronized void setMode(int mode) {
		this.mode = mode;
	}


	public synchronized double[] getRotation() {
		return rotation;
	}


	public synchronized void setRotation(double[] rotation) {
		this.rotation = rotation;
	}


	public synchronized int getSkin() {
		return skin;
	}


	public synchronized void setSkin(int skin) {
		this.skin = skin;
	}


	public synchronized float[] getCurMatrix() {
		return curMatrix;
	}


	public synchronized void setCurMatrix(float[] curMatrix) {
		this.curMatrix = curMatrix;
	}
}
