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

import java.util.ArrayList;
import java.util.List;

/**
 *
 * @author Tom
 */
public class MIDIFileData {
    private int id = -1;
    private String title = "";
    private String filepath = "";
    private int other = 0;
    private int highNote = 0; //Highest Note
    private int lowNote = 127; //Lowest Note
    private double longestNote = 0.0; //Longest Note
    private double shortestNote  = 100.0; //shortest Note
    private int ascending = 0; //Upward movements
    private int descending = 0; //Downward movements
    private int[] Pitch = new int[128];
    private List<Integer> instruments = new ArrayList<>();
    private List<Integer> percussions = new ArrayList<>();
    private String key = "";
    
    public MIDIFileData()
    {
        initPitch();
    }
    
    private void initPitch() {
       for (int i=0; i<Pitch.length; i++) {
          Pitch[i] = 0;
       }
    }
    
    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }
    
    public String getFilepath() {
        return filepath;
    }

    public void setFilepath(String filepath) {
        this.filepath = filepath;
    }
    
    public void setTitle(String _title)
    {
        title = _title;
    }
    
    public void setOther(int _other)
    {
        other = _other;
    }
    
    public String getTitle()
    {
        return title;
    }
    
    public int getOther()
    {
        return other;
    }

    public int getHighNote() {
        return highNote;
    }

    public void setHighNote(int highNote) {
        this.highNote = highNote;
    }

    public int getLowNote() {
        return lowNote;
    }

    public void setLowNote(int lowNote) {
        this.lowNote = lowNote;
    }

    public double getLongestNote() {
        return longestNote;
    }

    public void setLongestNote(double longestNote) {
        this.longestNote = longestNote;
    }

    public double getShortestNote() {
        return shortestNote;
    }

    public void setShortestNote(double shortestNote) {
        this.shortestNote = shortestNote;
    }

    public int getAscending() {
        return ascending;
    }

    public void setAscending(int ascending) {
        this.ascending = ascending;
    }

    public int getDescending() {
        return descending;
    }

    public void setDescending(int descending) {
        this.descending = descending;
    }

    public int getPitch(int index) {
      return Pitch[index];
   }

   public void increasePitch(int index) {
      this.Pitch[index]++;
   }
   
   public void setPitch(int index, int value) {
      this.Pitch[index] = value;
   }
   
   public int[] getPitches() {
      return Pitch;
   }
   
   public List<Integer> getInstruments() {
      return instruments;
   }

   public void addInstrument(int instrument) {
      this.instruments.add(instrument);
   }

   public List<Integer> getPercussion() {
      return percussions;
   }

   public void addPercussion(int percussion) {
      this.percussions.add(percussion);
   }

   public String getKey() {
      return key;
   }

   public void setKey(String key) {
      this.key = key;
   }
   
}
