libcdio  2.1.0
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  */
Definition: cdtext.h:104
Definition: cdtext.h:66
Definition: cdtext.h:130
Definition: cdtext.h:170
Definition: cdtext.h:141
Definition: cdtext.h:181
Common type definitions used pervasively in libcdio.
bool cdtext_select_language(cdtext_t *p_cdtext, cdtext_lang_t language)
Definition: cdtext.h:106
Definition: cdtext.h:177
Definition: cdtext.h:150
Definition: cdtext.h:77
Definition: cdtext.h:89
Definition: cdtext.h:45
const char * cdtext_genre2str(cdtext_genre_t i)
Definition: cdtext.h:186
Definition: cdtext.h:136
Definition: cdtext.h:197
#define MAX_CDTEXT_FIELDS
Definition: cdtext.h:38
Definition: cdtext.h:139
Definition: cdtext.h:46
Definition: cdtext.h:204
Definition: cdtext.h:114
Definition: cdtext.h:108
Definition: cdtext.h:147
const char * cdtext_get_const(const cdtext_t *p_cdtext, cdtext_field_t field, track_t track)
Definition: cdtext.h:208
void cdtext_destroy(cdtext_t *p_cdtext)
Definition: cdtext.h:83
Definition: cdtext.h:174
Definition: cdtext.h:202
Definition: cdtext.h:91
Definition: cdtext.h:172
Definition: cdtext.h:157
cdtext_lang_t * cdtext_list_languages_v2(cdtext_t *p_cdtext)
Definition: cdtext.h:167
Definition: cdtext.h:135
Definition: cdtext.h:84
Definition: cdtext.h:149
Definition: cdtext.h:154
Definition: cdtext.h:109
Definition: cdtext.h:48
uint8_t track_t
Definition: types.h:276
Definition: cdtext.h:182
Definition: cdtext.h:115
Definition: cdtext.h:188
Definition: cdtext.h:176
Definition: cdtext.h:50
Definition: cdtext.h:179
Definition: cdtext.h:127
Definition: cdtext.h:90
Definition: cdtext.h:191
Definition: cdtext.h:88
Definition: cdtext.h:133
Definition: cdtext.h:142
Definition: cdtext.h:175
cdtext_genre_t cdtext_get_genre(const cdtext_t *p_cdtext)
Definition: cdtext.h:187
Definition: cdtext.h:76
Definition: cdtext.h:53
Definition: cdtext.h:185
Definition: cdtext.h:203
Definition: cdtext.h:47
Definition: cdtext.h:117
Definition: cdtext.h:78
Definition: cdtext.h:54
Definition: cdtext.h:184
Definition: cdtext.h:190
Definition: cdtext.h:161
Definition: cdtext.h:112
Definition: cdtext.h:81
Definition: cdtext.h:201
Definition: cdtext.h:196
Definition: cdtext.h:151
char * cdtext_get(const cdtext_t *p_cdtext, cdtext_field_t key, track_t track)
cdtext_genre_t
Enumeration of possible genre codes.
Definition: cdtext.h:62
Definition: cdtext.h:110
Definition: cdtext.h:119
Definition: cdtext.h:140
Definition: cdtext.h:128
Definition: cdtext.h:164
Definition: cdtext.h:68
Definition: cdtext.h:65
Definition: cdtext.h:69
Definition: cdtext.h:87
Definition: cdtext.h:49
Definition: cdtext.h:79
Definition: cdtext.h:171
const char * cdtext_lang2str(cdtext_lang_t i)
Definition: cdtext.h:131
Definition: cdtext.h:209
Definition: cdtext.h:138
Definition: cdtext.h:111
Definition: cdtext.h:126
Definition: cdtext.h:75
Definition: cdtext.h:67
Definition: cdtext.h:155
Definition: cdtext.h:120
bool cdtext_set_language_index(cdtext_t *p_cdtext, int idx)
const char * cdtext_field2str(cdtext_field_t i)
Definition: cdtext.h:152
Definition: cdtext.h:73
Definition: cdtext.h:134
Definition: cdtext.h:52
cdtext_t * cdtext_init(void)
Definition: cdtext.h:63
Definition: cdtext.h:146
Definition: cdtext.h:148
Definition: cdtext.h:123
Definition: cdtext.h:116
Definition: cdtext.h:143
Definition: cdtext.h:169
Definition: cdtext.h:162
Definition: cdtext.h:124
int cdtext_data_init(cdtext_t *p_cdtext, uint8_t *wdata, size_t i_data)
Definition: cdtext.h:160
Definition: cdtext.h:129
Definition: cdtext.h:192
Definition: cdtext.h:55
Definition: cdtext.h:125
Definition: cdtext.h:158
cdtext_lang_t cdtext_str2lang(const char *lang)
Definition: cdtext.h:193
void cdtext_set(cdtext_t *p_cdtext, cdtext_field_t key, const uint8_t *value, track_t track, const char *charset)
track_t cdtext_get_last_track(const cdtext_t *p_cdtext)
Definition: cdtext.h:194
cdtext_lang_t
Enumeration of possible CD-TEXT languages.
Definition: cdtext.h:101
Definition: cdtext.h:105
cdtext_lang_t cdtext_get_language(const cdtext_t *p_cdtext)
Definition: cdtext.h:180
Definition: cdtext.h:195
Definition: cdtext.h:107
Definition: cdtext.h:118
Definition: cdtext.h:103
Definition: cdtext.h:159
track_t cdtext_get_first_track(const cdtext_t *p_cdtext)
Definition: cdtext.h:72
Definition: cdtext.h:200
Definition: cdtext.h:199
struct cdtext_s cdtext_t
Opaque type for CD-Text.
Definition: cdtext.h:218
Definition: cdtext.h:145
Definition: cdtext.h:80
Definition: cdtext.h:156
Definition: cdtext.h:85
Definition: cdtext.h:166
Definition: cdtext.h:163
Definition: cdtext.h:102
Definition: cdtext.h:74
Definition: cdtext.h:121
Definition: cdtext.h:132
Definition: cdtext.h:198
Definition: cdtext.h:173
Definition: cdtext.h:70
Definition: cdtext.h:144
Definition: cdtext.h:71
Definition: cdtext.h:122
Definition: cdtext.h:51
Definition: cdtext.h:86
Definition: cdtext.h:189
Definition: cdtext.h:82
Definition: cdtext.h:183
Definition: cdtext.h:153
Definition: cdtext.h:168
Definition: cdtext.h:113
Definition: cdtext.h:178
Definition: cdtext.h:165
cdtext_lang_t * cdtext_list_languages(const cdtext_t *p_cdtext)
Definition: cdtext.h:137
Definition: cdtext.h:64
cdtext_field_t
Enumeration of CD-TEXT text fields.
Definition: cdtext.h:44