libcdio  0.93
cdtext.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2004, 2005, 2008, 2012 Rocky Bernstein <rocky@gnu.org>
3  adapted from cuetools
4  Copyright (C) 2003 Svend Sanjay Sorensen <ssorensen@fastmail.fm>
5 
6  This program is free software: you can redistribute it and/or modify
7  it under the terms of the GNU General Public License as published by
8  the Free Software Foundation, either version 3 of the License, or
9  (at your option) any later version.
10 
11  This program is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  GNU General Public License for more details.
15 
16  You should have received a copy of the GNU General Public License
17  along with this program. If not, see <http://www.gnu.org/licenses/>.
18 */
26 
27 #ifndef CDIO_CDTEXT_H_
28 #define CDIO_CDTEXT_H_
29 
30 #include <cdio/types.h>
31 
32 #ifdef __cplusplus
33 extern "C" {
34 #endif /* __cplusplus */
35 
36 #define MIN_CDTEXT_FIELD 0
37 #define MAX_CDTEXT_FIELDS 10
38 
40 typedef enum {
53 
55 typedef enum {
86 
92 typedef enum {
196 } cdtext_lang_t;
197 
201 typedef struct cdtext_s cdtext_t;
202 
206 const char *cdtext_genre2str (cdtext_genre_t i);
207 
211 const char *cdtext_lang2str (cdtext_lang_t i);
212 
216 const char *cdtext_field2str (cdtext_field_t i);
217 
224 cdtext_t *cdtext_init (void);
225 
235 int cdtext_data_init(cdtext_t *p_cdtext, uint8_t *wdata, size_t i_data);
236 
242 void cdtext_destroy (cdtext_t *p_cdtext);
243 
250 char *cdtext_get (const cdtext_t *p_cdtext, cdtext_field_t key, track_t track);
251 
262 const char *cdtext_get_const (const cdtext_t *p_cdtext, cdtext_field_t field,
263  track_t track);
264 
270 cdtext_genre_t cdtext_get_genre (const cdtext_t *p_cdtext);
271 
277 cdtext_lang_t cdtext_get_language (const cdtext_t *p_cdtext);
278 
287 bool cdtext_select_language(cdtext_t *p_cdtext, cdtext_lang_t language);
288 
289 /*
290  Returns a list of available languages or NULL.
291 
292  Internally the list is stored in a static array.
293 
294  @param p_cdtext the CD-TEXT object
295 */
296 cdtext_lang_t *cdtext_list_languages (const cdtext_t *p_cdtext);
297 
309 void cdtext_set (cdtext_t *p_cdtext, cdtext_field_t key, const uint8_t *value, track_t track, const char *charset);
310 
311 #ifdef __cplusplus
312 }
313 #endif /* __cplusplus */
314 
315 #endif /* CDIO_CDTEXT_H_ */
316 
317 /*
318  * Local variables:
319  * c-file-style: "gnu"
320  * tab-width: 8
321  * indent-tabs-mode: nil
322  * End:
323  */
Definition: cdtext.h:50
cdtext_field_t
Definition: cdtext.h:40
Definition: cdtext.h:61
Definition: cdtext.h:116
Definition: cdtext.h:82
Definition: cdtext.h:69
Definition: cdtext.h:148
Definition: cdtext.h:121
Definition: cdtext.h:83
Definition: cdtext.h:62
Definition: cdtext.h:139
Common type definitions used pervasively in libcdio.
Definition: cdtext.h:136
Definition: cdtext.h:187
Definition: cdtext.h:168
Definition: cdtext.h:172
bool cdtext_select_language(cdtext_t *p_cdtext, cdtext_lang_t language)
Definition: cdtext.h:125
Definition: cdtext.h:154
Definition: cdtext.h:166
Definition: cdtext.h:103
Definition: cdtext.h:97
Definition: cdtext.h:169
const char * cdtext_genre2str(cdtext_genre_t i)
Definition: cdtext.h:137
cdtext_lang_t
Definition: cdtext.h:92
Definition: cdtext.h:122
Definition: cdtext.h:102
#define MAX_CDTEXT_FIELDS
Definition: cdtext.h:37
Definition: cdtext.h:165
Definition: cdtext.h:80
Definition: cdtext.h:107
Definition: cdtext.h:190
Definition: cdtext.h:128
const char * cdtext_get_const(const cdtext_t *p_cdtext, cdtext_field_t field, track_t track)
void cdtext_destroy(cdtext_t *p_cdtext)
Definition: cdtext.h:182
Definition: cdtext.h:96
Definition: cdtext.h:175
Definition: cdtext.h:153
Definition: cdtext.h:70
Definition: cdtext.h:48
Definition: cdtext.h:49
Definition: cdtext.h:142
uint8_t track_t
Definition: types.h:275
Definition: cdtext.h:159
Definition: cdtext.h:78
Definition: cdtext.h:132
Definition: cdtext.h:73
Definition: cdtext.h:177
Definition: cdtext.h:71
Definition: cdtext.h:109
Definition: cdtext.h:81
Definition: cdtext.h:76
Definition: cdtext.h:158
cdtext_genre_t cdtext_get_genre(const cdtext_t *p_cdtext)
Definition: cdtext.h:59
Definition: cdtext.h:173
Definition: cdtext.h:192
Definition: cdtext.h:135
Definition: cdtext.h:189
cdtext_genre_t
Definition: cdtext.h:55
Definition: cdtext.h:66
Definition: cdtext.h:51
Definition: cdtext.h:47
Definition: cdtext.h:77
Definition: cdtext.h:167
Definition: cdtext.h:161
Definition: cdtext.h:126
Definition: cdtext.h:156
Definition: cdtext.h:60
Definition: cdtext.h:152
Definition: cdtext.h:45
Definition: cdtext.h:104
char * cdtext_get(const cdtext_t *p_cdtext, cdtext_field_t key, track_t track)
Definition: cdtext.h:108
Definition: cdtext.h:75
Definition: cdtext.h:57
Definition: cdtext.h:46
Definition: cdtext.h:93
Definition: cdtext.h:145
Definition: cdtext.h:183
Definition: cdtext.h:113
Definition: cdtext.h:58
Definition: cdtext.h:140
Definition: cdtext.h:134
Definition: cdtext.h:111
Definition: cdtext.h:43
Definition: cdtext.h:191
Definition: cdtext.h:155
Definition: cdtext.h:180
const char * cdtext_lang2str(cdtext_lang_t i)
Definition: cdtext.h:64
Definition: cdtext.h:112
Definition: cdtext.h:193
Definition: cdtext.h:195
Definition: cdtext.h:56
Definition: cdtext.h:99
Definition: cdtext.h:127
const char * cdtext_field2str(cdtext_field_t i)
Definition: cdtext.h:65
Definition: cdtext.h:181
Definition: cdtext.h:174
Definition: cdtext.h:74
Definition: cdtext.h:164
Definition: cdtext.h:186
Definition: cdtext.h:130
Definition: cdtext.h:114
Definition: cdtext.h:188
Definition: cdtext.h:106
Definition: cdtext.h:100
cdtext_t * cdtext_init(void)
Definition: cdtext.h:117
Definition: cdtext.h:63
Definition: cdtext.h:44
Definition: cdtext.h:160
Definition: cdtext.h:118
Definition: cdtext.h:120
Definition: cdtext.h:79
Definition: cdtext.h:124
struct cdtext_s cdtext_t
Definition: cdtext.h:201
Definition: cdtext.h:72
Definition: cdtext.h:184
Definition: cdtext.h:41
int cdtext_data_init(cdtext_t *p_cdtext, uint8_t *wdata, size_t i_data)
Definition: cdtext.h:179
Definition: cdtext.h:163
Definition: cdtext.h:185
Definition: cdtext.h:147
Definition: cdtext.h:149
Definition: cdtext.h:67
Definition: cdtext.h:105
void cdtext_set(cdtext_t *p_cdtext, cdtext_field_t key, const uint8_t *value, track_t track, const char *charset)
Definition: cdtext.h:171
Definition: cdtext.h:143
Definition: cdtext.h:42
Definition: cdtext.h:94
Definition: cdtext.h:178
cdtext_lang_t cdtext_get_language(const cdtext_t *p_cdtext)
Definition: cdtext.h:141
Definition: cdtext.h:131
Definition: cdtext.h:157
Definition: cdtext.h:146
Definition: cdtext.h:84
Definition: cdtext.h:98
Definition: cdtext.h:144
Definition: cdtext.h:151
Definition: cdtext.h:138
Definition: cdtext.h:133
Definition: cdtext.h:176
Definition: cdtext.h:162
Definition: cdtext.h:119
Definition: cdtext.h:110
Definition: cdtext.h:150
Definition: cdtext.h:95
Definition: cdtext.h:170
Definition: cdtext.h:194
Definition: cdtext.h:101
cdtext_lang_t * cdtext_list_languages(const cdtext_t *p_cdtext)
Definition: cdtext.h:115
Definition: cdtext.h:68
Definition: cdtext.h:129
Definition: cdtext.h:123