Example #1
0
 private TGTrack readTrack(int number, List<TGChannel> channels, TGLyric lyrics)
     throws IOException {
   readUnsignedByte();
   if (number == 1 || getVersionIndex() == 0) {
     skip(1);
   }
   TGTrack track = new TGTrackImpl();
   track.setNumber(number);
   track.setLyrics(lyrics);
   track.setName(readStringByte(40));
   int stringCount = readInt();
   for (int i = 0; i < 7; i++) {
     int tuning = readInt();
     if (stringCount > i) {
       track.getStrings().add(new TGString(i + 1, tuning));
     }
   }
   readInt();
   final TGChannel newChannel = this.readChannel(channels);
   if (newChannel != null) {
     track.setChannel(newChannel);
   }
   // readChannel(track.getChannel(), channels);
   readInt();
   track.setOffset(readInt());
   track.setColor(readColor());
   skip((getVersionIndex() > 0) ? 49 : 44);
   if (getVersionIndex() > 0) {
     readStringByteSizeOfInteger();
     readStringByteSizeOfInteger();
   }
   return track;
 }
 private TGTrack readTrack(TGSong song, int number, List channels, TGLyric lyrics)
     throws IOException {
   TGTrack track = getFactory().newTrack();
   track.setNumber(number);
   track.setLyrics(lyrics);
   readUnsignedByte();
   track.setName(readStringByte(40));
   int stringCount = readInt();
   for (int i = 0; i < 7; i++) {
     int tuning = readInt();
     if (stringCount > i) {
       TGString string = getFactory().newString();
       string.setNumber(i + 1);
       string.setValue(tuning);
       track.getStrings().add(string);
     }
   }
   readInt();
   readChannel(song, track, channels);
   readInt();
   track.setOffset(readInt());
   readColor(track.getColor());
   return track;
 }