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

« back to all changes in this revision

Viewing changes to TuxGuitar/src/org/herac/tuxguitar/song/models/effects/TGEffectGrace.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
import org.herac.tuxguitar.song.models.TGDuration;
 
5
import org.herac.tuxguitar.song.models.TGVelocities;
 
6
 
 
7
public abstract class TGEffectGrace {
 
8
        
 
9
        public static final int TRANSITION_NONE = 0;
 
10
        
 
11
        public static final int TRANSITION_SLIDE = 1;
 
12
        
 
13
        public static final int TRANSITION_BEND = 2;
 
14
        
 
15
        public static final int TRANSITION_HAMMER = 3;
 
16
        
 
17
        private int fret;
 
18
        private int duration;
 
19
        private int dynamic;
 
20
        private int transition;
 
21
        private boolean onBeat;
 
22
        private boolean dead;
 
23
        
 
24
        public TGEffectGrace() {
 
25
                this.fret = 0;
 
26
                this.duration = 1;
 
27
                this.dynamic = TGVelocities.DEFAULT;
 
28
                this.transition = TRANSITION_NONE;
 
29
                this.onBeat = false;
 
30
                this.dead = false;
 
31
        }
 
32
        
 
33
        public boolean isDead() {
 
34
                return this.dead;
 
35
        }
 
36
        
 
37
        public void setDead(boolean dead) {
 
38
                this.dead = dead;
 
39
        }
 
40
        
 
41
        public int getDuration() {
 
42
                return this.duration;
 
43
        }
 
44
        
 
45
        public void setDuration(int duration) {
 
46
                this.duration = duration;
 
47
        }
 
48
        
 
49
        public int getDynamic() {
 
50
                return this.dynamic;
 
51
        }
 
52
        
 
53
        public void setDynamic(int dynamic) {
 
54
                this.dynamic = dynamic;
 
55
        }
 
56
        
 
57
        public int getFret() {
 
58
                return this.fret;
 
59
        }
 
60
        
 
61
        public void setFret(int fret) {
 
62
                this.fret = fret;
 
63
        }
 
64
        
 
65
        public boolean isOnBeat() {
 
66
                return this.onBeat;
 
67
        }
 
68
        
 
69
        public void setOnBeat(boolean onBeat) {
 
70
                this.onBeat = onBeat;
 
71
        }
 
72
        
 
73
        public int getTransition() {
 
74
                return this.transition;
 
75
        }
 
76
        
 
77
        public void setTransition(int transition) {
 
78
                this.transition = transition;
 
79
        }
 
80
        
 
81
        public int getDurationTime(){
 
82
                //return (int)(((float)TGDuration.QUARTER_TIME / 16.00 ) * (float)getDuration());
 
83
                return (int)((TGDuration.QUARTER_TIME / 16.00 ) * getDuration());
 
84
        }
 
85
        
 
86
        public TGEffectGrace clone(TGFactory factory){
 
87
                TGEffectGrace effect = factory.newEffectGrace();
 
88
                effect.setFret(getFret());
 
89
                effect.setDuration(getDuration());
 
90
                effect.setDynamic(getDynamic());
 
91
                effect.setTransition(getTransition());
 
92
                effect.setOnBeat(isOnBeat());
 
93
                effect.setDead(isDead());
 
94
                return effect;
 
95
        }
 
96
        
 
97
}