本文整理汇总了PHP中Transform::fromInt64BE方法的典型用法代码示例。如果您正苦于以下问题:PHP Transform::fromInt64BE方法的具体用法?PHP Transform::fromInt64BE怎么用?PHP Transform::fromInt64BE使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Transform
的用法示例。
在下文中一共展示了Transform::fromInt64BE方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
/**
* 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);
$entryCount = $this->_reader->readUInt32BE();
$data = $this->_reader->read
($this->getOffset() + $this->getSize() - $this->_reader->getOffset());
for ($i = 1; $i <= $entryCount; $i++)
$this->_chunkOffsetTable[$i] =
Transform::fromInt64BE(substr($data, ($i - 1) * 8, 8));
}
示例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;
if (strlen($this->_data) > 4)
$this->_counter = Transform::fromInt64BE($this->_data); // UInt64
else
$this->_counter = Transform::fromUInt32BE($this->_data);
}
示例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;
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;
}
}
示例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;
}
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;
}
}
}
示例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;
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);
}
示例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;
}
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);
}
}
}