get_last_session returns lsn_t not session number.

Add get_track_last_session for Solaris. Correct it's play_msf.
This commit is contained in:
rocky
2005-03-05 10:48:41 +00:00
parent 822a203ba8
commit b0f8934073
5 changed files with 55 additions and 22 deletions

View File

@@ -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 <rocky@panix.com>
@@ -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.

View File

@@ -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 <rocky@panix.com>
@@ -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.

View File

@@ -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 <rocky@panix.com>
@@ -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)

View File

@@ -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 <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: 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 <string.h>
@@ -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;

View File

@@ -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 <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: 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 <glob.h>
@@ -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;