Add Zend_Media_Id3v2 class proposal
git-svn-id: http://php-reader.googlecode.com/svn/branches/zend@153 51a70ab9-7547-0410-9469-37e369ee0574
This commit is contained in:
@@ -50,7 +50,8 @@ class Zend_Io_FileReader extends Zend_Io_Reader
|
||||
if (!file_exists($filename) || !is_readable($filename) ||
|
||||
($fd = fopen($filename, $mode)) === false) {
|
||||
require_once('Zend/Io/Exception.php');
|
||||
throw new Zend_Io_Exception('Unable to open file for reading: ' . $filename);
|
||||
throw new Zend_Io_Exception
|
||||
('Unable to open file for reading: ' . $filename);
|
||||
}
|
||||
parent::__construct($fd);
|
||||
}
|
||||
|
||||
@@ -50,7 +50,8 @@ class Zend_Io_FileWriter extends Zend_Io_Writer
|
||||
$mode = file_exists($filename) ? 'r+b' : 'wb';
|
||||
if (($fd = fopen($filename, $mode)) === false) {
|
||||
require_once('Zend/Io/Exception.php');
|
||||
throw new Zend_Io_Exception('Unable to open file for writing: ' . $filename);
|
||||
throw new Zend_Io_Exception
|
||||
('Unable to open file for writing: ' . $filename);
|
||||
}
|
||||
parent::__construct($fd);
|
||||
}
|
||||
|
||||
@@ -69,7 +69,8 @@ class Zend_Io_Reader
|
||||
if (!is_resource($fd) ||
|
||||
!in_array(get_resource_type($fd), array('stream'))) {
|
||||
require_once('Zend/Io/Exception.php');
|
||||
throw new Zend_Io_Exception('Invalid resource type (only resources of type stream are supported)');
|
||||
throw new Zend_Io_Exception
|
||||
('Invalid resource type (only resources of type stream are supported)');
|
||||
}
|
||||
|
||||
$this->_fd = $fd;
|
||||
@@ -497,7 +498,8 @@ class Zend_Io_Reader
|
||||
* @throws Zend_Io_Exception if <var>length</var> attribute is negative or
|
||||
* if an I/O error occurs
|
||||
*/
|
||||
public final function readString16($length, &$order = null, $trimOrder = false)
|
||||
public final function readString16
|
||||
($length, &$order = null, $trimOrder = false)
|
||||
{
|
||||
$value = $this->read($length);
|
||||
|
||||
|
||||
@@ -40,23 +40,42 @@ class Zend_Io_StringReader extends Zend_Io_Reader
|
||||
* Constructs the Zend_Io_StringReader class with given source string.
|
||||
*
|
||||
* @param string $data The string to use as the source.
|
||||
* @param integer $length If the <var>length</var> argument is given,
|
||||
* reading will stop after <var>length</var> bytes have been read or
|
||||
* the end of string is reached, whichever comes first.
|
||||
* @throws Zend_Io_Exception if an I/O error occurs
|
||||
*/
|
||||
public function __construct($data)
|
||||
public function __construct($data, $length = null)
|
||||
{
|
||||
if (($this->_fd = fopen('php://memory', 'w+b')) === false) {
|
||||
require_once('Zend/Io/Exception.php');
|
||||
throw new Zend_Io_Exception('Unable to open php://memory stream');
|
||||
}
|
||||
if ($data !== null && is_string($data)) {
|
||||
if (($this->_size = fwrite($this->_fd, $data, $tagSize)) === false) {
|
||||
if ($length === null) {
|
||||
$length = strlen($data);
|
||||
}
|
||||
if (($this->_size = fwrite($this->_fd, $data, $length)) === false) {
|
||||
require_once('Zend/Io/Exception.php');
|
||||
throw new Zend_Io_Exception('Unable to write data to php://memory stream');
|
||||
throw new Zend_Io_Exception
|
||||
('Unable to write data to php://memory stream');
|
||||
}
|
||||
fseek($this->_fd, 0);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the string representation of this class.
|
||||
*/
|
||||
public function toString()
|
||||
{
|
||||
$offset = $this->getOffset();
|
||||
$this->setOffset(0);
|
||||
$data = $this->read($this->getSize());
|
||||
$this->setOffset($offset);
|
||||
return $data;
|
||||
}
|
||||
|
||||
/**
|
||||
* Closes the file descriptor.
|
||||
*/
|
||||
|
||||
@@ -39,24 +39,43 @@ class Zend_Io_StringWriter extends Zend_Io_Writer
|
||||
/**
|
||||
* Constructs the Zend_Io_StringWriter class with given source string.
|
||||
*
|
||||
* @param string $data The string to use as the source.
|
||||
* @param string $data The string to use as the source.
|
||||
* @param integer $length If the <var>length</var> argument is given,
|
||||
* reading will stop after <var>length</var> bytes have been read or
|
||||
* the end of string is reached, whichever comes first.
|
||||
* @throws Zend_Io_Exception if an I/O error occurs
|
||||
*/
|
||||
public function __construct($data = null)
|
||||
public function __construct($data = null, $length = null)
|
||||
{
|
||||
if (($this->_fd = fopen('php://memory', 'w+b')) === false) {
|
||||
require_once('Zend/Io/Exception.php');
|
||||
throw new Zend_Io_Exception('Unable to open php://memory stream');
|
||||
}
|
||||
if ($data !== null && is_string($data)) {
|
||||
if (($this->_size = fwrite($this->_fd, $data, $tagSize)) === false) {
|
||||
if ($length === null) {
|
||||
$length = strlen($data);
|
||||
}
|
||||
if (($this->_size = fwrite($this->_fd, $data, $length)) === false) {
|
||||
require_once('Zend/Io/Exception.php');
|
||||
throw new Zend_Io_Exception('Unable to write data to php://memory stream');
|
||||
throw new Zend_Io_Exception
|
||||
('Unable to write data to php://memory stream');
|
||||
}
|
||||
fseek($this->_fd, 0);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the string representation of this class.
|
||||
*/
|
||||
public function toString()
|
||||
{
|
||||
$offset = $this->getOffset();
|
||||
$this->setOffset(0);
|
||||
$data = fread($this->getFileDescriptor(), $this->getSize());
|
||||
$this->setOffset($offset);
|
||||
return $data;
|
||||
}
|
||||
|
||||
/**
|
||||
* Closes the file descriptor.
|
||||
*/
|
||||
|
||||
@@ -67,9 +67,10 @@ class Zend_Io_Writer
|
||||
public function __construct($fd)
|
||||
{
|
||||
if (!is_resource($fd) ||
|
||||
!in_array(get_resource_type($fd), array('stream'))) {
|
||||
!in_array(get_resource_type($fd), array('stream'))) {
|
||||
require_once('Zend/Io/Exception.php');
|
||||
throw new Zend_Io_Exception('Invalid resource type (only resources of type stream are supported)');
|
||||
throw new Zend_Io_Exception
|
||||
('Invalid resource type (only resources of type stream are supported)');
|
||||
}
|
||||
|
||||
$this->_fd = $fd;
|
||||
@@ -174,7 +175,11 @@ class Zend_Io_Writer
|
||||
require_once('Zend/Io/Exception.php');
|
||||
throw new Zend_Io_Exception('Cannot operate on a closed stream');
|
||||
}
|
||||
fwrite($this->_fd, $value, $length === null ? strlen($value) : $length);
|
||||
if ($length === null) {
|
||||
$length = strlen($value);
|
||||
}
|
||||
fwrite($this->_fd, $value, $length);
|
||||
$this->_size += $length;
|
||||
return $this;
|
||||
}
|
||||
|
||||
@@ -197,7 +202,7 @@ class Zend_Io_Writer
|
||||
* @return Zend_Io_Writer
|
||||
* @throws Zend_Io_Exception if the stream is closed
|
||||
*/
|
||||
public final function writeUInt8()
|
||||
public final function writeUInt8($value)
|
||||
{
|
||||
return $this->write(pack('C*', $value));
|
||||
}
|
||||
@@ -223,7 +228,7 @@ class Zend_Io_Writer
|
||||
*/
|
||||
public final function writeInt16LE($value)
|
||||
{
|
||||
if ($this->_isBigEndian()) {
|
||||
if ($this->_isLittleEndian()) {
|
||||
return $this->write(strrev($this->_toInt16($value)));
|
||||
} else {
|
||||
return $this->write($this->_toInt16($value));
|
||||
@@ -240,7 +245,7 @@ class Zend_Io_Writer
|
||||
*/
|
||||
public final function writeInt16BE($value)
|
||||
{
|
||||
if ($this->_isLittleEndian()) {
|
||||
if ($this->_isBigEndian()) {
|
||||
return $this->write(strrev($this->_toInt16($value)));
|
||||
} else {
|
||||
return $this->write($this->_toInt16($value));
|
||||
@@ -294,7 +299,7 @@ class Zend_Io_Writer
|
||||
*/
|
||||
public final function writeInt32LE($value)
|
||||
{
|
||||
if ($this->_isBigEndian()) {
|
||||
if ($this->_isLittleEndian()) {
|
||||
return $this->write(strrev($this->_toInt32($value)));
|
||||
} else {
|
||||
return $this->write($this->_toInt32($value));
|
||||
@@ -311,7 +316,7 @@ class Zend_Io_Writer
|
||||
*/
|
||||
public final function writeInt32BE($value)
|
||||
{
|
||||
if ($this->_isLittleEndian()) {
|
||||
if ($this->_isBigEndian()) {
|
||||
return $this->write(strrev($this->_toInt32($value)));
|
||||
} else {
|
||||
return $this->write($this->_toInt32($value));
|
||||
@@ -354,7 +359,8 @@ class Zend_Io_Writer
|
||||
*/
|
||||
public final function writeInt64LE($value)
|
||||
{
|
||||
return $this->write(pack('V*', $value & 0xffffffff, $value / (0xffffffff+1)));
|
||||
return $this->write
|
||||
(pack('V*', $value & 0xffffffff, $value / (0xffffffff+1)));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -367,7 +373,8 @@ class Zend_Io_Writer
|
||||
*/
|
||||
public final function writeInt64BE($value)
|
||||
{
|
||||
return $this->write(pack('N*', $value / (0xffffffff+1), $value & 0xffffffff));
|
||||
return $this->write
|
||||
(pack('N*', $value / (0xffffffff+1), $value & 0xffffffff));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -391,7 +398,7 @@ class Zend_Io_Writer
|
||||
*/
|
||||
public final function writeFloatLE($value)
|
||||
{
|
||||
if ($this->_isBigEndian()) {
|
||||
if ($this->_isLittleEndian()) {
|
||||
return $this->write(strrev($this->_toFloat($value)));
|
||||
} else {
|
||||
return $this->write($this->_toFloat($value));
|
||||
@@ -408,7 +415,7 @@ class Zend_Io_Writer
|
||||
*/
|
||||
public final function writeFloatBE($value)
|
||||
{
|
||||
if ($this->_isLittleEndian()) {
|
||||
if ($this->_isBigEndian()) {
|
||||
return $this->write(strrev($this->_toFloat($value)));
|
||||
} else {
|
||||
return $this->write($this->_toFloat($value));
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Media
|
||||
* @subpackage Id3
|
||||
* @subpackage ID3
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
@@ -29,7 +29,7 @@ require_once 'Zend/Exception.php';
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Media
|
||||
* @subpackage Id3
|
||||
* @subpackage ID3
|
||||
* @author Sven Vollbehr <sven@vollbehr.eu>
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
|
||||
111
src/Zend/Media/Id3/DateFrame.php
Normal file
111
src/Zend/Media/Id3/DateFrame.php
Normal file
@@ -0,0 +1,111 @@
|
||||
<?php
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Media
|
||||
* @subpackage ID3
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
*/
|
||||
|
||||
/**#@+ @ignore */
|
||||
require_once 'Zend/Media/Id3/TextFrame.php';
|
||||
/**#@-*/
|
||||
|
||||
/**
|
||||
* A base class for all the text frames representing a date or parts of it.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Media
|
||||
* @subpackage ID3
|
||||
* @author Sven Vollbehr <sven@vollbehr.eu>
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
*/
|
||||
abstract class Zend_Media_Id3_DateFrame
|
||||
extends Zend_Media_Id3_TextFrame
|
||||
{
|
||||
private $_format;
|
||||
|
||||
/**
|
||||
* 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.
|
||||
* @param string $format Rule for formatting output. If null the default
|
||||
* ISO 8601 date format is used.
|
||||
*/
|
||||
public function __construct
|
||||
($reader = null, &$options = array(), $format = null)
|
||||
{
|
||||
Zend_Media_Id3_Frame::__construct($reader, $options);
|
||||
|
||||
$this->setEncoding(Zend_Media_Id3_Encoding::ISO88591);
|
||||
|
||||
$this->_format = $format;
|
||||
|
||||
if ($this->_reader === null) {
|
||||
return;
|
||||
}
|
||||
|
||||
$this->_reader->skip(1);
|
||||
$this->setText($this->_reader->readString8($this->_reader->getSize()));
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the date.
|
||||
*
|
||||
* @return Zend_Date
|
||||
*/
|
||||
public function getDate()
|
||||
{
|
||||
require_once 'Zend/Date.php';
|
||||
$date = new Zend_Date(0);
|
||||
$date->setTimezone('UTC');
|
||||
$date->set
|
||||
($this->getText(),
|
||||
$this->_format ? $this->_format : Zend_Date::ISO_8601);
|
||||
return $date;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the date. If called with null value the current time is entered.
|
||||
*
|
||||
* @param Zend_Date $date The date.
|
||||
*/
|
||||
public function setDate($date = null)
|
||||
{
|
||||
require_once 'Zend/Date.php';
|
||||
if ($date === null) {
|
||||
$date = Zend_Date::now();
|
||||
}
|
||||
$date->setTimezone('UTC');
|
||||
$this->setText($date->toString(Zend_Date::ISO_8601));
|
||||
}
|
||||
|
||||
/**
|
||||
* Writes the frame raw data without the header.
|
||||
*
|
||||
* @param Zend_Io_Writer $writer The writer object.
|
||||
* @return void
|
||||
*/
|
||||
protected function _writeFrame($writer)
|
||||
{
|
||||
$this->setEncoding(Zend_Media_Id3_Encoding::ISO88591);
|
||||
parent::_writeFrame($writer);
|
||||
}
|
||||
}
|
||||
82
src/Zend/Media/Id3/Encoding.php
Normal file
82
src/Zend/Media/Id3/Encoding.php
Normal file
@@ -0,0 +1,82 @@
|
||||
<?php
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Media
|
||||
* @subpackage ID3
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
*/
|
||||
|
||||
/**
|
||||
* The <var>Encoding</var> interface implies that the implementing ID3v2 frame
|
||||
* supports content encoding.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Media
|
||||
* @subpackage ID3
|
||||
* @author Sven Vollbehr <sven@vollbehr.eu>
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
*/
|
||||
interface Zend_Media_Id3_Encoding
|
||||
{
|
||||
/** The ISO-8859-1 encoding. */
|
||||
const ISO88591 = 0;
|
||||
|
||||
/** The UTF-16 Unicode encoding with BOM. */
|
||||
const UTF16 = 1;
|
||||
|
||||
/** The UTF-16LE Unicode encoding without BOM. */
|
||||
const UTF16LE = 4;
|
||||
|
||||
/** The UTF-16BE Unicode encoding without BOM. */
|
||||
const UTF16BE = 2;
|
||||
|
||||
/** The UTF-8 Unicode encoding. */
|
||||
const UTF8 = 3;
|
||||
|
||||
/**
|
||||
* Returns the text encoding.
|
||||
*
|
||||
* All the strings read from a file are automatically converted to the
|
||||
* character encoding specified with the <var>encoding</var> option. See
|
||||
* {@link Zend_Media_Id3v2} for details. This method returns that character
|
||||
* encoding, or any value set after read, translated into a string form
|
||||
* regarless if it was set using a {@link Zend_Media_Id3_Encoding} constant
|
||||
* or a string.
|
||||
*
|
||||
* @return integer
|
||||
*/
|
||||
public function getEncoding();
|
||||
|
||||
/**
|
||||
* Sets the text encoding.
|
||||
*
|
||||
* All the string written to the frame are done so using given character
|
||||
* encoding. No conversions of existing data take place upon the call to
|
||||
* this method thus all texts must be given in given character encoding.
|
||||
*
|
||||
* The character encoding parameter takes either a
|
||||
* {@link Zend_Media_Id3_Encoding} constant or a character set name string
|
||||
* in the form accepted by iconv. The default character encoding used to
|
||||
* write the frame is 'utf-8'.
|
||||
*
|
||||
* @see Zend_Media_Id3_Encoding
|
||||
* @param integer $encoding The text encoding.
|
||||
*/
|
||||
public function setEncoding($encoding);
|
||||
}
|
||||
@@ -14,7 +14,7 @@
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Media
|
||||
* @subpackage Id3
|
||||
* @subpackage ID3
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
@@ -30,7 +30,7 @@ require_once 'Zend/Media/Exception.php';
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Media
|
||||
* @subpackage Id3
|
||||
* @subpackage ID3
|
||||
* @author Sven Vollbehr <sven@vollbehr.eu>
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
|
||||
348
src/Zend/Media/Id3/ExtendedHeader.php
Normal file
348
src/Zend/Media/Id3/ExtendedHeader.php
Normal file
@@ -0,0 +1,348 @@
|
||||
<?php
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Media
|
||||
* @subpackage ID3
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
*/
|
||||
|
||||
/**#@+ @ignore */
|
||||
require_once 'Zend/Media/Id3/Object.php';
|
||||
/**#@-*/
|
||||
|
||||
/**
|
||||
* The extended header contains information that can provide further insight in
|
||||
* the structure of the tag, but is not vital to the correct parsing of the tag
|
||||
* information; hence the extended header is optional.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Media
|
||||
* @subpackage ID3
|
||||
* @author Sven Vollbehr <sven@vollbehr.eu>
|
||||
* @author Ryan Butterfield <buttza@gmail.com>
|
||||
* @copyright Copyright (c) 2005-2009 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_Id3_ExtendedHeader extends Zend_Media_Id3_Object
|
||||
{
|
||||
/**
|
||||
* A flag to denote that the present tag is an update of a tag found earlier
|
||||
* in the present file or stream. If frames defined as unique are found in
|
||||
* the present tag, they are to override any corresponding ones found in the
|
||||
* earlier tag. This flag has no corresponding data.
|
||||
*
|
||||
* @since ID3v2.4.0
|
||||
*/
|
||||
const UPDATE = 64;
|
||||
|
||||
/**
|
||||
* @since ID3v2.4.0 A flag to denote that a CRC-32 data is included in the
|
||||
* extended header. The CRC is calculated on all the data between the header
|
||||
* and footer as indicated by the header's tag length field, minus the
|
||||
* extended header. Note that this includes the padding (if there is any),
|
||||
* but excludes the footer. The CRC-32 is stored as an 35 bit synchsafe
|
||||
* integer, leaving the upper four bits always zeroed.
|
||||
*
|
||||
* @since ID3v2.3.0 The CRC is calculated before unsynchronisation on the
|
||||
* data between the extended header and the padding, i.e. the frames and
|
||||
* only the frames.
|
||||
*/
|
||||
const CRC32 = 32;
|
||||
|
||||
/**
|
||||
* A flag to denote whether or not the tag has restrictions applied on it.
|
||||
*
|
||||
* @since ID3v2.4.0
|
||||
*/
|
||||
const RESTRICTED = 16;
|
||||
|
||||
/** @var integer */
|
||||
private $_size;
|
||||
|
||||
/** @var integer */
|
||||
private $_flags = 0;
|
||||
|
||||
/** @var integer */
|
||||
private $_padding;
|
||||
|
||||
/** @var integer */
|
||||
private $_crc;
|
||||
|
||||
/** @var integer */
|
||||
private $_restrictions = 0;
|
||||
|
||||
/**
|
||||
* Constructs the class with given parameters and reads object related data
|
||||
* from the ID3v2 tag.
|
||||
*
|
||||
* @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 ($reader === null)
|
||||
return;
|
||||
|
||||
$offset = $this->_reader->getOffset();
|
||||
$this->_size = $this->_reader->readUInt32BE();
|
||||
|
||||
/* ID3v2.3.0 ExtendedHeader */
|
||||
if ($this->getOption('version', 4) < 4) {
|
||||
if ($this->_reader->readUInt16BE() == 0x8000) {
|
||||
$this->_flags = self::CRC32;
|
||||
}
|
||||
$this->_padding = $this->_reader->readUInt32BE();
|
||||
if ($this->hasFlag(self::CRC32)) {
|
||||
$this->_crc = $this->_reader->readUInt32BE();
|
||||
}
|
||||
}
|
||||
|
||||
/* ID3v2.4.0 ExtendedHeader */
|
||||
else {
|
||||
$this->_size = $this->_decodeSynchsafe32($this->_size);
|
||||
$this->_reader->skip(1);
|
||||
$this->_flags = $this->_reader->readInt8();
|
||||
if ($this->hasFlag(self::UPDATE)) {
|
||||
$this->_reader->skip(1);
|
||||
}
|
||||
if ($this->hasFlag(self::CRC32)) {
|
||||
$this->_reader->skip(1);
|
||||
$this->_crc =
|
||||
$this->_reader->readInt8() * (0xfffffff + 1) +
|
||||
_decodeSynchsafe32($this->_reader->readUInt32BE());
|
||||
}
|
||||
if ($this->hasFlag(self::RESTRICTED)) {
|
||||
$this->_reader->skip(1);
|
||||
$this->_restrictions = $this->_reader->readInt8();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the extended header size in bytes.
|
||||
*
|
||||
* @return integer
|
||||
*/
|
||||
public function getSize()
|
||||
{
|
||||
return $this->_size;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks whether or not the flag is set. Returns <var>true</var> if the
|
||||
* flag is set, <var>false</var> otherwise.
|
||||
*
|
||||
* @param integer $flag The flag to query.
|
||||
* @return boolean
|
||||
*/
|
||||
public function hasFlag($flag)
|
||||
{
|
||||
return ($this->_flags & $flag) == $flag;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the flags byte.
|
||||
*
|
||||
* @return integer
|
||||
*/
|
||||
public function getFlags($flags)
|
||||
{
|
||||
return $this->_flags;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the flags byte.
|
||||
*
|
||||
* @param integer $flags The flags byte.
|
||||
*/
|
||||
public function setFlags($flags)
|
||||
{
|
||||
$this->_flags = $flags;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the CRC-32 data.
|
||||
*
|
||||
* @return integer
|
||||
*/
|
||||
public function getCrc()
|
||||
{
|
||||
if ($this->hasFlag(self::CRC32)) {
|
||||
return $this->_crc;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets whether the CRC-32 should be generated upon tag write.
|
||||
*
|
||||
* @param boolean $useCrc Whether CRC-32 should be generated.
|
||||
*/
|
||||
public function useCrc($useCrc)
|
||||
{
|
||||
if ($useCrc) {
|
||||
$this->setFlags($this->getFlags() | self::CRC32);
|
||||
} else {
|
||||
$this->setFlags($this->getFlags() & ~self::CRC32);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the CRC-32. The CRC-32 value is calculated of all the frames in the
|
||||
* tag and includes padding.
|
||||
*
|
||||
* @param integer $crc The 32-bit CRC value.
|
||||
*/
|
||||
public function setCrc($crc)
|
||||
{
|
||||
if (is_bool($crc)) {
|
||||
$this->useCrc($crc);
|
||||
} else {
|
||||
$this->_crc = $crc;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the restrictions. For some applications it might be desired to
|
||||
* restrict a tag in more ways than imposed by the ID3v2 specification. Note
|
||||
* that the presence of these restrictions does not affect how the tag is
|
||||
* decoded, merely how it was restricted before encoding. If this flag is
|
||||
* set the tag is restricted as follows:
|
||||
*
|
||||
* <pre>
|
||||
* Restrictions %ppqrrstt
|
||||
*
|
||||
* p - Tag size restrictions
|
||||
*
|
||||
* 00 No more than 128 frames and 1 MB total tag size.
|
||||
* 01 No more than 64 frames and 128 KB total tag size.
|
||||
* 10 No more than 32 frames and 40 KB total tag size.
|
||||
* 11 No more than 32 frames and 4 KB total tag size.
|
||||
*
|
||||
* q - Text encoding restrictions
|
||||
*
|
||||
* 0 No restrictions
|
||||
* 1 Strings are only encoded with ISO-8859-1 or UTF-8.
|
||||
*
|
||||
* r - Text fields size restrictions
|
||||
*
|
||||
* 00 No restrictions
|
||||
* 01 No string is longer than 1024 characters.
|
||||
* 10 No string is longer than 128 characters.
|
||||
* 11 No string is longer than 30 characters.
|
||||
*
|
||||
* Note that nothing is said about how many bytes is used to represent
|
||||
* those characters, since it is encoding dependent. If a text frame
|
||||
* consists of more than one string, the sum of the strungs is restricted
|
||||
* as stated.
|
||||
*
|
||||
* s - Image encoding restrictions
|
||||
*
|
||||
* 0 No restrictions
|
||||
* 1 Images are encoded only with PNG [PNG] or JPEG [JFIF].
|
||||
*
|
||||
* t - Image size restrictions
|
||||
*
|
||||
* 00 No restrictions
|
||||
* 01 All images are 256x256 pixels or smaller.
|
||||
* 10 All images are 64x64 pixels or smaller.
|
||||
* 11 All images are exactly 64x64 pixels, unless required otherwise.
|
||||
* </pre>
|
||||
*
|
||||
* @return integer
|
||||
*/
|
||||
public function getRestrictions()
|
||||
{
|
||||
return $this->_restrictions;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the restrictions byte. See {@link #getRestrictions} for more.
|
||||
*
|
||||
* @param integer $restrictions The restrictions byte.
|
||||
*/
|
||||
public function setRestrictions($restrictions)
|
||||
{
|
||||
$this->_restrictions = $restrictions;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the total padding size, or simply the total tag size excluding
|
||||
* the frames and the headers.
|
||||
*
|
||||
* @return integer
|
||||
* @deprecated ID3v2.3.0
|
||||
*/
|
||||
public function getPadding()
|
||||
{
|
||||
return $this->_padding;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the total padding size, or simply the total tag size excluding the
|
||||
* frames and the headers.
|
||||
*
|
||||
* @param integer $padding The padding size.
|
||||
* @deprecated ID3v2.3.0
|
||||
*/
|
||||
public function setPadding($padding)
|
||||
{
|
||||
return $this->_padding = $padding;
|
||||
}
|
||||
|
||||
/**
|
||||
* Writes the header data.
|
||||
*
|
||||
* @param Zend_Io_Writer $writer The writer object.
|
||||
* @return void
|
||||
*/
|
||||
public function write($writer)
|
||||
{
|
||||
/* ID3v2.3.0 ExtendedHeader */
|
||||
if ($this->getOption('version', 4) < 4) {
|
||||
$writer->writeUInt32BE($this->_size)
|
||||
->writeUInt16BE($this->hasFlag(self::CRC32) ? 0x8000 : 0)
|
||||
->writeUInt32BE($this->_padding);
|
||||
if ($this->hasFlag(self::CRC32)) {
|
||||
$writer->writeUInt32BE($this->_crc);
|
||||
}
|
||||
}
|
||||
|
||||
/* ID3v2.4.0 ExtendedHeader */
|
||||
else {
|
||||
$writer->writeUInt32BE($this->_encodeSynchsafe32($this->_size))
|
||||
->writeInt8(1)
|
||||
->writeInt8($this->_flags);
|
||||
if ($this->hasFlag(self::UPDATE)) {
|
||||
$writer->write("\0");
|
||||
}
|
||||
if ($this->hasFlag(self::CRC32)) {
|
||||
$writer->writeInt8(5)
|
||||
->writeInt8
|
||||
($this->_crc & 0xf0000000 >> 28 & 0xf /*eq >>> 28*/)
|
||||
->writeUInt32BE($this->_encodeSynchsafe32($this->_crc));
|
||||
}
|
||||
if ($this->hasFlag(self::RESTRICTED)) {
|
||||
$writer->writeInt8(1)
|
||||
->writeInt8($this->_restrictions);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
315
src/Zend/Media/Id3/Frame.php
Normal file
315
src/Zend/Media/Id3/Frame.php
Normal file
@@ -0,0 +1,315 @@
|
||||
<?php
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Media
|
||||
* @subpackage ID3
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
*/
|
||||
|
||||
/**#@+ @ignore */
|
||||
require_once 'Zend/Media/Id3/Object.php';
|
||||
require_once 'Zend/Io/StringReader.php';
|
||||
require_once 'Zend/Io/StringWriter.php';
|
||||
/**#@-*/
|
||||
|
||||
/**
|
||||
* A base class for all ID3v2 frames as described in the
|
||||
* {@link http://www.id3.org/id3v2.4.0-frames ID3v2 frames document}.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Media
|
||||
* @subpackage ID3
|
||||
* @author Sven Vollbehr <sven@vollbehr.eu>
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
*/
|
||||
abstract class Zend_Media_Id3_Frame extends Zend_Media_Id3_Object
|
||||
{
|
||||
/**
|
||||
* This flag tells the tag parser what to do with this frame if it
|
||||
* unknown and the tag is altered in any way. This applies to all kinds of
|
||||
* alterations, including adding more padding and reordering the frames.
|
||||
*/
|
||||
const DISCARD_ON_TAGCHANGE = 16384;
|
||||
|
||||
/**
|
||||
* This flag tells the tag parser what to do with this frame if it is
|
||||
* unknown and the file, excluding the tag, is altered. This does not apply
|
||||
* when the audio is completely replaced with other audio data.
|
||||
*/
|
||||
const DISCARD_ON_FILECHANGE = 8192;
|
||||
|
||||
/**
|
||||
* This flag, if set, tells the software that the contents of this frame are
|
||||
* intended to be read only. Changing the contents might break something,
|
||||
* e.g. a signature.
|
||||
*/
|
||||
const READ_ONLY = 4096;
|
||||
|
||||
/**
|
||||
* This flag indicates whether or not this frame belongs in a group with
|
||||
* other frames. If set, a group identifier byte is added to the frame.
|
||||
* Every frame with the same group identifier belongs to the same group.
|
||||
*/
|
||||
const GROUPING_IDENTITY = 32;
|
||||
|
||||
/**
|
||||
* This flag indicates whether or not the frame is compressed. A <i>Data
|
||||
* Length Indicator</i> byte is included in the frame.
|
||||
*
|
||||
* @see DATA_LENGTH_INDICATOR
|
||||
*/
|
||||
const COMPRESSION = 8;
|
||||
|
||||
/**
|
||||
* This flag indicates whether or not the frame is encrypted. If set, one
|
||||
* byte indicating with which method it was encrypted will be added to the
|
||||
* frame. See description of the {@link Zend_Media_Id3_Frame_Encr ENCR}
|
||||
* frame for more information about encryption method registration.
|
||||
* Encryption should be done after compression. Whether or not setting this
|
||||
* flag requires the presence of a <i>Data Length Indicator</i> depends on
|
||||
* the specific algorithm used.
|
||||
*
|
||||
* @see DATA_LENGTH_INDICATOR
|
||||
*/
|
||||
const ENCRYPTION = 4;
|
||||
|
||||
/**
|
||||
* This flag indicates whether or not unsynchronisation was applied to this
|
||||
* frame.
|
||||
*
|
||||
* @since ID3v2.4.0
|
||||
*/
|
||||
const UNSYNCHRONISATION = 2;
|
||||
|
||||
/**
|
||||
* This flag indicates that a data length indicator has been added to the
|
||||
* frame.
|
||||
*
|
||||
* @since ID3v2.4.0
|
||||
*/
|
||||
const DATA_LENGTH_INDICATOR = 1;
|
||||
|
||||
/** @var integer */
|
||||
private $_identifier;
|
||||
|
||||
/** @var integer */
|
||||
private $_size = 0;
|
||||
|
||||
/** @var integer */
|
||||
private $_flags = 0;
|
||||
|
||||
/**
|
||||
* Constructs the class with given parameters and reads object related data
|
||||
* from the ID3v2 tag.
|
||||
*
|
||||
* Replaces the reader instance with a string reader object instance that
|
||||
* can be used to further process the data in the frame sub class.
|
||||
*
|
||||
* @todo Only limited subset of flags are processed.
|
||||
* @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 ($reader === null) {
|
||||
$this->_identifier = strtoupper(substr(get_class($this), -4));
|
||||
} else {
|
||||
$this->_identifier = $this->_reader->readString8(4, " ");
|
||||
|
||||
/* ID3v2.3.0 size and flags; convert flags to 2.4.0 format */
|
||||
if ($this->getOption('version', 4) < 4) {
|
||||
$this->_size = $this->_reader->readUInt32BE();
|
||||
$flags = $this->_reader->readUInt16BE();
|
||||
if (($flags & 0x8000) == 0x8000)
|
||||
$this->_flags |= self::DISCARD_ON_TAGCHANGE;
|
||||
if (($flags & 0x4000) == 0x4000)
|
||||
$this->_flags |= self::DISCARD_ON_FILECHANGE;
|
||||
if (($flags & 0x2000) == 0x2000)
|
||||
$this->_flags |= self::READ_ONLY;
|
||||
if (($flags & 0x80) == 0x80)
|
||||
$this->_flags |= self::COMPRESSION;
|
||||
if (($flags & 0x40) == 0x40)
|
||||
$this->_flags |= self::ENCRYPTION;
|
||||
if (($flags & 0x20) == 0x20)
|
||||
$this->_flags |= self::GROUPING_IDENTITY;
|
||||
}
|
||||
|
||||
/* ID3v2.4.0 size and flags */
|
||||
else {
|
||||
$this->_size =
|
||||
$this->_decodeSynchsafe32($this->_reader->readUInt32BE());
|
||||
$this->_flags = $this->_reader->readUInt16BE();
|
||||
}
|
||||
|
||||
$dataLength = $this->_size;
|
||||
if ($this->hasFlag(self::DATA_LENGTH_INDICATOR)) {
|
||||
$dataLength =
|
||||
$this->_decodeSynchsafe32($this->_reader->readUInt32BE());
|
||||
$this->_size -= 4;
|
||||
}
|
||||
|
||||
$data = $this->_reader->read($this->_size);
|
||||
$this->_size = $dataLength;
|
||||
|
||||
if ($this->hasFlag(self::UNSYNCHRONISATION) ||
|
||||
$this->getOption('unsynchronisation', false) === true) {
|
||||
$data = $this->_decodeUnsynchronisation($data);
|
||||
}
|
||||
|
||||
$this->_reader = new Zend_Io_StringReader($data);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the frame identifier string.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public final function getIdentifier()
|
||||
{
|
||||
return $this->_identifier;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the frame identifier.
|
||||
*
|
||||
* @param string $identifier The identifier.
|
||||
*/
|
||||
public final function setIdentifier($identifier)
|
||||
{
|
||||
$this->_identifier = $identifier;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the size of the data in the final frame, after encryption,
|
||||
* compression and unsynchronisation. The size is excluding the frame
|
||||
* header.
|
||||
*
|
||||
* @return integer
|
||||
*/
|
||||
public final function getSize()
|
||||
{
|
||||
return $this->_size;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks whether or not the flag is set. Returns <var>true</var> if the
|
||||
* flag is set, <var>false</var> otherwise.
|
||||
*
|
||||
* @param integer $flag The flag to query.
|
||||
* @return boolean
|
||||
*/
|
||||
public final function hasFlag($flag)
|
||||
{
|
||||
return ($this->_flags & $flag) == $flag;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the frame flags byte.
|
||||
*
|
||||
* @return integer
|
||||
*/
|
||||
public final function getFlags($flags)
|
||||
{
|
||||
return $this->_flags;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the frame flags byte.
|
||||
*
|
||||
* @param string $flags The flags byte.
|
||||
*/
|
||||
public final function setFlags($flags)
|
||||
{
|
||||
$this->_flags = $flags;
|
||||
}
|
||||
|
||||
/**
|
||||
* Writes the frame raw data without the header.
|
||||
*
|
||||
* @param Zend_Io_Writer $writer The writer object.
|
||||
* @return void
|
||||
*/
|
||||
abstract protected function _writeFrame($writer);
|
||||
|
||||
/**
|
||||
* Writes the frame data with the header.
|
||||
*
|
||||
* @param Zend_Io_Writer $writer The writer object.
|
||||
* @return void
|
||||
*/
|
||||
public function write($writer)
|
||||
{
|
||||
/* ID3v2.3.0 Flags; convert from 2.4.0 format */
|
||||
if ($this->getOption('version', 4) < 4) {
|
||||
$flags = 0;
|
||||
if ($this->hasFlag(self::DISCARD_ON_TAGCHANGE)) {
|
||||
$flags = $flags | 0x8000;
|
||||
}
|
||||
if ($this->hasFlag(self::DISCARD_ON_FILECHANGE)) {
|
||||
$flags = $flags | 0x4000;
|
||||
}
|
||||
if ($this->hasFlag(self::READ_ONLY)) {
|
||||
$flags = $flags | 0x2000;
|
||||
}
|
||||
if ($this->hasFlag(self::COMPRESSION)) {
|
||||
$flags = $flags | 0x80;
|
||||
}
|
||||
if ($this->hasFlag(self::ENCRYPTION)) {
|
||||
$flags = $flags | 0x40;
|
||||
}
|
||||
if ($this->hasFlag(self::GROUPING_IDENTITY)) {
|
||||
$flags = $flags | 0x20;
|
||||
}
|
||||
}
|
||||
|
||||
/* ID3v2.4.0 Flags */
|
||||
else {
|
||||
$flags = $this->_flags;
|
||||
}
|
||||
|
||||
$this->_writeFrame($buffer = new Zend_Io_StringWriter());
|
||||
$data = $buffer->toString();
|
||||
$size = $this->_size = strlen($data);
|
||||
|
||||
if ($this->getOption('version', 4) >= 4) {
|
||||
$data = $this->_encodeUnsynchronisation($data);
|
||||
if (($dataLength = strlen($data)) != $size) {
|
||||
$size = 4 + $dataLength;
|
||||
$flags |= self::DATA_LENGTH_INDICATOR | self::UNSYNCHRONISATION;
|
||||
$this->setOption('unsynchronisation', true);
|
||||
} else {
|
||||
$flags &= ~(self::DATA_LENGTH_INDICATOR |
|
||||
self::UNSYNCHRONISATION);
|
||||
}
|
||||
}
|
||||
|
||||
$writer->writeString8(substr($this->_identifier, 0, 4), 4, " ")
|
||||
->writeUInt32BE($this->_encodeSynchsafe32($size))
|
||||
->writeUInt16BE($flags);
|
||||
|
||||
if (($flags & self::DATA_LENGTH_INDICATOR) ==
|
||||
self::DATA_LENGTH_INDICATOR) {
|
||||
$writer->writeUInt32BE($this->_encodeSynchsafe32($this->_size));
|
||||
}
|
||||
$writer->write($data);
|
||||
}
|
||||
}
|
||||
178
src/Zend/Media/Id3/Frame/Aenc.php
Normal file
178
src/Zend/Media/Id3/Frame/Aenc.php
Normal file
@@ -0,0 +1,178 @@
|
||||
<?php
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Media
|
||||
* @subpackage ID3
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
*/
|
||||
|
||||
/**#@+ @ignore */
|
||||
require_once 'Zend/Media/Id3/Frame.php';
|
||||
/**#@-*/
|
||||
|
||||
/**
|
||||
* The <i>Audio encryption</i> 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.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Media
|
||||
* @subpackage ID3
|
||||
* @author Sven Vollbehr <sven@vollbehr.eu>
|
||||
* @author Ryan Butterfield <buttza@gmail.com>
|
||||
* @copyright Copyright (c) 2005-2009 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_Id3_Frame_Aenc extends Zend_Media_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 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());
|
||||
}
|
||||
|
||||
/**
|
||||
* 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;
|
||||
}
|
||||
|
||||
/**
|
||||
* Writes the frame raw data without the header.
|
||||
*
|
||||
* @param Zend_Io_Writer $writer The writer object.
|
||||
* @return void
|
||||
*/
|
||||
protected function _writeFrame($writer)
|
||||
{
|
||||
$writer->writeString8($this->_owner, 1)
|
||||
->writeUInt16BE($this->_previewStart)
|
||||
->writeUInt16BE($this->_previewLength)
|
||||
->write($this->_encryptionInfo);
|
||||
}
|
||||
}
|
||||
290
src/Zend/Media/Id3/Frame/Apic.php
Normal file
290
src/Zend/Media/Id3/Frame/Apic.php
Normal file
@@ -0,0 +1,290 @@
|
||||
<?php
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Media
|
||||
* @subpackage ID3
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
*/
|
||||
|
||||
/**#@+ @ignore */
|
||||
require_once 'Zend/Media/Id3/Frame.php';
|
||||
require_once 'Zend/Media/Id3/Encoding.php';
|
||||
/**#@-*/
|
||||
|
||||
/**
|
||||
* The <i>Attached picture</i> frame contains a picture directly related to the
|
||||
* audio file. Image format is the MIME type and subtype for the image.
|
||||
*
|
||||
* There may be several pictures attached to one file, each in their individual
|
||||
* APIC frame, but only one with the same content descriptor. There may only
|
||||
* be one picture with the same picture type.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Media
|
||||
* @subpackage ID3
|
||||
* @author Sven Vollbehr <sven@vollbehr.eu>
|
||||
* @author Ryan Butterfield <buttza@gmail.com>
|
||||
* @copyright Copyright (c) 2005-2009 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_Id3_Frame_Apic extends Zend_Media_Id3_Frame
|
||||
implements Zend_Media_Id3_Encoding
|
||||
{
|
||||
/**
|
||||
* The list of image types.
|
||||
*
|
||||
* @var Array
|
||||
*/
|
||||
public static $types = array
|
||||
('Other', '32x32 pixels file icon (PNG only)', 'Other file icon',
|
||||
'Cover (front)', 'Cover (back)', 'Leaflet page',
|
||||
'Media (e.g. label side of CD)', 'Lead artist/lead performer/soloist',
|
||||
'Artist/performer', 'Conductor', 'Band/Orchestra', 'Composer',
|
||||
'Lyricist/text writer', 'Recording Location', 'During recording',
|
||||
'During performance', 'Movie/video screen capture',
|
||||
'A bright coloured fish', 'Illustration', 'Band/artist logotype',
|
||||
'Publisher/Studio logotype');
|
||||
|
||||
/** @var integer */
|
||||
private $_encoding;
|
||||
|
||||
/** @var string */
|
||||
private $_mimeType = 'image/unknown';
|
||||
|
||||
/** @var integer */
|
||||
private $_imageType = 0;
|
||||
|
||||
/** @var string */
|
||||
private $_description;
|
||||
|
||||
/** @var string */
|
||||
private $_imageData;
|
||||
|
||||
/** @var integer */
|
||||
private $_imageSize = 0;
|
||||
|
||||
/**
|
||||
* Constructs the class with given parameters and parses object related
|
||||
* data.
|
||||
*
|
||||
* @todo There is the possibility to put only a link to the image file by
|
||||
* using the MIME type '-->' and having a complete URL instead of picture
|
||||
* data. Support for such needs design considerations.
|
||||
* @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);
|
||||
$this->_imageType = $this->_reader->readUInt8();
|
||||
|
||||
switch ($encoding) {
|
||||
case self::UTF16:
|
||||
// break intentionally omitted
|
||||
case self::UTF16BE:
|
||||
list ($this->_description, $this->_imageData) =
|
||||
$this->_explodeString16
|
||||
($this->_reader->read($this->_reader->getSize()), 2);
|
||||
break;
|
||||
case self::UTF8:
|
||||
// break intentionally omitted
|
||||
default:
|
||||
list ($this->_description, $this->_imageData) =
|
||||
$this->_explodeString8
|
||||
($this->_reader->read($this->_reader->getSize()), 2);
|
||||
break;
|
||||
}
|
||||
$this->_description =
|
||||
$this->_convertString($this->_description, $encoding);
|
||||
$this->_imageSize = strlen($this->_imageData);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the text encoding.
|
||||
*
|
||||
* All the strings read from a file are automatically converted to the
|
||||
* character encoding specified with the <var>encoding</var> option. See
|
||||
* {@link Zend_Media_Id3v2} for details. This method returns that character
|
||||
* encoding, or any value set after read, translated into a string form
|
||||
* regarless if it was set using a {@link Zend_Media_Id3_Encoding} constant
|
||||
* or a string.
|
||||
*
|
||||
* @return integer
|
||||
*/
|
||||
public function getEncoding()
|
||||
{
|
||||
return $this->_translateIntToEncoding($this->_encoding);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the text encoding.
|
||||
*
|
||||
* All the string written to the frame are done so using given character
|
||||
* encoding. No conversions of existing data take place upon the call to
|
||||
* this method thus all texts must be given in given character encoding.
|
||||
*
|
||||
* The character encoding parameter takes either a
|
||||
* {@link Zend_Media_Id3_Encoding} constant or a character set name string
|
||||
* in the form accepted by iconv. The default character encoding used to
|
||||
* write the frame is 'utf-8'.
|
||||
*
|
||||
* @see Zend_Media_Id3_Encoding
|
||||
* @param integer $encoding The text encoding.
|
||||
*/
|
||||
public function setEncoding($encoding)
|
||||
{
|
||||
$this->_encoding = $this->_translateEncodingToInt($encoding);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the MIME type. The MIME type is always ISO-8859-1 encoded.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getMimeType()
|
||||
{
|
||||
return $this->_mimeType;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the MIME type. The MIME type is always ISO-8859-1 encoded.
|
||||
*
|
||||
* @param string $mimeType The MIME type.
|
||||
*/
|
||||
public function setMimeType($mimeType)
|
||||
{
|
||||
$this->_mimeType = $mimeType;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the image type.
|
||||
*
|
||||
* @return integer
|
||||
*/
|
||||
public function getImageType()
|
||||
{
|
||||
return $this->_imageType;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the image type code.
|
||||
*
|
||||
* @param integer $imageType The image type code.
|
||||
*/
|
||||
public function setImageType($imageType)
|
||||
{
|
||||
$this->_imageType = $imageType;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the file description.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getDescription()
|
||||
{
|
||||
return $this->_description;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the content description text using given encoding.
|
||||
*
|
||||
* @param string $description The content description text.
|
||||
* @param integer $encoding The text encoding.
|
||||
*/
|
||||
public function setDescription($description, $encoding = null)
|
||||
{
|
||||
$this->_description = $description;
|
||||
if ($encoding !== null) {
|
||||
$this->setEncoding($encoding);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the embedded image data.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getImageData()
|
||||
{
|
||||
return $this->_imageData;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the embedded image data. Also updates the image size field to
|
||||
* correspond the new data.
|
||||
*
|
||||
* @param string $imageData The image data.
|
||||
*/
|
||||
public function setImageData($imageData)
|
||||
{
|
||||
$this->_imageData = $imageData;
|
||||
$this->_imageSize = strlen($imageData);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the size of the embedded image data.
|
||||
*
|
||||
* @return integer
|
||||
*/
|
||||
public function getImageSize()
|
||||
{
|
||||
return $this->_imageSize;
|
||||
}
|
||||
|
||||
/**
|
||||
* Writes the frame raw data without the header.
|
||||
*
|
||||
* @param Zend_Io_Writer $writer The writer object.
|
||||
* @return void
|
||||
*/
|
||||
protected function _writeFrame($writer)
|
||||
{
|
||||
$writer->writeUInt8($this->_encoding)
|
||||
->writeString8($this->_mimeType, 1)
|
||||
->writeUInt8($this->_imageType);
|
||||
switch ($this->_encoding) {
|
||||
case self::UTF16LE:
|
||||
$writer->writeString16
|
||||
($this->_description,
|
||||
Zend_Io_Writer::LITTLE_ENDIAN_ORDER, 1);
|
||||
break;
|
||||
case self::UTF16:
|
||||
// break intentionally omitted
|
||||
case self::UTF16BE:
|
||||
$writer->writeString16($this->_description, null, 1);
|
||||
break;
|
||||
default:
|
||||
$writer->writeString8($this->_description, 1);
|
||||
break;
|
||||
}
|
||||
$writer->writeString8($this->_imageData);
|
||||
}
|
||||
}
|
||||
160
src/Zend/Media/Id3/Frame/Aspi.php
Normal file
160
src/Zend/Media/Id3/Frame/Aspi.php
Normal file
@@ -0,0 +1,160 @@
|
||||
<?php
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Media
|
||||
* @subpackage ID3
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
* @since ID3v2.4.0
|
||||
*/
|
||||
|
||||
/**#@+ @ignore */
|
||||
require_once 'Zend/Media/Id3/Frame.php';
|
||||
/**#@-*/
|
||||
|
||||
/**
|
||||
* Audio files with variable bit rates are intrinsically difficult to deal with
|
||||
* in the case of seeking within the file. The <i>Audio seek point index</i> or
|
||||
* ASPI frame makes seeking easier by providing a list a seek points within the
|
||||
* audio file. The seek points are a fractional offset within the audio data,
|
||||
* providing a starting point from which to find an appropriate point to start
|
||||
* decoding. The presence of an ASPI frame requires the existence of a
|
||||
* {@link Zend_Media_Id3_Frame_Tlen TLEN} frame, indicating the duration of the
|
||||
* file in milliseconds. There may only be one audio seek point index frame in
|
||||
* a tag.
|
||||
*
|
||||
* @todo Data parsing and write support
|
||||
* @category Zend
|
||||
* @package Zend_Media
|
||||
* @subpackage ID3
|
||||
* @author Sven Vollbehr <sven@vollbehr.eu>
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
* @since ID3v2.4.0
|
||||
*/
|
||||
final class Zend_Media_Id3_Frame_Aspi extends Zend_Media_Id3_Frame
|
||||
{
|
||||
/** @var integer */
|
||||
private $_dataStart;
|
||||
|
||||
/** @var integer */
|
||||
private $_dataLength;
|
||||
|
||||
/** @var integer */
|
||||
private $_size;
|
||||
|
||||
/** @var Array */
|
||||
private $_fractions = array();
|
||||
|
||||
/**
|
||||
* 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) {
|
||||
require_once 'Zend/Media/Id3/Exception.php';
|
||||
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 ++;
|
||||
}
|
||||
}*/
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the byte offset from the beginning of the file.
|
||||
*
|
||||
* @return integer
|
||||
*/
|
||||
public function getDataStart()
|
||||
{
|
||||
return $this->_dataStart;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the byte offset from the beginning of the file.
|
||||
*
|
||||
* @param integer $dataStart The offset.
|
||||
*/
|
||||
public function setDataStart($dataStart)
|
||||
{
|
||||
$this->_dataStart = $dataStart;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the byte length of the audio data being indexed.
|
||||
*
|
||||
* @return integer
|
||||
*/
|
||||
public function getDataLength()
|
||||
{
|
||||
return $this->_dataLength;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the byte length of the audio data being indexed.
|
||||
*
|
||||
* @param integer $dataLength The length.
|
||||
*/
|
||||
public function setDataLength($dataLength)
|
||||
{
|
||||
$this->_dataLength = $dataLength;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the number of index points in the frame.
|
||||
*
|
||||
* @return integer
|
||||
*/
|
||||
public function getSize()
|
||||
{
|
||||
return count($this->_fractions);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the numerator of the fraction representing a relative position in
|
||||
* the data or <var>false</var> if index not defined. The denominator is 2
|
||||
* to the power of b.
|
||||
*
|
||||
* @param integer $index The fraction numerator.
|
||||
* @return integer
|
||||
*/
|
||||
public function getFractionAt($index)
|
||||
{
|
||||
if (isset($this->_fractions[$index])) {
|
||||
return $this->_fractions[$index];
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
155
src/Zend/Media/Id3/Frame/Comm.php
Normal file
155
src/Zend/Media/Id3/Frame/Comm.php
Normal file
@@ -0,0 +1,155 @@
|
||||
<?php
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Media
|
||||
* @subpackage ID3
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
*/
|
||||
|
||||
/**#@+ @ignore */
|
||||
require_once 'Zend/Media/Id3/LanguageTextFrame.php';
|
||||
/**#@-*/
|
||||
|
||||
/**
|
||||
* The <i>Comments</i> frame is intended for any kind of full text information
|
||||
* that does not fit in any other frame. It consists of a frame header followed
|
||||
* by encoding, language and content descriptors and is ended with the actual
|
||||
* comment as a text string. Newline characters are allowed in the comment text
|
||||
* string. There may be more than one comment frame in each tag, but only one
|
||||
* with the same language and content descriptor.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Media
|
||||
* @subpackage ID3
|
||||
* @author Sven Vollbehr <sven@vollbehr.eu>
|
||||
* @copyright Copyright (c) 2005-2009 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_Id3_Frame_Comm extends Zend_Media_Id3_LanguageTextFrame
|
||||
{
|
||||
/** @var string */
|
||||
private $_description;
|
||||
|
||||
/**
|
||||
* 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') {
|
||||
$this->_language = 'und';
|
||||
}
|
||||
|
||||
switch ($encoding) {
|
||||
case self::UTF16:
|
||||
// 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
|
||||
default:
|
||||
list($this->_description, $this->_text) = $this->_convertString
|
||||
($this->_explodeString8
|
||||
($this->_reader->read($this->_reader->getSize()), 2),
|
||||
$encoding);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the short content description.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getDescription()
|
||||
{
|
||||
return $this->_description;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the content description text using given encoding. The description
|
||||
* language and encoding must be that of the actual text.
|
||||
*
|
||||
* @param string $description The content description text.
|
||||
* @param string $language The language code.
|
||||
* @param integer $encoding The text encoding.
|
||||
*/
|
||||
public function setDescription
|
||||
($description, $language = null, $encoding = null)
|
||||
{
|
||||
$this->_description = $description;
|
||||
if ($language !== null) {
|
||||
$this->setLanguage($language);
|
||||
}
|
||||
if ($encoding !== null) {
|
||||
$this->setEncoding($encoding);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Writes the frame raw data without the header.
|
||||
*
|
||||
* @param Zend_Io_Writer $writer The writer object.
|
||||
* @return void
|
||||
*/
|
||||
protected function _writeFrame($writer)
|
||||
{
|
||||
$writer->writeUInt8($this->_encoding)
|
||||
->write($this->_language);
|
||||
switch ($this->_encoding) {
|
||||
case self::UTF16LE:
|
||||
$writer->writeString16
|
||||
($this->_description,
|
||||
Zend_Io_Writer::LITTLE_ENDIAN_ORDER, 1)
|
||||
->writeString16
|
||||
($this->_text,Zend_Io_Writer::LITTLE_ENDIAN_ORDER);
|
||||
break;
|
||||
case self::UTF16:
|
||||
// break intentionally omitted
|
||||
case self::UTF16BE:
|
||||
$writer->writeString16($this->_description, null, 1)
|
||||
->writeString16($this->_text);
|
||||
break;
|
||||
default:
|
||||
$writer->writeString8($this->_description, 1)
|
||||
->writeString8($this->_text);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
490
src/Zend/Media/Id3/Frame/Comr.php
Normal file
490
src/Zend/Media/Id3/Frame/Comr.php
Normal file
@@ -0,0 +1,490 @@
|
||||
<?php
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Media
|
||||
* @subpackage ID3
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
*/
|
||||
|
||||
/**#@+ @ignore */
|
||||
require_once 'Zend/Media/Id3/Frame.php';
|
||||
require_once 'Zend/Media/Id3/Encoding.php';
|
||||
/**#@-*/
|
||||
|
||||
/**
|
||||
* The <i>Commercial frame</i> enables several competing offers in the same tag
|
||||
* by bundling all needed information. That makes this frame rather complex but
|
||||
* it's an easier solution than if one tries to achieve the same result with
|
||||
* several frames.
|
||||
*
|
||||
* There may be more than one commercial frame in a tag, but no two may be
|
||||
* identical.
|
||||
*
|
||||
* @todo The use of Zend_Currency requires design considerations.
|
||||
* @category Zend
|
||||
* @package Zend_Media
|
||||
* @subpackage ID3
|
||||
* @author Sven Vollbehr <sven@vollbehr.eu>
|
||||
* @author Ryan Butterfield <buttza@gmail.com>
|
||||
* @copyright Copyright (c) 2005-2009 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_Id3_Frame_Comr extends Zend_Media_Id3_Frame
|
||||
implements Zend_Media_Id3_Encoding
|
||||
{
|
||||
/**
|
||||
* The delivery types.
|
||||
*
|
||||
* @var Array
|
||||
*/
|
||||
public static $types = array
|
||||
('Other', 'Standard CD album with other songs',
|
||||
'Compressed audio on CD', 'File over the Internet',
|
||||
'Stream over the Internet', 'As note sheets',
|
||||
'As note sheets in a book with other sheets', 'Music on other media',
|
||||
'Non-musical merchandise');
|
||||
|
||||
/** @var integer */
|
||||
private $_encoding;
|
||||
|
||||
/** @var string */
|
||||
private $_currency = 'EUR';
|
||||
|
||||
/** @var string */
|
||||
private $_price;
|
||||
|
||||
/** @var string */
|
||||
private $_date;
|
||||
|
||||
/** @var string */
|
||||
private $_contact;
|
||||
|
||||
/** @var integer */
|
||||
private $_delivery = 0;
|
||||
|
||||
/** @var string */
|
||||
private $_seller;
|
||||
|
||||
/** @var string */
|
||||
private $_description;
|
||||
|
||||
/** @var string */
|
||||
private $_mimeType = false;
|
||||
|
||||
/** @var string */
|
||||
private $_imageData;
|
||||
|
||||
/** @var integer */
|
||||
private $_imageSize = 0;
|
||||
|
||||
/**
|
||||
* 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
|
||||
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
|
||||
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);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the text encoding.
|
||||
*
|
||||
* All the strings read from a file are automatically converted to the
|
||||
* character encoding specified with the <var>encoding</var> option. See
|
||||
* {@link Zend_Media_Id3v2} for details. This method returns that character
|
||||
* encoding, or any value set after read, translated into a string form
|
||||
* regarless if it was set using a {@link Zend_Media_Id3_Encoding} constant
|
||||
* or a string.
|
||||
*
|
||||
* @return integer
|
||||
*/
|
||||
public function getEncoding()
|
||||
{
|
||||
return $this->_translateIntToEncoding($this->_encoding);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the text encoding.
|
||||
*
|
||||
* All the string written to the frame are done so using given character
|
||||
* encoding. No conversions of existing data take place upon the call to
|
||||
* this method thus all texts must be given in given character encoding.
|
||||
*
|
||||
* The character encoding parameter takes either a
|
||||
* {@link Zend_Media_Id3_Encoding} constant or a character set name string
|
||||
* in the form accepted by iconv. The default character encoding used to
|
||||
* write the frame is 'utf-8'.
|
||||
*
|
||||
* @see Zend_Media_Id3_Encoding
|
||||
* @param integer $encoding The text encoding.
|
||||
*/
|
||||
public function setEncoding($encoding)
|
||||
{
|
||||
$this->_encoding = $this->_translateEncodingToInt($encoding);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the currency code, encoded according to
|
||||
* {@link http://www.iso.org/iso/support/faqs/faqs_widely_used_standards/widely_used_standards_other/currency_codes/currency_codes_list-1.htm
|
||||
* ISO 4217} alphabetic currency code.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getCurrency()
|
||||
{
|
||||
return $this->_currency;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the currency used in transaction, encoded according to
|
||||
* {@link http://www.iso.org/iso/support/faqs/faqs_widely_used_standards/widely_used_standards_other/currency_codes/currency_codes_list-1.htm
|
||||
* ISO 4217} alphabetic currency code.
|
||||
*
|
||||
* @param string $currency The currency code.
|
||||
*/
|
||||
public function setCurrency($currency)
|
||||
{
|
||||
$this->_currency = strtoupper($currency);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the first price.
|
||||
*
|
||||
* @return double
|
||||
*/
|
||||
public function getPrice()
|
||||
{
|
||||
$array = explode('/', $this->_price);
|
||||
return doubleval($array[0]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the price array.
|
||||
*
|
||||
* @return Array
|
||||
*/
|
||||
public function getPrices()
|
||||
{
|
||||
$array = explode('/', $this->_price);
|
||||
foreach ($array as $key => $value) {
|
||||
$array[$key] = doubleval($value);
|
||||
}
|
||||
return $array;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the default price. Multiple prices can be given in the form of an
|
||||
* array but there may only be one currency of each type.
|
||||
*
|
||||
* @param double $price The price.
|
||||
*/
|
||||
public function setPrice($price)
|
||||
{
|
||||
$this->setPrices($price);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the default price. Multiple prices can be given in the form of an
|
||||
* array but there may only be one currency of each type.
|
||||
*
|
||||
* @param double|Array $prices The prices.
|
||||
*/
|
||||
public function setPrices($prices)
|
||||
{
|
||||
if (!is_array($prices)) {
|
||||
$prices = array($prices);
|
||||
}
|
||||
$this->_price = implode('/', $prices);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the date describing for how long the price is valid.
|
||||
*
|
||||
* @internal The ID3v2 standard does not declare the time zone to be used
|
||||
* in the date. Date must thus be expressed as GMT/UTC.
|
||||
* @return Zend_Date
|
||||
*/
|
||||
public function getDate()
|
||||
{
|
||||
require_once 'Zend/Date.php';
|
||||
$date = new Zend_Date(0);
|
||||
$date->setTimezone('UTC');
|
||||
$date->set($this->_date, 'yyyyMMdd');
|
||||
return $date;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the date describing for how long the price is valid for.
|
||||
*
|
||||
* @internal The ID3v2 standard does not declare the time zone to be used
|
||||
* in the date. Date must thus be expressed as GMT/UTC.
|
||||
* @param Zend_Date $date The date.
|
||||
*/
|
||||
public function setDate($date)
|
||||
{
|
||||
require_once 'Zend/Date.php';
|
||||
if ($date === null) {
|
||||
$date = Zend_Date::now();
|
||||
}
|
||||
$date->setTimezone('UTC');
|
||||
$this->_date = $date->toString('yyyyMMdd');
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the contact URL, with which the user can contact the seller.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getContact()
|
||||
{
|
||||
return $this->_contact;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the contact URL, with which the user can contact the seller.
|
||||
*
|
||||
* @param string $contact The contact URL.
|
||||
*/
|
||||
public function setContact($contact)
|
||||
{
|
||||
$this->_contact = $contact;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the delivery type with whitch the audio was delivered when
|
||||
* bought.
|
||||
*
|
||||
* @return integer
|
||||
*/
|
||||
public function getDelivery()
|
||||
{
|
||||
return $this->_delivery;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the delivery type with whitch the audio was delivered when bought.
|
||||
*
|
||||
* @param integer $delivery The delivery type code.
|
||||
*/
|
||||
public function setDelivery($delivery)
|
||||
{
|
||||
$this->_delivery = $delivery;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the name of the seller.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getSeller()
|
||||
{
|
||||
return $this->_seller;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the name of the seller using given encoding. The seller text
|
||||
* encoding must be that of the description text.
|
||||
*
|
||||
* @param string $seller The name of the seller.
|
||||
* @param integer $encoding The text encoding.
|
||||
*/
|
||||
public function setSeller($seller, $encoding = null)
|
||||
{
|
||||
$this->_seller = $seller;
|
||||
if ($encoding !== null) {
|
||||
$this->setEncoding($encoding);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the short description of the product.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getDescription()
|
||||
{
|
||||
return $this->_description;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the content description text using given encoding. The description
|
||||
* encoding must be that of the seller text.
|
||||
*
|
||||
* @param string $description The content description text.
|
||||
* @param integer $encoding The text encoding.
|
||||
*/
|
||||
public function setDescription($description, $encoding = null)
|
||||
{
|
||||
$this->_description = $description;
|
||||
if ($encoding !== null) {
|
||||
$this->setEncoding($encoding);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the MIME type of the seller's company logo, if attached, or
|
||||
* <var>false</var> otherwise. Currently only 'image/png' and 'image/jpeg'
|
||||
* are allowed.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getMimeType()
|
||||
{
|
||||
return $this->_mimeType;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the MIME type. Currently only 'image/png' and 'image/jpeg' are
|
||||
* allowed. The MIME type is always ISO-8859-1 encoded.
|
||||
*
|
||||
* @param string $mimeType The MIME type.
|
||||
*/
|
||||
public function setMimeType($mimeType)
|
||||
{
|
||||
$this->_mimeType = $mimeType;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the embedded image binary data.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getImageData()
|
||||
{
|
||||
return $this->_imageData;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the embedded image data. Also updates the image size to correspond
|
||||
* the new data.
|
||||
*
|
||||
* @param string $imageData The image data.
|
||||
*/
|
||||
public function setImageData($imageData)
|
||||
{
|
||||
$this->_imageData = $imageData;
|
||||
$this->_imageSize = strlen($imageData);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the size of the embedded image data.
|
||||
*
|
||||
* @return integer
|
||||
*/
|
||||
public function getImageSize()
|
||||
{
|
||||
return $this->_imageSize;
|
||||
}
|
||||
|
||||
/**
|
||||
* Writes the frame raw data without the header.
|
||||
*
|
||||
* @param Zend_Io_Writer $writer The writer object.
|
||||
* @return void
|
||||
*/
|
||||
protected function _writeFrame($writer)
|
||||
{
|
||||
$writer->writeUInt8($this->_encoding)
|
||||
->write($this->_currency)
|
||||
->writeString8($this->_price, 1)
|
||||
->write($this->_date)
|
||||
->writeString8($this->_contact, 1)
|
||||
->writeUInt8($this->_delivery);
|
||||
switch ($this->_encoding) {
|
||||
case self::UTF16LE:
|
||||
$writer->writeString16
|
||||
($this->_seller, Zend_Io_Writer::LITTLE_ENDIAN_ORDER, 1)
|
||||
->writeString16
|
||||
($this->_description,
|
||||
Zend_Io_Writer::LITTLE_ENDIAN_ORDER, 1);
|
||||
break;
|
||||
case self::UTF16:
|
||||
// break intentionally omitted
|
||||
case self::UTF16BE:
|
||||
$writer->writeString16($this->_seller, null, 1)
|
||||
->writeString16($this->_description, null, 1);
|
||||
break;
|
||||
default:
|
||||
$writer->writeString8($this->_seller, 1)
|
||||
->writeString8($this->_description, 1);
|
||||
break;
|
||||
}
|
||||
if ($this->_mimeType) {
|
||||
$writer->writeString8($this->_mimeType, 1)
|
||||
->write($this->_imageData);
|
||||
}
|
||||
}
|
||||
}
|
||||
165
src/Zend/Media/Id3/Frame/Encr.php
Normal file
165
src/Zend/Media/Id3/Frame/Encr.php
Normal file
@@ -0,0 +1,165 @@
|
||||
<?php
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Media
|
||||
* @subpackage ID3
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
*/
|
||||
|
||||
/**#@+ @ignore */
|
||||
require_once 'Zend/Media/Id3/Frame.php';
|
||||
/**#@-*/
|
||||
|
||||
/**
|
||||
* To identify with which method a frame has been encrypted the encryption
|
||||
* method must be registered in the tag with the <i>Encryption method
|
||||
* registration</i> frame.
|
||||
*
|
||||
* The owner identifier 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 encryption method. Questions
|
||||
* regarding the encryption method should be sent to the indicated email
|
||||
* address.
|
||||
*
|
||||
* The method symbol contains a value that is associated with this method
|
||||
* throughout the whole tag, in the range 0x80-0xF0. All other values are
|
||||
* reserved. The method symbol may optionally be followed by encryption
|
||||
* specific data.
|
||||
*
|
||||
* There may be several ENCR frames in a tag but only one containing the same
|
||||
* symbol and only one containing the same owner identifier. The method must be
|
||||
* used somewhere in the tag. See {@link Zend_Media_Id3_Frame#ENCRYPTION} for
|
||||
* more information.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Media
|
||||
* @subpackage ID3
|
||||
* @author Sven Vollbehr <sven@vollbehr.eu>
|
||||
* @author Ryan Butterfield <buttza@gmail.com>
|
||||
* @copyright Copyright (c) 2005-2009 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_Id3_Frame_Encr extends Zend_Media_Id3_Frame
|
||||
{
|
||||
/** @var string */
|
||||
private $_owner;
|
||||
|
||||
/** @var integer */
|
||||
private $_method;
|
||||
|
||||
/** @var string */
|
||||
private $_encryptionData;
|
||||
|
||||
/**
|
||||
* 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());
|
||||
}
|
||||
|
||||
/**
|
||||
* 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 method symbol.
|
||||
*
|
||||
* @return integer
|
||||
*/
|
||||
public function getMethod()
|
||||
{
|
||||
return $this->_method;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the method symbol.
|
||||
*
|
||||
* @param integer $method The method symbol byte.
|
||||
*/
|
||||
public function setMethod($method)
|
||||
{
|
||||
$this->_method = $method;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the encryption data.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getEncryptionData()
|
||||
{
|
||||
return $this->_encryptionData;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the encryption data.
|
||||
*
|
||||
* @param string $encryptionData The encryption data string.
|
||||
*/
|
||||
public function setEncryptionData($encryptionData)
|
||||
{
|
||||
$this->_encryptionData = $encryptionData;
|
||||
}
|
||||
|
||||
/**
|
||||
* Writes the frame raw data without the header.
|
||||
*
|
||||
* @param Zend_Io_Writer $writer The writer object.
|
||||
* @return void
|
||||
*/
|
||||
protected function _writeFrame($writer)
|
||||
{
|
||||
$writer->writeString8($this->_owner, 1)
|
||||
->writeInt8($this->_method)
|
||||
->write($this->_encryptionData);
|
||||
}
|
||||
}
|
||||
195
src/Zend/Media/Id3/Frame/Equ2.php
Normal file
195
src/Zend/Media/Id3/Frame/Equ2.php
Normal file
@@ -0,0 +1,195 @@
|
||||
<?php
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Media
|
||||
* @subpackage ID3
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
* @since ID3v2.4.0
|
||||
*/
|
||||
|
||||
/**#@+ @ignore */
|
||||
require_once 'Zend/Media/Id3/Frame.php';
|
||||
/**#@-*/
|
||||
|
||||
/**
|
||||
* The <i>Equalisation (2)</i> is another subjective, alignment frame. It allows
|
||||
* the user to predefine an equalisation curve within the audio file. There may
|
||||
* be more than one EQU2 frame in each tag, but only one with the same
|
||||
* identification string.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Media
|
||||
* @subpackage ID3
|
||||
* @author Sven Vollbehr <sven@vollbehr.eu>
|
||||
* @author Ryan Butterfield <buttza@gmail.com>
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
* @since ID3v2.4.0
|
||||
*/
|
||||
final class Zend_Media_Id3_Frame_Equ2 extends Zend_Media_Id3_Frame
|
||||
{
|
||||
/**
|
||||
* Interpolation type that defines that no interpolation is made. A jump
|
||||
* from one adjustment level to another occurs in the middle between two
|
||||
* adjustment points.
|
||||
*/
|
||||
const BAND = 0;
|
||||
|
||||
/**
|
||||
* Interpolation type that defines that interpolation between adjustment
|
||||
* points is linear.
|
||||
*/
|
||||
const LINEAR = 1;
|
||||
|
||||
/** @var integer */
|
||||
private $_interpolation;
|
||||
|
||||
/** @var string */
|
||||
private $_device;
|
||||
|
||||
/** @var Array */
|
||||
private $_adjustments = array();
|
||||
|
||||
/**
|
||||
* 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);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the interpolation method. The interpolation method describes
|
||||
* which method is preferred when an interpolation between the adjustment
|
||||
* point that follows.
|
||||
*
|
||||
* @return integer
|
||||
*/
|
||||
public function getInterpolation()
|
||||
{
|
||||
return $this->_interpolation;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the interpolation method. The interpolation method describes which
|
||||
* method is preferred when an interpolation between the adjustment point
|
||||
* that follows.
|
||||
*
|
||||
* @param integer $interpolation The interpolation method code.
|
||||
*/
|
||||
public function setInterpolation($interpolation)
|
||||
{
|
||||
$this->_interpolation = $interpolation;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the device where the adjustments should apply.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getDevice()
|
||||
{
|
||||
return $this->_device;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the device where the adjustments should apply.
|
||||
*
|
||||
* @param string $device The device.
|
||||
*/
|
||||
public function setDevice($device)
|
||||
{
|
||||
$this->_device = $device;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the array containing adjustments having frequencies as keys and
|
||||
* their corresponding adjustments as values.
|
||||
*
|
||||
* Adjustment points are ordered by frequency.
|
||||
*
|
||||
* @return Array
|
||||
*/
|
||||
public function getAdjustments()
|
||||
{
|
||||
return $this->_adjustments;
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a volume adjustment setting for given frequency. The frequency can
|
||||
* have a value from 0 to 32767 Hz, and the adjustment </> +/- 64 dB with a
|
||||
* precision of 0.001953125 dB.
|
||||
*
|
||||
* @param integer $frequency The frequency, in hertz.
|
||||
* @param integer $adjustment The adjustment, in dB.
|
||||
*/
|
||||
public function addAdjustment($frequency, $adjustment)
|
||||
{
|
||||
$this->_adjustments[$frequency] = $adjustment;
|
||||
ksort($this->_adjustments);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the adjustments array. The array must have frequencies as keys and
|
||||
* their corresponding adjustments as values. The frequency can have a value
|
||||
* from 0 to 32767 Hz, and the adjustment </> +/- 64 dB with a precision of
|
||||
* 0.001953125 dB. One frequency should only be described once in the frame.
|
||||
*
|
||||
* @param Array $adjustments The adjustments array.
|
||||
*/
|
||||
public function setAdjustments($adjustments)
|
||||
{
|
||||
$this->_adjustments = $adjustments;
|
||||
ksort($this->_adjustments);
|
||||
}
|
||||
|
||||
/**
|
||||
* Writes the frame raw data without the header.
|
||||
*
|
||||
* @param Zend_Io_Writer $writer The writer object.
|
||||
* @return void
|
||||
*/
|
||||
protected function _writeFrame($writer)
|
||||
{
|
||||
$writer->writeInt8($this->_interpolation)
|
||||
->writeString8($this->_device, 1);
|
||||
foreach ($this->_adjustments as $frequency => $adjustment) {
|
||||
$writer->writeUInt16BE($frequency * 2)
|
||||
->writeInt16BE($adjustment * 512);
|
||||
}
|
||||
}
|
||||
}
|
||||
133
src/Zend/Media/Id3/Frame/Equa.php
Normal file
133
src/Zend/Media/Id3/Frame/Equa.php
Normal file
@@ -0,0 +1,133 @@
|
||||
<?php
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Media
|
||||
* @subpackage ID3
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
* @deprecated ID3v2.3.0
|
||||
*/
|
||||
|
||||
/**#@+ @ignore */
|
||||
require_once 'Zend/Media/Id3/Frame.php';
|
||||
/**#@-*/
|
||||
|
||||
/**
|
||||
* The <i>Equalisation</i> frame is another subjective, alignment frame. It
|
||||
* allows the user to predefine an equalisation curve within the audio file.
|
||||
* There may only be one EQUA frame in each tag.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Media
|
||||
* @subpackage ID3
|
||||
* @author Sven Vollbehr <sven@vollbehr.eu>
|
||||
* @author Ryan Butterfield <buttza@gmail.com>
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
* @deprecated ID3v2.3.0
|
||||
*/
|
||||
final class Zend_Media_Id3_Frame_Equa extends Zend_Media_Id3_Frame
|
||||
{
|
||||
/** @var Array */
|
||||
private $_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;
|
||||
}
|
||||
|
||||
$adjustmentBits = $this->_reader->readInt8();
|
||||
if ($adjustmentBits <= 8 || $adjustmentBits > 16) {
|
||||
require_once 'Zend/Media/Id3/Exception.php';
|
||||
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);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the array containing adjustments having frequencies as keys and
|
||||
* their corresponding adjustments as values.
|
||||
*
|
||||
* @return Array
|
||||
*/
|
||||
public function getAdjustments()
|
||||
{
|
||||
return $this->_adjustments;
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a volume adjustment setting for given frequency. The frequency can
|
||||
* have a value from 0 to 32767 Hz.
|
||||
*
|
||||
* @param integer $frequency The frequency, in hertz.
|
||||
* @param integer $adjustment The adjustment, in dB.
|
||||
*/
|
||||
public function addAdjustment($frequency, $adjustment)
|
||||
{
|
||||
$this->_adjustments[$frequency] = $adjustment;
|
||||
ksort($this->_adjustments);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the adjustments array. The array must have frequencies as keys and
|
||||
* their corresponding adjustments as values. The frequency can have a value
|
||||
* from 0 to 32767 Hz. One frequency should only be described once in the
|
||||
* frame.
|
||||
*
|
||||
* @param Array $adjustments The adjustments array.
|
||||
*/
|
||||
public function setAdjustments($adjustments)
|
||||
{
|
||||
$this->_adjustments = $adjustments;
|
||||
ksort($this->_adjustments);
|
||||
}
|
||||
|
||||
/**
|
||||
* Writes the frame raw data without the header.
|
||||
*
|
||||
* @param Zend_Io_Writer $writer The writer object.
|
||||
* @return void
|
||||
*/
|
||||
protected function _writeFrame($writer)
|
||||
{
|
||||
$writer->writeInt8(16);
|
||||
foreach ($this->_adjustments as $frequency => $adjustment) {
|
||||
$writer->writeUInt16BE
|
||||
($adjustment > 0 ? $frequency | 0x8000 : $frequency & ~0x8000)
|
||||
->writeUInt16BE(abs($adjustment));
|
||||
}
|
||||
}
|
||||
}
|
||||
168
src/Zend/Media/Id3/Frame/Etco.php
Normal file
168
src/Zend/Media/Id3/Frame/Etco.php
Normal file
@@ -0,0 +1,168 @@
|
||||
<?php
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Media
|
||||
* @subpackage ID3
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
*/
|
||||
|
||||
/**#@+ @ignore */
|
||||
require_once 'Zend/Media/Id3/Frame.php';
|
||||
require_once 'Zend/Media/Id3/Timing.php';
|
||||
/**#@-*/
|
||||
|
||||
/**
|
||||
* The <i>Event timing codes</i> allows synchronisation with key events in the
|
||||
* audio.
|
||||
*
|
||||
* The events are an array of timestamp and type pairs. The time stamp is set to
|
||||
* zero if directly at the beginning of the sound or after the previous event.
|
||||
* All events are sorted in chronological order.
|
||||
*
|
||||
* The events 0xe0-ef are for user events. You might want to synchronise your
|
||||
* music to something, like setting off an explosion on-stage, activating a
|
||||
* screensaver etc.
|
||||
*
|
||||
* There may only be one ETCO frame in each tag.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Media
|
||||
* @subpackage ID3
|
||||
* @author Sven Vollbehr <sven@vollbehr.eu>
|
||||
* @author Ryan Butterfield <buttza@gmail.com>
|
||||
* @copyright Copyright (c) 2005-2009 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_Id3_Frame_Etco extends Zend_Media_Id3_Frame
|
||||
implements Zend_Media_Id3_Timing
|
||||
{
|
||||
/**
|
||||
* The list of event types.
|
||||
*
|
||||
* @var Array
|
||||
*/
|
||||
public static $types = array
|
||||
('Padding', 'End of initial silence', 'Intro start', 'Main part start',
|
||||
'Outro start', 'Outro end', 'Verse start','Refrain start',
|
||||
'Interlude start', 'Theme start', 'Variation start', 'Key change',
|
||||
'Time change', 'Momentary unwanted noise', 'Sustained noise',
|
||||
'Sustained noise end', 'Intro end', 'Main part end', 'Verse end',
|
||||
'Refrain end', 'Theme end', 'Profanity', 'Profanity end',
|
||||
|
||||
0xe0 => 'User event', 'User event', 'User event', 'User event',
|
||||
'User event', 'User event', 'User event', 'User event', 'User event',
|
||||
'User event', 'User event', 'User event', 'User event', 'User event',
|
||||
|
||||
0xfd => 'Audio end (start of silence)', 'Audio file ends',
|
||||
'One more byte of events follows');
|
||||
|
||||
/** @var integer */
|
||||
private $_format = Zend_Media_Id3_Timing::MPEG_FRAMES;
|
||||
|
||||
/** @var Array */
|
||||
private $_events = array();
|
||||
|
||||
/**
|
||||
* 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);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the timing format.
|
||||
*
|
||||
* @return integer
|
||||
*/
|
||||
public function getFormat()
|
||||
{
|
||||
return $this->_format;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the timing format.
|
||||
*
|
||||
* @see Zend_Media_Id3_Timing
|
||||
* @param integer $format The timing format.
|
||||
*/
|
||||
public function setFormat($format)
|
||||
{
|
||||
$this->_format = $format;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the events as an associated array having the timestamps as keys
|
||||
* and the event types as values.
|
||||
*
|
||||
* @return Array
|
||||
*/
|
||||
public function getEvents()
|
||||
{
|
||||
return $this->_events;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the events using given format. The value must be an associated array
|
||||
* having the timestamps as keys and the event types as values.
|
||||
*
|
||||
* @param Array $events The events array.
|
||||
* @param integer $format The timing format.
|
||||
*/
|
||||
public function setEvents($events, $format = null)
|
||||
{
|
||||
$this->_events = $events;
|
||||
if ($format !== null) {
|
||||
$this->setFormat($format);
|
||||
}
|
||||
ksort($this->_events);
|
||||
}
|
||||
|
||||
/**
|
||||
* Writes the frame raw data without the header.
|
||||
*
|
||||
* @param Zend_Io_Writer $writer The writer object.
|
||||
* @return void
|
||||
*/
|
||||
protected function _writeFrame($writer)
|
||||
{
|
||||
$writer->writeUInt8($this->_format);
|
||||
foreach ($this->_events as $timestamp => $type) {
|
||||
$writer->writeUInt8($type)
|
||||
->writeUInt32BE($timestamp);
|
||||
}
|
||||
}
|
||||
}
|
||||
264
src/Zend/Media/Id3/Frame/Geob.php
Normal file
264
src/Zend/Media/Id3/Frame/Geob.php
Normal file
@@ -0,0 +1,264 @@
|
||||
<?php
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Media
|
||||
* @subpackage ID3
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
*/
|
||||
|
||||
/**#@+ @ignore */
|
||||
require_once 'Zend/Media/Id3/Frame.php';
|
||||
require_once 'Zend/Media/Id3/Encoding.php';
|
||||
/**#@-*/
|
||||
|
||||
/**
|
||||
* In the <i>General encapsulated object</i> frame any type of file can be
|
||||
* encapsulated.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Media
|
||||
* @subpackage ID3
|
||||
* @author Sven Vollbehr <sven@vollbehr.eu>
|
||||
* @author Ryan Butterfield <buttza@gmail.com>
|
||||
* @copyright Copyright (c) 2005-2009 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_Id3_Frame_Geob extends Zend_Media_Id3_Frame
|
||||
implements Zend_Media_Id3_Encoding
|
||||
{
|
||||
/** @var integer */
|
||||
private $_encoding;
|
||||
|
||||
/** @var string */
|
||||
private $_mimeType;
|
||||
|
||||
/** @var string */
|
||||
private $_filename;
|
||||
|
||||
/** @var string */
|
||||
private $_description;
|
||||
|
||||
/** @var string */
|
||||
private $_data;
|
||||
|
||||
/**
|
||||
* 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
|
||||
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
|
||||
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);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the text encoding.
|
||||
*
|
||||
* All the strings read from a file are automatically converted to the
|
||||
* character encoding specified with the <var>encoding</var> option. See
|
||||
* {@link Zend_Media_Id3v2} for details. This method returns that character
|
||||
* encoding, or any value set after read, translated into a string form
|
||||
* regarless if it was set using a {@link Zend_Media_Id3_Encoding} constant
|
||||
* or a string.
|
||||
*
|
||||
* @return integer
|
||||
*/
|
||||
public function getEncoding()
|
||||
{
|
||||
return $this->_translateIntToEncoding($this->_encoding);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the text encoding.
|
||||
*
|
||||
* All the string written to the frame are done so using given character
|
||||
* encoding. No conversions of existing data take place upon the call to
|
||||
* this method thus all texts must be given in given character encoding.
|
||||
*
|
||||
* The character encoding parameter takes either a
|
||||
* {@link Zend_Media_Id3_Encoding} constant or a character set name string
|
||||
* in the form accepted by iconv. The default character encoding used to
|
||||
* write the frame is 'utf-8'.
|
||||
*
|
||||
* @see Zend_Media_Id3_Encoding
|
||||
* @param integer $encoding The text encoding.
|
||||
*/
|
||||
public function setEncoding($encoding)
|
||||
{
|
||||
$this->_encoding = $this->_translateEncodingToInt($encoding);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the MIME type. The MIME type is always encoded with ISO-8859-1.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getMimeType()
|
||||
{
|
||||
return $this->_mimeType;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the MIME type. The MIME type is always ISO-8859-1 encoded.
|
||||
*
|
||||
* @param string $mimeType The MIME type.
|
||||
*/
|
||||
public function setMimeType($mimeType)
|
||||
{
|
||||
$this->_mimeType = $mimeType;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the file name.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getFilename()
|
||||
{
|
||||
return $this->_filename;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the file name using given encoding. The file name encoding must be
|
||||
* that of the description text.
|
||||
*
|
||||
* @param string $description The file description text.
|
||||
* @param integer $encoding The text encoding.
|
||||
*/
|
||||
public function setFilename($filename, $encoding = null)
|
||||
{
|
||||
$this->_filename = $filename;
|
||||
if ($encoding !== null) {
|
||||
$this->_encoding = $encoding;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the file description.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getDescription()
|
||||
{
|
||||
return $this->_description;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the file description text using given encoding. The description
|
||||
* encoding must be that of the file name.
|
||||
*
|
||||
* @param string $description The file description text.
|
||||
* @param integer $encoding The text encoding.
|
||||
*/
|
||||
public function setDescription($description, $encoding = null)
|
||||
{
|
||||
$this->_description = $description;
|
||||
if ($encoding !== null) {
|
||||
$this->setEncoding($encoding);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the embedded object binary data.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getData()
|
||||
{
|
||||
return $this->_data;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the embedded object binary data.
|
||||
*
|
||||
* @param string $data The object data.
|
||||
*/
|
||||
public function setData($data)
|
||||
{
|
||||
$this->_data = $data;
|
||||
}
|
||||
|
||||
/**
|
||||
* Writes the frame raw data without the header.
|
||||
*
|
||||
* @param Zend_Io_Writer $writer The writer object.
|
||||
* @return void
|
||||
*/
|
||||
protected function _writeFrame($writer)
|
||||
{
|
||||
$writer->writeUInt8($this->_encoding)
|
||||
->writeString8($this->_mimeType, 1);
|
||||
switch ($this->_encoding) {
|
||||
case self::UTF16LE:
|
||||
$writer->writeString16
|
||||
($this->_filename, Zend_Io_Writer::LITTLE_ENDIAN_ORDER, 1)
|
||||
->writeString16
|
||||
($this->_description,
|
||||
Zend_Io_Writer::LITTLE_ENDIAN_ORDER, 1);
|
||||
break;
|
||||
case self::UTF16:
|
||||
// break intentionally omitted
|
||||
case self::UTF16BE:
|
||||
$writer->writeString16($this->_filename, null, 1)
|
||||
->writeString16($this->_description, null, 1);
|
||||
break;
|
||||
default:
|
||||
$writer->writeString8($this->_filename, 1)
|
||||
->writeString8($this->_description, 1);
|
||||
break;
|
||||
}
|
||||
$writer->write($this->_data);
|
||||
}
|
||||
}
|
||||
160
src/Zend/Media/Id3/Frame/Grid.php
Normal file
160
src/Zend/Media/Id3/Frame/Grid.php
Normal file
@@ -0,0 +1,160 @@
|
||||
<?php
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Media
|
||||
* @subpackage ID3
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
*/
|
||||
|
||||
/**#@+ @ignore */
|
||||
require_once 'Zend/Media/Id3/Frame.php';
|
||||
/**#@-*/
|
||||
|
||||
/**
|
||||
* The <i>Group identification registration</i> frame enables grouping of
|
||||
* otherwise unrelated frames. This can be used when some frames are to be
|
||||
* signed. To identify which frames belongs to a set of frames a group
|
||||
* identifier must be registered in the tag with this frame.
|
||||
*
|
||||
* The owner 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 grouping. Questions regarding the grouping
|
||||
* should be sent to the indicated email address.
|
||||
*
|
||||
* The group symbol contains a value that associates the frame with this group
|
||||
* throughout the whole tag, in the range 0x80-0xf0. All other values are
|
||||
* reserved. The group symbol may optionally be followed by some group specific
|
||||
* data, e.g. 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 Zend_Media_Id3_Frame#GROUPING_IDENTITY} for more information.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Media
|
||||
* @subpackage ID3
|
||||
* @author Sven Vollbehr <sven@vollbehr.eu>
|
||||
* @author Ryan Butterfield <buttza@gmail.com>
|
||||
* @copyright Copyright (c) 2005-2009 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_Id3_Frame_Grid extends Zend_Media_Id3_Frame
|
||||
{
|
||||
/** @var string */
|
||||
private $_owner;
|
||||
|
||||
/** @var integer */
|
||||
private $_group;
|
||||
|
||||
/** @var string */
|
||||
private $_data;
|
||||
|
||||
/**
|
||||
* 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->_group = $this->_reader->readUInt8();
|
||||
$this->_data = $this->_reader->read($this->_reader->getSize());
|
||||
}
|
||||
|
||||
/**
|
||||
* 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 group symbol.
|
||||
*
|
||||
* @return integer
|
||||
*/
|
||||
public function getGroup()
|
||||
{
|
||||
return $this->_group;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the group symbol.
|
||||
*
|
||||
* @param integer $group The group symbol.
|
||||
*/
|
||||
public function setGroup($group)
|
||||
{
|
||||
$this->_group = $group;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the group dependent data.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getData()
|
||||
{
|
||||
return $this->_data;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the group dependent data.
|
||||
*
|
||||
* @param string $data The data.
|
||||
*/
|
||||
public function setData($data)
|
||||
{
|
||||
$this->_data = $data;
|
||||
}
|
||||
|
||||
/**
|
||||
* Writes the frame raw data without the header.
|
||||
*
|
||||
* @param Zend_Io_Writer $writer The writer object.
|
||||
* @return void
|
||||
*/
|
||||
protected function _writeFrame($writer)
|
||||
{
|
||||
$writer->writeString8($this->_owner, 1)
|
||||
->writeUInt8($this->_group)
|
||||
->write($this->_data);
|
||||
}
|
||||
}
|
||||
200
src/Zend/Media/Id3/Frame/Ipls.php
Normal file
200
src/Zend/Media/Id3/Frame/Ipls.php
Normal file
@@ -0,0 +1,200 @@
|
||||
<?php
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Media
|
||||
* @subpackage ID3
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
* @deprecated ID3v2.3.0
|
||||
*/
|
||||
|
||||
/**#@+ @ignore */
|
||||
require_once 'Zend/Media/Id3/Frame.php';
|
||||
require_once 'Zend/Media/Id3/Encoding.php';
|
||||
/**#@-*/
|
||||
|
||||
/**
|
||||
* The <i>Involved people list</i> is a frame containing the names of those
|
||||
* involved, and how they were involved. There may only be one IPLS frame in
|
||||
* each tag.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Media
|
||||
* @subpackage ID3
|
||||
* @author Sven Vollbehr <sven@vollbehr.eu>
|
||||
* @author Ryan Butterfield <buttza@gmail.com>
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
* @deprecated ID3v2.3.0
|
||||
*/
|
||||
final class Zend_Media_Id3_Frame_Ipls extends Zend_Media_Id3_Frame
|
||||
implements Zend_Media_Id3_Encoding
|
||||
{
|
||||
/** @var integer */
|
||||
private $_encoding;
|
||||
|
||||
/** @var Array */
|
||||
private $_people = array();
|
||||
|
||||
/**
|
||||
* 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
|
||||
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
|
||||
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]);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the text encoding.
|
||||
*
|
||||
* All the strings read from a file are automatically converted to the
|
||||
* character encoding specified with the <var>encoding</var> option. See
|
||||
* {@link Zend_Media_Id3v2} for details. This method returns that character
|
||||
* encoding, or any value set after read, translated into a string form
|
||||
* regarless if it was set using a {@link Zend_Media_Id3_Encoding} constant
|
||||
* or a string.
|
||||
*
|
||||
* @return integer
|
||||
*/
|
||||
public function getEncoding()
|
||||
{
|
||||
return $this->_translateIntToEncoding($this->_encoding);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the text encoding.
|
||||
*
|
||||
* All the string written to the frame are done so using given character
|
||||
* encoding. No conversions of existing data take place upon the call to
|
||||
* this method thus all texts must be given in given character encoding.
|
||||
*
|
||||
* The character encoding parameter takes either a
|
||||
* {@link Zend_Media_Id3_Encoding} constant or a character set name string
|
||||
* in the form accepted by iconv. The default character encoding used to
|
||||
* write the frame is 'utf-8'.
|
||||
*
|
||||
* @see Zend_Media_Id3_Encoding
|
||||
* @param integer $encoding The text encoding.
|
||||
*/
|
||||
public function setEncoding($encoding)
|
||||
{
|
||||
$this->_encoding = $this->_translateEncodingToInt($encoding);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the involved people list as an array. For each person, the array
|
||||
* contains an entry, which too is an associate array with involvement as
|
||||
* its key and involvee as its value.
|
||||
*
|
||||
* @return Array
|
||||
*/
|
||||
public function getPeople()
|
||||
{
|
||||
return $this->_people;
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a person with his involvement.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function addPerson($involvement, $person)
|
||||
{
|
||||
$this->_people[] = array($involvement => $person);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the involved people list array. For each person, the array must
|
||||
* contain an associate array with involvement as its key and involvee as
|
||||
* its value.
|
||||
*
|
||||
* @param Array $people The involved people list.
|
||||
*/
|
||||
public function setPeople($people)
|
||||
{
|
||||
$this->_people = $people;
|
||||
}
|
||||
|
||||
/**
|
||||
* Writes the frame raw data without the header.
|
||||
*
|
||||
* @param Zend_Io_Writer $writer The writer object.
|
||||
* @return void
|
||||
*/
|
||||
protected function _writeFrame($writer)
|
||||
{
|
||||
$writer->writeUInt8($this->_encoding);
|
||||
foreach ($this->_people as $entry) {
|
||||
foreach ($entry as $key => $val) {
|
||||
switch ($this->_encoding) {
|
||||
case self::UTF16LE:
|
||||
$writer->writeString16
|
||||
($key, Zend_Io_Writer::LITTLE_ENDIAN_ORDER, 1)
|
||||
->writeString16
|
||||
($val, Zend_Io_Writer::LITTLE_ENDIAN_ORDER, 1);
|
||||
break;
|
||||
case self::UTF16:
|
||||
// break intentionally omitted
|
||||
case self::UTF16BE:
|
||||
$writer->writeString16($key, null, 1)
|
||||
->writeString16($val, null, 1);
|
||||
break;
|
||||
default:
|
||||
$writer->writeString8($key, 1)
|
||||
->writeString8($val, 1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
188
src/Zend/Media/Id3/Frame/Link.php
Normal file
188
src/Zend/Media/Id3/Frame/Link.php
Normal file
@@ -0,0 +1,188 @@
|
||||
<?php
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Media
|
||||
* @subpackage ID3
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
*/
|
||||
|
||||
/**#@+ @ignore */
|
||||
require_once 'Zend/Media/Id3/Frame.php';
|
||||
/**#@-*/
|
||||
|
||||
/**
|
||||
* The <i>Linked information</i> frame is used to keep information duplication
|
||||
* as low as possible by linking information from another ID3v2 tag that might
|
||||
* reside in another audio file or alone in a binary file. It is recommended
|
||||
* that this method is only used when the files are stored on a CD-ROM or other
|
||||
* circumstances when the risk of file separation is low.
|
||||
*
|
||||
* Data should be retrieved from the first tag found in the file to which this
|
||||
* link points. There may be more than one LINK frame in a tag, but only one
|
||||
* with the same contents.
|
||||
*
|
||||
* A linked frame is to be considered as part of the tag and has the same
|
||||
* restrictions as if it was a physical part of the tag (i.e. only one
|
||||
* {@link Zend_Media_Id3_Frame_Rvrb RVRB} frame allowed, whether it's linked or
|
||||
* not).
|
||||
*
|
||||
* Frames that may be linked and need no additional data are
|
||||
* {@link Zend_Media_Id3_Frame_Aspi ASPI},
|
||||
* {@link Zend_Media_Id3_Frame_Etco ETCO},
|
||||
* {@link Zend_Media_Id3_Frame_Equ2 EQU2},
|
||||
* {@link Zend_Media_Id3_Frame_Mcdi MCDI},
|
||||
* {@link Zend_Media_Id3_Frame_Mllt MLLT},
|
||||
* {@link Zend_Media_Id3_Frame_Owne OWNE},
|
||||
* {@link Zend_Media_Id3_Frame_Rva2 RVA2},
|
||||
* {@link Zend_Media_Id3_Frame_Rvrb RVRB},
|
||||
* {@link Zend_Media_Id3_Frame_Sytc SYTC}, the text information frames (ie
|
||||
* frames descendats of {@link Zend_Media_Id3_TextFrame}) and the URL
|
||||
* link frames (ie frames descendants of
|
||||
* {@link Zend_Media_Id3_LinkFrame}).
|
||||
*
|
||||
* The {@link Zend_Media_Id3_Frame_Aenc AENC},
|
||||
* {@link Zend_Media_Id3_Frame_Apic APIC},
|
||||
* {@link Zend_Media_Id3_Frame_Geob GEOB}
|
||||
* and {@link Zend_Media_Id3_Frame_Txxx TXXX} frames may be linked with the
|
||||
* content descriptor as additional ID data.
|
||||
*
|
||||
* The {@link Zend_Media_Id3_Frame_User USER} frame may be linked with the
|
||||
* language field as additional ID data.
|
||||
*
|
||||
* The {@link Zend_Media_Id3_Frame_Priv PRIV} frame may be linked with the owner
|
||||
* identifier as additional ID data.
|
||||
*
|
||||
* The {@link Zend_Media_Id3_Frame_Comm COMM},
|
||||
* {@link Zend_Media_Id3_Frame_Sylt SYLT} and
|
||||
* {@link Zend_Media_Id3_Frame_Uslt USLT} frames may be linked with three bytes
|
||||
* of language descriptor directly followed by a content descriptor as
|
||||
* additional ID data.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Media
|
||||
* @subpackage ID3
|
||||
* @author Sven Vollbehr <sven@vollbehr.eu>
|
||||
* @author Ryan Butterfield <buttza@gmail.com>
|
||||
* @copyright Copyright (c) 2005-2009 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_Id3_Frame_Link extends Zend_Media_Id3_Frame
|
||||
{
|
||||
/** @var string */
|
||||
private $_target;
|
||||
|
||||
/** @var string */
|
||||
private $_url;
|
||||
|
||||
/** @var string */
|
||||
private $_qualifier;
|
||||
|
||||
/**
|
||||
* 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);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the target tag identifier.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getTarget()
|
||||
{
|
||||
return $this->_target;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the target tag identifier.
|
||||
*
|
||||
* @param string $target The target tag identifier.
|
||||
*/
|
||||
public function setTarget($target)
|
||||
{
|
||||
$this->_target = $target;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the target tag URL.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getUrl()
|
||||
{
|
||||
return $this->_url;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the target tag URL.
|
||||
*
|
||||
* @param string $url The target URL.
|
||||
*/
|
||||
public function setUrl($url)
|
||||
{
|
||||
$this->_url = $url;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the additional data to identify further the tag.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getQualifier()
|
||||
{
|
||||
return $this->_qualifier;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the additional data to be used in tag identification.
|
||||
*
|
||||
* @param string $identifier The qualifier.
|
||||
*/
|
||||
public function setQualifier($qualifier)
|
||||
{
|
||||
$this->_qualifier = $qualifier;
|
||||
}
|
||||
|
||||
/**
|
||||
* Writes the frame raw data without the header.
|
||||
*
|
||||
* @param Zend_Io_Writer $writer The writer object.
|
||||
* @return void
|
||||
*/
|
||||
protected function _writeFrame($writer)
|
||||
{
|
||||
$writer->writeString8(substr($this->_target, 0, 4), 4)
|
||||
->writeString8($this->_url, 1)
|
||||
->writeString8($this->_qualifier);
|
||||
}
|
||||
}
|
||||
102
src/Zend/Media/Id3/Frame/Mcdi.php
Normal file
102
src/Zend/Media/Id3/Frame/Mcdi.php
Normal file
@@ -0,0 +1,102 @@
|
||||
<?php
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Media
|
||||
* @subpackage ID3
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
*/
|
||||
|
||||
/**#@+ @ignore */
|
||||
require_once 'Zend/Media/Id3/Frame.php';
|
||||
/**#@-*/
|
||||
|
||||
/**
|
||||
* This frame is intended for music that comes from a CD, so that the CD can be
|
||||
* identified in databases such as the CDDB. The frame consists of a binary dump
|
||||
* of the Table Of Contents, TOC, from the CD, which is a header of 4 bytes and
|
||||
* then 8 bytes/track on the CD plus 8 bytes for the lead out, making a
|
||||
* maximum of 804 bytes. The offset to the beginning of every track on the CD
|
||||
* should be described with a four bytes absolute CD-frame address per track,
|
||||
* and not with absolute time. When this frame is used the presence of a valid
|
||||
* {@link Zend_Media_Id3_Frame_Trck TRCK} frame is required, even if the CD's
|
||||
* only got one track. It is recommended that this frame is always added to tags
|
||||
* originating from CDs.
|
||||
*
|
||||
* There may only be one MCDI frame in each tag.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Media
|
||||
* @subpackage ID3
|
||||
* @author Sven Vollbehr <sven@vollbehr.eu>
|
||||
* @copyright Copyright (c) 2005-2009 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_Id3_Frame_Mcdi extends Zend_Media_Id3_Frame
|
||||
{
|
||||
/** @var string */
|
||||
private $_data;
|
||||
|
||||
/**
|
||||
* 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());
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the CD TOC binary dump.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getData()
|
||||
{
|
||||
return $this->_data;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the CD TOC binary dump.
|
||||
*
|
||||
* @param string $data The CD TOC binary dump string.
|
||||
*/
|
||||
public function setData($data)
|
||||
{
|
||||
$this->_data = $data;
|
||||
}
|
||||
|
||||
/**
|
||||
* Writes the frame raw data without the header.
|
||||
*
|
||||
* @param Zend_Io_Writer $writer The writer object.
|
||||
* @return void
|
||||
*/
|
||||
protected function _writeFrame($writer)
|
||||
{
|
||||
$writer->write($this->_data);
|
||||
}
|
||||
}
|
||||
187
src/Zend/Media/Id3/Frame/Mllt.php
Normal file
187
src/Zend/Media/Id3/Frame/Mllt.php
Normal file
@@ -0,0 +1,187 @@
|
||||
<?php
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Media
|
||||
* @subpackage ID3
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
*/
|
||||
|
||||
/**#@+ @ignore */
|
||||
require_once 'Zend/Media/Id3/Frame.php';
|
||||
/**#@-*/
|
||||
|
||||
/**
|
||||
* To increase performance and accuracy of jumps within a MPEG audio file,
|
||||
* frames with time codes in different locations in the file might be useful.
|
||||
* The <i>MPEG location lookup table</i> frame includes references that the
|
||||
* software can use to calculate positions in the file.
|
||||
*
|
||||
* The MPEG frames between reference describes how much the frame counter should
|
||||
* be increased for every reference. If this value is two then the first
|
||||
* reference points out the second frame, the 2nd reference the 4th frame, the
|
||||
* 3rd reference the 6th frame etc. In a similar way the bytes between reference
|
||||
* and milliseconds between reference points out bytes and milliseconds
|
||||
* respectively.
|
||||
*
|
||||
* Each reference consists of two parts; a certain number of bits that describes
|
||||
* the difference between what is said in bytes between reference and the
|
||||
* reality and a certain number of bits that describes the difference between
|
||||
* what is said in milliseconds between reference and the reality.
|
||||
*
|
||||
* There may only be one MLLT frame in each tag.
|
||||
*
|
||||
* @todo Data parsing and write support
|
||||
* @category Zend
|
||||
* @package Zend_Media
|
||||
* @subpackage ID3
|
||||
* @author Sven Vollbehr <sven@vollbehr.eu>
|
||||
* @copyright Copyright (c) 2005-2009 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_Id3_Frame_Mllt extends Zend_Media_Id3_Frame
|
||||
{
|
||||
/** @var integer */
|
||||
private $_frames;
|
||||
|
||||
/** @var integer */
|
||||
private $_bytes;
|
||||
|
||||
/** @var integer */
|
||||
private $_milliseconds;
|
||||
|
||||
/** @var Array */
|
||||
private $_deviation = array();
|
||||
|
||||
/**
|
||||
* 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) {
|
||||
require_once 'Zend/Media/Id3/Exception.php';
|
||||
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);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the number of MPEG frames between reference.
|
||||
*
|
||||
|
||||
* @return integer
|
||||
*/
|
||||
public function getFrames()
|
||||
{
|
||||
return $this->_frames;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the number of MPEG frames between reference.
|
||||
*
|
||||
|
||||
* @param integer $frames The number of MPEG frames.
|
||||
*/
|
||||
public function setFrames($frames)
|
||||
{
|
||||
$this->_frames = $frames;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the number of bytes between reference.
|
||||
*
|
||||
|
||||
* @return integer
|
||||
*/
|
||||
public function getBytes()
|
||||
{
|
||||
return $this->_bytes;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the number of bytes between reference.
|
||||
*
|
||||
|
||||
* @param integer $bytes The number of bytes.
|
||||
*/
|
||||
public function setBytes($bytes)
|
||||
{
|
||||
$this->_bytes = $bytes;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the number of milliseconds between references.
|
||||
*
|
||||
|
||||
* @return integer
|
||||
*/
|
||||
public function getMilliseconds()
|
||||
{
|
||||
return $this->_milliseconds;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the number of milliseconds between references.
|
||||
*
|
||||
|
||||
* @param integer $milliseconds The number of milliseconds.
|
||||
*/
|
||||
public function setMilliseconds($milliseconds)
|
||||
{
|
||||
return $this->_milliseconds;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the deviations as an array. Each value is an array containing two
|
||||
* values, ie the deviation in bytes, and the deviation in milliseconds,
|
||||
* respectively.
|
||||
*
|
||||
|
||||
* @return Array
|
||||
*/
|
||||
public function getDeviation()
|
||||
{
|
||||
return $this->_deviation;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the deviations array. The array must consist of arrays, each of
|
||||
* which having two values, the deviation in bytes, and the deviation in
|
||||
* milliseconds, respectively.
|
||||
*
|
||||
|
||||
* @param Array $deviation The deviations array.
|
||||
*/
|
||||
public function setDeviation($deviation)
|
||||
{
|
||||
$this->_deviation = $deviation;
|
||||
}
|
||||
}
|
||||
258
src/Zend/Media/Id3/Frame/Owne.php
Normal file
258
src/Zend/Media/Id3/Frame/Owne.php
Normal file
@@ -0,0 +1,258 @@
|
||||
<?php
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Media
|
||||
* @subpackage ID3
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
*/
|
||||
|
||||
/**#@+ @ignore */
|
||||
require_once 'Zend/Media/Id3/Frame.php';
|
||||
require_once 'Zend/Media/Id3/Encoding.php';
|
||||
/**#@-*/
|
||||
|
||||
/**
|
||||
* The <i>Ownership frame</i> might be used as a reminder of a made transaction
|
||||
* or, if signed, as proof. Note that the {@link Zend_Media_Id3_Frame_User USER}
|
||||
* and {@link Zend_Media_Id3_Frame_Town TOWN} frames are good to use in
|
||||
* conjunction with this one.
|
||||
*
|
||||
* There may only be one OWNE frame in a tag.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Media
|
||||
* @subpackage ID3
|
||||
* @author Sven Vollbehr <sven@vollbehr.eu>
|
||||
* @author Ryan Butterfield <buttza@gmail.com>
|
||||
* @copyright Copyright (c) 2005-2009 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_Id3_Frame_Owne extends Zend_Media_Id3_Frame
|
||||
implements Zend_Media_Id3_Encoding
|
||||
{
|
||||
/** @var integer */
|
||||
private $_encoding;
|
||||
|
||||
/** @var string */
|
||||
private $_currency = 'EUR';
|
||||
|
||||
/** @var string */
|
||||
private $_price;
|
||||
|
||||
/** @var string */
|
||||
private $_date;
|
||||
|
||||
/** @var string */
|
||||
private $_seller;
|
||||
|
||||
/**
|
||||
* 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);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the text encoding.
|
||||
*
|
||||
* All the strings read from a file are automatically converted to the
|
||||
* character encoding specified with the <var>encoding</var> option. See
|
||||
* {@link Zend_Media_Id3v2} for details. This method returns that character
|
||||
* encoding, or any value set after read, translated into a string form
|
||||
* regarless if it was set using a {@link Zend_Media_Id3_Encoding} constant
|
||||
* or a string.
|
||||
*
|
||||
* @return integer
|
||||
*/
|
||||
public function getEncoding()
|
||||
{
|
||||
return $this->_translateIntToEncoding($this->_encoding);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the text encoding.
|
||||
*
|
||||
* All the string written to the frame are done so using given character
|
||||
* encoding. No conversions of existing data take place upon the call to
|
||||
* this method thus all texts must be given in given character encoding.
|
||||
*
|
||||
* The character encoding parameter takes either a
|
||||
* {@link Zend_Media_Id3_Encoding} constant or a character set name string
|
||||
* in the form accepted by iconv. The default character encoding used to
|
||||
* write the frame is 'utf-8'.
|
||||
*
|
||||
* @see Zend_Media_Id3_Encoding
|
||||
* @param integer $encoding The text encoding.
|
||||
*/
|
||||
public function setEncoding($encoding)
|
||||
{
|
||||
$this->_encoding = $this->_translateEncodingToInt($encoding);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the currency code, encoded according to
|
||||
* {@link http://www.iso.org/iso/support/faqs/faqs_widely_used_standards/widely_used_standards_other/currency_codes/currency_codes_list-1.htm
|
||||
* ISO 4217} alphabetic currency code.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getCurrency()
|
||||
{
|
||||
return $this->_currency;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the currency used in transaction, encoded according to
|
||||
* {@link http://www.iso.org/iso/support/faqs/faqs_widely_used_standards/widely_used_standards_other/currency_codes/currency_codes_list-1.htm
|
||||
* ISO 4217} alphabetic currency code.
|
||||
*
|
||||
* @param string $currency The currency code.
|
||||
*/
|
||||
public function setCurrency($currency)
|
||||
{
|
||||
$this->_currency = strtoupper($currency);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the price.
|
||||
*
|
||||
* @return double
|
||||
*/
|
||||
public function getPrice()
|
||||
{
|
||||
return doubleval($this->_price);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the price.
|
||||
*
|
||||
* @param integer $price The price.
|
||||
*/
|
||||
public function setPrice($price)
|
||||
{
|
||||
$this->_price = number_format($price, 2, '.', '');
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the date describing for how long the price is valid.
|
||||
*
|
||||
* @internal The ID3v2 standard does not declare the time zone to be used
|
||||
* in the date. Date must thus be expressed as GMT/UTC.
|
||||
* @return Zend_Date
|
||||
*/
|
||||
public function getDate()
|
||||
{
|
||||
require_once 'Zend/Date.php';
|
||||
$date = new Zend_Date(0);
|
||||
$date->setTimezone('UTC');
|
||||
$date->set($this->_date, 'yyyyMMdd');
|
||||
return $date;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the date describing for how long the price is valid for.
|
||||
*
|
||||
* @internal The ID3v2 standard does not declare the time zone to be used
|
||||
* in the date. Date must thus be expressed as GMT/UTC.
|
||||
* @param Zend_Date $date The date.
|
||||
*/
|
||||
public function setDate($date)
|
||||
{
|
||||
require_once 'Zend/Date.php';
|
||||
if ($date === null) {
|
||||
$date = Zend_Date::now();
|
||||
}
|
||||
$date->setTimezone('UTC');
|
||||
$this->_date = $date->toString('yyyyMMdd');
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the name of the seller.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getSeller()
|
||||
{
|
||||
return $this->_seller;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the name of the seller using given encoding.
|
||||
*
|
||||
* @param string $seller The name of the seller.
|
||||
* @param integer $encoding The text encoding.
|
||||
*/
|
||||
public function setSeller($seller, $encoding = null)
|
||||
{
|
||||
$this->_seller = $seller;
|
||||
if ($encoding !== null) {
|
||||
$this->setEncoding($encoding);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Writes the frame raw data without the header.
|
||||
*
|
||||
* @param Zend_Io_Writer $writer The writer object.
|
||||
* @return void
|
||||
*/
|
||||
protected function _writeFrame($writer)
|
||||
{
|
||||
$writer->writeUInt8($this->_encoding)
|
||||
->write($this->_currency)
|
||||
->writeString8($this->_price, 1)
|
||||
->write($this->_date);
|
||||
switch ($this->_encoding) {
|
||||
case self::UTF16LE:
|
||||
$writer->writeString16
|
||||
($this->_seller, Zend_Io_Writer::LITTLE_ENDIAN_ORDER);
|
||||
break;
|
||||
case self::UTF16:
|
||||
// break intentionally omitted
|
||||
case self::UTF16BE:
|
||||
$writer->writeString16($this->_seller);
|
||||
break;
|
||||
default:
|
||||
$writer->writeString8($this->_seller);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
110
src/Zend/Media/Id3/Frame/Pcnt.php
Normal file
110
src/Zend/Media/Id3/Frame/Pcnt.php
Normal file
@@ -0,0 +1,110 @@
|
||||
<?php
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Media
|
||||
* @subpackage ID3
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
*/
|
||||
|
||||
/**#@+ @ignore */
|
||||
require_once 'Zend/Media/Id3/Frame.php';
|
||||
/**#@-*/
|
||||
|
||||
/**
|
||||
* The <i>Play counter</i> is simply a counter of the number of times a file has
|
||||
* been played. The value is increased by one every time the file begins to
|
||||
* play. There may only be one PCNT frame in each tag.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Media
|
||||
* @subpackage ID3
|
||||
* @author Sven Vollbehr <sven@vollbehr.eu>
|
||||
* @author Ryan Butterfield <buttza@gmail.com>
|
||||
* @copyright Copyright (c) 2005-2009 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_Id3_Frame_Pcnt extends Zend_Media_Id3_Frame
|
||||
{
|
||||
/** @var integer */
|
||||
private $_counter = 0;
|
||||
|
||||
/**
|
||||
* 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();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the counter.
|
||||
*
|
||||
* @return integer
|
||||
*/
|
||||
public function getCounter()
|
||||
{
|
||||
return $this->_counter;
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds counter by one.
|
||||
*/
|
||||
public function addCounter()
|
||||
{
|
||||
$this->_counter++;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the counter value.
|
||||
*
|
||||
* @param integer $counter The counter value.
|
||||
*/
|
||||
public function setCounter($counter)
|
||||
{
|
||||
$this->_counter = $counter;
|
||||
}
|
||||
|
||||
/**
|
||||
* Writes the frame raw data without the header.
|
||||
*
|
||||
* @param Zend_Io_Writer $writer The writer object.
|
||||
* @return void
|
||||
*/
|
||||
protected function _writeFrame($writer)
|
||||
{
|
||||
if ($this->_counter > 4294967295) {
|
||||
$writer->writeInt64BE($this->_counter); // UInt64
|
||||
} else {
|
||||
$writer->writeUInt32BE($this->_counter);
|
||||
}
|
||||
}
|
||||
}
|
||||
176
src/Zend/Media/Id3/Frame/Popm.php
Normal file
176
src/Zend/Media/Id3/Frame/Popm.php
Normal file
@@ -0,0 +1,176 @@
|
||||
<?php
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Media
|
||||
* @subpackage ID3
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
*/
|
||||
|
||||
/**#@+ @ignore */
|
||||
require_once 'Zend/Media/Id3/Frame.php';
|
||||
/**#@-*/
|
||||
|
||||
/**
|
||||
* The purpose of the <i>Popularimeter</i> frame is to specify how good an audio
|
||||
* file is. Many interesting applications could be found to this frame such as a
|
||||
* playlist that features better audio files more often than others or it could
|
||||
* be used to profile a person's taste and find other good files by comparing
|
||||
* people's profiles. The frame contains the email address to the user, one
|
||||
* rating byte and a four byte play counter, intended to be increased with one
|
||||
* for every time the file is played.
|
||||
*
|
||||
* The rating is 1-255 where 1 is worst and 255 is best. 0 is unknown. If no
|
||||
* personal counter is wanted it may be omitted. When the counter reaches all
|
||||
* one's, one byte is inserted in front of the counter thus making the counter
|
||||
* eight bits bigger in the same away as the play counter
|
||||
* {@link Zend_Media_Id3_Frame_Pcnt PCNT}. There may be more than one POPM frame
|
||||
* in each tag, but only one with the same email address.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Media
|
||||
* @subpackage ID3
|
||||
* @author Sven Vollbehr <sven@vollbehr.eu>
|
||||
* @author Ryan Butterfield <buttza@gmail.com>
|
||||
* @copyright Copyright (c) 2005-2009 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_Id3_Frame_Popm extends Zend_Media_Id3_Frame
|
||||
{
|
||||
/** @var string */
|
||||
private $_owner;
|
||||
|
||||
/** @var integer */
|
||||
private $_rating = 0;
|
||||
|
||||
/** @var integer */
|
||||
private $_counter = 0;
|
||||
|
||||
/**
|
||||
* 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();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 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)
|
||||
{
|
||||
return $this->_owner = $owner;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the user rating.
|
||||
*
|
||||
* @return integer
|
||||
*/
|
||||
public function getRating()
|
||||
{
|
||||
return $this->_rating;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the user rating.
|
||||
*
|
||||
* @param integer $rating The user rating.
|
||||
*/
|
||||
public function setRating($rating)
|
||||
{
|
||||
$this->_rating = $rating;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the counter.
|
||||
*
|
||||
* @return integer
|
||||
*/
|
||||
public function getCounter()
|
||||
{
|
||||
return $this->_counter;
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds counter by one.
|
||||
*/
|
||||
public function addCounter()
|
||||
{
|
||||
$this->_counter++;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the counter value.
|
||||
*
|
||||
* @param integer $counter The counter value.
|
||||
*/
|
||||
public function setCounter($counter)
|
||||
{
|
||||
$this->_counter = $counter;
|
||||
}
|
||||
|
||||
/**
|
||||
* Writes the frame raw data without the header.
|
||||
*
|
||||
* @param Zend_Io_Writer $writer The writer object.
|
||||
* @return void
|
||||
*/
|
||||
protected function _writeFrame($writer)
|
||||
{
|
||||
$writer->writeString8($this->_owner, 1)
|
||||
->writeInt8($this->_rating);
|
||||
if ($this->_counter > 0xffffffff) {
|
||||
$writer->writeInt64BE($this->_counter);
|
||||
} else if ($this->_counter > 0) {
|
||||
$writer->writeUInt32BE($this->_counter);
|
||||
}
|
||||
}
|
||||
}
|
||||
129
src/Zend/Media/Id3/Frame/Poss.php
Normal file
129
src/Zend/Media/Id3/Frame/Poss.php
Normal file
@@ -0,0 +1,129 @@
|
||||
<?php
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Media
|
||||
* @subpackage ID3
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
*/
|
||||
|
||||
/**#@+ @ignore */
|
||||
require_once 'Zend/Media/Id3/Frame.php';
|
||||
require_once 'Zend/Media/Id3/Timing.php';
|
||||
/**#@-*/
|
||||
|
||||
/**
|
||||
* The <i>Position synchronisation frame</i> delivers information to the
|
||||
* listener of how far into the audio stream he picked up; in effect, it states
|
||||
* the time offset from the first frame in the stream. There may only be one
|
||||
* POSS frame in each tag.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Media
|
||||
* @subpackage ID3
|
||||
* @author Sven Vollbehr <sven@vollbehr.eu>
|
||||
* @author Ryan Butterfield <buttza@gmail.com>
|
||||
* @copyright Copyright (c) 2005-2009 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_Id3_Frame_Poss extends Zend_Media_Id3_Frame
|
||||
implements Zend_Media_Id3_Timing
|
||||
{
|
||||
/** @var integer */
|
||||
private $_format = Zend_Media_Id3_Timing::MPEG_FRAMES;
|
||||
|
||||
/** @var integer */
|
||||
private $_position;
|
||||
|
||||
/**
|
||||
* 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();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the timing format.
|
||||
*
|
||||
* @return integer
|
||||
*/
|
||||
public function getFormat()
|
||||
{
|
||||
return $this->_format;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the timing format.
|
||||
*
|
||||
* @see Zend_Media_Id3_Timing
|
||||
* @param integer $format The timing format.
|
||||
*/
|
||||
public function setFormat($format)
|
||||
{
|
||||
$this->_format = $format;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the position where in the audio the listener starts to receive,
|
||||
* i.e. the beginning of the next frame.
|
||||
*
|
||||
* @return integer
|
||||
*/
|
||||
public function getPosition()
|
||||
{
|
||||
return $this->_position;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the position where in the audio the listener starts to receive,
|
||||
* i.e. the beginning of the next frame, using given format.
|
||||
*
|
||||
* @param integer $position The position.
|
||||
* @param integer $format The timing format.
|
||||
*/
|
||||
public function setPosition($position, $format = null)
|
||||
{
|
||||
$this->_position = $position;
|
||||
if ($format !== null) {
|
||||
$this->setFormat($format);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Writes the frame raw data without the header.
|
||||
*
|
||||
* @param Zend_Io_Writer $writer The writer object.
|
||||
* @return void
|
||||
*/
|
||||
protected function _writeFrame($writer)
|
||||
{
|
||||
$writer->writeUInt8($this->_format)
|
||||
->writeUInt32BE($this->_position);
|
||||
}
|
||||
}
|
||||
125
src/Zend/Media/Id3/Frame/Priv.php
Normal file
125
src/Zend/Media/Id3/Frame/Priv.php
Normal file
@@ -0,0 +1,125 @@
|
||||
<?php
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Media
|
||||
* @subpackage ID3
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
*/
|
||||
|
||||
/**#@+ @ignore */
|
||||
require_once 'Zend/Media/Id3/Frame.php';
|
||||
/**#@-*/
|
||||
|
||||
/**
|
||||
* The <i>Private frame</i> is used to contain information from a software
|
||||
* producer that its program uses and does not fit into the other frames. The
|
||||
* frame consists of an owner identifier string and the binary data. The owner
|
||||
* identifier is 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 the frame. Questions regarding the frame should be sent to the indicated
|
||||
* email address. The tag may contain more than one PRIV frame but only with
|
||||
* different contents.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Media
|
||||
* @subpackage ID3
|
||||
* @author Sven Vollbehr <sven@vollbehr.eu>
|
||||
* @author Ryan Butterfield <buttza@gmail.com>
|
||||
* @copyright Copyright (c) 2005-2009 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_Id3_Frame_Priv extends Zend_Media_Id3_Frame
|
||||
{
|
||||
/** @var string */
|
||||
private $_owner;
|
||||
|
||||
/** @var string */
|
||||
private $_data;
|
||||
|
||||
/**
|
||||
* 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->_data) =
|
||||
$this->_explodeString8
|
||||
($this->_reader->read($this->_reader->getSize()), 2);
|
||||
}
|
||||
|
||||
/**
|
||||
* 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 private binary data associated with the frame.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getData()
|
||||
{
|
||||
return $this->_data;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the private binary data associated with the frame.
|
||||
*
|
||||
* @param string $data The private binary data string.
|
||||
*/
|
||||
public function setData($data)
|
||||
{
|
||||
$this->_data = $data;
|
||||
}
|
||||
|
||||
/**
|
||||
* Writes the frame raw data without the header.
|
||||
*
|
||||
* @param Zend_Io_Writer $writer The writer object.
|
||||
* @return void
|
||||
*/
|
||||
protected function _writeFrame($writer)
|
||||
{
|
||||
$writer->writeString8($this->_owner, 1)
|
||||
->write($this->_data);
|
||||
}
|
||||
}
|
||||
190
src/Zend/Media/Id3/Frame/Rbuf.php
Normal file
190
src/Zend/Media/Id3/Frame/Rbuf.php
Normal file
@@ -0,0 +1,190 @@
|
||||
<?php
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Media
|
||||
* @subpackage ID3
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
*/
|
||||
|
||||
/**#@+ @ignore */
|
||||
require_once 'Zend/Media/Id3/Frame.php';
|
||||
/**#@-*/
|
||||
|
||||
/**
|
||||
* Sometimes the server from which an audio file is streamed is aware of
|
||||
* transmission or coding problems resulting in interruptions in the audio
|
||||
* stream. In these cases, the size of the buffer can be recommended by the
|
||||
* server using the <i>Recommended buffer size</i> frame. If the embedded info
|
||||
* flag is set then this indicates that an ID3 tag with the maximum size
|
||||
* described in buffer size may occur in the audio stream. In such case the tag
|
||||
* should reside between two MPEG frames, if the audio is MPEG encoded. If the
|
||||
* position of the next tag is known, offset to next tag may be used. The offset
|
||||
* is calculated from the end of tag in which this frame resides to the first
|
||||
* byte of the header in the next. This field may be omitted. Embedded tags are
|
||||
* generally not recommended since this could render unpredictable behaviour
|
||||
* from present software/hardware.
|
||||
*
|
||||
* For applications like streaming audio it might be an idea to embed tags into
|
||||
* the audio stream though. If the clients connects to individual connections
|
||||
* like HTTP and there is a possibility to begin every transmission with a tag,
|
||||
* then this tag should include a recommended buffer size frame. If the client
|
||||
* is connected to a arbitrary point in the stream, such as radio or multicast,
|
||||
* then the recommended buffer size frame should be included in every tag.
|
||||
*
|
||||
* The buffer size should be kept to a minimum. There may only be one RBUF
|
||||
* frame in each tag.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Media
|
||||
* @subpackage ID3
|
||||
* @author Sven Vollbehr <sven@vollbehr.eu>
|
||||
* @author Ryan Butterfield <buttza@gmail.com>
|
||||
* @copyright Copyright (c) 2005-2009 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_Id3_Frame_Rbuf extends Zend_Media_Id3_Frame
|
||||
{
|
||||
/**
|
||||
* A flag to denote that an ID3 tag with the maximum size described in
|
||||
* buffer size may occur in the audio stream.
|
||||
*/
|
||||
const EMBEDDED = 0x1;
|
||||
|
||||
/** @var integer */
|
||||
private $_bufferSize;
|
||||
|
||||
/** @var integer */
|
||||
private $_infoFlags;
|
||||
|
||||
/** @var integer */
|
||||
private $_offset = 0;
|
||||
|
||||
/**
|
||||
* 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
|
||||
("\0" . $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();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the buffer size.
|
||||
*
|
||||
* @return integer
|
||||
*/
|
||||
public function getBufferSize()
|
||||
{
|
||||
return $this->_bufferSize;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the buffer size.
|
||||
*
|
||||
* @param integer $size The buffer size.
|
||||
*/
|
||||
public function setBufferSize($bufferSize)
|
||||
{
|
||||
$this->_bufferSize = $bufferSize;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks whether or not the flag is set. Returns <var>true</var> if the
|
||||
* flag is set, <var>false</var> otherwise.
|
||||
*
|
||||
* @param integer $flag The flag to query.
|
||||
* @return boolean
|
||||
*/
|
||||
public function hasInfoFlag($flag)
|
||||
{
|
||||
return ($this->_infoFlags & $flag) == $flag;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the flags byte.
|
||||
*
|
||||
* @return integer
|
||||
*/
|
||||
public function getInfoFlags()
|
||||
{
|
||||
return $this->_infoFlags;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the flags byte.
|
||||
*
|
||||
* @param string $flags The flags byte.
|
||||
*/
|
||||
public function setInfoFlags($infoFlags)
|
||||
{
|
||||
$this->_infoFlags = $infoFlags;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the offset to next tag.
|
||||
*
|
||||
* @return integer
|
||||
*/
|
||||
public function getOffset()
|
||||
{
|
||||
return $this->_offset;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the offset to next tag.
|
||||
*
|
||||
* @param integer $offset The offset.
|
||||
*/
|
||||
public function setOffset($offset)
|
||||
{
|
||||
$this->_offset = $offset;
|
||||
}
|
||||
|
||||
/**
|
||||
* Writes the frame raw data without the header.
|
||||
*
|
||||
* @param Zend_Io_Writer $writer The writer object.
|
||||
* @return void
|
||||
*/
|
||||
protected function _writeFrame($writer)
|
||||
{
|
||||
$tmp = new Zend_Io_StringWriter();
|
||||
$tmp->writeUInt32BE($this->_bufferSize);
|
||||
|
||||
$writer->write(substr($tmp->toString(), 1, 3))
|
||||
->writeInt8($this->_infoFlags)
|
||||
->writeInt32BE($this->_offset);
|
||||
}
|
||||
}
|
||||
213
src/Zend/Media/Id3/Frame/Rva2.php
Normal file
213
src/Zend/Media/Id3/Frame/Rva2.php
Normal file
@@ -0,0 +1,213 @@
|
||||
<?php
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Media
|
||||
* @subpackage ID3
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
* @since ID3v2.4.0
|
||||
*/
|
||||
|
||||
/**#@+ @ignore */
|
||||
require_once 'Zend/Media/Id3/Frame.php';
|
||||
/**#@-*/
|
||||
|
||||
/**
|
||||
* The <i>Relative volume adjustment (2)</i> frame is a more subjective frame
|
||||
* than the previous ones. It allows the user to say how much he wants to
|
||||
* increase/decrease the volume on each channel when the file is played. The
|
||||
* purpose is to be able to align all files to a reference volume, so that you
|
||||
* don't have to change the volume constantly. This frame may also be used to
|
||||
* balance adjust the audio.
|
||||
*
|
||||
* The volume adjustment is encoded in a way giving the scale of +/- 64 dB with
|
||||
* a precision of 0.001953125 dB.
|
||||
*
|
||||
* There may be more than one RVA2 frame in each tag, but only one with the same
|
||||
* identification string.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Media
|
||||
* @subpackage ID3
|
||||
* @author Sven Vollbehr <sven@vollbehr.eu>
|
||||
* @author Ryan Butterfield <buttza@gmail.com>
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
* @since ID3v2.4.0
|
||||
*/
|
||||
final class Zend_Media_Id3_Frame_Rva2 extends Zend_Media_Id3_Frame
|
||||
{
|
||||
/**
|
||||
* The channel type key.
|
||||
*
|
||||
* @see $types
|
||||
* @var string
|
||||
*/
|
||||
const channelType = 'channelType';
|
||||
|
||||
/**
|
||||
* The volume adjustment key. Adjustments are +/- 64 dB with a precision of
|
||||
* 0.001953125 dB.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
const volumeAdjustment = 'volumeAdjustment';
|
||||
|
||||
/**
|
||||
* The peak volume key.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
const peakVolume = 'peakVolume';
|
||||
|
||||
/**
|
||||
* The list of channel types.
|
||||
*
|
||||
* @var Array
|
||||
*/
|
||||
public static $types = array
|
||||
('Other', 'Master volume', 'Front right', 'Front left', 'Back right',
|
||||
'Back left', 'Front centre', 'Back centre', 'Subwoofer');
|
||||
|
||||
/** @var string */
|
||||
private $_device;
|
||||
|
||||
/** @var Array */
|
||||
private $_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;
|
||||
}
|
||||
|
||||
list ($this->_device) =
|
||||
$this->_explodeString8
|
||||
($this->_reader->read($this->_reader->getSize()), 2);
|
||||
$this->_reader->setOffset(strlen($this->_device) + 1);
|
||||
|
||||
for ($i = $j = 0; $i < 9; $i++) {
|
||||
$this->_adjustments[$i] = array
|
||||
(self::channelType => $this->_reader->readInt8(),
|
||||
self::volumeAdjustment =>
|
||||
$this->_reader->readInt16BE() / 512.0);
|
||||
$bitsInPeak = $this->_reader->readInt8();
|
||||
$bytesInPeak = $bitsInPeak > 0 ? ceil($bitsInPeak / 8) : 0;
|
||||
switch ($bytesInPeak) {
|
||||
case 8:
|
||||
$this->_adjustments[$i][self::peakVolume] =
|
||||
$this->_reader->readInt64BE();
|
||||
break;
|
||||
case 4:
|
||||
$this->_adjustments[$i][self::peakVolume] =
|
||||
$this->_reader->readUInt32BE();
|
||||
break;
|
||||
case 2:
|
||||
$this->_adjustments[$i][self::peakVolume] =
|
||||
$this->_reader->readUInt16BE();
|
||||
break;
|
||||
case 1:
|
||||
$this->_adjustments[$i][self::peakVolume] =
|
||||
$this->_reader->readUInt8();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the device where the adjustments should apply.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getDevice()
|
||||
{
|
||||
return $this->_device;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the device where the adjustments should apply.
|
||||
*
|
||||
* @param string $device The device.
|
||||
*/
|
||||
public function setDevice($device)
|
||||
{
|
||||
$this->_device = $device;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the array containing volume adjustments for each channel. Volume
|
||||
* adjustments are arrays themselves containing the following keys:
|
||||
* channelType, volumeAdjustment, peakVolume.
|
||||
*
|
||||
* @return Array
|
||||
*/
|
||||
public function getAdjustments()
|
||||
{
|
||||
return $this->_adjustments;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the array of volume adjustments for each channel. Each volume
|
||||
* adjustment is an array too containing the following keys: channelType,
|
||||
* volumeAdjustment, peakVolume.
|
||||
*
|
||||
* @param Array $adjustments The volume adjustments array.
|
||||
*/
|
||||
public function setAdjustments($adjustments)
|
||||
{
|
||||
$this->_adjustments = $adjustments;
|
||||
}
|
||||
|
||||
/**
|
||||
* Writes the frame raw data without the header.
|
||||
*
|
||||
* @param Zend_Io_Writer $writer The writer object.
|
||||
* @return void
|
||||
*/
|
||||
protected function _writeFrame($writer)
|
||||
{
|
||||
$writer->writeString8($this->_device, 1);
|
||||
foreach ($this->_adjustments as $channel) {
|
||||
$writer->writeInt8($channel[self::channelType])
|
||||
->writeInt16BE($channel[self::volumeAdjustment] * 512);
|
||||
if (abs($channel[self::peakVolume]) <= 0xff) {
|
||||
$writer->writeInt8(8)
|
||||
->writeUInt8($channel[self::peakVolume]);
|
||||
} else if (abs($channel[self::peakVolume]) <= 0xffff) {
|
||||
$writer->writeInt8(16)
|
||||
->writeUInt16BE($channel[self::peakVolume]);
|
||||
} else if (abs($channel[self::peakVolume]) <= 0xffffffff) {
|
||||
$writer->writeInt8(32)
|
||||
->writeUInt32BE($channel[self::peakVolume]);
|
||||
} else {
|
||||
$writer->writeInt8(64)
|
||||
->writeInt64BE($channel[self::peakVolume]); // UInt64
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
238
src/Zend/Media/Id3/Frame/Rvad.php
Normal file
238
src/Zend/Media/Id3/Frame/Rvad.php
Normal file
@@ -0,0 +1,238 @@
|
||||
<?php
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Media
|
||||
* @subpackage ID3
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
* @deprecated ID3v2.3.0
|
||||
*/
|
||||
|
||||
/**#@+ @ignore */
|
||||
require_once 'Zend/Media/Id3/Frame.php';
|
||||
/**#@-*/
|
||||
|
||||
/**
|
||||
* The <i>Relative volume adjustment</i> frame is a more subjective function
|
||||
* than the previous ones. It allows the user to say how much he wants to
|
||||
* increase/decrease the volume on each channel while the file is played. The
|
||||
* purpose is to be able to align all files to a reference volume, so that you
|
||||
* don't have to change the volume constantly. This frame may also be used to
|
||||
* balance adjust the audio.
|
||||
*
|
||||
* There may only be one RVAD frame in each tag.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Media
|
||||
* @subpackage ID3
|
||||
* @author Sven Vollbehr <sven@vollbehr.eu>
|
||||
* @author Ryan Butterfield <buttza@gmail.com>
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
* @deprecated ID3v2.3.0
|
||||
*/
|
||||
final class Zend_Media_Id3_Frame_Rvad extends Zend_Media_Id3_Frame
|
||||
{
|
||||
/* The required keys. */
|
||||
|
||||
/** @var string */
|
||||
const right = 'right';
|
||||
|
||||
/** @var string */
|
||||
const left = 'left';
|
||||
|
||||
/** @var string */
|
||||
const peakRight = 'peakRight';
|
||||
|
||||
/** @var string */
|
||||
const peakLeft = 'peakLeft';
|
||||
|
||||
/* The optional keys. */
|
||||
|
||||
/** @var string */
|
||||
const rightBack = 'rightBack';
|
||||
|
||||
/** @var string */
|
||||
const leftBack = 'leftBack';
|
||||
|
||||
/** @var string */
|
||||
const peakRightBack = 'peakRightBack';
|
||||
|
||||
/** @var string */
|
||||
const peakLeftBack = 'peakLeftBack';
|
||||
|
||||
/** @var string */
|
||||
const center = 'center';
|
||||
|
||||
/** @var string */
|
||||
const peakCenter = 'peakCenter';
|
||||
|
||||
/** @var string */
|
||||
const bass = 'bass';
|
||||
|
||||
/** @var string */
|
||||
const peakBass = 'peakBass';
|
||||
|
||||
/** @var Array */
|
||||
private $_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;
|
||||
}
|
||||
|
||||
$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();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the array containing the volume adjustments. The array must
|
||||
* contain the following keys: right, left, peakRight, peakLeft. It may
|
||||
* optionally contain the following keys: rightBack, leftBack,
|
||||
* peakRightBack, peakLeftBack, center, peakCenter, bass, and peakBass.
|
||||
*
|
||||
* @return Array
|
||||
*/
|
||||
public function getAdjustments()
|
||||
{
|
||||
return $this->_adjustments;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the array of volume adjustments. The array must contain the
|
||||
* following keys: right, left, peakRight, peakLeft. It may optionally
|
||||
* contain the following keys: rightBack, leftBack, peakRightBack,
|
||||
* peakLeftBack, center, peakCenter, bass, and peakBass.
|
||||
*
|
||||
* @param Array $adjustments The volume adjustments array.
|
||||
*/
|
||||
public function setAdjustments($adjustments)
|
||||
{
|
||||
$this->_adjustments = $adjustments;
|
||||
}
|
||||
|
||||
/**
|
||||
* Writes the frame raw data without the header.
|
||||
*
|
||||
* @param Zend_Io_Writer $writer The writer object.
|
||||
* @return void
|
||||
*/
|
||||
protected function _writeFrame($writer)
|
||||
{
|
||||
$writer->writeInt8($flags = 0);
|
||||
if ($this->_adjustments[self::right] > 0)
|
||||
$flags = $flags | 0x1;
|
||||
if ($this->_adjustments[self::left] > 0)
|
||||
$flags = $flags | 0x2;
|
||||
$writer->writeInt8(16)
|
||||
->writeUInt16BE(abs($this->_adjustments[self::right]))
|
||||
->writeUInt16BE(abs($this->_adjustments[self::left]))
|
||||
->writeUInt16BE(abs($this->_adjustments[self::peakRight]))
|
||||
->writeUInt16BE(abs($this->_adjustments[self::peakLeft]));
|
||||
|
||||
if (isset($this->_adjustments[self::rightBack]) &&
|
||||
isset($this->_adjustments[self::leftBack]) &&
|
||||
isset($this->_adjustments[self::peakRightBack]) &&
|
||||
isset($this->_adjustments[self::peakLeftBack])) {
|
||||
if ($this->_adjustments[self::rightBack] > 0)
|
||||
$flags = $flags | 0x4;
|
||||
if ($this->_adjustments[self::leftBack] > 0)
|
||||
$flags = $flags | 0x8;
|
||||
$writer->writeUInt16BE(abs($this->_adjustments[self::rightBack]))
|
||||
->writeUInt16BE(abs($this->_adjustments[self::leftBack]))
|
||||
->writeUInt16BE
|
||||
(abs($this->_adjustments[self::peakRightBack]))
|
||||
->writeUInt16BE
|
||||
(abs($this->_adjustments[self::peakLeftBack]));
|
||||
}
|
||||
|
||||
if (isset($this->_adjustments[self::center]) &&
|
||||
isset($this->_adjustments[self::peakCenter])) {
|
||||
if ($this->_adjustments[self::center] > 0)
|
||||
$flags = $flags | 0x10;
|
||||
$writer->writeUInt16BE(abs($this->_adjustments[self::center]))
|
||||
->writeUInt16BE(abs($this->_adjustments[self::peakCenter]));
|
||||
}
|
||||
|
||||
if (isset($this->_adjustments[self::bass]) &&
|
||||
isset($this->_adjustments[self::peakBass])) {
|
||||
if ($this->_adjustments[self::bass] > 0)
|
||||
$flags = $flags | 0x20;
|
||||
$writer->writeUInt16BE(abs($this->_adjustments[self::bass]))
|
||||
->writeUInt16BE(abs($this->_adjustments[self::peakBass]));
|
||||
}
|
||||
$writer->setOffset(0);
|
||||
$writer->writeInt8($flags);
|
||||
}
|
||||
}
|
||||
331
src/Zend/Media/Id3/Frame/Rvrb.php
Normal file
331
src/Zend/Media/Id3/Frame/Rvrb.php
Normal file
@@ -0,0 +1,331 @@
|
||||
<?php
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Media
|
||||
* @subpackage ID3
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
*/
|
||||
|
||||
/**#@+ @ignore */
|
||||
require_once 'Zend/Media/Id3/Frame.php';
|
||||
/**#@-*/
|
||||
|
||||
/**
|
||||
* The <i>Reverb</i> is yet another subjective frame, with which you can adjust
|
||||
* echoes of different kinds. Reverb left/right is the delay between every
|
||||
* bounce in milliseconds. Reverb bounces left/right is the number of bounces
|
||||
* that should be made. $FF equals an infinite number of bounces. Feedback is
|
||||
* the amount of volume that should be returned to the next echo bounce. $00 is
|
||||
* 0%, $FF is 100%. If this value were $7F, there would be 50% volume reduction
|
||||
* on the first bounce, 50% of that on the second and so on. Left to left means
|
||||
* the sound from the left bounce to be played in the left speaker, while left
|
||||
* to right means sound from the left bounce to be played in the right speaker.
|
||||
*
|
||||
* Premix left to right is the amount of left sound to be mixed in the right
|
||||
* before any reverb is applied, where $00 id 0% and $FF is 100%. Premix right
|
||||
* to left does the same thing, but right to left. Setting both premix to $FF
|
||||
* would result in a mono output (if the reverb is applied symmetric). There
|
||||
* may only be one RVRB frame in each tag.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Media
|
||||
* @subpackage ID3
|
||||
* @author Sven Vollbehr <sven@vollbehr.eu>
|
||||
* @author Ryan Butterfield <buttza@gmail.com>
|
||||
* @copyright Copyright (c) 2005-2009 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_Id3_Frame_Rvrb extends Zend_Media_Id3_Frame
|
||||
{
|
||||
/** @var integer */
|
||||
private $_reverbLeft;
|
||||
|
||||
/** @var integer */
|
||||
private $_reverbRight;
|
||||
|
||||
/** @var integer */
|
||||
private $_reverbBouncesLeft;
|
||||
|
||||
/** @var integer */
|
||||
private $_reverbBouncesRight;
|
||||
|
||||
/** @var integer */
|
||||
private $_reverbFeedbackLtoL;
|
||||
|
||||
/** @var integer */
|
||||
private $_reverbFeedbackLtoR;
|
||||
|
||||
/** @var integer */
|
||||
private $_reverbFeedbackRtoR;
|
||||
|
||||
/** @var integer */
|
||||
private $_reverbFeedbackRtoL;
|
||||
|
||||
/** @var integer */
|
||||
private $_premixLtoR;
|
||||
|
||||
/** @var integer */
|
||||
private $_premixRtoL;
|
||||
|
||||
/**
|
||||
* 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();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the left reverb.
|
||||
*
|
||||
* @return integer
|
||||
*/
|
||||
public function getReverbLeft()
|
||||
{
|
||||
return $this->_reverbLeft;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the left reverb.
|
||||
*
|
||||
* @param integer $reverbLeft The left reverb.
|
||||
*/
|
||||
public function setReverbLeft($reverbLeft)
|
||||
{
|
||||
return $this->_reverbLeft = $reverbLeft;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the right reverb.
|
||||
*
|
||||
* @return integer
|
||||
*/
|
||||
public function getReverbRight()
|
||||
{
|
||||
return $this->_reverbRight;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the right reverb.
|
||||
*
|
||||
* @param integer $reverbRight The right reverb.
|
||||
*/
|
||||
public function setReverbRight($reverbRight)
|
||||
{
|
||||
return $this->_reverbRight = $reverbRight;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the left reverb bounces.
|
||||
*
|
||||
* @return integer
|
||||
*/
|
||||
public function getReverbBouncesLeft()
|
||||
{
|
||||
return $this->_reverbBouncesLeft;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the left reverb bounces.
|
||||
*
|
||||
* @param integer $reverbBouncesLeft The left reverb bounces.
|
||||
*/
|
||||
public function setReverbBouncesLeft($reverbBouncesLeft)
|
||||
{
|
||||
$this->_reverbBouncesLeft = $reverbBouncesLeft;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the right reverb bounces.
|
||||
*
|
||||
* @return integer
|
||||
*/
|
||||
public function getReverbBouncesRight()
|
||||
{
|
||||
return $this->_reverbBouncesRight;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the right reverb bounces.
|
||||
*
|
||||
* @param integer $reverbBouncesRight The right reverb bounces.
|
||||
*/
|
||||
public function setReverbBouncesRight($reverbBouncesRight)
|
||||
{
|
||||
$this->_reverbBouncesRight = $reverbBouncesRight;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the left-to-left reverb feedback.
|
||||
*
|
||||
* @return integer
|
||||
*/
|
||||
public function getReverbFeedbackLtoL()
|
||||
{
|
||||
return $this->_reverbFeedbackLtoL;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the left-to-left reverb feedback.
|
||||
*
|
||||
* @param integer $reverbFeedbackLtoL The left-to-left reverb feedback.
|
||||
*/
|
||||
public function setReverbFeedbackLtoL($reverbFeedbackLtoL)
|
||||
{
|
||||
$this->_reverbFeedbackLtoL = $reverbFeedbackLtoL;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the left-to-right reverb feedback.
|
||||
*
|
||||
* @return integer
|
||||
*/
|
||||
public function getReverbFeedbackLtoR()
|
||||
{
|
||||
return $this->_reverbFeedbackLtoR;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the left-to-right reverb feedback.
|
||||
*
|
||||
* @param integer $reverbFeedbackLtoR The left-to-right reverb feedback.
|
||||
*/
|
||||
public function setReverbFeedbackLtoR($reverbFeedbackLtoR)
|
||||
{
|
||||
$this->_reverbFeedbackLtoR = $reverbFeedbackLtoR;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the right-to-right reverb feedback.
|
||||
*
|
||||
* @return integer
|
||||
*/
|
||||
public function getReverbFeedbackRtoR()
|
||||
{
|
||||
return $this->_reverbFeedbackRtoR;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the right-to-right reverb feedback.
|
||||
*
|
||||
* @param integer $reverbFeedbackRtoR The right-to-right reverb feedback.
|
||||
*/
|
||||
public function setReverbFeedbackRtoR($reverbFeedbackRtoR)
|
||||
{
|
||||
$this->_reverbFeedbackRtoR = $reverbFeedbackRtoR;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the right-to-left reverb feedback.
|
||||
*
|
||||
* @return integer
|
||||
*/
|
||||
public function getReverbFeedbackRtoL()
|
||||
{
|
||||
return $this->_reverbFeedbackRtoL;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the right-to-left reverb feedback.
|
||||
*
|
||||
* @param integer $reverbFeedbackRtoL The right-to-left reverb feedback.
|
||||
*/
|
||||
public function setReverbFeedbackRtoL($reverbFeedbackRtoL)
|
||||
{
|
||||
$this->_reverbFeedbackRtoL = $reverbFeedbackRtoL;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the left-to-right premix.
|
||||
*
|
||||
* @return integer
|
||||
*/
|
||||
public function getPremixLtoR()
|
||||
{
|
||||
return $this->_premixLtoR;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the left-to-right premix.
|
||||
*
|
||||
* @param integer $premixLtoR The left-to-right premix.
|
||||
*/
|
||||
public function setPremixLtoR($premixLtoR)
|
||||
{
|
||||
$this->_premixLtoR = $premixLtoR;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the right-to-left premix.
|
||||
*
|
||||
* @return integer
|
||||
*/
|
||||
public function getPremixRtoL()
|
||||
{
|
||||
return $this->_premixRtoL;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the right-to-left premix.
|
||||
*
|
||||
* @param integer $premixRtoL The right-to-left premix.
|
||||
*/
|
||||
public function setPremixRtoL($premixRtoL)
|
||||
{
|
||||
$this->_premixRtoL = $premixRtoL;
|
||||
}
|
||||
|
||||
/**
|
||||
* Writes the frame raw data without the header.
|
||||
*
|
||||
* @param Zend_Io_Writer $writer The writer object.
|
||||
* @return void
|
||||
*/
|
||||
protected function _writeFrame($writer)
|
||||
{
|
||||
$writer->writeUInt16BE($this->_reverbLeft)
|
||||
->writeUInt16BE($this->_reverbRight)
|
||||
->writeUInt8($this->_reverbBouncesLeft)
|
||||
->writeUInt8($this->_reverbBouncesRight)
|
||||
->writeUInt8($this->_reverbFeedbackLtoL)
|
||||
->writeUInt8($this->_reverbFeedbackLtoR)
|
||||
->writeUInt8($this->_reverbFeedbackRtoR)
|
||||
->writeUInt8($this->_reverbFeedbackRtoL)
|
||||
->writeUInt8($this->_premixLtoR)
|
||||
->writeUInt8($this->_premixRtoL);
|
||||
}
|
||||
}
|
||||
95
src/Zend/Media/Id3/Frame/Seek.php
Normal file
95
src/Zend/Media/Id3/Frame/Seek.php
Normal file
@@ -0,0 +1,95 @@
|
||||
<?php
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Media
|
||||
* @subpackage ID3
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
* @since ID3v2.4.0
|
||||
*/
|
||||
|
||||
/**#@+ @ignore */
|
||||
require_once 'Zend/Media/Id3/Frame.php';
|
||||
/**#@-*/
|
||||
|
||||
/**
|
||||
* The <i>Seek</i> frame indicates where other tags in a file/stream can be
|
||||
* found. The minimum offset to next tag is calculated from the end of this tag
|
||||
* to the beginning of the next. There may only be one seek frame in a tag.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Media
|
||||
* @subpackage ID3
|
||||
* @author Sven Vollbehr <sven@vollbehr.eu>
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
* @since ID3v2.4.0
|
||||
*/
|
||||
final class Zend_Media_Id3_Frame_Seek extends Zend_Media_Id3_Frame
|
||||
{
|
||||
/** @var integer */
|
||||
private $_minOffset;
|
||||
|
||||
/**
|
||||
* 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();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the minimum offset to next tag in bytes.
|
||||
*
|
||||
* @return integer
|
||||
*/
|
||||
public function getMinimumOffset()
|
||||
{
|
||||
return $this->_minOffset;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the minimum offset to next tag in bytes.
|
||||
*
|
||||
* @param integer $minOffset The minimum offset.
|
||||
*/
|
||||
public function setMinimumOffset($minOffset)
|
||||
{
|
||||
$this->_minOffset = $minOffset;
|
||||
}
|
||||
|
||||
/**
|
||||
* Writes the frame raw data without the header.
|
||||
*
|
||||
* @param Zend_Io_Writer $writer The writer object.
|
||||
* @return void
|
||||
*/
|
||||
protected function _writeFrame($writer)
|
||||
{
|
||||
$writer->writeInt32BE($this->_minOffset);
|
||||
}
|
||||
}
|
||||
123
src/Zend/Media/Id3/Frame/Sign.php
Normal file
123
src/Zend/Media/Id3/Frame/Sign.php
Normal file
@@ -0,0 +1,123 @@
|
||||
<?php
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Media
|
||||
* @subpackage ID3
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
* @since ID3v2.4.0
|
||||
*/
|
||||
|
||||
/**#@+ @ignore */
|
||||
require_once 'Zend/Media/Id3/Frame.php';
|
||||
/**#@-*/
|
||||
|
||||
/**
|
||||
* This frame enables a group of frames, grouped with the
|
||||
* <i>Group identification registration</i>, to be signed. Although signatures
|
||||
* can reside inside the registration frame, it might be desired to store the
|
||||
* signature elsewhere, e.g. in watermarks. There may be more than one signature
|
||||
* frame in a tag, but no two may be identical.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Media
|
||||
* @subpackage ID3
|
||||
* @author Sven Vollbehr <sven@vollbehr.eu>
|
||||
* @author Ryan Butterfield <buttza@gmail.com>
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
* @since ID3v2.4.0
|
||||
*/
|
||||
final class Zend_Media_Id3_Frame_Sign extends Zend_Media_Id3_Frame
|
||||
{
|
||||
/** @var integer */
|
||||
private $_group;
|
||||
|
||||
/** @var string */
|
||||
private $_signature;
|
||||
|
||||
/**
|
||||
* 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());
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the group symbol byte.
|
||||
*
|
||||
* @return integer
|
||||
*/
|
||||
public function getGroup()
|
||||
{
|
||||
return $this->_group;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the group symbol byte.
|
||||
*
|
||||
* @param integer $group The group symbol byte.
|
||||
*/
|
||||
public function setGroup($group)
|
||||
{
|
||||
$this->_group = $group;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the signature binary data.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getSignature()
|
||||
{
|
||||
return $this->_signature;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the signature binary data.
|
||||
*
|
||||
* @param string $signature The signature binary data string.
|
||||
*/
|
||||
public function setSignature($signature)
|
||||
{
|
||||
$this->_signature = $signature;
|
||||
}
|
||||
|
||||
/**
|
||||
* Writes the frame raw data without the header.
|
||||
*
|
||||
* @param Zend_Io_Writer $writer The writer object.
|
||||
* @return void
|
||||
*/
|
||||
protected function _writeFrame($writer)
|
||||
{
|
||||
$writer->writeUInt8($this->_group)
|
||||
->write($this->_signature);
|
||||
}
|
||||
}
|
||||
371
src/Zend/Media/Id3/Frame/Sylt.php
Normal file
371
src/Zend/Media/Id3/Frame/Sylt.php
Normal file
@@ -0,0 +1,371 @@
|
||||
<?php
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Media
|
||||
* @subpackage ID3
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
*/
|
||||
|
||||
/**#@+ @ignore */
|
||||
require_once 'Zend/Media/Id3/Frame.php';
|
||||
require_once 'Zend/Media/Id3/Encoding.php';
|
||||
require_once 'Zend/Media/Id3/Language.php';
|
||||
require_once 'Zend/Media/Id3/Timing.php';
|
||||
/**#@-*/
|
||||
|
||||
/**
|
||||
* The <i>Synchronised lyrics/text</i> frame is another way of incorporating the
|
||||
* words, said or sung lyrics, in the audio file as text, this time, however,
|
||||
* in sync with the audio. It might also be used to describing events e.g.
|
||||
* occurring on a stage or on the screen in sync with the audio.
|
||||
*
|
||||
* There may be more than one SYLT frame in each tag, but only one with the
|
||||
* same language and content descriptor.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Media
|
||||
* @subpackage ID3
|
||||
* @author Sven Vollbehr <sven@vollbehr.eu>
|
||||
* @author Ryan Butterfield <buttza@gmail.com>
|
||||
* @copyright Copyright (c) 2005-2009 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_Id3_Frame_SYLT extends Zend_Media_Id3_Frame
|
||||
implements Zend_Media_Id3_Encoding, Zend_Media_Id3_Language,
|
||||
Zend_Media_Id3_Timing
|
||||
{
|
||||
/**
|
||||
* The list of content types.
|
||||
*
|
||||
* @var Array
|
||||
*/
|
||||
public static $types = array
|
||||
('Other', 'Lyrics', 'Text transcription', 'Movement/Part name',
|
||||
'Events', 'Chord', 'Trivia', 'URLs to webpages', 'URLs to images');
|
||||
|
||||
/** @var integer */
|
||||
private $_encoding;
|
||||
|
||||
/** @var string */
|
||||
private $_language = 'und';
|
||||
|
||||
/** @var integer */
|
||||
private $_format = Zend_Media_Id3_Timing::MPEG_FRAMES;
|
||||
|
||||
/** @var integer */
|
||||
private $_type = 0;
|
||||
|
||||
/** @var string */
|
||||
private $_description;
|
||||
|
||||
/** @var Array */
|
||||
private $_events = array();
|
||||
|
||||
/**
|
||||
* 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';
|
||||
}
|
||||
$this->_format = $this->_reader->readUInt8();
|
||||
$this->_type = $this->_reader->readUInt8();
|
||||
|
||||
$offset = $this->_reader->getOffset();
|
||||
switch ($encoding) {
|
||||
case self::UTF16:
|
||||
// break intentionally omitted
|
||||
case self::UTF16BE:
|
||||
list($this->_description) =
|
||||
$this->_explodeString16
|
||||
($this->_reader->read($this->_reader->getSize()), 2);
|
||||
$this->_reader->setOffset
|
||||
($offset + strlen($this->_description) + 2);
|
||||
break;
|
||||
case self::UTF8:
|
||||
// break intentionally omitted
|
||||
default:
|
||||
list($this->_description) =
|
||||
$this->_explodeString8
|
||||
($this->_reader->read($this->_reader->getSize()), 2);
|
||||
$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
|
||||
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
|
||||
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);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the text encoding.
|
||||
*
|
||||
* All the strings read from a file are automatically converted to the
|
||||
* character encoding specified with the <var>encoding</var> option. See
|
||||
* {@link Zend_Media_Id3v2} for details. This method returns that character
|
||||
* encoding, or any value set after read, translated into a string form
|
||||
* regarless if it was set using a {@link Zend_Media_Id3_Encoding} constant
|
||||
* or a string.
|
||||
*
|
||||
* @return integer
|
||||
*/
|
||||
public function getEncoding()
|
||||
{
|
||||
return $this->_translateIntToEncoding($this->_encoding);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the text encoding.
|
||||
*
|
||||
* All the string written to the frame are done so using given character
|
||||
* encoding. No conversions of existing data take place upon the call to
|
||||
* this method thus all texts must be given in given character encoding.
|
||||
*
|
||||
* The character encoding parameter takes either a
|
||||
* {@link Zend_Media_Id3_Encoding} constant or a character set name string
|
||||
* in the form accepted by iconv. The default character encoding used to
|
||||
* write the frame is 'utf-8'.
|
||||
*
|
||||
* @see Zend_Media_Id3_Encoding
|
||||
* @param integer $encoding The text encoding.
|
||||
*/
|
||||
public function setEncoding($encoding)
|
||||
{
|
||||
$this->_encoding = $this->_translateEncodingToInt($encoding);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the language code as specified in the
|
||||
* {@link http://www.loc.gov/standards/iso639-2/ ISO-639-2} standard.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getLanguage()
|
||||
{
|
||||
return $this->_language;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the text language code as specified in the
|
||||
* {@link http://www.loc.gov/standards/iso639-2/ ISO-639-2} standard.
|
||||
*
|
||||
* @see Zend_Media_Id3_Language
|
||||
* @param string $language The language code.
|
||||
*/
|
||||
public function setLanguage($language)
|
||||
{
|
||||
$language = strtolower($language);
|
||||
if ($language == 'xxx') {
|
||||
$language = 'und';
|
||||
}
|
||||
$this->_language = substr($language, 0, 3);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the timing format.
|
||||
*
|
||||
* @return integer
|
||||
*/
|
||||
public function getFormat()
|
||||
{
|
||||
return $this->_format;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the timing format.
|
||||
*
|
||||
* @see Zend_Media_Id3_Timing
|
||||
* @param integer $format The timing format.
|
||||
*/
|
||||
public function setFormat($format)
|
||||
{
|
||||
$this->_format = $format;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the content type code.
|
||||
*
|
||||
* @return integer
|
||||
*/
|
||||
public function getType()
|
||||
{
|
||||
return $this->_type;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the content type code.
|
||||
*
|
||||
* @param integer $type The content type code.
|
||||
*/
|
||||
public function setType($type)
|
||||
{
|
||||
$this->_type = $type;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the content description.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getDescription()
|
||||
{
|
||||
return $this->_description;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the content description text using given encoding. The description
|
||||
* language and encoding must be that of the actual text.
|
||||
*
|
||||
* @param string $description The content description text.
|
||||
* @param string $language The language code.
|
||||
* @param integer $encoding The text encoding.
|
||||
*/
|
||||
public function setDescription
|
||||
($description, $language = null, $encoding = null)
|
||||
{
|
||||
$this->_description = $description;
|
||||
if ($language !== null) {
|
||||
$this->setLanguage($language);
|
||||
}
|
||||
if ($encoding !== null) {
|
||||
$this->setEncoding($encoding);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the syllable events with their timestamps.
|
||||
*
|
||||
* @return Array
|
||||
*/
|
||||
public function getEvents()
|
||||
{
|
||||
return $this->_events;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the syllable events with their timestamps using given encoding.
|
||||
*
|
||||
* The text language and encoding must be that of the description text.
|
||||
*
|
||||
* @param Array $text The test string.
|
||||
* @param string $language The language code.
|
||||
* @param integer $encoding The text encoding.
|
||||
*/
|
||||
public function setEvents($events, $language = null, $encoding = null)
|
||||
{
|
||||
$this->_events = $events;
|
||||
if ($language !== null) {
|
||||
$this->setLanguage($language);
|
||||
}
|
||||
if ($encoding !== null) {
|
||||
$this->setEncoding($encoding);
|
||||
}
|
||||
ksort($this->_events);
|
||||
}
|
||||
|
||||
/**
|
||||
* Writes the frame raw data without the header.
|
||||
*
|
||||
* @param Zend_Io_Writer $writer The writer object.
|
||||
* @return void
|
||||
*/
|
||||
protected function _writeFrame($writer)
|
||||
{
|
||||
$writer->writeUInt8($this->_encoding)
|
||||
->write($this->_language)
|
||||
->writeUInt8($this->_format)
|
||||
->writeUInt8($this->_type);
|
||||
switch ($this->_encoding) {
|
||||
case self::UTF16LE:
|
||||
$writer->writeString16
|
||||
($this->_description,
|
||||
Zend_Io_Writer::LITTLE_ENDIAN_ORDER, 1);
|
||||
break;
|
||||
case self::UTF16:
|
||||
// break intentionally omitted
|
||||
case self::UTF16BE:
|
||||
$writer->writeString16($this->_description, null, 1);
|
||||
break;
|
||||
default:
|
||||
$writer->writeString8($this->_description, 1);
|
||||
break;
|
||||
}
|
||||
foreach ($this->_events as $timestamp => $syllable) {
|
||||
switch ($this->_encoding) {
|
||||
case self::UTF16LE:
|
||||
$writer->writeString16
|
||||
($syllable, Zend_Io_Writer::LITTLE_ENDIAN_ORDER, 1);
|
||||
break;
|
||||
case self::UTF16:
|
||||
// break intentionally omitted
|
||||
case self::UTF16BE:
|
||||
$writer->writeString16($syllable, null, 1);
|
||||
break;
|
||||
default:
|
||||
$writer->writeString8($syllable, 1);
|
||||
break;
|
||||
}
|
||||
$writer->writeUInt32BE($timestamp);
|
||||
}
|
||||
}
|
||||
}
|
||||
157
src/Zend/Media/Id3/Frame/Sytc.php
Normal file
157
src/Zend/Media/Id3/Frame/Sytc.php
Normal file
@@ -0,0 +1,157 @@
|
||||
<?php
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Media
|
||||
* @subpackage ID3
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
*/
|
||||
|
||||
/**#@+ @ignore */
|
||||
require_once 'Zend/Media/Id3/Frame.php';
|
||||
require_once 'Zend/Media/Id3/Timing.php';
|
||||
/**#@-*/
|
||||
|
||||
/**
|
||||
* For a more accurate description of the tempo of a musical piece, the
|
||||
* <i>Synchronised tempo codes</i> frame might be used.
|
||||
*
|
||||
* The tempo data consists of one or more tempo codes. Each tempo code consists
|
||||
* of one tempo part and one time part. The tempo is in BPM described with one
|
||||
* or two bytes. If the first byte has the value $FF, one more byte follows,
|
||||
* which is added to the first giving a range from 2 - 510 BPM, since $00 and
|
||||
* $01 is reserved. $00 is used to describe a beat-free time period, which is
|
||||
* not the same as a music-free time period. $01 is used to indicate one single
|
||||
* beat-stroke followed by a beat-free period.
|
||||
*
|
||||
* The tempo descriptor is followed by a time stamp. Every time the tempo in the
|
||||
* music changes, a tempo descriptor may indicate this for the player. All tempo
|
||||
* descriptors must be sorted in chronological order. The first beat-stroke in
|
||||
* a time-period is at the same time as the beat description occurs. There may
|
||||
* only be one SYTC frame in each tag.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Media
|
||||
* @subpackage ID3
|
||||
* @author Sven Vollbehr <sven@vollbehr.eu>
|
||||
* @author Ryan Butterfield <buttza@gmail.com>
|
||||
* @copyright Copyright (c) 2005-2009 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_Id3_Frame_Sytc extends Zend_Media_Id3_Frame
|
||||
implements Zend_Media_Id3_Timing
|
||||
{
|
||||
/** Describes a beat-free time period. */
|
||||
const BEAT_FREE = 0x00;
|
||||
|
||||
/** Indicate one single beat-stroke followed by a beat-free period. */
|
||||
const SINGLE_BEAT = 0x01;
|
||||
|
||||
/** @var integer */
|
||||
private $_format = Zend_Media_Id3_Timing::MPEG_FRAMES;
|
||||
|
||||
/** @var Array */
|
||||
private $_events = array();
|
||||
|
||||
/**
|
||||
* 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);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the timing format.
|
||||
*
|
||||
* @return integer
|
||||
*/
|
||||
public function getFormat()
|
||||
{
|
||||
return $this->_format;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the timing format.
|
||||
*
|
||||
* @see Zend_Media_Id3_Timing
|
||||
* @param integer $format The timing format.
|
||||
*/
|
||||
public function setFormat($format)
|
||||
{
|
||||
$this->_format = $format;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the time-bpm tempo events.
|
||||
*
|
||||
* @return Array
|
||||
*/
|
||||
public function getEvents()
|
||||
{
|
||||
return $this->_events;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the time-bpm tempo events.
|
||||
*
|
||||
* @param Array $events The time-bpm tempo events.
|
||||
*/
|
||||
public function setEvents($events)
|
||||
{
|
||||
$this->_events = $events;
|
||||
ksort($this->_events);
|
||||
}
|
||||
|
||||
/**
|
||||
* Writes the frame raw data without the header.
|
||||
*
|
||||
* @param Zend_Io_Writer $writer The writer object.
|
||||
* @return void
|
||||
*/
|
||||
protected function _writeFrame($writer)
|
||||
{
|
||||
$writer->writeUInt8($this->_format);
|
||||
foreach ($this->_events as $timestamp => $tempo) {
|
||||
if ($tempo >= 0xff) {
|
||||
$writer->writeUInt8(0xff)
|
||||
->writeUInt8($tempo - 0xff);
|
||||
} else {
|
||||
$writer->writeUInt8($tempo);
|
||||
}
|
||||
$writer->writeUInt32BE($timestamp);
|
||||
}
|
||||
}
|
||||
}
|
||||
40
src/Zend/Media/Id3/Frame/Talb.php
Normal file
40
src/Zend/Media/Id3/Frame/Talb.php
Normal file
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Media
|
||||
* @subpackage ID3
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
*/
|
||||
|
||||
/**#@+ @ignore */
|
||||
require_once 'Zend/Media/Id3/TextFrame.php';
|
||||
/**#@-*/
|
||||
|
||||
/**
|
||||
* The <i>Album/Movie/Show title</i> frame is intended for the title of the
|
||||
* recording (or source of sound) from which the audio in the file is taken.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Media
|
||||
* @subpackage ID3
|
||||
* @author Sven Vollbehr <sven@vollbehr.eu>
|
||||
* @copyright Copyright (c) 2005-2009 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_Id3_Frame_Talb extends Zend_Media_Id3_TextFrame
|
||||
{}
|
||||
40
src/Zend/Media/Id3/Frame/Tbpm.php
Normal file
40
src/Zend/Media/Id3/Frame/Tbpm.php
Normal file
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Media
|
||||
* @subpackage ID3
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
*/
|
||||
|
||||
/**#@+ @ignore */
|
||||
require_once 'Zend/Media/Id3/NumberFrame.php';
|
||||
/**#@-*/
|
||||
|
||||
/**
|
||||
* The <i>BPM</i> frame contains the number of beats per minute in the main part
|
||||
* of the audio. The BPM is an integer and represented as a numerical string.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Media
|
||||
* @subpackage ID3
|
||||
* @author Sven Vollbehr <sven@vollbehr.eu>
|
||||
* @copyright Copyright (c) 2005-2009 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_Id3_Frame_Tbpm extends Zend_Media_Id3_NumberFrame
|
||||
{}
|
||||
39
src/Zend/Media/Id3/Frame/Tcom.php
Normal file
39
src/Zend/Media/Id3/Frame/Tcom.php
Normal file
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Media
|
||||
* @subpackage ID3
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
*/
|
||||
|
||||
/**#@+ @ignore */
|
||||
require_once 'Zend/Media/Id3/TextFrame.php';
|
||||
/**#@-*/
|
||||
|
||||
/**
|
||||
* The <i>Composer</i> frame is intended for the name of the composer.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Media
|
||||
* @subpackage ID3
|
||||
* @author Sven Vollbehr <sven@vollbehr.eu>
|
||||
* @copyright Copyright (c) 2005-2009 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_Id3_Frame_Tcom extends Zend_Media_Id3_TextFrame
|
||||
{}
|
||||
49
src/Zend/Media/Id3/Frame/Tcon.php
Normal file
49
src/Zend/Media/Id3/Frame/Tcon.php
Normal file
@@ -0,0 +1,49 @@
|
||||
<?php
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Media
|
||||
* @subpackage ID3
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
*/
|
||||
|
||||
/**#@+ @ignore */
|
||||
require_once 'Zend/Media/Id3/TextFrame.php';
|
||||
/**#@-*/
|
||||
|
||||
/**
|
||||
* The <i>Content type</i>, which ID3v1 was stored as a one byte numeric value
|
||||
* only, is now a string. You may use one or several of the ID3v1 types as
|
||||
* numerical strings, or, since the category list would be impossible to
|
||||
* maintain with accurate and up to date categories, define your own.
|
||||
*
|
||||
* You may also use any of the following keywords:
|
||||
*
|
||||
* <pre>
|
||||
* RX Remix
|
||||
* CR Cover
|
||||
* </pre>
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Media
|
||||
* @subpackage ID3
|
||||
* @author Sven Vollbehr <sven@vollbehr.eu>
|
||||
* @copyright Copyright (c) 2005-2009 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_Id3_Frame_Tcon extends Zend_Media_Id3_TextFrame
|
||||
{}
|
||||
46
src/Zend/Media/Id3/Frame/Tcop.php
Normal file
46
src/Zend/Media/Id3/Frame/Tcop.php
Normal file
@@ -0,0 +1,46 @@
|
||||
<?php
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Media
|
||||
* @subpackage ID3
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
*/
|
||||
|
||||
/**#@+ @ignore */
|
||||
require_once 'Zend/Media/Id3/TextFrame.php';
|
||||
/**#@-*/
|
||||
|
||||
/**
|
||||
* The <i>Copyright message</i> frame, in which the string must begin with a
|
||||
* year and a space character (making five characters), is intended for the
|
||||
* copyright holder of the original sound, not the audio file itself. The
|
||||
* absence of this frame means only that the copyright information is
|
||||
* unavailable or has been removed, and must not be interpreted to mean that the
|
||||
* audio is public domain. Every time this field is displayed the field must be
|
||||
* preceded with 'Copyright ' (C) ' ', where (C) is one character showing a C in
|
||||
* a circle.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Media
|
||||
* @subpackage ID3
|
||||
* @author Sven Vollbehr <sven@vollbehr.eu>
|
||||
* @copyright Copyright (c) 2005-2009 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_Id3_Frame_Tcop extends Zend_Media_Id3_TextFrame
|
||||
{}
|
||||
42
src/Zend/Media/Id3/Frame/Tdat.php
Normal file
42
src/Zend/Media/Id3/Frame/Tdat.php
Normal file
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Media
|
||||
* @subpackage ID3
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
* @deprecated ID3v2.3.0
|
||||
*/
|
||||
|
||||
/**#@+ @ignore */
|
||||
require_once 'Zend/Media/Id3/TextFrame.php';
|
||||
/**#@-*/
|
||||
|
||||
/**
|
||||
* The <i>Date</i> frame is a numeric string in the DDMM format containing the
|
||||
* date for the recording. This field is always four characters long.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Media
|
||||
* @subpackage ID3
|
||||
* @author Sven Vollbehr <sven@vollbehr.eu>
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
* @deprecated ID3v2.3.0
|
||||
*/
|
||||
final class Zend_Media_Id3_Frame_Tdat extends Zend_Media_Id3_TextFrame
|
||||
{}
|
||||
42
src/Zend/Media/Id3/Frame/Tden.php
Normal file
42
src/Zend/Media/Id3/Frame/Tden.php
Normal file
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Media
|
||||
* @subpackage ID3
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
* @since ID3v2.4.0
|
||||
*/
|
||||
|
||||
/**#@+ @ignore */
|
||||
require_once 'Zend/Media/Id3/DateFrame.php';
|
||||
/**#@-*/
|
||||
|
||||
/**
|
||||
* The <i>Encoding time</i> frame contains a timestamp describing when the audio
|
||||
* was encoded.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Media
|
||||
* @subpackage ID3
|
||||
* @author Sven Vollbehr <sven@vollbehr.eu>
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
* @since ID3v2.4.0
|
||||
*/
|
||||
final class Zend_Media_Id3_Frame_Tden extends Zend_Media_Id3_DateFrame
|
||||
{}
|
||||
41
src/Zend/Media/Id3/Frame/Tdly.php
Normal file
41
src/Zend/Media/Id3/Frame/Tdly.php
Normal file
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Media
|
||||
* @subpackage ID3
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
*/
|
||||
|
||||
/**#@+ @ignore */
|
||||
require_once 'Zend/Media/Id3/NumberFrame.php';
|
||||
/**#@-*/
|
||||
|
||||
/**
|
||||
* The <i>Playlist delay</i> defines the numbers of milliseconds of silence that
|
||||
* should be inserted before this audio. The value zero indicates that this is a
|
||||
* part of a multifile audio track that should be played continuously.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Media
|
||||
* @subpackage ID3
|
||||
* @author Sven Vollbehr <sven@vollbehr.eu>
|
||||
* @copyright Copyright (c) 2005-2009 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_Id3_Frame_Tdly extends Zend_Media_Id3_NumberFrame
|
||||
{}
|
||||
42
src/Zend/Media/Id3/Frame/Tdor.php
Normal file
42
src/Zend/Media/Id3/Frame/Tdor.php
Normal file
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Media
|
||||
* @subpackage ID3
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
* @since ID3v2.4.0
|
||||
*/
|
||||
|
||||
/**#@+ @ignore */
|
||||
require_once 'Zend/Media/Id3/DateFrame.php';
|
||||
/**#@-*/
|
||||
|
||||
/**
|
||||
* The <i>Original release time</i> frame contains a timestamp describing when
|
||||
* the original recording of the audio was released.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Media
|
||||
* @subpackage ID3
|
||||
* @author Sven Vollbehr <sven@vollbehr.eu>
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
* @since ID3v2.4.0
|
||||
*/
|
||||
final class Zend_Media_Id3_Frame_Tdor extends Zend_Media_Id3_DateFrame
|
||||
{}
|
||||
43
src/Zend/Media/Id3/Frame/Tdrc.php
Normal file
43
src/Zend/Media/Id3/Frame/Tdrc.php
Normal file
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Media
|
||||
* @subpackage ID3
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
* @since ID3v2.4.0
|
||||
*/
|
||||
|
||||
/**#@+ @ignore */
|
||||
require_once 'Zend/Media/Id3/DateFrame.php';
|
||||
/**#@-*/
|
||||
|
||||
/**
|
||||
* The <i>Recording time</i> frame contains a timestamp describing when the
|
||||
* audio was recorded.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Media
|
||||
* @subpackage ID3
|
||||
* @author Sven Vollbehr <sven@vollbehr.eu>
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
* @since ID3v2.4.0
|
||||
*/
|
||||
final class Zend_Media_Id3_Frame_Tdrc extends Zend_Media_Id3_DateFrame
|
||||
{
|
||||
}
|
||||
42
src/Zend/Media/Id3/Frame/Tdrl.php
Normal file
42
src/Zend/Media/Id3/Frame/Tdrl.php
Normal file
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Media
|
||||
* @subpackage ID3
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
* @since ID3v2.4.0
|
||||
*/
|
||||
|
||||
/**#@+ @ignore */
|
||||
require_once 'Zend/Media/Id3/DateFrame.php';
|
||||
/**#@-*/
|
||||
|
||||
/**
|
||||
* The <i>Release time</i> frame contains a timestamp describing when the audio
|
||||
* was first released.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Media
|
||||
* @subpackage ID3
|
||||
* @author Sven Vollbehr <sven@vollbehr.eu>
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
* @since ID3v2.4.0
|
||||
*/
|
||||
final class Zend_Media_Id3_Frame_Tdrl extends Zend_Media_Id3_DateFrame
|
||||
{}
|
||||
42
src/Zend/Media/Id3/Frame/Tdtg.php
Normal file
42
src/Zend/Media/Id3/Frame/Tdtg.php
Normal file
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Media
|
||||
* @subpackage ID3
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
* @since ID3v2.4.0
|
||||
*/
|
||||
|
||||
/**#@+ @ignore */
|
||||
require_once 'Zend/Media/Id3/DateFrame.php';
|
||||
/**#@-*/
|
||||
|
||||
/**
|
||||
* The <i>Tagging time</i> frame contains a timestamp describing then the audio
|
||||
* was tagged.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Media
|
||||
* @subpackage ID3
|
||||
* @author Sven Vollbehr <sven@vollbehr.eu>
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
* @since ID3v2.4.0
|
||||
*/
|
||||
final class Zend_Media_Id3_Frame_Tdtg extends Zend_Media_Id3_DateFrame
|
||||
{}
|
||||
41
src/Zend/Media/Id3/Frame/Tenc.php
Normal file
41
src/Zend/Media/Id3/Frame/Tenc.php
Normal file
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Media
|
||||
* @subpackage ID3
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
*/
|
||||
|
||||
/**#@+ @ignore */
|
||||
require_once 'Zend/Media/Id3/TextFrame.php';
|
||||
/**#@-*/
|
||||
|
||||
/**
|
||||
* The <i>Encoded by</i> frame contains the name of the person or organisation
|
||||
* that encoded the audio file. This field may contain a copyright message, if
|
||||
* the audio file also is copyrighted by the encoder.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Media
|
||||
* @subpackage ID3
|
||||
* @author Sven Vollbehr <sven@vollbehr.eu>
|
||||
* @copyright Copyright (c) 2005-2009 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_Id3_Frame_Tenc extends Zend_Media_Id3_TextFrame
|
||||
{}
|
||||
40
src/Zend/Media/Id3/Frame/Text.php
Normal file
40
src/Zend/Media/Id3/Frame/Text.php
Normal file
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Media
|
||||
* @subpackage ID3
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
*/
|
||||
|
||||
/**#@+ @ignore */
|
||||
require_once 'Zend/Media/Id3/TextFrame.php';
|
||||
/**#@-*/
|
||||
|
||||
/**
|
||||
* The <i>Lyricist/Text writer</i> frame is intended for the writer of the text
|
||||
* or lyrics in the recording.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Media
|
||||
* @subpackage ID3
|
||||
* @author Sven Vollbehr <sven@vollbehr.eu>
|
||||
* @copyright Copyright (c) 2005-2009 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_Id3_Frame_Text extends Zend_Media_Id3_TextFrame
|
||||
{}
|
||||
57
src/Zend/Media/Id3/Frame/Tflt.php
Normal file
57
src/Zend/Media/Id3/Frame/Tflt.php
Normal file
@@ -0,0 +1,57 @@
|
||||
<?php
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Media
|
||||
* @subpackage ID3
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
*/
|
||||
|
||||
/**#@+ @ignore */
|
||||
require_once 'Zend/Media/Id3/TextFrame.php';
|
||||
/**#@-*/
|
||||
|
||||
/**
|
||||
* The <i>File type</i> frame indicates which type of audio this tag defines.
|
||||
* The following types and refinements are defined:
|
||||
*
|
||||
* <pre>
|
||||
* MIME MIME type follows
|
||||
* MPG MPEG Audio
|
||||
* /1 MPEG 1/2 layer I
|
||||
* /2 MPEG 1/2 layer II
|
||||
* /3 MPEG 1/2 layer III
|
||||
* /2.5 MPEG 2.5
|
||||
* /AAC Advanced audio compression
|
||||
* VQF Transform-domain Weighted Interleave Vector Quantisation
|
||||
* PCM Pulse Code Modulated audio
|
||||
* </pre>
|
||||
*
|
||||
* but other types may be used, but not for these types though. This is used in
|
||||
* a similar way to the predefined types in the
|
||||
* {@link Zend_Media_Id3_Frame_Tmed TMED} frame. If this frame is not present
|
||||
* audio type is assumed to be MPG.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Media
|
||||
* @subpackage ID3
|
||||
* @author Sven Vollbehr <sven@vollbehr.eu>
|
||||
* @copyright Copyright (c) 2005-2009 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_Id3_Frame_Tflt extends Zend_Media_Id3_TextFrame
|
||||
{}
|
||||
105
src/Zend/Media/Id3/Frame/Time.php
Normal file
105
src/Zend/Media/Id3/Frame/Time.php
Normal file
@@ -0,0 +1,105 @@
|
||||
<?php
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Media
|
||||
* @subpackage ID3
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
* @deprecated ID3v2.3.0
|
||||
*/
|
||||
|
||||
/**#@+ @ignore */
|
||||
require_once 'Zend/Media/Id3/DateFrame.php';
|
||||
/**#@-*/
|
||||
|
||||
/**
|
||||
* The <i>Time</i> frame contains the time for the recording in the HHMM format.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Media
|
||||
* @subpackage ID3
|
||||
* @author Sven Vollbehr <sven@vollbehr.eu>
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
* @deprecated ID3v2.3.0
|
||||
*/
|
||||
final class Zend_Media_Id3_Frame_Time extends Zend_Media_Id3_DateFrame
|
||||
{
|
||||
private $_hours;
|
||||
private $_minutes;
|
||||
|
||||
/**
|
||||
* 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, 'HHmm');
|
||||
$this->_hours = substr($this->getText(), 0, 2);
|
||||
$this->_minutes = substr($this->getText(), 2, 2);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the hour.
|
||||
*
|
||||
* @return integer
|
||||
*/
|
||||
public function getHour()
|
||||
{
|
||||
return intval($this->_hours);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the hour.
|
||||
*
|
||||
* @param integer $hours The hours.
|
||||
*/
|
||||
public function setHour($hours)
|
||||
{
|
||||
$this->setText
|
||||
(($this->_hours = str_pad(strval($hours), 2, "0", STR_PAD_LEFT)) .
|
||||
($this->_minutes ? $this->_minutes : '00'),
|
||||
Zend_Media_Id3_Encoding::ISO88591);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the minutes.
|
||||
*
|
||||
* @return integer
|
||||
*/
|
||||
public function getMinute()
|
||||
{
|
||||
return intval($this->_minutes);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the minutes.
|
||||
*
|
||||
* @param integer $minutes The minutes.
|
||||
*/
|
||||
public function setMinute($minutes)
|
||||
{
|
||||
$this->setText
|
||||
(($this->_hours ? $this->_hours : '00') .
|
||||
($this->_minutes =
|
||||
str_pad(strval($minutes), 2, "0", STR_PAD_LEFT)),
|
||||
Zend_Media_Id3_Encoding::ISO88591);
|
||||
}
|
||||
}
|
||||
43
src/Zend/Media/Id3/Frame/Tipl.php
Normal file
43
src/Zend/Media/Id3/Frame/Tipl.php
Normal file
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Media
|
||||
* @subpackage ID3
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
* @since ID3v2.4.0
|
||||
*/
|
||||
|
||||
/**#@+ @ignore */
|
||||
require_once 'Zend/Media/Id3/TextFrame.php';
|
||||
/**#@-*/
|
||||
|
||||
/**
|
||||
* The <i>Involved people list</i> is very similar to the musician credits list,
|
||||
* but maps between functions, like producer, and names.
|
||||
*
|
||||
* @todo Implement better support
|
||||
* @category Zend
|
||||
* @package Zend_Media
|
||||
* @subpackage ID3
|
||||
* @author Sven Vollbehr <sven@vollbehr.eu>
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
* @since ID3v2.4.0
|
||||
*/
|
||||
final class Zend_Media_Id3_Frame_Tipl extends Zend_Media_Id3_TextFrame
|
||||
{}
|
||||
41
src/Zend/Media/Id3/Frame/Tit1.php
Normal file
41
src/Zend/Media/Id3/Frame/Tit1.php
Normal file
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Media
|
||||
* @subpackage ID3
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
*/
|
||||
|
||||
/**#@+ @ignore */
|
||||
require_once 'Zend/Media/Id3/TextFrame.php';
|
||||
/**#@-*/
|
||||
|
||||
/**
|
||||
* The <i>Content group description</i> frame is used if the sound belongs to a
|
||||
* larger category of sounds/music. For example, classical music is often sorted
|
||||
* in different musical sections (e.g. 'Piano Concerto', 'Weather - Hurricane').
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Media
|
||||
* @subpackage ID3
|
||||
* @author Sven Vollbehr <sven@vollbehr.eu>
|
||||
* @copyright Copyright (c) 2005-2009 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_Id3_Frame_Tit1 extends Zend_Media_Id3_TextFrame
|
||||
{}
|
||||
40
src/Zend/Media/Id3/Frame/Tit2.php
Normal file
40
src/Zend/Media/Id3/Frame/Tit2.php
Normal file
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Media
|
||||
* @subpackage ID3
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
*/
|
||||
|
||||
/**#@+ @ignore */
|
||||
require_once 'Zend/Media/Id3/TextFrame.php';
|
||||
/**#@-*/
|
||||
|
||||
/**
|
||||
* The <i>Title/Songname/Content description</i> frame is the actual name of the
|
||||
* piece (e.g. 'Adagio', 'Hurricane Donna').
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Media
|
||||
* @subpackage ID3
|
||||
* @author Sven Vollbehr <sven@vollbehr.eu>
|
||||
* @copyright Copyright (c) 2005-2009 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_Id3_Frame_Tit2 extends Zend_Media_Id3_TextFrame
|
||||
{}
|
||||
41
src/Zend/Media/Id3/Frame/Tit3.php
Normal file
41
src/Zend/Media/Id3/Frame/Tit3.php
Normal file
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Media
|
||||
* @subpackage ID3
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
*/
|
||||
|
||||
/**#@+ @ignore */
|
||||
require_once 'Zend/Media/Id3/TextFrame.php';
|
||||
/**#@-*/
|
||||
|
||||
/**
|
||||
* The <i>Subtitle/Description refinement</i> frame is used for information
|
||||
* directly related to the contents title (e.g. 'Op. 16' or 'Performed live at
|
||||
* Wembley').
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Media
|
||||
* @subpackage ID3
|
||||
* @author Sven Vollbehr <sven@vollbehr.eu>
|
||||
* @copyright Copyright (c) 2005-2009 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_Id3_Frame_Tit3 extends Zend_Media_Id3_TextFrame
|
||||
{}
|
||||
43
src/Zend/Media/Id3/Frame/Tkey.php
Normal file
43
src/Zend/Media/Id3/Frame/Tkey.php
Normal file
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Media
|
||||
* @subpackage ID3
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
*/
|
||||
|
||||
/**#@+ @ignore */
|
||||
require_once 'Zend/Media/Id3/TextFrame.php';
|
||||
/**#@-*/
|
||||
|
||||
/**
|
||||
* The <i>Initial key</i> frame contains the musical key in which the sound
|
||||
* starts. It is represented as a string with a maximum length of three
|
||||
* characters. The ground keys are represented with 'A', 'B', 'C', 'D', 'E', 'F'
|
||||
* and 'G' and halfkeys represented with 'b' and '#'. Minor is represented as
|
||||
* 'm', e.g. 'Dbm'. Off key is represented with an 'o' only.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Media
|
||||
* @subpackage ID3
|
||||
* @author Sven Vollbehr <sven@vollbehr.eu>
|
||||
* @copyright Copyright (c) 2005-2009 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_Id3_Frame_Tkey extends Zend_Media_Id3_TextFrame
|
||||
{}
|
||||
43
src/Zend/Media/Id3/Frame/Tlan.php
Normal file
43
src/Zend/Media/Id3/Frame/Tlan.php
Normal file
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Media
|
||||
* @subpackage ID3
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
*/
|
||||
|
||||
/**#@+ @ignore */
|
||||
require_once 'Zend/Media/Id3/TextFrame.php';
|
||||
/**#@-*/
|
||||
|
||||
/**
|
||||
* The <i>Language</i> frame should contain the languages of the text or lyrics
|
||||
* spoken or sung in the audio. The language is represented with three
|
||||
* characters according to {@link http://www.loc.gov/standards/iso639-2/
|
||||
* ISO-639-2}. If more than one language is used in the text their language
|
||||
* codes should follow according to the amount of their usage.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Media
|
||||
* @subpackage ID3
|
||||
* @author Sven Vollbehr <sven@vollbehr.eu>
|
||||
* @copyright Copyright (c) 2005-2009 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_Id3_Frame_Tlan extends Zend_Media_Id3_TextFrame
|
||||
{}
|
||||
40
src/Zend/Media/Id3/Frame/Tlen.php
Normal file
40
src/Zend/Media/Id3/Frame/Tlen.php
Normal file
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Media
|
||||
* @subpackage ID3
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
*/
|
||||
|
||||
/**#@+ @ignore */
|
||||
require_once 'Zend/Media/Id3/NumberFrame.php';
|
||||
/**#@-*/
|
||||
|
||||
/**
|
||||
* The <i>Length</i> frame contains the length of the audio file in
|
||||
* milliseconds.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Media
|
||||
* @subpackage ID3
|
||||
* @author Sven Vollbehr <sven@vollbehr.eu>
|
||||
* @copyright Copyright (c) 2005-2009 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_Id3_Frame_Tlen extends Zend_Media_Id3_NumberFrame
|
||||
{}
|
||||
44
src/Zend/Media/Id3/Frame/Tmcl.php
Normal file
44
src/Zend/Media/Id3/Frame/Tmcl.php
Normal file
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Media
|
||||
* @subpackage ID3
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
* @since ID3v2.4.0
|
||||
*/
|
||||
|
||||
/**#@+ @ignore */
|
||||
require_once 'Zend/Media/Id3/TextFrame.php';
|
||||
/**#@-*/
|
||||
|
||||
/**
|
||||
* The <i>Musician credits list</i> is intended as a mapping between instruments
|
||||
* and the musician that played it. Every odd field is an instrument and every
|
||||
* even is an artist or a comma delimited list of artists.
|
||||
*
|
||||
* @todo Implement better support
|
||||
* @category Zend
|
||||
* @package Zend_Media
|
||||
* @subpackage ID3
|
||||
* @author Sven Vollbehr <sven@vollbehr.eu>
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
* @since ID3v2.4.0
|
||||
*/
|
||||
final class Zend_Media_Id3_Frame_Tmcl extends Zend_Media_Id3_TextFrame
|
||||
{}
|
||||
124
src/Zend/Media/Id3/Frame/Tmed.php
Normal file
124
src/Zend/Media/Id3/Frame/Tmed.php
Normal file
@@ -0,0 +1,124 @@
|
||||
<?php
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Media
|
||||
* @subpackage ID3
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
*/
|
||||
|
||||
/**#@+ @ignore */
|
||||
require_once 'Zend/Media/Id3/TextFrame.php';
|
||||
/**#@-*/
|
||||
|
||||
/**
|
||||
* The <i>Media type</i> frame describes from which media the sound originated.
|
||||
* This may be a text string or a reference to the predefined media types found
|
||||
* in the list below. Example: 'VID/PAL/VHS'.
|
||||
*
|
||||
* <pre>
|
||||
* DIG Other digital media
|
||||
* /A Analogue transfer from media
|
||||
*
|
||||
* ANA Other analogue media
|
||||
* /WAC Wax cylinder
|
||||
* /8CA 8-track tape cassette
|
||||
*
|
||||
* CD CD
|
||||
* /A Analogue transfer from media
|
||||
* /DD DDD
|
||||
* /AD ADD
|
||||
* /AA AAD
|
||||
*
|
||||
* LD Laserdisc
|
||||
*
|
||||
* TT Turntable records
|
||||
* /33 33.33 rpm
|
||||
* /45 45 rpm
|
||||
* /71 71.29 rpm
|
||||
* /76 76.59 rpm
|
||||
* /78 78.26 rpm
|
||||
* /80 80 rpm
|
||||
*
|
||||
* MD MiniDisc
|
||||
* /A Analogue transfer from media
|
||||
*
|
||||
* DAT DAT
|
||||
* /A Analogue transfer from media
|
||||
* /1 standard, 48 kHz/16 bits, linear
|
||||
* /2 mode 2, 32 kHz/16 bits, linear
|
||||
* /3 mode 3, 32 kHz/12 bits, non-linear, low speed
|
||||
* /4 mode 4, 32 kHz/12 bits, 4 channels
|
||||
* /5 mode 5, 44.1 kHz/16 bits, linear
|
||||
* /6 mode 6, 44.1 kHz/16 bits, 'wide track' play
|
||||
*
|
||||
* DCC DCC
|
||||
* /A Analogue transfer from media
|
||||
*
|
||||
* DVD DVD
|
||||
* /A Analogue transfer from media
|
||||
*
|
||||
* TV Television
|
||||
* /PAL PAL
|
||||
* /NTSC NTSC
|
||||
* /SECAM SECAM
|
||||
*
|
||||
* VID Video
|
||||
* /PAL PAL
|
||||
* /NTSC NTSC
|
||||
* /SECAM SECAM
|
||||
* /VHS VHS
|
||||
* /SVHS S-VHS
|
||||
* /BETA BETAMAX
|
||||
*
|
||||
* RAD Radio
|
||||
* /FM FM
|
||||
* /AM AM
|
||||
* /LW LW
|
||||
* /MW MW
|
||||
*
|
||||
* TEL Telephone
|
||||
* /I ISDN
|
||||
*
|
||||
* MC MC (normal cassette)
|
||||
* /4 4.75 cm/s (normal speed for a two sided cassette)
|
||||
* /9 9.5 cm/s
|
||||
* /I Type I cassette (ferric/normal)
|
||||
* /II Type II cassette (chrome)
|
||||
* /III Type III cassette (ferric chrome)
|
||||
* /IV Type IV cassette (metal)
|
||||
*
|
||||
* REE Reel
|
||||
* /9 9.5 cm/s
|
||||
* /19 19 cm/s
|
||||
* /38 38 cm/s
|
||||
* /76 76 cm/s
|
||||
* /I Type I cassette (ferric/normal)
|
||||
* /II Type II cassette (chrome)
|
||||
* /III Type III cassette (ferric chrome)
|
||||
* /IV Type IV cassette (metal)
|
||||
* </pre>
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Media
|
||||
* @subpackage ID3
|
||||
* @author Sven Vollbehr <sven@vollbehr.eu>
|
||||
* @copyright Copyright (c) 2005-2009 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_Id3_Frame_Tmed extends Zend_Media_Id3_TextFrame
|
||||
{}
|
||||
42
src/Zend/Media/Id3/Frame/Tmoo.php
Normal file
42
src/Zend/Media/Id3/Frame/Tmoo.php
Normal file
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Media
|
||||
* @subpackage ID3
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
* @since ID3v2.4.0
|
||||
*/
|
||||
|
||||
/**#@+ @ignore */
|
||||
require_once 'Zend/Media/Id3/TextFrame.php';
|
||||
/**#@-*/
|
||||
|
||||
/**
|
||||
* The <i>Mood</i> frame is intended to reflect the mood of the audio with a few
|
||||
* keywords, e.g. 'Romantic' or 'Sad'.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Media
|
||||
* @subpackage ID3
|
||||
* @author Sven Vollbehr <sven@vollbehr.eu>
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
* @since ID3v2.4.0
|
||||
*/
|
||||
final class Zend_Media_Id3_Frame_Tmoo extends Zend_Media_Id3_TextFrame
|
||||
{}
|
||||
41
src/Zend/Media/Id3/Frame/Toal.php
Normal file
41
src/Zend/Media/Id3/Frame/Toal.php
Normal file
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Media
|
||||
* @subpackage ID3
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
*/
|
||||
|
||||
/**#@+ @ignore */
|
||||
require_once 'Zend/Media/Id3/TextFrame.php';
|
||||
/**#@-*/
|
||||
|
||||
/**
|
||||
* The <i>Original album/movie/show title</i> frame is intended for the title of
|
||||
* the original recording (or source of sound), if for example the music in the
|
||||
* file should be a cover of a previously released song.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Media
|
||||
* @subpackage ID3
|
||||
* @author Sven Vollbehr <sven@vollbehr.eu>
|
||||
* @copyright Copyright (c) 2005-2009 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_Id3_Frame_Toal extends Zend_Media_Id3_TextFrame
|
||||
{}
|
||||
41
src/Zend/Media/Id3/Frame/Tofn.php
Normal file
41
src/Zend/Media/Id3/Frame/Tofn.php
Normal file
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Media
|
||||
* @subpackage ID3
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
*/
|
||||
|
||||
/**#@+ @ignore */
|
||||
require_once 'Zend/Media/Id3/TextFrame.php';
|
||||
/**#@-*/
|
||||
|
||||
/**
|
||||
* The <i>Original filename</i> frame contains the preferred filename for the
|
||||
* file, since some media doesn't allow the desired length of the filename. The
|
||||
* filename is case sensitive and includes its suffix.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Media
|
||||
* @subpackage ID3
|
||||
* @author Sven Vollbehr <sven@vollbehr.eu>
|
||||
* @copyright Copyright (c) 2005-2009 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_Id3_Frame_Tofn extends Zend_Media_Id3_TextFrame
|
||||
{}
|
||||
41
src/Zend/Media/Id3/Frame/Toly.php
Normal file
41
src/Zend/Media/Id3/Frame/Toly.php
Normal file
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Media
|
||||
* @subpackage ID3
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
*/
|
||||
|
||||
/**#@+ @ignore */
|
||||
require_once 'Zend/Media/Id3/TextFrame.php';
|
||||
/**#@-*/
|
||||
|
||||
/**
|
||||
* The <i>Original lyricist/text writer</i> frame is intended for the text
|
||||
* writer of the original recording, if for example the music in the file should
|
||||
* be a cover of a previously released song.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Media
|
||||
* @subpackage ID3
|
||||
* @author Sven Vollbehr <sven@vollbehr.eu>
|
||||
* @copyright Copyright (c) 2005-2009 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_Id3_Frame_Toly extends Zend_Media_Id3_TextFrame
|
||||
{}
|
||||
41
src/Zend/Media/Id3/Frame/Tope.php
Normal file
41
src/Zend/Media/Id3/Frame/Tope.php
Normal file
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Media
|
||||
* @subpackage ID3
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
*/
|
||||
|
||||
/**#@+ @ignore */
|
||||
require_once 'Zend/Media/Id3/TextFrame.php';
|
||||
/**#@-*/
|
||||
|
||||
/**
|
||||
* The <i>Original artist/performer</i> frame is intended for the performer of
|
||||
* the original recording, if for example the music in the file should be a
|
||||
* cover of a previously released song.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Media
|
||||
* @subpackage ID3
|
||||
* @author Sven Vollbehr <sven@vollbehr.eu>
|
||||
* @copyright Copyright (c) 2005-2009 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_Id3_Frame_Tope extends Zend_Media_Id3_TextFrame
|
||||
{}
|
||||
76
src/Zend/Media/Id3/Frame/Tory.php
Normal file
76
src/Zend/Media/Id3/Frame/Tory.php
Normal file
@@ -0,0 +1,76 @@
|
||||
<?php
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Media
|
||||
* @subpackage ID3
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
* @deprecated ID3v2.3.0
|
||||
*/
|
||||
|
||||
/**#@+ @ignore */
|
||||
require_once 'Zend/Media/Id3/DateFrame.php';
|
||||
/**#@-*/
|
||||
|
||||
/**
|
||||
* The <i>Original release year</i> frame is intended for the year when the
|
||||
* original recording, if for example the music in the file should be a cover of
|
||||
* a previously released song, was released. The field is formatted as in the
|
||||
* {@link Zend_Media_Id3_Frame_Tyer TYER} frame.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Media
|
||||
* @subpackage ID3
|
||||
* @author Sven Vollbehr <sven@vollbehr.eu>
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
* @deprecated ID3v2.3.0
|
||||
*/
|
||||
final class Zend_Media_Id3_Frame_Tory extends Zend_Media_Id3_DateFrame
|
||||
{
|
||||
/**
|
||||
* 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, 'Y');
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the year.
|
||||
*
|
||||
* @return integer
|
||||
*/
|
||||
public function getYear()
|
||||
{
|
||||
return intval($this->getText());
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the year.
|
||||
*
|
||||
* @param integer $year The year given in four digits.
|
||||
*/
|
||||
public function setYear($year)
|
||||
{
|
||||
$this->setText(strval($year));
|
||||
}
|
||||
}
|
||||
40
src/Zend/Media/Id3/Frame/Town.php
Normal file
40
src/Zend/Media/Id3/Frame/Town.php
Normal file
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Media
|
||||
* @subpackage ID3
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
*/
|
||||
|
||||
/**#@+ @ignore */
|
||||
require_once 'Zend/Media/Id3/TextFrame.php';
|
||||
/**#@-*/
|
||||
|
||||
/**
|
||||
* The <i>File owner/licensee</i> frame contains the name of the owner or
|
||||
* licensee of the file and it's contents.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Media
|
||||
* @subpackage ID3
|
||||
* @author Sven Vollbehr <sven@vollbehr.eu>
|
||||
* @copyright Copyright (c) 2005-2009 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_Id3_Frame_Town extends Zend_Media_Id3_TextFrame
|
||||
{}
|
||||
40
src/Zend/Media/Id3/Frame/Tpe1.php
Normal file
40
src/Zend/Media/Id3/Frame/Tpe1.php
Normal file
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Media
|
||||
* @subpackage ID3
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
*/
|
||||
|
||||
/**#@+ @ignore */
|
||||
require_once 'Zend/Media/Id3/TextFrame.php';
|
||||
/**#@-*/
|
||||
|
||||
/**
|
||||
* The <i>Lead artist/Lead performer/Soloist/Performing group</i> is used for
|
||||
* the main artist.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Media
|
||||
* @subpackage ID3
|
||||
* @author Sven Vollbehr <sven@vollbehr.eu>
|
||||
* @copyright Copyright (c) 2005-2009 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_Id3_Frame_Tpe1 extends Zend_Media_Id3_TextFrame
|
||||
{}
|
||||
40
src/Zend/Media/Id3/Frame/Tpe2.php
Normal file
40
src/Zend/Media/Id3/Frame/Tpe2.php
Normal file
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Media
|
||||
* @subpackage ID3
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
*/
|
||||
|
||||
/**#@+ @ignore */
|
||||
require_once 'Zend/Media/Id3/TextFrame.php';
|
||||
/**#@-*/
|
||||
|
||||
/**
|
||||
* The <i>Band/Orchestra/Accompaniment</i> frame is used for additional
|
||||
* information about the performers in the recording.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Media
|
||||
* @subpackage ID3
|
||||
* @author Sven Vollbehr <sven@vollbehr.eu>
|
||||
* @copyright Copyright (c) 2005-2009 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_Id3_Frame_Tpe2 extends Zend_Media_Id3_TextFrame
|
||||
{}
|
||||
39
src/Zend/Media/Id3/Frame/Tpe3.php
Normal file
39
src/Zend/Media/Id3/Frame/Tpe3.php
Normal file
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Media
|
||||
* @subpackage ID3
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
*/
|
||||
|
||||
/**#@+ @ignore */
|
||||
require_once 'Zend/Media/Id3/TextFrame.php';
|
||||
/**#@-*/
|
||||
|
||||
/**
|
||||
* The <i>Conductor</i> frame is used for the name of the conductor.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Media
|
||||
* @subpackage ID3
|
||||
* @author Sven Vollbehr <sven@vollbehr.eu>
|
||||
* @copyright Copyright (c) 2005-2009 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_Id3_Frame_Tpe3 extends Zend_Media_Id3_TextFrame
|
||||
{}
|
||||
41
src/Zend/Media/Id3/Frame/Tpe4.php
Normal file
41
src/Zend/Media/Id3/Frame/Tpe4.php
Normal file
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Media
|
||||
* @subpackage ID3
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
*/
|
||||
|
||||
/**#@+ @ignore */
|
||||
require_once 'Zend/Media/Id3/TextFrame.php';
|
||||
/**#@-*/
|
||||
|
||||
/**
|
||||
* The <i>Interpreted, remixed, or otherwise modified by</i> frame contains more
|
||||
* information about the people behind a remix and similar interpretations of
|
||||
* another existing piece.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Media
|
||||
* @subpackage ID3
|
||||
* @author Sven Vollbehr <sven@vollbehr.eu>
|
||||
* @copyright Copyright (c) 2005-2009 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_Id3_Frame_Tpe4 extends Zend_Media_Id3_TextFrame
|
||||
{}
|
||||
114
src/Zend/Media/Id3/Frame/Tpos.php
Normal file
114
src/Zend/Media/Id3/Frame/Tpos.php
Normal file
@@ -0,0 +1,114 @@
|
||||
<?php
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Media
|
||||
* @subpackage ID3
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
*/
|
||||
|
||||
/**#@+ @ignore */
|
||||
require_once 'Zend/Media/Id3/TextFrame.php';
|
||||
/**#@-*/
|
||||
|
||||
/**
|
||||
* The <i>Number of a set</i> frame is a numeric string that describes which part
|
||||
* of a set the audio came from. This frame is used if the source described in
|
||||
* the {@link Zend_Media_Id3_Frame_Talb TALB} frame is divided into several
|
||||
* mediums, e.g. a double CD. The value may be extended with a '/' character and
|
||||
* a numeric string containing the total number of parts in the set. E.g. '1/2'.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Media
|
||||
* @subpackage ID3
|
||||
* @author Sven Vollbehr <sven@vollbehr.eu>
|
||||
* @copyright Copyright (c) 2005-2009 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_Id3_Frame_Tpos extends Zend_Media_Id3_TextFrame
|
||||
{
|
||||
private $_number;
|
||||
private $_total;
|
||||
|
||||
/**
|
||||
* 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()));
|
||||
@list ($this->_number, $this->_total) = explode("/", $this->getText());
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the number.
|
||||
*
|
||||
* @return integer
|
||||
*/
|
||||
public function getNumber()
|
||||
{
|
||||
return intval($this->_number);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the number.
|
||||
*
|
||||
* @param integer $number The number.
|
||||
*/
|
||||
public function setNumber($part)
|
||||
{
|
||||
$this->setText
|
||||
($this->_number = strval($part) .
|
||||
($this->_total ? '/' . $this->_total : ''),
|
||||
Zend_Media_Id3_Encoding::ISO88591);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the total number.
|
||||
*
|
||||
* @return integer
|
||||
*/
|
||||
public function getTotal()
|
||||
{
|
||||
return intval($this->_total);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the total number.
|
||||
*
|
||||
* @param integer $total The total number.
|
||||
*/
|
||||
public function setTotal($total)
|
||||
{
|
||||
$this->setText
|
||||
(($this->_number ? $this->_number : '?') . "/" .
|
||||
($this->_total = strval($total)),
|
||||
Zend_Media_Id3_Encoding::ISO88591);
|
||||
}
|
||||
}
|
||||
48
src/Zend/Media/Id3/Frame/Tpro.php
Normal file
48
src/Zend/Media/Id3/Frame/Tpro.php
Normal file
@@ -0,0 +1,48 @@
|
||||
<?php
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Media
|
||||
* @subpackage ID3
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
* @since ID3v2.4.0
|
||||
*/
|
||||
|
||||
/**#@+ @ignore */
|
||||
require_once 'Zend/Media/Id3/TextFrame.php';
|
||||
/**#@-*/
|
||||
|
||||
/**
|
||||
* The <i>Produced notice</i> frame, in which the string must begin with a year
|
||||
* and a space character (making five characters), is intended for the
|
||||
* production copyright holder of the original sound, not the audio file itself.
|
||||
* The absence of this frame means only that the production copyright
|
||||
* information is unavailable or has been removed, and must not be interpreted
|
||||
* to mean that the audio is public domain. Every time this field is displayed
|
||||
* the field must be preceded with 'Produced ' (P) ' ', where (P) is one
|
||||
* character showing a P in a circle.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Media
|
||||
* @subpackage ID3
|
||||
* @author Sven Vollbehr <sven@vollbehr.eu>
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
* @since ID3v2.4.0
|
||||
*/
|
||||
final class Zend_Media_Id3_Frame_Tpro extends Zend_Media_Id3_TextFrame
|
||||
{}
|
||||
40
src/Zend/Media/Id3/Frame/Tpub.php
Normal file
40
src/Zend/Media/Id3/Frame/Tpub.php
Normal file
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Media
|
||||
* @subpackage ID3
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
*/
|
||||
|
||||
/**#@+ @ignore */
|
||||
require_once 'Zend/Media/Id3/TextFrame.php';
|
||||
/**#@-*/
|
||||
|
||||
/**
|
||||
* The <i>Publisher</i> frame simply contains the name of the label or
|
||||
* publisher.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Media
|
||||
* @subpackage ID3
|
||||
* @author Sven Vollbehr <sven@vollbehr.eu>
|
||||
* @copyright Copyright (c) 2005-2009 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_Id3_Frame_Tpub extends Zend_Media_Id3_TextFrame
|
||||
{}
|
||||
113
src/Zend/Media/Id3/Frame/Trck.php
Normal file
113
src/Zend/Media/Id3/Frame/Trck.php
Normal file
@@ -0,0 +1,113 @@
|
||||
<?php
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Media
|
||||
* @subpackage ID3
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
*/
|
||||
|
||||
/**#@+ @ignore */
|
||||
require_once 'Zend/Media/Id3/TextFrame.php';
|
||||
/**#@-*/
|
||||
|
||||
/**
|
||||
* The <i>Track number/Position in set</i> frame is a numeric string containing
|
||||
* the order number of the audio-file on its original recording. This may be
|
||||
* extended with a '/' character and a numeric string containing the total
|
||||
* number of tracks/elements on the original recording. E.g. '4/9'.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Media
|
||||
* @subpackage ID3
|
||||
* @author Sven Vollbehr <sven@vollbehr.eu>
|
||||
* @copyright Copyright (c) 2005-2009 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_Id3_Frame_Trck extends Zend_Media_Id3_TextFrame
|
||||
{
|
||||
private $_number;
|
||||
private $_total;
|
||||
|
||||
/**
|
||||
* 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()));
|
||||
@list ($this->_number, $this->_total) = explode("/", $this->getText());
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the number.
|
||||
*
|
||||
* @return integer
|
||||
*/
|
||||
public function getNumber()
|
||||
{
|
||||
return intval($this->_number);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the number.
|
||||
*
|
||||
* @param integer $number The number.
|
||||
*/
|
||||
public function setNumber($part)
|
||||
{
|
||||
$this->setText
|
||||
($this->_number = strval($part) .
|
||||
($this->_total ? '/' . $this->_total : ''),
|
||||
Zend_Media_Id3_Encoding::ISO88591);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the total number.
|
||||
*
|
||||
* @return integer
|
||||
*/
|
||||
public function getTotal()
|
||||
{
|
||||
return intval($this->_total);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the total number.
|
||||
*
|
||||
* @param integer $total The total number.
|
||||
*/
|
||||
public function setTotal($total)
|
||||
{
|
||||
$this->setText
|
||||
(($this->_number ? $this->_number : '?') . "/" .
|
||||
($this->_total = strval($total)),
|
||||
Zend_Media_Id3_Encoding::ISO88591);
|
||||
}
|
||||
}
|
||||
45
src/Zend/Media/Id3/Frame/Trda.php
Normal file
45
src/Zend/Media/Id3/Frame/Trda.php
Normal file
@@ -0,0 +1,45 @@
|
||||
<?php
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Media
|
||||
* @subpackage ID3
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
* @deprecated ID3v2.3.0
|
||||
*/
|
||||
|
||||
/**#@+ @ignore */
|
||||
require_once 'Zend/Media/Id3/TextFrame.php';
|
||||
/**#@-*/
|
||||
|
||||
/**
|
||||
* The <i>Recording dates</i> frame is intended to be used as complement to
|
||||
* the {@link Zend_Media_Id3_Frame_Tyer TYER},
|
||||
* {@link Zend_Media_Id3_Frame_Tdat TDAT} and
|
||||
* {@link Zend_Media_Id3_Frame_Time TIME} frames. E.g. '4th-7th June, 12th June'
|
||||
* in combination with the {@link Zend_Media_Id3_Frame_Tyer TYER} frame.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Media
|
||||
* @subpackage ID3
|
||||
* @author Sven Vollbehr <sven@vollbehr.eu>
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
* @deprecated ID3v2.3.0
|
||||
*/
|
||||
final class Zend_Media_Id3_Frame_Trda extends Zend_Media_Id3_TextFrame
|
||||
{}
|
||||
40
src/Zend/Media/Id3/Frame/Trsn.php
Normal file
40
src/Zend/Media/Id3/Frame/Trsn.php
Normal file
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Media
|
||||
* @subpackage ID3
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
*/
|
||||
|
||||
/**#@+ @ignore */
|
||||
require_once 'Zend/Media/Id3/TextFrame.php';
|
||||
/**#@-*/
|
||||
|
||||
/**
|
||||
* The <i>Internet radio station name</i> frame contains the name of the
|
||||
* internet radio station from which the audio is streamed.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Media
|
||||
* @subpackage ID3
|
||||
* @author Sven Vollbehr <sven@vollbehr.eu>
|
||||
* @copyright Copyright (c) 2005-2009 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_Id3_Frame_TRSN extends Zend_Media_Id3_TextFrame
|
||||
{}
|
||||
40
src/Zend/Media/Id3/Frame/Trso.php
Normal file
40
src/Zend/Media/Id3/Frame/Trso.php
Normal file
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Media
|
||||
* @subpackage ID3
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
*/
|
||||
|
||||
/**#@+ @ignore */
|
||||
require_once 'Zend/Media/Id3/TextFrame.php';
|
||||
/**#@-*/
|
||||
|
||||
/**
|
||||
* The <i>Internet radio station owner</i> frame contains the name of the owner
|
||||
* of the internet radio station from which the audio is streamed.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Media
|
||||
* @subpackage ID3
|
||||
* @author Sven Vollbehr <sven@vollbehr.eu>
|
||||
* @copyright Copyright (c) 2005-2009 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_Id3_Frame_TRSO extends Zend_Media_Id3_TextFrame
|
||||
{}
|
||||
42
src/Zend/Media/Id3/Frame/Tsiz.php
Normal file
42
src/Zend/Media/Id3/Frame/Tsiz.php
Normal file
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Media
|
||||
* @subpackage ID3
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
* @deprecated ID3v2.3.0
|
||||
*/
|
||||
|
||||
/**#@+ @ignore */
|
||||
require_once 'Zend/Media/Id3/NumberFrame.php';
|
||||
/**#@-*/
|
||||
|
||||
/**
|
||||
* The <i>Size</i> frame contains the size of the audiofile in bytes, excluding
|
||||
* the ID3v2 tag.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Media
|
||||
* @subpackage ID3
|
||||
* @author Sven Vollbehr <sven@vollbehr.eu>
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
* @deprecated ID3v2.3.0
|
||||
*/
|
||||
final class Zend_Media_Id3_Frame_Tsiz extends Zend_Media_Id3_NumberFrame
|
||||
{}
|
||||
43
src/Zend/Media/Id3/Frame/Tsoa.php
Normal file
43
src/Zend/Media/Id3/Frame/Tsoa.php
Normal file
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Media
|
||||
* @subpackage ID3
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
* @since ID3v2.4.0
|
||||
*/
|
||||
|
||||
/**#@+ @ignore */
|
||||
require_once 'Zend/Media/Id3/TextFrame.php';
|
||||
/**#@-*/
|
||||
|
||||
/**
|
||||
* The <i>Album sort order</i> frame defines a string which should be used
|
||||
* instead of the {@link Zend_Media_Id3_Frame_Talb TALB} album name frame for
|
||||
* sorting purposes.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Media
|
||||
* @subpackage ID3
|
||||
* @author Sven Vollbehr <sven@vollbehr.eu>
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
* @since ID3v2.4.0
|
||||
*/
|
||||
final class Zend_Media_Id3_Frame_Tsoa extends Zend_Media_Id3_TextFrame
|
||||
{}
|
||||
43
src/Zend/Media/Id3/Frame/Tsop.php
Normal file
43
src/Zend/Media/Id3/Frame/Tsop.php
Normal file
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Media
|
||||
* @subpackage ID3
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
* @since ID3v2.4.0
|
||||
*/
|
||||
|
||||
/**#@+ @ignore */
|
||||
require_once 'Zend/Media/Id3/TextFrame.php';
|
||||
/**#@-*/
|
||||
|
||||
/**
|
||||
* The <i>Performer sort order</i> frame defines a string which should be used
|
||||
* instead of the {@link Zend_Media_Id3_Frame_Tpe2 TPE2} performer frame for
|
||||
* sorting purposes.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Media
|
||||
* @subpackage ID3
|
||||
* @author Sven Vollbehr <sven@vollbehr.eu>
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
* @since ID3v2.4.0
|
||||
*/
|
||||
final class Zend_Media_Id3_Frame_Tsop extends Zend_Media_Id3_TextFrame
|
||||
{}
|
||||
43
src/Zend/Media/Id3/Frame/Tsot.php
Normal file
43
src/Zend/Media/Id3/Frame/Tsot.php
Normal file
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Media
|
||||
* @subpackage ID3
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
* @since ID3v2.4.0
|
||||
*/
|
||||
|
||||
/**#@+ @ignore */
|
||||
require_once 'Zend/Media/Id3/TextFrame.php';
|
||||
/**#@-*/
|
||||
|
||||
/**
|
||||
* The <i>Title sort order</i> frame defines a string which should be used
|
||||
* instead of the {@link Zend_Media_Id3_Frame_Tit2 TIT2} title frame for sorting
|
||||
* purposes.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Media
|
||||
* @subpackage ID3
|
||||
* @author Sven Vollbehr <sven@vollbehr.eu>
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
* @since ID3v2.4.0
|
||||
*/
|
||||
final class Zend_Media_Id3_Frame_Tsot extends Zend_Media_Id3_TextFrame
|
||||
{}
|
||||
206
src/Zend/Media/Id3/Frame/Tsrc.php
Normal file
206
src/Zend/Media/Id3/Frame/Tsrc.php
Normal file
@@ -0,0 +1,206 @@
|
||||
<?php
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Media
|
||||
* @subpackage ID3
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
*/
|
||||
|
||||
/**#@+ @ignore */
|
||||
require_once 'Zend/Media/Id3/TextFrame.php';
|
||||
/**#@-*/
|
||||
|
||||
/**
|
||||
* The <i>TSRC</i> frame should contain the International Standard Recording
|
||||
* Code or ISRC (12 characters).
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Media
|
||||
* @subpackage ID3
|
||||
* @author Sven Vollbehr <sven@vollbehr.eu>
|
||||
* @copyright Copyright (c) 2005-2009 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_Id3_Frame_Tsrc extends Zend_Media_Id3_TextFrame
|
||||
{
|
||||
/** @var string */
|
||||
private $_country;
|
||||
|
||||
/** @var string */
|
||||
private $_registrant;
|
||||
|
||||
/** @var string */
|
||||
private $_year;
|
||||
|
||||
/** @var string */
|
||||
private $_uniqueNumber;
|
||||
|
||||
/**
|
||||
* 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);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the appropriate for the registrant the two-character ISO 3166-1
|
||||
* alpha-2 country code.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getCountry()
|
||||
{
|
||||
return $this->_country;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the country.
|
||||
*
|
||||
* @param string $country The two-character ISO 3166-1 alpha-2 country code.
|
||||
*/
|
||||
public function setCountry($country)
|
||||
{
|
||||
$this->_country = $country;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the three character alphanumeric registrant code, uniquely
|
||||
* identifying the organisation which registered the ISRC code.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getRegistrant()
|
||||
{
|
||||
return $this->_registrant;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the registrant.
|
||||
*
|
||||
* @param string $registrant The three character alphanumeric registrant
|
||||
* code.
|
||||
*/
|
||||
public function setRegistrant($registrant)
|
||||
{
|
||||
$this->_registrant = $registrant;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the year of registration.
|
||||
*
|
||||
* @return integer
|
||||
*/
|
||||
public function getYear()
|
||||
{
|
||||
$year = intval($this->_year);
|
||||
if ($year > 50) {
|
||||
return 1900 + $year;
|
||||
} else {
|
||||
return 2000 + $year;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the year.
|
||||
*
|
||||
* @param integer $year The year of registration.
|
||||
*/
|
||||
public function setYear($year)
|
||||
{
|
||||
$this->_year = substr(strval($year), 2, 2);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the unique number identifying the particular sound recording.
|
||||
*
|
||||
* @return integer
|
||||
*/
|
||||
public function getUniqueNumber()
|
||||
{
|
||||
return intval($this->_uniqueNumber);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the unique number.
|
||||
*
|
||||
* @param integer $uniqueNumber The unique number identifying the
|
||||
* particular sound recording.
|
||||
*/
|
||||
public function setUniqueNumber($uniqueNumber)
|
||||
{
|
||||
$this->_uniqueNumber =
|
||||
str_pad(strval($uniqueNumber), 5, "0", STR_PAD_LEFT);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the whole ISRC code in the form
|
||||
* "country-registrant-year-unique number".
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getIsrc()
|
||||
{
|
||||
return $this->_country . "-" . $this->_registrant . "-" .
|
||||
$this->_year . "-" . $this->_uniqueNumber;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the ISRC code in the form "country-registrant-year-unique number".
|
||||
*
|
||||
* @param string $isrc The ISRC code.
|
||||
*/
|
||||
public function setIsrc($isrc)
|
||||
{
|
||||
list($this->_country,
|
||||
$this->_registrant,
|
||||
$this->_year,
|
||||
$this->_uniqueNumber) = preg_split('/-/', $isrc);
|
||||
}
|
||||
|
||||
/**
|
||||
* Writes the frame raw data without the header.
|
||||
*
|
||||
* @param Zend_Io_Writer $writer The writer object.
|
||||
* @return void
|
||||
*/
|
||||
protected function _writeFrame($writer)
|
||||
{
|
||||
$this->setText
|
||||
($this->_country . $this->_registrant . $this->_year .
|
||||
$this->_uniqueNumber, Zend_Media_Id3_Encoding::ISO88591);
|
||||
parent::_writeFrame($writer);
|
||||
}
|
||||
}
|
||||
41
src/Zend/Media/Id3/Frame/Tsse.php
Normal file
41
src/Zend/Media/Id3/Frame/Tsse.php
Normal file
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Media
|
||||
* @subpackage ID3
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
*/
|
||||
|
||||
/**#@+ @ignore */
|
||||
require_once 'Zend/Media/Id3/TextFrame.php';
|
||||
/**#@-*/
|
||||
|
||||
/**
|
||||
* The <i>Software/Hardware and settings used for encoding</i> frame includes
|
||||
* the used audio encoder and its settings when the file was encoded. Hardware
|
||||
* refers to hardware encoders, not the computer on which a program was run.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Media
|
||||
* @subpackage ID3
|
||||
* @author Sven Vollbehr <sven@vollbehr.eu>
|
||||
* @copyright Copyright (c) 2005-2009 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_Id3_Frame_Tsse extends Zend_Media_Id3_TextFrame
|
||||
{}
|
||||
42
src/Zend/Media/Id3/Frame/Tsst.php
Normal file
42
src/Zend/Media/Id3/Frame/Tsst.php
Normal file
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Media
|
||||
* @subpackage ID3
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
* @since ID3v2.4.0
|
||||
*/
|
||||
|
||||
/**#@+ @ignore */
|
||||
require_once 'Zend/Media/Id3/TextFrame.php';
|
||||
/**#@-*/
|
||||
|
||||
/**
|
||||
* The <i>Set subtitle</i> frame is intended for the subtitle of the part of a
|
||||
* set this track belongs to.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Media
|
||||
* @subpackage ID3
|
||||
* @author Sven Vollbehr <sven@vollbehr.eu>
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
* @since ID3v2.4.0
|
||||
*/
|
||||
final class Zend_Media_Id3_Frame_Tsst extends Zend_Media_Id3_TextFrame
|
||||
{}
|
||||
144
src/Zend/Media/Id3/Frame/Txxx.php
Normal file
144
src/Zend/Media/Id3/Frame/Txxx.php
Normal file
@@ -0,0 +1,144 @@
|
||||
<?php
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Media
|
||||
* @subpackage ID3
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
*/
|
||||
|
||||
/**#@+ @ignore */
|
||||
require_once 'Zend/Media/Id3/TextFrame.php';
|
||||
/**#@-*/
|
||||
|
||||
/**
|
||||
* This frame is intended for one-string text information concerning the audio
|
||||
* file in a similar way to the other T-frames. The frame consists of a
|
||||
* description of the string followed by the actual string. There may be more
|
||||
* than one TXXX frame in each tag, but only one with the same description.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Media
|
||||
* @subpackage ID3
|
||||
* @author Sven Vollbehr <sven@vollbehr.eu>
|
||||
* @author Ryan Butterfield <buttza@gmail.com>
|
||||
* @copyright Copyright (c) 2005-2009 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_Id3_Frame_Txxx extends Zend_Media_Id3_TextFrame
|
||||
{
|
||||
/** @var string */
|
||||
private $_description;
|
||||
|
||||
/**
|
||||
* 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
|
||||
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(array($this->_text), $encoding);
|
||||
break;
|
||||
case self::UTF8:
|
||||
// break intentionally omitted
|
||||
default:
|
||||
list($this->_description, $this->_text) = $this->_convertString
|
||||
($this->_explodeString8
|
||||
($this->_reader->read($this->_reader->getSize()), 2),
|
||||
$encoding);
|
||||
$this->_text = array($this->_text);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the description text.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getDescription()
|
||||
{
|
||||
return $this->_description;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the description text using given encoding.
|
||||
*
|
||||
* @param string $description The content description text.
|
||||
* @param integer $encoding The text encoding.
|
||||
*/
|
||||
public function setDescription($description, $encoding = null)
|
||||
{
|
||||
$this->_description = $description;
|
||||
if ($encoding !== null) {
|
||||
$this->setEncoding($encoding);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Writes the frame raw data without the header.
|
||||
*
|
||||
* @param Zend_Io_Writer $writer The writer object.
|
||||
* @return void
|
||||
*/
|
||||
protected function _writeFrame($writer)
|
||||
{
|
||||
$writer->writeUInt8($this->_encoding);
|
||||
switch ($this->_encoding) {
|
||||
case self::UTF16LE:
|
||||
$writer->writeString16
|
||||
($this->_description,
|
||||
Zend_Io_Writer::LITTLE_ENDIAN_ORDER, null, 1)
|
||||
->writeString16
|
||||
($this->_text[0],
|
||||
Zend_Io_Writer::LITTLE_ENDIAN_ORDER);
|
||||
break;
|
||||
case self::UTF16:
|
||||
// break intentionally omitted
|
||||
case self::UTF16BE:
|
||||
$writer->writeString16($this->_description, null, 1)
|
||||
->writeString16($this->_text[0], null);
|
||||
break;
|
||||
default:
|
||||
$writer->writeString8($this->_description, 1)
|
||||
->writeString8($this->_text[0]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
73
src/Zend/Media/Id3/Frame/Tyer.php
Normal file
73
src/Zend/Media/Id3/Frame/Tyer.php
Normal file
@@ -0,0 +1,73 @@
|
||||
<?php
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Media
|
||||
* @subpackage ID3
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
* @deprecated ID3v2.3.0
|
||||
*/
|
||||
|
||||
/**#@+ @ignore */
|
||||
require_once 'Zend/Media/Id3/DateFrame.php';
|
||||
/**#@-*/
|
||||
|
||||
/**
|
||||
* The <i>Year</i> frame is a numeric string with a year of the recording.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Media
|
||||
* @subpackage ID3
|
||||
* @author Sven Vollbehr <sven@vollbehr.eu>
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
* @deprecated ID3v2.3.0
|
||||
*/
|
||||
final class Zend_Media_Id3_Frame_Tyer extends Zend_Media_Id3_DateFrame
|
||||
{
|
||||
/**
|
||||
* 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, 'Y');
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the year.
|
||||
*
|
||||
* @return integer
|
||||
*/
|
||||
public function getYear()
|
||||
{
|
||||
return intval($this->getText());
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the year.
|
||||
*
|
||||
* @param integer $year The year given in four digits.
|
||||
*/
|
||||
public function setYear($year)
|
||||
{
|
||||
$this->setText(strval($year));
|
||||
}
|
||||
}
|
||||
48
src/Zend/Media/Id3/Frame/Unknown.php
Normal file
48
src/Zend/Media/Id3/Frame/Unknown.php
Normal file
@@ -0,0 +1,48 @@
|
||||
<?php
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Media
|
||||
* @subpackage ID3
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
*/
|
||||
|
||||
/**#@+ @ignore */
|
||||
require_once 'Zend/Media/Id3/Frame.php';
|
||||
/**#@-*/
|
||||
|
||||
/**
|
||||
* This class represents a frame not known to the library.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Media
|
||||
* @subpackage ID3
|
||||
* @author Sven Vollbehr <sven@vollbehr.eu>
|
||||
* @copyright Copyright (c) 2005-2009 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_Id3_Frame_Unknown extends Zend_Media_Id3_Frame
|
||||
{
|
||||
/**
|
||||
* Writes the frame raw data without the header.
|
||||
*
|
||||
* @param Zend_Io_Writer $writer The writer object.
|
||||
* @return void
|
||||
*/
|
||||
protected function _writeFrame($writer)
|
||||
{}
|
||||
}
|
||||
43
src/Zend/Media/Id3/Frame/User.php
Normal file
43
src/Zend/Media/Id3/Frame/User.php
Normal file
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Media
|
||||
* @subpackage ID3
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
*/
|
||||
|
||||
/**#@+ @ignore */
|
||||
require_once 'Zend/Media/Id3/LanguageTextFrame.php';
|
||||
/**#@-*/
|
||||
|
||||
/**
|
||||
* The <i>Terms of use frame</i> contains a brief description of the terms of
|
||||
* use and ownership of the file. More detailed information concerning the legal
|
||||
* terms might be available through the {@link Zend_Media_Id3_Frame_Wcop WCOP}
|
||||
* frame. Newlines are allowed in the text. There may be more than one Terms of
|
||||
* use frames in a tag, but only one with the same language.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Media
|
||||
* @subpackage ID3
|
||||
* @author Sven Vollbehr <sven@vollbehr.eu>
|
||||
* @copyright Copyright (c) 2005-2009 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_Id3_Frame_User extends Zend_Media_Id3_LanguageTextFrame
|
||||
{}
|
||||
154
src/Zend/Media/Id3/Frame/Uslt.php
Normal file
154
src/Zend/Media/Id3/Frame/Uslt.php
Normal file
@@ -0,0 +1,154 @@
|
||||
<?php
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Media
|
||||
* @subpackage ID3
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
*/
|
||||
|
||||
/**#@+ @ignore */
|
||||
require_once 'Zend/Media/Id3/LanguageTextFrame.php';
|
||||
/**#@-*/
|
||||
|
||||
/**
|
||||
* The <i>Unsynchronised lyrics/text transcription</i> frame contains the lyrics
|
||||
* of the song or a text transcription of other vocal activities. There may be
|
||||
* more than one unsynchronised lyrics/text transcription frame in each tag, but
|
||||
* only one with the same language and content descriptor.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Media
|
||||
* @subpackage ID3
|
||||
* @author Sven Vollbehr <sven@vollbehr.eu>
|
||||
* @author Ryan Butterfield <buttza@gmail.com>
|
||||
* @copyright Copyright (c) 2005-2009 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_Id3_Frame_Uslt extends Zend_Media_Id3_LanguageTextFrame
|
||||
{
|
||||
/** @var string */
|
||||
private $_description;
|
||||
|
||||
/**
|
||||
* 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') {
|
||||
$this->_language = 'und';
|
||||
}
|
||||
|
||||
switch ($encoding) {
|
||||
case self::UTF16:
|
||||
// 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
|
||||
default:
|
||||
list($this->_description, $this->_text) = $this->_convertString
|
||||
($this->_explodeString8
|
||||
($this->_reader->read($this->_reader->getSize()), 2),
|
||||
$encoding);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the short content description.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getDescription()
|
||||
{
|
||||
return $this->_description;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the content description text using given encoding. The description
|
||||
* language and encoding must be that of the actual text.
|
||||
*
|
||||
* @param string $description The content description text.
|
||||
* @param string $language The language code.
|
||||
* @param integer $encoding The text encoding.
|
||||
*/
|
||||
public function setDescription
|
||||
($description, $language = null, $encoding = null)
|
||||
{
|
||||
$this->_description = $description;
|
||||
if ($language !== null) {
|
||||
$this->setLanguage($language);
|
||||
}
|
||||
if ($encoding !== null) {
|
||||
$this->setEncoding($encoding);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Writes the frame raw data without the header.
|
||||
*
|
||||
* @param Zend_Io_Writer $writer The writer object.
|
||||
* @return void
|
||||
*/
|
||||
protected function _writeFrame($writer)
|
||||
{
|
||||
$writer->writeUInt8($this->_encoding)
|
||||
->write($this->_language);
|
||||
switch ($this->_encoding) {
|
||||
case self::UTF16LE:
|
||||
$writer->writeString16
|
||||
($this->_description,
|
||||
Zend_Io_Writer::LITTLE_ENDIAN_ORDER, 1)
|
||||
->writeString16
|
||||
($this->_text,Zend_Io_Writer::LITTLE_ENDIAN_ORDER);
|
||||
break;
|
||||
case self::UTF16:
|
||||
// break intentionally omitted
|
||||
case self::UTF16BE:
|
||||
$writer->writeString16($this->_description, null, 1)
|
||||
->writeString16($this->_text);
|
||||
break;
|
||||
default:
|
||||
$writer->writeString8($this->_description, 1)
|
||||
->writeString8($this->_text);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
41
src/Zend/Media/Id3/Frame/Wcom.php
Normal file
41
src/Zend/Media/Id3/Frame/Wcom.php
Normal file
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Media
|
||||
* @subpackage ID3
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
*/
|
||||
|
||||
/**#@+ @ignore */
|
||||
require_once 'Zend/Media/Id3/LinkFrame.php';
|
||||
/**#@-*/
|
||||
|
||||
/**
|
||||
* The <i>Commercial information</i> frame is a URL pointing at a webpage with
|
||||
* information such as where the album can be bought. There may be more than one
|
||||
* WCOM frame in a tag, but not with the same content.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Media
|
||||
* @subpackage ID3
|
||||
* @author Sven Vollbehr <sven@vollbehr.eu>
|
||||
* @copyright Copyright (c) 2005-2009 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_Id3_Frame_Wcom extends Zend_Media_Id3_LinkFrame
|
||||
{}
|
||||
40
src/Zend/Media/Id3/Frame/Wcop.php
Normal file
40
src/Zend/Media/Id3/Frame/Wcop.php
Normal file
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Media
|
||||
* @subpackage ID3
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
*/
|
||||
|
||||
/**#@+ @ignore */
|
||||
require_once 'Zend/Media/Id3/LinkFrame.php';
|
||||
/**#@-*/
|
||||
|
||||
/**
|
||||
* The <i>Copyright/Legal information</i> frame is a URL pointing at a webpage
|
||||
* where the terms of use and ownership of the file is described.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Media
|
||||
* @subpackage ID3
|
||||
* @author Sven Vollbehr <sven@vollbehr.eu>
|
||||
* @copyright Copyright (c) 2005-2009 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_Id3_Frame_Wcop extends Zend_Media_Id3_LinkFrame
|
||||
{}
|
||||
40
src/Zend/Media/Id3/Frame/Woaf.php
Normal file
40
src/Zend/Media/Id3/Frame/Woaf.php
Normal file
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Media
|
||||
* @subpackage ID3
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
*/
|
||||
|
||||
/**#@+ @ignore */
|
||||
require_once 'Zend/Media/Id3/LinkFrame.php';
|
||||
/**#@-*/
|
||||
|
||||
/**
|
||||
* The <i>Official audio file webpage</i> frame is a URL pointing at a file
|
||||
* specific webpage.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Media
|
||||
* @subpackage ID3
|
||||
* @author Sven Vollbehr <sven@vollbehr.eu>
|
||||
* @copyright Copyright (c) 2005-2009 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_Id3_Frame_Woaf extends Zend_Media_Id3_LinkFrame
|
||||
{}
|
||||
41
src/Zend/Media/Id3/Frame/Woar.php
Normal file
41
src/Zend/Media/Id3/Frame/Woar.php
Normal file
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Media
|
||||
* @subpackage ID3
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
*/
|
||||
|
||||
/**#@+ @ignore */
|
||||
require_once 'Zend/Media/Id3/LinkFrame.php';
|
||||
/**#@-*/
|
||||
|
||||
/**
|
||||
* The <i>Official artist/performer webpage</i> frame is a URL pointing at the
|
||||
* artists official webpage. There may be more than one WOAR frame in a tag if
|
||||
* the audio contains more than one performer, but not with the same content.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Media
|
||||
* @subpackage ID3
|
||||
* @author Sven Vollbehr <sven@vollbehr.eu>
|
||||
* @copyright Copyright (c) 2005-2009 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_Id3_Frame_Woar extends Zend_Media_Id3_LinkFrame
|
||||
{}
|
||||
40
src/Zend/Media/Id3/Frame/Woas.php
Normal file
40
src/Zend/Media/Id3/Frame/Woas.php
Normal file
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Media
|
||||
* @subpackage ID3
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
*/
|
||||
|
||||
/**#@+ @ignore */
|
||||
require_once 'Zend/Media/Id3/LinkFrame.php';
|
||||
/**#@-*/
|
||||
|
||||
/**
|
||||
* The <i>Official audio source webpage</i> frame is a URL pointing at the
|
||||
* official webpage for the source of the audio file, e.g. a movie.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Media
|
||||
* @subpackage ID3
|
||||
* @author Sven Vollbehr <sven@vollbehr.eu>
|
||||
* @copyright Copyright (c) 2005-2009 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_Id3_Frame_Woas extends Zend_Media_Id3_LinkFrame
|
||||
{}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user