private void writeTimeSignature(TGTimeSignature timeSignature) { // escribo el numerador writeByte(timeSignature.getNumerator()); // escribo el denominador writeDuration(timeSignature.getDenominator()); }
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; }
private void readTimeSignature(TGTimeSignature timeSignature) { // leo el numerador timeSignature.setNumerator(readByte()); // leo el denominador readDuration(timeSignature.getDenominator()); }
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; }
private void addTimeSignature(TGTimeSignature ts, int indent) { this.writer.println( indent(indent) + "\\time " + ts.getNumerator() + "/" + ts.getDenominator().getValue()); }
public boolean isEqual(TGTimeSignature ts) { return (getNumerator() == ts.getNumerator() && getDenominator().isEqual(ts.getDenominator())); }
public void copy(TGTimeSignature timeSignature) { timeSignature.setNumerator(getNumerator()); getDenominator().copy(timeSignature.getDenominator()); }