reversound/src/conteneurs/NoteProfiled.java
gaugendre 6b4ec42c01 adding code
Switching from INSA svn to GitHub
2014-06-11 15:35:06 +02:00

51 lines
1 KiB
Java

package conteneurs;
/**
* Created by gaby on 14/05/14.
*/
public class NoteProfiled extends ObservableObject{
private int idNote;
private Profil profil;
public NoteProfiled(int idNote, Profil profil) {
this.idNote = idNote;
this.profil = profil;
}
@Override
public Class getType() {
return NoteProfiled.class;
}
public Profil getProfil() {
return profil;
}
/** Permet de definir le profil d'une note, cad l'amplitude des harmoniques
* @param profil le profil de la note */
public void setProfil(Profil profil) {
this.profil = profil;
emit(ObservableObjectEvent.Type.DATA_CHANGED);
}
/** Indice qui caracterise la hauteur de la note */
public int getIdNote() {
return idNote;
}
/** Renvoie la frequence d'une note à partir de son indice (exemple: la 49) */
public float getFreq(){
return NoteGamme.getStatFreq(idNote);
}
/** Renvoie le nom de la note a partir de sa hauteur */
public String getNoteName(){
return NoteGamme.getNoteName(idNote);
}
public String toString(){
return getNoteName();
}
}