Change class name
git-svn-id: http://php-reader.googlecode.com/svn/trunk@120 51a70ab9-7547-0410-9469-37e369ee0574
This commit is contained in:
@@ -36,13 +36,13 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/**#@+ @ignore */
|
/**#@+ @ignore */
|
||||||
require_once("MPEG/Audio/Object.php");
|
require_once("MPEG/ABS/Object.php");
|
||||||
require_once("MPEG/Audio/Frame.php");
|
require_once("MPEG/ABS/Frame.php");
|
||||||
/**#@-*/
|
/**#@-*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This class represents an MPEG Audio file as described in ISO/IEC 11172-3 and
|
* This class represents an MPEG Audio Bit Stream as described in
|
||||||
* ISO/IEC 13818-3 standards.
|
* ISO/IEC 11172-3 and ISO/IEC 13818-3 standards.
|
||||||
*
|
*
|
||||||
* Non-standard VBR header extensions or namely XING, VBRI and LAME headers are
|
* Non-standard VBR header extensions or namely XING, VBRI and LAME headers are
|
||||||
* supported.
|
* supported.
|
||||||
@@ -60,7 +60,7 @@ require_once("MPEG/Audio/Frame.php");
|
|||||||
* @license http://code.google.com/p/php-reader/wiki/License New BSD License
|
* @license http://code.google.com/p/php-reader/wiki/License New BSD License
|
||||||
* @version $Rev: 1 $
|
* @version $Rev: 1 $
|
||||||
*/
|
*/
|
||||||
final class MPEG_Audio extends MPEG_Audio_Object
|
final class MPEG_ABS extends MPEG_ABS_Object
|
||||||
{
|
{
|
||||||
/** @var integer */
|
/** @var integer */
|
||||||
private $_bytes;
|
private $_bytes;
|
||||||
@@ -68,13 +68,13 @@ final class MPEG_Audio extends MPEG_Audio_Object
|
|||||||
/** @var Array */
|
/** @var Array */
|
||||||
private $_frames = array();
|
private $_frames = array();
|
||||||
|
|
||||||
/** @var MPEG_Audio_XINGHeader */
|
/** @var MPEG_ABS_XINGHeader */
|
||||||
private $_xingHeader = null;
|
private $_xingHeader = null;
|
||||||
|
|
||||||
/** @var MPEG_Audio_LAMEHeader */
|
/** @var MPEG_ABS_LAMEHeader */
|
||||||
private $_lameHeader = null;
|
private $_lameHeader = null;
|
||||||
|
|
||||||
/** @var MPEG_Audio_VBRIHeader */
|
/** @var MPEG_ABS_VBRIHeader */
|
||||||
private $_vbriHeader = null;
|
private $_vbriHeader = null;
|
||||||
|
|
||||||
/** @var integer */
|
/** @var integer */
|
||||||
@@ -94,7 +94,7 @@ final class MPEG_Audio extends MPEG_Audio_Object
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructs the MPEG_Audio class with given file and options.
|
* Constructs the MPEG_ABS class with given file and options.
|
||||||
*
|
*
|
||||||
* The following options are currently recognized:
|
* The following options are currently recognized:
|
||||||
* o readmode -- Can be one of full or lazy and determines when the read of
|
* o readmode -- Can be one of full or lazy and determines when the read of
|
||||||
@@ -155,7 +155,7 @@ final class MPEG_Audio extends MPEG_Audio_Object
|
|||||||
$offset = $this->_reader->getOffset();
|
$offset = $this->_reader->getOffset();
|
||||||
|
|
||||||
$this->_frames[] =
|
$this->_frames[] =
|
||||||
$firstFrame = new MPEG_Audio_Frame($this->_reader, $options);
|
$firstFrame = new MPEG_ABS_Frame($this->_reader, $options);
|
||||||
|
|
||||||
$postoffset = $this->_reader->getOffset();
|
$postoffset = $this->_reader->getOffset();
|
||||||
|
|
||||||
@@ -163,12 +163,12 @@ final class MPEG_Audio extends MPEG_Audio_Object
|
|||||||
($offset + 4 + self::$sidesizes
|
($offset + 4 + self::$sidesizes
|
||||||
[$firstFrame->getFrequencyType()][$firstFrame->getMode()]);
|
[$firstFrame->getFrequencyType()][$firstFrame->getMode()]);
|
||||||
if (($xing = $this->_reader->readString8(4)) == "Xing" || $xing == "Info") {
|
if (($xing = $this->_reader->readString8(4)) == "Xing" || $xing == "Info") {
|
||||||
require_once("MPEG/Audio/XINGHeader.php");
|
require_once("MPEG/ABS/XINGHeader.php");
|
||||||
$this->_xingHeader = new MPEG_Audio_XINGHeader($this->_reader, $options);
|
$this->_xingHeader = new MPEG_ABS_XINGHeader($this->_reader, $options);
|
||||||
if ($this->_reader->readString8(4) == "LAME") {
|
if ($this->_reader->readString8(4) == "LAME") {
|
||||||
require_once("MPEG/Audio/LAMEHeader.php");
|
require_once("MPEG/ABS/LAMEHeader.php");
|
||||||
$this->_lameHeader =
|
$this->_lameHeader =
|
||||||
new MPEG_Audio_LAMEHeader($this->_reader, $options);
|
new MPEG_ABS_LAMEHeader($this->_reader, $options);
|
||||||
}
|
}
|
||||||
|
|
||||||
// A header frame is not counted as an audio frame
|
// A header frame is not counted as an audio frame
|
||||||
@@ -177,8 +177,8 @@ final class MPEG_Audio extends MPEG_Audio_Object
|
|||||||
|
|
||||||
$this->_reader->setOffset($offset + 4 + 32);
|
$this->_reader->setOffset($offset + 4 + 32);
|
||||||
if ($this->_reader->readString8(4) == "VBRI") {
|
if ($this->_reader->readString8(4) == "VBRI") {
|
||||||
require_once("MPEG/Audio/VBRIHeader.php");
|
require_once("MPEG/ABS/VBRIHeader.php");
|
||||||
$this->_vbriHeader = new MPEG_Audio_VBRIHeader($this->_reader, $options);
|
$this->_vbriHeader = new MPEG_ABS_VBRIHeader($this->_reader, $options);
|
||||||
|
|
||||||
// A header frame is not counted as an audio frame
|
// A header frame is not counted as an audio frame
|
||||||
array_pop($this->_frames);
|
array_pop($this->_frames);
|
||||||
@@ -238,7 +238,7 @@ final class MPEG_Audio extends MPEG_Audio_Object
|
|||||||
* Returns the Xing VBR header, or <var>null</var> if not found in the audio
|
* Returns the Xing VBR header, or <var>null</var> if not found in the audio
|
||||||
* bitstream.
|
* bitstream.
|
||||||
*
|
*
|
||||||
* @return MPEG_Audio_XINGHeader
|
* @return MPEG_ABS_XINGHeader
|
||||||
*/
|
*/
|
||||||
public function getXingHeader() { return $this->_xingHeader; }
|
public function getXingHeader() { return $this->_xingHeader; }
|
||||||
|
|
||||||
@@ -254,7 +254,7 @@ final class MPEG_Audio extends MPEG_Audio_Object
|
|||||||
* Returns the LAME VBR header, or <var>null</var> if not found in the audio
|
* Returns the LAME VBR header, or <var>null</var> if not found in the audio
|
||||||
* bitstream.
|
* bitstream.
|
||||||
*
|
*
|
||||||
* @return MPEG_Audio_LAMEHeader
|
* @return MPEG_ABS_LAMEHeader
|
||||||
*/
|
*/
|
||||||
public function getLameHeader() { return $this->_lameHeader; }
|
public function getLameHeader() { return $this->_lameHeader; }
|
||||||
|
|
||||||
@@ -270,7 +270,7 @@ final class MPEG_Audio extends MPEG_Audio_Object
|
|||||||
* Returns the Fraunhofer IIS VBR header, or <var>null</var> if not found in
|
* Returns the Fraunhofer IIS VBR header, or <var>null</var> if not found in
|
||||||
* the audio bitstream.
|
* the audio bitstream.
|
||||||
*
|
*
|
||||||
* @return MPEG_Audio_VBRIHeader
|
* @return MPEG_ABS_VBRIHeader
|
||||||
*/
|
*/
|
||||||
public function getVbriHeader() { return $this->_vbriHeader; }
|
public function getVbriHeader() { return $this->_vbriHeader; }
|
||||||
|
|
||||||
@@ -376,7 +376,7 @@ final class MPEG_Audio extends MPEG_Audio_Object
|
|||||||
$this->_reader->setOffset($this->_lastFrameOffset);
|
$this->_reader->setOffset($this->_lastFrameOffset);
|
||||||
|
|
||||||
for ($i = 0; $this->_reader->getOffset() < $this->_bytes; $i++) {
|
for ($i = 0; $this->_reader->getOffset() < $this->_bytes; $i++) {
|
||||||
$frame = new MPEG_Audio_Frame($this->_reader, $options);
|
$frame = new MPEG_ABS_Frame($this->_reader, $options);
|
||||||
|
|
||||||
$this->_cumulativePlayDuration +=
|
$this->_cumulativePlayDuration +=
|
||||||
(double)($frame->getLength() / ($frame->getBitrate() * 1000 / 8));
|
(double)($frame->getLength() / ($frame->getBitrate() * 1000 / 8));
|
||||||
@@ -38,16 +38,16 @@
|
|||||||
/**#@+ @ignore */
|
/**#@+ @ignore */
|
||||||
require_once("Reader.php");
|
require_once("Reader.php");
|
||||||
require_once("Twiddling.php");
|
require_once("Twiddling.php");
|
||||||
require_once("MPEG/Audio/Object.php");
|
require_once("MPEG/ABS/Object.php");
|
||||||
/**#@-*/
|
/**#@-*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This class represents an MPEG Audio frame as described in ISO/IEC 11172-3 and
|
* This class represents an MPEG Audio Bit Stream frame as described in
|
||||||
* ISO/IEC 13818-3 standards.
|
* ISO/IEC 11172-3 and ISO/IEC 13818-3 standards.
|
||||||
*
|
*
|
||||||
* To accommodate fast header processing the error checking data and the audio
|
* To accommodate fast header processing the error checking data and the audio
|
||||||
* data are lazy fetch by default. You can change this behaviour by giving a
|
* data are lazy fetch by default. You can change this behaviour by giving a
|
||||||
* proper option to the {@link MPEG_Audio} class.
|
* proper option to the {@link MPEG_ABS} class.
|
||||||
*
|
*
|
||||||
* @package php-reader
|
* @package php-reader
|
||||||
* @subpackage MPEG
|
* @subpackage MPEG
|
||||||
@@ -57,7 +57,7 @@ require_once("MPEG/Audio/Object.php");
|
|||||||
* @license http://code.google.com/p/php-reader/wiki/License New BSD License
|
* @license http://code.google.com/p/php-reader/wiki/License New BSD License
|
||||||
* @version $Rev: 1 $
|
* @version $Rev: 1 $
|
||||||
*/
|
*/
|
||||||
class MPEG_Audio_Frame extends MPEG_Audio_Object
|
class MPEG_ABS_Frame extends MPEG_ABS_Object
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* The bitrate lookup table. The table has the following format.
|
* The bitrate lookup table. The table has the following format.
|
||||||
@@ -229,7 +229,7 @@ class MPEG_Audio_Frame extends MPEG_Audio_Object
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructs the class with given parameters and reads object related data
|
* Constructs the class with given parameters and reads object related data
|
||||||
* from the MPEG frame.
|
* from the frame.
|
||||||
*
|
*
|
||||||
* @param Reader $reader The reader object.
|
* @param Reader $reader The reader object.
|
||||||
* @param Array $options Array of options.
|
* @param Array $options Array of options.
|
||||||
@@ -38,12 +38,12 @@
|
|||||||
/**#@+ @ignore */
|
/**#@+ @ignore */
|
||||||
require_once("Reader.php");
|
require_once("Reader.php");
|
||||||
require_once("Twiddling.php");
|
require_once("Twiddling.php");
|
||||||
require_once("MPEG/Object.php");
|
require_once("MPEG/ABS/Object.php");
|
||||||
/**#@-*/
|
/**#@-*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This class represents a LAME extension to the Xing VBR header. The purpose of
|
* This class represents a LAME extension to the Xing VBR header. The purpose of
|
||||||
* this header is to provide extra information about the MP3 bistream, encoder
|
* this header is to provide extra information about the audio bistream, encoder
|
||||||
* and parameters used. This header should, as much as possible, be meaningfull
|
* and parameters used. This header should, as much as possible, be meaningfull
|
||||||
* for as many encoders as possible, even if it is unlikely that other encoders
|
* for as many encoders as possible, even if it is unlikely that other encoders
|
||||||
* than LAME will implement it.
|
* than LAME will implement it.
|
||||||
@@ -60,7 +60,7 @@ require_once("MPEG/Object.php");
|
|||||||
* @license http://code.google.com/p/php-reader/wiki/License New BSD License
|
* @license http://code.google.com/p/php-reader/wiki/License New BSD License
|
||||||
* @version $Rev: 1 $
|
* @version $Rev: 1 $
|
||||||
*/
|
*/
|
||||||
class MPEG_Audio_LAMEHeader extends MPEG_Object
|
class MPEG_ABS_LAMEHeader extends MPEG_ABS_Object
|
||||||
{
|
{
|
||||||
|
|
||||||
/** @var integer */
|
/** @var integer */
|
||||||
@@ -40,7 +40,7 @@ require_once("MPEG/Object.php");
|
|||||||
/**#@-*/
|
/**#@-*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The base class for all MPEG Audio objects.
|
* The base class for all MPEG Audio Bit Stream objects.
|
||||||
*
|
*
|
||||||
* @package php-reader
|
* @package php-reader
|
||||||
* @subpackage MPEG
|
* @subpackage MPEG
|
||||||
@@ -50,7 +50,7 @@ require_once("MPEG/Object.php");
|
|||||||
* @license http://code.google.com/p/php-reader/wiki/License New BSD License
|
* @license http://code.google.com/p/php-reader/wiki/License New BSD License
|
||||||
* @version $Rev: 107 $
|
* @version $Rev: 107 $
|
||||||
*/
|
*/
|
||||||
abstract class MPEG_Audio_Object extends MPEG_Object
|
abstract class MPEG_ABS_Object extends MPEG_Object
|
||||||
{
|
{
|
||||||
/** @var integer */
|
/** @var integer */
|
||||||
const VERSION_ONE = 3;
|
const VERSION_ONE = 3;
|
||||||
@@ -38,12 +38,12 @@
|
|||||||
/**#@+ @ignore */
|
/**#@+ @ignore */
|
||||||
require_once("Reader.php");
|
require_once("Reader.php");
|
||||||
require_once("Twiddling.php");
|
require_once("Twiddling.php");
|
||||||
require_once("MPEG/Object.php");
|
require_once("MPEG/ABS/Object.php");
|
||||||
/**#@-*/
|
/**#@-*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This class represents the Fraunhofer IIS VBR header which is often found in
|
* This class represents the Fraunhofer IIS VBR header which is often found in
|
||||||
* the first frame of an MPEG stream.
|
* the first frame of an MPEG Audio Bit Stream.
|
||||||
*
|
*
|
||||||
* @package php-reader
|
* @package php-reader
|
||||||
* @subpackage MPEG
|
* @subpackage MPEG
|
||||||
@@ -53,7 +53,7 @@ require_once("MPEG/Object.php");
|
|||||||
* @license http://code.google.com/p/php-reader/wiki/License New BSD License
|
* @license http://code.google.com/p/php-reader/wiki/License New BSD License
|
||||||
* @version $Rev: 1 $
|
* @version $Rev: 1 $
|
||||||
*/
|
*/
|
||||||
class MPEG_Audio_VBRIHeader extends MPEG_Object
|
class MPEG_ABS_VBRIHeader extends MPEG_ABS_Object
|
||||||
{
|
{
|
||||||
/** @var integer */
|
/** @var integer */
|
||||||
private $_version;
|
private $_version;
|
||||||
@@ -38,12 +38,12 @@
|
|||||||
/**#@+ @ignore */
|
/**#@+ @ignore */
|
||||||
require_once("Reader.php");
|
require_once("Reader.php");
|
||||||
require_once("Twiddling.php");
|
require_once("Twiddling.php");
|
||||||
require_once("MPEG/Object.php");
|
require_once("MPEG/ABS/Object.php");
|
||||||
/**#@-*/
|
/**#@-*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This class represents the Xing VBR header which is often found in the first
|
* This class represents the Xing VBR header which is often found in the first
|
||||||
* frame of an MPEG stream.
|
* frame of an MPEG Audio Bit Stream.
|
||||||
*
|
*
|
||||||
* @package php-reader
|
* @package php-reader
|
||||||
* @subpackage MPEG
|
* @subpackage MPEG
|
||||||
@@ -53,7 +53,7 @@ require_once("MPEG/Object.php");
|
|||||||
* @license http://code.google.com/p/php-reader/wiki/License New BSD License
|
* @license http://code.google.com/p/php-reader/wiki/License New BSD License
|
||||||
* @version $Rev: 1 $
|
* @version $Rev: 1 $
|
||||||
*/
|
*/
|
||||||
class MPEG_Audio_XINGHeader extends MPEG_Object
|
class MPEG_ABS_XINGHeader extends MPEG_ABS_Object
|
||||||
{
|
{
|
||||||
/** @var integer */
|
/** @var integer */
|
||||||
private $_frames = false;
|
private $_frames = false;
|
||||||
@@ -36,8 +36,8 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The MPEG_Exception is thrown whenever an error occurs within the family of
|
* The MPEG_Exception is thrown whenever an error occurs within the MPEG family
|
||||||
* {@link MPEG} classes.
|
* of classes.
|
||||||
*
|
*
|
||||||
* @package php-reader
|
* @package php-reader
|
||||||
* @subpackage MPEG
|
* @subpackage MPEG
|
||||||
|
|||||||
Reference in New Issue
Block a user