Add support for ID3v2.3
git-svn-id: http://php-reader.googlecode.com/svn/trunk@75 51a70ab9-7547-0410-9469-37e369ee0574
This commit is contained in:
@@ -56,7 +56,7 @@ require_once("ID3/Frame.php");
|
||||
* a digital signature. There may be several GRID frames in a tag but only one
|
||||
* containing the same symbol and only one containing the same owner identifier.
|
||||
* The group symbol must be used somewhere in the tag. See
|
||||
* {@link ID3_Frame#GROUPING_IDENTITY} for more information.
|
||||
* {@link ID3_Frame#GROUPING_ownerENTITY} for more information.
|
||||
*
|
||||
* @package php-reader
|
||||
* @subpackage ID3
|
||||
@@ -68,7 +68,7 @@ require_once("ID3/Frame.php");
|
||||
final class ID3_Frame_GRID extends ID3_Frame
|
||||
{
|
||||
/** @var string */
|
||||
private $_id;
|
||||
private $_owner;
|
||||
|
||||
/** @var integer */
|
||||
private $_group;
|
||||
@@ -80,15 +80,16 @@ final class ID3_Frame_GRID extends ID3_Frame
|
||||
* 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)
|
||||
public function __construct($reader = null, &$options = array())
|
||||
{
|
||||
parent::__construct($reader);
|
||||
parent::__construct($reader, $options);
|
||||
|
||||
if ($reader === null)
|
||||
return;
|
||||
|
||||
list($this->_id, $this->_data) = preg_split("/\\x00/", $this->_data, 2);
|
||||
list($this->_owner, $this->_data) = preg_split("/\\x00/", $this->_data, 2);
|
||||
$this->_group = Transform::fromInt8($this->_data[0]);
|
||||
$this->_groupData = substr($this->_data, 1);
|
||||
}
|
||||
@@ -98,14 +99,14 @@ final class ID3_Frame_GRID extends ID3_Frame
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getIdentifier() { return $this->_id; }
|
||||
public function getOwner() { return $this->_owner; }
|
||||
|
||||
/**
|
||||
* Sets the owner identifier string.
|
||||
*
|
||||
* @param string $id The owner identifier string.
|
||||
* @param string $owner The owner identifier string.
|
||||
*/
|
||||
public function setIdentifier($id) { $this->_id = $id; }
|
||||
public function setOwner($owner) { $this->_owner = $owner; }
|
||||
|
||||
/**
|
||||
* Returns the group symbol.
|
||||
@@ -143,7 +144,7 @@ final class ID3_Frame_GRID extends ID3_Frame
|
||||
public function __toString()
|
||||
{
|
||||
parent::setData
|
||||
($this->_id . "\0" . Transform::toInt8($this->_group) .
|
||||
($this->_owner . "\0" . Transform::toInt8($this->_group) .
|
||||
$this->_groupData);
|
||||
return parent::__toString();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user