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

« back to all changes in this revision

Viewing changes to src/org/herac/tuxguitar/song/models/effects/HarmonicEffect.java

  • Committer: Bazaar Package Importer
  • Author(s): Philippe Coval
  • Date: 2007-02-04 01:41:23 UTC
  • Revision ID: james.westby@ubuntu.com-20070204014123-9pv7okph0iaiqkvw
Tags: upstream-0.9.1
ImportĀ upstreamĀ versionĀ 0.9.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
package org.herac.tuxguitar.song.models.effects;
 
2
 
 
3
public class HarmonicEffect {
 
4
        public static final String KEY_NATURAL = "N.H";
 
5
        
 
6
        public static final String KEY_ARTIFICIAL = "A.H";
 
7
        
 
8
        public static final String KEY_TAPPED = "T.H";
 
9
        
 
10
        public static final String KEY_PINCH = "P.H";
 
11
        
 
12
        public static final String KEY_SEMI = "S.H";
 
13
        
 
14
        public static final int TYPE_NATURAL = 1;
 
15
        
 
16
        public static final int TYPE_ARTIFICIAL = 2;
 
17
        
 
18
        public static final int TYPE_TAPPED = 3;
 
19
        
 
20
        public static final int TYPE_PINCH = 4;
 
21
        
 
22
        public static final int TYPE_SEMI = 5;
 
23
                
 
24
        public static final int MIN_ARTIFICIAL_OFFSET = -24;
 
25
        
 
26
        public static final int MAX_ARTIFICIAL_OFFSET = 24;
 
27
        
 
28
        public static final int MAX_TAPPED_OFFSET = 24;
 
29
        
 
30
        private int type;
 
31
        
 
32
        private int data;
 
33
        
 
34
        public HarmonicEffect(int type){
 
35
                this(type,0);
 
36
        }
 
37
        
 
38
        public HarmonicEffect(int type,int data){
 
39
                this.type = type;
 
40
                this.data = data;
 
41
        }
 
42
        
 
43
        public int getData() {
 
44
                return data;
 
45
        }
 
46
 
 
47
        public void setData(int data) {
 
48
                this.data = data;
 
49
        }
 
50
 
 
51
        public int getType() {
 
52
                return type;
 
53
        }
 
54
 
 
55
        public void setType(int type) {
 
56
                this.type = type;
 
57
        }
 
58
        
 
59
        public boolean isNatural(){
 
60
                return (this.type == TYPE_NATURAL);
 
61
        }
 
62
 
 
63
        public boolean isArtificial(){
 
64
                return (this.type == TYPE_ARTIFICIAL);
 
65
        }       
 
66
 
 
67
        public boolean isTapped(){
 
68
                return (this.type == TYPE_TAPPED);
 
69
        }       
 
70
 
 
71
        public boolean isPinch(){
 
72
                return (this.type == TYPE_PINCH);
 
73
        }       
 
74
        
 
75
        public boolean isSemi(){
 
76
                return (this.type == TYPE_SEMI);
 
77
        }       
 
78
        
 
79
        public Object clone(){
 
80
                HarmonicEffect effect = new HarmonicEffect(this.type,this.data);
 
81
                
 
82
                return effect;
 
83
        }
 
84
}