本文整理汇总了Java中org.herac.tuxguitar.song.models.TGDuration.getValue方法的典型用法代码示例。如果您正苦于以下问题:Java TGDuration.getValue方法的具体用法?Java TGDuration.getValue怎么用?Java TGDuration.getValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.herac.tuxguitar.song.models.TGDuration
的用法示例。
在下文中一共展示了TGDuration.getValue方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getMinSpacing
import org.herac.tuxguitar.song.models.TGDuration; //导入方法依赖的package包/类
/**
* Calcula el Espacio minimo que quedara entre nota y nota
*/
protected float getMinSpacing(TGDuration duration){
float scale = getScale();
switch(duration.getValue()){
case TGDuration.WHOLE:
return (50.0f * scale);
case TGDuration.HALF:
return (30.0f * scale);
case TGDuration.QUARTER:
return (25.0f * scale);
case TGDuration.EIGHTH:
return (20.0f * scale);
default:
return (18.0f * scale);
}
}
示例2: getVoiceWidth
import org.herac.tuxguitar.song.models.TGDuration; //导入方法依赖的package包/类
/**
* Calcula el Espacio que ocupara el pulso
*/
public float getVoiceWidth(TGVoiceImpl voice){
float scale = getScale();
TGDuration duration = voice.getDuration();
if(duration != null){
switch(duration.getValue()){
case TGDuration.WHOLE:
return (30.0f * scale);
case TGDuration.HALF:
return (25.0f * scale);
case TGDuration.QUARTER:
return (21.0f * scale);
case TGDuration.EIGHTH:
return (20.0f * scale);
case TGDuration.SIXTEENTH:
return (19.0f * scale);
case TGDuration.THIRTY_SECOND:
return (18.0f * scale);
default:
return this.getMinBeatWidth();
}
}
return (20.0f * scale);
}
示例3: parseDuration
import org.herac.tuxguitar.song.models.TGDuration; //导入方法依赖的package包/类
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: processAction
import org.herac.tuxguitar.song.models.TGDuration; //导入方法依赖的package包/类
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);
}
}
示例5: processAction
import org.herac.tuxguitar.song.models.TGDuration; //导入方法依赖的package包/类
protected void processAction(TGActionContext context) {
TGVoice voice = ((TGVoice) context.getAttribute(TGDocumentContextAttributes.ATTRIBUTE_VOICE));
TGDuration duration = ((TGDuration) context.getAttribute(TGDocumentContextAttributes.ATTRIBUTE_DURATION));
if( duration.getValue() != VALUE || (!voice.isEmpty() && voice.getDuration().getValue() != VALUE) ){
duration.setValue(VALUE);
duration.setDotted(false);
duration.setDoubleDotted(false);
TGActionManager tgActionManager = TGActionManager.getInstance(getContext());
tgActionManager.execute(TGSetDurationAction.NAME, context);
}
}
示例6: processAction
import org.herac.tuxguitar.song.models.TGDuration; //导入方法依赖的package包/类
protected void processAction(TGActionContext context) {
TGDuration duration = ((TGDuration) context.getAttribute(TGDocumentContextAttributes.ATTRIBUTE_DURATION));
if( duration.getValue() > TGDuration.WHOLE ){
duration.setValue(duration.getValue() / 2);
duration.setDotted(false);
duration.setDoubleDotted(false);
TGActionManager tgActionManager = TGActionManager.getInstance(getContext());
tgActionManager.execute(TGSetDurationAction.NAME, context);
}
}