本文整理汇总了Java中org.herac.tuxguitar.song.models.TGDuration.setValue方法的典型用法代码示例。如果您正苦于以下问题:Java TGDuration.setValue方法的具体用法?Java TGDuration.setValue怎么用?Java TGDuration.setValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.herac.tuxguitar.song.models.TGDuration
的用法示例。
在下文中一共展示了TGDuration.setValue方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: parseRhythm
import org.herac.tuxguitar.song.models.TGDuration; //导入方法依赖的package包/类
private void parseRhythm(GPXRhythm gpRhythm , TGDuration tgDuration){
tgDuration.setDotted(gpRhythm.getAugmentationDotCount() == 1);
tgDuration.setDoubleDotted(gpRhythm.getAugmentationDotCount() == 2);
tgDuration.getDivision().setTimes(gpRhythm.getPrimaryTupletDen());
tgDuration.getDivision().setEnters(gpRhythm.getPrimaryTupletNum());
if(gpRhythm.getNoteValue().equals("Whole")){
tgDuration.setValue(TGDuration.WHOLE);
}else if(gpRhythm.getNoteValue().equals("Half")){
tgDuration.setValue(TGDuration.HALF);
}else if(gpRhythm.getNoteValue().equals("Quarter")){
tgDuration.setValue(TGDuration.QUARTER);
}else if(gpRhythm.getNoteValue().equals("Eighth")){
tgDuration.setValue(TGDuration.EIGHTH);
}else if(gpRhythm.getNoteValue().equals("16th")){
tgDuration.setValue(TGDuration.SIXTEENTH);
}else if(gpRhythm.getNoteValue().equals("32nd")){
tgDuration.setValue(TGDuration.THIRTY_SECOND);
}else if(gpRhythm.getNoteValue().equals("64th")){
tgDuration.setValue(TGDuration.SIXTY_FOURTH);
}
}
示例2: getRealStart
import org.herac.tuxguitar.song.models.TGDuration; //导入方法依赖的package包/类
public long getRealStart(TGMeasure measure,long currStart){
long beatLength = TGSongManager.getDivisionLength(measure.getHeader());
long start = currStart;
boolean startBeat = (start % beatLength == 0);
if(!startBeat){
TGDuration minDuration = getSongManager().getFactory().newDuration();
minDuration.setValue(TGDuration.SIXTY_FOURTH);
minDuration.getDivision().setEnters(3);
minDuration.getDivision().setTimes(2);
for(int i = 0;i < minDuration.getTime();i++){
start ++;
startBeat = (start % beatLength == 0);
if(startBeat){
break;
}
}
if(!startBeat){
start = currStart;
}
}
return start;
}
示例3: createDurations
import org.herac.tuxguitar.song.models.TGDuration; //导入方法依赖的package包/类
public static List<TGDuration> createDurations(TGFactory factory,long time){
List<TGDuration> durations = new ArrayList<TGDuration>();
TGDuration minimum = factory.newDuration();
minimum.setValue(TGDuration.SIXTY_FOURTH);
minimum.setDotted(false);
minimum.setDoubleDotted(false);
minimum.getDivision().setEnters(3);
minimum.getDivision().setTimes(2);
long missingTime = time;
while( missingTime > minimum.getTime() ){
TGDuration duration = TGDuration.fromTime(factory, missingTime, minimum , 10);
durations.add( duration.clone(factory) );
missingTime -= duration.getTime();
}
return durations;
}
示例4: readDuration
import org.herac.tuxguitar.song.models.TGDuration; //导入方法依赖的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);
}
}
示例5: 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);
}
}
示例6: 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);
}
}
示例7: 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);
}
}
示例8: readDuration
import org.herac.tuxguitar.song.models.TGDuration; //导入方法依赖的package包/类
private TGDuration readDuration() throws IOException {
TGDuration duration = getFactory().newDuration();
duration.setValue( (int) (Math.pow( 2 , (readByte() + 4) ) / 4 ) );
return duration;
}
示例9: readDuration
import org.herac.tuxguitar.song.models.TGDuration; //导入方法依赖的package包/类
private TGDuration readDuration(int flags) throws IOException {
TGDuration duration = getFactory().newDuration();
duration.setValue( (int) (Math.pow( 2 , (readByte() + 4) ) / 4 ) );
duration.setDotted(((flags & 0x01) != 0));
if ((flags & 0x20) != 0) {
int divisionType = readInt();
switch (divisionType) {
case 3:
duration.getDivision().setEnters(3);
duration.getDivision().setTimes(2);
break;
case 5:
duration.getDivision().setEnters(5);
duration.getDivision().setTimes(4);
break;
case 6:
duration.getDivision().setEnters(6);
duration.getDivision().setTimes(4);
break;
case 7:
duration.getDivision().setEnters(7);
duration.getDivision().setTimes(4);
break;
case 9:
duration.getDivision().setEnters(9);
duration.getDivision().setTimes(8);
break;
case 10:
duration.getDivision().setEnters(10);
duration.getDivision().setTimes(8);
break;
case 11:
duration.getDivision().setEnters(11);
duration.getDivision().setTimes(8);
break;
case 12:
duration.getDivision().setEnters(12);
duration.getDivision().setTimes(8);
break;
}
}
return duration;
}
示例10: readDuration
import org.herac.tuxguitar.song.models.TGDuration; //导入方法依赖的package包/类
private TGDuration readDuration(int flags) throws IOException {
TGDuration duration = getFactory().newDuration();
duration.setValue( (int) (Math.pow( 2 , (readByte() + 4) ) / 4 ) );
duration.setDotted(((flags & 0x01) != 0));
if ((flags & 0x20) != 0) {
int divisionType = readInt();
switch (divisionType) {
case 3:
duration.getDivision().setEnters(3);
duration.getDivision().setTimes(2);
break;
case 5:
duration.getDivision().setEnters(5);
duration.getDivision().setTimes(4);
break;
case 6:
duration.getDivision().setEnters(6);
duration.getDivision().setTimes(4);
break;
case 7:
duration.getDivision().setEnters(7);
duration.getDivision().setTimes(4);
break;
case 9:
duration.getDivision().setEnters(9);
duration.getDivision().setTimes(8);
break;
case 10:
duration.getDivision().setEnters(10);
duration.getDivision().setTimes(8);
break;
case 11:
duration.getDivision().setEnters(11);
duration.getDivision().setTimes(8);
break;
case 12:
duration.getDivision().setEnters(12);
duration.getDivision().setTimes(8);
break;
case 13:
duration.getDivision().setEnters(13);
duration.getDivision().setTimes(8);
break;
}
}
return duration;
}
示例11: newDuration
import org.herac.tuxguitar.song.models.TGDuration; //导入方法依赖的package包/类
private TGDuration newDuration(int value){
TGDuration duration = this.songManager.getFactory().newDuration();
duration.setValue(value);
return duration;
}