本文整理汇总了Java中org.herac.tuxguitar.song.models.TGDuration.SIXTY_FOURTH属性的典型用法代码示例。如果您正苦于以下问题:Java TGDuration.SIXTY_FOURTH属性的具体用法?Java TGDuration.SIXTY_FOURTH怎么用?Java TGDuration.SIXTY_FOURTH使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.herac.tuxguitar.song.models.TGDuration
的用法示例。
在下文中一共展示了TGDuration.SIXTY_FOURTH属性的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: toStrokeValue
private int toStrokeValue( TGStroke stroke ){
if( stroke.getValue() == TGDuration.SIXTY_FOURTH ){
return 2;
}
if( stroke.getValue() == TGDuration.THIRTY_SECOND ){
return 3;
}
if( stroke.getValue() == TGDuration.SIXTEENTH ){
return 4;
}
if( stroke.getValue() == TGDuration.EIGHTH ){
return 5;
}
if( stroke.getValue() == TGDuration.QUARTER ){
return 6;
}
return 2;
}
示例2: toStrokeValue
private int toStrokeValue( int value ){
if( value == 1 || value == 2){
return TGDuration.SIXTY_FOURTH;
}
if( value == 3){
return TGDuration.THIRTY_SECOND;
}
if( value == 4){
return TGDuration.SIXTEENTH;
}
if( value == 5){
return TGDuration.EIGHTH;
}
if( value == 6){
return TGDuration.QUARTER;
}
return TGDuration.SIXTY_FOURTH;
}
示例3: parseDuration
private byte parseDuration(TGDuration duration) {
byte value = 0;
switch (duration.getValue()) {
case TGDuration.WHOLE:
value = -2;
break;
case TGDuration.HALF:
value = -1;
break;
case TGDuration.QUARTER:
value = 0;
break;
case TGDuration.EIGHTH:
value = 1;
break;
case TGDuration.SIXTEENTH:
value = 2;
break;
case TGDuration.THIRTY_SECOND:
value = 3;
break;
case TGDuration.SIXTY_FOURTH:
value = 4;
break;
}
return value;
}
示例4: writeTrill
private void writeTrill(TGEffectTrill trill) throws IOException {
writeByte((byte)trill.getFret());
if(trill.getDuration().getValue() == TGDuration.SIXTEENTH){
writeByte((byte)1);
}else if(trill.getDuration().getValue() == TGDuration.THIRTY_SECOND){
writeByte((byte)2);
}else if(trill.getDuration().getValue() == TGDuration.SIXTY_FOURTH){
writeByte((byte)3);
}
}
示例5: processAction
protected void processAction(TGActionContext context) {
TGDuration duration = ((TGDuration) context.getAttribute(TGDocumentContextAttributes.ATTRIBUTE_DURATION));
if( duration.getValue() < TGDuration.SIXTY_FOURTH ){
duration.setValue(duration.getValue() * 2);
duration.setDotted(false);
duration.setDoubleDotted(false);
TGActionManager tgActionManager = TGActionManager.getInstance(getContext());
tgActionManager.execute(TGSetDurationAction.NAME, context);
}
}
示例6: writeNoteEffects
private void writeNoteEffects(TGNoteEffect effect) throws IOException {
int flags1 = 0;
int flags2 = 0;
if (effect.isBend()) {
flags1 |= 0x01;
}
if (effect.isHammer()) {
flags1 |= 0x02;
}
if (effect.isLetRing()) {
flags1 |= 0x08;
}
if (effect.isGrace()) {
flags1 |= 0x10;
}
if(effect.isStaccato()){
flags2 |= 0x01;
}
if(effect.isPalmMute()){
flags2 |= 0x02;
}
if(effect.isTremoloPicking()){
flags2 |= 0x04;
}
if (effect.isSlide()) {
flags2 |= 0x08;
}
if (effect.isVibrato()) {
flags2 |= 0x40;
}
if(effect.isHarmonic()){
flags2 |= 0x10;
}
if(effect.isTrill()){
flags2 |= 0x20;
}
writeUnsignedByte(flags1);
writeUnsignedByte(flags2);
if ((flags1 & 0x01) != 0) {
writeBend(effect.getBend());
}
if ((flags1 & 0x10) != 0) {
writeGrace(effect.getGrace());
}
if ((flags2 & 0x04) != 0) {
writeTremoloPicking(effect.getTremoloPicking());
}
if ((flags2 & 0x08) != 0) {
writeByte((byte)1);
}
if ((flags2 & 0x10) != 0) {
if(effect.getHarmonic().getType() == TGEffectHarmonic.TYPE_NATURAL){
writeByte((byte)1);
}else if(effect.getHarmonic().getType() == TGEffectHarmonic.TYPE_TAPPED){
writeByte((byte)3);
}else if(effect.getHarmonic().getType() == TGEffectHarmonic.TYPE_PINCH){
writeByte((byte)4);
}else if(effect.getHarmonic().getType() == TGEffectHarmonic.TYPE_SEMI){
writeByte((byte)5);
}else if(effect.getHarmonic().getType() == TGEffectHarmonic.TYPE_ARTIFICIAL){
writeByte((byte)15);
}
}
if ((flags2 & 0x20) != 0) {
writeByte((byte)effect.getTrill().getFret());
if(effect.getTrill().getDuration().getValue() == TGDuration.SIXTEENTH){
writeByte((byte)1);
}else if(effect.getTrill().getDuration().getValue() == TGDuration.THIRTY_SECOND){
writeByte((byte)2);
}else if(effect.getTrill().getDuration().getValue() == TGDuration.SIXTY_FOURTH){
writeByte((byte)3);
}
}
}
示例7: paintSilence
public void paintSilence(TGLayout layout,TGPainter painter, float fromX, float fromY) {
int style = layout.getStyle();
float x = 0;
float lineSpacing = 0;
float y = 0;
float scale = 0;
if((style & TGLayout.DISPLAY_SCORE) != 0 ){
x = fromX + getPosX() + getBeatImpl().getSpacing(layout);
y = fromY + getPaintPosition(TGTrackSpacing.POSITION_SCORE_MIDDLE_LINES) + this.silenceY;
lineSpacing = layout.getScoreLineSpacing();
scale = (lineSpacing / 9.0f);
}else{
x = fromX + getPosX() + getBeatImpl().getSpacing(layout) - 1;
y = fromY + getPaintPosition(TGTrackSpacing.POSITION_TABLATURE) + this.silenceY;
lineSpacing = layout.getStringSpacing();
scale = (lineSpacing / 10.0f);
}
setStyle(layout, painter,(layout.isPlayModeEnabled() && isPlaying(layout)));
painter.initPath(TGPainter.PATH_FILL);
int duration = getDuration().getValue();
if(duration == TGDuration.WHOLE){
TGSilencePainter.paintWhole(painter, x, y , scale);
}
else if(duration == TGDuration.HALF){
TGSilencePainter.paintHalf(painter, x, y , scale);
}
else if(duration == TGDuration.QUARTER){
TGSilencePainter.paintQuarter(painter, x, y, scale);
}
else if(duration == TGDuration.EIGHTH){
TGSilencePainter.paintEighth(painter, x, y, scale);
}
else if(duration == TGDuration.SIXTEENTH){
TGSilencePainter.paintSixteenth(painter, x, y, scale);
}
else if(duration == TGDuration.THIRTY_SECOND){
TGSilencePainter.paintThirtySecond(painter, x, y, scale);
}
else if(duration == TGDuration.SIXTY_FOURTH){
TGSilencePainter.paintSixtyFourth(painter, x, y, scale);
}
painter.closePath();
if(getDuration().isDotted() || getDuration().isDoubleDotted()){
layout.setDotStyle(painter);
painter.initPath();
painter.moveTo(x + 10,y +1);
painter.addOval(x + 10,y +1,1,1);
if(getDuration().isDoubleDotted()){
painter.moveTo(x + 13,y +1);
painter.addOval(x + 13,y +1,1,1);
}
painter.closePath();
}
if(!getDuration().getDivision().isEqual(TGDivisionType.NORMAL)){
layout.setDivisionTypeStyle(painter);
if((style & TGLayout.DISPLAY_SCORE) != 0 ){
painter.drawString(Integer.toString(getDuration().getDivision().getEnters()), x,(fromY + getPaintPosition(TGTrackSpacing.POSITION_DIVISION_TYPE)));
}else{
painter.drawString(Integer.toString(getDuration().getDivision().getEnters()),x,(fromY + getPaintPosition(TGTrackSpacing.POSITION_DIVISION_TYPE)));
}
}
}