Audio encryption indicates if the actual audio stream is * encrypted, and by whom. * * The identifier is a URL containing an email address, or a link to a location * where an email address can be found, that belongs to the organisation * responsible for this specific encrypted audio file. Questions regarding the * encrypted audio should be sent to the email address specified. There may be * more than one AENC frame in a tag, but only one with the same owner * identifier. * * @package php-reader * @subpackage ID3 * @author Sven Vollbehr * @author Ryan Butterfield * @copyright Copyright (c) 2008 The PHP Reader Project Workgroup * @license http://code.google.com/p/php-reader/wiki/License New BSD License * @version $Rev: 105 $ */ final class ID3_Frame_AENC extends ID3_Frame { /** @var string */ private $_owner; /** @var integer */ private $_previewStart; /** @var integer */ private $_previewLength; /** @var string */ private $_encryptionInfo; /** * 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->_previewStart = Transform::fromUInt16BE(substr($this->_data, 0, 2)); $this->_previewLength = Transform::fromUInt16BE(substr($this->_data, 2, 2)); $this->_encryptionInfo = substr($this->_data, 4); } /** * Returns the owner identifier string. * * @return string */ public function getOwner() { return $this->_owner; } /** * Sets the owner identifier string. * * @param string $owner The owner identifier string. */ public function setOwner($owner) { $this->_owner = $owner; } /** * Returns the pointer to an unencrypted part of the audio in frames. * * @return integer */ public function getPreviewStart() { return $this->_previewStart; } /** * Sets the pointer to an unencrypted part of the audio in frames. * * @param integer $previewStart The pointer to an unencrypted part. */ public function setPreviewStart($previewStart) { $this->_previewStart = $previewStart; } /** * Returns the length of the preview in frames. * * @return integer */ public function getPreviewLength() { return $this->_previewLength; } /** * Sets the length of the preview in frames. * * @param integer $previewLength The length of the preview. */ public function setPreviewLength($previewLength) { $this->_previewLength = $previewLength; } /** * Returns the encryption info. * * @return string */ public function getEncryptionInfo() { return $this->_encryptionInfo; } /** * Sets the encryption info binary string. * * @param string $encryptionInfo The data string. */ public function setEncryptionInfo($encryptionInfo) { $this->_encryptionInfo = $encryptionInfo; } /** * Returns the frame raw data. * * @return string */ public function __toString() { $this->setData ($this->_owner . "\0" . Transform::toUInt16BE($this->_previewStart) . Transform::toUInt16BE($this->_previewLength) . $this->_encryptionInfo); return parent::__toString(); } }