1 /* 2 Copyright (C) 2004, 2005, 2008, 2011, 2012 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 /*! 20 Header for image drivers. In contrast to image_common.h which contains 21 routines, this header like most C headers does not depend on anything 22 defined before it is included. 23 */ 24 25 #ifndef CDIO_DRIVER_IMAGE_H_ 26 #define CDIO_DRIVER_IMAGE_H_ 27 28 #if defined(HAVE_CONFIG_H) && !defined(__CDIO_CONFIG_H__) 29 # include "config.h" 30 # define __CDIO_CONFIG_H__ 1 31 #endif 32 33 #ifdef HAVE_STDBOOL_H 34 # include <stdbool.h> 35 #endif 36 37 #include <cdio/types.h> 38 #include <cdio/cdtext.h> 39 #include "cdio_private.h" 40 #include <cdio/sector.h> 41 42 /*! 43 The universal format for information about a track for CD image readers 44 It may be that some fields can be derived from other fields. 45 Over time this structure may get cleaned up. Possibly this can be 46 expanded/reused for real CD formats. 47 */ 48 49 typedef struct { 50 track_t track_num; /**< Probably is index+1 */ 51 msf_t start_msf; 52 lba_t start_lba; 53 int start_index; 54 lba_t pregap; /**< pre-gap */ 55 lba_t silence; /**< pre-gap with zero audio data */ 56 int sec_count; /**< Number of sectors in this track. Does not 57 include pregap */ 58 int num_indices; 59 flag_t flags; /**< "[NO] COPY", "4CH", "[NO] PREMPAHSIS" */ 60 char *isrc; /**< IRSC Code (5.22.4) exactly 12 bytes */ 61 char *filename; 62 CdioDataSource_t *data_source; 63 off_t offset; /**< byte offset into data_start of track 64 beginning. In cdrdao for example, one 65 filename may cover many tracks and 66 each track would then have a different 67 offset. 68 */ 69 track_format_t track_format; 70 bool track_green; 71 72 trackmode_t mode; 73 uint16_t datasize; /**< How much is in the portion we return 74 back? */ 75 uint16_t datastart; /**< Offset from begining of frame 76 that data starts */ 77 uint16_t endsize; /**< How much stuff at the end to skip over. 78 This stuff may have error correction 79 (EDC, or ECC).*/ 80 uint16_t blocksize; /**< total block size = start + size + end */ 81 } track_info_t; 82 83 84 #endif /* CDIO_DRIVER_IMAGE_H_ */ 85