當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Transform::fromInt8方法代碼示例

本文整理匯總了PHP中Transform::fromInt8方法的典型用法代碼示例。如果您正苦於以下問題:PHP Transform::fromInt8方法的具體用法?PHP Transform::fromInt8怎麽用?PHP Transform::fromInt8使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Transform的用法示例。


在下文中一共展示了Transform::fromInt8方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: __construct

 /**
  * 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);
     }
 }
開發者ID:AsteriaGamer,項目名稱:steamdriven-kohana,代碼行數:32,代碼來源:COMM.php

示例2: __construct

 /**
  * 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);
     }
 }
開發者ID:AsteriaGamer,項目名稱:steamdriven-kohana,代碼行數:32,代碼來源:GEOB.php

示例3: __construct

 /**
  * 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));
 }
開發者ID:AsteriaGamer,項目名稱:steamdriven-kohana,代碼行數:37,代碼來源:RVAD.php

示例4: __construct

 /**
  * 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));
 }
開發者ID:AsteriaGamer,項目名稱:steamdriven-kohana,代碼行數:15,代碼來源:POSS.php

示例5: __construct

 /**
  * 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
 }
開發者ID:AsteriaGamer,項目名稱:steamdriven-kohana,代碼行數:16,代碼來源:SYTC.php

示例6: __construct

 /**
  * 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);
 }
開發者ID:lokamaya,項目名稱:zend-mp3,代碼行數:20,代碼來源:Mllt.php

示例7: __construct

 /**
  * 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));
     }
 }
開發者ID:AsteriaGamer,項目名稱:steamdriven-kohana,代碼行數:19,代碼來源:EQUA.php

示例8: __construct

 /**
  * 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);
         }
     }
 }
開發者ID:AsteriaGamer,項目名稱:steamdriven-kohana,代碼行數:23,代碼來源:POPM.php

示例9: __construct

 /**
  * 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));
     }
 }
開發者ID:AsteriaGamer,項目名稱:steamdriven-kohana,代碼行數:25,代碼來源:AbstractText.php

示例10: __construct

 /**
  * 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 ++;
         }
       }*/
 }
開發者ID:AsteriaGamer,項目名稱:steamdriven-kohana,代碼行數:26,代碼來源:ASPI.php

示例11: __construct

 /**
  * 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);
     }
 }
開發者ID:AsteriaGamer,項目名稱:steamdriven-kohana,代碼行數:25,代碼來源:USER.php

示例12: __construct

 /**
  * 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);
 }
開發者ID:rtdean93,項目名稱:therock,代碼行數:27,代碼來源:EQUA.php

示例13: __construct

 /**
  * 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]);
     }
 }
開發者ID:AsteriaGamer,項目名稱:steamdriven-kohana,代碼行數:28,代碼來源:IPLS.php

示例14: __construct

 /**
  * 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);
     }
 }
開發者ID:AsteriaGamer,項目名稱:steamdriven-kohana,代碼行數:29,代碼來源:OWNE.php

示例15: __construct

 /**
  * 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));
 }
開發者ID:rtdean93,項目名稱:therock,代碼行數:19,代碼來源:RBUF.php


注:本文中的Transform::fromInt8方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。