#include <cddb/cddb_track.h>
Go to the source code of this file.
Defines | |
#define | CDDB_DISC_H 1 |
#define | FRAMES_PER_SECOND 75 |
The number of frames that fit into one second. | |
#define | FRAMES_TO_SECONDS(f) ((f) / FRAMES_PER_SECOND) |
This macro converts an amount of frames into an amount of seconds. | |
#define | SECONDS_TO_FRAMES(s) ((s) * FRAMES_PER_SECOND) |
This macro converts an amount of seconds into an amount of frames. | |
Typedefs | |
typedef cddb_disc_s | cddb_disc_t |
The CDDB disc structure. | |
Enumerations | |
enum | cddb_cat_t { CDDB_CAT_DATA = 0, CDDB_CAT_FOLK, CDDB_CAT_JAZZ, CDDB_CAT_MISC, CDDB_CAT_ROCK, CDDB_CAT_COUNTRY, CDDB_CAT_BLUES, CDDB_CAT_NEWAGE, CDDB_CAT_REGGAE, CDDB_CAT_CLASSICAL, CDDB_CAT_SOUNDTRACK, CDDB_CAT_INVALID, CDDB_CAT_LAST } |
The different CDDB categories. More... | |
Functions | |
cddb_disc_t * | cddb_disc_new (void) |
Creates a new CDDB disc structure. | |
void | cddb_disc_destroy (cddb_disc_t *disc) |
Free all resources associated with the given CDDB disc structure. | |
cddb_disc_t * | cddb_disc_clone (const cddb_disc_t *disc) |
Creates a clone of the given disc. | |
void | cddb_disc_add_track (cddb_disc_t *disc, cddb_track_t *track) |
Add a new track to a disc. | |
cddb_track_t * | cddb_disc_get_track (const cddb_disc_t *disc, int track_no) |
Retrieves a numbered track from the disc. | |
cddb_track_t * | cddb_disc_get_track_first (cddb_disc_t *disc) |
Returns the first track of the disc. | |
cddb_track_t * | cddb_disc_get_track_next (cddb_disc_t *disc) |
Returns the next track on the disc and advances the internal track iterator. | |
unsigned int | cddb_disc_get_discid (const cddb_disc_t *disc) |
Get the ID of the disc. | |
void | cddb_disc_set_discid (cddb_disc_t *disc, unsigned int id) |
Set the ID of the disc. | |
cddb_cat_t | cddb_disc_get_category (const cddb_disc_t *disc) |
Get the disc CDDB category ID. | |
void | cddb_disc_set_category (cddb_disc_t *disc, cddb_cat_t cat) |
Set the disc CDDB category ID. | |
const char * | cddb_disc_get_category_str (cddb_disc_t *disc) |
Get the disc CDDB category as a string. | |
void | cddb_disc_set_category_str (cddb_disc_t *disc, const char *cat) |
Sets the category of the disc. | |
const char * | cddb_disc_get_genre (const cddb_disc_t *disc) |
Get the disc genre. | |
void | cddb_disc_set_genre (cddb_disc_t *disc, const char *genre) |
Set the disc genre. | |
unsigned int | cddb_disc_get_length (const cddb_disc_t *disc) |
Get the disc length. | |
void | cddb_disc_set_length (cddb_disc_t *disc, unsigned int l) |
Set the disc length. | |
unsigned int | cddb_disc_get_year (const cddb_disc_t *disc) |
Get the year of publication for this disc. | |
void | cddb_disc_set_year (cddb_disc_t *disc, unsigned int y) |
Set the year of publication for this disc. | |
int | cddb_disc_get_track_count (const cddb_disc_t *disc) |
Get the number of tracks on the disc. | |
const char * | cddb_disc_get_title (const cddb_disc_t *disc) |
Get the disc title. | |
void | cddb_disc_set_title (cddb_disc_t *disc, const char *title) |
Set the disc title. | |
void | cddb_disc_append_title (cddb_disc_t *disc, const char *title) |
Append to the disc title. | |
const char * | cddb_disc_get_artist (const cddb_disc_t *disc) |
Get the disc artist name. | |
void | cddb_disc_set_artist (cddb_disc_t *disc, const char *artist) |
Set the disc artist name. | |
void | cddb_disc_append_artist (cddb_disc_t *disc, const char *artist) |
Append to the disc artist. | |
const char * | cddb_disc_get_ext_data (const cddb_disc_t *disc) |
Get the extended disc data. | |
void | cddb_disc_set_ext_data (cddb_disc_t *disc, const char *ext_data) |
Set the extended data for the disc. | |
void | cddb_disc_append_ext_data (cddb_disc_t *disc, const char *ext_data) |
Append to the extended disc data. | |
void | cddb_disc_copy (cddb_disc_t *dst, cddb_disc_t *src) |
Copy all data from one disc to another. | |
int | cddb_disc_calc_discid (cddb_disc_t *disc) |
Calculate the CDDB disc ID. | |
void | cddb_disc_print (cddb_disc_t *disc) |
Prints information about the disc on stdout. | |
Variables | |
const char * | CDDB_CATEGORY [CDDB_CAT_LAST] |
String values for the CDDB categories. |
|
|
|
The number of frames that fit into one second.
|
|
This macro converts an amount of frames into an amount of seconds.
|
|
This macro converts an amount of seconds into an amount of frames.
|
|
The CDDB disc structure. Contains all information associated with a full CD. |
|
|
Add a new track to a disc. The track is added to the end of the existing list of tracks.
|
|
Append to the disc artist. If the disc 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.
|
|
Append to the extended disc data. If the disc 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.
|
|
Append to the disc title. If the disc 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.
|
|
Calculate the CDDB disc ID. To calculate a disc ID the provided disc needs to have its length set, and every track in the disc structure needs to have its frame offset initialized. The disc ID field will be set in the disc structure.
|
|
Creates a clone of the given disc.
|
|
Copy all data from one disc to another. Any fields that are unavailable in the source disc structure will not result in a reset of the same field in the destination disc structure; e.g. if there is no title in the source disc, but there is one in the destination disc, then the destination's title will remain unchanged.
|
|
Free all resources associated with the given CDDB disc structure. The tracks will also be freed automatically.
|
|
Get the disc artist name. If the disc is invalid or no artist is set then NULL will be returned.
|
|
Get the disc CDDB category ID. If the disc is invalid or no category is set then CDDB_CAT_INVALID will be returned. If you want a string representation of the category use the cddb_disc_get_category_str function.
|
|
Get the disc CDDB category as a string. If no category is set for this disc then 'invalid' will be returned. If the disc structure is invalid NULL is returned. If you only want the ID of the category use the cddb_disc_get_category function.
|
|
Get the ID of the disc. If the disc is invalid or the disc ID is not yet initialized 0 will be returned.
|
|
Get the extended disc data. If the disc is invalid or no extended data is set then NULL will be returned.
|
|
Get the disc genre. If no genre is set for this disc then NULL will be returned. As opposed to the disc category, this field is not limited to a predefined set.
|
|
Get the disc length. If no length is set for this disc then 0 will be returned.
|
|
Get the disc title. If the disc is invalid or no title is set then NULL will be returned.
|
|
Retrieves a numbered track from the disc. If there is no track with the given number, then NULL will be returned.
|
|
Get the number of tracks on the disc. If the disc is invalid -1 is returned.
|
|
Returns the first track of the disc. If there is no such track then NULL will be returned. The internal track iterator will also be reset. This function should be called before the first call to cddb_disc_get_track_next.
|
|
Returns the next track on the disc and advances the internal track iterator. If there is no such track then NULL will be returned. This function should be called after calling cddb_disc_get_track_first.
|
|
Get the year of publication for this disc. If no year is defined 0 is returned.
|
|
Creates a new CDDB disc structure.
|
|
Prints information about the disc on stdout. This is just a debugging routine to display the structure's content.
|
|
Set the disc artist name. If the disc 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 disc will be deleted.
|
|
Set the disc CDDB category ID.
|
|
Sets the category of the disc. If the specified category is an invalid CDDB category, then CDDB_CAT_MISC will be used.
|
|
Set the ID of the disc. When the disc ID is not known yet, then it can be calculated with the cddb_disc_calc_discid function (which will automatically initialize the correct field in the disc structure).
|
|
Set the extended data for the disc. If the disc 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.
|
|
Set the disc genre. As opposed to the disc category, this field is not limited to a predefined set. If the disc already had a genre, then the memory for that string will be freed. The new genre will be copied into a new chunk of memory.
|
|
Set the disc length.
|
|
Set the disc title. If the disc 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 disc will be deleted.
|
|
Set the year of publication for this disc.
|
|
String values for the CDDB categories.
|