libcdio  0.90
track.h
Go to the documentation of this file.
00001 /*
00002     Copyright (C) 2005, 2006, 2008, 2012 Rocky Bernstein <rocky@gnu.org>
00003 
00004     This program is free software: you can redistribute it and/or modify
00005     it under the terms of the GNU General Public License as published by
00006     the Free Software Foundation, either version 3 of the License, or
00007     (at your option) any later version.
00008 
00009     This program is distributed in the hope that it will be useful,
00010     but WITHOUT ANY WARRANTY; without even the implied warranty of
00011     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012     GNU General Public License for more details.
00013 
00014     You should have received a copy of the GNU General Public License
00015     along with this program.  If not, see <http://www.gnu.org/licenses/>.
00016 */
00017 
00021 #ifndef CDIO_TRACK_H_
00022 #define CDIO_TRACK_H_
00023 
00024 #ifdef __cplusplus
00025 extern "C" {
00026 #endif /* __cplusplus */
00027 
00029   extern const char *track_format2str[6];
00030 
00031   typedef enum  {
00032     TRACK_FORMAT_AUDIO,   
00033     TRACK_FORMAT_CDI,     
00034     TRACK_FORMAT_XA,      
00035     TRACK_FORMAT_DATA,    
00036     TRACK_FORMAT_PSX,     
00039     TRACK_FORMAT_ERROR    
00040   } track_format_t;
00041 
00042   typedef enum {
00043     CDIO_TRACK_FLAG_FALSE,
00044     CDIO_TRACK_FLAG_TRUE,
00045     CDIO_TRACK_FLAG_ERROR,
00046     CDIO_TRACK_FLAG_UNKNOWN
00047   } track_flag_t;
00048 
00050   typedef struct {
00051     track_flag_t preemphasis; 
00052     track_flag_t copy_permit; 
00053     int channels;             
00056   } track_flags_t;
00057 
00070   extern enum cdio_track_enums {
00071     CDIO_CDROM_LBA           = 0x01, 
00072     CDIO_CDROM_MSF           = 0x02, 
00074     CDIO_CDROM_DATA_TRACK    = 0x04,
00075     CDIO_CDROM_CDI_TRACK     = 0x10,
00076     CDIO_CDROM_XA_TRACK      = 0x20,
00077     CDIO_CD_MAX_TRACKS       =   99, 
00078     CDIO_CDROM_LEADOUT_TRACK = 0xAA, 
00079     CDIO_INVALID_TRACK       = 0xFF, 
00081    } cdio_track_enums;
00082 
00083 #define CDIO_CD_MIN_TRACK_NO  1 
00088   typedef enum {
00089     AUDIO,                      
00090     MODE1,                      
00091     MODE1_RAW,                  
00092     MODE2,                      
00093     MODE2_FORM1,                
00094     MODE2_FORM2,                
00095     MODE2_FORM_MIX,             
00096     MODE2_RAW                   
00097   } trackmode_t;
00098 
00105   track_t cdio_get_first_track_num(const CdIo_t *p_cdio);
00106 
00111   track_t cdio_get_last_track_num (const CdIo_t *p_cdio);
00112 
00113 
00121   track_t cdio_get_track(const CdIo_t *p_cdio, lsn_t lsn);
00122 
00127   int cdio_get_track_channels(const CdIo_t *p_cdio, track_t i_track);
00128 
00132   track_flag_t cdio_get_track_copy_permit(const CdIo_t *p_cdio,
00133                                           track_t i_track);
00134 
00138   track_format_t cdio_get_track_format(const CdIo_t *p_cdio, track_t i_track);
00139 
00148   bool cdio_get_track_green(const CdIo_t *p_cdio, track_t i_track);
00149 
00154   lsn_t cdio_get_track_last_lsn(const CdIo_t *p_cdio, track_t i_track);
00155 
00168   lba_t cdio_get_track_lba(const CdIo_t *p_cdio, track_t i_track);
00169 
00182   lsn_t cdio_get_track_lsn(const CdIo_t *p_cdio, track_t i_track);
00183 
00193   lba_t cdio_get_track_pregap_lba(const CdIo_t *p_cdio, track_t i_track);
00194 
00204   lsn_t cdio_get_track_pregap_lsn(const CdIo_t *p_cdio, track_t i_track);
00205 
00218   char * cdio_get_track_isrc (const CdIo_t *p_cdio, track_t i_track);
00219 
00230   bool cdio_get_track_msf(const CdIo_t *p_cdio, track_t i_track,
00231                           /*out*/ msf_t *msf);
00232 
00236   track_flag_t cdio_get_track_preemphasis(const CdIo_t *p_cdio,
00237                                           track_t i_track);
00238 
00247   unsigned int cdio_get_track_sec_count(const CdIo_t *p_cdio, track_t i_track);
00248 
00249 #ifdef __cplusplus
00250 }
00251 #endif /* __cplusplus */
00252 
00253 #endif /* CDIO_TRACK_H_ */