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


Java TGDuration.THIRTY_SECOND属性代码示例

本文整理汇总了Java中org.herac.tuxguitar.song.models.TGDuration.THIRTY_SECOND属性的典型用法代码示例。如果您正苦于以下问题:Java TGDuration.THIRTY_SECOND属性的具体用法?Java TGDuration.THIRTY_SECOND怎么用?Java TGDuration.THIRTY_SECOND使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在org.herac.tuxguitar.song.models.TGDuration的用法示例。

在下文中一共展示了TGDuration.THIRTY_SECOND属性的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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;
}
 
开发者ID:axlecho,项目名称:tuxguitar,代码行数:18,代码来源:GP4OutputStream.java


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


示例3: getVoiceWidth

/**
 * 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,代码行数:26,代码来源:TGLayout.java


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


示例5: writeTremoloPicking

public void writeTremoloPicking(TGEffectTremoloPicking effect) throws IOException{
	if(effect.getDuration().getValue() == TGDuration.EIGHTH){
		writeUnsignedByte(1);
	}else if(effect.getDuration().getValue() == TGDuration.SIXTEENTH){
		writeUnsignedByte(2);
	}else if(effect.getDuration().getValue() == TGDuration.THIRTY_SECOND){
		writeUnsignedByte(3);
	}
}
 
开发者ID:axlecho,项目名称:tuxguitar,代码行数:9,代码来源:GP4OutputStream.java


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


示例7: writeTremoloPicking

private void writeTremoloPicking(TGEffectTremoloPicking tremoloPicking) throws IOException{
	if(tremoloPicking.getDuration().getValue() == TGDuration.EIGHTH){
		writeByte((byte)1);
	}else if(tremoloPicking.getDuration().getValue() == TGDuration.SIXTEENTH){
		writeByte((byte)2);
	}else if(tremoloPicking.getDuration().getValue() == TGDuration.THIRTY_SECOND){
		writeByte((byte)3);
	}
}
 
开发者ID:axlecho,项目名称:tuxguitar,代码行数:9,代码来源:GP5OutputStream.java


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


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



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