diff --git a/include/cdio/device.h b/include/cdio/device.h index 7b3fdbb0..0fef1714 100644 --- a/include/cdio/device.h +++ b/include/cdio/device.h @@ -1,5 +1,5 @@ /* -*- c -*- - $Id: device.h,v 1.17 2005/03/05 10:10:16 rocky Exp $ + $Id: device.h,v 1.18 2005/03/05 10:48:41 rocky Exp $ Copyright (C) 2005 Rocky Bernstein @@ -360,14 +360,14 @@ extern "C" { /* out*/ cdio_hwinfo_t *p_hw_info ); - /*! - Return the session number of the last on the CD. + /*! Get the LSN of the first track of the last session of + on the CD. @param p_cdio the CD object to be acted upon. @param i_last_session pointer to the session number to be returned. */ - driver_return_code_t cdio_get_last_session (CdIo_t *p_cdio, /*out*/ unsigned - int *i_last_session); + driver_return_code_t cdio_get_last_session (CdIo_t *p_cdio, + /*out*/ lsn_t *i_last_session); /*! Find out if media has changed since the last call. diff --git a/lib/driver/cdio_private.h b/lib/driver/cdio_private.h index 5904e8cb..0e58f877 100644 --- a/lib/driver/cdio_private.h +++ b/lib/driver/cdio_private.h @@ -1,5 +1,5 @@ /* - $Id: cdio_private.h,v 1.20 2005/03/05 10:10:16 rocky Exp $ + $Id: cdio_private.h,v 1.21 2005/03/05 10:48:41 rocky Exp $ Copyright (C) 2003, 2004, 2005 Rocky Bernstein @@ -202,14 +202,14 @@ extern "C" { bool (*get_hwinfo) ( const CdIo_t *p_cdio, /* out*/ cdio_hwinfo_t *p_hw_info ); - /*! - Return the session number of the last on the CD. + /*! Get the LSN of the first track of the last session of + on the CD. @param p_cdio the CD object to be acted upon. @param i_last_session pointer to the session number to be returned. */ driver_return_code_t (*get_last_session) - (void *p_env, /*out*/ unsigned int *i_last_session); + (void *p_env, /*out*/ lsn_t *i_last_session); /*! Find out if media has changed since the last call. diff --git a/lib/driver/device.c b/lib/driver/device.c index 3ff56ebb..163680f3 100644 --- a/lib/driver/device.c +++ b/lib/driver/device.c @@ -1,5 +1,5 @@ /* - $Id: device.c,v 1.11 2005/03/05 10:10:16 rocky Exp $ + $Id: device.c,v 1.12 2005/03/05 10:48:41 rocky Exp $ Copyright (C) 2005 Rocky Bernstein @@ -582,8 +582,8 @@ cdio_get_hwinfo (const CdIo_t *p_cdio, cdio_hwinfo_t *hw_info) @param p_cdio the CD object to be acted upon. @param i_last_session pointer to the session number to be returned. */ -driver_return_code_t cdio_get_last_session (CdIo_t *p_cdio, /*out*/ unsigned - int *i_last_session) +driver_return_code_t cdio_get_last_session (CdIo_t *p_cdio, + /*out*/ lsn_t *i_last_session) { if (!p_cdio) return DRIVER_OP_UNINIT; if (p_cdio->op.get_last_session) diff --git a/lib/driver/gnu_linux.c b/lib/driver/gnu_linux.c index 187a5cc2..1afd2637 100644 --- a/lib/driver/gnu_linux.c +++ b/lib/driver/gnu_linux.c @@ -1,5 +1,5 @@ /* - $Id: gnu_linux.c,v 1.2 2005/03/05 10:10:16 rocky Exp $ + $Id: gnu_linux.c,v 1.3 2005/03/05 10:48:41 rocky Exp $ Copyright (C) 2001 Herbert Valerio Riedel Copyright (C) 2002, 2003, 2004, 2005 Rocky Bernstein @@ -27,7 +27,7 @@ # include "config.h" #endif -static const char _rcsid[] = "$Id: gnu_linux.c,v 1.2 2005/03/05 10:10:16 rocky Exp $"; +static const char _rcsid[] = "$Id: gnu_linux.c,v 1.3 2005/03/05 10:48:41 rocky Exp $"; #include @@ -396,15 +396,15 @@ get_drive_cap_linux (const void *p_user_data, } #endif -/*! - Return the session number of the last on the CD. +/*! Get the LSN of the first track of the last session of + on the CD. @param p_cdio the CD object to be acted upon. @param i_last_session pointer to the session number to be returned. */ static driver_return_code_t get_last_session_linux (void *p_user_data, - /*out*/ unsigned int *i_last_session) + /*out*/ lsn_t *i_last_session) { const _img_private_t *p_env = p_user_data; struct cdrom_multisession ms; diff --git a/lib/driver/solaris.c b/lib/driver/solaris.c index 8b97bcee..04a03a3c 100644 --- a/lib/driver/solaris.c +++ b/lib/driver/solaris.c @@ -1,5 +1,5 @@ /* - $Id: solaris.c,v 1.1 2005/03/05 09:26:52 rocky Exp $ + $Id: solaris.c,v 1.2 2005/03/05 10:48:41 rocky Exp $ Copyright (C) 2001 Herbert Valerio Riedel Copyright (C) 2002, 2003, 2004, 2005 Rocky Bernstein @@ -38,7 +38,7 @@ #ifdef HAVE_SOLARIS_CDROM -static const char _rcsid[] = "$Id: solaris.c,v 1.1 2005/03/05 09:26:52 rocky Exp $"; +static const char _rcsid[] = "$Id: solaris.c,v 1.2 2005/03/05 10:48:41 rocky Exp $"; #ifdef HAVE_GLOB_H #include @@ -137,11 +137,21 @@ audio_pause_solaris (void *p_user_data) @param p_cdio the CD object to be acted upon. */ static driver_return_code_t -audio_play_msf_solaris (void *p_user_data, msf_t *p_msf) +audio_play_msf_solaris (void *p_user_data, msf_t *p_start_msf, + msf_t *p_end_msf) { const _img_private_t *p_env = p_user_data; - return ioctl(p_env->gen.fd, CDROMPLAYMSF, p_msf); + + struct cdrom_msf solaris_msf; + solaris_msf.cdmsf_min0 = p_start_msf->m; + solaris_msf.cdmsf_sec0 = p_start_msf->s; + solaris_msf.cdmsf_frame0 = p_start_msf->f; + solaris_msf.cdmsf_min1 = p_end_msf->m; + solaris_msf.cdmsf_sec1 = p_end_msf->s; + solaris_msf.cdmsf_frame1 = p_end_msf->f; + + return ioctl(p_env->gen.fd, CDROMPLAYMSF, &solaris_msf); } /*! @@ -196,7 +206,7 @@ audio_resume_solaris (void *p_user_data) */ static driver_return_code_t audio_set_volume_solaris (void *p_user_data, - const cdio_audio_volume_t *p_volume) { + cdio_audio_volume_t *p_volume) { const _img_private_t *p_env = p_user_data; return ioctl(p_env->gen.fd, CDROMVOLCTRL, p_volume); @@ -754,6 +764,28 @@ get_discmode_solaris (void *p_user_data) return discmode; } +/*! + Return the session number of the last on the CD. + + @param p_cdio the CD object to be acted upon. + @param i_last_session pointer to the session number to be returned. +*/ +static driver_return_code_t +get_last_session_solaris (void *p_user_data, + /*out*/ lsn_t *i_last_session_lsn) +{ + const _img_private_t *p_env = p_user_data; + int i_rc; + + i_rc = ioctl(p_env->gen.fd, CDROMREADOFFSET, &i_last_session_lsn); + if (0 == i_rc) { + return DRIVER_OP_SUCCESS; + } else { + cdio_warn ("ioctl CDROMREADOFFSET failed: %s\n", strerror(errno)); + return DRIVER_OP_ERROR; + } +} + /*! Get format of track. */ @@ -988,6 +1020,7 @@ cdio_open_am_solaris (const char *psz_orig_source, const char *access_mode) _funcs.get_drive_cap = get_drive_cap_mmc; _funcs.get_first_track_num = get_first_track_num_generic; _funcs.get_hwinfo = NULL; + _funcs.get_last_session = get_last_session_solaris; _funcs.get_media_changed = get_media_changed_mmc, _funcs.get_mcn = get_mcn_mmc, _funcs.get_num_tracks = get_num_tracks_generic;