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

« back to all changes in this revision

Viewing changes to TuxGuitar/src/org/herac/tuxguitar/gui/editors/chord/ChordSettings.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.gui.editors.chord;
 
2
 
 
3
public class ChordSettings {
 
4
        
 
5
        private static ChordSettings instance;
 
6
        
 
7
        private boolean emptyStringChords;
 
8
        private float bassGrade;
 
9
        private float fingeringGrade;
 
10
        private float subsequentGrade;
 
11
        private float requiredBasicsGrade;
 
12
        private float manyStringsGrade;
 
13
        private float goodChordSemanticsGrade;
 
14
        private int chordsToDisplay;
 
15
        private int howManyIncompleteChords;
 
16
        private int chordTypeIndex;
 
17
        private int findChordsMin;
 
18
        private int findChordsMax;
 
19
        
 
20
        private ChordSettings() {
 
21
                this.emptyStringChords = false;
 
22
                this.bassGrade = 200.0f;
 
23
                this.fingeringGrade = 150.0f; // was:200
 
24
                this.subsequentGrade = 200.0f;
 
25
                this.requiredBasicsGrade = 150.0f;
 
26
                this.manyStringsGrade = 100.0f;
 
27
                this.goodChordSemanticsGrade = 200.0f;
 
28
                this.chordsToDisplay = 30;
 
29
                this.howManyIncompleteChords = 4;
 
30
                this.chordTypeIndex = 0;
 
31
                this.findChordsMin=0;
 
32
                this.findChordsMax=15;
 
33
        }
 
34
        
 
35
        public static ChordSettings instance(){
 
36
                if( instance == null ){
 
37
                        instance = new ChordSettings();
 
38
                }
 
39
                return instance;
 
40
        }
 
41
        
 
42
        public float getBassGrade() {
 
43
                return this.bassGrade;
 
44
        }
 
45
        
 
46
        public void setBassGrade(float bassGrade) {
 
47
                this.bassGrade = bassGrade;
 
48
        }
 
49
        
 
50
        public int getChordsToDisplay() {
 
51
                return this.chordsToDisplay;
 
52
        }
 
53
        
 
54
        public void setChordsToDisplay(int chordsToDisplay) {
 
55
                this.chordsToDisplay = chordsToDisplay;
 
56
        }
 
57
        
 
58
        public boolean isEmptyStringChords() {
 
59
                return this.emptyStringChords;
 
60
        }
 
61
        
 
62
        public void setEmptyStringChords(boolean emptyStringChords) {
 
63
                this.emptyStringChords = emptyStringChords;
 
64
        }
 
65
        
 
66
        public float getFingeringGrade() {
 
67
                return this.fingeringGrade;
 
68
        }
 
69
        
 
70
        public void setFingeringGrade(float fingeringGrade) {
 
71
                this.fingeringGrade = fingeringGrade;
 
72
        }
 
73
        
 
74
        public float getGoodChordSemanticsGrade() {
 
75
                return this.goodChordSemanticsGrade;
 
76
        }
 
77
        
 
78
        public void setGoodChordSemanticsGrade(float goodChordSemanticsGrade) {
 
79
                this.goodChordSemanticsGrade = goodChordSemanticsGrade;
 
80
        }
 
81
        
 
82
        public float getManyStringsGrade() {
 
83
                return this.manyStringsGrade;
 
84
        }
 
85
        
 
86
        public void setManyStringsGrade(float manyStringsGrade) {
 
87
                this.manyStringsGrade = manyStringsGrade;
 
88
        }
 
89
        
 
90
        public float getRequiredBasicsGrade() {
 
91
                return this.requiredBasicsGrade;
 
92
        }
 
93
        
 
94
        public void setRequiredBasicsGrade(float requiredBasicsGrade) {
 
95
                this.requiredBasicsGrade = requiredBasicsGrade;
 
96
        }
 
97
        
 
98
        public float getSubsequentGrade() {
 
99
                return this.subsequentGrade;
 
100
        }
 
101
        
 
102
        public void setSubsequentGrade(float subsequentGrade) {
 
103
                this.subsequentGrade = subsequentGrade;
 
104
        }
 
105
        
 
106
        public int getIncompleteChords() {
 
107
                return this.howManyIncompleteChords;
 
108
        }
 
109
        
 
110
        public void setIncompleteChords(int incomplete) {
 
111
                this.howManyIncompleteChords = incomplete;
 
112
        }
 
113
        
 
114
        public int getFindChordsMin() {
 
115
                return this.findChordsMin;
 
116
        }
 
117
        
 
118
        public void setFindChordsMin(int min) {
 
119
                this.findChordsMin = min;
 
120
        }
 
121
        
 
122
        public int getFindChordsMax() {
 
123
                return this.findChordsMax;
 
124
        }
 
125
        
 
126
        public void setFindChordsMax(int max) {
 
127
                this.findChordsMax = max;
 
128
        }
 
129
        
 
130
        public int getChordTypeIndex() {
 
131
                return this.chordTypeIndex;
 
132
        }
 
133
        
 
134
        public void setChordTypeIndex(int index) {
 
135
                switch (index) {
 
136
                        case 0 : // normal
 
137
                                        this.bassGrade = 200.0f;
 
138
                                        this.fingeringGrade = 150.0f;
 
139
                                        this.subsequentGrade = 200.0f;
 
140
                                        this.requiredBasicsGrade = 150.0f;
 
141
                                        this.manyStringsGrade = 100.0f;
 
142
                                        this.goodChordSemanticsGrade = 200.0f;
 
143
                                    break;
 
144
                        case 1 : // inversions
 
145
                                        this.bassGrade = -100.0f;
 
146
                                        this.fingeringGrade = 150.0f;
 
147
                                        this.subsequentGrade = 200.0f;
 
148
                                        this.requiredBasicsGrade = 150.0f;
 
149
                                        this.manyStringsGrade = 50.0f;
 
150
                                        this.goodChordSemanticsGrade = 200.0f;
 
151
                                        break;
 
152
                        case 2 : // close-voiced
 
153
                                        this.bassGrade = 50.0f;
 
154
                                        this.fingeringGrade = 200.0f;
 
155
                                        this.subsequentGrade = 350.0f;
 
156
                                        this.requiredBasicsGrade = 150.0f;
 
157
                                        this.manyStringsGrade = -100.0f;
 
158
                                        this.goodChordSemanticsGrade = 200.0f;
 
159
                                        break;
 
160
                        case 3 : // open-voiced
 
161
                                        this.bassGrade = 100.0f;
 
162
                                        this.fingeringGrade = 100.0f;
 
163
                                        this.subsequentGrade = -80.0f;
 
164
                                        this.requiredBasicsGrade = 100.0f;
 
165
                                        this.manyStringsGrade = -80.0f;
 
166
                                        this.goodChordSemanticsGrade = 200.0f;
 
167
                                        break;
 
168
                }
 
169
                this.chordTypeIndex = index;
 
170
        }
 
171
}