Add track control info for Doze.
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
$Id: aspi32.c,v 1.1 2004/12/18 17:29:32 rocky Exp $
|
||||
$Id: aspi32.c,v 1.2 2005/01/01 04:17:41 rocky Exp $
|
||||
|
||||
Copyright (C) 2004 Rocky Bernstein <rocky@panix.com>
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
# include "config.h"
|
||||
#endif
|
||||
|
||||
static const char _rcsid[] = "$Id: aspi32.c,v 1.1 2004/12/18 17:29:32 rocky Exp $";
|
||||
static const char _rcsid[] = "$Id: aspi32.c,v 1.2 2005/01/01 04:17:41 rocky Exp $";
|
||||
|
||||
#include <cdio/cdio.h>
|
||||
#include <cdio/sector.h>
|
||||
@@ -679,7 +679,7 @@ read_toc_aspi (_img_private_t *p_env)
|
||||
p_env->gen.i_tracks = tocheader[3] - tocheader[2] + 1;
|
||||
|
||||
{
|
||||
int i, i_toclength;
|
||||
int i, j, i_toclength;
|
||||
unsigned char *p_fulltoc;
|
||||
|
||||
i_toclength = 4 /* header */ + tocheader[0] +
|
||||
@@ -702,13 +702,26 @@ read_toc_aspi (_img_private_t *p_env)
|
||||
p_env->gen.i_tracks = 0;
|
||||
}
|
||||
|
||||
for( i = 0 ; i <= p_env->gen.i_tracks ; i++ ) {
|
||||
j = p_env->gen.i_first_track;
|
||||
|
||||
for( i = 0 ; i <= p_env->gen.i_tracks ; i++, j++ ) {
|
||||
int i_index = 8 + 8 * i;
|
||||
p_env->tocent[ i ].start_lsn = ((int)p_fulltoc[ i_index ] << 24) +
|
||||
((int)p_fulltoc[ i_index+1 ] << 16) +
|
||||
((int)p_fulltoc[ i_index+2 ] << 8) +
|
||||
(int)p_fulltoc[ i_index+3 ];
|
||||
p_env->tocent[ i ].Control = (UCHAR)p_fulltoc[ 1 + 8 * i ];
|
||||
p_env->tocent[i].Control = (UCHAR)p_fulltoc[ 1 + 8 * i ];
|
||||
|
||||
p_env->gen.track_flags[j].preemphasis =
|
||||
p_env->tocent[i].Control & 0x1
|
||||
? CDIO_TRACK_FLAG_TRUE : CDIO_TRACK_FLAG_FALSE;
|
||||
|
||||
p_env->gen.track_flags[j].copy_permit =
|
||||
p_env->tocent[i].Control & 0x2
|
||||
? CDIO_TRACK_FLAG_TRUE : CDIO_TRACK_FLAG_FALSE;
|
||||
|
||||
p_env->gen.track_flags[j].channels =
|
||||
p_env->tocent[i].Control & 0x8 ? 4 : 2;
|
||||
|
||||
cdio_debug( "p_sectors: %i %lu",
|
||||
i, (unsigned long int) p_env->tocent[i].start_lsn );
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
$Id: win32.c,v 1.1 2004/12/18 17:29:32 rocky Exp $
|
||||
$Id: win32.c,v 1.2 2005/01/01 04:17:41 rocky Exp $
|
||||
|
||||
Copyright (C) 2003, 2004 Rocky Bernstein <rocky@panix.com>
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
# include "config.h"
|
||||
#endif
|
||||
|
||||
static const char _rcsid[] = "$Id: win32.c,v 1.1 2004/12/18 17:29:32 rocky Exp $";
|
||||
static const char _rcsid[] = "$Id: win32.c,v 1.2 2005/01/01 04:17:41 rocky Exp $";
|
||||
|
||||
#include <cdio/cdio.h>
|
||||
#include <cdio/sector.h>
|
||||
@@ -728,33 +728,36 @@ cdio_open_am_win32 (const char *psz_orig_source, const char *psz_access_mode)
|
||||
|
||||
memset( &_funcs, 0, sizeof(_funcs) );
|
||||
|
||||
_funcs.eject_media = _cdio_eject_media;
|
||||
_funcs.free = _free_win32;
|
||||
_funcs.get_arg = _get_arg_win32;
|
||||
_funcs.get_cdtext = get_cdtext_generic;
|
||||
_funcs.get_default_device = cdio_get_default_device_win32;
|
||||
_funcs.get_devices = cdio_get_devices_win32;
|
||||
_funcs.get_discmode = get_discmode_win32;
|
||||
_funcs.get_drive_cap = scsi_mmc_get_drive_cap_generic;
|
||||
_funcs.get_first_track_num= get_first_track_num_generic;
|
||||
_funcs.get_hwinfo = NULL;
|
||||
_funcs.get_mcn = _cdio_get_mcn;
|
||||
_funcs.get_num_tracks = get_num_tracks_generic;
|
||||
_funcs.get_track_format = _cdio_get_track_format;
|
||||
_funcs.get_track_green = _cdio_get_track_green;
|
||||
_funcs.get_track_lba = NULL; /* This could be implemented if need be. */
|
||||
_funcs.get_track_msf = _cdio_get_track_msf;
|
||||
_funcs.lseek = NULL;
|
||||
_funcs.read = NULL;
|
||||
_funcs.read_audio_sectors = _cdio_read_audio_sectors;
|
||||
_funcs.read_mode1_sector = _cdio_read_mode1_sector;
|
||||
_funcs.read_mode1_sectors = _cdio_read_mode1_sectors;
|
||||
_funcs.read_mode2_sector = _cdio_read_mode2_sector;
|
||||
_funcs.read_mode2_sectors = _cdio_read_mode2_sectors;
|
||||
_funcs.read_toc = &read_toc_win32;
|
||||
_funcs.run_scsi_mmc_cmd = &run_scsi_cmd_win32;
|
||||
_funcs.set_arg = set_arg_win32;
|
||||
_funcs.stat_size = stat_size_win32;
|
||||
_funcs.eject_media = _cdio_eject_media;
|
||||
_funcs.free = _free_win32;
|
||||
_funcs.get_arg = _get_arg_win32;
|
||||
_funcs.get_cdtext = get_cdtext_generic;
|
||||
_funcs.get_default_device = cdio_get_default_device_win32;
|
||||
_funcs.get_devices = cdio_get_devices_win32;
|
||||
_funcs.get_discmode = get_discmode_win32;
|
||||
_funcs.get_drive_cap = scsi_mmc_get_drive_cap_generic;
|
||||
_funcs.get_first_track_num = get_first_track_num_generic;
|
||||
_funcs.get_hwinfo = NULL;
|
||||
_funcs.get_mcn = _cdio_get_mcn;
|
||||
_funcs.get_num_tracks = get_num_tracks_generic;
|
||||
_funcs.get_track_channels = get_track_channels_generic,
|
||||
_funcs.get_track_copy_permit = get_track_copy_permit_generic,
|
||||
_funcs.get_track_format = _cdio_get_track_format;
|
||||
_funcs.get_track_green = _cdio_get_track_green;
|
||||
_funcs.get_track_lba = NULL; /* This could be done if need be. */
|
||||
_funcs.get_track_msf = _cdio_get_track_msf;
|
||||
_funcs.get_track_preemphasis = get_track_preemphasis_generic,
|
||||
_funcs.lseek = NULL;
|
||||
_funcs.read = NULL;
|
||||
_funcs.read_audio_sectors = _cdio_read_audio_sectors;
|
||||
_funcs.read_mode1_sector = _cdio_read_mode1_sector;
|
||||
_funcs.read_mode1_sectors = _cdio_read_mode1_sectors;
|
||||
_funcs.read_mode2_sector = _cdio_read_mode2_sector;
|
||||
_funcs.read_mode2_sectors = _cdio_read_mode2_sectors;
|
||||
_funcs.read_toc = &read_toc_win32;
|
||||
_funcs.run_scsi_mmc_cmd = &run_scsi_cmd_win32;
|
||||
_funcs.set_arg = set_arg_win32;
|
||||
_funcs.stat_size = stat_size_win32;
|
||||
|
||||
_data = _cdio_malloc (sizeof (_img_private_t));
|
||||
_data->access_mode = str_to_access_mode_win32(psz_access_mode);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
$Id: win32_ioctl.c,v 1.1 2004/12/18 17:29:32 rocky Exp $
|
||||
$Id: win32_ioctl.c,v 1.2 2005/01/01 04:17:41 rocky Exp $
|
||||
|
||||
Copyright (C) 2004 Rocky Bernstein <rocky@panix.com>
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
# include "config.h"
|
||||
#endif
|
||||
|
||||
static const char _rcsid[] = "$Id: win32_ioctl.c,v 1.1 2004/12/18 17:29:32 rocky Exp $";
|
||||
static const char _rcsid[] = "$Id: win32_ioctl.c,v 1.2 2005/01/01 04:17:41 rocky Exp $";
|
||||
|
||||
#ifdef HAVE_WIN32_CDROM
|
||||
|
||||
@@ -552,7 +552,7 @@ read_fulltoc_win32mmc (_img_private_t *p_env)
|
||||
{
|
||||
scsi_mmc_cdb_t cdb = {{0, }};
|
||||
CDROM_TOC_FULL cdrom_toc_full;
|
||||
int i_status, i, i_track_format, i_seen_flag;
|
||||
int i_status, i, j, i_track_format, i_seen_flag;
|
||||
|
||||
/* Operation code */
|
||||
CDIO_MMC_SET_COMMAND(cdb.field, CDIO_MMC_GPCMD_READ_TOC);
|
||||
@@ -594,7 +594,8 @@ read_fulltoc_win32mmc (_img_private_t *p_env)
|
||||
i_seen_flag|=0x02;
|
||||
}
|
||||
|
||||
if ( 0xA2 == cdrom_toc_full.TrackData[i].POINT ) {
|
||||
j = cdrom_toc_full.TrackData[i].POINT;
|
||||
if ( 0xA2 == j ) {
|
||||
/* Start position of the lead out */
|
||||
p_env->tocent[ p_env->gen.i_tracks ].start_lsn =
|
||||
cdio_msf3_to_lba(
|
||||
@@ -609,15 +610,25 @@ read_fulltoc_win32mmc (_img_private_t *p_env)
|
||||
|
||||
if (cdrom_toc_full.TrackData[i].POINT > 0
|
||||
&& cdrom_toc_full.TrackData[i].POINT <= p_env->gen.i_tracks) {
|
||||
p_env->tocent[ cdrom_toc_full.TrackData[i].POINT - 1 ].start_lsn =
|
||||
p_env->tocent[j-1].start_lsn =
|
||||
cdio_msf3_to_lba(
|
||||
cdrom_toc_full.TrackData[i].PMIN,
|
||||
cdrom_toc_full.TrackData[i].PSEC,
|
||||
cdrom_toc_full.TrackData[i].PFRAME );
|
||||
p_env->tocent[ cdrom_toc_full.TrackData[i].POINT - 1 ].Control =
|
||||
p_env->tocent[j-1].Control =
|
||||
cdrom_toc_full.TrackData[i].Control;
|
||||
p_env->tocent[ cdrom_toc_full.TrackData[i].POINT - 1 ].Format =
|
||||
i_track_format;
|
||||
p_env->tocent[j-1].Format = i_track_format;
|
||||
|
||||
p_env->gen.track_flags[j].preemphasis =
|
||||
cdrom_toc_full.TrackData[i].Control & 0x1
|
||||
? CDIO_TRACK_FLAG_TRUE : CDIO_TRACK_FLAG_FALSE;
|
||||
|
||||
p_env->gen.track_flags[j].copy_permit =
|
||||
cdrom_toc_full.TrackData[i].Control & 0x2
|
||||
? CDIO_TRACK_FLAG_TRUE : CDIO_TRACK_FLAG_FALSE;
|
||||
|
||||
p_env->gen.track_flags[j].channels =
|
||||
cdrom_toc_full.TrackData[i].Control & 0x8 ? 4 : 2;
|
||||
|
||||
cdio_debug("p_sectors: %i, %lu", i,
|
||||
(unsigned long int) (p_env->tocent[i].start_lsn));
|
||||
@@ -644,7 +655,7 @@ read_toc_win32ioctl (_img_private_t *p_env)
|
||||
{
|
||||
CDROM_TOC cdrom_toc;
|
||||
DWORD dwBytesReturned;
|
||||
unsigned int i;
|
||||
unsigned int i, j;
|
||||
|
||||
if ( ! p_env ) return false;
|
||||
|
||||
@@ -670,13 +681,27 @@ read_toc_win32ioctl (_img_private_t *p_env)
|
||||
p_env->gen.i_first_track = cdrom_toc.FirstTrack;
|
||||
p_env->gen.i_tracks = cdrom_toc.LastTrack - cdrom_toc.FirstTrack + 1;
|
||||
|
||||
for( i = 0 ; i <= p_env->gen.i_tracks ; i++ ) {
|
||||
j = p_env->gen.i_first_track;
|
||||
for( i = 0 ; i <= p_env->gen.i_tracks ; i++, j++ ) {
|
||||
p_env->tocent[ i ].start_lsn =
|
||||
cdio_msf3_to_lba( cdrom_toc.TrackData[i].Address[1],
|
||||
cdrom_toc.TrackData[i].Address[2],
|
||||
cdrom_toc.TrackData[i].Address[3] );
|
||||
p_env->tocent[ i ].Control = cdrom_toc.TrackData[i].Control;
|
||||
p_env->tocent[ i ].Format = cdrom_toc.TrackData[i].Format;
|
||||
p_env->tocent[i].Control = cdrom_toc.TrackData[i].Control;
|
||||
p_env->tocent[i].Format = cdrom_toc.TrackData[i].Format;
|
||||
|
||||
p_env->gen.track_flags[j].preemphasis =
|
||||
p_env->tocent[i].Control & 0x1
|
||||
? CDIO_TRACK_FLAG_TRUE : CDIO_TRACK_FLAG_FALSE;
|
||||
|
||||
p_env->gen.track_flags[j].copy_permit =
|
||||
p_env->tocent[i].Control & 0x2
|
||||
? CDIO_TRACK_FLAG_TRUE : CDIO_TRACK_FLAG_FALSE;
|
||||
|
||||
p_env->gen.track_flags[j].channels =
|
||||
p_env->tocent[i].Control & 0x8 ? 4 : 2;
|
||||
|
||||
|
||||
cdio_debug("p_sectors: %i, %lu", i,
|
||||
(unsigned long int) (p_env->tocent[i].start_lsn));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user