getid3_flac::parseCUESHEET() –

You appear to be a bot. Output may be restricted

Description

Usage

$bool = getid3_flac::parseCUESHEET( $BlockData );

Parameters

$BlockData
( string ) required

Returns

bool

Source

File name: wordpress/wp-includes/ID3/module.audio.flac.php
Lines:

1 to 50 of 50
  private function parseCUESHEET($BlockData) {
    $info = &$this->getid3->info;
    $offset = 0;
    $info['flac']['CUESHEET']['media_catalog_number'] =                              trim(substr($BlockData, $offset, 128), "\0");
    $offset += 128;
    $info['flac']['CUESHEET']['lead_in_samples']      =         getid3_lib::BigEndian2Int(substr($BlockData, $offset, 8));
    $offset += 8;
    $info['flac']['CUESHEET']['flags']['is_cd']       = (bool) (getid3_lib::BigEndian2Int(substr($BlockData, $offset, 1)) & 0x80);
    $offset += 1;

    $offset += 258; // reserved

    $info['flac']['CUESHEET']['number_tracks']        =         getid3_lib::BigEndian2Int(substr($BlockData, $offset, 1));
    $offset += 1;

    for ($track = 0; $track < $info['flac']['CUESHEET']['number_tracks']; $track++) {
      $TrackSampleOffset = getid3_lib::BigEndian2Int(substr($BlockData, $offset, 8));
      $offset += 8;
      $TrackNumber       = getid3_lib::BigEndian2Int(substr($BlockData, $offset, 1));
      $offset += 1;

      $info['flac']['CUESHEET']['tracks'][$TrackNumber]['sample_offset']         = $TrackSampleOffset;

      $info['flac']['CUESHEET']['tracks'][$TrackNumber]['isrc']                  =                           substr($BlockData, $offset, 12);
      $offset += 12;

      $TrackFlagsRaw                                                             = getid3_lib::BigEndian2Int(substr($BlockData, $offset, 1));
      $offset += 1;
      $info['flac']['CUESHEET']['tracks'][$TrackNumber]['flags']['is_audio']     = (bool) ($TrackFlagsRaw & 0x80);
      $info['flac']['CUESHEET']['tracks'][$TrackNumber]['flags']['pre_emphasis'] = (bool) ($TrackFlagsRaw & 0x40);

      $offset += 13; // reserved

      $info['flac']['CUESHEET']['tracks'][$TrackNumber]['index_points']          = getid3_lib::BigEndian2Int(substr($BlockData, $offset, 1));
      $offset += 1;

      for ($index = 0; $index < $info['flac']['CUESHEET']['tracks'][$TrackNumber]['index_points']; $index++) {
        $IndexSampleOffset = getid3_lib::BigEndian2Int(substr($BlockData, $offset, 8));
        $offset += 8;
        $IndexNumber       = getid3_lib::BigEndian2Int(substr($BlockData, $offset, 1));
        $offset += 1;

        $offset += 3; // reserved

        $info['flac']['CUESHEET']['tracks'][$TrackNumber]['indexes'][$IndexNumber] = $IndexSampleOffset;
      }
    }

    return true;
  }
 

 View on GitHub View on Trac