Ejemplo n.º 1
0
  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;
  }
Ejemplo n.º 2
0
 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());
   }
 }
Ejemplo n.º 3
0
  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;
  }