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 @@
/*
$Id: win32.c,v 1.21 2005/03/01 01:22:38 rocky Exp $
$Id: win32.c,v 1.22 2005/03/01 09:33:52 rocky Exp $
Copyright (C) 2003, 2004, 2005 Rocky Bernstein <rocky@panix.com>
@@ -26,7 +26,7 @@
# include "config.h"
#endif
static const char _rcsid[] = "$Id: win32.c,v 1.21 2005/03/01 01:22:38 rocky Exp $";
static const char _rcsid[] = "$Id: win32.c,v 1.22 2005/03/01 09:33:52 rocky Exp $";
#include <cdio/cdio.h>
#include <cdio/sector.h>
@@ -748,6 +748,7 @@ cdio_open_am_win32 (const char *psz_orig_source, const char *psz_access_mode)
memset( &_funcs, 0, sizeof(_funcs) );
_funcs.audio_read_subchannel = audio_read_subchannel_mmc;
_funcs.eject_media = _cdio_eject_media;
_funcs.free = free_win32;
_funcs.get_arg = _get_arg_win32;

View File

@@ -1,5 +1,5 @@
/*
$Id: _cdio_linux.c,v 1.31 2005/03/01 08:14:09 rocky Exp $
$Id: _cdio_linux.c,v 1.32 2005/03/01 09:33:52 rocky Exp $
Copyright (C) 2001 Herbert Valerio Riedel <hvr@gnu.org>
Copyright (C) 2002, 2003, 2004, 2005 Rocky Bernstein <rocky@panix.com>
@@ -27,7 +27,7 @@
# include "config.h"
#endif
static const char _rcsid[] = "$Id: _cdio_linux.c,v 1.31 2005/03/01 08:14:09 rocky Exp $";
static const char _rcsid[] = "$Id: _cdio_linux.c,v 1.32 2005/03/01 09:33:52 rocky Exp $";
#include <string.h>
@@ -236,7 +236,7 @@ audio_play_track_index_linux (void *p_user_data,
}
/*!
Resume playing an audio CD.
Read Audio Subchannel information
@param p_cdio the CD object to be acted upon.

View File

@@ -1,5 +1,5 @@
/*
$Id: _cdio_sunos.c,v 1.26 2005/03/01 08:14:09 rocky Exp $
$Id: _cdio_sunos.c,v 1.27 2005/03/01 09:33:52 rocky Exp $
Copyright (C) 2001 Herbert Valerio Riedel <hvr@gnu.org>
Copyright (C) 2002, 2003, 2004, 2005 Rocky Bernstein <rocky@panix.com>
@@ -38,7 +38,7 @@
#ifdef HAVE_SOLARIS_CDROM
static const char _rcsid[] = "$Id: _cdio_sunos.c,v 1.26 2005/03/01 08:14:09 rocky Exp $";
static const char _rcsid[] = "$Id: _cdio_sunos.c,v 1.27 2005/03/01 09:33:52 rocky Exp $";
#ifdef HAVE_GLOB_H
#include <glob.h>
@@ -160,7 +160,7 @@ audio_play_track_index_solaris (void *p_user_data,
}
/*!
Resume playing an audio CD.
Read Audio Subchannel information
@param p_cdio the CD object to be acted upon.

View File

@@ -157,6 +157,7 @@ cdtext_init
cdtext_is_keyword
cdtext_set
discmode2str
mmc_audio_read_subchannel
mmc_eject_media
mmc_get_blocksize
mmc_get_discmode

View File

@@ -1,6 +1,6 @@
/* Common Multimedia Command (MMC) routines.
$Id: mmc.c,v 1.16 2005/02/28 02:56:26 rocky Exp $
$Id: mmc.c,v 1.17 2005/03/01 09:33:52 rocky Exp $
Copyright (C) 2004, 2005 Rocky Bernstein <rocky@panix.com>
@@ -54,6 +54,20 @@
corresponding publically-accessible routine.
*************************************************************************/
/*!
Read Audio Subchannel information
@param p_user_data the CD object to be acted upon.
*/
driver_return_code_t
audio_read_subchannel_mmc ( void *p_user_data, cdio_subchannel_t *p_subchannel)
{
generic_img_private_t *p_env = p_user_data;
if (!p_env) return DRIVER_OP_UNINIT;
return mmc_get_blocksize(p_env->cdio);
}
/*!
Get the block size for subsequest read requests, via MMC.
@return the blocksize if > 0; error if <= 0
@@ -161,6 +175,7 @@ mmc_get_drive_cap_buf(const uint8_t *p,
if (p[5] & 0x01) *p_read_cap |= CDIO_DRIVE_CAP_READ_CD_DA;
if (p[5] & 0x10) *p_read_cap |= CDIO_DRIVE_CAP_READ_C2_ERRS;
if (p[5] & 0x20) *p_read_cap |= CDIO_DRIVE_CAP_READ_ISRC;
if (p[5] & 0x40) *p_read_cap |= CDIO_DRIVE_CAP_READ_MCN;
/* Writer */
if (p[3] & 0x01) *p_write_cap |= CDIO_DRIVE_CAP_WRITE_CD_R;
@@ -508,6 +523,29 @@ mmc_get_disc_last_lsn ( const CdIo_t *p_cdio )
return retval;
}
/*!
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)
{
scsi_mmc_cdb_t cdb;
if (!p_cdio) return DRIVER_OP_UNINIT;
memset(&cdb, 0, sizeof(scsi_mmc_cdb_t));
CDIO_MMC_SET_COMMAND(cdb.field, CDIO_MMC_GPCMD_READ_SUBCHANNEL);
cdb.field[1] = CDIO_CDROM_MSF;
cdb.field[2] = 0x40; /* subq */
cdb.field[6] = 0x40; /* track number (only in isrc mode, ignored) */
cdb.field[8] = 20;
return mmc_run_cmd(p_cdio, 2000, &cdb, SCSI_MMC_DATA_READ,
sizeof(cdio_subchannel_t), p_subchannel);
}
/*!
Return the discmode as reported by the SCSI-MMC Read (FULL) TOC
command.

View File

@@ -1,6 +1,6 @@
/* private MMC helper routines.
$Id: mmc_private.h,v 1.6 2005/02/17 07:03:37 rocky Exp $
$Id: mmc_private.h,v 1.7 2005/03/01 09:33:52 rocky Exp $
Copyright (C) 2004, 2005 Rocky Bernstein <rocky@panix.com>
@@ -37,6 +37,16 @@ msecs2secs(unsigned int msecs)
MMC CdIo Operations which a driver may use.
These are not directly user-accessible.
************************************************************/
/*!
Read Audio Subchannel information
@param p_user_data the CD object to be acted upon.
*/
driver_return_code_t
audio_read_subchannel_mmc ( void *p_user_data,
cdio_subchannel_t *p_subchannel);
/*!
Get the block size for subsequest read requests, via a SCSI MMC
MODE_SENSE 6 command.