1
package org.herac.tuxguitar.io.tef.base;
3
import java.util.ArrayList;
4
import java.util.Iterator;
12
private TETempo tempo;
13
private TETimeSignature timeSignature;
14
private TERepeat[] repeats;
15
private TEText[] texts;
16
private TEChord[] chords;
17
private TEPercussion[] percussions;
18
private TERhythm[] rhythms;
19
private TETrack[] tracks;
20
private List components;
21
private List tsChanges;
24
this.components = new ArrayList();
25
this.tsChanges = new ArrayList();
28
public TERhythm[] getRhythms() {
32
public void setRhythms(int length) {
33
this.rhythms = new TERhythm[length];
36
public void setRhythm(int index,TERhythm rhythm) {
37
this.rhythms[index] = rhythm;
40
public TEPercussion[] getPercussions() {
41
return this.percussions;
44
public void setPercussions(int length) {
45
this.percussions = new TEPercussion[length];
48
public void setPercussion(int index,TEPercussion percussions) {
49
this.percussions[index] = percussions;
52
public TEChord[] getChords() {
56
public void setChords(int length) {
57
this.chords = new TEChord[length];
60
public void setChord(int index,TEChord chord) {
61
this.chords[index] = chord;
64
public TEInfo getInfo() {
68
public void setInfo(TEInfo info) {
72
public TERepeat[] getRepeats() {
76
public void setRepeats(int length) {
77
this.repeats = new TERepeat[length];
80
public void setRepeat(int index,TERepeat repeat) {
81
this.repeats[index] = repeat;
84
public TEText[] getTexts() {
88
public void setTexts(int length) {
89
this.texts = new TEText[length];
92
public void setText(int index,TEText text) {
93
this.texts[index] = text;
96
public TETrack[] getTracks() {
100
public void setTracks(int length) {
101
this.tracks = new TETrack[length];
104
public void setTrack(int index,TETrack track) {
105
this.tracks[index] = track;
108
public TETimeSignature getTimeSignature() {
109
return this.timeSignature;
112
public void setTimeSignature(TETimeSignature timeSignature) {
113
this.timeSignature = timeSignature;
116
public TETempo getTempo() {
120
public void setTempo(TETempo tempo) {
124
public int getStrings() {
128
public void setStrings(int strings) {
129
this.strings = strings;
132
public int getMeasures() {
133
return this.measures;
136
public void setMeasures(int measures) {
137
this.measures = measures;
140
public List getComponents() {
141
return this.components;
144
public void addTimeSignatureChange(TETimeSignatureChange tsChange){
145
this.tsChanges.add(tsChange);
148
public TETimeSignature getTimeSignature(int measure){
149
Iterator it = this.tsChanges.iterator();
151
TETimeSignatureChange change = (TETimeSignatureChange)it.next();
152
if(change.getMeasure() == measure){
153
return change.getTimeSignature();
156
return getTimeSignature();
159
public String toString(){
160
String string = new String("[SONG] *** Tabledit file format ***\n");
161
string += (this.getInfo().toString() + "\n");
162
string += (this.getTempo().toString() + "\n");
163
for(int i = 0; i < this.repeats.length; i ++){
164
string += (this.repeats[i].toString() + "\n");
166
for(int i = 0; i < this.texts.length; i ++){
167
string += (this.texts[i].toString() + "\n");
169
for(int i = 0; i < this.chords.length; i ++){
170
string += (this.chords[i].toString() + "\n");
172
for(int i = 0; i < this.percussions.length; i ++){
173
string += (this.percussions[i].toString() + "\n");
175
for(int i = 0; i < this.rhythms.length; i ++){
176
string += (this.rhythms[i].toString() + "\n");
178
for(int i = 0; i < this.tracks.length; i ++){
179
string += (this.tracks[i].toString() + "\n");
181
for(int i = 0; i < this.components.size(); i ++){
182
string += (this.components.get(i).toString() + "\n");