コード例 #1
0
 private TGMeasureHeader readMeasureHeader(int number, TGSong song, TGTimeSignature timeSignature)
     throws IOException {
   int flags = readUnsignedByte();
   TGMeasureHeader header = getFactory().newHeader();
   header.setNumber(number);
   header.setStart(0);
   header.getTempo().setValue(120);
   header.setTripletFeel(this.tripletFeel);
   header.setRepeatOpen(((flags & 0x04) != 0));
   if ((flags & 0x01) != 0) {
     timeSignature.setNumerator(readByte());
   }
   if ((flags & 0x02) != 0) {
     timeSignature.getDenominator().setValue(readByte());
   }
   timeSignature.copy(header.getTimeSignature());
   if ((flags & 0x08) != 0) {
     header.setRepeatClose(readByte());
   }
   if ((flags & 0x10) != 0) {
     header.setRepeatAlternative(parseRepeatAlternative(song, number, readUnsignedByte()));
   }
   if ((flags & 0x20) != 0) {
     header.setMarker(readMarker(number));
   }
   if ((flags & 0x40) != 0) {
     readByte();
     readByte();
   }
   return header;
 }
コード例 #2
0
ファイル: TGInputStream.java プロジェクト: snowd/tuxguitar
  private void readTimeSignature(TGTimeSignature timeSignature) {
    // leo el numerador
    timeSignature.setNumerator(readByte());

    // leo el denominador
    readDuration(timeSignature.getDenominator());
  }
コード例 #3
0
 private TGMeasureHeader readMeasureHeader(int index, TGTimeSignature timeSignature)
     throws IOException {
   int flags = readUnsignedByte();
   TGMeasureHeader header = new TGMeasureHeaderImpl();
   header.setNumber((index + 1));
   header.setStart(0);
   header.getTempo().setValue(120);
   header.setRepeatOpen(((flags & 0x04) != 0));
   if ((flags & 0x01) != 0) {
     timeSignature.setNumerator(readByte());
   }
   if ((flags & 0x02) != 0) {
     timeSignature.getDenominator().setValue(readByte());
   }
   header.setTimeSignature(timeSignature.clone());
   if ((flags & 0x08) != 0) {
     header.setRepeatClose(((readByte() & 0xff) - 1));
   }
   if ((flags & 0x20) != 0) {
     header.setMarker(readMarker(header.getNumber()));
   }
   if ((flags & 0x10) != 0) {
     header.setRepeatAlternative(readUnsignedByte());
   }
   if ((flags & 0x40) != 0) {
     readByte();
     readByte();
   }
   if ((flags & 0x01) != 0 || (flags & 0x02) != 0) {
     skip(4);
   }
   if ((flags & 0x10) == 0) {
     skip(1);
   }
   int tripletFeel = readByte();
   if (tripletFeel == 1) {
     header.setTripletFeel(TGMeasureHeader.TRIPLET_FEEL_EIGHTH);
   } else if (tripletFeel == 2) {
     header.setTripletFeel(TGMeasureHeader.TRIPLET_FEEL_SIXTEENTH);
   } else {
     header.setTripletFeel(TGMeasureHeader.TRIPLET_FEEL_NONE);
   }
   return header;
 }
コード例 #4
0
 public void copy(TGTimeSignature timeSignature) {
   timeSignature.setNumerator(getNumerator());
   getDenominator().copy(timeSignature.getDenominator());
 }