private TGSong read() { TGSong song = this.factory.newSong(); // leo el nombre song.setName(readString()); // leo el artista song.setArtist(readString()); // leo el album song.setAlbum(readString()); // leo el autor song.setAuthor(readString()); // leo la cantidad de pistas int trackCount = readInt(); // leo las pistas for (int i = 0; i < trackCount; i++) { song.addTrack(readTrack(song)); } return song; }
private void readTracks(TGSong song, int count, List channels, TGLyric lyric, int lyricTrack) throws IOException { for (int number = 1; number <= count; number++) { song.addTrack( readTrack( song, number, channels, (number == lyricTrack) ? lyric : getFactory().newLyric())); } }
private void readTracks( TGSong song, int count, List<TGChannel> channels, TGLyric lyric, int lyricTrack) throws IOException { for (int number = 1; number <= count; number++) { song.addTrack( readTrack(number, channels, (number == lyricTrack) ? lyric : new TGLyricImpl())); } skip((getVersionIndex() == 0 ? 2 : 1)); }
private TGSong read() { TGSong song = this.factory.newSong(); // leo el nombre song.setName(readUnsignedByteString()); // leo el artista song.setArtist(readUnsignedByteString()); // leo el album song.setAlbum(readUnsignedByteString()); // leo el autor song.setAuthor(readUnsignedByteString()); // leo la cantidad de measure headers int headerCount = readShort(); // leo las pistas TGMeasureHeader lastHeader = null; long headerStart = TGDuration.QUARTER_TIME; for (int i = 0; i < headerCount; i++) { TGMeasureHeader header = readMeasureHeader(i + 1, headerStart, lastHeader); song.addMeasureHeader(header); headerStart += header.getLength(); lastHeader = header; } // leo la cantidad de pistas int trackCount = readByte(); // leo las pistas for (int i = 0; i < trackCount; i++) { song.addTrack(readTrack(i + 1, song)); } return song; }