?? cdrecord.h
字號(hào):
/* @(#)cdrecord.h 1.43 98/10/18 Copyright 1995 J. Schilling *//* * Definitions for cdrecord * * Copyright (c) 1995 J. Schilling *//* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; see the file COPYING. If not, write to * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. *//* * Defines for option flags */#define F_DUMMY 0x000001L /* Do dummy writes */#define F_TOC 0x000002L /* Get TOC */#define F_EJECT 0x000004L /* Eject disk after doing the work */#define F_LOAD 0x000008L /* Load disk only */#define F_MULTI 0x000010L /* Create linkable TOC/multi-session */#define F_MSINFO 0x000020L /* Get multi-session info */#define F_FIX 0x000040L /* Fixate disk only */#define F_NOFIX 0x000080L /* Do not fixate disk */#define F_VERSION 0x000100L /* Print version info */#define F_CHECKDRIVE 0x000200L /* Check for driver */#define F_INQUIRY 0x000400L /* Do inquiry */#define F_PRCAP 0x000800L /* Print capabilities */#define F_SCANBUS 0x001000L /* Scan SCSI Bus */#define F_RESET 0x002000L /* Reset SCSI Bus */#define F_BLANK 0x004000L /* Blank CD-RW */#define F_PRATIP 0x008000L /* Print ATIP info */#define F_PRDINFO 0x010000L /* Print disk info */#define F_IGNSIZE 0x020000L /* Ignore disk size */#ifdef min#undef min#endif#define min(a, b) ((a)<(b)?(a):(b))#ifdef max#undef max#endif#define max(a, b) ((a)<(b)?(b):(a))#undef roundup#define roundup(x, y) ((((x)+((y)-1))/(y))*(y))#define DATA_SEC_SIZE 2048#define AUDIO_SEC_SIZE 2352#define MAX_TRACK 99 /* Red Book track limit */#define PAD_SECS 15 /* NOTE: pad must be less than BUF_SIZE */#define PAD_SIZE (PAD_SECS * DATA_SEC_SIZE)#define DEFAULT_FIFOSIZE (4*1024*1024)typedef struct tindex { int dummy; /* Not yet implemented */} tindex_t;typedef struct track { int f; /* Open file for this track */ char *filename; /* File name for this track */ long trackstart; /* Start of this track */ long tracksize; /* Size of this track (-1 == until EOF) */ long padsize; /* Pad size for this track (0 == none) */ long pregapsize; /* Pre-gap size for this track */ int secsize; /* Sector size for this track */ int secspt; /* # of sectors to copy for one transfer*/ int pktsize; /* # of blocks per write packet */ char trackno; /* Track number for this track */ char sectype; /* Sector type */ char tracktype; /* Track type (toc type) */ char dbtype; /* Data block type for this track */ int flags; /* Flags (see below) */ tindex_t *tindex; /* Track index descriptor */} track_t;/* * Defines for flags */#define TI_AUDIO 0x0001 /* File is an audio track */#define TI_PREEMP 0x0002 /* Audio track recorded w/preemphasis */#define TI_MIX 0x0004 /* This is a mixed mode track */#define TI_RAW 0x0008 /* Write this track in raw mode */#define TI_PAD 0x0010 /* Pad data track */#define TI_SWAB 0x0020 /* Swab audio data */#define TI_ISOSIZE 0x0040 /* Use iso size for track */#define TI_NOAUHDR 0x0080 /* Don't look for audio header */#define TI_FIRST 0x0100 /* This is the first track */#define TI_LAST 0x0200 /* This is the last track */#define TI_PACKET 0x0400 /* Fixed- or variable-packet track */#define TI_NOCLOSE 0x0800 /* Don't close the track after writing */#define is_audio(tp) (((tp)->flags & TI_AUDIO) != 0)#define is_preemp(tp) (((tp)->flags & TI_PREEMP) != 0)#define is_pad(tp) (((tp)->flags & TI_PAD) != 0)#define is_swab(tp) (((tp)->flags & TI_SWAB) != 0)#define is_first(tp) (((tp)->flags & TI_FIRST) != 0)#define is_last(tp) (((tp)->flags & TI_LAST) != 0)#define is_packet(tp) (((tp)->flags & TI_PACKET) != 0)#define is_noclose(tp) (((tp)->flags & TI_NOCLOSE) != 0)/* * Defines for toc type / track type */#define TOC_DA 0 /* CD-DA */#define TOC_ROM 1 /* CD-ROM */#define TOC_XA1 2 /* CD_ROM XA with first track in mode 1 */#define TOC_XA2 3 /* CD_ROM XA with first track in mode 2 */#define TOC_CDI 4 /* CDI */#define TOC_MASK 7 /* Mask needed for toctname[] */extern char *toc2name[]; /* Convert toc type to name */extern int toc2sess[]; /* Convert toc type to session format *//* * Defines for sector type * * Mode is 2 bits * Aud is 1 bit * * Sector is: aud << 2 | mode */#define ST_ROM_MODE1 1 /* CD-ROM in mode 1 (vanilla cdrom) */#define ST_ROM_MODE2 2 /* CD-ROM in mode 2 */#define ST_AUDIO_NOPRE 4 /* CD-DA stereo without preemphasis */#define ST_AUDIO_PRE 5 /* CD-DA stereo with preemphasis */#define ST_AUDIOMASK 0x04 /* Mask for audio bit */#define ST_MODEMASK 0x03 /* Mask for mode bits in sector type */#define ST_MASK 0x07 /* Mask needed for sectname[] */extern char *st2name[]; /* Convert sector type to name */extern int st2mode[]; /* Convert sector type to control nibble*//* * Control nibble bits: * * 0 with preemphasis (audio) / incremental (data) * 1 digital copy permitted * 2 data (not audio) track * 3 4 channels (not 2) */#define TM_PREEM 0x1 /* Audio track with preemphasis */ #define TM_INCREMENTAL 0x1 /* Incremental data track */ #define TM_ALLOW_COPY 0x2 /* Digital copy permitted */#define TM_DATA 0x4 /* This is a data track */#define TM_QUADRO 0x8 /* Four channel audio *//* * Adr nibble: */#define ADR_NONE 0 /* Sub-Q mode info not supplied */#define ADR_POS 1 /* Sub-Q encodes position data */#define ADR_MCN 2 /* Sub-Q encodes Media Catalog Number */#define ADR_ISRC 3 /* Sub-Q encodes ISRC *//* * Defines for write type (from SCSI-3/mmc) */#define WT_PACKET 0x0 /* Packet writing */#define WT_TAO 0x1 /* Track at once */#define WT_SAO 0x2 /* Session at once */#define WT_RAW 0x3 /* Raw */#define WT_RES_4 0x4 /* Reserved */#define WT_RES_5 0x5 /* Reserved */#define WT_RES_6 0x6 /* Reserved */#define WT_RES_7 0x7 /* Reserved */#define WT_RES_8 0x8 /* Reserved */#define WT_RES_9 0x9 /* Reserved */#define WT_RES_A 0xA /* Reserved */#define WT_RES_B 0xB /* Reserved */#define WT_RES_C 0xC /* Reserved */#define WT_RES_D 0xD /* Reserved */#define WT_RES_E 0xE /* Reserved */#define WT_RES_F 0xF /* Reserved *//* * Defines for data block type (from SCSI-3/mmc) */#define DB_RAW 0 /* 2352 bytes of raw data */#define DB_RAW_PQ 1 /* 2368 bytes (raw data + P/Q Subchannel) */#define DB_RAW_PW 2 /* 2448 bytes (raw data + P-W Subchannel) */#define DB_RAW_PW_R 3 /* 2448 bytes (raw data + P-W raw Subchannel)*/#define DB_RES_4 4 /* - Reserved */#define DB_RES_5 5 /* - Reserved */#define DB_RES_6 6 /* - Reserved */#define DB_VU_7 7 /* - Vendor specific */#define DB_ROM_MODE1 8 /* 2048 bytes Mode 1 (ISO/IEC 10149) */#define DB_ROM_MODE2 9 /* 2336 bytes Mode 2 (ISO/IEC 10149) */#define DB_XA_MODE1 10 /* 2048 bytes Mode 1? (CD-ROM XA form 1) */#define DB_XA_MODE2 10 /* 2048 bytes Mode 2? (CD-ROM XA form 1) */#define DB_XA_MODE2_F1 11 /* 2056 bytes Mode 2 (CD-ROM XA form 1) */#define DB_XA_MODE2_F2 12 /* 2324 bytes Mode 2 (CD-ROM XA form 2) */#define DB_XA_MODE2_MIX 13 /* 2332 bytes Mode 2 (CD-ROM XA 1/2+subhdr) */#define DB_RES_14 14 /* - Reserved */#define DB_VU_15 15 /* - Vendor specific */extern char *db2name[]; /* Convert data block type to name *//* * Defines for multi session type (from SCSI-3/mmc) */#define MS_NONE 0 /* No B0 pointer. Next session not allowed*/#define MS_FINAL 1 /* B0 = FF:FF:FF. Next session not allowed*/#define MS_RES 2 /* Reserved */#define MS_MULTI 3 /* B0 = Next PA. Next session allowed *//* * Defines for session format (from SCSI-3/mmc) */#define SES_DA_ROM 0x00 /* CD-DA or CD-ROM disk */#define SES_CDI 0x10 /* CD-I disk */#define SES_XA 0x20 /* CD-ROM XA disk */#define SES_UNDEF 0xFF /* Undefined disk type (read disk info) *//* * Defines for blanking of CD-RW discs (from SCSI-3/mmc) */#define BLANK_DISC 0x00 /* Erase the entire disc */#define BLANK_MINIMAL 0x01 /* Erase the PMA, 1st session TOC, pregap */#define BLANK_TRACK 0x02 /* Erase an incomplete track */#define BLANK_UNRESERVE 0x03 /* Unreserve a track */#define BLANK_TAIL 0x04 /* Erase the tail of a track */#define BLANK_UNCLOSE 0x05 /* Unclose the last session */#define BLANK_SESSION 0x06 /* Erase the last session *//* * Useful definitions for audio tracks */#define sample (44100 * 2) /* one 16bit audio sample */#define ssample (sample * 2) /* one stereo sample */#define samples(v) ((v) / ssample) /* # of stereo samples */#define hsamples(v) ((v) / (ssample/100)) /* 100* # of stereo samples/s*/#define fsamples(v) ((v) / (ssample/75)) /* 75* # of stereo samples/s */#define minutes(v) ((int)(samples(v) / 60))#define seconds(v) ((int)(samples(v) % 60))#define hseconds(v) ((int)(hsamples(v) % 100))#define frames(v) ((int)(fsamples(v) % 75))typedef struct msf { char msf_min; char msf_sec; char msf_frame;} msf_t;/* * Definitions for read TOC/PMA/ATIP command */#define FMT_TOC 0#define FMT_SINFO 1#define FMT_FULLTOC 2#define FMT_PMA 3#define FMT_ATIP 4/* * Definitions for read disk information "disk status" */#define DS_EMPTY 0 /* Empty disk */#define DS_APPENDABLE 1 /* Incomplete disk (appendable) */#define DS_COMPLETE 2 /* Complete disk (closed/no B0 pointer) */#define DS_RESERVED 3 /* Reserved *//* * Definitions for read disk information "session status"
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -