libcdio
0.82
|
00001 /* 00002 $Id: track.h,v 1.14 2008/03/25 15:59:09 karl Exp $ 00003 00004 Copyright (C) 2005, 2006, 2008 Rocky Bernstein <rocky@gnu.org> 00005 00006 This program is free software: you can redistribute it and/or modify 00007 it under the terms of the GNU General Public License as published by 00008 the Free Software Foundation, either version 3 of the License, or 00009 (at your option) any later version. 00010 00011 This program is distributed in the hope that it will be useful, 00012 but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00014 GNU General Public License for more details. 00015 00016 You should have received a copy of the GNU General Public License 00017 along with this program. If not, see <http://www.gnu.org/licenses/>. 00018 */ 00019 00023 #ifndef __CDIO_TRACK_H__ 00024 #define __CDIO_TRACK_H__ 00025 00026 #ifdef __cplusplus 00027 extern "C" { 00028 #endif /* __cplusplus */ 00029 00031 extern const char *track_format2str[6]; 00032 00033 typedef enum { 00034 TRACK_FORMAT_AUDIO, 00035 TRACK_FORMAT_CDI, 00036 TRACK_FORMAT_XA, 00037 TRACK_FORMAT_DATA, 00038 TRACK_FORMAT_PSX, 00041 TRACK_FORMAT_ERROR 00042 } track_format_t; 00043 00044 typedef enum { 00045 CDIO_TRACK_FLAG_FALSE, 00046 CDIO_TRACK_FLAG_TRUE, 00047 CDIO_TRACK_FLAG_ERROR, 00048 CDIO_TRACK_FLAG_UNKNOWN 00049 } track_flag_t; 00050 00052 typedef struct { 00053 track_flag_t preemphasis; 00054 track_flag_t copy_permit; 00055 int channels; 00058 } track_flags_t; 00059 00072 extern enum cdio_track_enums { 00073 CDIO_CDROM_LBA = 0x01, 00074 CDIO_CDROM_MSF = 0x02, 00076 CDIO_CDROM_DATA_TRACK = 0x04, 00077 CDIO_CDROM_CDI_TRACK = 0x10, 00078 CDIO_CDROM_XA_TRACK = 0x20, 00079 CDIO_CD_MAX_TRACKS = 99, 00080 CDIO_CDROM_LEADOUT_TRACK = 0xAA, 00081 CDIO_INVALID_TRACK = 0xFF, 00083 } cdio_track_enums; 00084 00085 #define CDIO_CD_MIN_TRACK_NO 1 00090 typedef enum { 00091 AUDIO, 00092 MODE1, 00093 MODE1_RAW, 00094 MODE2, 00095 MODE2_FORM1, 00096 MODE2_FORM2, 00097 MODE2_FORM_MIX, 00098 MODE2_RAW 00099 } trackmode_t; 00100 00112 cdtext_t *cdio_get_cdtext (CdIo_t *p_cdio, track_t i_track); 00113 00120 track_t cdio_get_first_track_num(const CdIo_t *p_cdio); 00121 00126 track_t cdio_get_last_track_num (const CdIo_t *p_cdio); 00127 00128 00136 track_t cdio_get_track(const CdIo_t *p_cdio, lsn_t lsn); 00137 00142 int cdio_get_track_channels(const CdIo_t *p_cdio, track_t i_track); 00143 00147 track_flag_t cdio_get_track_copy_permit(const CdIo_t *p_cdio, 00148 track_t i_track); 00149 00153 track_format_t cdio_get_track_format(const CdIo_t *p_cdio, track_t i_track); 00154 00163 bool cdio_get_track_green(const CdIo_t *p_cdio, track_t i_track); 00164 00169 lsn_t cdio_get_track_last_lsn(const CdIo_t *p_cdio, track_t i_track); 00170 00183 lba_t cdio_get_track_lba(const CdIo_t *p_cdio, track_t i_track); 00184 00197 lsn_t cdio_get_track_lsn(const CdIo_t *p_cdio, track_t i_track); 00198 00208 lba_t cdio_get_track_pregap_lba(const CdIo_t *p_cdio, track_t i_track); 00209 00219 lsn_t cdio_get_track_pregap_lsn(const CdIo_t *p_cdio, track_t i_track); 00220 00233 char * cdio_get_track_isrc (const CdIo_t *p_cdio, track_t i_track); 00234 00245 bool cdio_get_track_msf(const CdIo_t *p_cdio, track_t i_track, 00246 /*out*/ msf_t *msf); 00247 00251 track_flag_t cdio_get_track_preemphasis(const CdIo_t *p_cdio, 00252 track_t i_track); 00253 00262 unsigned int cdio_get_track_sec_count(const CdIo_t *p_cdio, track_t i_track); 00263 00264 #ifdef __cplusplus 00265 } 00266 #endif /* __cplusplus */ 00267 00268 #endif /* __CDIO_TRACK_H__ */ 00269