Esempio n. 1
0
 /**
  * @return string
  */
 public function FormatDataForID3v1()
 {
     $tag_data_id3v1['genreid'] = 255;
     if (!empty($this->tag_data['GENRE'])) {
         foreach ($this->tag_data['GENRE'] as $key => $value) {
             if (Tag\Id3v1::LookupGenreID($value) !== false) {
                 $tag_data_id3v1['genreid'] = Tag\Id3v1::LookupGenreID($value);
                 break;
             }
         }
     }
     $tag_data_id3v1['title'] = Helper::iconv_fallback($this->tag_encoding, 'ISO-8859-1', implode(' ', isset($this->tag_data['TITLE']) ? $this->tag_data['TITLE'] : array()));
     $tag_data_id3v1['artist'] = Helper::iconv_fallback($this->tag_encoding, 'ISO-8859-1', implode(' ', isset($this->tag_data['ARTIST']) ? $this->tag_data['ARTIST'] : array()));
     $tag_data_id3v1['album'] = Helper::iconv_fallback($this->tag_encoding, 'ISO-8859-1', implode(' ', isset($this->tag_data['ALBUM']) ? $this->tag_data['ALBUM'] : array()));
     $tag_data_id3v1['year'] = Helper::iconv_fallback($this->tag_encoding, 'ISO-8859-1', implode(' ', isset($this->tag_data['YEAR']) ? $this->tag_data['YEAR'] : array()));
     $tag_data_id3v1['comment'] = Helper::iconv_fallback($this->tag_encoding, 'ISO-8859-1', implode(' ', isset($this->tag_data['COMMENT']) ? $this->tag_data['COMMENT'] : array()));
     $tag_data_id3v1['track'] = intval(Helper::iconv_fallback($this->tag_encoding, 'ISO-8859-1', implode(' ', isset($this->tag_data['TRACKNUMBER']) ? $this->tag_data['TRACKNUMBER'] : array())));
     if ($tag_data_id3v1['track'] <= 0) {
         $tag_data_id3v1['track'] = '';
     }
     $this->MergeExistingTagData('id3v1', $tag_data_id3v1);
     return $tag_data_id3v1;
 }