* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ final class Zend_Media_Flac_MetadataBlock_Seektable extends Zend_Media_Flac_MetadataBlock { /** @var Array */ private $_seekpoints = array(); /** * Constructs the class with given parameters and parses object related data. * * @param Zend_Io_Reader $reader The reader object. */ public function __construct($reader) { parent::__construct($reader); $seekpointCount = $this->getSize() / 18; for ($i = 0; $i < $seekpointCount; $i++) { $this->_seekpoints[] = array( 'sampleNumber' => $this->_reader->readInt64BE(), 'offset' => $this->_reader->readInt64BE(), 'numberOfSamples' => $this->_reader->readUInt16BE() ); } } /** * Returns the seekpoint table. The array consists of items having three keys. * * o sampleNumber -- Sample number of first sample in the target frame, or 0xFFFFFFFFFFFFFFFF for a * placeholder point. * o offset -- Offset (in bytes) from the first byte of the first frame header to the first byte of the * target frame's header. * o numberOfSamples -- Number of samples in the target frame. * * @return Array */ public function getSeekpoints() { return $this->_seekpoints; } }