Ejemplo n.º 1
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);
 }
Ejemplo n.º 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;
     }
     $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));
     }
 }
Ejemplo n.º 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) {
         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 ++;
         }
       }*/
 }
Ejemplo n.º 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;

    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;
    }
  }
Ejemplo n.º 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->_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);
 }
Ejemplo n.º 6
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;
         }
     }
 }
Ejemplo n.º 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;
     }
     $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);
 }
Ejemplo n.º 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;
     }
     $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]);
 }