~ubuntu-branches/ubuntu/oneiric/tuxguitar/oneiric

« back to all changes in this revision

Viewing changes to TuxGuitar/src/org/herac/tuxguitar/io/tg/TGStream.java

  • Committer: Bazaar Package Importer
  • Author(s): Philippe Coval
  • Date: 2008-06-19 00:30:30 UTC
  • mto: (5.1.2 sid)
  • mto: This revision was merged to the branch mainline in revision 3.
  • Revision ID: james.westby@ubuntu.com-20080619003030-h719szrhsngou7c6
Tags: upstream-1.0
ImportĀ upstreamĀ versionĀ 1.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
package org.herac.tuxguitar.io.tg;
 
2
 
 
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;
 
8
 
 
9
public class TGStream {
 
10
        
 
11
        public static final String TG_FORMAT_NAME = ("TuxGuitar File Format");
 
12
        
 
13
        public static final String TG_FORMAT_VERSION = (TG_FORMAT_NAME + " - " + TGVersion.CURRENT.getVersion() );
 
14
        
 
15
        public static final String TG_FORMAT_EXTENSION = (".tg");
 
16
        
 
17
        protected static final int TRACK_LYRICS = 0x01;
 
18
        
 
19
        protected static final int CHANNEL_SOLO = 0x01;
 
20
        
 
21
        protected static final int CHANNEL_MUTE = 0x02;
 
22
        
 
23
        protected static final int MEASURE_HEADER_TIMESIGNATURE = 0x01;
 
24
        
 
25
        protected static final int MEASURE_HEADER_TEMPO = 0x02;
 
26
        
 
27
        protected static final int MEASURE_HEADER_REPEAT_OPEN = 0x04;
 
28
        
 
29
        protected static final int MEASURE_HEADER_REPEAT_CLOSE = 0x08;
 
30
        
 
31
        protected static final int MEASURE_HEADER_REPEAT_ALTERNATIVE = 0x10;
 
32
        
 
33
        protected static final int MEASURE_HEADER_MARKER = 0x20;
 
34
        
 
35
        protected static final int MEASURE_HEADER_TRIPLET_FEEL = 0x40;
 
36
        
 
37
        protected static final int MEASURE_CLEF = 0x01;
 
38
        
 
39
        protected static final int MEASURE_KEYSIGNATURE = 0x02;
 
40
        
 
41
        protected static final int BEAT_HAS_NEXT = 0x01;
 
42
        
 
43
        protected static final int BEAT_NEXT_DURATION = 0x02;
 
44
        
 
45
        protected static final int BEAT_HAS_NOTES = 0x04;
 
46
        
 
47
        protected static final int BEAT_HAS_CHORD = 0x08;
 
48
        
 
49
        protected static final int BEAT_HAS_TEXT = 0x10;
 
50
        
 
51
        protected static final int NOTE_HAS_NEXT = 0x01;
 
52
        
 
53
        protected static final int NOTE_TIED = 0x02;
 
54
        
 
55
        protected static final int NOTE_EFFECT = 0x04;
 
56
        
 
57
        protected static final int NOTE_VELOCITY = 0x08;
 
58
        
 
59
        protected static final int DURATION_DOTTED = 0x01;
 
60
        
 
61
        protected static final int DURATION_DOUBLE_DOTTED = 0x02;
 
62
        
 
63
        protected static final int DURATION_NO_TUPLETO = 0x04;
 
64
        
 
65
        protected static final int EFFECT_BEND = 0x01;
 
66
        
 
67
        protected static final int EFFECT_TREMOLO_BAR = 0x02;
 
68
        
 
69
        protected static final int EFFECT_HARMONIC = 0x04;
 
70
        
 
71
        protected static final int EFFECT_GRACE = 0x08;
 
72
        
 
73
        protected static final int EFFECT_TRILL = 0x010;
 
74
        
 
75
        protected static final int EFFECT_TREMOLO_PICKING = 0x020;
 
76
        
 
77
        protected static final int EFFECT_VIBRATO = 0x040;
 
78
        
 
79
        protected static final int EFFECT_DEAD = 0x080;
 
80
        
 
81
        protected static final int EFFECT_SLIDE = 0x0100;
 
82
        
 
83
        protected static final int EFFECT_HAMMER = 0x0200;
 
84
        
 
85
        protected static final int EFFECT_GHOST = 0x0400;
 
86
        
 
87
        protected static final int EFFECT_ACCENTUATED = 0x0800;
 
88
        
 
89
        protected static final int EFFECT_HEAVY_ACCENTUATED = 0x01000;
 
90
        
 
91
        protected static final int EFFECT_PALM_MUTE = 0x02000;
 
92
        
 
93
        protected static final int EFFECT_STACCATO = 0x04000;
 
94
        
 
95
        protected static final int EFFECT_TAPPING = 0x08000;
 
96
        
 
97
        protected static final int EFFECT_SLAPPING = 0x010000;
 
98
        
 
99
        protected static final int EFFECT_POPPING = 0x020000;
 
100
        
 
101
        protected static final int EFFECT_FADE_IN = 0x040000;
 
102
        
 
103
        protected static final int GRACE_FLAG_DEAD = 0x01;
 
104
        
 
105
        protected static final int GRACE_FLAG_ON_BEAT = 0x02;
 
106
        
 
107
        protected class TGBeatData {
 
108
                private long start;
 
109
                private int velocity;
 
110
                private TGDuration duration;
 
111
                
 
112
                protected TGBeatData(TGMeasure measure){
 
113
                        this.init(measure);
 
114
                }
 
115
                
 
116
                private void init(TGMeasure measure){
 
117
                        this.setStart(measure.getStart());
 
118
                        this.setVelocity(TGVelocities.DEFAULT);
 
119
                        this.setDuration(new TGFactory().newDuration());
 
120
                }
 
121
                
 
122
                public TGDuration getDuration() {
 
123
                        return this.duration;
 
124
                }
 
125
                
 
126
                public void setDuration(TGDuration duration) {
 
127
                        this.duration = duration;
 
128
                }
 
129
                
 
130
                public long getStart() {
 
131
                        return this.start;
 
132
                }
 
133
                
 
134
                public void setStart(long start) {
 
135
                        this.start = start;
 
136
                }
 
137
                
 
138
                public int getVelocity() {
 
139
                        return this.velocity;
 
140
                }
 
141
                
 
142
                public void setVelocity(int velocity) {
 
143
                        this.velocity = velocity;
 
144
                }
 
145
        }
 
146
}