/** * 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; } }
/** * 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), ''); }
/** * 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; } }
/** * 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), ''); } }
/** * 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]); } }
/** * 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); }
/** * 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(); }
/** * 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); }
/** * 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()); }
/** * 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(); }
/** * 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); }
/** * 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(); }
/** * 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()); }
/** * 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())); }
/** * 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()); }
/** * 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->_previewStart = $this->_reader->readUInt16BE(); $this->_previewLength = $this->_reader->readUInt16BE(); $this->_encryptionInfo = $this->_reader->read($this->_reader->getSize()); }
/** * 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); }
/** * 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; } if ($this->_reader->getSize() > 4) { $this->_counter = $this->_reader->readInt64BE(); // UInt64 } else { $this->_counter = $this->_reader->readUInt32BE(); } }
/** * 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())); $this->_country = substr($this->getText(), 0, 2); $this->_registrant = substr($this->getText(), 2, 3); $this->_year = substr($this->getText(), 5, 2); $this->_uniqueNumber = substr($this->getText(), 7, 5); }
/** * 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->_interpolation = $this->_reader->readInt8(); list($this->_device) = $this->_explodeString8($this->_reader->read($this->_reader->getSize()), 2); $this->_reader->setOffset(1 + strlen($this->_device) + 1); while ($this->_reader->available()) { $this->_adjustments[(int) ($this->_reader->readUInt16BE() / 2)] = $this->_reader->readInt16BE() / 512.0; } ksort($this->_adjustments); }
/** * 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; } // Who designs frames with 3 byte integers?? $this->_reader = new Zend_Io_StringReader("" . $this->_reader->read($this->_reader->getSize())); $this->_bufferSize = $this->_reader->readUInt32BE(); $this->_infoFlags = $this->_reader->readInt8(); if ($this->_reader->available()) { $this->_offset = $this->_reader->readInt32BE(); } }
/** * 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->_currency = strtoupper($this->_reader->read(3)); $offset = $this->_reader->getOffset(); list($this->_price) = $this->_explodeString8($this->_reader->read($this->_reader->getSize()), 2); $this->_reader->setOffset($offset + strlen($this->_price) + 1); $this->_date = $this->_reader->read(8); $this->_seller = $this->_convertString($this->_reader->read($this->_reader->getSize()), $encoding); }
/** * 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; } $adjustmentBits = $this->_reader->readInt8(); if ($adjustmentBits <= 8 || $adjustmentBits > 16) { throw new Zend_Media_Id3_Exception('Unsupported adjustment bit size of: ' . $adjustmentBits); } while ($this->_reader->available()) { $frequency = $this->_reader->readUInt16BE(); $this->_adjustments[$frequency & 0x7fff] = ($frequency & 0x8000) == 0x8000 ? $this->_reader->readUInt16BE() : -$this->_reader->readUInt16BE(); } ksort($this->_adjustments); }
/** * 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(); while ($this->_reader->available()) { $data = $this->_reader->readUInt8(); $this->_events[$this->_reader->readUInt32BE()] = $data; if ($data == 0xff) { break; } } ksort($this->_events); }
/** * 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; } $offset = 0; $this->_format = $this->_reader->readUInt8(); while ($this->_reader->available()) { $tempo = $this->_reader->readUInt8(); if ($tempo == 0xff) { $tempo += $this->_reader->readUInt8(); } $this->_events[$this->_reader->readUInt32BE()] = $tempo; } ksort($this->_events); }
/** * 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->_reverbLeft = $this->_reader->readUInt16BE(); $this->_reverbRight = $this->_reader->readUInt16BE(); $this->_reverbBouncesLeft = $this->_reader->readUInt8(); $this->_reverbBouncesRight = $this->_reader->readUInt8(); $this->_reverbFeedbackLtoL = $this->_reader->readUInt8(); $this->_reverbFeedbackLtoR = $this->_reader->readUInt8(); $this->_reverbFeedbackRtoR = $this->_reader->readUInt8(); $this->_reverbFeedbackRtoL = $this->_reader->readUInt8(); $this->_premixLtoR = $this->_reader->readUInt8(); $this->_premixRtoL = $this->_reader->readUInt8(); }
/** * 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->_rating = $this->_reader->readUInt8(); if ($this->_reader->getSize() - strlen($this->_owner) - 2 > 4) { $this->_counter = $this->_reader->readInt64BE(); // UInt64 } else { if ($this->_reader->available() > 0) { $this->_counter = $this->_reader->readUInt32BE(); } } }
/** * 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->_currency = strtoupper($this->_reader->read(3)); $offset = $this->_reader->getOffset(); list($this->_price) = $this->_explodeString8($this->_reader->read($this->_reader->getSize()), 2); $this->_reader->setOffset($offset + strlen($this->_price) + 1); $this->_date = $this->_reader->read(8); $offset = $this->_reader->getOffset(); list($this->_contact) = $this->_explodeString8($this->_reader->read($this->_reader->getSize()), 2); $this->_reader->setOffset($offset + strlen($this->_contact) + 1); $this->_delivery = $this->_reader->readUInt8(); $offset = $this->_reader->getOffset(); switch ($encoding) { case self::UTF16: // break intentionally omitted // break intentionally omitted case self::UTF16BE: list($this->_seller, $this->_description) = $this->_explodeString16($this->_reader->read($this->_reader->getSize()), 3); $this->_reader->setOffset($offset + strlen($this->_seller) + strlen($this->_description) + 4); break; case self::UTF8: // break intentionally omitted // break intentionally omitted default: list($this->_seller, $this->_description) = $this->_explodeString8($this->_reader->read($this->_reader->getSize()), 3); $this->_reader->setOffset($offset + strlen($this->_seller) + strlen($this->_description) + 2); break; } $this->_seller = $this->_convertString($this->_seller, $encoding); $this->_description = $this->_convertString($this->_description, $encoding); if (!$this->_reader->available()) { return; } list($this->_mimeType, $this->_imageData) = $this->_explodeString8($this->_reader->read($this->_reader->getSize()), 2); $this->_imageSize = strlen($this->_imageData); }
/** * 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->_dataStart = $this->_reader->readInt32BE(); $this->_dataLength = $this->_reader->readInt32BE(); $this->_size = $this->_reader->readInt16BE(); $bitsPerPoint = $this->_reader->readInt8($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 ++; } }*/ }
/** * 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->_target = $this->_reader->read(4); list($this->_url, $this->_qualifier) = $this->_explodeString8($this->_reader->read($this->_reader->getSize()), 2); }