Marker Object class. * * @package php-reader * @subpackage ASF * @author Sven Vollbehr * @copyright Copyright (c) 2008 The PHP Reader Project Workgroup * @license http://code.google.com/p/php-reader/wiki/License New BSD License * @version $Rev: 108 $ */ final class ASF_Object_Marker extends ASF_Object { /** @var string */ private $_name; /** @var Array */ private $_markers = array(); /** * Constructs the class with given parameters and reads object related data * from the ASF file. * * @param Reader $reader The reader object. * @param Array $options The options array. */ public function __construct($reader, &$options = array()) { parent::__construct($reader, $options); $this->_reader->skip(16); $markersCount = $this->_reader->readUInt32LE(); $this->_reader->skip(2); $nameLength = $this->_reader->readUInt16LE(); $this->_name = iconv ("utf-16le", $this->getOption("encoding"), $this->_reader->readString16LE($nameLength)); for ($i = 0; $i < $markersCount; $i++) { $marker = array ("offset" => $this->_reader->readInt64LE(), "presentationTime" => $this->_reader->readInt64LE()); $this->_reader->skip(2); $marker["sendTime"] = $this->_reader->readUInt32LE(); $marker["flags"] = $this->_reader->readUInt32LE(); $descriptionLength = $this->_reader->readUInt32LE(); $marker["description"] = iconv ("utf-16le", $this->getOption("encoding"), $this->_reader->readString16LE($descriptionLength)); $this->_markers[] = $marker; } } /** * Returns the name of the Marker Object. * * @return Array */ public function getName() { return $this->_name; } /** * Returns an array of markers. Each entry consists of the following keys. * * o offset -- Specifies a byte offset into the Data Object to the * actual position of the marker in the Data Object. ASF parsers * must seek to this position to properly display data at the specified * marker Presentation Time. * * o presentationTime -- Specifies the presentation time of the marker, in * 100-nanosecond units. * * o sendTime -- Specifies the send time of the marker entry, in * milliseconds. * * o flags -- Flags are reserved and should be set to 0. * * o description -- Specifies a description of the marker entry. * * @return Array */ public function getMarkers() { return $this->_markers; } }