1
package org.herac.tuxguitar.io.tg;
3
import org.herac.tuxguitar.song.factory.TGFactory;
4
import org.herac.tuxguitar.song.models.TGDuration;
5
import org.herac.tuxguitar.song.models.TGMeasure;
6
import org.herac.tuxguitar.song.models.TGVelocities;
7
import org.herac.tuxguitar.util.TGVersion;
9
public class TGStream {
11
public static final String TG_FORMAT_NAME = ("TuxGuitar File Format");
13
public static final String TG_FORMAT_VERSION = (TG_FORMAT_NAME + " - " + TGVersion.CURRENT.getVersion() );
15
public static final String TG_FORMAT_EXTENSION = (".tg");
17
protected static final int TRACK_LYRICS = 0x01;
19
protected static final int CHANNEL_SOLO = 0x01;
21
protected static final int CHANNEL_MUTE = 0x02;
23
protected static final int MEASURE_HEADER_TIMESIGNATURE = 0x01;
25
protected static final int MEASURE_HEADER_TEMPO = 0x02;
27
protected static final int MEASURE_HEADER_REPEAT_OPEN = 0x04;
29
protected static final int MEASURE_HEADER_REPEAT_CLOSE = 0x08;
31
protected static final int MEASURE_HEADER_REPEAT_ALTERNATIVE = 0x10;
33
protected static final int MEASURE_HEADER_MARKER = 0x20;
35
protected static final int MEASURE_HEADER_TRIPLET_FEEL = 0x40;
37
protected static final int MEASURE_CLEF = 0x01;
39
protected static final int MEASURE_KEYSIGNATURE = 0x02;
41
protected static final int BEAT_HAS_NEXT = 0x01;
43
protected static final int BEAT_NEXT_DURATION = 0x02;
45
protected static final int BEAT_HAS_NOTES = 0x04;
47
protected static final int BEAT_HAS_CHORD = 0x08;
49
protected static final int BEAT_HAS_TEXT = 0x10;
51
protected static final int NOTE_HAS_NEXT = 0x01;
53
protected static final int NOTE_TIED = 0x02;
55
protected static final int NOTE_EFFECT = 0x04;
57
protected static final int NOTE_VELOCITY = 0x08;
59
protected static final int DURATION_DOTTED = 0x01;
61
protected static final int DURATION_DOUBLE_DOTTED = 0x02;
63
protected static final int DURATION_NO_TUPLETO = 0x04;
65
protected static final int EFFECT_BEND = 0x01;
67
protected static final int EFFECT_TREMOLO_BAR = 0x02;
69
protected static final int EFFECT_HARMONIC = 0x04;
71
protected static final int EFFECT_GRACE = 0x08;
73
protected static final int EFFECT_TRILL = 0x010;
75
protected static final int EFFECT_TREMOLO_PICKING = 0x020;
77
protected static final int EFFECT_VIBRATO = 0x040;
79
protected static final int EFFECT_DEAD = 0x080;
81
protected static final int EFFECT_SLIDE = 0x0100;
83
protected static final int EFFECT_HAMMER = 0x0200;
85
protected static final int EFFECT_GHOST = 0x0400;
87
protected static final int EFFECT_ACCENTUATED = 0x0800;
89
protected static final int EFFECT_HEAVY_ACCENTUATED = 0x01000;
91
protected static final int EFFECT_PALM_MUTE = 0x02000;
93
protected static final int EFFECT_STACCATO = 0x04000;
95
protected static final int EFFECT_TAPPING = 0x08000;
97
protected static final int EFFECT_SLAPPING = 0x010000;
99
protected static final int EFFECT_POPPING = 0x020000;
101
protected static final int EFFECT_FADE_IN = 0x040000;
103
protected static final int GRACE_FLAG_DEAD = 0x01;
105
protected static final int GRACE_FLAG_ON_BEAT = 0x02;
107
protected class TGBeatData {
109
private int velocity;
110
private TGDuration duration;
112
protected TGBeatData(TGMeasure measure){
116
private void init(TGMeasure measure){
117
this.setStart(measure.getStart());
118
this.setVelocity(TGVelocities.DEFAULT);
119
this.setDuration(new TGFactory().newDuration());
122
public TGDuration getDuration() {
123
return this.duration;
126
public void setDuration(TGDuration duration) {
127
this.duration = duration;
130
public long getStart() {
134
public void setStart(long start) {
138
public int getVelocity() {
139
return this.velocity;
142
public void setVelocity(int velocity) {
143
this.velocity = velocity;