1
package org.herac.tuxguitar.gui.editors.tab.layout;
3
public class TrackSpacing {
4
public static final int SCORE = 0x01;
5
public static final int TABLATURE = 0x02;
7
/*** POSITIONS ARRAY INDICES ***/
8
public static final int POSITION_TOP = 0;
9
public static final int POSITION_TEXT = 1;
10
public static final int POSITION_BUFFER_SEPARATOR = 2;
11
public static final int POSITION_REPEAT_ENDING = 3;
12
public static final int POSITION_CHORD = 4;
13
public static final int POSITION_SCORE_UP_LINES = 5;
14
public static final int POSITION_SCORE_MIDDLE_LINES = 6;
15
public static final int POSITION_SCORE_DOWN_LINES = 7;
16
public static final int POSITION_TUPLETO = 8;
17
public static final int POSITION_ACCENTUATED_EFFECT = 9;
18
public static final int POSITION_HARMONIC_EFFEC = 10;
19
public static final int POSITION_TAPPING_EFFEC = 11;
20
public static final int POSITION_PALM_MUTE_EFFEC = 12;
21
public static final int POSITION_VIBRATO_EFFEC = 13;
22
public static final int POSITION_FADE_IN = 14;
23
public static final int POSITION_TABLATURE_TOP_SEPARATOR = 15;
24
public static final int POSITION_TABLATURE = 16;
25
public static final int POSITION_LYRIC = 17;
26
public static final int POSITION_BOTTOM = 18;
28
private static final int[][] POSITIONS = new int[][]{
33
2, //POSITION_BUFFER_SEPARATOR
34
3, //POSITION_REPEAT_ENDING
36
11, //POSITION_SCORE_UP_LINES
37
12, //POSITION_SCORE_MIDDLE_LINES
38
13, //POSITION_SCORE_DOWN_LINES
39
14, //POSITION_TUPLETO
40
5, //POSITION_ACCENTUATED_EFFECT
41
6, //POSITION_HARMONIC_EFFEC
42
7, //POSITION_TAPPING_EFFEC
43
8, //POSITION_PALM_MUTE_EFFEC
44
9, //POSITION_VIBRATO_EFFEC
45
10, //POSITION_FADE_IN
46
15, //POSITION_TABLATURE_TOP_SEPARATOR
47
16, //POSITION_TABLATURE
56
2, //POSITION_BUFFER_SEPARATOR
57
3, //POSITION_REPEAT_ENDING
59
16, //POSITION_SCORE_UP_LINES
60
17, //POSITION_SCORE_MIDDLE_LINES
61
18, //POSITION_SCORE_DOWN_LINES
62
13, //POSITION_TUPLETO
63
5, //POSITION_ACCENTUATED_EFFECT
64
6, //POSITION_HARMONIC_EFFEC
65
7, //POSITION_TAPPING_EFFEC
66
8, //POSITION_PALM_MUTE_EFFEC
67
9, //POSITION_VIBRATO_EFFEC
68
10, //POSITION_FADE_IN
69
11, //POSITION_TABLATURE_TOP_SEPARATOR
70
12, //POSITION_TABLATURE
75
/** SCORE | TABLATURE **/
79
2, //POSITION_BUFFER_SEPARATOR
80
3, //POSITION_REPEAT_ENDING
82
5, //POSITION_SCORE_UP_LINES
83
6, //POSITION_SCORE_MIDDLE_LINES
84
7, //POSITION_SCORE_DOWN_LINES
86
9, //POSITION_ACCENTUATED_EFFECT
87
10, //POSITION_HARMONIC_EFFEC
88
11, //POSITION_TAPPING_EFFEC
89
12, //POSITION_PALM_MUTE_EFFEC
90
13, //POSITION_VIBRATO_EFFEC
91
14, //POSITION_FADE_IN
92
15, //POSITION_TABLATURE_TOP_SEPARATOR
93
16, //POSITION_TABLATURE
100
private int[] spacing;
102
public TrackSpacing(ViewLayout layout){
104
this.flags |= ((layout.getStyle() & ViewLayout.DISPLAY_SCORE) != 0?SCORE:0);
105
this.flags |= ((layout.getStyle() & ViewLayout.DISPLAY_TABLATURE) != 0 ?TABLATURE:0);
106
this.spacing = new int[18];
109
public void setSize(int index,int size){
110
this.spacing[ POSITIONS [this.flags -1] [index] ] = size;
113
public int getSize(){
115
for(int i = 0;i < this.spacing.length; i ++){
116
spacing += this.spacing[i];
121
public int getPosition(int index){
123
for(int i = 0;i < POSITIONS[this.flags -1][index]; i ++){
124
spacing += this.spacing[i];
b'\\ No newline at end of file'