Exemplo n.º 1
0
 private function writeLyrics(Song $song)
 {
     $lyricTrack = null;
     $tracks = $song->getTracks();
     foreach ($tracks as $track) {
         if (!$track->getLyrics()->isEmpty()) {
             $lyricTrack = $track;
             break;
         }
     }
     $this->writeInt($lyricTrack == null ? 0 : $lyricTrack->getNumber());
     $this->writeInt($lyricTrack == null ? 0 : $lyricTrack->getLyrics()->getFrom());
     $this->writeStringInteger($lyricTrack == null ? '' : $lyricTrack->getLyrics()->getLyrics());
     for ($i = 0; $i < 4; $i++) {
         $this->writeInt($lyricTrack === null ? 0 : 1);
         $this->writeStringInteger('');
     }
 }