Net_CDDB
[ class tree: Net_CDDB ] [ index: Net_CDDB ] [ all elements ]

Class: Net_CDDB_Disc

Source Location: /Net_CDDB-0.3.0/CDDB/Disc.php

Class Overview


Class representing an audio-CD with CDDB information


Variables

Methods


Inherited Variables

Inherited Methods


Class Details

[line 30]
Class representing an audio-CD with CDDB information

This class has methods to access all of the information a CDDB server has available about a specific audio CD.



[ Top ]


Class Variables

$_artist =

[line 46]

Artist name
  • Access: protected

Type:   string


[ Top ]

$_category =

[line 70]

CDDB category string (the directory the disc record is stored in)
  • Access: protected

Type:   string


[ Top ]

$_discid =

[line 62]

8-char discid field
  • Access: protected

Type:   string


[ Top ]

$_genre =

[line 78]

CDDB genre string
  • Access: protected

Type:   string


[ Top ]

$_length =

[line 94]

Length in seconds of the audio-CD
  • Access: protected

Type:   integer


[ Top ]

$_playorder =

[line 102]

Playorder of tracks ( optional CDDB attribute )
  • Access: protected

Type:   string


[ Top ]

$_processed_by =

[line 126]

The program which processing the record submission
  • Access: protected

Type:   string


[ Top ]

$_revision =

[line 110]

CDDB revision attribute
  • Access: protected

Type:   integer


[ Top ]

$_submitted_via =

[line 118]

The program which submitted this record
  • Access: protected

Type:   string


[ Top ]

$_this_revision =

[line 134]

Revision id if we've edited the record
  • Access: protected

Type:   integer


[ Top ]

$_title =

[line 54]

Disc/audio CD title
  • Access: protected

Type:   string


[ Top ]

$_tracks =

[line 38]

Array of tracks for the disc, Net_CDDB_Track objects
  • Access: protected

Type:   array


[ Top ]

$_year =

[line 86]

Year audio CD was published
  • Access: protected

Type:   integer


[ Top ]



Method Detail

Net_CDDB_Disc (Constructor)   [line 167]

Net_CDDB_Disc Net_CDDB_Disc( string $arr_or_discid, [string $dartist = ''], [string $dtitle = ''], [string $category = ''], [string $dgenre = ''], [integer $dyear = ''], [array $tracks = array()], [integer $dlength = 0], [integer $revision = 0], [string $playorder = ''], [ $submitted_via = ''], [ $processed_by = ''])

Construct a new Net_CDDB_Disc object

The Net_CDDB_Disc actually supports two differnet methods of constructing a Net_CDDB_Disc object. The first is to provide all of the parameters. An alternative constructor allows passing an associative array as the first *and only* parameter with the following keys:

  • discid, 8-char discid
  • dartist, string artist name
  • dtitle, string title of the cd
  • dgenre, string genre of the cd
  • dyear, integer year the cd was published
  • dlength, length of disc (in seconds)
  • revision, CDDB record revision # of disc
  • playorder, string describing custom track play order

  • Todo: Make sure documentation about field names is correct and complete
  • Access: public

Parameters:

string   $arr_or_discid     *See note above!*
string   $dartist     
string   $dtitle     
string   $category     
string   $dgenre     
integer   $dyear     
array   $tracks     An array of Net_CDDB_Track objects or an array of arrays to construct Net_CDDB_Track objects with
integer   $dlength     
integer   $revision     The CDDB revision from the CDDB record
string   $playorder     Optional play-order of the tracks
   $submitted_via     
   $processed_by     

[ Top ]

getArtist   [line 253]

string getArtist( )

Get the artist for the audio CD
  • Access: public

[ Top ]

getCategory   [line 285]

string getCategory( )

Get the category this disc is stored in (directory on CDDB server)

CDDB servers usually maintain about 11 different categories for discs which (very roughly) correspond to a few different genres of music. The category is needed for disc submission and CDDB reads. There is also a free-form 'genre' field stored with each disc record which should be used for a more accurate disc genre description.


[ Top ]

getDiscExtraData   [line 496]

string getDiscExtraData( )

Get any extra data associated with the disc
  • Access: public
  • Todo: Finish supporting this

[ Top ]

getDiscId   [line 241]

string getDiscId( )

Get the 8-char discid for the disc
  • Access: public

[ Top ]

getDiscLength   [line 432]

integer getDiscLength( [bool $formatted = false])

Retrieve the length of this disc in seconds
  • Access: public

Parameters:

bool   $formatted     Whether or not to return in string format: HH:MM:SS ( defaults to returning an integer number of seconds in length )

[ Top ]

getDiscPlayorder   [line 508]

string getDiscPlayorder( )

Get the playorder of the disc
  • Access: public
  • Todo: Make sure this actually works

[ Top ]

getDiscYear   [line 451]

integer getDiscYear( )

Retrieve the year this disc was published
  • Access: public

[ Top ]

getGenre   [line 297]

string getGenre( )

Get the genre this disc belongs to
  • Access: public

[ Top ]

getProcessedBy   [line 473]

string getProcessedBy( )

Get the name of the program which processed the disc
  • Access: public

[ Top ]

getRevision   [line 462]

integer getRevision( )

Get the record revision number
  • Access: public

[ Top ]

getSubmittedVia   [line 484]

string getSubmittedVia( )

Get the name of the program that submitted the disc record
  • Access: public

[ Top ]

getTitle   [line 265]

string getTitle( )

Get the title of this disc
  • Access: public

[ Top ]

getTrack   [line 417]

Net_CDDB_Track getTrack( integer $track_num)

Get the Net_CDDB_Track object representing the given track number
  • Access: public

Parameters:

integer   $track_num     

[ Top ]

getTrackArtist   [line 401]

string getTrackArtist( integer $track_num)

Get the track artist for the given track number

Parameters:

integer   $track_num     

[ Top ]

getTrackExtraData   [line 385]

string getTrackExtraData( integer $track_num)

Get the extra data for the given track number

Parameters:

integer   $track_num     

[ Top ]

getTrackLength   [line 368]

mixed getTrackLength( integer $track_num, [boolean $formatted = false])

Get the track length for the given track number

Parameters:

integer   $track_num     
boolean   $formatted     

[ Top ]

getTrackOffset   [line 348]

integer getTrackOffset( integer $track_num)

Get the track offset for a specific track

Parameters:

integer   $track_num     

[ Top ]

getTrackTitle   [line 329]

string getTrackTitle( integer $track_num)

Get the track title for a specific track number ( track #s start at 0 )

  1.  print("The title of the first song is: ");
  2.  $disc->getTrackTitle(0);


Parameters:

integer   $track_num     

[ Top ]

numTracks   [line 309]

integer numTracks( )

Get the number of tracks the CD contains
  • Access: public

[ Top ]

toString   [line 523]

string toString( )

Return a string representation of this CDDB Disc ( the CDDB file format )
  • Access: public
  • Todo: Make EXTD data field work
  • Todo: Probably should return an *exact* copy of already submitted record (submitted by, processed by are optoinal)

[ Top ]


Documentation generated on Sun, 25 Feb 2007 14:00:14 -0500 by phpDocumentor 1.3.0. PEAR Logo Copyright © PHP Group 2004.