libcdio  0.83
sector.h
Go to the documentation of this file.
1 /*
2  $Id: sector.h,v 1.38 2008/03/25 15:59:09 karl Exp $
3 
4  Copyright (C) 2003, 2004, 2005, 2006, 2008 Rocky Bernstein <rocky@gnu.org>
5  Copyright (C) 2000 Herbert Valerio Riedel <hvr@gnu.org>
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 */
59 
60 #ifndef _CDIO_SECTOR_H_
61 #define _CDIO_SECTOR_H_
62 
63 #ifdef __cplusplus
64  extern "C" {
65 #endif
66 
67 #include <cdio/types.h>
68 
72 #define CDIO_SUBCHANNEL_SUBQ_DATA 0
73 #define CDIO_SUBCHANNEL_CURRENT_POSITION 1
74 #define CDIO_SUBCHANNEL_MEDIA_CATALOG 2
75 #define CDIO_SUBCHANNEL_TRACK_ISRC 3
76 
80  typedef enum {
81  NONE = 0x00, /* no flags set */
82  PRE_EMPHASIS = 0x01, /* audio track recorded with pre-emphasis */
83  COPY_PERMITTED = 0x02, /* digital copy permitted */
84  DATA = 0x04, /* data track */
85  FOUR_CHANNEL_AUDIO = 0x08, /* 4 audio channels */
86  SCMS = 0x10 /* SCMS (5.29.2.7) */
87  } flag_t;
88 
89 #define CDIO_PREGAP_SECTORS 150
90 #define CDIO_POSTGAP_SECTORS 150
91 
97  extern enum cdio_cd_enums {
98  CDIO_CD_MINS = 74,
123  CDIO_CD_MAX_LSN = 450150,
124  CDIO_CD_MIN_LSN = -450150,
125  } cdio_cd_enums;
126 
132 #define CDIO_CD_MINS 74
134 #define CDIO_CD_SECS_PER_MIN 60
135 #define CDIO_CD_FRAMES_PER_SEC 75
136 #define CDIO_CD_SYNC_SIZE 12
137 #define CDIO_CD_CHUNK_SIZE 24
138 #define CDIO_CD_NUM_OF_CHUNKS 98
139 #define CDIO_CD_FRAMESIZE_SUB 96
140 #define CDIO_CD_HEADER_SIZE 4
142 #define CDIO_CD_SUBHEADER_SIZE 8
144 #define CDIO_CD_EDC_SIZE 4
146 #define CDIO_CD_M1F1_ZERO_SIZE 8
148 #define CDIO_CD_ECC_SIZE 276
150 #define CDIO_CD_FRAMESIZE 2048
151 #define CDIO_CD_FRAMESIZE_RAW 2352
152 #define CDIO_CD_FRAMESIZE_RAWER 2646
154 #define CDIO_CD_FRAMESIZE_RAW1 (CDIO_CD_CD_FRAMESIZE_RAW-CDIO_CD_SYNC_SIZE) /*2340*/
155 #define CDIO_CD_FRAMESIZE_RAW0 (CDIO_CD_FRAMESIZE_RAW-CDIO_CD_SYNC_SIZE-CDIO_CD_HEADER_SIZE) /*2336*/
156 
158 #define CDIO_CD_XA_HEADER (CDIO_CD_HEADER_SIZE+CDIO_CD_SUBHEADER_SIZE)
159 
161 #define CDIO_CD_XA_TAIL (CDIO_CD_EDC_SIZE+CDIO_CD_ECC_SIZE)
162 
164 #define CDIO_CD_XA_SYNC_HEADER (CDIO_CD_SYNC_SIZE+CDIO_CD_XA_HEADER)
165 
168  extern const uint8_t CDIO_SECTOR_SYNC_HEADER[CDIO_CD_SYNC_SIZE];
178  extern enum m2_sector_enums {
182  } m2_sector_enums;
183 
184 #define M2F2_SECTOR_SIZE 2324
185 #define M2SUB_SECTOR_SIZE 2332
186 #define M2RAW_SECTOR_SIZE 2336
187 
189 #define CDIO_CD_MAX_SESSIONS 99
190 
191 #define CDIO_CD_MIN_SESSION_NO 1
192 
194 #define CDIO_CD_MAX_LSN 450150
195 
196 #define CDIO_CD_MIN_LSN -450150
197 
198 
199 #define CDIO_CD_FRAMES_PER_MIN \
200  (CDIO_CD_FRAMES_PER_SEC*CDIO_CD_SECS_PER_MIN)
201 
202 #define CDIO_CD_74MIN_SECTORS (UINT32_C(74)*CDIO_CD_FRAMES_PER_MIN)
203 #define CDIO_CD_80MIN_SECTORS (UINT32_C(80)*CDIO_CD_FRAMES_PER_MIN)
204 #define CDIO_CD_90MIN_SECTORS (UINT32_C(90)*CDIO_CD_FRAMES_PER_MIN)
205 
206 #define CDIO_CD_MAX_SECTORS \
207  (UINT32_C(100)*CDIO_CD_FRAMES_PER_MIN-CDIO_PREGAP_SECTORS)
208 
209 #define msf_t_SIZEOF 3
210 
214  char *cdio_lba_to_msf_str (lba_t i_lba);
215 
219  char *cdio_msf_to_str (const msf_t *p_msf);
220 
224  lba_t cdio_lba_to_lsn (lba_t i_lba);
225 
229  void cdio_lba_to_msf(lba_t i_lba, msf_t *p_msf);
230 
235  lba_t cdio_lsn_to_lba (lsn_t i_lsn);
236 
240  void cdio_lsn_to_msf (lsn_t i_lsn, msf_t *p_msf);
241 
246  lba_t cdio_msf_to_lba (const msf_t *p_msf);
247 
252  lsn_t cdio_msf_to_lsn (const msf_t *p_msf);
253 
259  lba_t cdio_msf3_to_lba (unsigned int minutes, unsigned int seconds,
260  unsigned int frames);
261 
266  lba_t cdio_mmssff_to_lba (const char *psz_mmssff);
267 
268 #ifdef __cplusplus
269  }
270 #endif
271 
272 #ifndef DO_NOT_WANT_PARANOIA_COMPATIBILITY
273 
274 #define CD_FRAMESIZE_RAW CDIO_CD_FRAMESIZE_RAW
275 #endif /*DO_NOT_WANT_PARANOIA_COMPATIBILITY*/
276 
277 #endif /* _CDIO_SECTOR_H_ */
278 
279 
280 /*
281  * Local variables:
282  * c-file-style: "gnu"
283  * tab-width: 8
284  * indent-tabs-mode: nil
285  * End:
286  */

Generated for libcdio by doxygen 1.8.1.1