[SPIP] v3.2.1-->v3.2.3
[lhc/web/www.git] / www / plugins-dist / medias / lib / getid3 / module.tag.id3v1.php
index d160e9b..cafc3fb 100644 (file)
@@ -1,11 +1,11 @@
 <?php
+
 /////////////////////////////////////////////////////////////////
 /// getID3() by James Heinrich <info@getid3.org>               //
-//  available at http://getid3.sourceforge.net                 //
-//            or http://www.getid3.org                         //
-//          also https://github.com/JamesHeinrich/getID3       //
-/////////////////////////////////////////////////////////////////
-// See readme.txt for more details                             //
+//  available at https://github.com/JamesHeinrich/getID3       //
+//            or https://www.getid3.org                        //
+//            or http://getid3.sourceforge.net                 //
+//  see readme.txt for more details                            //
 /////////////////////////////////////////////////////////////////
 //                                                             //
 // module.tag.id3v1.php                                        //
@@ -17,7 +17,9 @@
 
 class getid3_id3v1 extends getid3_handler
 {
-
+       /**
+        * @return bool
+        */
        public function Analyze() {
                $info = &$this->getid3->info;
 
@@ -124,10 +126,20 @@ class getid3_id3v1 extends getid3_handler
                return true;
        }
 
+       /**
+        * @param string $str
+        *
+        * @return string
+        */
        public static function cutfield($str) {
                return trim(substr($str, 0, strcspn($str, "\x00")));
        }
 
+       /**
+        * @param bool $allowSCMPXextended
+        *
+        * @return string[]
+        */
        public static function ArrayOfGenres($allowSCMPXextended=false) {
                static $GenreLookup = array(
                        0    => 'Blues',
@@ -312,6 +324,12 @@ class getid3_id3v1 extends getid3_handler
                return ($allowSCMPXextended ? $GenreLookupSCMPX : $GenreLookup);
        }
 
+       /**
+        * @param string $genreid
+        * @param bool   $allowSCMPXextended
+        *
+        * @return string|false
+        */
        public static function LookupGenreName($genreid, $allowSCMPXextended=true) {
                switch ($genreid) {
                        case 'RX':
@@ -328,6 +346,12 @@ class getid3_id3v1 extends getid3_handler
                return (isset($GenreLookup[$genreid]) ? $GenreLookup[$genreid] : false);
        }
 
+       /**
+        * @param string $genre
+        * @param bool   $allowSCMPXextended
+        *
+        * @return string|false
+        */
        public static function LookupGenreID($genre, $allowSCMPXextended=false) {
                $GenreLookup = self::ArrayOfGenres($allowSCMPXextended);
                $LowerCaseNoSpaceSearchTerm = strtolower(str_replace(' ', '', $genre));
@@ -339,6 +363,11 @@ class getid3_id3v1 extends getid3_handler
                return false;
        }
 
+       /**
+        * @param string $OriginalGenre
+        *
+        * @return string|false
+        */
        public static function StandardiseID3v1GenreName($OriginalGenre) {
                if (($GenreID = self::LookupGenreID($OriginalGenre)) !== false) {
                        return self::LookupGenreName($GenreID);
@@ -346,6 +375,17 @@ class getid3_id3v1 extends getid3_handler
                return $OriginalGenre;
        }
 
+       /**
+        * @param string     $title
+        * @param string     $artist
+        * @param string     $album
+        * @param string     $year
+        * @param int        $genreid
+        * @param string     $comment
+        * @param int|string $track
+        *
+        * @return string
+        */
        public static function GenerateID3v1Tag($title, $artist, $album, $year, $genreid, $comment, $track='') {
                $ID3v1Tag  = 'TAG';
                $ID3v1Tag .= str_pad(trim(substr($title,  0, 30)), 30, "\x00", STR_PAD_RIGHT);