cvs: pear /File_Ogg/File Ogg.php /File_Ogg/File/Ogg Bitstream.php Flac.php Speex.php Theora.php Vorbis.php /LiveUser_Admin/docs/examples/example 1
index.php

From: Date: Tue, 08 Nov 2005 19:36:19 +0000
Subject: cvs: pear /File_Ogg/File Ogg.php /File_Ogg/File/Ogg Bitstream.php Flac.php Speex.php Theora.php Vorbis.php /LiveUser_Admin/docs/examples/example 1
index.php
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-36169@lists.php.net to get a copy of this message
djg Tue Nov 8 14:36:19 2005 EDT Modified files: /pear/LiveUser_Admin/docs/examples/example 1 index.php /pear/File_Ogg/File Ogg.php /pear/File_Ogg/File/Ogg Bitstream.php Flac.php Speex.php Theora.php Vorbis.php Log: Documentation and CS changes.

http://cvs.php.net/diff.php/pear/LiveUser_Admin/docs/examples/example/1?r1=&r2=&ty=u http://cvs.php.net/diff.php/pear/LiveUser_Admin/docs/examples/example/index.php?r1=1.7&r2=1.8&ty=u http://cvs.php.net/diff.php/pear/File_Ogg/File/Ogg.php?r1=1.9&r2=1.10&ty=u Index: pear/File_Ogg/File/Ogg.php diff -u pear/File_Ogg/File/Ogg.php:1.9 pear/File_Ogg/File/Ogg.php:1.10 --- pear/File_Ogg/File/Ogg.php:1.9 Mon Nov 7 09:21:21 2005 +++ pear/File_Ogg/File/Ogg.php Tue Nov 8 14:36:09 2005 @@ -1,81 +1,102 @@ <?php /* vim: set expandtab tabstop=4 shiftwidth=4: */ -// +--------------------------------------------------------------------------------+ -// | File_Ogg PEAR Package for Accessing Ogg Bitstreams | -// | Copyright (c) 2005 David Grant <david@grant.org.uk> | -// +--------------------------------------------------------------------------------+ -// | This library is free software; you can redistribute it and/or | -// | modify it under the terms of the GNU Lesser General Public | -// | License as published by the Free Software Foundation; either | -// | version 2.1 of the License, or (at your option) any later version. | -// | | -// | This library is distributed in the hope that it will be useful, | -// | but WITHOUT ANY WARRANTY; without even the implied warranty of | -// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | -// | Lesser General Public License for more details. | -// | | -// | You should have received a copy of the GNU Lesser General Public | -// | License along with this library; if not, write to the Free Software | -// | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | -// +--------------------------------------------------------------------------------+ +// +----------------------------------------------------------------------------+ +// | File_Ogg PEAR Package for Accessing Ogg Bitstreams | +// | Copyright (c) 2005 David Grant <david@grant.org.uk> | +// +----------------------------------------------------------------------------+ +// | This library is free software; you can redistribute it and/or | +// | modify it under the terms of the GNU Lesser General Public | +// | License as published by the Free Software Foundation; either | +// | version 2.1 of the License, or (at your option) any later version. | +// | | +// | This library is distributed in the hope that it will be useful, | +// | but WITHOUT ANY WARRANTY; without even the implied warranty of | +// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | +// | Lesser General Public License for more details. | +// | | +// | You should have received a copy of the GNU Lesser General Public | +// | License along with this library; if not, write to the Free Software | +// | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | +// +----------------------------------------------------------------------------+ /** - * @author David Grant <david@grant.org.uk> + * @author David Grant <david@grant.org.uk> * @category File - * @copyright David Grant <david@grant.org.uk> - * @license http://www.gnu.org/copyleft/lesser.html GNU LGPL - * @link http://pear.php.net/package/File_Ogg - * @package File_Ogg - * @version CVS: $Id: Ogg.php,v 1.9 2005/11/07 14:21:21 djg Exp $ + * @copyright David Grant <david@grant.org.uk> + * @license http://www.gnu.org/copyleft/lesser.html GNU LGPL + * @link http://pear.php.net/package/File_Ogg + * @package File_Ogg + * @version CVS: $Id: Ogg.php,v 1.10 2005/11/08 19:36:09 djg Exp $ */ require_once('PEAR.php'); -require_once('File/Ogg/Bitstream.php'); +require_once('Ogg' . DIRECTORY_SEPARATOR . 'Bitstream.php'); -define("OGG_STREAM_VORBIS", 1); -define("OGG_STREAM_THEORA", 2); -define("OGG_STREAM_SPEEX", 3); -define("OGG_STREAM_FLAC", 4); +/** + * @access public + */ +define("OGG_STREAM_VORBIS", 1); +/** + * @access public + */ +define("OGG_STREAM_THEORA", 2); +/** + * @access public + */ +define("OGG_STREAM_SPEEX", 3); +/** + * @access public + */ +define("OGG_STREAM_FLAC", 4); /** * Capture pattern to determine if a file is an Ogg physical stream. + * @access private */ define("OGG_CAPTURE_PATTERN", "OggS"); /** * Maximum size of an Ogg stream page plus four. This value is specified to allow * efficient parsing of the physical stream. The extra four is a paranoid measure * to make sure a capture pattern is not split into two parts accidentally. + * @access private */ define("OGG_MAXIMUM_PAGE_SIZE", 65311); /** * Capture pattern for an Ogg Vorbis logical stream. + * @access private */ define("OGG_STREAM_CAPTURE_VORBIS", "vorbis"); /** * Capture pattern for an Ogg Speex logical stream. + * @access private */ -define("OGG_STREAM_CAPTURE_SPEEX", "Speex "); +define("OGG_STREAM_CAPTURE_SPEEX", "Speex "); /** * Capture pattern for an Ogg FLAC logical stream. + * @access private */ -define("OGG_STREAM_CAPTURE_FLAC", "fLaC"); +define("OGG_STREAM_CAPTURE_FLAC", "fLaC"); /** * Capture pattern for an Ogg Theora logical stream. + * @access private */ define("OGG_STREAM_CAPTURE_THEORA", "theora"); /** * Error thrown if the file location passed is nonexistant or unreadable. + * @access private */ -define("OGG_ERROR_INVALID_FILE", 1); +define("OGG_ERROR_INVALID_FILE", 1); /** * Error thrown if the user attempts to extract an unsupported logical stream. + * @access private */ -define("OGG_ERROR_UNSUPPORTED", 2); +define("OGG_ERROR_UNSUPPORTED", 2); /** * Error thrown if the user attempts to extract an logical stream with no * corresponding serial number. + * @access private */ -define("OGG_ERROR_BAD_SERIAL", 3); +define("OGG_ERROR_BAD_SERIAL", 3); /** * Class for parsing a ogg bitstream. @@ -124,19 +145,19 @@ { clearstatcache(); if (! file_exists($fileLocation)) { - PEAR::raiseError("Couldn't Open File. Check File Path.", OGG_ERROR_INVALID_FILE); - return; + PEAR::raiseError("Couldn't Open File. Check File Path.", OGG_ERROR_INVALID_FILE); + return; } $this->_filePointer = fopen($fileLocation, "rb"); if (is_resource($this->_filePointer)) $this->_splitStreams(); - else + else PEAR::raiseError("Couldn't Open File. Check File Permissions.", OGG_ERROR_INVALID_FILE); } /** - * @access private + * @access private */ function _decodePageHeader($pageData, $pageOffset, $pageFinish) { @@ -148,33 +169,33 @@ if ($stream_version['data'] != 0x00) return (FALSE); - $header_flag = unpack("cdata", substr($pageData, 5, 1)); - $abs_granual_pos = unpack("Vdata", substr($pageData, 6, 8)); + $header_flag = unpack("cdata", substr($pageData, 5, 1)); + $abs_granual_pos = unpack("Vdata", substr($pageData, 6, 8)); // Serial number for the current datastream. - $stream_serial = unpack("Vdata", substr($pageData, 14, 4)); - $page_sequence = unpack("Vdata", substr($pageData, 18, 4)); - $checksum = unpack("Vdata", substr($pageData, 22, 4)); - $page_segments = unpack("cdata", substr($pageData, 26, 1)); - $segments_total = 0; + $stream_serial = unpack("Vdata", substr($pageData, 14, 4)); + $page_sequence = unpack("Vdata", substr($pageData, 18, 4)); + $checksum = unpack("Vdata", substr($pageData, 22, 4)); + $page_segments = unpack("cdata", substr($pageData, 26, 1)); + $segments_total = 0; for ($i = 0; $i < $page_segments['data']; ++$i) { - $segments = unpack("Cdata", substr($pageData, 26 + ($i + 1), 1)); + $segments = unpack("Cdata", substr($pageData, 26 + ($i + 1), 1)); $segments_total += $segments['data']; } - $this->_streamList[$stream_serial['data']]['stream_page'][$page_sequence['data']]['stream_version'] = $stream_version['data']; - $this->_streamList[$stream_serial['data']]['stream_page'][$page_sequence['data']]['header_flag'] = $header_flag['data']; - $this->_streamList[$stream_serial['data']]['stream_page'][$page_sequence['data']]['abs_granual_pos'] = $abs_granual_pos['data']; - $this->_streamList[$stream_serial['data']]['stream_page'][$page_sequence['data']]['checksum'] = $checksum['data']; - $this->_streamList[$stream_serial['data']]['stream_page'][$page_sequence['data']]['segments'] = $segments_total; - $this->_streamList[$stream_serial['data']]['stream_page'][$page_sequence['data']]['head_offset'] = $pageOffset; - $this->_streamList[$stream_serial['data']]['stream_page'][$page_sequence['data']]['body_offset'] = $pageOffset + 26 + $page_segments['data'] + 1; - $this->_streamList[$stream_serial['data']]['stream_page'][$page_sequence['data']]['body_finish'] = $pageFinish; - $this->_streamList[$stream_serial['data']]['stream_page'][$page_sequence['data']]['data_length'] = $pageFinish - $pageOffset; + $this->_streamList[$stream_serial['data']]['stream_page'][$page_sequence['data']]['stream_version'] = $stream_version['data']; + $this->_streamList[$stream_serial['data']]['stream_page'][$page_sequence['data']]['header_flag'] = $header_flag['data']; + $this->_streamList[$stream_serial['data']]['stream_page'][$page_sequence['data']]['abs_granual_pos'] = $abs_granual_pos['data']; + $this->_streamList[$stream_serial['data']]['stream_page'][$page_sequence['data']]['checksum'] = $checksum['data']; + $this->_streamList[$stream_serial['data']]['stream_page'][$page_sequence['data']]['segments'] = $segments_total; + $this->_streamList[$stream_serial['data']]['stream_page'][$page_sequence['data']]['head_offset'] = $pageOffset; + $this->_streamList[$stream_serial['data']]['stream_page'][$page_sequence['data']]['body_offset'] = $pageOffset + 26 + $page_segments['data'] + 1; + $this->_streamList[$stream_serial['data']]['stream_page'][$page_sequence['data']]['body_finish'] = $pageFinish; + $this->_streamList[$stream_serial['data']]['stream_page'][$page_sequence['data']]['data_length'] = $pageFinish - $pageOffset; return (TRUE); } /** - * @access private + * @access private */ function _splitStreams() { @@ -188,7 +209,7 @@ // 4 bytes are added to ensure that the capture pattern of the next // pages comes through. if (! ($stream_data = fread($this->_filePointer, OGG_MAXIMUM_PAGE_SIZE))) - break; + break; // Split the data into various pages. $stream_pages = explode(OGG_CAPTURE_PATTERN, $stream_data); @@ -200,7 +221,7 @@ // two iterations from the loop. $number_pages = (strlen($stream_data) == OGG_MAXIMUM_PAGE_SIZE) ? count($stream_pages) - 2 : count($stream_pages) - 1; if (! count($stream_pages)) - break; + break; for ($i = 1; $i <= $number_pages; ++$i) { $stream_pages[$i] = OGG_CAPTURE_PATTERN . $stream_pages[$i]; @@ -234,7 +255,7 @@ /** * Returns the appropriate logical bitstream that corresponds to the provided serial. * - * This function returns a logical bitstream contained within the ogg physical + * This function returns a logical bitstream contained within the Ogg physical * stream, corresponding to the serial used as the offset for that bitstream. * The returned stream may be Vorbis, Speex, FLAC or Theora, although the only * usable bitstream is Vorbis. @@ -244,28 +265,21 @@ function getStream($streamSerial) { if (! array_key_exists($streamSerial, $this->_streamList)) - PEAR::raiseError("The stream number is invalid.", OGG_ERROR_BAD_SERIAL); + PEAR::raiseError("The stream number is invalid.", OGG_ERROR_BAD_SERIAL); switch ($this->_streamList[$streamSerial]['stream_type']) { case (OGG_STREAM_VORBIS): - require_once("File/Ogg/Vorbis.php"); + require_once("Ogg/Vorbis.php"); return (new File_Ogg_Vorbis($streamSerial, $this->_streamList[$streamSerial], $this->_filePointer)); - break; case (OGG_STREAM_SPEEX): - require_once("File/Ogg/Speex.php"); + require_once("Ogg/Speex.php"); return (new File_Ogg_Speex($streamSerial, $this->_streamList[$streamSerial], $this->_filePointer)); - // PEAR::raiseError("Speex streams are not currently supported.", OGG_ERROR_UNSUPPORTED); - break; case (OGG_STREAM_FLAC): - require_once("File/Ogg/Flac.php"); + require_once("Ogg/Flac.php"); return (new File_Ogg_Flac($streamSerial, $this->_streamList[$streamSerial], $this->_filePointer)); - // PEAR::raiseError("FLAC streams are not currently supported.", OGG_ERROR_UNSUPPORTED); - break; case (OGG_STREAM_THEORA): - require_once("File/Ogg/Theora.php"); + require_once("Ogg/Theora.php"); return (new File_Ogg_Theora($streamSerial, $this->_streamList[$streamSerial], $this->_filePointer)); - // PEAR::raiseError("Theora streams are not currently supported.", OGG_ERROR_UNSUPPORTED); - break; default: PEAR::raiseError("This stream could not be identified.", OGG_ERROR_UNSUPPORTED); } @@ -279,7 +293,8 @@ * bitstream corresponding to the supplied type. If one is found, the function returns * true, otherwise it return false. * - * @param int $streamType + * @param int $streamType + * @return boolean */ function hasStream($streamType) { @@ -298,23 +313,27 @@ * are returned, as an array of serial numbers. If no filter is provided, this * function returns a two-dimensional array, with the stream type as the primary key, * and a value consisting of an array of stream serial numbers. + * + * @param int $filter + * @return array */ function listStreams($filter = null) { $streams = array(); foreach ($this->_streamList as $stream_serial => $stream) { - if (! isset($streams[$stream['stream_type']])) - $streams[$stream['stream_type']] = array(); - - $streams[$stream['stream_type']][] = $stream_serial; + if (! isset($streams[$stream['stream_type']])) + // Initialise the result list for this stream type. + $streams[$stream['stream_type']] = array(); + + $streams[$stream['stream_type']][] = $stream_serial; } if (is_null($filter)) - return ($streams); + return ($streams); elseif (isset($streams[$filter])) - return ($streams[$filter]); + return ($streams[$filter]); else - return array(); + return array(); } } ?> \ No newline at end of file http://cvs.php.net/diff.php/pear/File_Ogg/File/Ogg/Bitstream.php?r1=1.2&r2=1.3&ty=u Index: pear/File_Ogg/File/Ogg/Bitstream.php diff -u pear/File_Ogg/File/Ogg/Bitstream.php:1.2 pear/File_Ogg/File/Ogg/Bitstream.php:1.3 --- pear/File_Ogg/File/Ogg/Bitstream.php:1.2 Thu Nov 3 09:14:52 2005 +++ pear/File_Ogg/File/Ogg/Bitstream.php Tue Nov 8 14:36:18 2005 @@ -1,32 +1,32 @@ <?php /* vim: set expandtab tabstop=4 shiftwidth=4: */ -// +--------------------------------------------------------------------------------+ -// | File_Ogg PEAR Package for Accessing Ogg Bitstreams | -// | Copyright (c) 2005 David Grant <david@grant.org.uk> | -// +--------------------------------------------------------------------------------+ -// | This library is free software; you can redistribute it and/or | -// | modify it under the terms of the GNU Lesser General Public | -// | License as published by the Free Software Foundation; either | -// | version 2.1 of the License, or (at your option) any later version. | -// | | -// | This library is distributed in the hope that it will be useful, | -// | but WITHOUT ANY WARRANTY; without even the implied warranty of | -// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | -// | Lesser General Public License for more details. | -// | | -// | You should have received a copy of the GNU Lesser General Public | -// | License along with this library; if not, write to the Free Software | -// | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | -// +--------------------------------------------------------------------------------+ +// +----------------------------------------------------------------------------+ +// | File_Ogg PEAR Package for Accessing Ogg Bitstreams | +// | Copyright (c) 2005 David Grant <david@grant.org.uk> | +// +----------------------------------------------------------------------------+ +// | This library is free software; you can redistribute it and/or | +// | modify it under the terms of the GNU Lesser General Public | +// | License as published by the Free Software Foundation; either | +// | version 2.1 of the License, or (at your option) any later version. | +// | | +// | This library is distributed in the hope that it will be useful, | +// | but WITHOUT ANY WARRANTY; without even the implied warranty of | +// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | +// | Lesser General Public License for more details. | +// | | +// | You should have received a copy of the GNU Lesser General Public | +// | License along with this library; if not, write to the Free Software | +// | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | +// +----------------------------------------------------------------------------+ /** - * @author David Grant <david@grant.org.uk> - * @category File - * @copyright David Grant <david@grant.org.uk> - * @license http://www.gnu.org/copyleft/lesser.html GNU LGPL - * @link http://pear.php.net/package/File_Ogg - * @package File_Ogg - * @version CVS: $Id: Bitstream.php,v 1.2 2005/11/03 14:14:52 djg Exp $ + * @author David Grant <david@grant.org.uk> + * @category File + * @copyright David Grant <david@grant.org.uk> + * @license http://www.gnu.org/copyleft/lesser.html GNU LGPL + * @link http://pear.php.net/package/File_Ogg + * @package File_Ogg + * @version CVS: $Id: Bitstream.php,v 1.3 2005/11/08 19:36:18 djg Exp $ */ class File_Ogg_Bitstream { @@ -37,9 +37,22 @@ * @access private */ var $_streamSerial; - var $_streamList; - var $_filePointer; - + /** + * @access private + */ + var $_streamList; + /** + * @access private + */ + var $_filePointer; + /** + * The number of bits used in this stream. + * + * @var int + * @access private + */ + var $_streamSize; + /** * Gives the serial number of this stream. * @@ -54,5 +67,19 @@ { return ($this->_streamSerial); } + + /** + * Gives the size (in bits) of this stream. + * + * This function returns the size of the Vorbis stream within the Ogg + * physical stream. + * + * @return int + * @access public + */ + function getSize() + { + return ($this->_streamSize); + } } ?> \ No newline at end of file http://cvs.php.net/diff.php/pear/File_Ogg/File/Ogg/Flac.php?r1=1.5&r2=1.6&ty=u Index: pear/File_Ogg/File/Ogg/Flac.php diff -u pear/File_Ogg/File/Ogg/Flac.php:1.5 pear/File_Ogg/File/Ogg/Flac.php:1.6 --- pear/File_Ogg/File/Ogg/Flac.php:1.5 Thu Nov 3 09:14:52 2005 +++ pear/File_Ogg/File/Ogg/Flac.php Tue Nov 8 14:36:18 2005 @@ -1,39 +1,42 @@ <?php /* vim: set expandtab tabstop=4 shiftwidth=4: */ -// +--------------------------------------------------------------------------------+ -// | File_Ogg PEAR Package for Accessing Ogg Bitstreams | -// | Copyright (c) 2005 David Grant <david@grant.org.uk> | -// +--------------------------------------------------------------------------------+ -// | This library is free software; you can redistribute it and/or | -// | modify it under the terms of the GNU Lesser General Public | -// | License as published by the Free Software Foundation; either | -// | version 2.1 of the License, or (at your option) any later version. | -// | | -// | This library is distributed in the hope that it will be useful, | -// | but WITHOUT ANY WARRANTY; without even the implied warranty of | -// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | -// | Lesser General Public License for more details. | -// | | -// | You should have received a copy of the GNU Lesser General Public | -// | License along with this library; if not, write to the Free Software | -// | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | -// +--------------------------------------------------------------------------------+ +// +----------------------------------------------------------------------------+ +// | File_Ogg PEAR Package for Accessing Ogg Bitstreams | +// | Copyright (c) 2005 David Grant <david@grant.org.uk> | +// +----------------------------------------------------------------------------+ +// | This library is free software; you can redistribute it and/or | +// | modify it under the terms of the GNU Lesser General Public | +// | License as published by the Free Software Foundation; either | +// | version 2.1 of the License, or (at your option) any later version. | +// | | +// | This library is distributed in the hope that it will be useful, | +// | but WITHOUT ANY WARRANTY; without even the implied warranty of | +// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | +// | Lesser General Public License for more details. | +// | | +// | You should have received a copy of the GNU Lesser General Public | +// | License along with this library; if not, write to the Free Software | +// | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | +// +----------------------------------------------------------------------------+ require_once('File/Ogg/Bitstream.php'); /** - * @author David Grant <david@grant.org.uk> - * @category File - * @copyright David Grant <david@grant.org.uk> - * @license http://www.gnu.org/copyleft/lesser.html GNU LGPL - * @link http://pear.php.net/package/File_Ogg - * @package File_Ogg - * @version CVS: $Id: Flac.php,v 1.5 2005/11/03 14:14:52 djg Exp $ + * @author David Grant <david@grant.org.uk> + * @category File + * @copyright David Grant <david@grant.org.uk> + * @license http://www.gnu.org/copyleft/lesser.html GNU LGPL + * @link http://pear.php.net/package/File_Ogg + * @package File_Ogg + * @version CVS: $Id: Flac.php,v 1.6 2005/11/08 19:36:18 djg Exp $ */ class File_Ogg_Flac extends File_Ogg_Bitstream { + /** + * @access private + */ function File_Ogg_Flac() - { - } + { + } } ?> \ No newline at end of file http://cvs.php.net/diff.php/pear/File_Ogg/File/Ogg/Speex.php?r1=1.6&r2=1.7&ty=u Index: pear/File_Ogg/File/Ogg/Speex.php diff -u pear/File_Ogg/File/Ogg/Speex.php:1.6 pear/File_Ogg/File/Ogg/Speex.php:1.7 --- pear/File_Ogg/File/Ogg/Speex.php:1.6 Thu Nov 3 09:14:53 2005 +++ pear/File_Ogg/File/Ogg/Speex.php Tue Nov 8 14:36:18 2005 @@ -1,39 +1,42 @@ <?php /* vim: set expandtab tabstop=4 shiftwidth=4: */ -// +--------------------------------------------------------------------------------+ -// | File_Ogg PEAR Package for Accessing Ogg Bitstreams | -// | Copyright (c) 2005 David Grant <david@grant.org.uk> | -// +--------------------------------------------------------------------------------+ -// | This library is free software; you can redistribute it and/or | -// | modify it under the terms of the GNU Lesser General Public | -// | License as published by the Free Software Foundation; either | -// | version 2.1 of the License, or (at your option) any later version. | -// | | -// | This library is distributed in the hope that it will be useful, | -// | but WITHOUT ANY WARRANTY; without even the implied warranty of | -// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | -// | Lesser General Public License for more details. | -// | | -// | You should have received a copy of the GNU Lesser General Public | -// | License along with this library; if not, write to the Free Software | -// | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | -// +--------------------------------------------------------------------------------+ +// +----------------------------------------------------------------------------+ +// | File_Ogg PEAR Package for Accessing Ogg Bitstreams | +// | Copyright (c) 2005 David Grant <david@grant.org.uk> | +// +----------------------------------------------------------------------------+ +// | This library is free software; you can redistribute it and/or | +// | modify it under the terms of the GNU Lesser General Public | +// | License as published by the Free Software Foundation; either | +// | version 2.1 of the License, or (at your option) any later version. | +// | | +// | This library is distributed in the hope that it will be useful, | +// | but WITHOUT ANY WARRANTY; without even the implied warranty of | +// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | +// | Lesser General Public License for more details. | +// | | +// | You should have received a copy of the GNU Lesser General Public | +// | License along with this library; if not, write to the Free Software | +// | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | +// +----------------------------------------------------------------------------+ require_once('File/Ogg/Bitstream.php'); /** - * @author David Grant <david@grant.org.uk> - * @category File - * @copyright David Grant <david@grant.org.uk> - * @license http://www.gnu.org/copyleft/lesser.html GNU LGPL - * @link http://pear.php.net/package/File_Ogg - * @package File_Ogg - * @version CVS: $Id: Speex.php,v 1.6 2005/11/03 14:14:53 djg Exp $ + * @author David Grant <david@grant.org.uk> + * @category File + * @copyright David Grant <david@grant.org.uk> + * @license http://www.gnu.org/copyleft/lesser.html GNU LGPL + * @link http://pear.php.net/package/File_Ogg + * @package File_Ogg + * @version CVS: $Id: Speex.php,v 1.7 2005/11/08 19:36:18 djg Exp $ */ class File_Ogg_Speex extends File_Ogg_Bitstream { - function File_Ogg_Speex() - { - } + /** + * @access private + */ + function File_Ogg_Speex() + { + } } ?> \ No newline at end of file http://cvs.php.net/diff.php/pear/File_Ogg/File/Ogg/Theora.php?r1=1.5&r2=1.6&ty=u Index: pear/File_Ogg/File/Ogg/Theora.php diff -u pear/File_Ogg/File/Ogg/Theora.php:1.5 pear/File_Ogg/File/Ogg/Theora.php:1.6 --- pear/File_Ogg/File/Ogg/Theora.php:1.5 Thu Nov 3 09:14:53 2005 +++ pear/File_Ogg/File/Ogg/Theora.php Tue Nov 8 14:36:18 2005 @@ -1,39 +1,42 @@ <?php /* vim: set expandtab tabstop=4 shiftwidth=4: */ -// +--------------------------------------------------------------------------------+ -// | File_Ogg PEAR Package for Accessing Ogg Bitstreams | -// | Copyright (c) 2005 David Grant <david@grant.org.uk> | -// +--------------------------------------------------------------------------------+ -// | This library is free software; you can redistribute it and/or | -// | modify it under the terms of the GNU Lesser General Public | -// | License as published by the Free Software Foundation; either | -// | version 2.1 of the License, or (at your option) any later version. | -// | | -// | This library is distributed in the hope that it will be useful, | -// | but WITHOUT ANY WARRANTY; without even the implied warranty of | -// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | -// | Lesser General Public License for more details. | -// | | -// | You should have received a copy of the GNU Lesser General Public | -// | License along with this library; if not, write to the Free Software | -// | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | -// +--------------------------------------------------------------------------------+ +// +----------------------------------------------------------------------------+ +// | File_Ogg PEAR Package for Accessing Ogg Bitstreams | +// | Copyright (c) 2005 David Grant <david@grant.org.uk> | +// +----------------------------------------------------------------------------+ +// | This library is free software; you can redistribute it and/or | +// | modify it under the terms of the GNU Lesser General Public | +// | License as published by the Free Software Foundation; either | +// | version 2.1 of the License, or (at your option) any later version. | +// | | +// | This library is distributed in the hope that it will be useful, | +// | but WITHOUT ANY WARRANTY; without even the implied warranty of | +// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | +// | Lesser General Public License for more details. | +// | | +// | You should have received a copy of the GNU Lesser General Public | +// | License along with this library; if not, write to the Free Software | +// | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | +// +----------------------------------------------------------------------------+ require_once('File/Ogg/Bitstream.php'); /** - * @author David Grant <david@grant.org.uk> - * @category File - * @copyright David Grant <david@grant.org.uk> - * @license http://www.gnu.org/copyleft/lesser.html GNU LGPL - * @link http://pear.php.net/package/File_Ogg - * @package File_Ogg - * @version CVS: $Id: Theora.php,v 1.5 2005/11/03 14:14:53 djg Exp $ + * @author David Grant <david@grant.org.uk> + * @category File + * @copyright David Grant <david@grant.org.uk> + * @license http://www.gnu.org/copyleft/lesser.html GNU LGPL + * @link http://pear.php.net/package/File_Ogg + * @package File_Ogg + * @version CVS: $Id: Theora.php,v 1.6 2005/11/08 19:36:18 djg Exp $ */ class File_Ogg_Theora extends File_Ogg_Bitstream { - function File_Ogg_Theora() - { - } + /** + * @access private + */ + function File_Ogg_Theora() + { + } } ?> \ No newline at end of file http://cvs.php.net/diff.php/pear/File_Ogg/File/Ogg/Vorbis.php?r1=1.8&r2=1.9&ty=u Index: pear/File_Ogg/File/Ogg/Vorbis.php diff -u pear/File_Ogg/File/Ogg/Vorbis.php:1.8 pear/File_Ogg/File/Ogg/Vorbis.php:1.9 --- pear/File_Ogg/File/Ogg/Vorbis.php:1.8 Mon Nov 7 09:21:22 2005 +++ pear/File_Ogg/File/Ogg/Vorbis.php Tue Nov 8 14:36:18 2005 @@ -1,45 +1,50 @@ <?php /* vim: set expandtab tabstop=4 shiftwidth=4: */ -// +--------------------------------------------------------------------------------+ -// | File_Ogg PEAR Package for Accessing Ogg Bitstreams | -// | Copyright (c) 2005 David Grant <david@grant.org.uk> | -// +--------------------------------------------------------------------------------+ -// | This library is free software; you can redistribute it and/or | -// | modify it under the terms of the GNU Lesser General Public | -// | License as published by the Free Software Foundation; either | -// | version 2.1 of the License, or (at your option) any later version. | -// | | -// | This library is distributed in the hope that it will be useful, | -// | but WITHOUT ANY WARRANTY; without even the implied warranty of | -// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | -// | Lesser General Public License for more details. | -// | | -// | You should have received a copy of the GNU Lesser General Public | -// | License along with this library; if not, write to the Free Software | -// | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | -// +--------------------------------------------------------------------------------+ +// +----------------------------------------------------------------------------+ +// | File_Ogg PEAR Package for Accessing Ogg Bitstreams | +// | Copyright (c) 2005 David Grant <david@grant.org.uk> | +// +----------------------------------------------------------------------------+ +// | This library is free software; you can redistribute it and/or | +// | modify it under the terms of the GNU Lesser General Public | +// | License as published by the Free Software Foundation; either | +// | version 2.1 of the License, or (at your option) any later version. | +// | | +// | This library is distributed in the hope that it will be useful, | +// | but WITHOUT ANY WARRANTY; without even the implied warranty of | +// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | +// | Lesser General Public License for more details. | +// | | +// | You should have received a copy of the GNU Lesser General Public | +// | License along with this library; if not, write to the Free Software | +// | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | +// +----------------------------------------------------------------------------+ require_once('File/Ogg/Bitstream.php'); /** - * Check number for the first header in a Vorbis stream. + * Check number for the first header in a Vorbis stream. + * @access private */ define("OGG_VORBIS_IDENTIFICATION_HEADER", 1); /** - * Check number for the second header in a Vorbis stream. + * Check number for the second header in a Vorbis stream. + * @access private */ define("OGG_VORBIS_COMMENTS_HEADER", 3); /** - * Check number for the third header in a Vorbis stream. + * Check number for the third header in a Vorbis stream. + * @access private */ define("OGG_VORBIS_SETUP_HEADER", 5); /** - * Error thrown if the stream appears to be corrupted. + * Error thrown if the stream appears to be corrupted. + * @access private */ define("OGG_VORBIS_ERROR_UNDECODABLE", 1); /** - * Error thrown if the user attempts to extract a comment using a comment key - * that does not exist. + * Error thrown if the user attempts to extract a comment using a comment key + * that does not exist. + * @access private */ define("OGG_VORBIS_ERROR_INVALID_COMMENT", 2); @@ -54,20 +59,20 @@ * @link http://www.xiph.org/ogg/vorbis/docs.html * @link http://www.xiph.org/ogg/vorbis/doc/vorbis-ogg.html * - * @author David Grant <david@grant.org.uk> - * @category File - * @copyright David Grant <david@grant.org.uk> - * @license http://www.gnu.org/copyleft/lesser.html GNU LGPL - * @link http://pear.php.net/package/File_Ogg - * @package File_Ogg - * @version CVS: $Id: Vorbis.php,v 1.8 2005/11/07 14:21:22 djg Exp $ + * @author David Grant <david@grant.org.uk> + * @category File + * @copyright David Grant <david@grant.org.uk> + * @license http://www.gnu.org/copyleft/lesser.html GNU LGPL + * @link http://pear.php.net/package/File_Ogg + * @package File_Ogg + * @version CVS: $Id: Vorbis.php,v 1.9 2005/11/08 19:36:18 djg Exp $ */ class File_Ogg_Vorbis extends File_Ogg_Bitstream { /** * Array to hold each of the comments. * - * @var array + * @var array * @access private */ var $_comments = array(); @@ -75,7 +80,7 @@ /** * Version of vorbis specification used. * - * @var int + * @var int * @access private */ var $_version; @@ -83,7 +88,7 @@ /** * Number of channels in the vorbis stream. * - * @var int + * @var int * @access private */ var $_channels; @@ -91,7 +96,7 @@ /** * Number of samples per second in the vorbis stream. * - * @var int + * @var int * @access private */ var $_sampleRate; @@ -99,7 +104,7 @@ /** * Minimum bitrate for the vorbis stream. * - * @var int + * @var int * @access private */ var $_minBitrate; @@ -107,7 +112,7 @@ /** * Maximum bitrate for the vorbis stream. * - * @var int + * @var int * @access private */ var $_maxBitrate; @@ -115,7 +120,7 @@ /** * Nominal bitrate for the vorbis stream. * - * @var int + * @var int * @access private */ var $_nomBitrate; @@ -123,7 +128,7 @@ /** * Average bitrate for the vorbis stream. * - * @var float + * @var float * @access private */ var $_avgBitrate; @@ -131,7 +136,7 @@ /** * Vendor string for the vorbis stream. * - * @var string + * @var string * @access private */ var $_vendor; @@ -139,20 +144,12 @@ /** * The length of this stream in seconds. * - * @var int + * @var int * @access private */ var $_streamLength; /** - * The number of bits used in this stream. - * - * @var int - * @access private - */ - var $_streamSize; - - /** * Constructor for accessing a Vorbis logical stream. * * This method is the constructor for the native-PHP interface to a Vorbis logical @@ -162,23 +159,23 @@ * @param array $streamData Data for the requested logical stream. * @param string $filePath Location of a file on the filesystem. * @param pointer $filePointer File pointer for the current physical stream. - * @access public + * @access private */ - function File_Ogg_Vorbis($streamSerial, $streamData, $filePointer) - { - $this->_streamSerial = $streamSerial; - $this->_streamList = $streamData; - $this->_filePointer = $filePointer; + function File_Ogg_Vorbis($streamSerial, $streamData, $filePointer) + { + $this->_streamSerial = $streamSerial; + $this->_streamList = $streamData; + $this->_filePointer = $filePointer; $this->_decodeIdentificationHeader(); $this->_decodeCommentsHeader(); - $this->_streamLength = round($streamData['stream_page'][count($streamData['stream_page']) - 1]['abs_granual_pos'] / $this->_sampleRate); + $this->_streamLength = round($streamData['stream_page'][count($streamData['stream_page']) - 1]['abs_granual_pos'] / $this->_sampleRate); // This gives an accuracy of approximately 99.7% to the streamsize of ogginfo. for ($i = 0; $i < count($streamData['stream_page']); ++$i) $this->_streamSize += $streamData['stream_page'][$i]['data_length']; - - $this->_avgBitrate = round(($this->_streamSize * 8) / $this->_streamLength); - } - + + $this->_avgBitrate = round(($this->_streamSize * 8) / $this->_streamLength); + } + /** * Parse the identification header (the first of three headers) in a Vorbis stream. * @@ -192,16 +189,16 @@ */ function _decodeIdentificationHeader() { - $this->_decodeCommonHeader(OGG_VORBIS_IDENTIFICATION_HEADER, 0); - + $this->_decodeCommonHeader(OGG_VORBIS_IDENTIFICATION_HEADER, 0); + $version = unpack("Vdata", fread($this->_filePointer, 4)); - + // The Vorbis stream version must be 0. if ($version['data'] == 0) - $this->_version = $version['data']; + $this->_version = $version['data']; else PEAR::raiseError("Stream is undecodable due to an invalid vorbis stream version.", OGG_VORBIS_ERROR_UNDECODABLE); - + // The number of channels is stored in an 8 bit unsigned integer, // with a maximum of 255 channels. $channels = unpack("Cdata", fread($this->_filePointer, 1)); @@ -210,50 +207,55 @@ PEAR::raiseError("Stream is undecodable due to zero channels.", OGG_VORBIS_ERROR_UNDECODABLE); else $this->_channels = $channels['data']; - - // The sample rate is a 32 bit unsigned integer. + + // The sample rate is a 32 bit unsigned integer. $sample_rate = unpack("Vdata", fread($this->_filePointer, 4)); // The sample rate MUST be greater than 0. if ($sample_rate['data'] == 0) PEAR::raiseError("Stream is undecodable due to a zero sample rate.", OGG_VORBIS_ERROR_UNDECODABLE); else $this->_sampleRate = $sample_rate['data']; - + // Extract the various bitrates from the vorbis stream. - $bitrate['max'] = unpack("Vdata", fread($this->_filePointer, 4)); - $this->_maxBitrate = $bitrate['max']['data']; - $bitrate['nom'] = unpack("Vdata", fread($this->_filePointer, 4)); - $this->_nomBitrate = $bitrate['nom']['data']; - $bitrate['min'] = unpack("Vdata", fread($this->_filePointer, 4)); - $this->_minBitrate = $bitrate['min']['data']; - + $bitrate['max'] = unpack("Vdata", fread($this->_filePointer, 4)); + $this->_maxBitrate = $bitrate['max']['data']; + $bitrate['nom'] = unpack("Vdata", fread($this->_filePointer, 4)); + $this->_nomBitrate = $bitrate['nom']['data']; + $bitrate['min'] = unpack("Vdata", fread($this->_filePointer, 4)); + $this->_minBitrate = $bitrate['min']['data']; + $blocksizes = unpack("Cdata", fread($this->_filePointer, 1)); - + // Powers of two between 6 and 13 inclusive. $valid_block_sizes = array(64, 128, 256, 512, 1024, 2048, 4096, 8192); - + // Extract bits 1 to 4 from the character data. // blocksize_0 MUST be a valid blocksize. $blocksize_0 = pow(2, ($blocksizes['data'] & 0x0F)); if (FALSE == in_array($blocksize_0, $valid_block_sizes)) PEAR::raiseError("Stream is undecodable because blocksize_0 is not a valid size.", OGG_VORBIS_ERROR_UNDECODABLE); - + // Extract bits 5 to 8 from the character data. // blocksize_1 MUST be a valid blocksize. $blocksize_1 = pow(2, ($blocksizes['data'] & 0xF0) >> 4); if (FALSE == in_array($blocksize_1, $valid_block_sizes)) PEAR::raiseError("Stream is undecodable because blocksize_1 is not a valid size.", OGG_VORBIS_ERROR_UNDECODABLE); - + // blocksize 0 MUST be less than or equal to blocksize 1. if ($blocksize_0 > $blocksize_1) PEAR::raiseError("Stream is undecodable because blocksize_0 is not less than or equal to blocksize_1.", OGG_VORBIS_ERROR_UNDECODABLE); - + // The framing bit MUST be set to mark the end of the identification header. $framing_bit = unpack("Cdata", fread($this->_filePointer, 1)); if ($framing_bit['data'] == 0) PEAR::raiseError("Stream in undecodable because the framing bit is not non-zero.", OGG_VORBIS_ERROR_UNDECODABLE); } + /** + * @access private + * @param int $packetType + * @param int $pageOffset + */ function _decodeCommonHeader($packetType, $pageOffset) { fseek($this->_filePointer, $this->_streamList['stream_page'][$pageOffset]['body_offset'], SEEK_SET); @@ -261,7 +263,7 @@ $packet = unpack("Cdata", fread($this->_filePointer, 1)); if ($packet['data'] != $packetType) PEAR::raiseError("Stream Undecodable", OGG_VORBIS_ERROR_UNDECODABLE); - + // The following six characters should be the characters 'v', 'o', 'r', 'b', 'i', 's'. if (fread($this->_filePointer, 6) != "vorbis") PEAR::raiseError("Stream is undecodable due to a malformed header.", OGG_VORBIS_ERROR_UNDECODABLE); @@ -280,35 +282,35 @@ */ function _decodeCommentsHeader() { - $this->_decodeCommonHeader(OGG_VORBIS_COMMENTS_HEADER, 1); + $this->_decodeCommonHeader(OGG_VORBIS_COMMENTS_HEADER, 1); // Decode the vendor string length. - $vendor_len = unpack("Vdata", fread($this->_filePointer, 4)); - $this->_vendor = fread($this->_filePointer, $vendor_len['data']); + $vendor_len = unpack("Vdata", fread($this->_filePointer, 4)); + $this->_vendor = fread($this->_filePointer, $vendor_len['data']); // Decode the size of the comments list. $comment_list_length = unpack("Vdata", fread($this->_filePointer, 4)); for ($i = 0; $i < $comment_list_length['data']; $i++) { $comment_length = unpack("Vdata", fread($this->_filePointer, 4)); // Comments are in the format 'ARTIST=Super Furry Animals', so split it on the equals character. // NOTE: Equals characters are strictly prohibited in either the COMMENT or DATA parts. - $comment = explode("=", fread($this->_filePointer, $comment_length['data'])); - $comment_title = (string) $comment[0]; - $comment_value = (string) utf8_decode($comment[1]); - + $comment = explode("=", fread($this->_filePointer, $comment_length['data'])); + $comment_title = (string) $comment[0]; + $comment_value = (string) utf8_decode($comment[1]); + // Check if the comment type (e.g. ARTIST) already exists. If it does, // take the new value, and the existing value (or array) and insert it // into a new array. This is important, since each comment type may have // multiple instances (e.g. ARTIST for a collaboration) and we should not // overwrite the previous value. if (isset($this->_comments[$comment_title])) { - if (is_array($this->_comments[$comment_title])) - $this->_comments[$comment_title][] = $comment_value; - else - $this->_comments[$comment_title] = array($this->_comments[$comment_title], $comment_value); + if (is_array($this->_comments[$comment_title])) + $this->_comments[$comment_title][] = $comment_value; + else + $this->_comments[$comment_title] = array($this->_comments[$comment_title], $comment_value); } else - $this->_comments[$comment_title] = $comment_value; + $this->_comments[$comment_title] = $comment_value; } - + // The framing bit MUST be set to mark the end of the comments header. $framing_bit = unpack("Cdata", fread($this->_filePointer, 1)); if ($framing_bit['data'] != 1) @@ -329,7 +331,7 @@ */ function getCommentList() { - return (array_keys($this->_comments)); + return (array_keys($this->_comments)); } /** @@ -347,14 +349,14 @@ */ function getField($commentTitle) { - if (isset($this->_comments[$commentTitle])) { - if (is_array($this->_comments[$commentTitle])) - return (implode(", ", $this->_comments[$commentTitle])); - else - return ($this->_comments[$commentTitle]); - } else - // The comment doesn't exist in this file. The user should've called getCommentList first. - return ""; + if (isset($this->_comments[$commentTitle])) { + if (is_array($this->_comments[$commentTitle])) + return (implode(", ", $this->_comments[$commentTitle])); + else + return ($this->_comments[$commentTitle]); + } else + // The comment doesn't exist in this file. The user should've called getCommentList first. + return ""; } /** @@ -373,6 +375,8 @@ } /** + * Vendor of software used to encode this stream. + * * Gives the vendor string for the software used to encode this stream. * It is common to find libVorbis here. A previous version of this package * compared this vendor string against a release table, but this has been @@ -387,9 +391,14 @@ } /** - * Gives the number of channels used in this stream. + * Number of channels used in this stream + * + * This function returns the number of channels used in this stream. This + * can range from 1 to 255, but will likely be 2 (stereo) or 1 (mono). * * @return int + * @see File_Ogg_Vorbis::isMono() + * @see File_Ogg_Vorbis::isStereo() * @access public */ function getChannels() @@ -398,7 +407,10 @@ } /** - * Gives the number of samples per second used in this stream. + * Samples per second. + * + * This function returns the number of samples used per second in this + * recording. Probably the most common value here is 44,100. * * @return int * @access public @@ -409,6 +421,8 @@ } /** + * Various bitrate measurements + * * Gives an array of the values of four different types of bitrates for this * stream. The nominal, maximum and minimum values are found within the file, * whereas the average value is computed. @@ -424,6 +438,9 @@ /** * Gives the most accurate bitrate measurement from this stream. * + * This function returns the most accurate bitrate measurement for this + * recording, depending on values set in the stream header. + * * @return float * @access public */ @@ -438,17 +455,6 @@ } /** - * Gives the size (in bits) of this stream. - * - * @return int - * @access public - */ - function getSize() - { - return ($this->_streamSize); - } - - /** * Gives the length (in seconds) of this stream. * * @return int @@ -462,21 +468,21 @@ /** * States whether this logical stream was encoded in mono. * - * @return boolean + * @return boolean */ function isMono() { - return $this->_channels == 1; + return $this->_channels == 1; } /** * States whether this logical stream was encoded in stereo. * - * @return boolean + * @return boolean */ function isStereo() { - return $this->_channels == 2; + return $this->_channels == 2; } /** @@ -486,141 +492,169 @@ */ function getTitle() { - return $this->getField("TITLE"); + return $this->getField("TITLE"); } /** * The version of the track, such as a remix. * - * @return string + * @return string */ function getVersion() { - return $this->getField("VERSION"); + return $this->getField("VERSION"); } /** * The album from which this track comes. * - * @return string + * @return string */ function getAlbum() { - return $this->getField("ALBUM"); + return $this->getField("ALBUM"); } /** * The number of this track if it is part of a larger collection. + * + * @return string */ function getTrackNumber() { - return $this->getField("TRACKNUMBER"); + return $this->getField("TRACKNUMBER"); } /** * The artist responsible for this track. * - * @return string + * This function returns the name of the artist responsible for this + * recording, which may be either a solo-artist, duet or group. + * + * @return string */ function getArtist() { - return $this->getField("ARTIST"); + return $this->getField("ARTIST"); } /** * The performer of this track, such as an orchestra * - * @return string + * @return string */ function getPerformer() { - return $this->getField("PERFORMER"); + return $this->getField("PERFORMER"); } /** * The copyright attribution for this track. * - * @return string + * @return string */ function getCopyright() { - return $this->getField("COPYRIGHT"); + return $this->getField("COPYRIGHT"); } /** * The rights of distribution for this track. * - * @return string + * This funtion returns the license for this track, and may include + * copyright information, or a creative commons statement. + * + * @return string */ function getLicense() { - return $this->getField("LICENSE"); + return $this->getField("LICENSE"); } /** - * The name of the organisation producing this track, such - * as a record label. + * The organisation responsible for this track. + * + * This function returns the name of the organisation responsible for + * the production of this track, such as the record label. * - * @return string + * @return string */ function getOrganization() { - return $this->getField("ORGANIZATION"); + return $this->getField("ORGANIZATION"); } /** * A short description of the contents of this track. * - * @return string + * This function returns a short description of this track, which might + * contain extra information that doesn't fit anywhere else. + * + * @return string */ function getDescription() { - return $this->getField("DESCRIPTION"); + return $this->getField("DESCRIPTION"); } /** * The genre of this recording (e.g. Rock) * + * This function returns the genre of this recording. There are no pre- + * defined genres, so this is completely up to the tagging software. + * * @return string */ function getGenre() { - return $this->getField("GENRE"); + return $this->getField("GENRE"); } /** * The date of the recording of this track. * + * This function returns the date on which this recording was made. There + * is no specification for the format of this date. + * * @return string */ function getDate() { - return $this->getField("DATE"); + return $this->getField("DATE"); } /** * Where this recording was made. * + * This function returns where this recording was made, such as a recording + * studio, or concert venue. + * * @return string */ function getLocation() { - return $this->getField("LOCATION"); + return $this->getField("LOCATION"); } + /** + * @return string + */ function getContact() { - return $this->getField("CONTACT"); + return $this->getField("CONTACT"); } /** - * The International Standard Recording Code for this track. + * International Standard Recording Code. + * + * Returns the International Standard Recording Code. This code can be + * validated using the Validate_ISPN package. * * @return string */ function getIsrc() { - return $this->getField("ISRC"); + return $this->getField("ISRC"); } } ?> \ No newline at end of file
« previous php.pear.cvs (#36169) next »