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
public static final int POSITION_TOP = 0;
8
public static final int POSITION_SCORE_UP_LINES = 1;
9
public static final int POSITION_SCORE_MIDDLE_LINES = 2;
10
public static final int POSITION_SCORE_DOWN_LINES = 3;
11
public static final int POSITION_TUPLETO = 4;
12
public static final int POSITION_ACCENTUATED_EFFECT = 5;
13
public static final int POSITION_HARMONIC_EFFEC = 6;
14
public static final int POSITION_TAPPING_EFFEC = 7;
15
public static final int POSITION_PALM_MUTE_EFFEC = 8;
16
public static final int POSITION_VIBRATO_EFFEC = 9;
17
public static final int POSITION_FADE_IN = 10;
18
public static final int POSITION_TABLATURE_TOP_SEPARATOR = 11;
19
public static final int POSITION_TABLATURE = 12;
20
public static final int POSITION_LYRIC = 13;
21
public static final int POSITION_BOTTOM = 14;
23
private static final int[][] POSITIONS = new int[][]{
27
1, //POSITION_SCORE_UP_LINES
28
2, //POSITION_SCORE_MIDDLE_LINES
29
3, //POSITION_SCORE_DOWN_LINES
31
5, //POSITION_ACCENTUATED_EFFECT
32
6, //POSITION_HARMONIC_EFFEC
33
7, //POSITION_TAPPING_EFFEC
34
8, //POSITION_PALM_MUTE_EFFEC
35
9, //POSITION_VIBRATO_EFFEC
36
10, //POSITION_FADE_IN
37
11, //POSITION_TABLATURE_TOP_SEPARATOR
38
12, //POSITION_TABLATURE
46
12, //POSITION_SCORE_UP_LINES
47
13, //POSITION_SCORE_MIDDLE_LINES
48
14, //POSITION_SCORE_DOWN_LINES
51
2, //POSITION_HARMONIC_EFFEC
52
3, //POSITION_TAPPING_EFFEC
53
4, //POSITION_PALM_MUTE_EFFEC
54
5, //POSITION_VIBRATO_EFFEC
55
1, //POSITION_ACCENTUATED_EFFECT
56
7, //POSITION_TABLATURE_TOP_SEPARATOR
57
8, //POSITION_TABLATURE
62
/** SCORE & TABLATURE **/
65
1, //POSITION_SCORE_UP_LINES
66
2, //POSITION_SCORE_MIDDLE_LINES
67
3, //POSITION_SCORE_DOWN_LINES
69
5, //POSITION_ACCENTUATED_EFFECT
70
6, //POSITION_HARMONIC_EFFEC
71
7, //POSITION_TAPPING_EFFEC
72
8, //POSITION_PALM_MUTE_EFFEC
73
9, //POSITION_VIBRATO_EFFEC
74
10, //POSITION_FADE_IN
75
11, //POSITION_TABLATURE_TOP_SEPARATOR
76
12, //POSITION_TABLATURE
83
private int[] spacing;
85
public TrackSpacing(ViewLayout layout){
87
this.flags |= (layout.isScoreEnabled()?SCORE:0);
88
this.flags |= (layout.isTablatureEnabled()?TABLATURE:0);
89
this.spacing = new int[15];
92
public void setSize(int index,int size){
93
this.spacing[ POSITIONS [this.flags -1] [index] ] = size;
98
for(int i = 0;i < this.spacing.length; i ++){
99
span += this.spacing[i];
104
public int getPosition(int index){
106
for(int i = 0;i < POSITIONS[this.flags -1][index]; i ++){
107
span += this.spacing[i];