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

Class: Net_CDDB_Disc

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

Class Overview


Class representing an audio-CD with CDDB information


Variables

Methods


Inherited Variables

Inherited Methods


Class Details

[line 25]
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 57]

Artist name
  • Access: protected

Type:   string


[ Top ]

$_discid =

[line 73]

8-char discid field
  • Access: protected

Type:   string


[ Top ]

$_extras =

[line 41]

Array of extra data about tracks
  • Access: protected

Type:   array


[ Top ]

$_genre =

[line 81]

CDDB genre string
  • Access: protected

Type:   string


[ Top ]

$_length =

[line 97]

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

Type:   integer


[ Top ]

$_offsets =

[line 49]

Array of track offsets ( in seconds )
  • Access: protected

Type:   array


[ Top ]

$_playorder =

[line 105]

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

Type:   string


[ Top ]

$_revision =

[line 113]

CDDB revision attribute
  • Access: protected

Type:   integer


[ Top ]

$_this_revision =

[line 121]

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

Type:   integer


[ Top ]

$_title =

[line 65]

Disc/audio CD title
  • Access: protected

Type:   string


[ Top ]

$_tracks =

[line 33]

Array of track titles
  • Access: protected

Type:   array


[ Top ]

$_year =

[line 89]

Year audio CD was published
  • Access: protected

Type:   integer


[ Top ]



Method Detail

Net_CDDB_Disc (Constructor)   [line 156]

Net_CDDB_Disc Net_CDDB_Disc( string $arr_or_discid, [string $artist = ''], [string $title = ''], [string $genre = ''], [integer $year = ''], [array $tracks = array()], [array $extras = array()], [array $offsets = array()], [integer $length = 0], [integer $revision = 0], [string $playorder = ''])

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
  • artist, string artist name
  • title, string title of the cd
  • genre, string genre of the cd
  • year, integer year the cd was published
  • tracks, array of track names
  • extras, array of extra data about each track (lyrics, subtitles, also know as, etc.)
  • offsets, array of track offsets (in seconds from beginning of disc)
  • length, length of disc (in seconds)
  • revision, CDDB record revision # of disc
  • playorder, string describing custom track play order

  • Access: public

Parameters:

string   $arr_or_discid   —  *See note above!*
string   $artist   — 
string   $title   — 
string   $genre   — 
integer   $year   — 
array   $tracks   —  Title of each track
array   $extras   —  Extra data about each track
array   $offsets   —  Offset (in seconds) of each track
integer   $length   — 
integer   $revision   —  The CDDB revision from the CDDB record
string   $playorder   —  Optional play-order of the tracks

[ Top ]

getArtist   [line 222]

string getArtist( )

Get the artist for the audio CD
  • Access: public

[ Top ]

getDiscId   [line 210]

string getDiscId( )

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

[ Top ]

getDiscLength   [line 306]

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 ]

getGenre   [line 246]

string getGenre( )

Get the genre this disc belongs to
  • Access: public

[ Top ]

getTitle   [line 234]

string getTitle( )

Get the title of this disc
  • Access: public

[ Top ]

getTrackOffset   [line 289]

integer getTrackOffset( integer $track_num)

Get the track offset for a specific track

Parameters:

integer   $track_num   — 

[ Top ]

getTrackTitle   [line 274]

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 258]

integer numTracks( )

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

[ Top ]

toString   [line 328]

string toString( )

Return a string representation of this CDDB Disc ( the CDDB file format )
  • Todo: Make EXTD data field work
  • Access: public

[ Top ]


Documentation generated on Mon, 11 Mar 2019 14:39:30 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.