本文整理汇总了PHP中Transform::fromUInt8方法的典型用法代码示例。如果您正苦于以下问题:PHP Transform::fromUInt8方法的具体用法?PHP Transform::fromUInt8怎么用?PHP Transform::fromUInt8使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Transform
的用法示例。
在下文中一共展示了Transform::fromUInt8方法的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())
{
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), "");
}
示例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::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]);
}
示例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;
$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);
}
}
示例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->_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);
}
}
示例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::fromUInt8($this->_data[0]);
$this->_position = Transform::fromUInt32BE(substr($this->_data, 1, 4));
}
示例6: __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::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));
}
}
示例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;
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;
}
}
示例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) = $this->explodeString8($this->_data, 2);
$this->_group = Transform::fromUInt8($this->_data[0]);
$this->_groupData = substr($this->_data, 1);
}
示例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::fromUInt8($this->_data[0]);
list($pricing, $this->_data) =
$this->explodeString8(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) =
$this->explodeString8(substr($this->_data, 8), 2);
$this->_delivery = Transform::fromUInt8($this->_data[0]);
$this->_data = substr($this->_data, 1);
switch ($this->_encoding) {
case self::UTF16:
list ($this->_seller, $this->_description, $this->_data) =
$this->explodeString16($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) =
$this->explodeString16($this->_data, 3);
$this->_seller = Transform::fromString16BE($this->_seller);
$this->_description = Transform::fromString16BE($this->_description);
break;
default:
list ($this->_seller, $this->_description, $this->_data) =
$this->explodeString8($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) =
$this->explodeString8($this->_data, 2);
$this->_imageSize = strlen($this->_imageData);
}
示例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)
return;
$this->_encoding = Transform::fromUInt8($this->_data[0]);
list($tmp, $this->_data) =
$this->explodeString8(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);
}
}
示例11: __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;
$offset = 0;
$this->_format = Transform::fromUInt8($this->_data[$offset++]);
while ($offset < strlen($this->_data)) {
$tempo = Transform::fromUInt8($this->_data[$offset++]);
if ($tempo == 0xff)
$tempo += Transform::fromUInt8($this->_data[$offset++]);
$this->_events
[Transform::fromUInt32BE(substr($this->_data, $offset, 4))] = $tempo;
$offset += 4;
}
ksort($this->_events);
}
示例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;
$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);
}
示例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->_format = Transform::fromUInt8($this->_data[0]);
for ($i = 1; $i < $this->getSize(); $i += 5) {
$this->_events[Transform::fromUInt32BE(substr($this->_data, $i + 1, 4))] =
$data = Transform::fromUInt8($this->_data[$i]);
if ($data == 0xff)
break;
}
ksort($this->_events);
}
示例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;
list($this->_owner, $this->_data) = $this->explodeString8($this->_data, 2);
$this->_rating = Transform::fromUInt8($this->_data[0]);
$this->_data = substr($this->_data, 1);
if (strlen($this->_data) > 4)
$this->_counter = Transform::fromInt64BE($this->_data); // UInt64
else if (strlen($this->_data) > 0)
$this->_counter = Transform::fromUInt32BE($this->_data);
}
示例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->_reverbLeft = Transform::fromUInt16BE(substr($this->_data, 0, 2));
$this->_reverbRight = Transform::fromUInt16BE(substr($this->_data, 2, 2));
$this->_reverbBouncesLeft = Transform::fromUInt8($this->_data[4]);
$this->_reverbBouncesRight = Transform::fromUInt8($this->_data[5]);
$this->_reverbFeedbackLtoL = Transform::fromUInt8($this->_data[6]);
$this->_reverbFeedbackLtoR = Transform::fromUInt8($this->_data[7]);
$this->_reverbFeedbackRtoR = Transform::fromUInt8($this->_data[8]);
$this->_reverbFeedbackRtoL = Transform::fromUInt8($this->_data[9]);
$this->_premixLtoR = Transform::fromUInt8($this->_data[10]);
$this->_premixRtoL = Transform::fromUInt8($this->_data[11]);
}