libcdio  2.1.0
About: GNU libcdio is a library for CD-ROM and CD image access.
  Fossies Dox: libcdio-2.1.0.tar.bz2  ("inofficial" and yet experimental doxygen-generated source code documentation)  

cdtext.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2018 Thomas Schmitt
3  Copyright (C) 2004, 2005, 2008, 2012, 2019 Rocky Bernstein <rocky@gnu.org>
4  adapted from cuetools
5  Copyright (C) 2003 Svend Sanjay Sorensen <ssorensen@fastmail.fm>
6 
7  This program is free software: you can redistribute it and/or modify
8  it under the terms of the GNU General Public License as published by
9  the Free Software Foundation, either version 3 of the License, or
10  (at your option) any later version.
11 
12  This program is distributed in the hope that it will be useful,
13  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  GNU General Public License for more details.
16 
17  You should have received a copy of the GNU General Public License
18  along with this program. If not, see <http://www.gnu.org/licenses/>.
19 */
27 
28 #ifndef CDIO_CDTEXT_H_
29 #define CDIO_CDTEXT_H_
30 
31 #include <cdio/types.h>
32 
33 #ifdef __cplusplus
34 extern "C" {
35 #endif /* __cplusplus */
36 
37 #define MIN_CDTEXT_FIELD 0
38 #define MAX_CDTEXT_FIELDS 10
39 
44 typedef enum {
57 
62 typedef enum {
93 
101 typedef enum {
205 
206  /* libcdio-internal pseudo codes: */
207 
211 } cdtext_lang_t;
212 
218 typedef struct cdtext_s cdtext_t;
219 
223 const char *cdtext_genre2str (cdtext_genre_t i);
224 
228 const char *cdtext_lang2str (cdtext_lang_t i);
229 
240 cdtext_lang_t cdtext_str2lang (const char *lang);
241 
245 const char *cdtext_field2str (cdtext_field_t i);
246 
253 cdtext_t *cdtext_init (void);
254 
287 int cdtext_data_init(cdtext_t *p_cdtext, uint8_t *wdata, size_t i_data);
288 
294 void cdtext_destroy (cdtext_t *p_cdtext);
295 
302 char *cdtext_get (const cdtext_t *p_cdtext, cdtext_field_t key, track_t track);
303 
314 const char *cdtext_get_const (const cdtext_t *p_cdtext, cdtext_field_t field,
315  track_t track);
316 
322 cdtext_genre_t cdtext_get_genre (const cdtext_t *p_cdtext);
323 
329 cdtext_lang_t cdtext_get_language (const cdtext_t *p_cdtext);
330 
336 track_t cdtext_get_first_track(const cdtext_t *p_cdtext);
337 
343 track_t cdtext_get_last_track(const cdtext_t *p_cdtext);
344 
353 bool cdtext_select_language(cdtext_t *p_cdtext, cdtext_lang_t language);
354 
372 cdtext_lang_t *cdtext_list_languages (const cdtext_t *p_cdtext);
373 
396 
407 bool
408 cdtext_set_language_index(cdtext_t *p_cdtext, int idx);
409 
421 void cdtext_set (cdtext_t *p_cdtext, cdtext_field_t key, const uint8_t *value, track_t track, const char *charset);
422 
423 #ifdef __cplusplus
424 }
425 #endif /* __cplusplus */
426 
427 #endif /* CDIO_CDTEXT_H_ */
428 
429 /*
430  * Local variables:
431  * c-file-style: "gnu"
432  * tab-width: 8
433  * indent-tabs-mode: nil
434  * End:
435  */
CDTEXT_LANGUAGE_ARABIC
Definition: cdtext.h:203
CDTEXT_FIELD_GENRE
Definition: cdtext.h:53
CDTEXT_GENRE_ADULT_CONTEMP
Definition: cdtext.h:65
CDTEXT_LANGUAGE_MOLDAVIAN
Definition: cdtext.h:173
CDTEXT_LANGUAGE_FRISIAN
Definition: cdtext.h:118
cdtext_get_const
const char * cdtext_get_const(const cdtext_t *p_cdtext, cdtext_field_t field, track_t track)
Definition: cdtext.c:289
CDTEXT_LANGUAGE_LAOTIAN
Definition: cdtext.h:177
CDTEXT_LANGUAGE_QUECHUA
Definition: cdtext.h:164
CDTEXT_GENRE_REGGAE
Definition: cdtext.h:85
CDTEXT_LANGUAGE_PUNJABI
Definition: cdtext.h:166
CDTEXT_GENRE_COUNTRY
Definition: cdtext.h:70
CDTEXT_LANGUAGE_KOREAN
Definition: cdtext.h:178
CDTEXT_LANGUAGE_CATALAN
Definition: cdtext.h:105
CDTEXT_LANGUAGE_CHINESE
Definition: cdtext.h:194
types.h
Common type definitions used pervasively in libcdio.
CDTEXT_FIELD_UPC_EAN
Definition: cdtext.h:52
cdtext_get
char * cdtext_get(const cdtext_t *p_cdtext, cdtext_field_t key, track_t track)
Definition: cdtext.c:269
CDTEXT_LANGUAGE_SOMALI
Definition: cdtext.h:158
CDTEXT_LANGUAGE_ARMENIAN
Definition: cdtext.h:202
CDTEXT_LANGUAGE_MARATHI
Definition: cdtext.h:172
CDTEXT_FIELD_INVALID
Definition: cdtext.h:55
CDTEXT_LANGUAGE_TELUGU
Definition: cdtext.h:152
CDTEXT_LANGUAGE_SERBO_CROAT
Definition: cdtext.h:161
CDTEXT_LANGUAGE_RUTHENIAN
Definition: cdtext.h:162
CDTEXT_LANGUAGE_ORIYA
Definition: cdtext.h:169
CDTEXT_LANGUAGE_URDU
Definition: cdtext.h:149
CDTEXT_LANGUAGE_ROMANIAN
Definition: cdtext.h:136
cdtext_destroy
void cdtext_destroy(cdtext_t *p_cdtext)
Definition: cdtext.c:242
CDTEXT_LANGUAGE_SERBIAN
Definition: cdtext.h:138
CDTEXT_LANGUAGE_NDEBELE
Definition: cdtext.h:171
CDTEXT_LANGUAGE_ASSAMESE
Definition: cdtext.h:201
CDTEXT_LANGUAGE_HAUSA
Definition: cdtext.h:186
cdtext_list_languages_v2
cdtext_lang_t * cdtext_list_languages_v2(cdtext_t *p_cdtext)
Definition: cdtext.c:411
CDTEXT_FIELD_COMPOSER
Definition: cdtext.h:48
cdtext_genre_t
cdtext_genre_t
Enumeration of possible genre codes.
Definition: cdtext.h:62
CDTEXT_LANGUAGE_ALBANIAN
Definition: cdtext.h:103
CDTEXT_LANGUAGE_ENGLISH
Definition: cdtext.h:111
CDTEXT_LANGUAGE_GUJURATI
Definition: cdtext.h:188
CDTEXT_LANGUAGE_IRISH
Definition: cdtext.h:119
CDTEXT_GENRE_EROTIC
Definition: cdtext.h:73
CDTEXT_LANGUAGE_SLOVAK
Definition: cdtext.h:139
MAX_CDTEXT_FIELDS
#define MAX_CDTEXT_FIELDS
Definition: cdtext.h:38
track_t
uint8_t track_t
Definition: types.h:276
i_data
static int i_data
Definition: cdda-player.c:106
CDTEXT_LANGUAGE_BULGARIAN
Definition: cdtext.h:196
CDTEXT_LANGUAGE_BASQUE
Definition: cdtext.h:115
CDTEXT_LANGUAGE_LATIN
Definition: cdtext.h:125
CDTEXT_LANGUAGE_OCCITAN
Definition: cdtext.h:133
CDTEXT_FIELD_TITLE
Definition: cdtext.h:45
CDTEXT_LANGUAGE_KANNADA
Definition: cdtext.h:181
CDTEXT_LANGUAGE_TATAR
Definition: cdtext.h:153
CDTEXT_GENRE_OPERA
Definition: cdtext.h:81
CDTEXT_GENRE_RAP
Definition: cdtext.h:84
CDTEXT_LANGUAGE_SLOVENIAN
Definition: cdtext.h:140
CDTEXT_LANGUAGE_GALICIAN
Definition: cdtext.h:121
CDTEXT_LANGUAGE_FAROESE
Definition: cdtext.h:116
CDTEXT_LANGUAGE_ICELANDIC
Definition: cdtext.h:122
CDTEXT_LANGUAGE_HINDI
Definition: cdtext.h:184
CDTEXT_LANGUAGE_AZERBAIJANI
Definition: cdtext.h:200
CDTEXT_LANGUAGE_BLOCK_UNUSED
Definition: cdtext.h:209
CDTEXT_GENRE_NEWAGE
Definition: cdtext.h:80
CDTEXT_LANGUAGE_SPANISH
Definition: cdtext.h:112
CDTEXT_GENRE_GOSPEL
Definition: cdtext.h:75
CDTEXT_LANGUAGE_GERMAN
Definition: cdtext.h:110
i
int i
Definition: cdinfo-linux.c:194
CDTEXT_LANGUAGE_CHURASH
Definition: cdtext.h:193
CDTEXT_LANGUAGE_NEPALI
Definition: cdtext.h:170
CDTEXT_GENRE_ROCK
Definition: cdtext.h:86
cdtext_select_language
bool cdtext_select_language(cdtext_t *p_cdtext, cdtext_lang_t language)
Definition: cdtext.c:459
CDTEXT_LANGUAGE_TURKISH
Definition: cdtext.h:143
CDTEXT_LANGUAGE_UKRAINIAN
Definition: cdtext.h:150
CDTEXT_GENRE_CHRIST_CONTEMP
Definition: cdtext.h:69
CDTEXT_LANGUAGE_HEBREW
Definition: cdtext.h:185
CDTEXT_GENRE_JAZZ
Definition: cdtext.h:77
CDTEXT_LANGUAGE_ZULU
Definition: cdtext.h:146
CDTEXT_LANGUAGE_FRENCH
Definition: cdtext.h:117
CDTEXT_LANGUAGE_CROATIAN
Definition: cdtext.h:106
cdtext_genre2str
const char * cdtext_genre2str(cdtext_genre_t i)
Definition: cdtext.c:215
CDTEXT_LANGUAGE_ESPERANTO
Definition: cdtext.h:113
CDTEXT_LANGUAGE_WELSH
Definition: cdtext.h:107
cdtext_get_genre
cdtext_genre_t cdtext_get_genre(const cdtext_t *p_cdtext)
Definition: cdtext.c:305
CDTEXT_LANGUAGE_MALAYSIAN
Definition: cdtext.h:174
CDTEXT_GENRE_ALT_ROCK
Definition: cdtext.h:66
cdtext_init
cdtext_t * cdtext_init(void)
Definition: cdtext.c:486
CDTEXT_GENRE_SPOKEN_WORD
Definition: cdtext.h:90
CDTEXT_LANGUAGE_WALLON
Definition: cdtext.h:145
CDTEXT_GENRE_SOUNDTRACK
Definition: cdtext.h:89
CDTEXT_LANGUAGE_SINHALESE
Definition: cdtext.h:159
CDTEXT_GENRE_FOLK
Definition: cdtext.h:74
CDTEXT_LANGUAGE_SHONA
Definition: cdtext.h:160
CDTEXT_LANGUAGE_FULANI
Definition: cdtext.h:191
CDTEXT_LANGUAGE_TADZHIK
Definition: cdtext.h:155
CDTEXT_LANGUAGE_ESTONIAN
Definition: cdtext.h:114
cdtext_get_first_track
track_t cdtext_get_first_track(const cdtext_t *p_cdtext)
Definition: cdtext.c:331
cdtext_set
void cdtext_set(cdtext_t *p_cdtext, cdtext_field_t key, const uint8_t *value, track_t track, const char *charset)
Definition: cdtext.c:568
CDTEXT_GENRE_CLASSIC
Definition: cdtext.h:68
cdtext_str2lang
cdtext_lang_t cdtext_str2lang(const char *lang)
Definition: cdtext.c:542
CDTEXT_LANGUAGE_UNKNOWN
Definition: cdtext.h:102
CDTEXT_LANGUAGE_SWAHILI
Definition: cdtext.h:156
CDTEXT_LANGUAGE_PUSHTU
Definition: cdtext.h:165
cdtext_field2str
const char * cdtext_field2str(cdtext_field_t i)
Definition: cdtext.c:203
cdtext_set_language_index
bool cdtext_set_language_index(cdtext_t *p_cdtext, int idx)
Definition: cdtext.c:435
CDTEXT_GENRE_POP
Definition: cdtext.h:83
CDTEXT_LANGUAGE_DUTCH
Definition: cdtext.h:131
CDTEXT_LANGUAGE_DARI
Definition: cdtext.h:192
CDTEXT_LANGUAGE_KHMER
Definition: cdtext.h:179
CDTEXT_LANGUAGE_GREEK
Definition: cdtext.h:189
CDTEXT_LANGUAGE_BRETON
Definition: cdtext.h:104
CDTEXT_LANGUAGE_LUXEMBOURGIAN
Definition: cdtext.h:127
CDTEXT_GENRE_DANCE
Definition: cdtext.h:71
CDTEXT_LANGUAGE_PORTUGUESE
Definition: cdtext.h:135
cdtext_lang2str
const char * cdtext_lang2str(cdtext_lang_t i)
Definition: cdtext.c:227
CDTEXT_LANGUAGE_ITALIAN
Definition: cdtext.h:123
CDTEXT_LANGUAGE_DANISH
Definition: cdtext.h:109
CDTEXT_GENRE_SOUNDEFFECTS
Definition: cdtext.h:88
cdtext_list_languages
cdtext_lang_t * cdtext_list_languages(const cdtext_t *p_cdtext)
Definition: cdtext.c:369
CDTEXT_GENRE_HIPHOP
Definition: cdtext.h:76
CDTEXT_LANGUAGE_LAPPISH
Definition: cdtext.h:124
CDTEXT_LANGUAGE_BAMBORA
Definition: cdtext.h:199
CDTEXT_LANGUAGE_POLISH
Definition: cdtext.h:134
CDTEXT_LANGUAGE_BIELORUSSIAN
Definition: cdtext.h:198
CDTEXT_GENRE_OPERETTA
Definition: cdtext.h:82
CDTEXT_FIELD_ARRANGER
Definition: cdtext.h:50
CDTEXT_LANGUAGE_GAELIC
Definition: cdtext.h:120
CDTEXT_LANGUAGE_FINNISH
Definition: cdtext.h:141
CDTEXT_LANGUAGE_RUSSIAN
Definition: cdtext.h:163
CDTEXT_LANGUAGE_GURANI
Definition: cdtext.h:187
CDTEXT_LANGUAGE_BURMESE
Definition: cdtext.h:195
CDTEXT_GENRE_RYTHMANDBLUES
Definition: cdtext.h:87
CDTEXT_GENRE_CHILDRENS
Definition: cdtext.h:67
CDTEXT_LANGUAGE_TAMIL
Definition: cdtext.h:154
CDTEXT_LANGUAGE_NORWEGIAN
Definition: cdtext.h:132
CDTEXT_LANGUAGE_VIETNAMESE
Definition: cdtext.h:147
CDTEXT_FIELD_ISRC
Definition: cdtext.h:51
CDTEXT_LANGUAGE_UZBEK
Definition: cdtext.h:148
cdtext_get_last_track
track_t cdtext_get_last_track(const cdtext_t *p_cdtext)
Definition: cdtext.c:344
CDTEXT_FIELD_PERFORMER
Definition: cdtext.h:46
cdtext_lang_t
cdtext_lang_t
Enumeration of possible CD-TEXT languages.
Definition: cdtext.h:101
CDTEXT_LANGUAGE_MALTESE
Definition: cdtext.h:130
CDTEXT_LANGUAGE_AMHARIC
Definition: cdtext.h:204
CDTEXT_LANGUAGE_JAPANESE
Definition: cdtext.h:182
CDTEXT_LANGUAGE_PAPAMIENTO
Definition: cdtext.h:168
CDTEXT_LANGUAGE_PERSIAN
Definition: cdtext.h:167
cdtext_data_init
int cdtext_data_init(cdtext_t *p_cdtext, uint8_t *wdata, size_t i_data)
Definition: cdtext.c:601
CDTEXT_LANGUAGE_INVALID
Definition: cdtext.h:208
CDTEXT_LANGUAGE_FLEMISH
Definition: cdtext.h:144
CDTEXT_LANGUAGE_BENGALI
Definition: cdtext.h:197
CDTEXT_LANGUAGE_KAZAKH
Definition: cdtext.h:180
CDTEXT_LANGUAGE_LATVIAN
Definition: cdtext.h:126
CDTEXT_LANGUAGE_GEORGIAN
Definition: cdtext.h:190
CDTEXT_GENRE_UNUSED
Definition: cdtext.h:63
CDTEXT_FIELD_DISCID
Definition: cdtext.h:54
CDTEXT_LANGUAGE_INDONESIAN
Definition: cdtext.h:183
CDTEXT_FIELD_MESSAGE
Definition: cdtext.h:49
CDTEXT_LANGUAGE_MALAGASAY
Definition: cdtext.h:175
CDTEXT_GENRE_MUSICAL
Definition: cdtext.h:79
CDTEXT_LANGUAGE_MACEDONIAN
Definition: cdtext.h:176
cdtext_s
Definition: cdtext_private.h:127
cdtext_field_t
cdtext_field_t
Enumeration of CD-TEXT text fields.
Definition: cdtext.h:44
CDTEXT_GENRE_UNDEFINED
Definition: cdtext.h:64
CDTEXT_LANGUAGE_CZECH
Definition: cdtext.h:108
CDTEXT_GENRE_WORLD_MUSIC
Definition: cdtext.h:91
CDTEXT_LANGUAGE_SWEDISH
Definition: cdtext.h:142
CDTEXT_LANGUAGE_THAI
Definition: cdtext.h:151
CDTEXT_GENRE_LATIN
Definition: cdtext.h:78
CDTEXT_GENRE_EASY_LISTENING
Definition: cdtext.h:72
CDTEXT_LANGUAGE_HUNGARIAN
Definition: cdtext.h:129
CDTEXT_LANGUAGE_LITHUANIAN
Definition: cdtext.h:128
CDTEXT_FIELD_SONGWRITER
Definition: cdtext.h:47
CDTEXT_LANGUAGE_SRANANTONGO
Definition: cdtext.h:157
cdtext_get_language
cdtext_lang_t cdtext_get_language(const cdtext_t *p_cdtext)
Definition: cdtext.c:318
CDTEXT_LANGUAGE_ROMANSH
Definition: cdtext.h:137