2
* Created on 29-dic-2005
4
* TODO To change the template for this generated file go to
5
* Window - Preferences - Java - Code Style - Code Templates
7
package org.herac.tuxguitar.song.models;
9
import org.herac.tuxguitar.song.factory.TGFactory;
14
* TODO To change the template for this generated type comment go to
15
* Window - Preferences - Java - Code Style - Code Templates
17
public abstract class TGChord {
18
private int firstFret;
19
private int[] strings;
23
public TGChord(int length){
24
this.strings = new int[length];
25
for(int i = 0;i < this.strings.length;i++){
30
public TGBeat getBeat() {
34
public void setBeat(TGBeat beat) {
38
public void addFretValue(int string,int fret){
39
if(string >= 0 && string < this.strings.length){
40
this.strings[string] = fret;
44
public int getFretValue(int string){
45
if(string >= 0 && string < this.strings.length){
46
return this.strings[string];
51
public int getFirstFret() {
52
return this.firstFret;
55
public void setFirstFret(int firstFret) {
56
this.firstFret = firstFret;
59
public int[] getStrings() {
63
public void setStrings(int[] strings) {
64
this.strings = strings;
67
public int countStrings(){
68
return this.strings.length;
71
public int countNotes(){
73
for(int i = 0;i < this.strings.length;i++){
74
if(this.strings[i] >= 0){
81
public String getName() {
85
public void setName(String name) {
89
public TGChord clone(TGFactory factory){
90
TGChord chord = factory.newChord(this.strings.length);
91
chord.setName(getName());
92
chord.setFirstFret(getFirstFret());
93
for(int i = 0;i < chord.strings.length;i++){
94
chord.strings[i] = this.strings[i];