2
* Created on 29-nov-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.gui.editors.tab;
9
import java.util.Iterator;
11
import org.eclipse.swt.graphics.Point;
12
import org.eclipse.swt.graphics.Rectangle;
13
import org.herac.tuxguitar.gui.editors.TGPainter;
14
import org.herac.tuxguitar.gui.editors.tab.layout.TrackSpacing;
15
import org.herac.tuxguitar.gui.editors.tab.layout.ViewLayout;
16
import org.herac.tuxguitar.gui.editors.tab.painters.TGKeySignaturePainter;
17
import org.herac.tuxguitar.gui.editors.tab.painters.TGNotePainter;
18
import org.herac.tuxguitar.song.factory.TGFactory;
19
import org.herac.tuxguitar.song.models.TGBeat;
20
import org.herac.tuxguitar.song.models.TGDuration;
21
import org.herac.tuxguitar.song.models.TGNote;
22
import org.herac.tuxguitar.song.models.TGNoteEffect;
23
import org.herac.tuxguitar.song.models.effects.TGEffectHarmonic;
28
* TODO To change the template for this generated type comment go to Window - Preferences - Java - Code Style - Code Templates
30
public class TGNoteImpl extends TGNote {
32
* Grupo al que pertenece este beat
34
private TGBeatGroup group;
36
private Rectangle noteOrientation;
40
private int scorePosY;
42
private int accidental;
44
public TGNoteImpl(TGFactory factory) {
46
this.noteOrientation = new Rectangle(0,0,0,0);
50
* Actualiza los valores para dibujar
52
public void update(ViewLayout layout) {
53
this.accidental = getMeasureImpl().getNoteAccidental( getRealValue() );
54
this.tabPosY = ( (getString() * layout.getStringSpacing()) - layout.getStringSpacing() );
55
this.scorePosY = this.group.getY1(layout,this,getMeasureImpl().getKeySignature(),getMeasureImpl().getClef());
61
public void paint(ViewLayout layout,TGPainter painter, int fromX, int fromY) {
62
int spacing = getBeatImpl().getSpacing();
63
paintScoreNote(layout, painter, fromX, fromY + getPaintPosition(TrackSpacing.POSITION_SCORE_MIDDLE_LINES),spacing);
64
if(!layout.isPlayModeEnabled()){
65
paintOfflineEffects(layout, painter,fromX,fromY, spacing);
67
paintTablatureNote(layout, painter, fromX, fromY + getPaintPosition(TrackSpacing.POSITION_TABLATURE),spacing);
70
private void paintOfflineEffects(ViewLayout layout,TGPainter painter,int fromX, int fromY, int spacing){
71
TGNoteEffect effect = getEffect();
73
layout.setOfflineEffectStyle(painter);
74
if(effect.isAccentuatedNote()){
75
int x = fromX + getPosX() + spacing;
76
int y = (fromY + getPaintPosition(TrackSpacing.POSITION_ACCENTUATED_EFFECT));
77
paintAccentuated(layout, painter, x, y);
79
else if(effect.isHeavyAccentuatedNote()){
80
int x = fromX + getPosX() + spacing;
81
int y = (fromY + getPaintPosition(TrackSpacing.POSITION_ACCENTUATED_EFFECT));
82
paintHeavyAccentuated(layout, painter, x, y);
84
if(effect.isFadeIn()){
85
int x = fromX + getPosX() + spacing;
86
int y = (fromY + getPaintPosition(TrackSpacing.POSITION_FADE_IN));
87
paintFadeIn(layout, painter, x, y);
89
if(effect.isHarmonic() && (layout.getStyle() & ViewLayout.DISPLAY_SCORE) == 0 ){
90
int x = fromX + getPosX() + spacing;
91
int y = (fromY + getPaintPosition(TrackSpacing.POSITION_HARMONIC_EFFEC));
92
String key = new String();
93
key = effect.getHarmonic().isNatural()?TGEffectHarmonic.KEY_NATURAL:key;
94
key = effect.getHarmonic().isArtificial()?TGEffectHarmonic.KEY_ARTIFICIAL:key;
95
key = effect.getHarmonic().isTapped()?TGEffectHarmonic.KEY_TAPPED:key;
96
key = effect.getHarmonic().isPinch()?TGEffectHarmonic.KEY_PINCH:key;
97
key = effect.getHarmonic().isSemi()?TGEffectHarmonic.KEY_SEMI:key;
98
painter.drawString(key,x, y);
100
if(effect.isTapping()){
101
int x = fromX + getPosX() + spacing;
102
int y = (fromY + getPaintPosition(TrackSpacing.POSITION_TAPPING_EFFEC));
103
painter.drawString("T",x, y);
105
else if(effect.isSlapping()){
106
int x = fromX + getPosX() + spacing;
107
int y = (fromY + getPaintPosition(TrackSpacing.POSITION_TAPPING_EFFEC));
108
painter.drawString("S",x, y);
110
else if(effect.isPopping()){
111
int x = fromX + getPosX() + spacing;
112
int y = (fromY + getPaintPosition(TrackSpacing.POSITION_TAPPING_EFFEC));
113
painter.drawString("P",x, y);
115
if(effect.isPalmMute()){
116
int x = fromX + getPosX() + spacing;
117
int y = (fromY + getPaintPosition(TrackSpacing.POSITION_PALM_MUTE_EFFEC));
118
painter.drawString("P.M",x, y);
120
if(effect.isVibrato()){
121
int x = fromX + getPosX() + spacing;
122
int y = (fromY + getPaintPosition(TrackSpacing.POSITION_VIBRATO_EFFEC));
123
paintVibrato(layout, painter,x,y);
125
if(effect.isTrill()){
126
int x = fromX + getPosX() + spacing;
127
int y = (fromY + getPaintPosition(TrackSpacing.POSITION_VIBRATO_EFFEC));
128
paintTrill(layout, painter,x,y);
133
* Pinta la nota en la tablatura
135
public void paintTablatureNote(ViewLayout layout,TGPainter painter, int fromX, int fromY, int spacing) {
136
int style = layout.getStyle();
137
if((style & ViewLayout.DISPLAY_TABLATURE) != 0){
138
int stringSpacing = layout.getStringSpacing();
139
int x = fromX + getPosX() + spacing + 2;
140
int y = fromY + getTabPosY();
142
this.noteOrientation.x = x;
143
this.noteOrientation.y = y;
144
this.noteOrientation.width = 1;
145
this.noteOrientation.height = 1;
147
layout.setTabNoteStyle(painter, (layout.isPlayModeEnabled() && getBeatImpl().isPlaying(layout)));
148
//-------------ligadura--------------------------------------
149
if (isTiedNote() && (style & ViewLayout.DISPLAY_SCORE) == 0) {
153
float tHeight = (stringSpacing * 3);
154
TGNoteImpl noteForTie = getNoteForTie();
155
if (noteForTie != null) {
156
tX = (fromX + noteForTie.getPosX() + noteForTie.getBeatImpl().getSpacing());
157
tY = (fromY + noteForTie.getTabPosY() + stringSpacing);
160
Rectangle r = layout.getNoteOrientation(painter,x,y,this);
161
tX = r.x - (stringSpacing * 2);
162
tY = (fromY + getTabPosY() + stringSpacing);
163
tWidth = (stringSpacing * 2);
166
painter.addArc(tX, (tY - tHeight ), tWidth, tHeight, 225,90);
169
//-------------nota--------------------------------------
170
} else if(!isTiedNote()){
171
Rectangle r = layout.getNoteOrientation(painter,x,y,this);
172
this.noteOrientation.x = r.x;
173
this.noteOrientation.y = r.y;
174
this.noteOrientation.width = r.width;
175
this.noteOrientation.height = r.height;
176
String visualNote = (getEffect().isDeadNote())?"X":Integer.toString(getValue());
177
visualNote = (getEffect().isGhostNote())?"(" + visualNote + ")":visualNote;
178
painter.drawString(visualNote, this.noteOrientation.x, this.noteOrientation.y);
181
//-------------efectos--------------------------------------
182
if(! layout.isPlayModeEnabled() ){
184
paintEffects(layout,painter,fromX,fromY,spacing);
186
if((style & ViewLayout.DISPLAY_SCORE) == 0){
187
int y1 = (fromY + getMeasureImpl().getTrackImpl().getTabHeight() + (stringSpacing / 2));
188
int y2 = (fromY + getMeasureImpl().getTrackImpl().getTabHeight() + ((stringSpacing / 2) * 5));
190
//-------------tremolo picking--------------------------------------
191
if(getEffect().isTremoloPicking()){
192
layout.setTabEffectStyle(painter);
194
int posy = (y1 + ((y2 - y1) / 2));
195
for(int i = TGDuration.EIGHTH;i <= getEffect().getTremoloPicking().getDuration().getValue(); i += i){
196
painter.moveTo(x - 3, posy - 1);
197
painter.lineTo(x + 4,posy + 1);
200
painter.setLineWidth(2);
202
painter.setLineWidth(1);
210
* Pinta la nota en la partitura
212
private void paintScoreNote(ViewLayout layout,TGPainter painter, int fromX, int fromY, int spacing) {
213
if((layout.getStyle() & ViewLayout.DISPLAY_SCORE) != 0 ){
214
float scale = layout.getScoreLineSpacing();
215
int direction = this.group.getDirection();
216
int key = getMeasureImpl().getKeySignature();
217
int clef = getMeasureImpl().getClef();
219
int x = ( fromX + getPosX() + spacing );
220
int y1 = ( fromY + getScorePosY() ) ;
222
//-------------foreground--------------------------------------
223
boolean playing = (layout.isPlayModeEnabled() && getBeatImpl().isPlaying(layout));
225
layout.setScoreNoteStyle(painter,playing);
227
//----------ligadura---------------------------------------
229
TGNoteImpl noteForTie = getNoteForTie();
230
float tScale = (scale / 8.0f);
231
float tX = x - (20.0f * tScale);
232
float tY = y1 - (2.0f * tScale);
233
float tWidth = (20.0f * tScale);
234
float tHeight = (30.0f * tScale);
235
if (noteForTie != null) {
236
int tNoteX = (fromX + noteForTie.getPosX() + noteForTie.getBeatImpl().getSpacing());
237
int tNoteY = (fromY + getScorePosY());
238
tX = tNoteX + (6.0f * tScale);
239
tY = tNoteY - (3.0f * tScale);
240
tWidth = (x - tNoteX) - (3.0f * tScale);
241
tHeight = (35.0f * tScale);
244
painter.addArc(tX,tY, tWidth, tHeight, 45, 90);
247
//----------sostenido--------------------------------------
248
if(this.accidental == TGMeasureImpl.NATURAL){
249
painter.initPath(TGPainter.PATH_FILL);
250
TGKeySignaturePainter.paintNatural(painter,(x - (scale - (scale / 4)) ),(y1 + (scale / 2)), scale);
253
else if(this.accidental == TGMeasureImpl.SHARP){
254
painter.initPath(TGPainter.PATH_FILL);
255
TGKeySignaturePainter.paintSharp(painter,(x - (scale - (scale / 4)) ),(y1 + (scale / 2)), scale);
258
else if(this.accidental == TGMeasureImpl.FLAT){
259
painter.initPath(TGPainter.PATH_FILL);
260
TGKeySignaturePainter.paintFlat(painter,(x - (scale - (scale / 4)) ),(y1 + (scale / 2)), scale);
263
//----------fin sostenido--------------------------------------
264
if(getEffect().isHarmonic()){
265
if( layout.isBufferEnabled() ){
266
painter.drawImage(layout.getResources().getHarmonicNote(getBeat().getDuration().getValue(),playing),x,y1);
268
boolean full = (getBeat().getDuration().getValue() >= TGDuration.QUARTER);
269
painter.initPath((full ? TGPainter.PATH_DRAW | TGPainter.PATH_FILL : TGPainter.PATH_DRAW));
270
TGNotePainter.paintHarmonic(painter,x,y1+1,(layout.getScoreLineSpacing() - 2) );
274
if( layout.isBufferEnabled() ){
275
painter.drawImage(layout.getResources().getScoreNote(getBeat().getDuration().getValue(),playing),x,y1);
277
boolean full = (getBeat().getDuration().getValue() >= TGDuration.QUARTER);
278
painter.initPath((full ? TGPainter.PATH_FILL : TGPainter.PATH_DRAW));
279
TGNotePainter.paintNote(painter,x,y1+1, ((full ? layout.getScoreLineSpacing() + 1 : layout.getScoreLineSpacing() ) - 2) );
284
if(! layout.isPlayModeEnabled() ){
286
if(getEffect().isGrace()){
287
paintGrace(layout, painter,x ,y1);
290
//PUNTILLO y DOBLE PUNTILLO
291
if (getBeat().getDuration().isDotted() || getBeat().getDuration().isDoubleDotted()) {
292
getBeatImpl().paintDot(layout, painter,( x + (12.0f * (scale / 8.0f) ) ), ( y1 + (layout.getScoreLineSpacing()/ 2)), (scale / 10.0f) );
296
if(getBeat().getDuration().getValue() >= TGDuration.HALF){
297
layout.setScoreNoteFooterStyle(painter);
298
int xMove = (direction == TGBeatGroup.DIRECTION_UP ? layout.getResources().getScoreNoteWidth() : 0);
299
int y2 = fromY + this.group.getY2(layout,getPosX() + spacing,key,clef);
302
if (getEffect().isStaccato()) {
305
int sY = (y2 + (4 * ((direction == TGBeatGroup.DIRECTION_UP)?-1:1)));
306
layout.setScoreEffectStyle(painter);
307
painter.initPath(TGPainter.PATH_FILL);
308
painter.moveTo(sX - (size / 2),sY - (size / 2));
309
painter.addOval(sX - (size / 2),sY - (size / 2),size,size);
313
if(getEffect().isTremoloPicking()){
314
layout.setScoreEffectStyle(painter);
317
if((direction == TGBeatGroup.DIRECTION_UP)){
318
tpY += (this.group.getMaxNote().getScorePosY() - layout.getScoreLineSpacing() - 4);
320
tpY += (this.group.getMinNote().getScorePosY() + layout.getScoreLineSpacing() + 4);
322
for(int i = TGDuration.EIGHTH;i <= getEffect().getTremoloPicking().getDuration().getValue(); i += i){
323
painter.moveTo(x + xMove - 3, tpY + 1);
324
painter.lineTo(x + xMove + 4,tpY - 1);
327
painter.setLineWidth(2);
329
painter.setLineWidth(1);
333
if (getEffect().isStaccato()) {
335
int sX = x + (layout.getResources().getScoreNoteWidth() / 2);
336
int sY = (fromY + this.group.getMinNote().getScorePosY() + layout.getScoreLineSpacing()) + 2;
337
layout.setScoreEffectStyle(painter);
338
painter.initPath(TGPainter.PATH_FILL);
339
painter.moveTo(sX - (size / 2),sY - (size / 2));
340
painter.addOval(sX - (size / 2),sY - (size / 2),size,size);
344
if(getEffect().isTremoloPicking()){
345
layout.setScoreEffectStyle(painter);
347
int tpX = (x + (layout.getResources().getScoreNoteWidth() / 2));
348
int tpY = fromY + (this.group.getMaxNote().getScorePosY() - layout.getScoreLineSpacing() - 4);
349
for(int i = TGDuration.EIGHTH;i <= getEffect().getTremoloPicking().getDuration().getValue(); i += i){
350
painter.moveTo(tpX - 3, tpY + 1);
351
painter.lineTo(tpX + 4,tpY - 1);
354
painter.setLineWidth(2);
356
painter.setLineWidth(1);
364
* Encuentra la nota a la que esta ligada
366
private TGNoteImpl getNoteForTie() {
367
for (int i = getMeasureImpl().countBeats() - 1; i >= 0; i--) {
368
TGBeat beat = getMeasureImpl().getBeat(i);
369
if (beat.getStart() < getBeat().getStart() && !beat.isRestBeat()) {
370
Iterator it = beat.getNotes().iterator();
372
TGNoteImpl note = (TGNoteImpl)it.next();
373
if (note.getString() == getString()) {
385
private void paintEffects(ViewLayout layout,TGPainter painter, int fromX, int fromY, int spacing){
386
int x = fromX + getPosX() + spacing;
387
int y = fromY + getTabPosY();
388
TGNoteEffect effect = getEffect();
389
if(effect.isGrace()){
390
layout.setGraceStyle(painter);
391
String value = Integer.toString(effect.getGrace().getFret());
392
Point gracePoint = painter.getStringExtent(value);
393
painter.drawString(value, (this.noteOrientation.x - gracePoint.x - 2), this.noteOrientation.y );
396
paintBend(layout, painter,(this.noteOrientation.x + this.noteOrientation.width), y);
397
}else if(effect.isTremoloBar()){
398
paintTremoloBar(layout, painter,(this.noteOrientation.x + this.noteOrientation.width), y);
399
}else if(effect.isSlide() || effect.isHammer()){
400
int nextFromX = fromX;
401
TGNoteImpl nextNote = (TGNoteImpl)layout.getSongManager().getMeasureManager().getNextNote(getMeasureImpl(),getBeat().getStart(),getString());
402
if(effect.isSlide()){
403
paintSlide(layout, painter, nextNote, x, y, nextFromX);
404
}else if(effect.isHammer()){
405
paintHammer(layout, painter, nextNote, x, y, nextFromX);
410
private void paintBend(ViewLayout layout,TGPainter painter,int fromX,int fromY){
411
float scale = layout.getScale();
412
float x = (fromX + (1.0f * scale));
413
float y = (fromY - (2.0f * scale));
415
layout.setTabEffectStyle(painter);
418
painter.moveTo( x, y );
419
painter.lineTo( x + (1.0f * scale), y );
420
painter.cubicTo(x + (1.0f * scale), y, x + (3.0f * scale), y , x + (3.0f * scale), y - (2.0f * scale));
421
painter.lineTo( x + (3.0f * scale), y - (12.0f * scale));
422
painter.lineTo( x + (1.0f * scale), y - (10.0f * scale));
423
painter.moveTo( x + (3.0f * scale), y - (12.0f * scale));
424
painter.lineTo( x + (5.0f * scale), y - (10.0f * scale));
428
private void paintTremoloBar(ViewLayout layout,TGPainter painter,int fromX,int fromY){
429
float scale = layout.getScale();
430
float x1 = fromX + (1.0f * scale);
431
float x2 = x1 + (8.0f * scale);
433
float y2 = y1 + (9.0f * scale);
434
layout.setTabEffectStyle(painter);
436
painter.moveTo(x1,y1);
437
painter.lineTo(x1 + ( (x2 - x1) / 2 ),y2);
438
painter.lineTo(x2,y1);
442
private void paintSlide(ViewLayout layout,TGPainter painter,TGNoteImpl nextNote,int fromX,int fromY,int nextFromX){
443
float xScale = layout.getScale();
444
float yScale = (layout.getStringSpacing() / 10.0f);
445
float yMove = (3.0f * yScale);
448
layout.setTabEffectStyle(painter);
449
if(nextNote != null){
450
float nextX = nextNote.getPosX() + nextFromX + nextNote.getBeatImpl().getSpacing();
453
if(nextNote.getValue() < getValue()){
456
}else if(nextNote.getValue() > getValue()){
464
painter.moveTo(x + (6.0f * xScale),y);
465
painter.lineTo(nextX - (3.0f * xScale),nextY);
469
painter.moveTo(x + (6.0f * xScale),y - yMove);
470
painter.lineTo(x + (17.0f * xScale),y - yMove);
475
private void paintHammer(ViewLayout layout,TGPainter painter,TGNoteImpl nextNote,int fromX,int fromY,int nextFromX){
476
float xScale = layout.getScale();
477
float yScale = (layout.getStringSpacing() / 10.0f);
479
float x = (fromX + (7.0f * xScale));
480
float y = (fromY - (5.0f * yScale));
482
float width = (nextNote != null)?( (nextNote.getPosX() + nextFromX + nextNote.getBeatImpl().getSpacing()) - (4.0f * xScale) - x ):(10.0f * xScale);
483
float height = (15.0f * yScale);
484
layout.setTabEffectStyle(painter);
486
painter.addArc(x,y, width, height, 45,90);
490
private void paintGrace(ViewLayout layout, TGPainter painter,int fromX,int fromY){
491
float scale = ( layout.getScoreLineSpacing() / 2.25f );
493
float x = fromX - (2f * scale);
494
float y = fromY + (scale / 3);
496
layout.setTabEffectStyle(painter);
497
painter.initPath(TGPainter.PATH_FILL);
498
TGNotePainter.paintFooter(painter,x, y , -1 , scale);
502
painter.moveTo(x, y - (2f * scale));
503
painter.lineTo(x, y + (2f * scale) - (scale / 4f));
506
painter.initPath(TGPainter.PATH_DRAW | TGPainter.PATH_FILL);
507
TGNotePainter.paintNote(painter,x - scale*1.33f, y + scale + (scale / 4f), scale);
511
painter.moveTo(x - scale, y );
512
painter.lineTo(x + scale, y - scale);
516
private void paintVibrato(ViewLayout layout, TGPainter painter,int fromX,int fromY){
517
float scale = layout.getScale();
519
float y = fromY + (2.0f * scale);
520
float width = ( getBeatImpl().getWidth() - (2.0f * scale) );
522
int loops = (int)(width / (6.0f * scale) );
524
layout.setTabEffectStyle(painter);
525
painter.initPath(TGPainter.PATH_FILL);
526
painter.moveTo(( x + ((2.0f) * scale) ),( y + (1.0f * scale) ));
527
for( int i = 0; i < loops ; i ++ ){
528
x = (fromX + ( (6.0f * scale) * i ) );
529
painter.lineTo(( x + (2.0f * scale) ),( y + (1.0f * scale) ));
530
painter.cubicTo(( x + (2.0f * scale) ),( y + (1.0f * scale) ),( x + (3.0f * scale) ), y ,( x + (4.0f * scale) ),( y + (1.0f * scale) ));
531
painter.lineTo(( x + (6.0f * scale) ),( y + (3.0f * scale) ));
534
painter.lineTo(( x + (7.0f * scale) ),( y + (2.0f * scale) ));
535
painter.cubicTo(( x + (7.0f * scale) ),( y + (2.0f * scale) ),( x + (8.0f * scale) ),( y + (2.0f * scale) ),( x + (7.0f * scale) ),( y + (3.0f * scale) ));
537
for( int i = (loops - 1); i >= 0 ; i -- ){
538
x = (fromX + ( (6.0f * scale) * i ) );
539
painter.lineTo(( x + (6.0f * scale) ),( y + (4.0f * scale) ));
540
painter.cubicTo(( x + (6.0f * scale) ),( y + (4.0f * scale) ),( x + (5.0f * scale) ),( y + (5.0f * scale) ),( x + (4.0f * scale) ),( y + (4.0f * scale) ));
541
painter.lineTo(( x + (2.0f * scale) ),( y + (2.0f * scale) ));
542
painter.lineTo(( x + (1.0f * scale) ),( y + (3.0f * scale) ));
544
painter.cubicTo(( x + (1.0f * scale) ),( y + (3.0f * scale) ), x ,( y + (3.0f * scale) ),( x + (1.0f * scale) ),( y + (2.0f * scale) ));
545
painter.lineTo(( x + (2.0f * scale) ),( y + (1.0f * scale) ));
550
private void paintTrill(ViewLayout layout, TGPainter painter,int fromX,int fromY){
551
String string = "Tr";
552
Point stringSize = painter.getStringExtent( string );
553
float scale = layout.getScale();
554
float x = fromX + stringSize.x;
555
float y = fromY + ( (stringSize.y - (5.0f * scale)) / 2.0f );
556
float width = ( getBeatImpl().getWidth() - stringSize.x - (2.0f * scale) );
558
int loops = (int)(width / (6.0f * scale) );
560
painter.drawString(string, fromX, fromY);
562
layout.setTabEffectStyle(painter);
563
painter.initPath(TGPainter.PATH_FILL);
564
painter.moveTo(( x + (2.0f * scale) ),( y + (1.0f * scale) ));
565
for( int i = 0; i < loops ; i ++ ){
566
x = (fromX + stringSize.x + ( (6.0f * scale) * i ) );
567
painter.lineTo(( x + (2.0f * scale) ),( y + (1.0f * scale) ));
568
painter.cubicTo(( x + (2.0f * scale) ),( y + (1.0f * scale) ),( x + (3.0f * scale) ), y ,( x + (4.0f * scale) ),( y + (1.0f * scale) ));
569
painter.lineTo(( x + (6.0f * scale) ),( y + (3.0f * scale) ));
572
painter.lineTo(( x + (7.0f * scale) ),( y + (2.0f * scale) ));
573
painter.cubicTo(( x + (7.0f * scale) ),( y + (2.0f * scale) ),( x + (8.0f * scale) ),( y + (2.0f * scale) ),( x + (7.0f * scale) ),( y + (3.0f * scale) ));
575
for( int i = (loops - 1); i >= 0 ; i -- ){
576
x = (fromX + stringSize.x + ( (6.0f * scale) * i ) );
577
painter.lineTo(( x + (6.0f * scale) ),( y + (4.0f * scale) ));
578
painter.cubicTo(( x + (6.0f * scale) ),( y + (4.0f * scale) ),( x + (5.0f * scale) ),( y + (5.0f * scale) ),( x + (4.0f * scale) ),( y + (4.0f * scale) ));
579
painter.lineTo(( x + (2.0f * scale) ),( y + (2.0f * scale) ));
580
painter.lineTo(( x + (1.0f * scale) ),( y + (3.0f * scale) ));
582
painter.cubicTo(( x + (1.0f * scale) ),( y + (3.0f * scale) ), x ,( y + (3.0f * scale) ),( x + (1.0f * scale) ),( y + (2.0f * scale) ));
583
painter.lineTo(( x + (2.0f * scale) ),( y + (1.0f * scale) ));
588
private void paintFadeIn(ViewLayout layout, TGPainter painter,int fromX,int fromY){
589
float scale = layout.getScale();
591
float y = fromY + (4.0f * scale );
592
float width = getBeatImpl().getWidth();
594
painter.moveTo ( x , y );
595
painter.cubicTo( x , y , x + width, y, x + width, y - (4.0f * scale ));
596
painter.moveTo ( x , y );
597
painter.cubicTo( x , y , x + width, y, x + width, y + (4.0f * scale ));
601
private void paintAccentuated(ViewLayout layout, TGPainter painter,int fromX,int fromY){
602
float scale = layout.getScale();
604
float y = fromY + (2f * scale );
606
painter.moveTo( x , y );
607
painter.lineTo( x + (6.0f * scale ) , y + (2.5f * scale ));
608
painter.lineTo( x , y + (5.0f * scale ));
612
private void paintHeavyAccentuated(ViewLayout layout, TGPainter painter,int fromX,int fromY){
613
float scale = layout.getScale();
617
painter.moveTo( x , y + (5.0f * scale ) );
618
painter.lineTo( x + (3.0f * scale ) , y + (1.0f * scale ));
619
painter.lineTo( x + (6.0f * scale ) , y + (5.0f * scale ) );
623
public int getRealValue(){
624
return (getValue() + getMeasureImpl().getTrack().getString(getString()).getValue());
627
public int getScorePosY() {
628
return this.scorePosY;
631
public int getTabPosY() {
635
public TGMeasureImpl getMeasureImpl(){
636
return getBeatImpl().getMeasureImpl();
639
public int getPaintPosition(int index){
640
return getMeasureImpl().getTs().getPosition(index);
643
public TGBeatImpl getBeatImpl() {
644
return (TGBeatImpl)super.getBeat();
647
public TGBeatGroup getBeatGroup() {
651
public void setBeatGroup(TGBeatGroup group) {
655
public int getPosX() {
656
return getBeatImpl().getPosX();
b'\\ No newline at end of file'