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_private.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2004-2005, 2008, 2011-2013
3  Rocky Bernstein <rocky@gnu.org>
4 
5  This program is free software: you can redistribute it and/or modify
6  it under the terms of the GNU General Public License as published by
7  the Free Software Foundation, either version 3 of the License, or
8  (at your option) any later version.
9 
10  This program is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU General Public License for more details.
14 
15  You should have received a copy of the GNU General Public License
16  along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18 
19 #ifndef CDIO_DRIVER_CDTEXT_PRIVATE_H_
20 #define CDIO_DRIVER_CDTEXT_PRIVATE_H_
21 
22 #include <cdio/types.h>
23 
24 #ifndef CDIO_CD_MAX_TRACKS
25 # define CDIO_CD_MAX_TRACKS 99 /* Largest CD track number */
26 #endif
27 
28 #define CDTEXT_GET_LEN16(p) (p[0]<<8) + p[1]
29 
30 
31 typedef enum {
37  CDTEXT_NUM_TRACKS_MAX = CDIO_CD_MAX_TRACKS+1, /* +1 for 0th disk track */
40 
45 typedef enum {
59 
60 
62 typedef enum cdtext_charcode_enum_s {
66 // * They are mentioned for completeness here
68 // * CDTEXT_CHARCODE_KOREAN = 0x81, /**< Korean */
69 // * CDTEXT_CHARCODE_CHINESE = 0x82, /**< Mandarin Chinese */
70 // * CDTEXT_CHARCODE_UNDEFINED = 0xFF, /**< everything else */
71 // */
72 
74 
77 {
78  uint8_t type;
79  uint8_t i_track;
80  uint8_t seq;
81  uint8_t char_pos; /* character position */
82  uint8_t block; /* block number 0..7 */
83  uint8_t db_chars; /* double byte character */
85  uint8_t crc[2];
86 };
87 
88 
91 {
92  uint8_t charcode; /* character code */
93  uint8_t i_first_track; /* first track number */
94  uint8_t i_last_track; /* last track number */
95  uint8_t copyright; /* 3 CD-TEXT is copyrighted, 0 no copyright on CD-TEXT */
96  uint8_t i_packs[16]; /* number of packs of each type
97  * 0 TITLE; 1 PERFORMER; 2 SONGWRITER; 3 COMPOSER;
98  * 4 ARRANGER; 5 MESSAGE; 6 DISCID; 7 GENRE;
99  * 8 TOC; 9 TOC2; 10-12 RESERVED; 13 CLOSED;
100  * 14 UPC_ISRC; 15 BLOCKSIZE */
101  uint8_t lastseq[8]; /* last sequence for block 0..7 */
102  uint8_t langcode[8]; /* language code for block 0..7 */
103 };
104 
107 
111 };
112 
118  bool copyright;
121 };
122 
127 struct cdtext_s {
130  uint8_t block_i;
131 };
132 
133 int cdtext_read_pack (cdtext_pack_t *pack, const uint8_t *data);
134 
139 cdtext_field_t cdtext_is_field (const char *field);
140 
141 #endif /* CDIO_DRIVER_CDTEXT_PRIVATE_H_ */
142 
143 /*
144  * Local variables:
145  * c-file-style: "gnu"
146  * tab-width: 8
147  * indent-tabs-mode: nil
148  * End:
149  */
CDTEXT_PACK_ARRANGER
Definition: cdtext_private.h:50
cdtext_block_s::language_code
cdtext_lang_t language_code
Definition: cdtext_private.h:117
cdtext_block_s::last_track
track_t last_track
Definition: cdtext_private.h:120
CDTEXT_PACK_UPC
Definition: cdtext_private.h:56
types.h
Common type definitions used pervasively in libcdio.
cdtext_block_s::copyright
bool copyright
Definition: cdtext_private.h:118
CDTEXT_PACK_DISCID
Definition: cdtext_private.h:52
CDTEXT_PACK_TOC
Definition: cdtext_private.h:54
cdtext_track_s::field
char * field[MAX_CDTEXT_FIELDS]
Definition: cdtext_private.h:110
CDTEXT_PACK_COMPOSER
Definition: cdtext_private.h:49
CDTEXT_LEN_BLOCKSIZE
Definition: cdtext_private.h:35
CDTEXT_NUM_BLOCKS_MAX
Definition: cdtext_private.h:36
cdtext_s::block
struct cdtext_block_s block[CDTEXT_NUM_BLOCKS_MAX]
Definition: cdtext_private.h:128
cdtext_genre_t
cdtext_genre_t
Enumeration of possible genre codes.
Definition: cdtext.h:62
cdtext_pack_s::db_chars
uint8_t db_chars
Definition: cdtext_private.h:83
cdtext_pack_s::crc
uint8_t crc[2]
Definition: cdtext_private.h:85
MAX_CDTEXT_FIELDS
#define MAX_CDTEXT_FIELDS
Definition: cdtext.h:38
track_t
uint8_t track_t
Definition: types.h:276
cdtext_pack_s::type
uint8_t type
Definition: cdtext_private.h:78
CDTEXT_PACK_MESSAGE
Definition: cdtext_private.h:51
cdtext_pack_s::text
uint8_t text[CDTEXT_LEN_TEXTDATA]
Definition: cdtext_private.h:84
cdtext_track_s
Definition: cdtext_private.h:109
CDTEXT_CHARCODE_ASCII
Definition: cdtext_private.h:64
cdtext_blocksize_s::lastseq
uint8_t lastseq[8]
Definition: cdtext_private.h:101
cdtext_block_s::genre_code
cdtext_genre_t genre_code
Definition: cdtext_private.h:116
CDTEXT_PACK_TITLE
Definition: cdtext_private.h:46
cdtext_packtype_enum_t
cdtext_packtype_enum_t
Definition: cdtext_private.h:45
CDTEXT_PACK_GENRE
Definition: cdtext_private.h:53
CDIO_CD_MAX_TRACKS
#define CDIO_CD_MAX_TRACKS
Definition: cdtext_private.h:25
CDTEXT_CHARCODE_ISO_8859_1
Definition: cdtext_private.h:63
CDTEXT_PACK_PERFORMER
Definition: cdtext_private.h:47
cdtext_block_s::first_track
track_t first_track
Definition: cdtext_private.h:119
cdtext_pack_s::block
uint8_t block
Definition: cdtext_private.h:82
cdtext_pack_s::i_track
uint8_t i_track
Definition: cdtext_private.h:79
cdtext_s::block_i
uint8_t block_i
Definition: cdtext_private.h:130
cdtext_read_pack
int cdtext_read_pack(cdtext_pack_t *pack, const uint8_t *data)
Definition: cdtext.c:865
cdtext_blocksize_s::i_packs
uint8_t i_packs[16]
Definition: cdtext_private.h:96
CDTEXT_PACK_SONGWRITER
Definition: cdtext_private.h:48
CDTEXT_PACK_BLOCKSIZE
Definition: cdtext_private.h:57
cdtext_blocksize_s::copyright
uint8_t copyright
Definition: cdtext_private.h:95
cdtext_charcode_enum_t
enum cdtext_charcode_enum_s cdtext_charcode_enum_t
CDTEXT_NUM_TRACKS_MAX
Definition: cdtext_private.h:37
cdtext_blocksize_s
Definition: cdtext_private.h:90
cdtext_blocksize_s::charcode
uint8_t charcode
Definition: cdtext_private.h:92
cdtext_blocksize_s::i_last_track
uint8_t i_last_track
Definition: cdtext_private.h:94
cdtext_pack_s
Definition: cdtext_private.h:76
cdtext_pack_s::char_pos
uint8_t char_pos
Definition: cdtext_private.h:81
cdtext_pack_s::seq
uint8_t seq
Definition: cdtext_private.h:80
cdtext_is_field
cdtext_field_t cdtext_is_field(const char *field)
Definition: cdtext.c:520
cdtext_block_s
Definition: cdtext_private.h:114
cdtext_blocksize_s::i_first_track
uint8_t i_first_track
Definition: cdtext_private.h:93
cdtext_block_s::track
struct cdtext_track_s track[CDTEXT_NUM_TRACKS_MAX]
Definition: cdtext_private.h:115
cdtext_lang_t
cdtext_lang_t
Enumeration of possible CD-TEXT languages.
Definition: cdtext.h:101
cdtext_s::languages
cdtext_lang_t languages[CDTEXT_NUM_BLOCKS_MAX]
Definition: cdtext_private.h:129
cdtext_s
Definition: cdtext_private.h:127
CDTEXT_PACK_TOC2
Definition: cdtext_private.h:55
cdtext_field_t
cdtext_field_t
Enumeration of CD-TEXT text fields.
Definition: cdtext.h:44
cdtext_format_enum_t
cdtext_format_enum_t
Definition: cdtext_private.h:31
CDTEXT_NUM_BLOCKPACKS_MAX
Definition: cdtext_private.h:38
CDTEXT_LEN_TEXTDATA
Definition: cdtext_private.h:33
CDTEXT_LEN_PACK
Definition: cdtext_private.h:34
CDTEXT_CHARCODE_SHIFT_JIS
Definition: cdtext_private.h:65
cdtext_blocksize_s::langcode
uint8_t langcode[8]
Definition: cdtext_private.h:102
cdtext_charcode_enum_s
cdtext_charcode_enum_s
Definition: cdtext_private.h:62
CDTEXT_LEN_BINARY_MAX
Definition: cdtext_private.h:32