Remove duplicate cdio_mmc_disctype_t.

This commit is contained in:
R. Bernstein
2010-02-08 19:01:14 -05:00
parent 100654b51b
commit 5656a0b14c
5 changed files with 74 additions and 92 deletions

View File

@@ -451,12 +451,11 @@ typedef enum {
recording */
CDIO_MMC_FEATURE_PROF_DVD_PRW = 0x001A, /**< DVD+RW - DVD ReWritable */
CDIO_MMC_FEATURE_PROF_DVD_PR = 0x001B, /**< DVD+R - DVD Recordable */
CDIO_MMC_FEATURE_PROF_DDCD_ROM = 0x0020, /**< Read only DDCD */
CDIO_MMC_FEATURE_PROF_DDCD_R = 0x0021, /**< DDCD-R Write only DDCD */
CDIO_MMC_FEATURE_PROF_DDCD_RW = 0x0022, /**< Re-Write only DDCD */
CDIO_MMC_FEATURE_PROF_DVD_RW_DL = 0x002A, /**< "DVD+RW/DL */
CDIO_MMC_FEATURE_PROF_DVD_PR2 = 0x002B, /**< DVD+R - DVD Recordable
CDIO_MMC_FEATURE_PROF_DVD_PRW_DL = 0x002A, /**< "DVD+RW/DL */
CDIO_MMC_FEATURE_PROF_DVD_PR_DL = 0x002B, /**< DVD+R - DVD Recordable
double layer */
CDIO_MMC_FEATURE_PROF_BD_ROM = 0x0040, /**< BD-ROM */
@@ -483,37 +482,6 @@ typedef enum {
} cdio_mmc_feature_interface_t;
typedef enum {
CDIO_MMC_DISCTYPE_NO_DISC = 0x00,
CDIO_MMC_DISCTYPE_CD_ROM = 0x08,
CDIO_MMC_DISCTYPE_CD_R = 0x09,
CDIO_MMC_DISCTYPE_CD_RW = 0x0A,
CDIO_MMC_DISCTYPE_DVD_ROM = 0x10,
CDIO_MMC_DISCTYPE_DVD_R = 0x11,
CDIO_MMC_DISCTYPE_DVD_RAM = 0x12,
CDIO_MMC_DISCTYPE_DVD_RW_RO = 0x13, /**< DVD-RW Restricted Overwrite */
CDIO_MMC_DISCTYPE_DVD_RW_SR = 0x14, /**< DVD-RW Sequential Recording */
CDIO_MMC_DISCTYPE_DVD_R_DL_SR = 0x15, /**< DVD-R Dual Layer Sequential
Recording */
CDIO_MMC_DISCTYPE_DVD_R_DL_JR = 0x16, /**< DVD-R Dual Layer Jump
Recording */
CDIO_MMC_DISCTYPE_DVD_PRW = 0x1A, /**< DVD+RW */
CDIO_MMC_DISCTYPE_DVD_PR = 0x1B, /**< DVD+R */
CDIO_MMC_DISCTYPE_DVD_PRW_DL = 0x2A, /**< DVD+RW Dual Layer */
CDIO_MMC_DISCTYPE_DVD_PR_DL = 0x2B, /**< DVD+R Dual Layer */
CDIO_MMC_DISCTYPE_BD_ROM = 0x40,
CDIO_MMC_DISCTYPE_BD_R_SR = 0x41, /**< Sequential Recording */
CDIO_MMC_DISCTYPE_BD_R_RR = 0x42, /**< Random Recording */
CDIO_MMC_DISCTYPE_BD_RE = 0x43,
CDIO_MMC_DISCTYPE_HD_DVD_ROM = 0x50,
CDIO_MMC_DISCTYPE_HD_DVD_R = 0x51,
CDIO_MMC_DISCTYPE_HD_DVD_RAM = 0x52
} cdio_mmc_disctype_t;
/**
The largest Command Descriptor Block (CDB) size.
The possible sizes are 6, 10, and 12 bytes.
@@ -804,12 +772,12 @@ mmc_audio_read_subchannel (CdIo_t *p_cdio,
bool_3way_t mmc_have_interface(CdIo_t *p_cdio,
cdio_mmc_feature_interface_t e_interface );
bool mmc_is_disctype_bd(cdio_mmc_disctype_t disctype);
bool mmc_is_disctype_cdrom(cdio_mmc_disctype_t disctype);
bool mmc_is_disctype_dvd(cdio_mmc_disctype_t disctype);
bool mmc_is_disctype_hd_dvd (cdio_mmc_disctype_t disctype);
bool mmc_is_disctype_overwritable (cdio_mmc_disctype_t disctype);
bool mmc_is_disctype_rewritable(cdio_mmc_disctype_t disctype);
bool mmc_is_disctype_bd(cdio_mmc_feature_profile_t disctype);
bool mmc_is_disctype_cdrom(cdio_mmc_feature_profile_t disctype);
bool mmc_is_disctype_dvd(cdio_mmc_feature_profile_t disctype);
bool mmc_is_disctype_hd_dvd (cdio_mmc_feature_profile_t disctype);
bool mmc_is_disctype_overwritable (cdio_mmc_feature_profile_t disctype);
bool mmc_is_disctype_rewritable(cdio_mmc_feature_profile_t disctype);
/**

View File

@@ -69,7 +69,7 @@ extern "C" {
*/
driver_return_code_t mmc_get_disctype( const CdIo_t *p_cdio,
unsigned int i_timeout_ms,
cdio_mmc_disctype_t *p_disctype);
cdio_mmc_feature_profile_t *p_disctype);
/**
Eject using MMC commands. If CD-ROM is "locked" we'll unlock it.

View File

@@ -1199,9 +1199,9 @@ const char *mmc_feature_profile2str( int i_feature_profile )
return "DDCD-R Write only DDCD";
case CDIO_MMC_FEATURE_PROF_DDCD_RW:
return "Re-Write only DDCD";
case CDIO_MMC_FEATURE_PROF_DVD_RW_DL:
case CDIO_MMC_FEATURE_PROF_DVD_PRW_DL:
return "DVD+RW - Double Layer";
case CDIO_MMC_FEATURE_PROF_DVD_PR2:
case CDIO_MMC_FEATURE_PROF_DVD_PR_DL:
return "DVD+R Double Layer - DVD Recordable Double Layer";
case CDIO_MMC_FEATURE_PROF_BD_ROM:
return "Blu Ray BD-ROM";
@@ -1276,12 +1276,12 @@ mmc_have_interface( CdIo_t *p_cdio, cdio_mmc_feature_interface_t e_interface )
}
bool
mmc_is_disctype_bd (cdio_mmc_disctype_t disctype) {
mmc_is_disctype_bd (cdio_mmc_feature_profile_t disctype) {
switch (disctype) {
case CDIO_MMC_DISCTYPE_BD_ROM:
case CDIO_MMC_DISCTYPE_BD_R_SR:
case CDIO_MMC_DISCTYPE_BD_R_RR:
case CDIO_MMC_DISCTYPE_BD_RE:
case CDIO_MMC_FEATURE_PROF_BD_ROM:
case CDIO_MMC_FEATURE_PROF_BD_SEQ:
case CDIO_MMC_FEATURE_PROF_BD_R_RANDOM:
case CDIO_MMC_FEATURE_PROF_BD_RE:
return true;
default:
return false;
@@ -1289,11 +1289,11 @@ mmc_is_disctype_bd (cdio_mmc_disctype_t disctype) {
}
bool
mmc_is_disctype_cdrom (cdio_mmc_disctype_t disctype) {
mmc_is_disctype_cdrom (cdio_mmc_feature_profile_t disctype) {
switch (disctype) {
case CDIO_MMC_DISCTYPE_CD_ROM:
case CDIO_MMC_DISCTYPE_CD_R:
case CDIO_MMC_DISCTYPE_CD_RW:
case CDIO_MMC_FEATURE_PROF_CD_ROM:
case CDIO_MMC_FEATURE_PROF_CD_R:
case CDIO_MMC_FEATURE_PROF_CD_RW:
return true;
default:
return false;
@@ -1302,19 +1302,19 @@ mmc_is_disctype_cdrom (cdio_mmc_disctype_t disctype) {
bool
mmc_is_disctype_dvd (cdio_mmc_disctype_t disctype) {
mmc_is_disctype_dvd (cdio_mmc_feature_profile_t disctype) {
switch (disctype) {
case CDIO_MMC_DISCTYPE_DVD_ROM:
case CDIO_MMC_DISCTYPE_DVD_RAM:
case CDIO_MMC_DISCTYPE_DVD_R:
case CDIO_MMC_DISCTYPE_DVD_RW_RO:
case CDIO_MMC_DISCTYPE_DVD_RW_SR:
case CDIO_MMC_DISCTYPE_DVD_R_DL_SR:
case CDIO_MMC_DISCTYPE_DVD_R_DL_JR:
case CDIO_MMC_DISCTYPE_DVD_PRW:
case CDIO_MMC_DISCTYPE_DVD_PR:
case CDIO_MMC_DISCTYPE_DVD_PRW_DL:
case CDIO_MMC_DISCTYPE_DVD_PR_DL:
case CDIO_MMC_FEATURE_PROF_DVD_ROM:
case CDIO_MMC_FEATURE_PROF_DVD_RAM:
case CDIO_MMC_FEATURE_PROF_DVD_R_SEQ:
case CDIO_MMC_FEATURE_PROF_DVD_RW_RO:
case CDIO_MMC_FEATURE_PROF_DVD_RW_SEQ:
case CDIO_MMC_FEATURE_PROF_DVD_R_DL_SEQ:
case CDIO_MMC_FEATURE_PROF_DVD_R_DL_JR:
case CDIO_MMC_FEATURE_PROF_DVD_PRW:
case CDIO_MMC_FEATURE_PROF_DVD_PR:
case CDIO_MMC_FEATURE_PROF_DVD_PRW_DL:
case CDIO_MMC_FEATURE_PROF_DVD_PR_DL:
return true;
default:
return false;
@@ -1322,11 +1322,11 @@ mmc_is_disctype_dvd (cdio_mmc_disctype_t disctype) {
}
bool
mmc_is_disctype_hd_dvd (cdio_mmc_disctype_t disctype) {
mmc_is_disctype_hd_dvd (cdio_mmc_feature_profile_t disctype) {
switch (disctype) {
case CDIO_MMC_DISCTYPE_HD_DVD_ROM:
case CDIO_MMC_DISCTYPE_HD_DVD_R:
case CDIO_MMC_DISCTYPE_HD_DVD_RAM:
case CDIO_MMC_FEATURE_PROF_HD_DVD_ROM:
case CDIO_MMC_FEATURE_PROF_HD_DVD_R:
case CDIO_MMC_FEATURE_PROF_HD_DVD_RAM:
return true;
default:
return false;
@@ -1335,15 +1335,15 @@ mmc_is_disctype_hd_dvd (cdio_mmc_disctype_t disctype) {
bool
mmc_is_disctype_overwritable (cdio_mmc_disctype_t disctype) {
mmc_is_disctype_overwritable (cdio_mmc_feature_profile_t disctype) {
switch (disctype) {
case CDIO_MMC_DISCTYPE_DVD_RW_RO:
case CDIO_MMC_DISCTYPE_DVD_R_DL_JR:
case CDIO_MMC_DISCTYPE_DVD_PRW:
case CDIO_MMC_DISCTYPE_DVD_PRW_DL:
case CDIO_MMC_DISCTYPE_BD_R_RR: /* pseudo-overwritable */
case CDIO_MMC_DISCTYPE_BD_RE:
case CDIO_MMC_DISCTYPE_HD_DVD_RAM:
case CDIO_MMC_FEATURE_PROF_DVD_RW_RO:
case CDIO_MMC_FEATURE_PROF_DVD_R_DL_JR:
case CDIO_MMC_FEATURE_PROF_DVD_PRW:
case CDIO_MMC_FEATURE_PROF_DVD_PRW_DL:
case CDIO_MMC_FEATURE_PROF_BD_R_RANDOM: /* pseudo-overwritable */
case CDIO_MMC_FEATURE_PROF_BD_RE:
case CDIO_MMC_FEATURE_PROF_HD_DVD_RAM:
return true;
default:
return false;
@@ -1352,15 +1352,15 @@ mmc_is_disctype_overwritable (cdio_mmc_disctype_t disctype) {
bool
mmc_is_disctype_rewritable (cdio_mmc_disctype_t disctype) {
mmc_is_disctype_rewritable (cdio_mmc_feature_profile_t disctype) {
/* discs that need blanking before re-use */
if (mmc_is_disctype_overwritable (disctype))
return true;
switch (disctype) {
case CDIO_MMC_DISCTYPE_CD_RW:
case CDIO_MMC_DISCTYPE_DVD_RW_SR:
case CDIO_MMC_DISCTYPE_BD_R_SR:
case CDIO_MMC_FEATURE_PROF_CD_RW:
case CDIO_MMC_FEATURE_PROF_DVD_RW_SEQ:
case CDIO_MMC_FEATURE_PROF_BD_SEQ:
return true;
default:
return false;

View File

@@ -60,7 +60,7 @@ mmc_eject_media( const CdIo_t *p_cdio )
*/
driver_return_code_t
mmc_get_disctype( const CdIo_t *p_cdio, unsigned int i_timeout_ms,
cdio_mmc_disctype_t *p_disctype)
cdio_mmc_feature_profile_t *p_disctype)
{
uint8_t buf[500] = { 0, };
driver_return_code_t i_status;
@@ -81,23 +81,37 @@ mmc_get_disctype( const CdIo_t *p_cdio, unsigned int i_timeout_ms,
p = buf + 8;
profiles_list_length = p[3];
q = p+4;
*p_disctype = CDIO_MMC_DISCTYPE_NO_DISC;
*p_disctype = CDIO_MMC_FEATURE_PROF_NON_CONFORM;
while ((CDIO_MMC_DISCTYPE_NO_DISC == *p_disctype) &&
while ((CDIO_MMC_FEATURE_PROF_NON_CONFORM == *p_disctype) &&
(q < p + profiles_list_length)) {
profile_number = CDIO_MMC_GET_LEN16(q);
profile_active = q[2] & 0x01;
if (profile_active)
switch (profile_number) {
case 0x08: case 0x09: case 0x0A:
case 0x10: case 0x11: case 0x12:
case 0x13: case 0x14: case 0x15:
case 0x16: case 0x1A: case 0x1B:
case 0x2A: case 0x2B: case 0x40:
case 0x41: case 0x42: case 0x43:
case 0x50: case 0x51: case 0x52:
*p_disctype = (cdio_mmc_disctype_t) profile_number;
case CDIO_MMC_FEATURE_PROF_CD_ROM:
case CDIO_MMC_FEATURE_PROF_CD_R:
case CDIO_MMC_FEATURE_PROF_CD_RW:
case CDIO_MMC_FEATURE_PROF_DVD_ROM:
case CDIO_MMC_FEATURE_PROF_DVD_R_SEQ:
case CDIO_MMC_FEATURE_PROF_DVD_RAM:
case CDIO_MMC_FEATURE_PROF_DVD_RW_RO:
case CDIO_MMC_FEATURE_PROF_DVD_RW_SEQ:
case CDIO_MMC_FEATURE_PROF_DVD_R_DL_SEQ:
case CDIO_MMC_FEATURE_PROF_DVD_R_DL_JR:
case CDIO_MMC_FEATURE_PROF_DVD_PRW:
case CDIO_MMC_FEATURE_PROF_DVD_PR:
case CDIO_MMC_FEATURE_PROF_DVD_PRW_DL:
case CDIO_MMC_FEATURE_PROF_DVD_PR_DL:
case CDIO_MMC_FEATURE_PROF_BD_ROM:
case CDIO_MMC_FEATURE_PROF_BD_SEQ:
case CDIO_MMC_FEATURE_PROF_BD_R_RANDOM:
case CDIO_MMC_FEATURE_PROF_BD_RE:
case CDIO_MMC_FEATURE_PROF_HD_DVD_ROM:
case CDIO_MMC_FEATURE_PROF_HD_DVD_R:
case CDIO_MMC_FEATURE_PROF_HD_DVD_RAM:
*p_disctype = (cdio_mmc_feature_profile_t) profile_number;
break;
}
q += 4;

View File

@@ -126,7 +126,7 @@ test_print_status_sense(int i_status, int sense_valid,
static int
test_get_disctype(CdIo_t *p_cdio, bool b_verbose)
{
cdio_mmc_disctype_t disctype;
cdio_mmc_feature_profile_t disctype;
driver_return_code_t i_status = mmc_get_disctype(p_cdio, 0, &disctype);
if (DRIVER_OP_SUCCESS == i_status) {
if (b_verbose)