Version 1 by Sven Vollbehr
on May 03, 2009 05:22.

compared with
Version 2 by Sven Vollbehr
on May 03, 2009 13:06.

Key
This line was removed.
This word was removed. This word was added.
This line was added.

Changes (39)

View Page History
{info:title=New Proposal Template}
This page has been created from a template that uses "zones." To proceed:

# Edit the page
# Replace sample content within each zone-data tag with your own content
# Remove this notice
# Save the page
# When you are ready for community review, move this page to the [Ready for Review] section on the edit page.

{note:title=No placeholders allowed!}
Please do not create placeholders. Wait until you have sufficient content to replace all sample data in the proposal template before creating your proposal document.
{note}
{info}

{zone-template-instance:ZFPROP:Proposal Zone Template}

{zone-data:component-name}
Zend_Magic Zend_Media
{zone-data}

{zone-data:proposer-list}
[My Name|mailto:noreply@zend.com]
[Sven Vollbehr|mailto:svollbehr@gmail.com]
[Jon Whitcraft|mailto:jon.zf@mac.com]
{zone-data}


{zone-data:revision}
1.0 - 1 January 2008: 3 May 2009: Initial Draft.
{zone-data}

{zone-data:overview}
Zend_Magic is a simple component that reads my mind and generates code dynamically to do what I want.
Zend_Media is a collection of classes representing various media file formats. Classes structure information of the files according to the file format standards and provide means to manipulate the information in an object oriented fashion.
{zone-data}

{zone-data:references}
* [Harry Houdini Wikipedia Entry|http://en.wikipedia.org/wiki/Harry_Houdini]
* [MagicTricks.com|http://www.magictricks.com/]
* [PHP Reader Project|http://php-reader.googlecode.com/]
{zone-data}

{zone-data:requirements}
Most requirements take the form of "foo will do ...." or "foo will not support ...", although different words and sentence structure might be used. Adding functionality to your proposal is requirements creep (bad), unless listed below. Discuss major changes with your team first, and then open a "feature improvement" issue against this component.

* This component *will* correctly reads a developers mind for intent and generate the right configuration file.
* The generated config file *will not* support XML, but will provide an extension point in the API.
* This component *will* use no more memory than twice the size of all data it contains.
* This component *will* include a factory method.
* This component *will not* allow subclassing. (i.e. when reviewed, we expect to see "final" keyword in code)
* This component *will* only generate data exports strictly complying with RFC 12345.
* This component *will* validate input data against formats supported by ZF component Foo.
* This component *will not* save any data using Zend_Cache or the filesystem. All transient data *will be* saved using Zend_Session.
* This component *will* structure information in various media file formats.
* This component *will* provide means to read and write the header information of a supported media file.
{zone-data}

{zone-data:dependencies}
* Zend_Exception
* Zend_Io
{zone-data}

{zone-data:operation}
The component is instantiated with a mind-link that ...

{zone-data}

{zone-data:milestones}
Describe some intermediate state of this component in terms of design notes, additional material added to this page, and / code. Note any significant dependencies here, such as, "Milestone #3 can not be completed until feature Foo has been added to ZF component XYZ." Milestones will be required for acceptance of future proposals. They are not hard, and many times you will only need to think of the first three below.
* Milestone 1: [design notes will be published here|http://framework.zend.com/wiki/x/sg]
* Milestone 2: Working prototype checked into the incubator supporting use cases #1, #2, ...
* Milestone 3: Working prototype checked into the incubator supporting use cases #3 and #4.
* Milestone 1: Working prototype transformed from existing code and checked into the incubator (necessary tasks: conform to Zend naming conventions, and refactor to support the new API described here and use the new Zend_Io library).
* Milestone 42: Unit tests exist, work, and are checked into SVN.
* Milestone 53: Initial documentation exists.

If a milestone is already done, begin the description with "\[DONE\]", like this:
* Milestone #: \[DONE\] Unit tests ...
* Milestone 4: Moved to core.
{zone-data}

{zone-data:class-list}
* Zend_Magic_Exception Zend_Media_Exception
* Zend_Magic (factory class)

* Zend_Magic_MindProbe Zend_Media_Asf
* Zend_Media_Asf_Exception
* Zend_Media_Asf_Object
* Zend_Media_Asf_Object_AdvancedContentEncryption
* Zend_Media_Asf_Object_AdvancedMutualExclusion
* Zend_Media_Asf_Object_BandwidthSharing
* Zend_Media_Asf_Object_BitrateMutualExclusion
* Zend_Media_Asf_Object_CodecList
* Zend_Media_Asf_Object_Compatibility
* Zend_Media_Asf_Object_Container
* Zend_Media_Asf_Object_ContentBranding
* Zend_Media_Asf_Object_ContentDescription
* Zend_Media_Asf_Object_ContentEncryption
* Zend_Media_Asf_Object_Data
* Zend_Media_Asf_Object_DigitalSignature
* Zend_Media_Asf_Object_ErrorCorrection
* Zend_Media_Asf_Object_ExtendedContentDescription
* Zend_Media_Asf_Object_ExtendedContentEncryption
* Zend_Media_Asf_Object_ExtendedStreamProperties
* Zend_Media_Asf_Object_FileProperties
* Zend_Media_Asf_Object_GroupMutualExclusion
* Zend_Media_Asf_Object_Header
* Zend_Media_Asf_Object_HeaderExtension
* Zend_Media_Asf_Object_Index
* Zend_Media_Asf_Object_IndexParameters
* Zend_Media_Asf_Object_LanguageList
* Zend_Media_Asf_Object_Marker
* Zend_Media_Asf_Object_MediaObjectIndex
* Zend_Media_Asf_Object_MediaObjectIndexParameters
* Zend_Media_Asf_Object_Metadata
* Zend_Media_Asf_Object_MetadataLibrary
* Zend_Media_Asf_Object_Padding
* Zend_Media_Asf_Object_ScriptCommand
* Zend_Media_Asf_Object_SimpleIndex
* Zend_Media_Asf_Object_StreamBitrateProperties
* Zend_Media_Asf_Object_StreamPrioritization
* Zend_Media_Asf_Object_StreamProperties
* Zend_Media_Asf_Object_TimecodeIndex
* Zend_Media_Asf_Object_TimecodeIndexParameters
* Zend_Media_Asf_Object_Unknown

* Zend_Magic_MindProbe_Intent Zend_Media_Id3v1
* Zend_Magic_Action Zend_Media_Id3v2
* Zend_Media_Id3_Encoding
* Zend_Media_Id3_Exception
* Zend_Media_Id3_ExtendedHeader
* Zend_Media_Id3_Frame
* Zend_Media_Id3_Frame_AbstractLink
* Zend_Media_Id3_Frame_AbstractText
* Zend_Media_Id3_Frame_AENC
* Zend_Media_Id3_Frame_APIC
* Zend_Media_Id3_Frame_ASPI
* Zend_Media_Id3_Frame_COMM
* Zend_Media_Id3_Frame_COMR
* Zend_Media_Id3_Frame_ENCR
* Zend_Media_Id3_Frame_EQU2
* Zend_Media_Id3_Frame_EQUA
* Zend_Media_Id3_Frame_ETCO
* Zend_Media_Id3_Frame_GEOB
* Zend_Media_Id3_Frame_GRID
* Zend_Media_Id3_Frame_IPLS
* Zend_Media_Id3_Frame_ISRC
* Zend_Media_Id3_Frame_LINK
* Zend_Media_Id3_Frame_MCDI
* Zend_Media_Id3_Frame_MLLT
* Zend_Media_Id3_Frame_OWNE
* Zend_Media_Id3_Frame_PCNT
* Zend_Media_Id3_Frame_POPM
* Zend_Media_Id3_Frame_POSS
* Zend_Media_Id3_Frame_PRIV
* Zend_Media_Id3_Frame_RBUF
* Zend_Media_Id3_Frame_RVA2
* Zend_Media_Id3_Frame_RVAD
* Zend_Media_Id3_Frame_RVRB
* Zend_Media_Id3_Frame_SEEK
* Zend_Media_Id3_Frame_SIGN
* Zend_Media_Id3_Frame_SYLT
* Zend_Media_Id3_Frame_SYTC
* Zend_Media_Id3_Frame_TALB
* Zend_Media_Id3_Frame_TBPM
* Zend_Media_Id3_Frame_TCOM
* Zend_Media_Id3_Frame_TCON
* Zend_Media_Id3_Frame_TCOP
* Zend_Media_Id3_Frame_TDAT
* Zend_Media_Id3_Frame_TDEN
* Zend_Media_Id3_Frame_TDLY
* Zend_Media_Id3_Frame_TDOR
* Zend_Media_Id3_Frame_TDRC
* Zend_Media_Id3_Frame_TDRL
* Zend_Media_Id3_Frame_TDTG
* Zend_Media_Id3_Frame_TENC
* Zend_Media_Id3_Frame_TEXT
* Zend_Media_Id3_Frame_TFLT
* Zend_Media_Id3_Frame_TIME
* Zend_Media_Id3_Frame_TIPL
* Zend_Media_Id3_Frame_TIT1
* Zend_Media_Id3_Frame_TIT2
* Zend_Media_Id3_Frame_TIT3
* Zend_Media_Id3_Frame_TKEY
* Zend_Media_Id3_Frame_TLAN
* Zend_Media_Id3_Frame_TLEN
* Zend_Media_Id3_Frame_TMCL
* Zend_Media_Id3_Frame_TMED
* Zend_Media_Id3_Frame_TMOO
* Zend_Media_Id3_Frame_TOAL
* Zend_Media_Id3_Frame_TOFN
* Zend_Media_Id3_Frame_TOLY
* Zend_Media_Id3_Frame_TOPE
* Zend_Media_Id3_Frame_TORY
* Zend_Media_Id3_Frame_TOWN
* Zend_Media_Id3_Frame_TPE1
* Zend_Media_Id3_Frame_TPE2
* Zend_Media_Id3_Frame_TPE3
* Zend_Media_Id3_Frame_TPE4
* Zend_Media_Id3_Frame_TPOS
* Zend_Media_Id3_Frame_TPRO
* Zend_Media_Id3_Frame_TPUB
* Zend_Media_Id3_Frame_TRCK
* Zend_Media_Id3_Frame_TRDA
* Zend_Media_Id3_Frame_TRSN
* Zend_Media_Id3_Frame_TRSO
* Zend_Media_Id3_Frame_TSIZ
* Zend_Media_Id3_Frame_TSOA
* Zend_Media_Id3_Frame_TSOP
* Zend_Media_Id3_Frame_TSOT
* Zend_Media_Id3_Frame_TSSE
* Zend_Media_Id3_Frame_TSST
* Zend_Media_Id3_Frame_TXXX
* Zend_Media_Id3_Frame_TYER
* Zend_Media_Id3_Frame_Unknown
* Zend_Media_Id3_Frame_USER
* Zend_Media_Id3_Frame_USLT
* Zend_Media_Id3_Frame_WCOM
* Zend_Media_Id3_Frame_WCOP
* Zend_Media_Id3_Frame_WOAF
* Zend_Media_Id3_Frame_WOAR
* Zend_Media_Id3_Frame_WOAS
* Zend_Media_Id3_Frame_WORS
* Zend_Media_Id3_Frame_WPAY
* Zend_Media_Id3_Frame_WPUB
* Zend_Media_Id3_Frame_WXXX
* Zend_Media_Id3_Header
* Zend_Media_Id3_Language
* Zend_Media_Id3_Object
* Zend_Media_Id3_Timing

* Zend_Magic_CodeGen Zend_Media_Iso14496
* Zend_Media_Iso14496_Box
* Zend_Media_Iso14496_Box_BXML
* Zend_Media_Iso14496_Box_CDSC
* Zend_Media_Iso14496_Box_CO64
* Zend_Media_Iso14496_Box_CPRT
* Zend_Media_Iso14496_Box_CTTS
* Zend_Media_Iso14496_Box_DATA
* Zend_Media_Iso14496_Box_DINF
* Zend_Media_Iso14496_Box_DREF
* Zend_Media_Iso14496_Box_EDTS
* Zend_Media_Iso14496_Box_ELST
* Zend_Media_Iso14496_Box_FREE
* Zend_Media_Iso14496_Box_FRMA
* Zend_Media_Iso14496_Box_FTYP
* Zend_Media_Iso14496_Box_Full
* Zend_Media_Iso14496_Box_HDLR
* Zend_Media_Iso14496_Box_HINT
* Zend_Media_Iso14496_Box_HMHD
* Zend_Media_Iso14496_Box_ID32
* Zend_Media_Iso14496_Box_IINF
* Zend_Media_Iso14496_Box_ILOC
* Zend_Media_Iso14496_Box_ILST
* Zend_Media_Iso14496_Box_IMIF
* Zend_Media_Iso14496_Box_INFE
* Zend_Media_Iso14496_Box_IPMC
* Zend_Media_Iso14496_Box_IPRO
* Zend_Media_Iso14496_Box_MDAT
* Zend_Media_Iso14496_Box_MDHD
* Zend_Media_Iso14496_Box_MDIA
* Zend_Media_Iso14496_Box_MEHD
* Zend_Media_Iso14496_Box_META
* Zend_Media_Iso14496_Box_MFHD
* Zend_Media_Iso14496_Box_MFRA
* Zend_Media_Iso14496_Box_MFRO
* Zend_Media_Iso14496_Box_MINF
* Zend_Media_Iso14496_Box_MOOF
* Zend_Media_Iso14496_Box_MOOV
* Zend_Media_Iso14496_Box_MVEX
* Zend_Media_Iso14496_Box_MVHD
* Zend_Media_Iso14496_Box_NMHD
* Zend_Media_Iso14496_Box_PADB
* Zend_Media_Iso14496_Box_PDIN
* Zend_Media_Iso14496_Box_PITM
* Zend_Media_Iso14496_Box_SBGP
* Zend_Media_Iso14496_Box_SCHI
* Zend_Media_Iso14496_Box_SCHM
* Zend_Media_Iso14496_Box_SDTP
* Zend_Media_Iso14496_Box_SGPD
* Zend_Media_Iso14496_Box_SINF
* Zend_Media_Iso14496_Box_SKIP
* Zend_Media_Iso14496_Box_SMHD
* Zend_Media_Iso14496_Box_STBL
* Zend_Media_Iso14496_Box_STCO
* Zend_Media_Iso14496_Box_STDP
* Zend_Media_Iso14496_Box_STSC
* Zend_Media_Iso14496_Box_STSD
* Zend_Media_Iso14496_Box_STSH
* Zend_Media_Iso14496_Box_STSS
* Zend_Media_Iso14496_Box_STSZ
* Zend_Media_Iso14496_Box_STTS
* Zend_Media_Iso14496_Box_STZ2
* Zend_Media_Iso14496_Box_SUBS
* Zend_Media_Iso14496_Box_TFHD
* Zend_Media_Iso14496_Box_TFRA
* Zend_Media_Iso14496_Box_TKHD
* Zend_Media_Iso14496_Box_TRAF
* Zend_Media_Iso14496_Box_TRAK
* Zend_Media_Iso14496_Box_TREF
* Zend_Media_Iso14496_Box_TREX
* Zend_Media_Iso14496_Box_TRUN
* Zend_Media_Iso14496_Box_UDTA
* Zend_Media_Iso14496_Box_URL
* Zend_Media_Iso14496_Box_URN
* Zend_Media_Iso14496_Box_VMHD
* Zend_Media_Iso14496_Box_XML
* Zend_Media_Iso14496_Exception

* Zend_Media_Mpeg_Abs
* Zend_Media_Mpeg_Ps
* Zend_Media_Mpeg_Abs_Frame
* Zend_Media_Mpeg_Abs_LameHeader
* Zend_Media_Mpeg_Abs_Object
* Zend_Media_Mpeg_Abs_VbriHeader
* Zend_Media_Mpeg_Abs_XingHeader
* Zend_Media_Mpeg_Exception
* Zend_Media_Mpeg_Object
{zone-data}

{zone-data:use-cases}
||UC-01||

... (see good use cases book)
{zone-data}

{zone-data:skeletons}
||Zend_Media_Id3v1||
{code}
class Zend_Magic_Exception extends Zend_Exception {}
final class Zend_Media_Id3v1
{
/**
* The genre list.
*
* @var Array
*/
public static $genres = array
('Blues', 'Classic Rock', 'Country', 'Dance', 'Disco', 'Funk', 'Grunge',
'Hip-Hop', 'Jazz', 'Metal', 'New Age', 'Oldies', 'Other', 'Pop', 'R&B',
'Rap', 'Reggae', 'Rock', 'Techno', 'Industrial', 'Alternative', 'Ska',
'Death Metal', 'Pranks', 'Soundtrack', 'Euro-Techno', 'Ambient',
'Trip-Hop', 'Vocal', 'Jazz+Funk', 'Fusion', 'Trance', 'Classical',
'Instrumental', 'Acid', 'House', 'Game', 'Sound Clip', 'Gospel',
'Noise', 'AlternRock', 'Bass', 'Soul', 'Punk', 'Space', 'Meditative',
'Instrumental Pop', 'Instrumental Rock', 'Ethnic', 'Gothic',
'Darkwave', 'Techno-Industrial', 'Electronic', 'Pop-Folk', 'Eurodance',
'Dream', 'Southern Rock', 'Comedy', 'Cult', 'Gangsta', 'Top 40',
'Christian Rap', 'Pop/Funk', 'Jungle', 'Native American', 'Cabaret',
'New Wave', 'Psychadelic', 'Rave', 'Showtunes', 'Trailer', 'Lo-Fi',
'Tribal', 'Acid Punk', 'Acid Jazz', 'Polka', 'Retro', 'Musical',
'Rock & Roll', 'Hard Rock', 'Folk', 'Folk-Rock', 'National Folk',
'Swing', 'Fast Fusion', 'Bebob', 'Latin', 'Revival', 'Celtic',
'Bluegrass', 'Avantgarde', 'Gothic Rock', 'Progressive Rock',
'Psychedelic Rock', 'Symphonic Rock', 'Slow Rock', 'Big Band',
'Chorus', 'Easy Listening', 'Acoustic', 'Humour', 'Speech', 'Chanson',
'Opera', 'Chamber Music', 'Sonata', 'Symphony', 'Booty Bass', 'Primus',
'Porn Groove', 'Satire', 'Slow Jam', 'Club', 'Tango', 'Samba',
'Folklore', 'Ballad', 'Power Ballad', 'Rhythmic Soul', 'Freestyle',
'Duet', 'Punk Rock', 'Drum Solo', 'A capella', 'Euro-House',
'Dance Hall', 255 => 'Unknown');

class Zend_Magic {
/**
* Constructs the Id3v1 class with given file. The file is not mandatory
* argument and may be omitted as a new tag can be written to a file also by
* giving the filename to the {@link #write} method of this class.
*
* @param string|resource|Zend_Io_Reader $filename The path to the file,
* file descriptor of an opened file, or a {@link Zend_Io_Reader} instance.
* @throws Zend_Media_Id3_Exception if given file descriptor is not valid
*/
public function __construct($filename = null);
...
/**
* Returns the title field.
*
* @return string
*/
public function getTitle();

/**
* Sets a new value for the title field. The field cannot exceed 30
* characters in length.
*
* @param string $title The title.
*/
public function setTitle($title);

/**
* Returns the artist field.
*
* @return string
*/
public function getArtist();

/**
* Sets a new value for the artist field. The field cannot exceed 30
* characters in length.
*
* @param string $artist The artist.
*/
public function setArtist($artist);

/**
* Returns the album field.
*
* @return string
*/
public function getAlbum();

/**
* Sets a new value for the album field. The field cannot exceed 30
* characters in length.
*
* @param string $album The album.
*/
public function setAlbum($album);

/**
* Returns the year field.
*
* @return string
*/
public function getYear();

/**
* Sets a new value for the year field. The field cannot exceed 4
* characters in length.
*
* @param string $year The year.
*/
public function setYear($year);

/**
* Returns the comment field.
*
* @return string
*/
public function getComment();

/**
* Sets a new value for the comment field. The field cannot exceed 30
* characters in length.
*
* @param string $comment The comment.
*/
public function setComment($comment);

/**
* Returns the track field.
*
* @since ID3v1.1
* @return integer
*/
public function getTrack();

/**
* Sets a new value for the track field. By setting this field you enforce
* the 1.1 version to be used.
*
* @since ID3v1.1
* @param integer $track The track number.
*/
public function setTrack($track);

/**
* Returns the genre.
*
* @return string
*/
public function getGenre();

/**
* Sets a new value for the genre field. The value may either be a numerical
* code representing one of the genres, or its string variant.
*
* The genre is set to unknown (code 255) in case the string is not found
* from the static {@link $genres} array of this class.
*
* @param integer $genre The genre.
*/
public function setGenre($genre);

/**
* Writes the possibly altered ID3v1 tag back to the file where it was read.
* If the class was constructed without a file name, one can be provided
* here as an argument. Regardless, the write operation will override
* previous tag information, if found.
*
* @param string $filename The optional path to the file.
* @throws Zend_Media_Id3_Exception if there is no file to write the tag to
*/
public function write($filename = null);

/**
* Magic function so that $obj->value will work.
*
* @param string $name The field name.
* @return mixed
*/
public function __get($name);

/**
* Magic function so that assignments with $obj->value will work.
*
* @param string $name The field name.
* @param string $value The field value.
* @return mixed
*/
public function __set($name, $value);
}
{code}
{zone-data}