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 readInfo(TGSong song) throws IOException { song.setName(readStringByteSizeOfInteger()); readStringByteSizeOfInteger(); song.setArtist(readStringByteSizeOfInteger()); song.setAlbum(readStringByteSizeOfInteger()); song.setAuthor(readStringByteSizeOfInteger()); song.setCopyright(readStringByteSizeOfInteger()); song.setWriter(readStringByteSizeOfInteger()); readStringByteSizeOfInteger(); int comments = readInt(); for (int i = 0; i < comments; i++) { song.setComments(song.getComments() + readStringByteSizeOfInteger()); } }
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; }