libcdio 2.1.1
sector.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2003, 2004, 2005, 2006, 2008, 2012
3 Rocky Bernstein <rocky@gnu.org>
4 Copyright (C) 2000 Herbert Valerio Riedel <hvr@gnu.org>
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*/
58
59#ifndef CDIO_SECTOR_H_
60#define CDIO_SECTOR_H_
61
62#ifdef __cplusplus
63 extern "C" {
64#endif
65
66#include <cdio/types.h>
67
78
82 typedef enum {
83 NONE = 0x00, /* no flags set */
84 PRE_EMPHASIS = 0x01, /* audio track recorded with pre-emphasis */
85 COPY_PERMITTED = 0x02, /* digital copy permitted */
86 DATA = 0x04, /* data track */
87 FOUR_CHANNEL_AUDIO = 0x08, /* 4 audio channels */
88 SCMS = 0x10 /* SCMS (5.29.2.7) */
90
91#define CDIO_PREGAP_SECTORS 150
92#define CDIO_POSTGAP_SECTORS 150
93
128
134#define CDIO_CD_MINS 74
136#define CDIO_CD_SECS_PER_MIN 60
137#define CDIO_CD_FRAMES_PER_SEC 75
138#define CDIO_CD_SYNC_SIZE 12
139#define CDIO_CD_CHUNK_SIZE 24
140#define CDIO_CD_NUM_OF_CHUNKS 98
141#define CDIO_CD_FRAMESIZE_SUB 96
142#define CDIO_CD_HEADER_SIZE 4
144#define CDIO_CD_SUBHEADER_SIZE 8
146#define CDIO_CD_EDC_SIZE 4
148#define CDIO_CD_M1F1_ZERO_SIZE 8
150#define CDIO_CD_ECC_SIZE 276
152#define CDIO_CD_FRAMESIZE 2048
153#define CDIO_CD_FRAMESIZE_RAW 2352
154#define CDIO_CD_FRAMESIZE_RAWER 2646
156#define CDIO_CD_FRAMESIZE_RAW1 (CDIO_CD_FRAMESIZE_RAW-CDIO_CD_SYNC_SIZE) /*2340*/
157#define CDIO_CD_FRAMESIZE_RAW0 (CDIO_CD_FRAMESIZE_RAW-CDIO_CD_SYNC_SIZE-CDIO_CD_HEADER_SIZE) /*2336*/
158
160#define CDIO_CD_XA_HEADER (CDIO_CD_HEADER_SIZE+CDIO_CD_SUBHEADER_SIZE)
161
163#define CDIO_CD_XA_TAIL (CDIO_CD_EDC_SIZE+CDIO_CD_ECC_SIZE)
164
166#define CDIO_CD_XA_SYNC_HEADER (CDIO_CD_SYNC_SIZE+CDIO_CD_XA_HEADER)
167
170 extern const uint8_t CDIO_SECTOR_SYNC_HEADER[CDIO_CD_SYNC_SIZE];
185
186#define M2F2_SECTOR_SIZE 2324
187#define M2SUB_SECTOR_SIZE 2332
188#define M2RAW_SECTOR_SIZE 2336
189
191#define CDIO_CD_MAX_SESSIONS 99
193#define CDIO_CD_MIN_SESSION_NO 1
194
196#define CDIO_CD_MAX_LSN 450150
198#define CDIO_CD_MIN_LSN -450150
199
200
201#define CDIO_CD_FRAMES_PER_MIN \
202 (CDIO_CD_FRAMES_PER_SEC*CDIO_CD_SECS_PER_MIN)
203
212
213#define msf_t_SIZEOF 3
214
219
223 char *cdio_msf_to_str (const msf_t *p_msf);
224
229
233 void cdio_lba_to_msf(lba_t i_lba, msf_t *p_msf);
234
240
244 void cdio_lsn_to_msf (lsn_t i_lsn, msf_t *p_msf);
245
251
257
263 lba_t cdio_msf3_to_lba (unsigned int minutes, unsigned int seconds,
264 unsigned int frames);
265
270 lba_t cdio_mmssff_to_lba (const char *psz_mmssff);
271
272#ifdef __cplusplus
273 }
274#endif
275
276#ifndef DO_NOT_WANT_PARANOIA_COMPATIBILITY
278#define CD_FRAMESIZE_RAW CDIO_CD_FRAMESIZE_RAW
279#endif /*DO_NOT_WANT_PARANOIA_COMPATIBILITY*/
280
281#endif /* CDIO_SECTOR_H_ */
282
283
284/*
285 * Local variables:
286 * c-file-style: "gnu"
287 * tab-width: 8
288 * indent-tabs-mode: nil
289 * End:
290 */
lba_t cdio_msf_to_lba(const msf_t *p_msf)
#define CDIO_CD_FRAMES_PER_SEC
Definition sector.h:137
char * cdio_msf_to_str(const msf_t *p_msf)
#define CDIO_CD_FRAMESIZE_RAW1
Definition sector.h:156
#define CDIO_CD_HEADER_SIZE
Definition sector.h:142
lba_t cdio_lba_to_lsn(lba_t i_lba)
#define CDIO_CD_FRAMESIZE_RAW
Definition sector.h:153
#define CDIO_CD_FRAMESIZE_SUB
Definition sector.h:141
#define CDIO_CD_CHUNK_SIZE
Definition sector.h:139
void cdio_lba_to_msf(lba_t i_lba, msf_t *p_msf)
#define CDIO_CD_MINS
Definition sector.h:134
#define CDIO_CD_ECC_SIZE
Definition sector.h:150
#define CDIO_CD_FRAMESIZE_RAW0
Definition sector.h:157
#define CDIO_CD_SUBHEADER_SIZE
Definition sector.h:144
#define CDIO_PREGAP_SECTORS
Definition sector.h:91
m2_sector_enums
Definition sector.h:180
#define CDIO_CD_MAX_SESSIONS
Definition sector.h:191
#define CDIO_CD_MIN_SESSION_NO
Definition sector.h:193
#define M2SUB_SECTOR_SIZE
Definition sector.h:187
#define CDIO_CD_FRAMESIZE
Definition sector.h:152
#define CDIO_CD_NUM_OF_CHUNKS
Definition sector.h:140
cdio_cd_enums
Definition sector.h:99
#define CDIO_CD_FRAMESIZE_RAWER
Definition sector.h:154
lba_t cdio_lsn_to_lba(lsn_t i_lsn)
#define CDIO_CD_MIN_LSN
Definition sector.h:198
lba_t cdio_mmssff_to_lba(const char *psz_mmssff)
lsn_t cdio_msf_to_lsn(const msf_t *p_msf)
char * cdio_lba_to_msf_str(lba_t i_lba)
cdio_cd_minutes_sectors
Definition sector.h:205
@ CDIO_CD_MAX_SECTORS
Definition sector.h:210
@ CDIO_CD_90MIN_SECTORS
Definition sector.h:208
@ CDIO_CD_74MIN_SECTORS
Definition sector.h:206
@ CDIO_CD_80MIN_SECTORS
Definition sector.h:207
lba_t cdio_msf3_to_lba(unsigned int minutes, unsigned int seconds, unsigned int frames)
#define CDIO_CD_SECS_PER_MIN
Definition sector.h:136
cdio_subchannel
Definition sector.h:72
@ CDIO_SUBCHANNEL_SUBQ_DATA
Definition sector.h:73
@ CDIO_SUBCHANNEL_TRACK_ISRC
Definition sector.h:76
@ CDIO_SUBCHANNEL_CURRENT_POSITION
Definition sector.h:74
@ CDIO_SUBCHANNEL_MEDIA_CATALOG
Definition sector.h:75
const uint8_t CDIO_SECTOR_SYNC_HEADER[CDIO_CD_SYNC_SIZE]
void cdio_lsn_to_msf(lsn_t i_lsn, msf_t *p_msf)
#define CDIO_CD_MAX_LSN
Definition sector.h:196
#define M2F2_SECTOR_SIZE
Definition sector.h:186
#define CDIO_CD_FRAMES_PER_MIN
Definition sector.h:201
flag_t
Definition sector.h:82
@ PRE_EMPHASIS
Definition sector.h:84
@ SCMS
Definition sector.h:88
@ DATA
Definition sector.h:86
@ COPY_PERMITTED
Definition sector.h:85
@ FOUR_CHANNEL_AUDIO
Definition sector.h:87
@ NONE
Definition sector.h:83
#define M2RAW_SECTOR_SIZE
Definition sector.h:188
#define CDIO_CD_SYNC_SIZE
Definition sector.h:138
Common type definitions used pervasively in libcdio.
typedefPRAGMA_END_PACKED struct msf_s msf_t
Definition types.h:208
#define UINT32_C(c)
Definition types.h:84
int32_t lba_t
Definition types.h:243
int32_t lsn_t
Definition types.h:250