39 $info = &$this->getid3->info;
41 $info[
'fileformat'] =
'cue';
62 foreach (explode(
"\n", str_replace(
"\r", null, $filedata)) as $line)
64 if ( (strlen($line) > 0) && ($line[0] !=
'#'))
66 $cue_lines[] = trim($line);
84 for (
$i=0;
$i < count($file);
$i++)
86 list(
$key) = explode(
' ', strtolower($file[
$i]), 2);
98 $currentFile = $this->
parseFile($file[$i]);
114 if (isset($currentFile))
116 $this->cuesheet[
'tracks'][$track_on][
'datafile'] = $currentFile;
135 $explodedline = explode(
' ', $line, 3);
136 $comment_REM = (isset($explodedline[0]) ? $explodedline[0] :
'');
137 $comment_type = (isset($explodedline[1]) ? $explodedline[1] :
'');
138 $comment_data = (isset($explodedline[2]) ? $explodedline[2] :
'');
139 if (($comment_REM ==
'REM') && $comment_type) {
140 $comment_type = strtolower($comment_type);
141 $commment_data = trim($comment_data,
' "');
142 if ($track_on != -1) {
143 $this->cuesheet[
'tracks'][$track_on][
'comments'][$comment_type][] = $comment_data;
145 $this->cuesheet[
'comments'][$comment_type][] = $comment_data;
158 $line = substr($line, strpos($line,
' ') + 1);
159 $type = strtolower(substr($line, strrpos($line,
' ')));
162 $line = substr($line, 0, strrpos($line,
' ') - 1);
165 $line = trim($line,
'"');
167 return array(
'filename'=>$line,
'type'=>
$type);
180 foreach (explode(
' ', strtolower($line)) as
$type)
186 $this->cuesheet[
'tracks'][$track_on][
'flags'] = array(
199 $this->cuesheet[
'tracks'][$track_on][
'flags'][
$type] =
true;
216 if ( strlen($line) > 0 )
220 $this->cuesheet[
'garbage'][] = $line;
224 $this->cuesheet[
'tracks'][$track_on][
'garbage'][] = $line;
237 $type = strtolower(substr($line, 0, strpos($line,
' ')));
238 $line = substr($line, strpos($line,
' ') + 1);
240 if (
$type ==
'index')
243 $number = intval(substr($line, 0, strpos($line,
' ')));
244 $line = substr($line, strpos($line,
' ') + 1);
248 $explodedline = explode(
':', $line);
249 $minutes = (isset($explodedline[0]) ? $explodedline[0] :
'');
250 $seconds = (isset($explodedline[1]) ? $explodedline[1] :
'');
251 $frames = (isset($explodedline[2]) ? $explodedline[2] :
'');
255 $this->cuesheet[
'tracks'][$track_on][
$type][$number] = array(
'minutes'=>intval($minutes),
'seconds'=>intval($seconds),
'frames'=>intval($frames));
259 $this->cuesheet[
'tracks'][$track_on][
$type] = array(
'minutes'=>intval($minutes),
'seconds'=>intval($seconds),
'frames'=>intval($frames));
266 $category = strtolower(substr($line, 0, strpos($line,
' ')));
267 $line = substr($line, strpos($line,
' ') + 1);
270 $line = trim($line,
'"');
282 $this->cuesheet[$category] = $line;
286 $this->cuesheet[
'tracks'][$track_on][$category] = $line;
302 $line = substr($line, strpos($line,
' ') + 1);
303 $track = ltrim(substr($line, 0, strpos($line,
' ')),
'0');
306 $datatype = strtolower(substr($line, strpos($line,
' ') + 1));
308 $this->cuesheet[
'tracks'][$track_on] = array(
'track_number'=>$track,
'datatype'=>$datatype);
parseString($line, $track_on)
parseCueSheet($file)
Parses the cue sheet array.
parseFile($line)
Parses the FILE command.
getID3() by James Heinrich info@getid3.org //
parseIndex($line, $track_on)
Parses the INDEX command of a TRACK.
readCueSheetFilename($filename)
parseFlags($line, $track_on)
Parses the FLAG command.
parseComment($line, $track_on)
Parses the REM command.
parseGarbage($line, $track_on)
Collect any unidentified data.
readCueSheet(&$filedata)
Parses a cue sheet file.
parseTrack($line, $track_on)
Parses the TRACK command.