Esempio n. 1
0
 /**
  * @param Id3MetadataInterface $id3Metadata
  */
 private function normalize(Id3MetadataInterface $id3Metadata)
 {
     $id3Metadata->setTitle($this->get('Title'));
     $id3Metadata->setArtist($this->get('Performer'));
     $id3Metadata->setAlbum($this->get('Album'));
     $id3Metadata->setGenre($this->get('Genre'));
     $id3Metadata->setYear($this->extractYear($this->get('Original_Released_date') ? $this->get('Original_Released_date') : $this->get('Recorded_date')));
     $id3Metadata->setComment($this->get('Comment'));
     $id3Metadata->setBpm($this->get('BPM'));
     $id3Metadata->setTimeDuration($this->getDuration());
 }
Esempio n. 2
0
 /**
  * @param Id3MetadataInterface $id3Metadata
  * @dataProvider id3MetadataProvider
  */
 public function testMethod(Id3MetadataInterface $id3Metadata)
 {
     $id3Metadata->setAllArtists(self::getArtists());
     $this->assertEquals(self::getArtists(), $id3Metadata->getAllArtists());
     $id3Metadata->setAllGenres(self::getGenres());
     $this->assertEquals(self::getGenres(), $id3Metadata->getAllGenres());
     $id3Metadata->setTitle(self::getTitle());
     $this->assertEquals(self::getTitle(), $id3Metadata->getTitle());
     $id3Metadata->setArtist(self::getArtists()[0]);
     $this->assertEquals(self::getArtists()[0], $id3Metadata->getArtist());
     $id3Metadata->setComment(self::getComment());
     $this->assertEquals(self::getComment(), $id3Metadata->getComment());
     $id3Metadata->setYear(self::getYear());
     $this->assertEquals(self::getYear(), $id3Metadata->getYear());
     $id3Metadata->setGenre(self::getGenres()[0]);
     $this->assertEquals(self::getGenres()[0], $id3Metadata->getGenre());
     $id3Metadata->setKey(self::getKey());
     $this->assertEquals(self::getKey(), $id3Metadata->getKey());
     $id3Metadata->setTimeDuration(self::getDuration());
     $this->assertEquals(self::getDuration(), $id3Metadata->getTimeDuration());
 }
Esempio n. 3
0
 /**
  * @param Id3MetadataInterface $id3Metadata
  *
  * @return string
  */
 private function bpmUpdateCmd(Id3MetadataInterface $id3Metadata)
 {
     if (!is_null($id3Metadata->getBpm())) {
         return sprintf(' --bpm %s', escapeshellarg($id3Metadata->getBpm()));
     }
 }
Esempio n. 4
0
 /**
  * @param Id3MetadataInterface $id3Metadata
  *
  * @return bool
  */
 public function supportWrite(Id3MetadataInterface $id3Metadata)
 {
     return in_array($id3Metadata->getFile()->getExtension(), $this->getSupportedExtensionsForWrite());
 }
Esempio n. 5
0
 /**
  * @param Id3MetadataInterface $id3Metadata
  *
  * @return string
  */
 private function bpmUpdateCmd(Id3MetadataInterface $id3Metadata)
 {
     if (!is_null($id3Metadata->getBpm())) {
         return sprintf(" --remove-tag=BPM --set-tag=%s", escapeshellarg('BPM=' . $id3Metadata->getBpm()));
     }
 }