/src/Zend/Media/Flac/MetadataBlock/Application.php

http://php-reader.googlecode.com/ · PHP · 77 lines · 19 code · 5 blank · 53 comment · 0 complexity · 9c570b9ece2254a1069fd16d2b1ece44 MD5 · raw file

  1. <?php
  2. /**
  3. * Zend Framework
  4. *
  5. * LICENSE
  6. *
  7. * This source file is subject to the new BSD license that is bundled
  8. * with this package in the file LICENSE.txt.
  9. * It is also available through the world-wide-web at this URL:
  10. * http://framework.zend.com/license/new-bsd
  11. * If you did not receive a copy of the license and are unable to
  12. * obtain it through the world-wide-web, please send an email
  13. * to license@zend.com so we can send you a copy immediately.
  14. *
  15. * @category Zend
  16. * @package Zend_Media
  17. * @subpackage FLAC
  18. * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
  19. * @license http://framework.zend.com/license/new-bsd New BSD License
  20. * @version $Id: Application.php 241 2011-06-11 16:46:52Z svollbehr $
  21. */
  22. /**#@+ @ignore */
  23. require_once 'Zend/Media/Flac/MetadataBlock.php';
  24. /**#@-*/
  25. /**
  26. * This class represents the application metadata block. This block is for use by third-party applications. The only
  27. * mandatory field is a 32-bit identifier. This ID is granted upon request to an application by the FLAC maintainers.
  28. * The remainder is of the block is defined by the registered application. Visit the registration page if you would like
  29. * to register an ID for your application with FLAC.
  30. *
  31. * Applications can be registered at {@link http://flac.sourceforge.net/id.html}.
  32. *
  33. * @category Zend
  34. * @package Zend_Media
  35. * @subpackage FLAC
  36. * @author Sven Vollbehr <sven@vollbehr.eu>
  37. * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
  38. * @license http://framework.zend.com/license/new-bsd New BSD License
  39. * @version $Id: Application.php 241 2011-06-11 16:46:52Z svollbehr $
  40. */
  41. final class Zend_Media_Flac_MetadataBlock_Application extends Zend_Media_Flac_MetadataBlock
  42. {
  43. /**
  44. * Constructs the class with given parameters and parses object related data.
  45. *
  46. * @param Zend_Io_Reader $reader The reader object.
  47. */
  48. public function __construct($reader)
  49. {
  50. parent::__construct($reader);
  51. $this->_identifier = $this->_reader->readUInt32BE();
  52. $this->_data = $this->_reader->read($this->getSize() - 4);
  53. }
  54. /**
  55. * Returns the application identifier.
  56. *
  57. * @return integer
  58. */
  59. public function getIdentifier()
  60. {
  61. return $this->_identifier;
  62. }
  63. /**
  64. * Returns the application data.
  65. *
  66. * @return string
  67. */
  68. public function getData()
  69. {
  70. return $this->_data;
  71. }
  72. }