cddb_track.h File Reference

Go to the source code of this file.

Defines

#define CDDB_TRACK_H   1

Typedefs

typedef cddb_track_s cddb_track_t
 The CDDB track structure.

Functions

cddb_track_tcddb_track_new (void)
 Creates a new CDDB track structure.
void cddb_track_destroy (cddb_track_t *track)
 Free all resources associated with the given CDDB track structure.
cddb_track_tcddb_track_clone (const cddb_track_t *track)
 Creates a clone of the given track.
int cddb_track_get_number (const cddb_track_t *track)
 Get the number of this track.
int cddb_track_get_frame_offset (const cddb_track_t *track)
 Get the frame offset of this track on the disc.
void cddb_track_set_frame_offset (cddb_track_t *track, int offset)
 Set the frame offset of this track on the disc.
int cddb_track_get_length (cddb_track_t *track)
 Get the length of the track in seconds.
void cddb_track_set_length (cddb_track_t *track, int length)
 Set the length of the track.
const char * cddb_track_get_title (const cddb_track_t *track)
 Get the track title.
void cddb_track_set_title (cddb_track_t *track, const char *title)
 Set the track title.
void cddb_track_append_title (cddb_track_t *track, const char *title)
 Append to the track title.
const char * cddb_track_get_artist (cddb_track_t *track)
 Get the track artist name.
void cddb_track_set_artist (cddb_track_t *track, const char *artist)
 Set the track artist name.
void cddb_track_append_artist (cddb_track_t *track, const char *artist)
 Append to the track artist.
const char * cddb_track_get_ext_data (cddb_track_t *track)
 Get the extended track data.
void cddb_track_set_ext_data (cddb_track_t *track, const char *ext_data)
 Set the extended data for the track.
void cddb_track_append_ext_data (cddb_track_t *track, const char *ext_data)
 Append to the extended track data.
void cddb_track_copy (cddb_track_t *dst, cddb_track_t *src)
 Copy all data from one track to another.
void cddb_track_print (cddb_track_t *track)
 Prints information about the track on stdout.


Define Documentation

#define CDDB_TRACK_H   1
 


Typedef Documentation

typedef struct cddb_track_s cddb_track_t
 

The CDDB track structure.

Contains all information associated with a single CD track. This structure will be used to populate the tracks linked list of the cddb_disc_s structure.


Function Documentation

void cddb_track_append_artist cddb_track_t track,
const char *  artist
 

Append to the track artist.

If the track does not have an artist yet, then a new one will be created from the given string, otherwise that string will be appended to the existing artist.

Parameters:
track The CDDB track structure.
artist Part of the artist name.

void cddb_track_append_ext_data cddb_track_t track,
const char *  ext_data
 

Append to the extended track data.

If the track does not have an extended data section yet, then a new one will be created from the given string, otherwise that string will be appended to the existing data.

Parameters:
track The CDDB track structure.
ext_data Part of the extended track data.

void cddb_track_append_title cddb_track_t track,
const char *  title
 

Append to the track title.

If the track does not have a title yet, then a new one will be created from the given string, otherwise that string will be appended to the existing title.

Parameters:
track The CDDB track structure.
title Part of the track title.

cddb_track_t* cddb_track_clone const cddb_track_t track  ) 
 

Creates a clone of the given track.

Parameters:
track The CDDB track structure.

void cddb_track_copy cddb_track_t dst,
cddb_track_t src
 

Copy all data from one track to another.

Any fields that are unavailable in the source track structure will not result in a reset of the same field in the destination track structure; e.g. if there is no title in the source track, but there is one in the destination track, then the destination's title will remain unchanged.

Parameters:
dst The destination CDDB track structure.
src The source CDDB track structure.

void cddb_track_destroy cddb_track_t track  ) 
 

Free all resources associated with the given CDDB track structure.

The linked list pointer (next) will not be touched. So you have to make sure that no other tracks are attached to this one before calling this function.

Parameters:
track The CDDB track structure.

const char* cddb_track_get_artist cddb_track_t track  ) 
 

Get the track artist name.

If there is no track artist defined, the disc artist will be returned. NULL will be returned if neither is defined.

Parameters:
track The CDDB track structure.

const char* cddb_track_get_ext_data cddb_track_t track  ) 
 

Get the extended track data.

If no extended data is set for this track then NULL will be returned.

Parameters:
track The CDDB track structure.
Returns:
The extended data.

int cddb_track_get_frame_offset const cddb_track_t track  ) 
 

Get the frame offset of this track on the disc.

If the track is invalid -1 will be returned.

Parameters:
track The CDDB track structure.
Returns:
The frame offset.

int cddb_track_get_length cddb_track_t track  ) 
 

Get the length of the track in seconds.

If the track length is not defined this routine will try to calculate it using the frame offsets of the tracks and the total disc length. These calculations will do no rounding to the nearest second. So it is possible that the sum off all track lengths does not add up to the actual disc length. If the length can not be calculated -1 will be returned.

Parameters:
track The CDDB track structure.
Returns:
The track length.

int cddb_track_get_number const cddb_track_t track  ) 
 

Get the number of this track.

This track number starts counting at 1. If the track is invalid or the track number is not defined -1 will be returned.

Parameters:
track The CDDB track structure.
Returns:
The track number.

const char* cddb_track_get_title const cddb_track_t track  ) 
 

Get the track title.

If the track is invalid or no title is set for this track then NULL will be returned.

Parameters:
track The CDDB track structure.
Returns:
The track title.

cddb_track_t* cddb_track_new void   ) 
 

Creates a new CDDB track structure.

Returns:
The CDDB track structure or NULL if memory allocation failed.

void cddb_track_print cddb_track_t track  ) 
 

Prints information about the track on stdout.

This is just a debugging routine to display the structure's content. It is used by cddb_disc_print to print the contents of a complete disc.

Parameters:
track The CDDB track structure.

void cddb_track_set_artist cddb_track_t track,
const char *  artist
 

Set the track artist name.

If the track already had an artist name, then the memory for that string will be freed. The new artist name will be copied into a new chunk of memory. If the given artist name is NULL, then the artist name of the track will be deleted.

Parameters:
track The CDDB track structure.
artist The new track artist name.

void cddb_track_set_ext_data cddb_track_t track,
const char *  ext_data
 

Set the extended data for the track.

If the track already had extended data, then the memory for that string will be freed. The new extended data will be copied into a new chunk of memory. If the given extended data is NULL, then the existing data will be deleted.

Parameters:
track The CDDB track structure.
ext_data The new extended data.

void cddb_track_set_frame_offset cddb_track_t track,
int  offset
 

Set the frame offset of this track on the disc.

Parameters:
track The CDDB track structure.
offset The frame offset.
Returns:
The frame offset.

void cddb_track_set_length cddb_track_t track,
int  length
 

Set the length of the track.

If no frame offset is yet known for this track, and it is part of a disc, then the frame offset will be calculated.

Parameters:
track The CDDB track structure.
length The track length in seconds.

void cddb_track_set_title cddb_track_t track,
const char *  title
 

Set the track title.

If the track already had a title, then the memory for that string will be freed. The new title will be copied into a new chunk of memory. If the given title is NULL, then the title of the track will be deleted.

Parameters:
track The CDDB track structure.
title The new track title.


Generated on Sun Oct 15 14:49:15 2006 for libcddb by  doxygen 1.4.6