diff --git a/lib/driver/MSWindows/aspi32.c b/lib/driver/MSWindows/aspi32.c index ea1e9b4e..f2426487 100644 --- a/lib/driver/MSWindows/aspi32.c +++ b/lib/driver/MSWindows/aspi32.c @@ -1,5 +1,5 @@ /* - $Id: aspi32.c,v 1.2 2005/01/01 04:17:41 rocky Exp $ + $Id: aspi32.c,v 1.3 2005/01/01 15:08:48 rocky Exp $ Copyright (C) 2004 Rocky Bernstein @@ -27,7 +27,7 @@ # include "config.h" #endif -static const char _rcsid[] = "$Id: aspi32.c,v 1.2 2005/01/01 04:17:41 rocky Exp $"; +static const char _rcsid[] = "$Id: aspi32.c,v 1.3 2005/01/01 15:08:48 rocky Exp $"; #include #include @@ -712,16 +712,7 @@ read_toc_aspi (_img_private_t *p_env) (int)p_fulltoc[ i_index+3 ]; 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; + set_track_flags(&(p_env->gen.track_flags[j]), p_env->tocent[i].Control); cdio_debug( "p_sectors: %i %lu", i, (unsigned long int) p_env->tocent[i].start_lsn ); diff --git a/lib/driver/MSWindows/win32_ioctl.c b/lib/driver/MSWindows/win32_ioctl.c index 1f566e6a..9b46ff3f 100644 --- a/lib/driver/MSWindows/win32_ioctl.c +++ b/lib/driver/MSWindows/win32_ioctl.c @@ -1,5 +1,5 @@ /* - $Id: win32_ioctl.c,v 1.2 2005/01/01 04:17:41 rocky Exp $ + $Id: win32_ioctl.c,v 1.3 2005/01/01 15:08:48 rocky Exp $ Copyright (C) 2004 Rocky Bernstein @@ -26,7 +26,7 @@ # include "config.h" #endif -static const char _rcsid[] = "$Id: win32_ioctl.c,v 1.2 2005/01/01 04:17:41 rocky Exp $"; +static const char _rcsid[] = "$Id: win32_ioctl.c,v 1.3 2005/01/01 15:08:48 rocky Exp $"; #ifdef HAVE_WIN32_CDROM @@ -619,16 +619,8 @@ read_fulltoc_win32mmc (_img_private_t *p_env) cdrom_toc_full.TrackData[i].Control; 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; + set_track_flags(&(p_env->gen.track_flags[j]), + p_env->tocent[j-1].Control); cdio_debug("p_sectors: %i, %lu", i, (unsigned long int) (p_env->tocent[i].start_lsn)); diff --git a/lib/driver/_cdio_generic.c b/lib/driver/_cdio_generic.c index 3fafaab8..90df2384 100644 --- a/lib/driver/_cdio_generic.c +++ b/lib/driver/_cdio_generic.c @@ -1,5 +1,5 @@ /* - $Id: _cdio_generic.c,v 1.3 2004/12/31 05:47:36 rocky Exp $ + $Id: _cdio_generic.c,v 1.4 2005/01/01 15:08:48 rocky Exp $ Copyright (C) 2004 Rocky Bernstein @@ -25,7 +25,7 @@ # include "config.h" #endif -static const char _rcsid[] = "$Id: _cdio_generic.c,v 1.3 2004/12/31 05:47:36 rocky Exp $"; +static const char _rcsid[] = "$Id: _cdio_generic.c,v 1.4 2005/01/01 15:08:48 rocky Exp $"; #include #include @@ -457,6 +457,20 @@ get_track_preemphasis_generic(const void *p_user_data, track_t i_track) return p_env->track_flags[i_track].preemphasis; } +void +set_track_flags(track_flags_t *p_track_flag, uint8_t i_flag) +{ + p_track_flag->preemphasis = ( i_flag & CDIO_TRACK_FLAG_PRE_EMPHASIS ) + ? CDIO_TRACK_FLAG_TRUE : CDIO_TRACK_FLAG_FALSE; + + p_track_flag->copy_permit = ( i_flag & CDIO_TRACK_FLAG_COPY_PERMITTED ) + ? CDIO_TRACK_FLAG_TRUE : CDIO_TRACK_FLAG_FALSE; + + p_track_flag->channels = ( i_flag & CDIO_TRACK_FLAG_FOUR_CHANNEL_AUDIO ) + ? 4 : 2; +} + + /* * Local variables: diff --git a/lib/driver/_cdio_linux.c b/lib/driver/_cdio_linux.c index d8eb0ec9..ac1d1968 100644 --- a/lib/driver/_cdio_linux.c +++ b/lib/driver/_cdio_linux.c @@ -1,5 +1,5 @@ /* - $Id: _cdio_linux.c,v 1.4 2005/01/01 14:20:15 rocky Exp $ + $Id: _cdio_linux.c,v 1.5 2005/01/01 15:08:48 rocky Exp $ Copyright (C) 2001 Herbert Valerio Riedel Copyright (C) 2002, 2003, 2004 Rocky Bernstein @@ -27,7 +27,7 @@ # include "config.h" #endif -static const char _rcsid[] = "$Id: _cdio_linux.c,v 1.4 2005/01/01 14:20:15 rocky Exp $"; +static const char _rcsid[] = "$Id: _cdio_linux.c,v 1.5 2005/01/01 15:08:48 rocky Exp $"; #include @@ -848,18 +848,7 @@ read_toc_linux (void *p_user_data) return false; } - /** FIXME: Do in a more generic place? **/ - p_env->gen.track_flags[i].preemphasis = - p_toc->cdte_ctrl & CDIO_TRACK_FLAG_PRE_EMPHASIS - ? CDIO_TRACK_FLAG_TRUE : CDIO_TRACK_FLAG_FALSE; - - p_env->gen.track_flags[i].copy_permit = - p_toc->cdte_ctrl & CDIO_TRACK_FLAG_COPY_PERMITTED - ? CDIO_TRACK_FLAG_TRUE : CDIO_TRACK_FLAG_FALSE; - - p_env->gen.track_flags[i].channels = - p_toc->cdte_ctrl & CDIO_TRACK_FLAG_FOUR_CHANNEL_AUDIO - ? 4 : 2; + set_track_flags(&(p_env->gen.track_flags[i]), p_toc->cdte_ctrl); /**** struct cdrom_msf0 *msf= &env->tocent[i-1].cdte_addr.msf; diff --git a/lib/driver/_cdio_sunos.c b/lib/driver/_cdio_sunos.c index 311f5382..3fa115a3 100644 --- a/lib/driver/_cdio_sunos.c +++ b/lib/driver/_cdio_sunos.c @@ -1,5 +1,5 @@ /* - $Id: _cdio_sunos.c,v 1.2 2004/12/31 08:27:49 rocky Exp $ + $Id: _cdio_sunos.c,v 1.3 2005/01/01 15:08:48 rocky Exp $ Copyright (C) 2001 Herbert Valerio Riedel Copyright (C) 2002, 2003, 2004 Rocky Bernstein @@ -38,7 +38,7 @@ #ifdef HAVE_SOLARIS_CDROM -static const char _rcsid[] = "$Id: _cdio_sunos.c,v 1.2 2004/12/31 08:27:49 rocky Exp $"; +static const char _rcsid[] = "$Id: _cdio_sunos.c,v 1.3 2005/01/01 15:08:48 rocky Exp $"; #ifdef HAVE_GLOB_H #include @@ -432,16 +432,7 @@ read_toc_solaris (void *p_user_data) return false; } - /** FIXME: Do in a more generic place? **/ - p_env->gen.track_flags[i].preemphasis = - p_toc->cdte_ctrl & 0x1 ? CDIO_TRACK_FLAG_TRUE : CDIO_TRACK_FLAG_FALSE; - - p_env->gen.track_flags[i].copy_permit = - p_toc->cdte_ctrl & 0x2 ? CDIO_TRACK_FLAG_TRUE : CDIO_TRACK_FLAG_FALSE; - - p_env->gen.track_flags[i].channels = - p_toc->cdte_ctrl & 0x8 ? 4 : 2; - + set_track_flags(&(p_env->gen.track_flags[i]), p_toc->cdte_ctrl); } /* read the lead-out track */ diff --git a/lib/driver/generic.h b/lib/driver/generic.h index 13594849..435723e3 100644 --- a/lib/driver/generic.h +++ b/lib/driver/generic.h @@ -1,5 +1,5 @@ /* - $Id: generic.h,v 1.3 2004/12/31 05:47:36 rocky Exp $ + $Id: generic.h,v 1.4 2005/01/01 15:08:48 rocky Exp $ Copyright (C) 2004 Rocky Bernstein @@ -192,6 +192,8 @@ extern "C" { */ bool init_cdtext_generic (generic_img_private_t *p_env); + void set_track_flags(track_flags_t *p_track_flag, uint8_t flag); + #ifdef __cplusplus } #endif /* __cplusplus */ diff --git a/lib/driver/image_common.c b/lib/driver/image_common.c index 5b02c5af..66ec5a69 100644 --- a/lib/driver/image_common.c +++ b/lib/driver/image_common.c @@ -1,5 +1,5 @@ /* - $Id: image_common.c,v 1.1 2004/12/31 07:51:43 rocky Exp $ + $Id: image_common.c,v 1.2 2005/01/01 15:08:48 rocky Exp $ Copyright (C) 2004 Rocky Bernstein @@ -116,10 +116,13 @@ _get_drive_cap_image (const void *user_data, cdio_drive_misc_cap_t *p_misc_cap) { - *p_read_cap = CDIO_DRIVE_CAP_READ_AUDIO + *p_read_cap = CDIO_DRIVE_CAP_READ_CD_DA | CDIO_DRIVE_CAP_READ_CD_G | CDIO_DRIVE_CAP_READ_CD_R | CDIO_DRIVE_CAP_READ_CD_RW + | CDIO_DRIVE_CAP_READ_MODE2_FORM1 + | CDIO_DRIVE_CAP_READ_MODE2_FORM2 + | CDIO_DRIVE_CAP_READ_MCN ; *p_write_cap = 0;