1 /* 2 * Created on 23-nov-2005 3 * 4 * TODO To change the template for this generated file go to 5 * Window - Preferences - Java - Code Style - Code Templates 6 */ 7 package org.herac.tuxguitar.song.models; 8 9 import org.herac.tuxguitar.song.factory.TGFactory; 10 11 /** 12 * @author julian 13 * 14 * TODO To change the template for this generated type comment go to Window - Preferences - Java - Code Style - Code Templates 15 */ 16 public abstract class TGNote { 17 private int value; 18 private int velocity; 19 private int string; 20 private boolean tiedNote; 21 private TGNoteEffect effect; 22 private TGVoice voice; 23 TGNote(TGFactory factory)24 public TGNote(TGFactory factory) { 25 this.value = 0; 26 this.velocity = TGVelocities.DEFAULT; 27 this.string = 1; 28 this.tiedNote = false; 29 this.effect = factory.newEffect(); 30 } 31 getValue()32 public int getValue() { 33 return this.value; 34 } 35 setValue(int value)36 public void setValue(int value) { 37 this.value = value; 38 } 39 getVelocity()40 public int getVelocity() { 41 return this.velocity; 42 } 43 setVelocity(int velocity)44 public void setVelocity(int velocity) { 45 this.velocity = velocity; 46 } 47 getString()48 public int getString() { 49 return this.string; 50 } 51 setString(int string)52 public void setString(int string) { 53 this.string = string; 54 } 55 isTiedNote()56 public boolean isTiedNote() { 57 return this.tiedNote; 58 } 59 setTiedNote(boolean tiedNote)60 public void setTiedNote(boolean tiedNote) { 61 this.tiedNote = tiedNote; 62 } 63 getEffect()64 public TGNoteEffect getEffect() { 65 return this.effect; 66 } 67 setEffect(TGNoteEffect effect)68 public void setEffect(TGNoteEffect effect) { 69 this.effect = effect; 70 } 71 getVoice()72 public TGVoice getVoice() { 73 return this.voice; 74 } 75 setVoice(TGVoice voice)76 public void setVoice(TGVoice voice) { 77 this.voice = voice; 78 } 79 clone(TGFactory factory)80 public TGNote clone(TGFactory factory){ 81 TGNote note = factory.newNote(); 82 note.setValue(getValue()); 83 note.setVelocity(getVelocity()); 84 note.setString(getString()); 85 note.setTiedNote(isTiedNote()); 86 note.setEffect(getEffect().clone(factory)); 87 return note; 88 } 89 }