示例#1
0
 /**
  * Constructs the class with given parameters and parses object related data.
  *
  * @param Reader $reader The reader object.
  * @param Array $options The options array.
  */
 public function __construct($reader = null, &$options = array())
 {
     parent::__construct($reader, $options);
     if ($reader === null) {
         return;
     }
     $this->_encoding = Transform::fromInt8($this->_data[0]);
     $this->_language = substr($this->_data, 1, 3);
     $this->_data = substr($this->_data, 4);
     switch ($this->_encoding) {
         case self::UTF16:
             list($this->_description, $this->_text) = preg_split("/\\x00\\x00/", $this->_data, 2);
             $this->_description = Transform::fromString16($this->_description);
             $this->_text = Transform::fromString16($this->_text);
             break;
         case self::UTF16BE:
             list($this->_description, $this->_text) = preg_split("/\\x00\\x00/", $this->_data, 2);
             $this->_description = Transform::fromString16BE($this->_description);
             $this->_text = Transform::fromString16BE($this->_text);
             break;
         default:
             list($this->_description, $this->_text) = preg_split("/\\x00/", $this->_data, 2);
             $this->_description = Transform::fromString8($this->_description);
             $this->_text = Transform::fromString8($this->_text);
     }
 }
示例#2
0
 /**
  * Constructs the class with given parameters and parses object related data.
  *
  * @param Reader $reader The reader object.
  * @param Array $options The options array.
  */
 public function __construct($reader = null, &$options = array())
 {
     parent::__construct($reader, $options);
     if ($reader === null) {
         return;
     }
     $this->_encoding = Transform::fromInt8($this->_data[0]);
     $this->_mimeType = substr($this->_data, 1, ($pos = strpos($this->_data, "", 1)) - 1);
     $this->_data = substr($this->_data, $pos);
     switch ($this->_encoding) {
         case self::UTF16:
             list($this->_filename, $this->_description, $this->_data) = preg_split("/\\x00\\x00/", $this->_data, 3);
             $this->_filename = Transform::fromString16($this->_filename);
             $this->_description = Transform::fromString16($this->_description);
             break;
         case self::UTF16BE:
             list($this->_filename, $this->_description, $this->_data) = preg_split("/\\x00\\x00/", $this->_data, 3);
             $this->_filename = Transform::fromString16BE($this->_filename);
             $this->_description = Transform::fromString16BE($this->_description);
             break;
         default:
             list($this->_filename, $this->_description, $this->_data) = preg_split("/\\x00/", $this->_data, 3);
             $this->_filename = Transform::fromString8($this->_filename);
             $this->_description = Transform::fromString8($this->_description);
     }
 }
示例#3
0
 /**
  * Constructs the class with given parameters and parses object related data.
  *
  * @param Reader $reader The reader object.
  * @param Array $options The options array.
  */
 public function __construct($reader = null, &$options = array())
 {
     parent::__construct($reader, $options);
     if ($reader === null) {
         return;
     }
     $flags = Transform::fromInt8($this->_data[0]);
     $descriptionBits = Transform::fromInt8($this->_data[0]);
     //16
     $this->_adjustments["right"] = ($flags & 0x20) == 0x20 ? Transform::fromUInt16BE(substr($this->_data, 0, 2)) : -Transform::fromUInt16BE(substr($this->_data, 0, 2));
     $this->_adjustments["left"] = ($flags & 0x10) == 0x10 ? Transform::fromUInt16BE(substr($this->_data, 2, 2)) : -Transform::fromUInt16BE(substr($this->_data, 2, 2));
     $this->_adjustments["peakRight"] = Transform::fromUInt16BE(substr($this->_data, 4, 2));
     $this->_adjustments["peakLeft"] = Transform::fromUInt16BE(substr($this->_data, 6, 2));
     if ($this->getSize() <= 8) {
         return;
     }
     $this->_adjustments["rightBack"] = ($flags & 0x8) == 0x8 ? Transform::fromUInt16BE(substr($this->_data, 8, 2)) : -Transform::fromUInt16BE(substr($this->_data, 8, 2));
     $this->_adjustments["leftBack"] = ($flags & 0x4) == 0x4 ? Transform::fromUInt16BE(substr($this->_data, 10, 2)) : -Transform::fromUInt16BE(substr($this->_data, 10, 2));
     $this->_adjustments["peakRightBack"] = Transform::fromUInt16BE(substr($this->_data, 12, 2));
     $this->_adjustments["peakLeftBack"] = Transform::fromUInt16BE(substr($this->_data, 14, 2));
     if ($this->getSize() <= 16) {
         return;
     }
     $this->_adjustments["center"] = ($flags & 0x2) == 0x2 ? Transform::fromUInt16BE(substr($this->_data, 16, 2)) : -Transform::fromUInt16BE(substr($this->_data, 16, 2));
     $this->_adjustments["peakCenter"] = Transform::fromUInt16BE(substr($this->_data, 18, 2));
     if ($this->getSize() <= 20) {
         return;
     }
     $this->_adjustments["bass"] = ($flags & 0x1) == 0x1 ? Transform::fromUInt16BE(substr($this->_data, 20, 2)) : -Transform::fromUInt16BE(substr($this->_data, 20, 2));
     $this->_adjustments["peakBass"] = Transform::fromUInt16BE(substr($this->_data, 22, 2));
 }
示例#4
0
 /**
  * Constructs the class with given parameters and parses object related data.
  *
  * @param Reader $reader The reader object.
  * @param Array $options The options array.
  */
 public function __construct($reader = null, &$options = array())
 {
     parent::__construct($reader, $options);
     if ($reader === null) {
         return;
     }
     $this->_format = Transform::fromInt8($this->_data[0]);
     $this->_position = Transform::fromUInt32BE(substr($this->_data, 1, 4));
 }
示例#5
0
 /**
  * Constructs the class with given parameters and parses object related data.
  *
  * @param Reader $reader The reader object.
  * @param Array $options The options array.
  */
 public function __construct($reader = null, &$options = array())
 {
     parent::__construct($reader, $options);
     if ($reader === null) {
         return;
     }
     $this->_format = Transform::fromInt8($this->_data[0]);
     $this->_tempoData = substr($this->_data, 1);
     // FIXME: Better parsing of data
 }
示例#6
0
 /**
  * Constructs the class with given parameters and parses object related
  * data.
  *
  * @param Zend_Io_Reader $reader The reader object.
  * @param Array $options The options array.
  */
 public function __construct($reader = null, &$options = array())
 {
     parent::__construct($reader, $options);
     if ($this->_reader === null) {
         throw new Zend_Media_Id3_Exception('Write not supported yet');
     }
     $this->_frames = Transform::fromInt16BE(substr($this->_data, 0, 2));
     $this->_bytes = Transform::fromInt32BE(substr($this->_data, 2, 3));
     $this->_milliseconds = Transform::fromInt32BE(substr($this->_data, 5, 3));
     $byteDevBits = Transform::fromInt8($this->_data[8]);
     $millisDevBits = Transform::fromInt8($this->_data[9]);
     // $data = substr($this->_data, 10);
 }
示例#7
0
 /**
  * Constructs the class with given parameters and parses object related data.
  *
  * @param Reader $reader The reader object.
  * @param Array $options The options array.
  */
 public function __construct($reader = null, &$options = array())
 {
     parent::__construct($reader, $options);
     if ($reader === null) {
         return;
     }
     $adjustmentBits = Transform::fromInt8($this->_data[0]);
     //16
     for ($i = 1; $i < strlen($this->_data); $i += 4) {
         $frequency = Transform::fromInt16BE(substr($this->_data, $i, 2));
         $this->_adjustments[$frequency & 0x7fff] = ($frequency & 0x2000) == 0x2000 ? Transform::fromInt16BE(substr($this->_data, $j + 2, 2)) : -Transform::fromInt16BE(substr($this->_data, $j + 2, 2));
     }
 }
示例#8
0
 /**
  * Constructs the class with given parameters and parses object related data.
  *
  * @param Reader $reader The reader object.
  * @param Array $options The options array.
  */
 public function __construct($reader = null, &$options = array())
 {
     parent::__construct($reader, $options);
     if ($reader === null) {
         return;
     }
     list($this->_owner, $this->_data) = preg_split("/\\x00/", $this->_data, 2);
     $this->_rating = Transform::fromInt8($this->_data[0]);
     $this->_data = substr($this->_data, 1);
     if (strlen($this->_data) > 4) {
         $this->_counter = Transform::fromInt64BE($this->_data);
     } else {
         if (strlen($this->_data) > 0) {
             $this->_counter = Transform::fromUInt32BE($this->_data);
         }
     }
 }
 /**
  * Constructs the class with given parameters and parses object related data.
  *
  * @param Reader $reader The reader object.
  * @param Array $options The options array.
  */
 public function __construct($reader = null, &$options = array())
 {
     parent::__construct($reader, $options);
     if ($reader === null) {
         return;
     }
     $this->_encoding = Transform::fromInt8($this->_data[0]);
     $this->_data = substr($this->_data, 1);
     switch ($this->_encoding) {
         case self::UTF16:
             $this->_text = preg_split("/\\x00\\x00/", Transform::fromString16($this->_data));
             break;
         case self::UTF16BE:
             $this->_text = preg_split("/\\x00\\x00/", Transform::fromString16BE($this->_data));
             break;
         default:
             $this->_text = preg_split("/\\x00/", Transform::fromString8($this->_data));
     }
 }
示例#10
0
 /**
  * Constructs the class with given parameters and parses object related data.
  *
  * @param Reader $reader The reader object.
  * @param Array $options The options array.
  */
 public function __construct($reader = null, &$options = array())
 {
     parent::__construct($reader, $options);
     if ($reader === null) {
         throw new ID3_Exception("Write not supported yet");
     }
     $this->_dataStart = Transform::fromInt32BE(substr($this->_data, 0, 4));
     $this->_dataLength = Transform::fromInt32BE(substr($this->_data, 4, 4));
     $this->_size = Transform::fromInt16BE(substr($this->_data, 8, 2));
     $bitsPerPoint = Transform::fromInt8($this->_data[10]);
     /*for ($i = 0, $offset = 11; $i < $this->_size; $i++) {
         if ($bitsPerPoint == 16) {
           $this->_fractions[$i] = substr($this->_data, $offset, 2);
           $offset += 2;
         } else {
           $this->_fractions[$i] = substr($this->_data, $offset, 1);
           $offset ++;
         }
       }*/
 }
示例#11
0
 /**
  * Constructs the class with given parameters and parses object related data.
  *
  * @param Reader $reader The reader object.
  */
 public function __construct($reader = null)
 {
     parent::__construct($reader);
     if ($reader === null) {
         return;
     }
     $this->_encoding = Transform::fromInt8($this->_data[0]);
     $this->_language = substr($this->_data, 1, 3);
     $this->_data = substr($this->_data, 4);
     switch ($this->_encoding) {
         case self::UTF16:
             $this->_text = Transform::fromString16($this->_data);
             break;
         case self::UTF16BE:
             $this->_text = Transform::fromString16BE($this->_data);
             break;
         default:
             $this->_text = Transform::fromString8($this->_data);
     }
 }
示例#12
0
文件: EQUA.php 项目: rtdean93/therock
 /**
  * Constructs the class with given parameters and parses object related data.
  *
  * @param Reader $reader The reader object.
  * @param Array $options The options array.
  */
 public function __construct($reader = null, &$options = array())
 {
   parent::__construct($reader, $options);
   
   if ($reader === null)
     return;
   
   $adjustmentBits = Transform::fromInt8($this->_data[0]);
   if ($adjustmentBits <= 8 || $adjustmentBits > 16)
     throw new ID3_Exception
         ("Unsupported adjustment bit size of: " . $adjustmentBits);
   
   for ($i = 1; $i < strlen($this->_data); $i += 4) {
     $frequency = Transform::fromUInt16BE(substr($this->_data, $i, 2));
     $this->_adjustments[($frequency & 0x7fff)] = 
         ($frequency & 0x8000) == 0x8000 ?
         Transform::fromUInt16BE(substr($this->_data, $i + 2, 2)) :
         -Transform::fromUInt16BE(substr($this->_data, $i + 2, 2));
   }
   ksort($this->_adjustments);
 }
示例#13
0
 /**
  * Constructs the class with given parameters and parses object related data.
  *
  * @param Reader $reader The reader object.
  * @param Array $options The options array.
  */
 public function __construct($reader = null, &$options = array())
 {
     parent::__construct($reader, $options);
     if ($reader === null) {
         return;
     }
     $this->_encoding = Transform::fromInt8($this->_data[0]);
     $data = array();
     switch ($this->_encoding) {
         case self::UTF16:
             $data = preg_split("/\\x00\\x00/", Transform::fromString16($this->_data));
             break;
         case self::UTF16BE:
             $data = preg_split("/\\x00\\x00/", Transform::fromString16BE($this->_data));
             break;
         default:
             $data = preg_split("/\\x00/", $this->_data);
     }
     for ($i = 0; $i < count($data); $i += 2) {
         $this->_people[] = array($data[$i] => @$data[$i + 1]);
     }
 }
示例#14
0
 /**
  * Constructs the class with given parameters and parses object related data.
  *
  * @param Reader $reader The reader object.
  * @param Array $options The options array.
  */
 public function __construct($reader = null, &$options = array())
 {
     parent::__construct($reader, $options);
     if ($reader === null) {
         return;
     }
     $this->_encoding = Transform::fromInt8($this->_data[0]);
     list($tmp, $this->_data) = preg_split("/\\x00/", substr($this->_data, 1), 2);
     $this->_currency = substr($tmp, 0, 3);
     $this->_price = substr($tmp, 3);
     $this->_date = substr($this->_data, 0, 8);
     $this->_data = substr($this->_data, 8);
     switch ($this->_encoding) {
         case self::UTF16:
             $this->_seller = Transform::fromString16($this->_data);
             break;
         case self::UTF16BE:
             $this->_seller = Transform::fromString16BE($this->_data);
             break;
         default:
             $this->_seller = Transform::fromString8($this->_data);
     }
 }
示例#15
0
文件: RBUF.php 项目: rtdean93/therock
 /**
  * Constructs the class with given parameters and parses object related data.
  *
  * @param Reader $reader The reader object.
  * @param Array $options The options array.
  */
 public function __construct($reader = null, &$options = array())
 {
   parent::__construct($reader, $options);
   
   if ($reader === null)
     return;
   
   $this->_bufferSize =
     Transform::fromUInt32BE("\0" . substr($this->_data, 0, 3));
   $this->_infoFlags = Transform::fromInt8($this->_data[3]);
   if ($this->getSize() > 4)
     $this->_offset = Transform::fromInt32BE(substr($this->_data, 4, 4));
 }
示例#16
0
 /**
  * Constructs the class with given parameters and parses object related data.
  *
  * @param Reader $reader The reader object.
  * @param Array $options The options array.
  */
 public function __construct($reader = null, &$options = array())
 {
     parent::__construct($reader, $options);
     if ($reader === null) {
         return;
     }
     list($this->_device, $this->_data) = preg_split("/\\x00/", $this->_data, 2);
     for ($i = $j = 0; $i < 9; $i++) {
         $this->_adjustments[$i] = array("channelType" => Transform::fromInt8($this->_data[$j++]), "volumeAdjustment" => Transform::fromInt16BE(substr($this->_data, $j++, 2)));
         $bitsInPeak = Transform::fromInt8($this->_data[++$j]);
         $bytesInPeak = $bitsInPeak > 0 ? ceil($bitsInPeak / 8) : 0;
         switch ($bytesInPeak) {
             case 8:
             case 7:
             case 6:
             case 5:
                 $this->_adjustments[$i]["peakVolume"] = Transform::fromInt64BE(substr($this->_data, $j, $bytesInPeak));
                 $j += $bytesInPeak;
                 break;
             case 4:
             case 3:
                 $this->_adjustments[$i]["peakVolume"] = Transform::fromUInt32BE(substr($this->_data, $j, $bytesInPeak));
                 $j += $bytesInPeak;
                 break;
             case 2:
                 $this->_adjustments[$i]["peakVolume"] = Transform::fromUInt16BE(substr($this->_data, $j, $bytesInPeak));
                 $j += $bytesInPeak;
                 break;
             case 1:
                 $this->_adjustments[$i]["peakVolume"] = Transform::fromInt8(substr($this->_data, $j, $bytesInPeak));
                 $j += $bytesInPeak;
         }
     }
 }
示例#17
0
 /**
  * Constructs the class with given parameters and parses object related data.
  *
  * @param Reader $reader The reader object.
  * @param Array $options The options array.
  */
 public function __construct($reader = null, &$options = array())
 {
     parent::__construct($reader, $options);
     if ($reader === null) {
         return;
     }
     list($this->_owner, $this->_data) = preg_split("/\\x00/", $this->_data, 2);
     $this->_method = Transform::fromInt8($this->_data[0]);
     $this->_encryptionData = substr($this->_data, 1);
 }
示例#18
0
 /**
  * Constructs the class with given parameters and parses object related data.
  *
  * @param Reader $reader The reader object.
  * @param Array $options The options array.
  */
 public function __construct($reader = null, &$options = array())
 {
     parent::__construct($reader, $options);
     if ($reader === null) {
         return;
     }
     $this->_reverbLeft = Transform::fromInt16BE(substr($this->_data, 0, 2));
     $this->_reverbRight = Transform::fromInt16BE(substr($this->_data, 2, 2));
     $this->_reverbBouncesLeft = Transform::fromInt8($this->_data[4]);
     $this->_reverbBouncesRight = Transform::fromInt8($this->_data[5]);
     $this->_reverbFeedbackLtoL = Transform::fromInt8($this->_data[6]);
     $this->_reverbFeedbackLtoR = Transform::fromInt8($this->_data[7]);
     $this->_reverbFeedbackRtoR = Transform::fromInt8($this->_data[8]);
     $this->_reverbFeedbackRtoL = Transform::fromInt8($this->_data[9]);
     $this->_premixLtoR = Transform::fromInt8($this->_data[10]);
     $this->_premixRtoL = Transform::fromInt8($this->_data[11]);
 }
示例#19
0
 /**
  * Constructs the class with given parameters and parses object related data.
  *
  * @param Reader $reader The reader object.
  * @param Array $options The options array.
  */
 public function __construct($reader = null, &$options = array())
 {
     parent::__construct($reader, $options);
     if ($reader === null) {
         return;
     }
     $this->_encoding = Transform::fromInt8($this->_data[0]);
     list($pricing, $this->_data) = preg_split("/\\x00/", substr($this->_data, 1), 2);
     $this->_currency = substr($pricing, 0, 3);
     $this->_price = substr($pricing, 3);
     $this->_date = substr($this->_data, 0, 8);
     list($this->_contact, $this->_data) = preg_split("/\\x00/", substr($this->_data, 8), 2);
     $this->_delivery = Transform::fromInt8($this->_data[0]);
     $this->_data = substr($this->_data, 1);
     switch ($this->_encoding) {
         case self::UTF16:
             list($this->_seller, $this->_description, $this->_data) = preg_split("/\\x00\\x00/", $this->_data, 3);
             $this->_seller = Transform::fromString16($this->_seller);
             $this->_description = Transform::fromString16($this->_description);
             break;
         case self::UTF16BE:
             list($this->_seller, $this->_description, $this->_data) = preg_split("/\\x00\\x00/", $this->_data, 3);
             $this->_seller = Transform::fromString16BE($this->_seller);
             $this->_description = Transform::fromString16BE($this->_description);
             break;
         default:
             list($this->_seller, $this->_description, $this->_data) = preg_split("/\\x00/", $this->_data, 3);
             $this->_seller = Transform::fromString8($this->_seller);
             $this->_description = Transform::fromString8($this->_description);
     }
     if (strlen($this->_data) == 0) {
         return;
     }
     list($this->_mimeType, $this->_imageData) = preg_split("/\\x00/", $this->_imageData, 2);
 }
 /**
  * Constructs the class with given parameters and reads object related data
  * from the ID3v2 tag.
  *
  * @param Reader $reader The reader object.
  * @param Array $options The options array.
  */
 public function __construct($reader = null, &$options = array())
 {
     parent::__construct($reader, $options);
     if ($reader === null) {
         return;
     }
     $offset = $this->_reader->getOffset();
     $this->_size = $this->decodeSynchsafe32($this->_reader->readUInt32BE());
     /* ID3v2.3.0 ExtendedHeader */
     if (isset($this->_options["version"]) && $this->_options["version"] < 4) {
         if ($this->_reader->readUInt16BE() == 0x8000) {
             $this->_flags = self::CRC32;
         }
         $this->_padding = $this->_reader->readUInt32BE();
         if ($this->hasFlag(self::CRC32)) {
             $this->_crc = Transform::readUInt32BE();
         }
     } else {
         $this->_reader->skip(1);
         $this->_flags = $this->_reader->readInt8();
         if ($this->hasFlag(self::UPDATE)) {
             $this->_reader->skip(1);
         }
         if ($this->hasFlag(self::CRC32)) {
             $this->_reader->skip(1);
             $this->_crc = Transform::fromInt8($this->_reader->read(1)) * (0xfffffff + 1) + decodeSynchsafe32(Transform::fromUInt32BE($this->_reader->read(4)));
         }
         if ($this->hasFlag(self::RESTRICTED)) {
             $this->_reader->skip(1);
             $this->_restrictions = $this->_reader->readInt8(1);
         }
     }
 }
示例#21
0
文件: STZ2.php 项目: rtdean93/therock
 /**
  * Constructs the class with given parameters and reads box related data from
  * the ISO Base Media file.
  *
  * @param Reader $reader The reader object.
  */
 public function __construct($reader, &$options = array())
 {
   parent::__construct($reader, $options);
   
   $this->_reader->skip(3);
   $fieldSize = $this->_reader->readInt8();
   $sampleCount = $this->_reader->readUInt32BE();
   $data = $this->_reader->read
     ($this->getOffset() + $this->getSize() - $this->_reader->getOffset());
   for ($i = 1; $i <= $sampleCount; $i++) {
     switch ($fieldSize) {
     case 4:
       $this->_sampleSizeTable[$i] =
         (($tmp = Transform::fromInt8($data[$i - 1])) >> 4) & 0xf;
       if ($i + 1 < $sampleCount)
         $this->_sampleSizeTable[$i++] = $tmp & 0xf;
       break;
     case 8:
       $this->_sampleSizeTable[$i] = Transform::fromInt8($data[$i - 1]);
       break;
     case 16:
       $this->_sampleSizeTable[$i] =
         Transform::fromUInt16BE(substr($data, ($i - 1) * 2, 2));
       break;
     }
   }
 }
示例#22
0
文件: RVAD.php 项目: rtdean93/therock
  /**
   * Constructs the class with given parameters and parses object related data.
   *
   * @param Reader $reader The reader object.
   * @param Array $options The options array.
   */
  public function __construct($reader = null, &$options = array())
  {
    parent::__construct($reader, $options);
    
    if ($reader === null)
      return;
    
    $flags = Transform::fromInt8($this->_data[0]);
    $descriptionBits = Transform::fromInt8($this->_data[1]);
    if ($descriptionBits <= 8 || $descriptionBits > 16)
      throw new ID3_Exception
          ("Unsupported description bit size of: " . $descriptionBits);
    
    $this->_adjustments[self::right] =
      ($flags & 0x1) == 0x1 ?
       Transform::fromUInt16BE(substr($this->_data, 2, 2)) :
       -Transform::fromUInt16BE(substr($this->_data, 2, 2));
    $this->_adjustments[self::left] =
      ($flags & 0x2) == 0x2 ?
       Transform::fromUInt16BE(substr($this->_data, 4, 2)) :
       -Transform::fromUInt16BE(substr($this->_data, 4, 2));
    $this->_adjustments[self::peakRight] =
      Transform::fromUInt16BE(substr($this->_data, 6, 2));
    $this->_adjustments[self::peakLeft] =
      Transform::fromUInt16BE(substr($this->_data, 8, 2));

    if ($this->getSize() <= 10)
      return;
    
    $this->_adjustments[self::rightBack] =
      ($flags & 0x4) == 0x4 ?
       Transform::fromUInt16BE(substr($this->_data, 10, 2)) :
       -Transform::fromUInt16BE(substr($this->_data, 10, 2));
    $this->_adjustments[self::leftBack] =
      ($flags & 0x8) == 0x8 ?
       Transform::fromUInt16BE(substr($this->_data, 12, 2)) :
       -Transform::fromUInt16BE(substr($this->_data, 12, 2));
    $this->_adjustments[self::peakRightBack] =
      Transform::fromUInt16BE(substr($this->_data, 14, 2));
    $this->_adjustments[self::peakLeftBack] =
      Transform::fromUInt16BE(substr($this->_data, 16, 2));

    if ($this->getSize() <= 18)
      return;
    
    $this->_adjustments[self::center] =
      ($flags & 0x10) == 0x10 ?
       Transform::fromUInt16BE(substr($this->_data, 18, 2)) :
       -Transform::fromUInt16BE(substr($this->_data, 18, 2));
    $this->_adjustments[self::peakCenter] =
      Transform::fromUInt16BE(substr($this->_data, 20, 2));
    
    if ($this->getSize() <= 22)
      return;
    
    $this->_adjustments[self::bass] =
      ($flags & 0x20) == 0x20 ?
       Transform::fromUInt16BE(substr($this->_data, 22, 2)) :
       -Transform::fromUInt16BE(substr($this->_data, 22, 2));
    $this->_adjustments[self::peakBass] =
      Transform::fromUInt16BE(substr($this->_data, 24, 2));
  }
示例#23
0
 /**
  * Constructs the class with given parameters and parses object related data.
  *
  * @param Reader $reader The reader object.
  * @param Array $options The options array.
  */
 public function __construct($reader = null, &$options = array())
 {
     parent::__construct($reader, $options);
     if ($reader === null) {
         return;
     }
     $this->_interpolation = Transform::fromInt8($this->_data[0]);
     list($this->_device, $this->_data) = preg_split("/\\x00/", substr($this->_data, 1), 2);
     for ($i = 0; $i < strlen($this->_data); $i += 8) {
         $this->_adjustments[Transform::fromInt16BE(substr($this->_data, $i, 2)) / 2] = Transform::fromInt16BE(substr($this->_data, $i + 2, 2)) / 512;
     }
     sort($this->_adjustments);
 }
示例#24
0
文件: SDTP.php 项目: rtdean93/therock
 /**
  * Constructs the class with given parameters and reads box related data from
  * the ISO Base Media file.
  *
  * @param Reader $reader The reader object.
  */
 public function __construct($reader, &$options = array())
 {
   parent::__construct($reader, $options);
   
   $data = $this->_reader->read
     ($this->getOffset() + $this->getSize() - $this->_reader->getOffset());
   $dataSize = strlen($data);
   for ($i = 1; $i <= $dataSize; $i++)
     $this->_sampleDependencyTypeTable[$i] = array
       ("sampleDependsOn" => (($tmp = Transform::fromInt8
                               ($data[$i - 1])) >> 4) & 0x3,
        "sampleIsDependedOn" => ($tmp >> 2) & 0x3,
        "sampleHasRedundancy" => $tmp & 0x3);
 }
示例#25
0
文件: EQU2.php 项目: rtdean93/therock
 /**
  * Constructs the class with given parameters and parses object related data.
  *
  * @param Reader $reader The reader object.
  * @param Array $options The options array.
  */
 public function __construct($reader = null, &$options = array())
 {
   parent::__construct($reader, $options);
   
   if ($reader === null)
     return;
   
   $this->_interpolation = Transform::fromInt8($this->_data[0]);
   list ($this->_device, $this->_data) =
     $this->explodeString8(substr($this->_data, 1), 2);
   
   for ($i = 0; $i < strlen($this->_data); $i += 4)
     $this->_adjustments
       [(int)(Transform::fromUInt16BE(substr($this->_data, $i, 2)) / 2)] = 
         Transform::fromInt16BE(substr($this->_data, $i + 2, 2)) / 512.0;
   ksort($this->_adjustments);
 }
示例#26
0
 /**
  * Constructs the class with given parameters and parses object related data.
  *
  * @param Reader $reader The reader object.
  * @param Array $options The options array.
  */
 public function __construct($reader = null, &$options = array())
 {
     parent::__construct($reader, $options);
     if ($reader === null) {
         return;
     }
     $this->_size = Transform::fromInt32BE(substr($this->_data, 0, 3));
     $this->_flags = Transform::fromInt8($this->_data[3]);
     $this->_offset = Transform::fromInt32BE(substr($this->_data, 4, 4));
 }
示例#27
0
文件: ENCR.php 项目: rtdean93/therock
 /**
  * Constructs the class with given parameters and parses object related data.
  *
  * @param Reader $reader The reader object.
  * @param Array $options The options array.
  */
 public function __construct($reader = null, &$options = array())
 {
   parent::__construct($reader, $options);
   
   if ($reader === null)
     return;
   
   list($this->_owner, $this->_data) = $this->explodeString8($this->_data, 2);
   $this->_method = Transform::fromInt8($this->_data[0]);
   $this->_encryptionData = substr($this->_data, 1);
 }
示例#28
0
 /**
  * Constructs the class with given parameters and parses object related data.
  *
  * @param Reader $reader The reader object.
  * @param Array $options The options array.
  */
 public function __construct($reader = null, &$options = array())
 {
     parent::__construct($reader, $options);
     if ($reader === null) {
         return;
     }
     $this->_format = Transform::fromInt8($this->_data[0]);
     for ($i = 1; $i < $this->getSize(); $i += 5) {
         $this->_events[Transform::fromInt32BE(substr($this->_data, $i + 1, 4))] = $data = Transform::fromInt8($this->_data[$i]);
         if ($data == 0xff) {
             break;
         }
     }
     sort($this->_events);
 }
示例#29
0
文件: RVA2.php 项目: rtdean93/therock
  /**
   * Constructs the class with given parameters and parses object related data.
   *
   * @param Reader $reader The reader object.
   * @param Array $options The options array.
   */
  public function __construct($reader = null, &$options = array())
  {
    parent::__construct($reader, $options);

    if ($reader === null)
      return;

    list ($this->_device, $this->_data) =
      $this->explodeString8($this->_data, 2);

    for ($i = $j = 0; $i < 9; $i++) {
      $this->_adjustments[$i] = array
        (self::channelType => Transform::fromInt8($this->_data[$j++]),
         self::volumeAdjustment =>
           Transform::fromInt16BE(substr($this->_data, $j++, 2)) / 512.0);
      $j++;
      $bitsInPeak = Transform::fromInt8($this->_data[$j++]);
      $bytesInPeak = $bitsInPeak > 0 ? ceil($bitsInPeak / 8) : 0;
      switch ($bytesInPeak) {
      case 8:
      case 7:
      case 6:
      case 5:
        $this->_adjustments[$i][self::peakVolume] =
          Transform::fromInt64BE(substr($this->_data, $j, $bytesInPeak));
        break;
      case 4:
      case 3:
        $this->_adjustments[$i][self::peakVolume] =
          Transform::fromUInt32BE(substr($this->_data, $j, $bytesInPeak));
        break;
      case 2:
        $this->_adjustments[$i][self::peakVolume] =
          Transform::fromUInt16BE(substr($this->_data, $j, $bytesInPeak));
        break;
      case 1:
        $this->_adjustments[$i][self::peakVolume] =
          Transform::fromUInt8(substr($this->_data, $j, $bytesInPeak));
      }
      $j += $bytesInPeak;
    }
  }
示例#30
0
文件: ILST.php 项目: rtdean93/therock
 /**
  * Constructs the class with given parameters and reads box related data from
  * the ISO Base Media file.
  *
  * @param Reader $reader The reader object.
  */
 public function __construct($reader = null, &$options = array())
 {
   parent::__construct($reader, $options);
   
   if ($reader === null)
     return;
   
   $this->_reader->skip(4);
   $data = $this->_reader->read
     ($this->getOffset() + $this->getSize() - $this->_reader->getOffset());
   switch ($this->getFlags()) {
   case self::INTEGER:
   case self::INTEGER_OLD_STYLE:
     for ($i = 0;  $i < strlen($data); $i++)
       $this->_value .= Transform::fromInt8($data[$i]);
     break;
   case self::STRING:
   default:
     $this->_value = $data;
   }
 }