package com.yonge.netty.dto;

import com.yonge.toolset.base.enums.BaseEnum;

public class NoteAnalysis {

	public enum NoteErrorType implements BaseEnum<String, NoteErrorType> {
		RIGHT("演奏正确"), CADENCE_WRONG("节奏错误"), INTONATION_WRONG("音准错误"), INTEGRITY_WRONG("完整度不足"), NOT_PLAY("未演奏"),

		CADENCE_FAST("节奏过快"),CADENCE_SLOW("节奏过慢"),
		INTONATION_HIGH("音准过高"),INTONATION_LOW("音准过低"),
		;

		private String msg;

		NoteErrorType(String msg) {
			this.msg = msg;
		}

		public String getMsg() {
			return msg;
		}

		@Override
		public String getCode() {
			return this.name();
		}
	}

	private int index;

	private int sectionIndex;

	private double startTime;

	private double endTime;
	
	private double durationTime;

	private int frequency;

	private int playFrequency = -1;

	private int tempo = 0;

	private NoteErrorType noteErrorType = NoteErrorType.RIGHT;

	private int score;
	
	private int intonationScore;
	
	private int tempoScore;
	
	private int integrityScore;

	private boolean ignore;
	
	private int measureRenderIndex;
	
	public NoteAnalysis(int measureRenderIndex, int index, int sectionIndex, int frequency, double durationTime) {
		this.measureRenderIndex = measureRenderIndex;
		this.durationTime = durationTime;
		this.index = index;
		this.sectionIndex = sectionIndex;
		this.frequency = frequency;
	}

	public NoteAnalysis(double startTime, double endTime, int playFrequency) {
		this.startTime = startTime;
		this.endTime = endTime;
		this.durationTime = endTime - startTime;
		this.playFrequency = playFrequency;
	}

	public int getMusicalNotesIndex() {
		return index;
	}

	public void setMusicalNotesIndex(int index) {
		this.index = index;
	}

	public double getStartTime() {
		return startTime;
	}

	public void setStartTime(double startTime) {
		this.startTime = startTime;
	}

	public double getEndTime() {
		return endTime;
	}

	public void setEndTime(double endTime) {
		this.endTime = endTime;
	}

	public double getDurationTime() {
		return durationTime;
	}

	public void setDurationTime(double durationTime) {
		this.durationTime = durationTime;
	}

	public double getPlayFrequency() {
		return playFrequency;
	}

	public void setPlayFrequency(int playFrequency) {
		this.playFrequency = playFrequency;
	}

	public int getFrequency() {
		return frequency;
	}

	public void setFrequency(int frequency) {
		this.frequency = frequency;
	}

	public int getTempo() {
		return tempo;
	}

	public void setTempo(int tempo) {
		this.tempo = tempo;
	}

	public int getSectionIndex() {
		return sectionIndex;
	}

	public void setSectionIndex(int sectionIndex) {
		this.sectionIndex = sectionIndex;
	}

	public boolean isIgnore() {
		return ignore;
	}

	public void setIgnore(boolean ignore) {
		this.ignore = ignore;
	}

	public NoteErrorType getMusicalErrorType() {
		return noteErrorType;
	}

	public void setMusicalErrorType(NoteErrorType noteErrorType) {
		this.noteErrorType = noteErrorType;
	}

	public int getScore() {
		return score;
	}

	public void setScore(int score) {
		this.score = score;
	}

	public int getIntonationScore() {
		return intonationScore;
	}

	public void setIntonationScore(int intonationScore) {
		this.intonationScore = intonationScore;
	}

	public int getTempoScore() {
		return tempoScore;
	}

	public void setTempoScore(int tempoScore) {
		this.tempoScore = tempoScore;
	}

	public int getIntegrityScore() {
		return integrityScore;
	}

	public void setIntegrityScore(int integrityScore) {
		this.integrityScore = integrityScore;
	}

	public int getMeasureRenderIndex() {
		return measureRenderIndex;
	}

}
