本文整理汇总了PHP中Zend_Media_Id3_Frame::__construct方法的典型用法代码示例。如果您正苦于以下问题:PHP Zend_Media_Id3_Frame::__construct方法的具体用法?PHP Zend_Media_Id3_Frame::__construct怎么用?PHP Zend_Media_Id3_Frame::__construct使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Zend_Media_Id3_Frame
的用法示例。
在下文中一共展示了Zend_Media_Id3_Frame::__construct方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __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())
{
Zend_Media_Id3_Frame::__construct($reader, $options);
$this->setEncoding($this->getOption('encoding', Zend_Media_Id3_Encoding::UTF8));
if ($this->_reader === null) {
return;
}
$encoding = $this->_reader->readUInt8();
$this->_language = strtolower($this->_reader->read(3));
if ($this->_language == 'xxx' || trim($this->_language, "") == '') {
$this->_language = 'und';
}
switch ($encoding) {
case self::UTF16:
// break intentionally omitted
// break intentionally omitted
case self::UTF16BE:
list($this->_description, $this->_text) = $this->_explodeString16($this->_reader->read($this->_reader->getSize()), 2);
$this->_description = $this->_convertString($this->_description, $encoding);
$this->_text = $this->_convertString($this->_text, $encoding);
break;
case self::UTF8:
// break intentionally omitted
// break intentionally omitted
default:
list($this->_description, $this->_text) = $this->_convertString($this->_explodeString8($this->_reader->read($this->_reader->getSize()), 2), $encoding);
break;
}
}
示例2: __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())
{
Zend_Media_Id3_Frame::__construct($reader, $options);
$this->setEncoding($this->getOption('encoding', Zend_Media_Id3_Encoding::UTF8));
if ($this->_reader === null) {
return;
}
$encoding = $this->_reader->readUInt8();
switch ($encoding) {
case self::UTF16:
// break intentionally omitted
// break intentionally omitted
case self::UTF16BE:
list($this->_description, $this->_link) = $this->_explodeString16($this->_reader->read($this->_reader->getSize()), 2);
break;
case self::UTF8:
// break intentionally omitted
// break intentionally omitted
default:
list($this->_description, $this->_link) = $this->_explodeString8($this->_reader->read($this->_reader->getSize()), 2);
break;
}
$this->_description = $this->_convertString($this->_description, $encoding);
$this->_link = implode($this->_explodeString8($this->_link, 1), '');
}
示例3: __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);
$this->setEncoding($this->getOption('encoding', Zend_Media_Id3_Encoding::UTF8));
if ($this->_reader === null) {
return;
}
$encoding = $this->_reader->readUInt8();
$this->_language = strtolower($this->_reader->read(3));
if ($this->_language == 'xxx') {
$this->_language = 'und';
}
switch ($encoding) {
case self::UTF16:
// break intentionally omitted
// break intentionally omitted
case self::UTF16BE:
$this->_text = $this->_convertString($this->_reader->readString16($this->_reader->getSize()), $encoding);
break;
case self::UTF8:
// break intentionally omitted
// break intentionally omitted
default:
$this->_text = $this->_convertString($this->_reader->readString8($this->_reader->getSize()), $encoding);
break;
}
}
示例4: __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) {
$this->_link = implode($this->_explodeString8($this->_reader->read($this->_reader->getSize()), 1), '');
}
}
示例5: __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);
$this->setEncoding($this->getOption('encoding', Zend_Media_Id3_Encoding::UTF8));
if ($this->_reader === null) {
return;
}
$data = array();
$encoding = $this->_reader->readUInt8();
switch ($encoding) {
case self::UTF16:
// break intentionally omitted
// break intentionally omitted
case self::UTF16BE:
$data = $this->_explodeString16($this->_reader->read($this->_reader->getSize()));
foreach ($data as &$str) {
$str = $this->_convertString($str, $encoding);
}
break;
case self::UTF8:
// break intentionally omitted
// break intentionally omitted
default:
$data = $this->_convertString($this->_explodeString8($this->_reader->read($this->_reader->getSize())), $encoding);
break;
}
for ($i = 0; $i < count($data) - 1; $i += 2) {
$this->_people[] = array($data[$i] => @$data[$i + 1]);
}
}
示例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);
$this->setEncoding($this->getOption('encoding', Zend_Media_Id3_Encoding::UTF8));
if ($this->_reader === null) {
return;
}
$encoding = $this->_reader->readUInt8();
list($this->_mimeType) = $this->_explodeString8($this->_reader->read($this->_reader->getSize()), 2);
$this->_reader->setOffset(1 + strlen($this->_mimeType) + 1);
switch ($encoding) {
case self::UTF16:
// break intentionally omitted
// break intentionally omitted
case self::UTF16BE:
list($this->_filename, $this->_description, $this->_data) = $this->_explodeString16($this->_reader->read($this->_reader->getSize()), 3);
break;
case self::UTF8:
// break intentionally omitted
// break intentionally omitted
default:
list($this->_filename, $this->_description, $this->_data) = $this->_explodeString8($this->_reader->read($this->_reader->getSize()), 3);
break;
}
$this->_filename = $this->_convertString($this->_filename, $encoding);
$this->_description = $this->_convertString($this->_description, $encoding);
}
示例7: __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) {
return;
}
$flags = $this->_reader->readInt8();
$descriptionBits = $this->_reader->readInt8();
if ($descriptionBits <= 8 || $descriptionBits > 16) {
require_once 'Zend/Media/Id3/Exception.php';
throw new Zend_Media_Id3_Exception('Unsupported description bit size of: ' . $descriptionBits);
}
$this->_adjustments[self::right] = ($flags & 0x1) == 0x1 ? $this->_reader->readUInt16BE() : -$this->_reader->readUInt16BE();
$this->_adjustments[self::left] = ($flags & 0x2) == 0x2 ? $this->_reader->readUInt16BE() : -$this->_reader->readUInt16BE();
$this->_adjustments[self::peakRight] = $this->_reader->readUInt16BE();
$this->_adjustments[self::peakLeft] = $this->_reader->readUInt16BE();
if (!$this->_reader->available()) {
return;
}
$this->_adjustments[self::rightBack] = ($flags & 0x4) == 0x4 ? $this->_reader->readUInt16BE() : -$this->_reader->readUInt16BE();
$this->_adjustments[self::leftBack] = ($flags & 0x8) == 0x8 ? $this->_reader->readUInt16BE() : -$this->_reader->readUInt16BE();
$this->_adjustments[self::peakRightBack] = $this->_reader->readUInt16BE();
$this->_adjustments[self::peakLeftBack] = $this->_reader->readUInt16BE();
if (!$this->_reader->available()) {
return;
}
$this->_adjustments[self::center] = ($flags & 0x10) == 0x10 ? $this->_reader->readUInt16BE() : -$this->_reader->readUInt16BE();
$this->_adjustments[self::peakCenter] = $this->_reader->readUInt16BE();
if (!$this->_reader->available()) {
return;
}
$this->_adjustments[self::bass] = ($flags & 0x20) == 0x20 ? $this->_reader->readUInt16BE() : -$this->_reader->readUInt16BE();
$this->_adjustments[self::peakBass] = $this->_reader->readUInt16BE();
}
示例8: __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) {
return;
}
list($this->_owner, $this->_fileIdentifier) = $this->_explodeString8($this->_reader->read($this->_reader->getSize()), 2);
}
示例9: __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) {
return;
}
$this->_data = $this->_reader->read($this->_reader->getSize());
}
示例10: __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) {
return;
}
$this->_minOffset = $this->_reader->readInt32BE();
}
示例11: __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);
$this->setEncoding($this->getOption('encoding', Zend_Media_Id3_Encoding::UTF8));
if ($this->_reader === null) {
return;
}
$encoding = $this->_reader->readUInt8();
$this->_language = strtolower($this->_reader->read(3));
if ($this->_language == 'xxx' || trim($this->_language, "") == '') {
$this->_language = 'und';
}
$this->_format = $this->_reader->readUInt8();
$this->_type = $this->_reader->readUInt8();
$offset = $this->_reader->getOffset();
switch ($encoding) {
case self::UTF16:
// break intentionally omitted
// break intentionally omitted
case self::UTF16BE:
list($this->_description) = $this->_explodeString16($this->_reader->read($this->_reader->getSize()), 2);
if ($this->_reader->getSize() >= $offset + strlen($this->_description) + 2) {
$this->_reader->setOffset($offset + strlen($this->_description) + 2);
}
break;
case self::UTF8:
// break intentionally omitted
// break intentionally omitted
default:
list($this->_description) = $this->_explodeString8($this->_reader->read($this->_reader->getSize()), 2);
if ($this->_reader->getSize() >= $offset + strlen($this->_description) + 1) {
$this->_reader->setOffset($offset + strlen($this->_description) + 1);
}
break;
}
$this->_description = $this->_convertString($this->_description, $encoding);
while ($this->_reader->available()) {
$offset = $this->_reader->getOffset();
switch ($encoding) {
case self::UTF16:
// break intentionally omitted
// break intentionally omitted
case self::UTF16BE:
list($syllable) = $this->_explodeString16($this->_reader->read($this->_reader->getSize()), 2);
$this->_reader->setOffset($offset + strlen($syllable) + 2);
break;
case self::UTF8:
// break intentionally omitted
// break intentionally omitted
default:
list($syllable) = $this->_explodeString8($this->_reader->read($this->_reader->getSize()), 2);
$this->_reader->setOffset($offset + strlen($syllable) + 1);
break;
}
$this->_events[$this->_reader->readUInt32BE()] = $this->_convertString($syllable, $encoding);
}
ksort($this->_events);
}
示例12: __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) {
return;
}
$this->_format = $this->_reader->readUInt8();
$this->_position = $this->_reader->readUInt32BE();
}
示例13: __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) {
return;
}
$this->_group = $this->_reader->readUInt8();
$this->_signature = $this->_reader->read($this->_reader->getSize());
}
示例14: __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())
{
Zend_Media_Id3_Frame::__construct($reader, $options);
$this->setEncoding(Zend_Media_Id3_Encoding::ISO88591);
if ($this->_reader === null) {
return;
}
$this->_reader->skip(1);
$this->setText($this->_reader->readString8($this->_reader->getSize()));
}
示例15: __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) {
return;
}
list($this->_owner, ) = $this->_explodeString8($this->_reader->read($this->_reader->getSize()), 2);
$this->_reader->setOffset(strlen($this->_owner) + 1);
$this->_method = $this->_reader->readInt8();
$this->_encryptionData = $this->_reader->read($this->_reader->getSize());
}