Main Page | Modules | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members

FLAC/metadata.h: metadata level 0 interface
[FLAC/metadata.h: metadata interfaces]


Detailed Description

The level 0 interface consists of individual routines to read the STREAMINFO, VORBIS_COMMENT, CUESHEET, and PICTURE blocks, requiring only a filename.

They try to skip any ID3v2 tag at the head of the file.


Functions

FLAC__bool FLAC__metadata_get_streaminfo (const char *filename, FLAC__StreamMetadata *streaminfo)
FLAC__bool FLAC__metadata_get_tags (const char *filename, FLAC__StreamMetadata **tags)
FLAC__bool FLAC__metadata_get_cuesheet (const char *filename, FLAC__StreamMetadata **cuesheet)
FLAC__bool FLAC__metadata_get_picture (const char *filename, FLAC__StreamMetadata **picture, FLAC__StreamMetadata_Picture_Type type, const char *mime_type, const FLAC__byte *description, unsigned max_width, unsigned max_height, unsigned max_depth, unsigned max_colors)


Function Documentation

FLAC__bool FLAC__metadata_get_streaminfo const char *  filename,
FLAC__StreamMetadata streaminfo
 

Read the STREAMINFO metadata block of the given FLAC file. This function will try to skip any ID3v2 tag at the head of the file.

Parameters:
filename The path to the FLAC file to read.
streaminfo A pointer to space for the STREAMINFO block. Since FLAC__StreamMetadata is a simple structure with no memory allocation involved, you pass the address of an existing structure. It need not be initialized.
Assertions:
 filename != NULL 
 streaminfo != NULL 
Return values:
FLAC__bool true if a valid STREAMINFO block was read from filename. Returns false if there was a memory allocation error, a file decoder error, or the file contained no STREAMINFO block. (A memory allocation error is possible because this function must set up a file decoder.)

FLAC__bool FLAC__metadata_get_tags const char *  filename,
FLAC__StreamMetadata **  tags
 

Read the VORBIS_COMMENT metadata block of the given FLAC file. This function will try to skip any ID3v2 tag at the head of the file.

Parameters:
filename The path to the FLAC file to read.
tags The address where the returned pointer will be stored. The tags object must be deleted by the caller using FLAC__metadata_object_delete().
Assertions:
 filename != NULL 
 tags != NULL 
Return values:
FLAC__bool true if a valid VORBIS_COMMENT block was read from filename, and *tags will be set to the address of the metadata structure. Returns false if there was a memory allocation error, a file decoder error, or the file contained no VORBIS_COMMENT block, and *tags will be set to NULL.

FLAC__bool FLAC__metadata_get_cuesheet const char *  filename,
FLAC__StreamMetadata **  cuesheet
 

Read the CUESHEET metadata block of the given FLAC file. This function will try to skip any ID3v2 tag at the head of the file.

Parameters:
filename The path to the FLAC file to read.
cuesheet The address where the returned pointer will be stored. The cuesheet object must be deleted by the caller using FLAC__metadata_object_delete().
Assertions:
 filename != NULL 
 cuesheet != NULL 
Return values:
FLAC__bool true if a valid CUESHEET block was read from filename, and *cuesheet will be set to the address of the metadata structure. Returns false if there was a memory allocation error, a file decoder error, or the file contained no CUESHEET block, and *cuesheet will be set to NULL.

FLAC__bool FLAC__metadata_get_picture const char *  filename,
FLAC__StreamMetadata **  picture,
FLAC__StreamMetadata_Picture_Type  type,
const char *  mime_type,
const FLAC__byte *  description,
unsigned  max_width,
unsigned  max_height,
unsigned  max_depth,
unsigned  max_colors
 

Read a PICTURE metadata block of the given FLAC file. This function will try to skip any ID3v2 tag at the head of the file. Since there can be more than one PICTURE block in a file, this function takes a number of parameters that act as constraints to the search. The PICTURE block with the largest area matching all the constraints will be returned, or *picture will be set to NULL if there was no such block.

Parameters:
filename The path to the FLAC file to read.
picture The address where the returned pointer will be stored. The picture object must be deleted by the caller using FLAC__metadata_object_delete().
type The desired picture type. Use -1 to mean "any type".
mime_type The desired MIME type, e.g. "image/jpeg". The string will be matched exactly. Use NULL to mean "any MIME type".
description The desired description. The string will be matched exactly. Use NULL to mean "any description".
max_width The maximum width in pixels desired. Use (unsigned)(-1) to mean "any width".
max_height The maximum height in pixels desired. Use (unsigned)(-1) to mean "any height".
max_depth The maximum color depth in bits-per-pixel desired. Use (unsigned)(-1) to mean "any depth".
max_colors The maximum number of colors desired. Use (unsigned)(-1) to mean "any number of colors".
Assertions:
 filename != NULL 
 picture != NULL 
Return values:
FLAC__bool true if a valid PICTURE block was read from filename, and *picture will be set to the address of the metadata structure. Returns false if there was a memory allocation error, a file decoder error, or the file contained no PICTURE block, and *picture will be set to NULL.