libcdio  0.90
Defines | Typedefs | Enumerations | Functions
cdtext.h File Reference

The top-level header for CD-Text information. Applications include this for CD-Text access. More...

#include <cdio/types.h>

Go to the source code of this file.

Defines

#define MIN_CDTEXT_FIELD   0
#define MAX_CDTEXT_FIELDS   10

Typedefs

typedef struct cdtext_s cdtext_t

Enumerations

enum  cdtext_field_t {
  CDTEXT_FIELD_TITLE = 0, CDTEXT_FIELD_PERFORMER = 1, CDTEXT_FIELD_SONGWRITER = 2, CDTEXT_FIELD_COMPOSER = 3,
  CDTEXT_FIELD_MESSAGE = 4, CDTEXT_FIELD_ARRANGER = 5, CDTEXT_FIELD_ISRC = 6, CDTEXT_FIELD_UPC_EAN = 7,
  CDTEXT_FIELD_GENRE = 8, CDTEXT_FIELD_DISCID = 9, CDTEXT_FIELD_INVALID = MAX_CDTEXT_FIELDS
}
enum  cdtext_genre_t {
  CDTEXT_GENRE_UNUSED = 0, CDTEXT_GENRE_UNDEFINED = 1, CDTEXT_GENRE_ADULT_CONTEMP = 2, CDTEXT_GENRE_ALT_ROCK = 3,
  CDTEXT_GENRE_CHILDRENS = 4, CDTEXT_GENRE_CLASSIC = 5, CDTEXT_GENRE_CHRIST_CONTEMP = 6, CDTEXT_GENRE_COUNTRY = 7,
  CDTEXT_GENRE_DANCE = 8, CDTEXT_GENRE_EASY_LISTENING = 9, CDTEXT_GENRE_EROTIC = 10, CDTEXT_GENRE_FOLK = 11,
  CDTEXT_GENRE_GOSPEL = 12, CDTEXT_GENRE_HIPHOP = 13, CDTEXT_GENRE_JAZZ = 14, CDTEXT_GENRE_LATIN = 15,
  CDTEXT_GENRE_MUSICAL = 16, CDTEXT_GENRE_NEWAGE = 17, CDTEXT_GENRE_OPERA = 18, CDTEXT_GENRE_OPERETTA = 19,
  CDTEXT_GENRE_POP = 20, CDTEXT_GENRE_RAP = 21, CDTEXT_GENRE_REGGAE = 22, CDTEXT_GENRE_ROCK = 23,
  CDTEXT_GENRE_RYTHMANDBLUES = 24, CDTEXT_GENRE_SOUNDEFFECTS = 25, CDTEXT_GENRE_SOUNDTRACK = 26, CDTEXT_GENRE_SPOKEN_WORD = 27,
  CDTEXT_GENRE_WORLD_MUSIC = 28
}
enum  cdtext_lang_t {
  CDTEXT_LANGUAGE_UNKNOWN = 0x00, CDTEXT_LANGUAGE_ALBANIAN = 0x01, CDTEXT_LANGUAGE_BRETON = 0x02, CDTEXT_LANGUAGE_CATALAN = 0x03,
  CDTEXT_LANGUAGE_CROATIAN = 0x04, CDTEXT_LANGUAGE_WELSH = 0x05, CDTEXT_LANGUAGE_CZECH = 0x06, CDTEXT_LANGUAGE_DANISH = 0x07,
  CDTEXT_LANGUAGE_GERMAN = 0x08, CDTEXT_LANGUAGE_ENGLISH = 0x09, CDTEXT_LANGUAGE_SPANISH = 0x0A, CDTEXT_LANGUAGE_ESPERANTO = 0x0B,
  CDTEXT_LANGUAGE_ESTONIAN = 0x0C, CDTEXT_LANGUAGE_BASQUE = 0x0D, CDTEXT_LANGUAGE_FAROESE = 0x0E, CDTEXT_LANGUAGE_FRENCH = 0x0F,
  CDTEXT_LANGUAGE_FRISIAN = 0x10, CDTEXT_LANGUAGE_IRISH = 0x11, CDTEXT_LANGUAGE_GAELIC = 0x12, CDTEXT_LANGUAGE_GALICIAN = 0x13,
  CDTEXT_LANGUAGE_ICELANDIC = 0x14, CDTEXT_LANGUAGE_ITALIAN = 0x15, CDTEXT_LANGUAGE_LAPPISH = 0x16, CDTEXT_LANGUAGE_LATIN = 0x17,
  CDTEXT_LANGUAGE_LATVIAN = 0x18, CDTEXT_LANGUAGE_LUXEMBOURGIAN = 0x19, CDTEXT_LANGUAGE_LITHUANIAN = 0x1A, CDTEXT_LANGUAGE_HUNGARIAN = 0x1B,
  CDTEXT_LANGUAGE_MALTESE = 0x1C, CDTEXT_LANGUAGE_DUTCH = 0x1D, CDTEXT_LANGUAGE_NORWEGIAN = 0x1E, CDTEXT_LANGUAGE_OCCITAN = 0x1F,
  CDTEXT_LANGUAGE_POLISH = 0x20, CDTEXT_LANGUAGE_PORTUGUESE = 0x21, CDTEXT_LANGUAGE_ROMANIAN = 0x22, CDTEXT_LANGUAGE_ROMANSH = 0x23,
  CDTEXT_LANGUAGE_SERBIAN = 0x24, CDTEXT_LANGUAGE_SLOVAK = 0x25, CDTEXT_LANGUAGE_SLOVENIAN = 0x26, CDTEXT_LANGUAGE_FINNISH = 0x27,
  CDTEXT_LANGUAGE_SWEDISH = 0x28, CDTEXT_LANGUAGE_TURKISH = 0x29, CDTEXT_LANGUAGE_FLEMISH = 0x2A, CDTEXT_LANGUAGE_WALLON = 0x2B,
  CDTEXT_LANGUAGE_ZULU = 0x45, CDTEXT_LANGUAGE_VIETNAMESE = 0x46, CDTEXT_LANGUAGE_UZBEK = 0x47, CDTEXT_LANGUAGE_URDU = 0x48,
  CDTEXT_LANGUAGE_UKRAINIAN = 0x49, CDTEXT_LANGUAGE_THAI = 0x4A, CDTEXT_LANGUAGE_TELUGU = 0x4B, CDTEXT_LANGUAGE_TATAR = 0x4C,
  CDTEXT_LANGUAGE_TAMIL = 0x4D, CDTEXT_LANGUAGE_TADZHIK = 0x4E, CDTEXT_LANGUAGE_SWAHILI = 0x4F, CDTEXT_LANGUAGE_SRANANTONGO = 0x50,
  CDTEXT_LANGUAGE_SOMALI = 0x51, CDTEXT_LANGUAGE_SINHALESE = 0x52, CDTEXT_LANGUAGE_SHONA = 0x53, CDTEXT_LANGUAGE_SERBO_CROAT = 0x54,
  CDTEXT_LANGUAGE_RUTHENIAN = 0x55, CDTEXT_LANGUAGE_RUSSIAN = 0x56, CDTEXT_LANGUAGE_QUECHUA = 0x57, CDTEXT_LANGUAGE_PUSHTU = 0x58,
  CDTEXT_LANGUAGE_PUNJABI = 0x59, CDTEXT_LANGUAGE_PERSIAN = 0x5A, CDTEXT_LANGUAGE_PAPAMIENTO = 0x5B, CDTEXT_LANGUAGE_ORIYA = 0x5C,
  CDTEXT_LANGUAGE_NEPALI = 0x5D, CDTEXT_LANGUAGE_NDEBELE = 0x5E, CDTEXT_LANGUAGE_MARATHI = 0x5F, CDTEXT_LANGUAGE_MOLDAVIAN = 0x60,
  CDTEXT_LANGUAGE_MALAYSIAN = 0x61, CDTEXT_LANGUAGE_MALAGASAY = 0x62, CDTEXT_LANGUAGE_MACEDONIAN = 0x63, CDTEXT_LANGUAGE_LAOTIAN = 0x64,
  CDTEXT_LANGUAGE_KOREAN = 0x65, CDTEXT_LANGUAGE_KHMER = 0x66, CDTEXT_LANGUAGE_KAZAKH = 0x67, CDTEXT_LANGUAGE_KANNADA = 0x68,
  CDTEXT_LANGUAGE_JAPANESE = 0x69, CDTEXT_LANGUAGE_INDONESIAN = 0x6A, CDTEXT_LANGUAGE_HINDI = 0x6B, CDTEXT_LANGUAGE_HEBREW = 0x6C,
  CDTEXT_LANGUAGE_HAUSA = 0x6D, CDTEXT_LANGUAGE_GURANI = 0x6E, CDTEXT_LANGUAGE_GUJURATI = 0x6F, CDTEXT_LANGUAGE_GREEK = 0x70,
  CDTEXT_LANGUAGE_GEORGIAN = 0x71, CDTEXT_LANGUAGE_FULANI = 0x72, CDTEXT_LANGUAGE_DARI = 0x73, CDTEXT_LANGUAGE_CHURASH = 0x74,
  CDTEXT_LANGUAGE_CHINESE = 0x75, CDTEXT_LANGUAGE_BURMESE = 0x76, CDTEXT_LANGUAGE_BULGARIAN = 0x77, CDTEXT_LANGUAGE_BENGALI = 0x78,
  CDTEXT_LANGUAGE_BIELORUSSIAN = 0x79, CDTEXT_LANGUAGE_BAMBORA = 0x7A, CDTEXT_LANGUAGE_AZERBAIJANI = 0x7B, CDTEXT_LANGUAGE_ASSAMESE = 0x7C,
  CDTEXT_LANGUAGE_ARMENIAN = 0x7D, CDTEXT_LANGUAGE_ARABIC = 0x7E, CDTEXT_LANGUAGE_AMHARIC = 0x7F
}

Functions

const char * cdtext_genre2str (cdtext_genre_t i)
const char * cdtext_lang2str (cdtext_lang_t i)
const char * cdtext_field2str (cdtext_field_t i)
cdtext_tcdtext_init (void)
int cdtext_data_init (cdtext_t *p_cdtext, uint8_t *wdata, size_t i_data)
void cdtext_destroy (cdtext_t *p_cdtext)
char * cdtext_get (const cdtext_t *p_cdtext, cdtext_field_t key, track_t track)
const char * cdtext_get_const (const cdtext_t *p_cdtext, cdtext_field_t field, track_t track)
cdtext_genre_t cdtext_get_genre (const cdtext_t *p_cdtext)
cdtext_lang_t cdtext_get_language (const cdtext_t *p_cdtext)
bool cdtext_select_language (cdtext_t *p_cdtext, cdtext_lang_t language)
cdtext_lang_tcdtext_list_languages (const cdtext_t *p_cdtext)
void cdtext_set (cdtext_t *p_cdtext, cdtext_field_t key, const uint8_t *value, track_t track, const char *charset)

Detailed Description

The top-level header for CD-Text information. Applications include this for CD-Text access.


Define Documentation

#define MAX_CDTEXT_FIELDS   10
#define MIN_CDTEXT_FIELD   0

Typedef Documentation

typedef struct cdtext_s cdtext_t

Opaque type for CD-Text.


Enumeration Type Documentation

Enumeration of CD-TEXT text fields.

Enumerator:
CDTEXT_FIELD_TITLE 

title of album name or track titles

CDTEXT_FIELD_PERFORMER 

name(s) of the performer(s)

CDTEXT_FIELD_SONGWRITER 

name(s) of the songwriter(s)

CDTEXT_FIELD_COMPOSER 

name(s) of the composer(s)

CDTEXT_FIELD_MESSAGE 

message(s) from content provider or artist, ISO-8859-1 encoded

CDTEXT_FIELD_ARRANGER 

name(s) of the arranger(s)

CDTEXT_FIELD_ISRC 

ISRC code of each track

CDTEXT_FIELD_UPC_EAN 

upc/european article number of disc, ISO-8859-1 encoded

CDTEXT_FIELD_GENRE 

genre identification and genre information, ASCII encoded

CDTEXT_FIELD_DISCID 

disc identification, ASCII encoded (may be non-printable)

CDTEXT_FIELD_INVALID 

INVALID FIELD

Enumeration of possible genre codes.

Enumerator:
CDTEXT_GENRE_UNUSED 

field is not used. default

CDTEXT_GENRE_UNDEFINED 

not defined

CDTEXT_GENRE_ADULT_CONTEMP 

Adult Contemporary

CDTEXT_GENRE_ALT_ROCK 

Alternative Rock

CDTEXT_GENRE_CHILDRENS 

Childrens Music

CDTEXT_GENRE_CLASSIC 

Classical

CDTEXT_GENRE_CHRIST_CONTEMP 

Contemporary Christian

CDTEXT_GENRE_COUNTRY 

Country

CDTEXT_GENRE_DANCE 

Dance

CDTEXT_GENRE_EASY_LISTENING 

Easy Listening

CDTEXT_GENRE_EROTIC 

Erotic

CDTEXT_GENRE_FOLK 

Folk

CDTEXT_GENRE_GOSPEL 

Gospel

CDTEXT_GENRE_HIPHOP 

Hip Hop

CDTEXT_GENRE_JAZZ 

Jazz

CDTEXT_GENRE_LATIN 

Latin

CDTEXT_GENRE_MUSICAL 

Musical

CDTEXT_GENRE_NEWAGE 

New Age

CDTEXT_GENRE_OPERA 

Opera

CDTEXT_GENRE_OPERETTA 

Operetta

CDTEXT_GENRE_POP 

Pop Music

CDTEXT_GENRE_RAP 

RAP

CDTEXT_GENRE_REGGAE 

Reggae

CDTEXT_GENRE_ROCK 

Rock Music

CDTEXT_GENRE_RYTHMANDBLUES 

Rhythm & Blues

CDTEXT_GENRE_SOUNDEFFECTS 

Sound Effects

CDTEXT_GENRE_SOUNDTRACK 

Soundtrack

CDTEXT_GENRE_SPOKEN_WORD 

Spoken Word

CDTEXT_GENRE_WORLD_MUSIC 

World Music

Enumeration of possible CD-TEXT languages.

The language code is encoded as specified in ANNEX 1 to part 5 of EBU Tech 32 58 -E (1991).

Enumerator:
CDTEXT_LANGUAGE_UNKNOWN 
CDTEXT_LANGUAGE_ALBANIAN 
CDTEXT_LANGUAGE_BRETON 
CDTEXT_LANGUAGE_CATALAN 
CDTEXT_LANGUAGE_CROATIAN 
CDTEXT_LANGUAGE_WELSH 
CDTEXT_LANGUAGE_CZECH 
CDTEXT_LANGUAGE_DANISH 
CDTEXT_LANGUAGE_GERMAN 
CDTEXT_LANGUAGE_ENGLISH 
CDTEXT_LANGUAGE_SPANISH 
CDTEXT_LANGUAGE_ESPERANTO 
CDTEXT_LANGUAGE_ESTONIAN 
CDTEXT_LANGUAGE_BASQUE 
CDTEXT_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EXT_LANGUAGE_SERBO_CROAT 
CDTEXT_LANGUAGE_RUTHENIAN 
CDTEXT_LANGUAGE_RUSSIAN 
CDTEXT_LANGUAGE_QUECHUA 
CDTEXT_LANGUAGE_PUSHTU 
CDTEXT_LANGUAGE_PUNJABI 
CDTEXT_LANGUAGE_PERSIAN 
CDTEXT_LANGUAGE_PAPAMIENTO 
CDTEXT_LANGUAGE_ORIYA 
CDTEXT_LANGUAGE_NEPALI 
CDTEXT_LANGUAGE_NDEBELE 
CDTEXT_LANGUAGE_MARATHI 
CDTEXT_LANGUAGE_MOLDAVIAN 
CDTEXT_LANGUAGE_MALAYSIAN 
CDTEXT_LANGUAGE_MALAGASAY 
CDTEXT_LANGUAGE_MACEDONIAN 
CDTEXT_LANGUAGE_LAOTIAN 
CDTEXT_LANGUAGE_KOREAN 
CDTEXT_LANGUAGE_KHMER 
CDTEXT_LANGUAGE_KAZAKH 
CDTEXT_LANGUAGE_KANNADA 
CDTEXT_LANGUAGE_JAPANESE 
CDTEXT_LANGUAGE_INDONESIAN 
CDTEXT_LANGUAGE_HINDI 
CDTEXT_LANGUAGE_HEBREW 
CDTEXT_LANGUAGE_HAUSA 
CDTEXT_LANGUAGE_GURANI 
CDTEXT_LANGUAGE_GUJURATI 
CDTEXT_LANGUAGE_GREEK 
CDTEXT_LANGUAGE_GEORGIAN 
CDTEXT_LANGUAGE_FULANI 
CDTEXT_LANGUAGE_DARI 
CDTEXT_LANGUAGE_CHURASH 
CDTEXT_LANGUAGE_CHINESE 
CDTEXT_LANGUAGE_BURMESE 
CDTEXT_LANGUAGE_BULGARIAN 
CDTEXT_LANGUAGE_BENGALI 
CDTEXT_LANGUAGE_BIELORUSSIAN 
CDTEXT_LANGUAGE_BAMBORA 
CDTEXT_LANGUAGE_AZERBAIJANI 
CDTEXT_LANGUAGE_ASSAMESE 
CDTEXT_LANGUAGE_ARMENIAN 
CDTEXT_LANGUAGE_ARABIC 
CDTEXT_LANGUAGE_AMHARIC 

Function Documentation

int cdtext_data_init ( cdtext_t p_cdtext,
uint8_t *  wdata,
size_t  i_data 
)

Read a binary CD-TEXT and fill a cdtext struct.

Parameters:
p_cdtextthe CD-TEXT object
wdatathe data
i_datasize of wdata
Returns:
0 on success, non-zero on failure
void cdtext_destroy ( cdtext_t p_cdtext)

Free memory associated with the given cdtext_t object.

Parameters:
p_cdtextthe CD-TEXT object
const char* cdtext_field2str ( cdtext_field_t  i)

Return string representation of given field type.

const char* cdtext_genre2str ( cdtext_genre_t  i)

Return string representation of the given genre code.

char* cdtext_get ( const cdtext_t p_cdtext,
cdtext_field_t  key,
track_t  track 
)

Returns a copy of the return value of cdtext_get_const or NULL.

Should be freed when done.

See also:
cdtext_get_const
const char* cdtext_get_const ( const cdtext_t p_cdtext,
cdtext_field_t  field,
track_t  track 
)

Returns value of the given field.

NULL is returned if key is CDTEXT_INVALID or the field is not set. Strings are encoded in UTF-8.

Parameters:
p_cdtextthe CD-TEXT object
fieldtype of the field to return
trackspecifies the track, 0 stands for disc
cdtext_genre_t cdtext_get_genre ( const cdtext_t p_cdtext)

Returns the discs genre code.

Parameters:
p_cdtextthe CD-TEXT object

Returns the currently active language.

Parameters:
p_cdtextthe CD-TEXT object
cdtext_t* cdtext_init ( void  )

Initialize a new cdtext structure.

When the structure is no longer needed, release the resources using cdtext_delete.

const char* cdtext_lang2str ( cdtext_lang_t  i)

Return string representation of the given language code.

bool cdtext_select_language ( cdtext_t p_cdtext,
cdtext_lang_t  language 
)

Try to select the given language.

Parameters:
p_cdtextthe CD-TEXT object
languagestring representation of the language
Returns:
true on success, false if language is not available
void cdtext_set ( cdtext_t p_cdtext,
cdtext_field_t  key,
const uint8_t *  value,
track_t  track,
const char *  charset 
)

Sets the given field at the given track to the given value.

Recodes to UTF-8 if charset is not NULL.

Parameters:
p_cdtextthe CD-TEXT object
keyfield to set
valuevalue to set
tracktrack to work on
charsetcharset to convert from