コード例 #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);
     switch ($this->_encoding) {
         case self::UTF16:
             list($this->_description, $this->_text) = preg_split("/\\x00\\x00/", $this->_data);
             $this->_description = Transform::fromString16($this->_description);
             $this->_text = array(Transform::fromString16($this->_text));
             break;
         case self::UTF16BE:
             list($this->_description, $this->_text) = preg_split("/\\x00\\x00/", $this->_data);
             $this->_description = Transform::fromString16BE($this->_description);
             $this->_text = array(Transform::fromString16BE($this->_text));
             break;
         default:
             list($this->_description, $this->_text) = preg_split("/\\x00/", $this->_data);
             $this->_text = array($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->_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));
     }
 }
コード例 #3
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);
     }
 }
コード例 #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->_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]);
     }
 }
コード例 #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->_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);
     }
 }
コード例 #6
0
ファイル: WXXX.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())
 {
   ID3_Frame::__construct($reader, $options);
   
   if ($reader === null)
     return;
   
   $this->_encoding = Transform::fromUInt8($this->_data[0]);
   $this->_data = substr($this->_data, 1);
   
   switch ($this->_encoding) {
   case self::UTF16:
     list($this->_description, $this->_link) = 
       $this->explodeString16($this->_data, 2);
     $this->_description = Transform::fromString16($this->_description);
     break;
   case self::UTF16BE:
       list($this->_description, $this->_link) = 
         $this->explodeString16($this->_data, 2);
       $this->_description = Transform::fromString16BE($this->_description);
     break;
   default:
     list($this->_description, $this->_link) =
       $this->explodeString8($this->_data, 2);
     break;
   }
   $this->_link = implode($this->explodeString8($this->_link, 1), "");
 }
コード例 #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->_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);
 }
コード例 #8
0
ファイル: GEOB.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->_encoding = Transform::fromUInt8($this->_data[0]);
    $this->_mimeType = substr
      ($this->_data, 1, ($pos = strpos($this->_data, "\0", 1)) - 1);
    $this->_data = substr($this->_data, $pos + 1);
    
    switch ($this->_encoding) {
    case self::UTF16:
      list ($this->_filename, $this->_description, $this->_objectData) =
        $this->explodeString16($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->_objectData) =
        $this->explodeString16($this->_data, 3);
      $this->_filename = Transform::fromString16BE($this->_filename);
      $this->_description = Transform::fromString16BE($this->_description);
      break;
    default:
      list ($this->_filename, $this->_description, $this->_objectData) =
        $this->explodeString8($this->_data, 3);
      $this->_filename = Transform::fromString8($this->_filename);
      $this->_description = Transform::fromString8($this->_description);
    }
  }
コード例 #9
0
ファイル: SYLT.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->_encoding = Transform::fromUInt8($this->_data[0]);
   $this->_language = substr($this->_data, 1, 3);
   if ($this->_language == "XXX")
     $this->_language = "und";
   $this->_format = Transform::fromUInt8($this->_data[4]);
   $this->_type = Transform::fromUInt8($this->_data[5]);
   $this->_data = substr($this->_data, 6);
   
   switch ($this->_encoding) {
   case self::UTF16:
     list($this->_description, $this->_data) =
       $this->explodeString16($this->_data, 2);
     $this->_description = Transform::fromString16($this->_description);
     break;
   case self::UTF16BE:
     list($this->_description, $this->_data) =
       $this->explodeString16($this->_data, 2);
     $this->_description = Transform::fromString16BE($this->_description);
     break;
   default:
     list($this->_description, $this->_data) =
       $this->explodeString8($this->_data, 2);
     $this->_description = Transform::fromString8($this->_description);
   }
   
   while (strlen($this->_data) > 0) {
     switch ($this->_encoding) {
     case self::UTF16:
       list($syllable, $this->_data) = 
         $this->explodeString16($this->_data, 2);
       $syllable = Transform::fromString16($syllable);
       break;
     case self::UTF16BE:
       list($syllable, $this->_data) = 
         $this->explodeString16($this->_data, 2);
       $syllable = Transform::fromString16BE($syllable);
       break;
     default:
       list($syllable, $this->_data) = 
         $this->explodeString8($this->_data, 2);
       $syllable = Transform::fromString8($syllable);
     }
     $this->_events[Transform::fromUInt32BE(substr($this->_data, 0, 4))] =
       $syllable;
     $this->_data = substr($this->_data, 4);
   }
   ksort($this->_events);
 }
コード例 #10
0
ファイル: AbstractText.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->_encoding = Transform::fromUInt8($this->_data[0]);
   $this->_data = substr($this->_data, 1);
   switch ($this->_encoding) {
   case self::UTF16:
     $this->_text =
       $this->explodeString16(Transform::fromString16($this->_data));
     break;
   case self::UTF16BE:
     $this->_text =
       $this->explodeString16(Transform::fromString16BE($this->_data));
     break;
   default:
     $this->_text =
       $this->explodeString8(Transform::fromString8($this->_data));
   }
 }
コード例 #11
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->_format = Transform::fromInt8($this->_data[3]);
     $this->_type = Transform::fromInt8($this->_data[4]);
     $this->_data = substr($this->_data, 5);
     switch ($this->_encoding) {
         case self::UTF16:
             list($this->_description, $this->_data) = preg_split("/\\x00\\x00/", $this->_data, 2);
             $this->_description = Transform::fromString16($this->_description);
             break;
         case self::UTF16BE:
             list($this->_description, $this->_data) = preg_split("/\\x00\\x00/", $this->_data, 2);
             $this->_description = Transform::fromString16BE($this->_description);
             break;
         default:
             list($this->_description, $this->_data) = preg_split("/\\x00/", $this->_data, 2);
             $this->_description = Transform::fromString8($this->_description);
     }
     $this->_text = $this->_data;
     // FIXME: Better parsing of data
 }
コード例 #12
0
ファイル: IPLS.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->_encoding = Transform::fromUInt8($this->_data[0]);
    $data = substr($this->_data, 1);
    $order = Transform::MACHINE_ENDIAN_ORDER;
    switch ($this->_encoding) {
    case self::UTF16:
      $data = $this->explodeString16($data);
      foreach ($data as &$str)
        $str = Transform::fromString16($str, $order);
      break;
    case self::UTF16BE:
      $data = $this->explodeString16($data);
      foreach ($data as &$str)
        $str = Transform::fromString16BE($str);
      break;
    default:
      $data = $this->explodeString8($data);
    }

    for ($i = 0; $i < count($data) - 1; $i += 2)
      $this->_people[] = array($data[$i] => @$data[$i + 1]);
  }
コード例 #13
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:
             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);
     }
 }
コード例 #14
0
ファイル: COMM.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->_encoding = Transform::fromUInt8($this->_data[0]);
    $this->_language = substr($this->_data, 1, 3);
    if ($this->_language == "XXX")
      $this->_language = "und";
    $this->_data = substr($this->_data, 4);
    
    switch ($this->_encoding) {
    case self::UTF16:
      list ($this->_description, $this->_text) =
        $this->explodeString16($this->_data, 2);
      $this->_description = Transform::fromString16($this->_description);
      $this->_text = Transform::fromString16($this->_text);
      break;
    case self::UTF16BE:
      list ($this->_description, $this->_text) =
        $this->explodeString16($this->_data, 2);
      $this->_description = Transform::fromString16BE($this->_description);
      $this->_text = Transform::fromString16BE($this->_text);
      break;
    default:
      list ($this->_description, $this->_text) =
        $this->explodeString8($this->_data, 2);
      $this->_description = Transform::fromString8($this->_description);
      $this->_text = Transform::fromString8($this->_text);
    }
  }
コード例 #15
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->_imageType = Transform::fromInt8($this->_data[$pos++]);
     $this->_data = substr($this->_data, $pos);
     switch ($this->_encoding) {
         case self::UTF16:
             list($this->_description, $this->_data) = preg_split("/\\x00\\x00/", $this->_data, 2);
             $this->_description = Transform::fromString16($this->_description);
             break;
         case self::UTF16BE:
             list($this->_description, $this->_data) = preg_split("/\\x00\\x00/", $this->_data, 2);
             $this->_description = Transform::fromString16BE($this->_description);
             break;
         default:
             list($this->_description, $this->_data) = preg_split("/\\x00/", $this->_data, 2);
     }
 }