[SPIP] v3.2.1-->v3.2.3
[lhc/web/www.git] / www / plugins-dist / medias / lib / getid3 / module.misc.cue.php
index 9c42799..4602cde 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.misc.cue.php                                         //
@@ -35,6 +35,9 @@ class getid3_cue extends getid3_handler
 {
        public $cuesheet = array();
 
+       /**
+        * @return bool
+        */
        public function Analyze() {
                $info = &$this->getid3->info;
 
@@ -44,18 +47,24 @@ class getid3_cue extends getid3_handler
                return true;
        }
 
-
-
+       /**
+        * @param string $filename
+        *
+        * @return array
+        */
        public function readCueSheetFilename($filename)
        {
                $filedata = file_get_contents($filename);
                return $this->readCueSheet($filedata);
        }
+
        /**
-       * Parses a cue sheet file.
-       *
-       * @param string $filename - The filename for the cue sheet to open.
-       */
+        * Parses a cue sheet file.
+        *
+        * @param string $filedata
+        *
+        * @return array
+        */
        public function readCueSheet(&$filedata)
        {
                $cue_lines = array();
@@ -72,10 +81,10 @@ class getid3_cue extends getid3_handler
        }
 
        /**
-       * Parses the cue sheet array.
-       *
-       * @param array $file - The cuesheet as an array of each line.
-       */
+        * Parses the cue sheet array.
+        *
+        * @param array $file - The cuesheet as an array of each line.
+        */
        public function parseCueSheet($file)
        {
                //-1 means still global, all others are track specific
@@ -125,11 +134,11 @@ class getid3_cue extends getid3_handler
        }
 
        /**
-       * Parses the REM command.
-       *
-       * @param string $line - The line in the cue file that contains the TRACK command.
-       * @param integer $track_on - The track currently processing.
-       */
+        * Parses the REM command.
+        *
+        * @param string  $line - The line in the cue file that contains the TRACK command.
+        * @param integer $track_on - The track currently processing.
+        */
        public function parseComment($line, $track_on)
        {
                $explodedline = explode(' ', $line, 3);
@@ -148,11 +157,12 @@ class getid3_cue extends getid3_handler
        }
 
        /**
-       * Parses the FILE command.
-       *
-       * @param string $line - The line in the cue file that contains the FILE command.
-       * @return array - Array of FILENAME and TYPE of file..
-       */
+        * Parses the FILE command.
+        *
+        * @param string $line - The line in the cue file that contains the FILE command.
+        *
+        * @return array - Array of FILENAME and TYPE of file..
+        */
        public function parseFile($line)
        {
                $line =            substr($line, strpos($line, ' ') + 1);
@@ -168,11 +178,11 @@ class getid3_cue extends getid3_handler
        }
 
        /**
-       * Parses the FLAG command.
-       *
-       * @param string $line - The line in the cue file that contains the TRACK command.
-       * @param integer $track_on - The track currently processing.
-       */
+        * Parses the FLAG command.
+        *
+        * @param string  $line - The line in the cue file that contains the TRACK command.
+        * @param integer $track_on - The track currently processing.
+        */
        public function parseFlags($line, $track_on)
        {
                if ($track_on != -1)
@@ -206,11 +216,11 @@ class getid3_cue extends getid3_handler
        }
 
        /**
-       * Collect any unidentified data.
-       *
-       * @param string $line - The line in the cue file that contains the TRACK command.
-       * @param integer $track_on - The track currently processing.
-       */
+        * Collect any unidentified data.
+        *
+        * @param string  $line - The line in the cue file that contains the TRACK command.
+        * @param integer $track_on - The track currently processing.
+        */
        public function parseGarbage($line, $track_on)
        {
                if ( strlen($line) > 0 )
@@ -227,15 +237,16 @@ class getid3_cue extends getid3_handler
        }
 
        /**
-       * Parses the INDEX command of a TRACK.
-       *
-       * @param string $line - The line in the cue file that contains the TRACK command.
-       * @param integer $track_on - The track currently processing.
-       */
+        * Parses the INDEX command of a TRACK.
+        *
+        * @param string  $line - The line in the cue file that contains the TRACK command.
+        * @param integer $track_on - The track currently processing.
+        */
        public function parseIndex($line, $track_on)
        {
                $type = strtolower(substr($line, 0, strpos($line, ' ')));
                $line =            substr($line, strpos($line, ' ') + 1);
+               $number = 0;
 
                if ($type == 'index')
                {
@@ -261,6 +272,10 @@ class getid3_cue extends getid3_handler
                }
        }
 
+       /**
+        * @param string $line
+        * @param int    $track_on
+        */
        public function parseString($line, $track_on)
        {
                $category = strtolower(substr($line, 0, strpos($line, ' ')));
@@ -292,11 +307,11 @@ class getid3_cue extends getid3_handler
        }
 
        /**
-       * Parses the TRACK command.
-       *
-       * @param string $line - The line in the cue file that contains the TRACK command.
-       * @param integer $track_on - The track currently processing.
-       */
+        * Parses the TRACK command.
+        *
+        * @param string  $line - The line in the cue file that contains the TRACK command.
+        * @param integer $track_on - The track currently processing.
+        */
        public function parseTrack($line, $track_on)
        {
                $line = substr($line, strpos($line, ' ') + 1);