2
* Created on 26-dic-2005
4
* TODO To change the template for this generated file go to
5
* Window - Preferences - Java - Code Style - Code Templates
7
package org.herac.tuxguitar.song.models;
9
import org.herac.tuxguitar.song.factory.TGFactory;
10
import org.herac.tuxguitar.song.models.effects.TGEffectBend;
11
import org.herac.tuxguitar.song.models.effects.TGEffectGrace;
12
import org.herac.tuxguitar.song.models.effects.TGEffectHarmonic;
13
import org.herac.tuxguitar.song.models.effects.TGEffectTremoloBar;
14
import org.herac.tuxguitar.song.models.effects.TGEffectTremoloPicking;
15
import org.herac.tuxguitar.song.models.effects.TGEffectTrill;
20
* TODO To change the template for this generated type comment go to
21
* Window - Preferences - Java - Code Style - Code Templates
23
public abstract class TGNoteEffect {
24
private TGEffectBend bend;
25
private TGEffectTremoloBar tremoloBar;
26
private TGEffectHarmonic harmonic;
27
private TGEffectGrace grace;
28
private TGEffectTrill trill;
29
private TGEffectTremoloPicking tremoloPicking;
30
private boolean vibrato;
31
private boolean deadNote;
32
private boolean slide;
33
private boolean hammer;
34
private boolean ghostNote;
35
private boolean accentuatedNote;
36
private boolean heavyAccentuatedNote;
37
private boolean palmMute;
38
private boolean staccato;
39
private boolean tapping;
40
private boolean slapping;
41
private boolean popping;
42
private boolean fadeIn;
44
public TGNoteEffect(){
46
this.tremoloBar = null;
50
this.tremoloPicking = null;
52
this.deadNote = false;
55
this.ghostNote = false;
56
this.accentuatedNote = false;
57
this.heavyAccentuatedNote = false;
58
this.palmMute = false;
59
this.staccato = false;
61
this.slapping = false;
66
public boolean isDeadNote() {
70
public void setDeadNote(boolean deadNote) {
71
this.deadNote = deadNote;
72
//si es true, quito los efectos incompatibles
73
if(this.isDeadNote()){
74
this.tremoloBar = null;
82
public boolean isVibrato() {
85
public void setVibrato(boolean vibrato) {
86
this.vibrato = vibrato;
87
//si no es null quito los efectos incompatibles
93
public TGEffectBend getBend() {
97
public void setBend(TGEffectBend bend) {
99
//si no es null quito los efectos incompatibles
101
this.tremoloBar = null;
103
this.deadNote = false;
109
public boolean isBend() {
110
return (this.bend != null && !this.bend.getPoints().isEmpty());
113
public TGEffectTremoloBar getTremoloBar() {
114
return this.tremoloBar;
117
public void setTremoloBar(TGEffectTremoloBar tremoloBar) {
118
this.tremoloBar = tremoloBar;
119
//si no es null quito los efectos incompatibles
120
if(this.isTremoloBar()){
123
this.deadNote = false;
129
public boolean isTremoloBar() {
130
return (this.tremoloBar != null);
134
public TGEffectTrill getTrill() {
138
public void setTrill(TGEffectTrill trill) {
140
//si es true, quito los efectos incompatibles
143
this.tremoloBar = null;
144
this.tremoloPicking = null;
147
this.deadNote = false;
148
this.vibrato = false;
152
public boolean isTrill() {
153
return (this.trill != null);
156
public TGEffectTremoloPicking getTremoloPicking() {
157
return this.tremoloPicking;
160
public void setTremoloPicking(TGEffectTremoloPicking tremoloPicking) {
161
this.tremoloPicking = tremoloPicking;
162
//si es true, quito los efectos incompatibles
163
if(this.isTremoloPicking()){
166
this.tremoloBar = null;
169
this.deadNote = false;
170
this.vibrato = false;
174
public boolean isTremoloPicking() {
175
return (this.tremoloPicking != null);
178
public boolean isHammer() {
182
public void setHammer(boolean hammer) {
183
this.hammer = hammer;
184
//si es true, quito los efectos incompatibles
187
this.tremoloBar = null;
189
this.deadNote = false;
194
public boolean isSlide() {
198
public void setSlide(boolean slide) {
200
//si es true, quito los efectos incompatibles
203
this.tremoloBar = null;
205
this.deadNote = false;
210
public boolean isGhostNote() {
211
return this.ghostNote;
214
public void setGhostNote(boolean ghostNote) {
215
this.ghostNote = ghostNote;
216
//si es true, quito los efectos incompatibles
217
if(this.isGhostNote()){
218
this.accentuatedNote = false;
219
this.heavyAccentuatedNote = false;
223
public boolean isAccentuatedNote() {
224
return this.accentuatedNote;
227
public void setAccentuatedNote(boolean accentuatedNote) {
228
this.accentuatedNote = accentuatedNote;
229
//si es true, quito los efectos incompatibles
230
if(this.isAccentuatedNote()){
231
this.ghostNote = false;
232
this.heavyAccentuatedNote = false;
236
public boolean isHeavyAccentuatedNote() {
237
return this.heavyAccentuatedNote;
240
public void setHeavyAccentuatedNote(boolean heavyAccentuatedNote) {
241
this.heavyAccentuatedNote = heavyAccentuatedNote;
242
//si es true, quito los efectos incompatibles
243
if(this.isHeavyAccentuatedNote()){
244
this.ghostNote = false;
245
this.accentuatedNote = false;
249
public void setHarmonic(TGEffectHarmonic harmonic) {
250
this.harmonic = harmonic;
253
public TGEffectHarmonic getHarmonic() {
254
return this.harmonic;
257
public boolean isHarmonic() {
258
return (this.harmonic != null);
261
public TGEffectGrace getGrace() {
265
public void setGrace(TGEffectGrace grace) {
269
public boolean isGrace() {
270
return (this.grace != null);
273
public boolean isPalmMute() {
274
return this.palmMute;
277
public void setPalmMute(boolean palmMute) {
278
this.palmMute = palmMute;
279
//si es true, quito los efectos incompatibles
280
if(this.isPalmMute()){
281
this.staccato = false;
285
public boolean isStaccato() {
286
return this.staccato;
289
public void setStaccato(boolean staccato) {
290
this.staccato = staccato;
291
//si es true, quito los efectos incompatibles
292
if(this.isStaccato()){
293
this.palmMute = false;
297
public boolean isPopping() {
301
public void setPopping(boolean popping) {
302
this.popping = popping;
303
//si es true, quito los efectos incompatibles
304
if(this.isPopping()){
305
this.tapping = false;
306
this.slapping = false;
310
public boolean isSlapping() {
311
return this.slapping;
314
public void setSlapping(boolean slapping) {
315
this.slapping = slapping;
316
//si es true, quito los efectos incompatibles
317
if(this.isSlapping()){
318
this.tapping = false;
319
this.popping = false;
323
public boolean isTapping() {
327
public void setTapping(boolean tapping) {
328
this.tapping = tapping;
329
//si es true, quito los efectos incompatibles
330
if(this.isTapping()){
331
this.slapping = false;
332
this.popping = false;
336
public boolean isFadeIn() {
340
public void setFadeIn(boolean fadeIn) {
341
this.fadeIn = fadeIn;
344
public boolean hasAnyEffect(){
350
isTremoloPicking() ||
356
isAccentuatedNote() ||
357
isHeavyAccentuatedNote() ||
366
public TGNoteEffect clone(TGFactory factory){
367
TGNoteEffect effect = factory.newEffect();
368
effect.setVibrato(isVibrato());
369
effect.setDeadNote(isDeadNote());
370
effect.setSlide(isSlide());
371
effect.setHammer(isHammer());
372
effect.setGhostNote(isGhostNote());
373
effect.setAccentuatedNote(isAccentuatedNote());
374
effect.setHeavyAccentuatedNote(isHeavyAccentuatedNote());
375
effect.setPalmMute(isPalmMute());
376
effect.setStaccato(isStaccato());
377
effect.setTapping(isTapping());
378
effect.setSlapping(isSlapping());
379
effect.setPopping(isPopping());
380
effect.setFadeIn(isFadeIn());
381
effect.setBend(isBend()?(TGEffectBend)this.bend.clone(factory):null);
382
effect.setTremoloBar(isTremoloBar()?(TGEffectTremoloBar)this.tremoloBar.clone(factory):null);
383
effect.setHarmonic(isHarmonic()?(TGEffectHarmonic)this.harmonic.clone(factory):null);
384
effect.setGrace(isGrace()?(TGEffectGrace)this.grace.clone(factory):null);
385
effect.setTrill(isTrill()?(TGEffectTrill)this.trill.clone(factory):null);
386
effect.setTremoloPicking(isTremoloPicking()?(TGEffectTremoloPicking)this.tremoloPicking.clone(factory):null);