/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package data;

import jm.music.data.Note;

/**
 *
 * @author Tom
 */
public class NoteData {
   private int pitch = 0;
   private double startTime = 0.0;
   private double duration = 0.0;
   private double quantizedDuration = 0.0;
   //private double markingOne = 0.0, markingTwo = 0.0, markingThree = 0.0, markingFour = 0.0;
   //private int mappingOne = 0, mappingTwo = 0, mappingThree = 0, mappingFour = 0;

   public NoteData() {
   }
   
   public NoteData(double startTime) {
      this.startTime = startTime;
      this.pitch = 0;
      this.duration = 0.0;
   }
   
   public NoteData(int pitch) {
      this.startTime = 0.0;
      this.pitch = pitch;
      this.duration = 0.0;
   }
   
   public NoteData(double startTime, double duration) {
      this.startTime = startTime;
      this.pitch = 0;
      this.duration = duration;
   }

   public NoteData(double startTime, int pitch) {
      this.startTime = startTime;
      this.pitch = pitch;
      this.duration = 0.0;
   }
   
   public NoteData(double startTime, double duration, int pitch) {
      this.startTime = startTime;
      this.pitch = pitch;
      this.duration = duration;
   }

    public NoteData(double startTime, double duration, double quantizedDuration, int pitch){//, double markingOne, double markingTwo, double markingThree, double markingFour,
            //int mappingOne, int mappingTwo, int mappingThree, int mappingFour) {
       this.startTime = startTime;
       this.pitch = pitch;
       this.duration = duration;
       this.quantizedDuration = quantizedDuration;
       /*this.markingOne = markingOne;
       this.markingTwo = markingTwo;
       this.markingThree = markingThree;
       this.markingFour = markingFour;
       this.mappingOne = mappingOne;
       this.mappingTwo = mappingTwo;
       this.mappingThree = mappingThree;
       this.mappingFour = mappingFour;*/
    }
   
   public NoteData Clone(){
       return new NoteData(startTime, duration, quantizedDuration, pitch);//, markingOne, markingTwo, markingThree, markingFour, mappingOne, mappingTwo, mappingThree, mappingFour);
   }
   
   public double getStartTime() {
      return startTime;
   }

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

    /*public int getMappingOne() {
        return mappingOne;
    }

    public void setMappingOne(int mappingOne) {
        this.mappingOne = mappingOne;
    }

    public int getMappingTwo() {
        return mappingTwo;
    }

    public void setMappingTwo(int mappingTwo) {
        this.mappingTwo = mappingTwo;
    }

    public int getMappingThree() {
        return mappingThree;
    }

    public void setMappingThree(int mappingThree) {
        this.mappingThree = mappingThree;
    }

    public int getMappingFour() {
        return mappingFour;
    }

    public void setMappingFour(int mappingFour) {
        this.mappingFour = mappingFour;
    }*/

   public int getPitch() {
      return pitch;
   }
   
   public String getNote() {
      if (pitch == Integer.MIN_VALUE)
      {
        return "REST";
      } else {
          if (Note.getNote(pitch).equalsIgnoreCase("N/A")){
              return "REST";
          }
          return Note.getNote(pitch);
      }
   }

   public void setPitch(int pitch) {
      this.pitch = pitch;
   }

    public double getDuration() {
        return duration;
    }

    public void setDuration(double duration) {
        this.duration = duration;
    }

    public double getQuantizedDuration() {
        return quantizedDuration;
    }

    public void setQuantizedDuration(double quantizedDuration) {
        this.quantizedDuration = quantizedDuration;
    }
    
    /*public double getMarkingOne() {
        return markingOne;
    }

    public void setMarkingOne(double markingOne) {
        this.markingOne = markingOne;
    }

    public double getMarkingTwo() {
        return markingTwo;
    }

    public void setMarkingTwo(double markingTwo) {
        this.markingTwo = markingTwo;
    }

    public double getMarkingThree() {
        return markingThree;
    }

    public void setMarkingThree(double markingThree) {
        this.markingThree = markingThree;
    }

    public double getMarkingFour() {
        return markingFour;
    }

    public void setMarkingFour(double markingFour) {
        this.markingFour = markingFour;
    }*/
   
    @Override
    public String toString(){
       return pitch +" " +startTime +" " +duration;
    }
    
    @Override
    public NoteData clone(){
        return new NoteData(startTime, duration, quantizedDuration, pitch);
    }
}
