[SPIP] v3.2.1-->v3.2.3
[lhc/web/www.git] / www / plugins-dist / medias / lib / getid3 / module.audio.dts.php
index bdc78f0..2dd44e9 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.audio.dts.php                                        //
 class getid3_dts extends getid3_handler
 {
        /**
-       * Default DTS syncword used in native .cpt or .dts formats
-       */
-    const syncword = "\x7F\xFE\x80\x01";
+        * Default DTS syncword used in native .cpt or .dts formats.
+        */
+       const syncword = "\x7F\xFE\x80\x01";
 
+       /**
+        * @var int
+        */
        private $readBinDataOffset = 0;
 
-    /**
-    * Possible syncwords indicating bitstream encoding
-    */
-    public static $syncwords = array(
-       0 => "\x7F\xFE\x80\x01",  // raw big-endian
-       1 => "\xFE\x7F\x01\x80",  // raw little-endian
-       2 => "\x1F\xFF\xE8\x00",  // 14-bit big-endian
-       3 => "\xFF\x1F\x00\xE8"); // 14-bit little-endian
+       /**
+        * Possible syncwords indicating bitstream encoding.
+        */
+       public static $syncwords = array(
+               0 => "\x7F\xFE\x80\x01",  // raw big-endian
+               1 => "\xFE\x7F\x01\x80",  // raw little-endian
+               2 => "\x1F\xFF\xE8\x00",  // 14-bit big-endian
+               3 => "\xFF\x1F\x00\xE8"); // 14-bit little-endian
 
+       /**
+        * @return bool
+        */
        public function Analyze() {
                $info = &$this->getid3->info;
                $info['fileformat'] = 'dts';
@@ -139,6 +145,12 @@ class getid3_dts extends getid3_handler
                return true;
        }
 
+       /**
+        * @param string $bin
+        * @param int $length
+        *
+        * @return float|int
+        */
        private function readBinData($bin, $length) {
                $data = substr($bin, $this->readBinDataOffset, $length);
                $this->readBinDataOffset += $length;
@@ -146,6 +158,11 @@ class getid3_dts extends getid3_handler
                return bindec($data);
        }
 
+       /**
+        * @param int $index
+        *
+        * @return int|string|false
+        */
        public static function bitrateLookup($index) {
                static $lookup = array(
                        0  => 32000,
@@ -184,6 +201,11 @@ class getid3_dts extends getid3_handler
                return (isset($lookup[$index]) ? $lookup[$index] : false);
        }
 
+       /**
+        * @param int $index
+        *
+        * @return int|string|false
+        */
        public static function sampleRateLookup($index) {
                static $lookup = array(
                        0  => 'invalid',
@@ -206,6 +228,11 @@ class getid3_dts extends getid3_handler
                return (isset($lookup[$index]) ? $lookup[$index] : false);
        }
 
+       /**
+        * @param int $index
+        *
+        * @return int|false
+        */
        public static function bitPerSampleLookup($index) {
                static $lookup = array(
                        0  => 16,
@@ -216,6 +243,11 @@ class getid3_dts extends getid3_handler
                return (isset($lookup[$index]) ? $lookup[$index] : false);
        }
 
+       /**
+        * @param int $index
+        *
+        * @return int|false
+        */
        public static function numChannelsLookup($index) {
                switch ($index) {
                        case 0:
@@ -254,6 +286,11 @@ class getid3_dts extends getid3_handler
                return false;
        }
 
+       /**
+        * @param int $index
+        *
+        * @return string
+        */
        public static function channelArrangementLookup($index) {
                static $lookup = array(
                        0  => 'A',
@@ -276,6 +313,12 @@ class getid3_dts extends getid3_handler
                return (isset($lookup[$index]) ? $lookup[$index] : 'user-defined');
        }
 
+       /**
+        * @param int $index
+        * @param int $version
+        *
+        * @return int|false
+        */
        public static function dialogNormalization($index, $version) {
                switch ($version) {
                        case 7: