• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

Java TGDivisionType类的典型用法和代码示例

java 2次浏览

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

TGDivisionType类属于org.herac.tuxguitar.song.models包,在下文中一共展示了TGDivisionType类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: readDuration

点赞 3

import org.herac.tuxguitar.song.models.TGDivisionType; //导入依赖的package包/类
private void readDuration(TGDuration duration) throws IOException{
	int header = readHeader();
	
	// leo el puntillo
	duration.setDotted((header & DURATION_DOTTED) != 0);
	
	//leo el doble puntillo
	duration.setDoubleDotted((header & DURATION_DOUBLE_DOTTED) != 0);
	
	//leo el valor
	duration.setValue(readByte());
	
	//leo el tipo de divisiones
	if(((header & DURATION_NO_TUPLET) != 0)){
		readDivisionType(duration.getDivision());
	}
	else{
		duration.getDivision().copyFrom(TGDivisionType.NORMAL);
	}
}
 

开发者ID:axlecho,
项目名称:tuxguitar,
代码行数:21,
代码来源:TGInputStream.java

示例2: readDuration

点赞 3

import org.herac.tuxguitar.song.models.TGDivisionType; //导入依赖的package包/类
private void readDuration(TGDuration duration){
	int header = readHeader();
	
	// leo el puntillo
	duration.setDotted((header & DURATION_DOTTED) != 0);
	
	//leo el doble puntillo
	duration.setDoubleDotted((header & DURATION_DOUBLE_DOTTED) != 0);
	
	//leo el valor
	duration.setValue(readByte());
	
	//leo el tipo de divisiones
	if(((header & DURATION_NO_TUPLET) != 0)){
		readDivisionType(duration.getDivision());
	}
	else{
		TGDivisionType.NORMAL.copy(duration.getDivision());
	}
}
 

开发者ID:lathspell,
项目名称:dtx2gp,
代码行数:21,
代码来源:TGInputStream.java

示例3: createDivisionTypeMenu

点赞 3

import org.herac.tuxguitar.song.models.TGDivisionType; //导入依赖的package包/类
private void createDivisionTypeMenu(TGToolBar toolBar, ToolItem item) {
	TGDuration duration = TablatureEditor.getInstance(toolBar.getContext()).getTablature().getCaret().getDuration();
	Menu menu = new Menu(item.getParent().getShell());
	
	for( int i = 0 ; i < TGDivisionType.ALTERED_DIVISION_TYPES.length ; i ++ ){
		TGDivisionType divisionType = TGDivisionType.ALTERED_DIVISION_TYPES[i];
		
		MenuItem menuItem = new MenuItem(menu, SWT.CHECK);
		menuItem.setText(toolBar.toCheckString(Integer.toString(TGDivisionType.ALTERED_DIVISION_TYPES[i].getEnters()), (divisionType.isEqual(duration.getDivision()))));
		menuItem.addSelectionListener(this.createDivisionTypeAction(toolBar, divisionType));
	}
	
	Rectangle rect = item.getBounds();
	Point pt = item.getParent().toDisplay(new Point(rect.x, rect.y));
	
	menu.setLocation(pt.x, pt.y + rect.height);
	menu.setVisible(true);
}
 

开发者ID:theokyr,
项目名称:TuxGuitar-1.3.1-fork,
代码行数:19,
代码来源:TGToolBarSectionDuration.java

示例4: readDuration

点赞 3

import org.herac.tuxguitar.song.models.TGDivisionType; //导入依赖的package包/类
private void readDuration(TGDuration duration){
	int header = readHeader();
	
	// leo el puntillo
	duration.setDotted((header & DURATION_DOTTED) != 0);
	
	//leo el doble puntillo
	duration.setDoubleDotted((header & DURATION_DOUBLE_DOTTED) != 0);
	
	//leo el valor
	duration.setValue(readByte());
	
	//leo el tipo de divisiones
	if(((header & DURATION_NO_TUPLET) != 0)){
		readDivisionType(duration.getDivision());
	}
	else{
		duration.getDivision().copyFrom(TGDivisionType.NORMAL);
	}
}
 

开发者ID:theokyr,
项目名称:TuxGuitar-1.3.1-fork,
代码行数:21,
代码来源:TGInputStream.java

示例5: addTrioles

点赞 3

import org.herac.tuxguitar.song.models.TGDivisionType; //导入依赖的package包/类
private void addTrioles(TGDuration duration) {
	TGDivisionType dt=duration.getDivision();
	int times=dt.getTimes();
	int enters=dt.getEnters();
	if(enters==times) {
		handleTrioles();
	}
	else {
		if(this.enterstogo==0) {
			this.enterstogo=enters;
			this.triol = "("+enters+":"+times+":"+enters; 
			this.line += this.triol+" ";
		}
		this.enters=enters;
		this.times=times;
		--this.enterstogo;
		if(this.enterstogo==0) {
			int p=this.line.lastIndexOf(this.triol);
			if(this.times==2)
				this.line=this.line.substring(0, p)+"("+this.enters+" "+this.line.substring(p+this.triol.length());
			this.enters=1;
			this.times=1;
		}
	}
}
 

开发者ID:theokyr,
项目名称:TuxGuitar-1.3.1-fork,
代码行数:26,
代码来源:ABCOutputStream.java

示例6: widgetSelected

点赞 3

import org.herac.tuxguitar.song.models.TGDivisionType; //导入依赖的package包/类
public void widgetSelected(SelectionEvent event) {
	if (event.detail == SWT.ARROW) {
		ToolItem item = (ToolItem) event.widget;
		Rectangle rect = item.getBounds();
		Point pt = item.getParent().toDisplay(new Point(rect.x, rect.y));
		this.subMenu.setLocation(pt.x, pt.y + rect.height);
		this.subMenu.setVisible(true);
	}else{
		TGDuration duration = getEditor().getTablature().getCaret().getDuration();
		if(duration.getDivision().isEqual(TGDivisionType.NORMAL)){
			((TGDivisionType)this.divisionType.getData()).setEnters(3);
			((TGDivisionType)this.divisionType.getData()).setTimes(2);
		}else{
			((TGDivisionType)this.divisionType.getData()).setEnters(1);
			((TGDivisionType)this.divisionType.getData()).setTimes(1);
		}
		TuxGuitar.instance().getAction(ChangeDivisionTypeAction.NAME).process(event);
	}
}
 

开发者ID:Totallicks,
项目名称:totallicks-tuxguitar,
代码行数:20,
代码来源:DurationToolItems.java

示例7: readDuration

点赞 3

import org.herac.tuxguitar.song.models.TGDivisionType; //导入依赖的package包/类
private void readDuration(TGDuration duration){
	int header = readHeader();
	
	// leo el puntillo
	duration.setDotted((header & DURATION_DOTTED) != 0);
	
	//leo el doble puntillo
	duration.setDoubleDotted((header & DURATION_DOUBLE_DOTTED) != 0);
	
	//leo el valor
	duration.setValue(readByte());
	
	//leo el tipo de divisiones
	if(((header & DURATION_NO_TUPLE) != 0)){
		readDivisionType(duration.getDivision());
	}
	else{
		TGDivisionType.NORMAL.copy(duration.getDivision());
	}
}
 

开发者ID:Totallicks,
项目名称:totallicks-tuxguitar,
代码行数:21,
代码来源:TGInputStream.java

示例8: initializeItems

点赞 2

import org.herac.tuxguitar.song.models.TGDivisionType; //导入依赖的package包/类
public void initializeItems(ContextMenu menu) {
	TGContext context = findContext();
	TGCaret caret = TGSongViewController.getInstance(context).getCaret();
	TGDuration duration = caret.getDuration();
	boolean running = TuxGuitar.getInstance(context).getPlayer().isRunning();

	this.initializeItem(menu, R.id.menu_duration_whole, this.createActionProcessor(TGSetWholeDurationAction.NAME), !running, duration.getValue() == TGDuration.WHOLE);
	this.initializeItem(menu, R.id.menu_duration_half, this.createActionProcessor(TGSetHalfDurationAction.NAME), !running, duration.getValue() == TGDuration.HALF);
	this.initializeItem(menu, R.id.menu_duration_quarter, this.createActionProcessor(TGSetQuarterDurationAction.NAME), !running, duration.getValue() == TGDuration.QUARTER);
	this.initializeItem(menu, R.id.menu_duration_eighth, this.createActionProcessor(TGSetEighthDurationAction.NAME), !running, duration.getValue() == TGDuration.EIGHTH);
	this.initializeItem(menu, R.id.menu_duration_sixteenth, this.createActionProcessor(TGSetSixteenthDurationAction.NAME), !running, duration.getValue() == TGDuration.SIXTEENTH);
	this.initializeItem(menu, R.id.menu_duration_thirtysecond, this.createActionProcessor(TGSetThirtySecondDurationAction.NAME), !running, duration.getValue() == TGDuration.THIRTY_SECOND);
	this.initializeItem(menu, R.id.menu_duration_sixtyfourth, this.createActionProcessor(TGSetSixtyFourthDurationAction.NAME), !running, duration.getValue() == TGDuration.SIXTY_FOURTH);
	this.initializeItem(menu, R.id.menu_duration_dotted, this.createActionProcessor(TGChangeDottedDurationAction.NAME), !running, duration.isDotted());
	this.initializeItem(menu, R.id.menu_duration_doubledotted, this.createActionProcessor(TGChangeDoubleDottedDurationAction.NAME), !running, duration.isDoubleDotted());
	
	this.initializeDivisionItem(menu, R.id.menu_duration_division_type_1, TGDivisionType.NORMAL, duration, running);
	this.initializeDivisionItem(menu, R.id.menu_duration_division_type_3, TGDivisionType.ALTERED_DIVISION_TYPES[0], duration, running);
	this.initializeDivisionItem(menu, R.id.menu_duration_division_type_5, TGDivisionType.ALTERED_DIVISION_TYPES[1], duration, running);
	this.initializeDivisionItem(menu, R.id.menu_duration_division_type_6, TGDivisionType.ALTERED_DIVISION_TYPES[2], duration, running);
	this.initializeDivisionItem(menu, R.id.menu_duration_division_type_7, TGDivisionType.ALTERED_DIVISION_TYPES[3], duration, running);
	this.initializeDivisionItem(menu, R.id.menu_duration_division_type_9, TGDivisionType.ALTERED_DIVISION_TYPES[4], duration, running);
	this.initializeDivisionItem(menu, R.id.menu_duration_division_type_10, TGDivisionType.ALTERED_DIVISION_TYPES[5], duration, running);
	this.initializeDivisionItem(menu, R.id.menu_duration_division_type_11, TGDivisionType.ALTERED_DIVISION_TYPES[6], duration, running);
	this.initializeDivisionItem(menu, R.id.menu_duration_division_type_12, TGDivisionType.ALTERED_DIVISION_TYPES[7], duration, running);
	this.initializeDivisionItem(menu, R.id.menu_duration_division_type_13, TGDivisionType.ALTERED_DIVISION_TYPES[8], duration, running);
}
 

开发者ID:axlecho,
项目名称:tuxguitar,
代码行数:28,
代码来源:TGDurationMenu.java

示例9: processAction

点赞 2

import org.herac.tuxguitar.song.models.TGDivisionType; //导入依赖的package包/类
protected void processAction(TGActionContext context){
	TGDivisionType divisionType = (TGDivisionType) context.getAttribute(PROPERTY_DIVISION_TYPE);
	TGDuration duration = (TGDuration) context.getAttribute(TGDocumentContextAttributes.ATTRIBUTE_DURATION);
	
	duration.getDivision().setEnters(divisionType.getEnters());
	duration.getDivision().setTimes(divisionType.getTimes());
	
	TGActionManager tgActionManager = TGActionManager.getInstance(getContext());
	tgActionManager.execute(TGSetDurationAction.NAME, context);
}
 

开发者ID:axlecho,
项目名称:tuxguitar,
代码行数:11,
代码来源:TGSetDivisionTypeDurationAction.java

示例10: writeDuration

点赞 2

import org.herac.tuxguitar.song.models.TGDivisionType; //导入依赖的package包/类
private void writeDuration(TGDuration duration) throws IOException{
	int header = 0;
	header = (duration.isDotted())?header |= DURATION_DOTTED:header;
	header = (duration.isDoubleDotted())?header |= DURATION_DOUBLE_DOTTED:header;
	header = (!duration.getDivision().isEqual(TGDivisionType.NORMAL))?header |= DURATION_NO_TUPLET:header;
	writeHeader(header);
	
	//escribo el valor
	writeByte(duration.getValue());
	
	//escribo el tipo de divisiones
	if(((header & DURATION_NO_TUPLET) != 0)){
		writeDivisionType(duration.getDivision());
	}
}
 

开发者ID:axlecho,
项目名称:tuxguitar,
代码行数:16,
代码来源:TGOutputStream.java

示例11: writeDivisionType

点赞 2

import org.herac.tuxguitar.song.models.TGDivisionType; //导入依赖的package包/类
private void writeDivisionType(TGDivisionType divisionType) throws IOException{
	//escribo los enters
	writeByte(divisionType.getEnters());
	
	//escribo los tiempos
	writeByte(divisionType.getTimes());
}
 

开发者ID:axlecho,
项目名称:tuxguitar,
代码行数:8,
代码来源:TGOutputStream.java

示例12: readDivisionType

点赞 2

import org.herac.tuxguitar.song.models.TGDivisionType; //导入依赖的package包/类
private void readDivisionType(TGDivisionType divisionType) throws IOException{
	//leo los enters
	divisionType.setEnters(readByte());
	
	//leo los tiempos
	divisionType.setTimes(readByte());
}
 

开发者ID:axlecho,
项目名称:tuxguitar,
代码行数:8,
代码来源:TGInputStream.java

示例13: writeDuration

点赞 2

import org.herac.tuxguitar.song.models.TGDivisionType; //导入依赖的package包/类
private void writeDuration(TGDuration duration){
	int header = 0;
	header = (duration.isDotted())?header |= DURATION_DOTTED:header;
	header = (duration.isDoubleDotted())?header |= DURATION_DOUBLE_DOTTED:header;
	header = (!duration.getDivision().isEqual(TGDivisionType.NORMAL))?header |= DURATION_NO_TUPLET:header;
	writeHeader(header);
	
	//escribo el valor
	writeByte(duration.getValue());
	
	//escribo el tipo de divisiones
	if(((header & DURATION_NO_TUPLET) != 0)){
		writeDivisionType(duration.getDivision());
	}
}
 

开发者ID:lathspell,
项目名称:dtx2gp,
代码行数:16,
代码来源:TGOutputStream.java

示例14: writeDivisionType

点赞 2

import org.herac.tuxguitar.song.models.TGDivisionType; //导入依赖的package包/类
private void writeDivisionType(TGDivisionType divisionType){
	//escribo los enters
	writeByte(divisionType.getEnters());
	
	//escribo los tiempos
	writeByte(divisionType.getTimes());
}
 

开发者ID:lathspell,
项目名称:dtx2gp,
代码行数:8,
代码来源:TGOutputStream.java

示例15: readDivisionType

点赞 2

import org.herac.tuxguitar.song.models.TGDivisionType; //导入依赖的package包/类
private void readDivisionType(TGDivisionType divisionType){
	//leo los enters
	divisionType.setEnters(readByte());
	
	//leo los tiempos
	divisionType.setTimes(readByte());
}
 

开发者ID:lathspell,
项目名称:dtx2gp,
代码行数:8,
代码来源:TGInputStream.java

示例16: createDivisionTypeComboItems

点赞 2

import org.herac.tuxguitar.song.models.TGDivisionType; //导入依赖的package包/类
private static ComboItem[] createDivisionTypeComboItems(){
	TGDivisionType[] types = TGDivisionType.ALTERED_DIVISION_TYPES;
	
	ComboItem[] comboItems = new ComboItem[ types.length + 1 ];
	comboItems[0] = new ComboItem( TuxGuitar.getProperty("beat.move-custom.dialog.duration.division-type.normal") , new int[] { 1  , 1} );
	for( int i = 0 ; i < types.length ; i ++ ){ 
		comboItems[i + 1] = new ComboItem(new Integer(types[i].getEnters()).toString(),new int[]{types[i].getEnters(),types[i].getTimes()});
	}
	
	return comboItems;
}
 

开发者ID:theokyr,
项目名称:TuxGuitar-1.3.1-fork,
代码行数:12,
代码来源:TGBeatMoveDialog.java

示例17: toggleDivisionType

点赞 2

import org.herac.tuxguitar.song.models.TGDivisionType; //导入依赖的package包/类
private void toggleDivisionType(TGToolBar toolBar) {
	TGDuration duration = TablatureEditor.getInstance(toolBar.getContext()).getTablature().getCaret().getDuration();
	TGDivisionType divisionType = null;
	if(duration.getDivision().isEqual(TGDivisionType.NORMAL)){
		divisionType = this.createDivisionType(toolBar, TGDivisionType.TRIPLET);
	}else{
		divisionType = this.createDivisionType(toolBar, TGDivisionType.NORMAL);
	}
	
	this.createDivisionTypeAction(toolBar, divisionType).process();
}
 

开发者ID:theokyr,
项目名称:TuxGuitar-1.3.1-fork,
代码行数:12,
代码来源:TGToolBarSectionDuration.java

示例18: readDivisionType

点赞 2

import org.herac.tuxguitar.song.models.TGDivisionType; //导入依赖的package包/类
private void readDivisionType(TGDivisionType divisionType){
	//leo los enters
	divisionType.setEnters(readInt());
	
	//leo los tiempos
	divisionType.setTimes(readInt());
}
 

开发者ID:theokyr,
项目名称:TuxGuitar-1.3.1-fork,
代码行数:8,
代码来源:TGInputStream.java

示例19: getStart

点赞 2

import org.herac.tuxguitar.song.models.TGDivisionType; //导入依赖的package包/类
private long getStart(TGDuration duration, TGMeasure measure,int position){
	float fixedPosition = position;
	if(duration != null && !duration.getDivision().isEqual(TGDivisionType.NORMAL)){
		fixedPosition = (( fixedPosition - (fixedPosition % 64)) + ((((fixedPosition % 64) * 2) * 2) / 3) );
	}
	long start = ((long) (measure.getStart() + ( (fixedPosition * TGDuration.QUARTER_TIME)  / 64)) );
	
	return start;
}
 

开发者ID:theokyr,
项目名称:TuxGuitar-1.3.1-fork,
代码行数:10,
代码来源:TESongStream.java

示例20: writeDuration

点赞 2

import org.herac.tuxguitar.song.models.TGDivisionType; //导入依赖的package包/类
private void writeDuration(Node parent, TGDuration duration){
	int index = duration.getIndex();
	if( index >=0 && index <= 6 ){
		int value = (DURATION_VALUES[ index ] * duration.getDivision().getTimes() / duration.getDivision().getEnters());
		if(duration.isDotted()){
			value += (value / 2);
		}
		else if(duration.isDoubleDotted()){
			value += ((value / 4) * 3);
		}
		
		this.addNode(parent,"duration",Integer.toString(value));
		this.addNode(parent,"type",DURATION_NAMES[ index ]);
		
		if(duration.isDotted()){
			this.addNode(parent,"dot");
		}
		else if(duration.isDoubleDotted()){
			this.addNode(parent,"dot");
			this.addNode(parent,"dot");
		}
		
		if(!duration.getDivision().isEqual(TGDivisionType.NORMAL)){
			Node divisionType = this.addNode(parent,"time-modification");
			this.addNode(divisionType,"actual-notes",Integer.toString(duration.getDivision().getEnters()));
			this.addNode(divisionType,"normal-notes",Integer.toString(duration.getDivision().getTimes()));
		}
	}
}
 

开发者ID:theokyr,
项目名称:TuxGuitar-1.3.1-fork,
代码行数:30,
代码来源:MusicXMLWriter.java


版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)