当前位置: 首页>>代码示例>>Java>>正文


Java TGDuration.getValue方法代码示例

本文整理汇总了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);
	}
}
 
开发者ID:axlecho,项目名称:tuxguitar,代码行数:19,代码来源:TGLayout.java

示例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);
}
 
开发者ID:axlecho,项目名称:tuxguitar,代码行数:27,代码来源:TGLayout.java

示例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;
}
 
开发者ID:axlecho,项目名称:tuxguitar,代码行数:28,代码来源:GP4OutputStream.java

示例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);
	}
}
 
开发者ID:axlecho,项目名称:tuxguitar,代码行数:13,代码来源:TGIncrementDurationAction.java

示例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);
	}
}
 
开发者ID:axlecho,项目名称:tuxguitar,代码行数:14,代码来源:TGSetWholeDurationAction.java

示例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);
	}
}
 
开发者ID:axlecho,项目名称:tuxguitar,代码行数:13,代码来源:TGDecrementDurationAction.java


注:本文中的org.herac.tuxguitar.song.models.TGDuration.getValue方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。