package library.core.music;





public class CoreSeData {

	private int myId;
	private int id;
	private int streamId;	//流れている音に対するＩＤ
	private float leftVolume=0.5f;	//0~1
	private float rightVolume=0.5f; //0~1
	private int priority=0;	//優先度　０が一番高い
	private int loop=0;	//0 ;ループなし　−１：無限ループ
	private float rate=1;	//再生速度　0.5~2

	private boolean nowPlaying;
	private String name;


	public CoreSeData(String name){
		this.name=name;
	}

	/**
	 *
	 * @param name
	 * @param myId   音を鳴らす時に使用
	 * @param leftVolume    0~1
	 * @param rightVolume   0~1
	 * @param priority  優先度　０が一番高い
	 * @param isLoop      ループするかどうか
	 * @param speed　　　再生速度　0.5~2
	 */
	public CoreSeData(String name,int myId,float leftVolume,float rightVolume,int priority,boolean isLoop,float speed){
		this.name=name;
		this.myId=myId;
		this.leftVolume=leftVolume;
		this.rightVolume=rightVolume;
		this.priority=priority;
		this.rate=speed;

		this.nowPlaying=false;

		if(isLoop){
			this.loop=-1;
		}else{
			this.loop=0;
		}
	}

	/**
	 * 内部処理用
	 */
	public void setSeId(int id){
		this.id=id;
	}

	public int getId() {
		return id;
	}


	public void setLoop(boolean isLoop){
		if(isLoop){
			this.loop=-1;
		}else{
			this.loop=0;
		}
	}

	public boolean isLoop(){
		return this.loop==0?false:true;
	}

	public float getLeftVolume() {
		return leftVolume;
	}

	public void setLeftVolume(float leftVolume) {
		this.leftVolume = leftVolume;
	}

	public float getRightVolume() {
		return rightVolume;
	}

	public void setRightVolume(float rightVolume) {
		this.rightVolume = rightVolume;
	}

	public int getPriority() {
		return priority;
	}

	public void setPriority(int priority) {
		this.priority = priority;
	}

	public float getRate() {
		return rate;
	}

	public void setRate(float rate) {
		this.rate = rate;
	}


	public String getName() {
		return name;
	}

	public int getMyId() {
		return myId;
	}

	public void setMyId(int myId) {
		this.myId = myId;
	}

	public int getStreamId() {
		return streamId;
	}

	public void setStreamId(int streamId) {
		this.streamId = streamId;
	}

	public boolean isNowPlaying() {
		return nowPlaying;
	}

	public void setNowPlaying(boolean nowPlaying) {
		this.nowPlaying = nowPlaying;
	}





}
