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

« back to all changes in this revision

Viewing changes to TuxGuitar/src/org/herac/tuxguitar/song/models/effects/TGEffectHarmonic.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.song.models.effects;
 
2
 
 
3
import org.herac.tuxguitar.song.factory.TGFactory;
 
4
 
 
5
public abstract class TGEffectHarmonic {
 
6
        public static final String KEY_NATURAL = "N.H";
 
7
        
 
8
        public static final String KEY_ARTIFICIAL = "A.H";
 
9
        
 
10
        public static final String KEY_TAPPED = "T.H";
 
11
        
 
12
        public static final String KEY_PINCH = "P.H";
 
13
        
 
14
        public static final String KEY_SEMI = "S.H";
 
15
        
 
16
        public static final int TYPE_NATURAL = 1;
 
17
        
 
18
        public static final int TYPE_ARTIFICIAL = 2;
 
19
        
 
20
        public static final int TYPE_TAPPED = 3;
 
21
        
 
22
        public static final int TYPE_PINCH = 4;
 
23
        
 
24
        public static final int TYPE_SEMI = 5;
 
25
        
 
26
        public static final int MIN_ARTIFICIAL_OFFSET = -24;
 
27
        
 
28
        public static final int MAX_ARTIFICIAL_OFFSET = 24;
 
29
        
 
30
        public static final int MAX_TAPPED_OFFSET = 24;
 
31
        
 
32
        public static final int NATURAL_FREQUENCIES[][] = {
 
33
                {12, 12}, //AH12 (+12 frets)
 
34
                {9 , 28}, //AH9 (+28 frets)
 
35
                {5 , 24}, //AH5 (+24 frets)
 
36
                {7 , 19}, //AH7 (+19 frets)
 
37
                {4 , 28}, //AH4 (+28 frets)
 
38
                {3 , 31}  //AH3 (+31 frets)
 
39
        };
 
40
        
 
41
        private int type;
 
42
        
 
43
        private int data;
 
44
        
 
45
        public TGEffectHarmonic(){
 
46
                this.type = 0;
 
47
                this.data = 0;
 
48
        }
 
49
        
 
50
        public int getData() {
 
51
                return this.data;
 
52
        }
 
53
        
 
54
        public void setData(int data) {
 
55
                this.data = data;
 
56
        }
 
57
        
 
58
        public int getType() {
 
59
                return this.type;
 
60
        }
 
61
        
 
62
        public void setType(int type) {
 
63
                this.type = type;
 
64
        }
 
65
        
 
66
        public boolean isNatural(){
 
67
                return (this.type == TYPE_NATURAL);
 
68
        }
 
69
        
 
70
        public boolean isArtificial(){
 
71
                return (this.type == TYPE_ARTIFICIAL);
 
72
        }
 
73
        
 
74
        public boolean isTapped(){
 
75
                return (this.type == TYPE_TAPPED);
 
76
        }
 
77
        
 
78
        public boolean isPinch(){
 
79
                return (this.type == TYPE_PINCH);
 
80
        }
 
81
        
 
82
        public boolean isSemi(){
 
83
                return (this.type == TYPE_SEMI);
 
84
        }
 
85
        
 
86
        public TGEffectHarmonic clone(TGFactory factory){
 
87
                TGEffectHarmonic effect = factory.newEffectHarmonic();
 
88
                effect.setType(getType());
 
89
                effect.setData(getData());
 
90
                return effect;
 
91
        }
 
92
        
 
93
}