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

Class: Net_CDDB_Utilities

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

Class Overview


Utilities class for use by CDDB Servers/Clients


Methods


Inherited Variables

Inherited Methods


Class Details

[line 20]
Utilities class for use by CDDB Servers/Clients


[ Top ]


Method Detail

calculateDiscId   [line 34]

string calculateDiscId( array $track_offsets, int $disc_length)

Calculate the disc id from the track offsets and disc length

Parameters:

array   $track_offsets   — 
int   $disc_length   —  Disc length in seconds

[ Top ]

parseFieldFromRecord   [line 265]

string parseFieldFromRecord( string $str, string $field)

Extract/parse just a single field by key from a CDDB record

Most of the data in a CDDB file format has a key associated with it, you can use this method to extract the value for just one key. Here are the available keys:

  • DISCID (8-character disc id)
  • DTITLE (title/artist of disc)
  • DYEAR (year disc was published)
  • DGENRE (genre of music)
  • TTITLE* (where * is the track number you want)
  • EXTD (extra data about disc)
  • YEAR (...?)
  • EXTT* (where * is the track number you want to extra data for)
  • PLAYORDER (custom play-order of the tracks?)


Parameters:

string   $str   — 
string   $field   — 

[ Top ]

parseRecord   [line 100]

array parseRecord( string $str, [string $category = ''])

Parse a record in CDDB format into a multidimensional array

Parameters:

string   $str   — 
string   $category   — 

[ Top ]

_sum   [line 56]

int _sum( int $n)

Helper function for calculateDiscId() method, sum digits in track offset

Parameters:

int   $n   — 

[ Top ]

_trim   [line 77]

void _trim( &$arr, array $arr)

Recursively trim all values in an array (of arrays)
  • Access: public

Parameters:

array   $arr   — 
   &$arr   — 

[ Top ]


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