The first all libcdio cdda_interface. There are some gaps could be

filled.

cdda_inteface.h renamed to cdda.h

cdio_destroy moved from cdio.h to device.h
This commit is contained in:
rocky
2005-01-05 04:16:11 +00:00
parent 2c20dfb2ef
commit 7a2a44a814
17 changed files with 254 additions and 722 deletions

View File

@@ -1,4 +1,4 @@
# $Id: Makefile.am,v 1.18 2005/01/04 10:58:03 rocky Exp $
# $Id: Makefile.am,v 1.19 2005/01/05 04:16:11 rocky Exp $
#
# Copyright (C) 2003, 2004 Rocky Bernstein <rocky@panix.com>
#
@@ -26,7 +26,7 @@ libcdioinclude_HEADERS = \
bytesex.h \
bytesex_asm.h \
paranoia.h \
cdda_interface.h \
cdda.h \
cdio.h \
cdtext.h \
cdtext.h \

View File

@@ -1,7 +1,7 @@
/*
$Id: cdda_interface.h,v 1.3 2004/12/30 11:13:49 rocky Exp $
$Id: cdda.h,v 1.1 2005/01/05 04:16:11 rocky Exp $
Copyright (C) 2004 Rocky Bernstein <rocky@panix.com>
Copyright (C) 2004, 2005 Rocky Bernstein <rocky@panix.com>
Copyright (C) 2001 Xiph.org
and Heiko Eissfeldt heiko@escape.colossus.de
@@ -27,8 +27,8 @@
#ifndef _CDDA_INTERFACE_H_
#define _CDDA_INTERFACE_H_
#include <cdio/cdio.h>
#include <cdio/paranoia.h>
#include <cdio/types.h>
#define CD_FRAMESAMPLES (CDIO_CD_FRAMESIZE_RAW / 4)
@@ -41,7 +41,6 @@
#define MAXTRK (CDIO_CD_MAX_TRACKS+1)
typedef struct TOC { /* structure of table of contents */
unsigned char bFlags;
unsigned char bTrack;
int32_t dwStartSector;
} TOC_t;
@@ -62,25 +61,21 @@ typedef struct TOC { /* structure of table of contents */
struct cdrom_drive_s {
CdIo_t *p_cdio;
int opened; /* This struct may just represent a candidate for opening */
char *cdda_device_name;
char *ioctl_device_name;
int cdda_fd;
int ioctl_fd;
char *drive_model;
int drive_type;
int interface;
int bigendianp;
int nsectors;
int cd_extra;
int tracks;
track_t tracks;
TOC_t disc_toc[MAXTRK];
long audio_first_sector;
long audio_last_sector;
lsn_t audio_first_sector;
lsn_t audio_last_sector;
int errordest;
int messagedest;
@@ -91,7 +86,7 @@ struct cdrom_drive_s {
int (*enable_cdda) (cdrom_drive_t *d, int onoff);
int (*read_toc) (cdrom_drive_t *d);
long (*read_audio) (cdrom_drive_t *d, void *p, long begin,
long (*read_audio) (cdrom_drive_t *d, void *p, lsn_t begin,
long sectors);
int (*set_speed) (cdrom_drive_t *d, int speed);
int error_retry;
@@ -138,26 +133,45 @@ extern cdrom_drive_t *cdda_identify_test(const char *filename,
/** oriented functions */
extern int cdda_speed_set(cdrom_drive_t *d, int speed);
extern void cdda_verbose_set(cdrom_drive_t *d,int err_action, int mes_action);
extern char *cdda_messages(cdrom_drive_t *d);
extern char *cdda_errors(cdrom_drive_t *d);
extern int cdda_speed_set(cdrom_drive_t *d, int speed);
extern void cdda_verbose_set(cdrom_drive_t *d, int err_action,
int mes_action);
extern char *cdda_messages(cdrom_drive_t *d);
extern char *cdda_errors(cdrom_drive_t *d);
extern int cdda_close(cdrom_drive_t *d);
extern int cdda_open(cdrom_drive_t *d);
extern long cdda_read(cdrom_drive_t *d, void *buffer,
long int beginsector, long int sectors);
extern int cdda_close(cdrom_drive_t *d);
extern int cdda_open(cdrom_drive_t *d);
extern long cdda_read(cdrom_drive_t *d, void *p_buffer,
lsn_t beginsector, long sectors);
extern long cdda_track_firstsector(cdrom_drive_t *d,int track);
extern long cdda_track_lastsector(cdrom_drive_t *d,int track);
extern long cdda_tracks(cdrom_drive_t *d);
extern int cdda_sector_gettrack(cdrom_drive_t *d,long sector);
extern int cdda_track_channels(cdrom_drive_t *d,int track);
extern int cdda_track_audiop(cdrom_drive_t *d,int track);
extern int cdda_track_copyp(cdrom_drive_t *d,int track);
extern int cdda_track_preemp(cdrom_drive_t *d,int track);
extern long cdda_disc_firstsector(cdrom_drive_t *d);
extern long cdda_disc_lastsector(cdrom_drive_t *d);
/*! Return the lsn for the start of track i_track */
extern lsn_t cdda_track_firstsector(cdrom_drive_t *d, track_t i_track);
/*! Get last lsn of the track. This generally one less than the start
of the next track. -1 is returned on error. */
extern lsn_t cdda_track_lastsector(cdrom_drive_t *d, track_t i_track);
extern track_t cdda_tracks(cdrom_drive_t *d);
extern int cdda_sector_gettrack(cdrom_drive_t *d, lsn_t lsn);
extern int cdda_track_channels(cdrom_drive_t *d, track_t i_track);
/*! Return 1 is track is an audio track, 0 otherwise. */
extern int cdda_track_audiop(cdrom_drive_t *d, track_t i_track);
/*! Return 1 is track has copy permit set, 0 otherwise. */
extern int cdda_track_copyp(cdrom_drive_t *d, track_t i_track);
/*! Return 1 is audio track has linear preemphasis set, 0 otherwise.
Only makes sense for audio tracks.
*/
extern int cdda_track_preemp(cdrom_drive_t *d, track_t i_track);
/*! Get first lsn of the first audio track. -1 is returned on error. */
extern lsn_t cdda_disc_firstsector(cdrom_drive_t *d);
/*! Get last lsn of the last audio track. The last lssn generally one
less than the start of the next track after the audio track. -1 is
returned on error. */
extern lsn_t cdda_disc_lastsector(cdrom_drive_t *d);
/** transport errors: */

View File

@@ -1,5 +1,5 @@
/* -*- c -*-
$Id: cdio.h,v 1.73 2005/01/04 10:58:03 rocky Exp $
$Id: cdio.h,v 1.74 2005/01/05 04:16:11 rocky Exp $
Copyright (C) 2001 Herbert Valerio Riedel <hvr@gnu.org>
Copyright (C) 2003, 2004, 2005 Rocky Bernstein <rocky@panix.com>
@@ -57,14 +57,6 @@ extern "C" {
/** This is an opaque structure for the CD-Text object. */
typedef struct cdtext cdtext_t;
/*!
Free any resources associated with p_cdio. Call this when done using p_cdio
and using CD reading/control operations.
@param p_cdio the CD object to eliminated.
*/
void cdio_destroy (CdIo_t *p_cdio);
/*!
Get the value associatied with key.

View File

@@ -1,5 +1,5 @@
/* -*- c -*-
$Id: device.h,v 1.1 2005/01/04 10:58:03 rocky Exp $
$Id: device.h,v 1.2 2005/01/05 04:16:11 rocky Exp $
Copyright (C) 2005 Rocky Bernstein <rocky@panix.com>
@@ -279,6 +279,14 @@ extern "C" {
/*! Like cdio_have_xxx but uses an enumeration instead. */
bool cdio_have_driver (driver_id_t driver_id);
/*!
Free any resources associated with p_cdio. Call this when done using p_cdio
and using CD reading/control operations.
@param p_cdio the CD object to eliminated.
*/
void cdio_destroy (CdIo_t *p_cdio);
/*!
Get a string decribing driver_id.

View File

@@ -1,7 +1,7 @@
/*
$Id: scsi_mmc.h,v 1.36 2004/12/18 17:29:32 rocky Exp $
$Id: scsi_mmc.h,v 1.37 2005/01/05 04:16:11 rocky Exp $
Copyright (C) 2003, 2004 Rocky Bernstein <rocky@panix.com>
Copyright (C) 2003, 2004, 2005 Rocky Bernstein <rocky@panix.com>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -395,7 +395,7 @@ discmode_t scsi_mmc_get_dvd_struct_physical ( const CdIo *p_cdio,
Get the CD-ROM hardware info via a SCSI MMC INQUIRY command.
False is returned if we had an error getting the information.
*/
bool scsi_mmc_get_hwinfo ( const CdIo *p_cdio,
bool scsi_mmc_get_hwinfo ( const CdIo_t *p_cdio,
/* out*/ cdio_hwinfo_t *p_hw_info );