Report ability to read MCN.

Add MMC routine to read audio subchannel.
This commit is contained in:
rocky
2005-03-01 09:33:52 +00:00
parent 126777b282
commit cd328dac84
10 changed files with 158 additions and 96 deletions

View File

@@ -1,5 +1,5 @@
/* -*- c -*-
$Id: device.h,v 1.15 2005/02/28 02:00:20 rocky Exp $
$Id: device.h,v 1.16 2005/03/01 09:33:52 rocky Exp $
Copyright (C) 2005 Rocky Bernstein <rocky@panix.com>
@@ -30,6 +30,86 @@
extern "C" {
#endif /* __cplusplus */
/*! The type of an drive capability bit mask. See below for values*/
typedef uint32_t cdio_drive_read_cap_t;
typedef uint32_t cdio_drive_write_cap_t;
typedef uint32_t cdio_drive_misc_cap_t;
/*!
\brief Drive types returned by cdio_get_drive_cap()
NOTE: Setting a bit here means the presence of a capability.
*/
#define CDIO_DRIVE_CAP_ERROR 0x40000 /**< Error */
#define CDIO_DRIVE_CAP_UNKNOWN 0x80000 /**< Dunno. It can be on if we
have only partial information
or are not completely certain
*/
#define CDIO_DRIVE_CAP_MISC_CLOSE_TRAY 0x00001 /**< caddy systems can't
close... */
#define CDIO_DRIVE_CAP_MISC_EJECT 0x00002 /**< but can eject. */
#define CDIO_DRIVE_CAP_MISC_LOCK 0x00004 /**< disable manual eject */
#define CDIO_DRIVE_CAP_MISC_SELECT_SPEED 0x00008 /**< programmable speed */
#define CDIO_DRIVE_CAP_MISC_SELECT_DISC 0x00010 /**< select disc from
juke-box */
#define CDIO_DRIVE_CAP_MISC_MULTI_SESSION 0x00020 /**< read sessions>1 */
#define CDIO_DRIVE_CAP_MISC_MEDIA_CHANGED 0x00080 /**< media changed */
#define CDIO_DRIVE_CAP_MISC_RESET 0x00100 /**< hard reset device */
#define CDIO_DRIVE_CAP_MISC_FILE 0x20000 /**< drive is really a file,
i.e a CD file image */
/*! Reading masks.. */
#define CDIO_DRIVE_CAP_READ_AUDIO 0x00001 /**< drive can play CD audio */
#define CDIO_DRIVE_CAP_READ_CD_DA 0x00002 /**< drive can read CD-DA */
#define CDIO_DRIVE_CAP_READ_CD_G 0x00004 /**< drive can read CD+G */
#define CDIO_DRIVE_CAP_READ_CD_R 0x00008 /**< drive can read CD-R */
#define CDIO_DRIVE_CAP_READ_CD_RW 0x00010 /**< drive can read CD-RW */
#define CDIO_DRIVE_CAP_READ_DVD_R 0x00020 /**< drive can read DVD-R */
#define CDIO_DRIVE_CAP_READ_DVD_PR 0x00040 /**< drive can read DVD+R */
#define CDIO_DRIVE_CAP_READ_DVD_RAM 0x00080 /**< drive can read DVD-RAM */
#define CDIO_DRIVE_CAP_READ_DVD_ROM 0x00100 /**< drive can read DVD-ROM */
#define CDIO_DRIVE_CAP_READ_DVD_RW 0x00200 /**< drive can read DVD-RW */
#define CDIO_DRIVE_CAP_READ_DVD_RPW 0x00400 /**< drive can read DVD+RW */
#define CDIO_DRIVE_CAP_READ_C2_ERRS 0x00800 /**< has C2 error correction */
#define CDIO_DRIVE_CAP_READ_MODE2_FORM1 0x01000 /**< can read mode 2 form 1 */
#define CDIO_DRIVE_CAP_READ_MODE2_FORM2 0x02000 /**< can read mode 2 form 2 */
#define CDIO_DRIVE_CAP_READ_MCN 0x04000 /**< can read MCN */
#define CDIO_DRIVE_CAP_READ_ISRC 0x08000 /**< can read ISRC */
/*! Writing masks.. */
#define CDIO_DRIVE_CAP_WRITE_CD_R 0x00001 /**< drive can write CD-R */
#define CDIO_DRIVE_CAP_WRITE_CD_RW 0x00002 /**< drive can write CD-R */
#define CDIO_DRIVE_CAP_WRITE_DVD_R 0x00004 /**< drive can write DVD-R */
#define CDIO_DRIVE_CAP_WRITE_DVD_PR 0x00008 /**< drive can write DVD+R */
#define CDIO_DRIVE_CAP_WRITE_DVD_RAM 0x00010 /**< drive can write DVD-RAM */
#define CDIO_DRIVE_CAP_WRITE_DVD_RW 0x00020 /**< drive can write DVD-RW */
#define CDIO_DRIVE_CAP_WRITE_DVD_RPW 0x00040 /**< drive can write DVD+RW */
#define CDIO_DRIVE_CAP_WRITE_MT_RAINIER 0x00080 /**< Mount Rainier */
#define CDIO_DRIVE_CAP_WRITE_BURN_PROOF 0x00100 /**< burn proof */
/**< Masks derived from above... */
#define CDIO_DRIVE_CAP_WRITE_CD ( \
CDIO_DRIVE_CAP_WRITE_CD_R \
| CDIO_DRIVE_CAP_WRITE_CD_RW \
)
/**< Has some sort of CD writer ability */
/**< Masks derived from above... */
#define CDIO_DRIVE_CAP_WRITE_DVD ( \
| CDIO_DRIVE_CAP_WRITE_DVD_R \
| CDIO_DRIVE_CAP_WRITE_DVD_PR \
| CDIO_DRIVE_CAP_WRITE_DVD_RAM \
| CDIO_DRIVE_CAP_WRITE_DVD_RW \
| CDIO_DRIVE_CAP_WRITE_DVD_RPW \
)
/**< Has some sort of DVD writer ability */
#define CDIO_DRIVE_CAP_WRITE \
(CDIO_DRIVE_CAP_WRITE_CD | CDIO_DRIVE_CAP_WRITE_DVD)
/**< Has some sort of DVD or CD writing ability */
/*! Size of fields returned by an INQUIRY command */
#define CDIO_MMC_HW_VENDOR_LEN 8 /**< length of vendor field */
#define CDIO_MMC_HW_MODEL_LEN 16 /**< length of model field */

View File

@@ -1,5 +1,5 @@
/*
$Id: mmc.h,v 1.13 2005/03/01 00:41:34 rocky Exp $
$Id: mmc.h,v 1.14 2005/03/01 09:33:52 rocky Exp $
Copyright (C) 2003, 2004, 2005 Rocky Bernstein <rocky@panix.com>
@@ -31,6 +31,7 @@
#include <cdio/cdio.h>
#include <cdio/types.h>
#include <cdio/dvd.h>
#include <cdio/audio.h>
#ifdef __cplusplus
extern "C" {
@@ -381,6 +382,15 @@ typedef enum scsi_mmc_direction {
#define CDIO_MMC_SET_MAIN_CHANNEL_SELECTION_BITS(cdb, val) \
cdb[9] = val << 3;
/*!
Read Audio Subchannel information
@param p_cdio the CD object to be acted upon.
*/
driver_return_code_t
mmc_audio_read_subchannel (CdIo_t *p_cdio, cdio_subchannel_t *p_subchannel);
/*!
* Eject using MMC commands.
@@ -445,7 +455,7 @@ void mmc_get_drive_cap ( CdIo_t *p_cdio,
@return the DVD discmode.
*/
discmode_t mmc_get_dvd_struct_physical ( const CdIo_t *p_cdio,
cdio_dvd_struct_t *s);
cdio_dvd_struct_t *s);
/*!
Get the CD-ROM hardware info via an MMC INQUIRY command.

View File

@@ -1,8 +1,8 @@
/*
$Id: types.h,v 1.27 2005/03/01 00:41:34 rocky Exp $
$Id: types.h,v 1.28 2005/03/01 09:33:52 rocky Exp $
Copyright (C) 2000 Herbert Valerio Riedel <hvr@gnu.org>
Copyright (C) 2002, 2003, 2004 Rocky Bernstein <rocky@panix.com>
Copyright (C) 2002, 2003, 2004, 2005 Rocky Bernstein <rocky@panix.com>
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
@@ -279,86 +279,6 @@ extern "C" {
typedef int cdio_fs_anal_t;
/*! The type of an drive capability bit mask. See below for values*/
typedef uint32_t cdio_drive_read_cap_t;
typedef uint32_t cdio_drive_write_cap_t;
typedef uint32_t cdio_drive_misc_cap_t;
/*!
\brief Drive types returned by cdio_get_drive_cap()
NOTE: Setting a bit here means the presence of a capability.
*/
#define CDIO_DRIVE_CAP_ERROR 0x40000 /**< Error */
#define CDIO_DRIVE_CAP_UNKNOWN 0x80000 /**< Dunno. It can be on if we
have only partial information
or are not completely certain
*/
#define CDIO_DRIVE_CAP_MISC_CLOSE_TRAY 0x00001 /**< caddy systems can't
close... */
#define CDIO_DRIVE_CAP_MISC_EJECT 0x00002 /**< but can eject. */
#define CDIO_DRIVE_CAP_MISC_LOCK 0x00004 /**< disable manual eject */
#define CDIO_DRIVE_CAP_MISC_SELECT_SPEED 0x00008 /**< programmable speed */
#define CDIO_DRIVE_CAP_MISC_SELECT_DISC 0x00010 /**< select disc from
juke-box */
#define CDIO_DRIVE_CAP_MISC_MULTI_SESSION 0x00020 /**< read sessions>1 */
#define CDIO_DRIVE_CAP_MISC_MEDIA_CHANGED 0x00080 /**< media changed */
#define CDIO_DRIVE_CAP_MISC_RESET 0x00100 /**< hard reset device */
#define CDIO_DRIVE_CAP_MISC_FILE 0x20000 /**< drive is really a file,
i.e a CD file image */
/*! Reading masks.. */
#define CDIO_DRIVE_CAP_READ_AUDIO 0x00001 /**< drive can play CD audio */
#define CDIO_DRIVE_CAP_READ_CD_DA 0x00002 /**< drive can read CD-DA */
#define CDIO_DRIVE_CAP_READ_CD_G 0x00004 /**< drive can read CD+G */
#define CDIO_DRIVE_CAP_READ_CD_R 0x00008 /**< drive can read CD-R */
#define CDIO_DRIVE_CAP_READ_CD_RW 0x00010 /**< drive can read CD-RW */
#define CDIO_DRIVE_CAP_READ_DVD_R 0x00020 /**< drive can read DVD-R */
#define CDIO_DRIVE_CAP_READ_DVD_PR 0x00040 /**< drive can read DVD+R */
#define CDIO_DRIVE_CAP_READ_DVD_RAM 0x00080 /**< drive can read DVD-RAM */
#define CDIO_DRIVE_CAP_READ_DVD_ROM 0x00100 /**< drive can read DVD-ROM */
#define CDIO_DRIVE_CAP_READ_DVD_RW 0x00200 /**< drive can read DVD-RW */
#define CDIO_DRIVE_CAP_READ_DVD_RPW 0x00400 /**< drive can read DVD+RW */
#define CDIO_DRIVE_CAP_READ_C2_ERRS 0x00800 /**< has C2 error correction */
#define CDIO_DRIVE_CAP_READ_MODE2_FORM1 0x01000 /**< can read mode 2 form 1 */
#define CDIO_DRIVE_CAP_READ_MODE2_FORM2 0x02000 /**< can read mode 2 form 2 */
#define CDIO_DRIVE_CAP_READ_MCN 0x04000 /**< can read MCN */
#define CDIO_DRIVE_CAP_READ_ISRC 0x08000 /**< can read ISRC */
/*! Writing masks.. */
#define CDIO_DRIVE_CAP_WRITE_CD_R 0x00001 /**< drive can write CD-R */
#define CDIO_DRIVE_CAP_WRITE_CD_RW 0x00002 /**< drive can write CD-R */
#define CDIO_DRIVE_CAP_WRITE_DVD_R 0x00004 /**< drive can write DVD-R */
#define CDIO_DRIVE_CAP_WRITE_DVD_PR 0x00008 /**< drive can write DVD+R */
#define CDIO_DRIVE_CAP_WRITE_DVD_RAM 0x00010 /**< drive can write DVD-RAM */
#define CDIO_DRIVE_CAP_WRITE_DVD_RW 0x00020 /**< drive can write DVD-RW */
#define CDIO_DRIVE_CAP_WRITE_DVD_RPW 0x00040 /**< drive can write DVD+RW */
#define CDIO_DRIVE_CAP_WRITE_MT_RAINIER 0x00080 /**< Mount Rainier */
#define CDIO_DRIVE_CAP_WRITE_BURN_PROOF 0x00100 /**< burn proof */
/**< Masks derived from above... */
#define CDIO_DRIVE_CAP_WRITE_CD ( \
CDIO_DRIVE_CAP_WRITE_CD_R \
| CDIO_DRIVE_CAP_WRITE_CD_RW \
)
/**< Has some sort of CD writer ability */
/**< Masks derived from above... */
#define CDIO_DRIVE_CAP_WRITE_DVD ( \
| CDIO_DRIVE_CAP_WRITE_DVD_R \
| CDIO_DRIVE_CAP_WRITE_DVD_PR \
| CDIO_DRIVE_CAP_WRITE_DVD_RAM \
| CDIO_DRIVE_CAP_WRITE_DVD_RW \
| CDIO_DRIVE_CAP_WRITE_DVD_RPW \
)
/**< Has some sort of DVD writer ability */
#define CDIO_DRIVE_CAP_WRITE \
(CDIO_DRIVE_CAP_WRITE_CD | CDIO_DRIVE_CAP_WRITE_DVD)
/**< Has some sort of DVD or CD writing ability */
/*!
track flags
Q Sub-channel Control Field (4.2.3.3)