Expand get_cdtext to include a track number. 0 = disc info.
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
$Id: sample8.c,v 1.3 2004/07/13 03:45:15 rocky Exp $
|
||||
$Id: sample8.c,v 1.4 2004/07/17 02:18:26 rocky Exp $
|
||||
|
||||
Copyright (C) 2003 Rocky Bernstein <rocky@panix.com>
|
||||
|
||||
@@ -26,51 +26,63 @@
|
||||
#include <sys/types.h>
|
||||
#include <cdio/cdio.h>
|
||||
#include <cdio/cdtext.h>
|
||||
|
||||
|
||||
static void
|
||||
print_cdtext_track_info(CdIo *cdio, track_t i_track, const char *message) {
|
||||
const cdtext_t *cdtext = cdio_get_cdtext(cdio, 0);
|
||||
|
||||
if (NULL != cdtext) {
|
||||
cdtext_field_t i;
|
||||
|
||||
printf("%s\n", message);
|
||||
|
||||
for (i=0; i < MAX_CDTEXT_FIELDS; i++) {
|
||||
if (cdtext->field[i]) {
|
||||
printf("\t%s: %s\n", cdtext_field2str(i), cdtext->field[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
print_cdtext_info(CdIo *cdio, track_t i_tracks, track_t i_first_track) {
|
||||
track_t i_last_track = i_first_track+i_tracks;
|
||||
|
||||
print_cdtext_track_info(cdio, 0, "\nCD-TEXT for Disc:");
|
||||
for ( ; i_first_track < i_last_track; i_first_track++ ) {
|
||||
char msg[50];
|
||||
sprintf(msg, "CD-TEXT for Track %d:", i_first_track);
|
||||
print_cdtext_track_info(cdio, i_first_track, msg);
|
||||
}
|
||||
}
|
||||
|
||||
int
|
||||
main(int argc, const char *argv[])
|
||||
{
|
||||
CdIo *cdio = cdio_open ("../test/cdda.cue", DRIVER_BINCUE);
|
||||
track_t i_first_track = cdio_get_first_track_num(cdio);
|
||||
track_t i_tracks = cdio_get_num_tracks(cdio);
|
||||
|
||||
|
||||
if (NULL == cdio) {
|
||||
printf("Couldn't open ../test/cdda.cue with BIN/CUE driver \n");
|
||||
return 1;
|
||||
} else {
|
||||
const cdtext_t *cdtext = cdio_get_cdtext(cdio);
|
||||
|
||||
if (NULL != cdtext) {
|
||||
printf("CD-TEXT Title: %s\n",
|
||||
cdtext->field[CDTEXT_TITLE] ?
|
||||
cdtext->field[CDTEXT_TITLE] : "not set");
|
||||
printf("CD-TEXT Performer: %s\n",
|
||||
cdtext->field[CDTEXT_PERFORMER] ?
|
||||
cdtext->field[CDTEXT_PERFORMER] : "not set"
|
||||
);
|
||||
} else {
|
||||
printf("Didn't get CD-TEXT info.\n");
|
||||
}
|
||||
print_cdtext_info(cdio, i_tracks, i_first_track);
|
||||
}
|
||||
|
||||
cdio_destroy(cdio);
|
||||
|
||||
cdio = cdio_open (NULL, DRIVER_UNKNOWN);
|
||||
i_first_track = cdio_get_first_track_num(cdio);
|
||||
i_tracks = cdio_get_num_tracks(cdio);
|
||||
|
||||
if (NULL == cdio) {
|
||||
printf("Couldn't find CD\n");
|
||||
return 1;
|
||||
} else {
|
||||
const cdtext_t *cdtext = cdio_get_cdtext(cdio);
|
||||
|
||||
if (NULL != cdtext) {
|
||||
printf("CD-TEXT Title: %s\n",
|
||||
cdtext->field[CDTEXT_TITLE] ?
|
||||
cdtext->field[CDTEXT_TITLE] : "not set");
|
||||
printf("CD-TEXT Performer: %s\n",
|
||||
cdtext->field[CDTEXT_PERFORMER] ?
|
||||
cdtext->field[CDTEXT_PERFORMER] : "not set"
|
||||
);
|
||||
} else {
|
||||
printf("Didn't get CD-TEXT info.\n");
|
||||
}
|
||||
print_cdtext_info(cdio, i_tracks, i_first_track);
|
||||
}
|
||||
|
||||
cdio_destroy(cdio);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* -*- c -*-
|
||||
$Id: cdio.h,v 1.56 2004/07/11 14:25:07 rocky Exp $
|
||||
$Id: cdio.h,v 1.57 2004/07/17 02:18:27 rocky Exp $
|
||||
|
||||
Copyright (C) 2001 Herbert Valerio Riedel <hvr@gnu.org>
|
||||
Copyright (C) 2003, 2004 Rocky Bernstein <rocky@panix.com>
|
||||
@@ -160,8 +160,11 @@ extern "C" {
|
||||
@param obj the CD object that may contain CD-TEXT information.
|
||||
@return the CD-TEXT object or NULL if obj is NULL
|
||||
or CD-TEXT information does not exist.
|
||||
|
||||
If i_track is 0 or CDIO_CDROM_LEADOUT_TRACK the track returned
|
||||
is the information assocated with the CD.
|
||||
*/
|
||||
const cdtext_t *cdio_get_cdtext (const CdIo *obj);
|
||||
const cdtext_t *cdio_get_cdtext (CdIo *obj, track_t i_track);
|
||||
|
||||
/*!
|
||||
Get an array of device names in search_devices that have at
|
||||
@@ -300,7 +303,7 @@ extern "C" {
|
||||
greater than 0, usually 1.
|
||||
|
||||
The "leadout" track is specified either by
|
||||
using i_track LEADOUT_TRACK or the total tracks+1.
|
||||
using i_track CDIO_CDROM_LEADOUT_TRACK or the total tracks+1.
|
||||
|
||||
@param obj object to get information from
|
||||
@param i_track the track number we want the LSN for
|
||||
@@ -314,7 +317,7 @@ extern "C" {
|
||||
greater than 0, usually 1.
|
||||
|
||||
The "leadout" track is specified either by
|
||||
using i_track LEADOUT_TRACK or the total tracks+1.
|
||||
using i_track CDIO_CDROM_LEADOUT_TRACK or the total tracks+1.
|
||||
|
||||
@param obj object to get information from
|
||||
@param i_track the track number we want the LSN for
|
||||
@@ -328,7 +331,7 @@ extern "C" {
|
||||
greater than 0, usually 1.
|
||||
|
||||
The "leadout" track is specified either by
|
||||
using i_track LEADOUT_TRACK or the total tracks+1.
|
||||
using i_track CDIO_CDROM_LEADOUT_TRACK or the total tracks+1.
|
||||
|
||||
@return true if things worked or false if there is no track entry.
|
||||
*/
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
$Id: cdtext.h,v 1.5 2004/07/16 21:29:24 rocky Exp $
|
||||
$Id: cdtext.h,v 1.6 2004/07/17 02:18:27 rocky Exp $
|
||||
|
||||
Copyright (C) 2004 Rocky Bernstein <rocky@panix.com>
|
||||
adapted from cuetools
|
||||
@@ -57,34 +57,34 @@ extern "C" {
|
||||
CDTEXT_INVALID = MAX_CDTEXT_FIELDS
|
||||
} cdtext_field_t;
|
||||
|
||||
/*! Return string representation of the enum values above */
|
||||
const char *cdtext_field2str (cdtext_field_t i);
|
||||
/*! Return string representation of the enum values above */
|
||||
const char *cdtext_field2str (cdtext_field_t i);
|
||||
|
||||
/*! Initialize a new cdtext structure.
|
||||
/*! Initialize a new cdtext structure.
|
||||
When the structure is no longer needed, release the
|
||||
resources using cdtext_delete.
|
||||
*/
|
||||
void cdtext_init (cdtext_t *cdtext);
|
||||
|
||||
/*! Free memory assocated with cdtext*/
|
||||
void cdtext_destroy (cdtext_t *cdtext);
|
||||
|
||||
/*!
|
||||
returns the CDTEXT value associated with key. NULL is returned
|
||||
if key is CDTEXT_INVALID or the field is not set.
|
||||
*/
|
||||
const char *cdtext_get (cdtext_field_t key, const cdtext_t *cdtext);
|
||||
void cdtext_init (cdtext_t *cdtext);
|
||||
|
||||
/*!
|
||||
/*! Free memory assocated with cdtext*/
|
||||
void cdtext_destroy (cdtext_t *cdtext);
|
||||
|
||||
/*! returns the CDTEXT value associated with key at the given track
|
||||
number. NULL is returned if key is CDTEXT_INVALID or the field is
|
||||
not set.
|
||||
*/
|
||||
const char *cdtext_get (cdtext_field_t key, const cdtext_t *cdtext);
|
||||
|
||||
/*!
|
||||
returns enum of keyword if key is a CD-TEXT keyword,
|
||||
returns MAX_CDTEXT_FIELDS non-zero otherwise.
|
||||
*/
|
||||
cdtext_field_t cdtext_is_keyword (const char *key);
|
||||
*/
|
||||
cdtext_field_t cdtext_is_keyword (const char *key);
|
||||
|
||||
/*!
|
||||
/*!
|
||||
sets cdtext's keyword entry to field
|
||||
*/
|
||||
void cdtext_set (cdtext_field_t key, const char *value, cdtext_t *cdtext);
|
||||
void cdtext_set (cdtext_field_t key, const char *value, cdtext_t *cdtext);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
$Id: _cdio_linux.c,v 1.64 2004/07/15 11:36:12 rocky Exp $
|
||||
$Id: _cdio_linux.c,v 1.65 2004/07/17 02:18:27 rocky Exp $
|
||||
|
||||
Copyright (C) 2001 Herbert Valerio Riedel <hvr@gnu.org>
|
||||
Copyright (C) 2002, 2003, 2004 Rocky Bernstein <rocky@panix.com>
|
||||
@@ -27,7 +27,7 @@
|
||||
# include "config.h"
|
||||
#endif
|
||||
|
||||
static const char _rcsid[] = "$Id: _cdio_linux.c,v 1.64 2004/07/15 11:36:12 rocky Exp $";
|
||||
static const char _rcsid[] = "$Id: _cdio_linux.c,v 1.65 2004/07/17 02:18:27 rocky Exp $";
|
||||
|
||||
#include <string.h>
|
||||
|
||||
@@ -699,11 +699,10 @@ _cdio_read_toc (_img_private_t *env)
|
||||
@return the CD-TEXT object or NULL if obj is NULL
|
||||
or CD-TEXT information does not exist.
|
||||
*/
|
||||
static const cdtext_t *
|
||||
_get_cdtext_linux (void *user_data)
|
||||
static bool
|
||||
_init_cdtext_linux (_img_private_t *env)
|
||||
{
|
||||
|
||||
_img_private_t *env = user_data;
|
||||
int status;
|
||||
struct scsi_cmd {
|
||||
unsigned int inlen; /* Length of data written to device */
|
||||
@@ -724,7 +723,7 @@ _get_cdtext_linux (void *user_data)
|
||||
status = ioctl(env->gen.fd, SCSI_IOCTL_SEND_COMMAND, (void *)&scsi_cmd);
|
||||
if (status != 0) {
|
||||
cdio_warn ("CDTEXT reading failed: %s\n", strerror(errno));
|
||||
return NULL;
|
||||
return false;
|
||||
} else {
|
||||
|
||||
CDText_data_t *pdata;
|
||||
@@ -787,8 +786,34 @@ _get_cdtext_linux (void *user_data)
|
||||
}
|
||||
}
|
||||
|
||||
env->b_cdtext_init = true;
|
||||
return true;
|
||||
}
|
||||
|
||||
/*!
|
||||
Get cdtext information for a CdIo object .
|
||||
|
||||
@param obj the CD object that may contain CD-TEXT information.
|
||||
@return the CD-TEXT object or NULL if obj is NULL
|
||||
or CD-TEXT information does not exist.
|
||||
*/
|
||||
static const cdtext_t *
|
||||
_get_cdtext_linux (void *user_data, track_t i_track)
|
||||
{
|
||||
_img_private_t *env = user_data;
|
||||
|
||||
if ( NULL == env ||
|
||||
(0 != i_track
|
||||
&& i_track >= TOTAL_TRACKS+FIRST_TRACK_NUM ) )
|
||||
return NULL;
|
||||
|
||||
env->b_cdtext_init = _init_cdtext_linux(env);
|
||||
if (!env->b_cdtext_init) return NULL;
|
||||
|
||||
if (0 == i_track)
|
||||
return &(env->cdtext);
|
||||
else
|
||||
return &(env->cdtext_track[i_track-FIRST_TRACK_NUM]);
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
$Id: cdio.c,v 1.60 2004/07/15 02:24:29 rocky Exp $
|
||||
$Id: cdio.c,v 1.61 2004/07/17 02:18:28 rocky Exp $
|
||||
|
||||
Copyright (C) 2003, 2004 Rocky Bernstein <rocky@panix.com>
|
||||
Copyright (C) 2001 Herbert Valerio Riedel <hvr@gnu.org>
|
||||
@@ -39,7 +39,7 @@
|
||||
#include <cdio/logging.h>
|
||||
#include "cdio_private.h"
|
||||
|
||||
static const char _rcsid[] = "$Id: cdio.c,v 1.60 2004/07/15 02:24:29 rocky Exp $";
|
||||
static const char _rcsid[] = "$Id: cdio.c,v 1.61 2004/07/17 02:18:28 rocky Exp $";
|
||||
|
||||
|
||||
const char *track_format2str[6] =
|
||||
@@ -279,12 +279,12 @@ cdio_get_arg (const CdIo *obj, const char key[])
|
||||
or CD-TEXT information does not exist.
|
||||
*/
|
||||
const cdtext_t *
|
||||
cdio_get_cdtext (const CdIo *obj)
|
||||
cdio_get_cdtext (CdIo *obj, track_t i_track)
|
||||
{
|
||||
if (obj == NULL) return NULL;
|
||||
|
||||
if (obj->op.get_cdtext) {
|
||||
return obj->op.get_cdtext (obj->env);
|
||||
return obj->op.get_cdtext (obj->env, i_track);
|
||||
} else {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
$Id: cdio_private.h,v 1.28 2004/07/13 03:45:15 rocky Exp $
|
||||
$Id: cdio_private.h,v 1.29 2004/07/17 02:18:28 rocky Exp $
|
||||
|
||||
Copyright (C) 2003, 2004 Rocky Bernstein <rocky@panix.com>
|
||||
|
||||
@@ -57,9 +57,16 @@ extern "C" {
|
||||
const char * (*get_arg) (void *env, const char key[]);
|
||||
|
||||
/*!
|
||||
Return cdtext information.
|
||||
Get cdtext information for a CdIo object.
|
||||
|
||||
@param obj the CD object that may contain CD-TEXT information.
|
||||
@return the CD-TEXT object or NULL if obj is NULL
|
||||
or CD-TEXT information does not exist.
|
||||
|
||||
If i_track is 0 or CDIO_CDROM_LEADOUT_TRACK the track returned
|
||||
is the information assocated with the CD.
|
||||
*/
|
||||
const cdtext_t * (*get_cdtext) (void *env);
|
||||
const cdtext_t * (*get_cdtext) (void *env, track_t i_track);
|
||||
|
||||
/*!
|
||||
Return an array of device names. if CdIo is NULL (we haven't
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
$Id: bincue.c,v 1.33 2004/07/11 14:25:07 rocky Exp $
|
||||
$Id: bincue.c,v 1.34 2004/07/17 02:18:28 rocky Exp $
|
||||
|
||||
Copyright (C) 2002, 2003, 2004 Rocky Bernstein <rocky@panix.com>
|
||||
Copyright (C) 2001 Herbert Valerio Riedel <hvr@gnu.org>
|
||||
@@ -26,7 +26,7 @@
|
||||
(*.cue).
|
||||
*/
|
||||
|
||||
static const char _rcsid[] = "$Id: bincue.c,v 1.33 2004/07/11 14:25:07 rocky Exp $";
|
||||
static const char _rcsid[] = "$Id: bincue.c,v 1.34 2004/07/17 02:18:28 rocky Exp $";
|
||||
|
||||
#include "image.h"
|
||||
#include "cdio_assert.h"
|
||||
@@ -883,7 +883,9 @@ _get_track_green_bincue(void *user_data, track_t i_track)
|
||||
{
|
||||
_img_private_t *env = user_data;
|
||||
|
||||
if (i_track > env->i_tracks || i_track == 0)
|
||||
if ( NULL == env ||
|
||||
( i_track < env->i_first_track
|
||||
|| i_track >= env->i_tracks + env->i_first_track ) )
|
||||
return false;
|
||||
|
||||
return env->tocent[i_track-env->i_first_track].track_green;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
$Id: image_common.h,v 1.11 2004/07/13 04:33:07 rocky Exp $
|
||||
$Id: image_common.h,v 1.12 2004/07/17 02:18:28 rocky Exp $
|
||||
|
||||
Copyright (C) 2004 Rocky Bernstein <rocky@panix.com>
|
||||
|
||||
@@ -90,15 +90,33 @@ _get_arg_image (void *user_data, const char key[])
|
||||
}
|
||||
|
||||
/*!
|
||||
Return the CD-TEXT structure
|
||||
Get cdtext information for a CdIo object.
|
||||
|
||||
@param obj the CD object that may contain CD-TEXT information.
|
||||
@return the CD-TEXT object or NULL if obj is NULL
|
||||
or CD-TEXT information does not exist.
|
||||
|
||||
If i_track is 0 or CDIO_CDROM_LEADOUT_TRACK the track returned
|
||||
is the information assocated with the CD.
|
||||
*/
|
||||
static const cdtext_t *
|
||||
_get_cdtext_image (void *user_data)
|
||||
_get_cdtext_image (void *user_data, track_t i_track)
|
||||
{
|
||||
const _img_private_t *env = user_data;
|
||||
|
||||
if (NULL == env) return NULL;
|
||||
if ( NULL == env ||
|
||||
( 0 != i_track
|
||||
&& i_track >= env->i_tracks + env->i_first_track ) )
|
||||
return NULL;
|
||||
|
||||
if (CDIO_CDROM_LEADOUT_TRACK == i_track)
|
||||
i_track = 0;
|
||||
|
||||
if (0 == i_track)
|
||||
return &(env->cdtext);
|
||||
else
|
||||
return &(env->tocent[i_track-env->i_first_track].cdtext);
|
||||
|
||||
}
|
||||
|
||||
/*!
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
$Id: cd-info.c,v 1.71 2004/07/16 21:29:25 rocky Exp $
|
||||
$Id: cd-info.c,v 1.72 2004/07/17 02:18:28 rocky Exp $
|
||||
|
||||
Copyright (C) 2003, 2004 Rocky Bernstein <rocky@panix.com>
|
||||
Copyright (C) 1996, 1997, 1998 Gerd Knorr <kraxel@bytesex.org>
|
||||
@@ -336,13 +336,13 @@ msf_seconds(msf_t *msf)
|
||||
the number of tracks.
|
||||
*/
|
||||
static unsigned long
|
||||
cddb_discid(CdIo *cdio, int num_tracks)
|
||||
cddb_discid(CdIo *cdio, int i_tracks)
|
||||
{
|
||||
int i,t,n=0;
|
||||
msf_t start_msf;
|
||||
msf_t msf;
|
||||
|
||||
for (i = 1; i <= num_tracks; i++) {
|
||||
for (i = 1; i <= i_tracks; i++) {
|
||||
cdio_get_track_msf(cdio, i, &msf);
|
||||
n += cddb_dec_digit_sum(msf_seconds(&msf));
|
||||
}
|
||||
@@ -352,7 +352,7 @@ cddb_discid(CdIo *cdio, int num_tracks)
|
||||
|
||||
t = msf_seconds(&msf) - msf_seconds(&start_msf);
|
||||
|
||||
return ((n % 0xff) << 24 | t << 8 | num_tracks);
|
||||
return ((n % 0xff) << 24 | t << 8 | i_tracks);
|
||||
}
|
||||
|
||||
|
||||
@@ -382,27 +382,37 @@ _log_handler (cdio_log_level_t level, const char message[])
|
||||
}
|
||||
|
||||
static void
|
||||
print_cdtext_info(CdIo *cdio) {
|
||||
const cdtext_t *cdtext = cdio_get_cdtext(cdio);
|
||||
print_cdtext_track_info(CdIo *cdio, track_t i_track, const char *message) {
|
||||
const cdtext_t *cdtext = cdio_get_cdtext(cdio, 0);
|
||||
|
||||
if (NULL != cdtext) {
|
||||
cdtext_field_t i;
|
||||
|
||||
printf("\nCD-TEXT info:\n");
|
||||
printf("%s\n", message);
|
||||
|
||||
for (i=0; i < MAX_CDTEXT_FIELDS; i++) {
|
||||
if (cdtext->field[i]) {
|
||||
printf("\t%s: %s\n", cdtext_field2str(i), cdtext->field[i]);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
printf("Didn't get CD-TEXT info.\n");
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
print_cdtext_info(CdIo *cdio, track_t i_tracks, track_t i_first_track) {
|
||||
track_t i_last_track = i_first_track+i_tracks;
|
||||
|
||||
print_cdtext_track_info(cdio, 0, "\nCD-TEXT for Disc:");
|
||||
for ( ; i_first_track < i_last_track; i_first_track++ ) {
|
||||
char msg[50];
|
||||
sprintf(msg, "CD-TEXT for Track %d:", i_first_track);
|
||||
print_cdtext_track_info(cdio, i_first_track, msg);
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef HAVE_CDDB
|
||||
static void
|
||||
print_cddb_info(CdIo *cdio, track_t num_tracks, track_t first_track_num) {
|
||||
print_cddb_info(CdIo *cdio, track_t i_tracks, track_t i_first_track) {
|
||||
int i, matches;
|
||||
|
||||
cddb_conn_t *conn = cddb_new();
|
||||
@@ -444,9 +454,9 @@ print_cddb_info(CdIo *cdio, track_t num_tracks, track_t first_track_num) {
|
||||
fprintf(stderr, "%s: unable to create CDDB disc structure", program_name);
|
||||
goto cddb_destroy;
|
||||
}
|
||||
for(i = 0; i < num_tracks; i++) {
|
||||
for(i = 0; i < i_tracks; i++) {
|
||||
cddb_track_t *t = cddb_track_new();
|
||||
t->frame_offset = cdio_get_track_lba(cdio, i+first_track_num);
|
||||
t->frame_offset = cdio_get_track_lba(cdio, i+i_first_track);
|
||||
cddb_disc_add_track(disc, t);
|
||||
}
|
||||
|
||||
@@ -643,7 +653,7 @@ print_iso9660_fs (const CdIo *p_cdio, cdio_fs_anal_t fs,
|
||||
static void
|
||||
print_analysis(int ms_offset, cdio_iso_analysis_t cdio_iso_analysis,
|
||||
cdio_fs_anal_t fs, int first_data, unsigned int num_audio,
|
||||
track_t num_tracks, track_t first_track_num,
|
||||
track_t i_tracks, track_t i_first_track,
|
||||
track_format_t track_format, CdIo *p_cdio)
|
||||
{
|
||||
int need_lf;
|
||||
@@ -652,11 +662,11 @@ print_analysis(int ms_offset, cdio_iso_analysis_t cdio_iso_analysis,
|
||||
case CDIO_FS_AUDIO:
|
||||
if (num_audio > 0) {
|
||||
printf("Audio CD, CDDB disc ID is %08lx\n",
|
||||
cddb_discid(p_cdio, num_tracks));
|
||||
cddb_discid(p_cdio, i_tracks));
|
||||
#ifdef HAVE_CDDB
|
||||
if (!opts.no_cddb) print_cddb_info(p_cdio, num_tracks, first_track_num);
|
||||
if (!opts.no_cddb) print_cddb_info(p_cdio, i_tracks, i_first_track);
|
||||
#endif
|
||||
print_cdtext_info(p_cdio);
|
||||
print_cdtext_info(p_cdio, i_tracks, i_first_track);
|
||||
}
|
||||
break;
|
||||
case CDIO_FS_ISO_9660:
|
||||
@@ -822,10 +832,10 @@ main(int argc, const char *argv[])
|
||||
cdio_fs_anal_t fs=CDIO_FS_AUDIO;
|
||||
int i;
|
||||
lsn_t start_track_lsn; /* lsn of first track */
|
||||
lsn_t data_start =0; /* start of data area */
|
||||
lsn_t data_start = 0; /* start of data area */
|
||||
int ms_offset = 0;
|
||||
track_t num_tracks=0;
|
||||
track_t first_track_num = 0;
|
||||
track_t i_tracks = 0;
|
||||
track_t i_first_track = 0;
|
||||
unsigned int num_audio = 0; /* # of audio tracks */
|
||||
unsigned int num_data = 0; /* # of data tracks */
|
||||
int first_data = -1; /* # of first data track */
|
||||
@@ -974,18 +984,18 @@ main(int argc, const char *argv[])
|
||||
if (device_list) free(device_list);
|
||||
}
|
||||
|
||||
first_track_num = cdio_get_first_track_num(cdio);
|
||||
num_tracks = cdio_get_num_tracks(cdio);
|
||||
i_first_track = cdio_get_first_track_num(cdio);
|
||||
i_tracks = cdio_get_num_tracks(cdio);
|
||||
|
||||
if (!opts.no_tracks) {
|
||||
printf(STRONG "CD-ROM Track List (%i - %i)\n" NORMAL,
|
||||
first_track_num, num_tracks);
|
||||
i_first_track, i_tracks);
|
||||
|
||||
printf(" #: MSF LSN Type Green?\n");
|
||||
}
|
||||
|
||||
/* Read and possibly print track information. */
|
||||
for (i = first_track_num; i <= CDIO_CDROM_LEADOUT_TRACK; i++) {
|
||||
for (i = i_first_track; i <= CDIO_CDROM_LEADOUT_TRACK; i++) {
|
||||
msf_t msf;
|
||||
char *psz_msf;
|
||||
|
||||
@@ -1014,7 +1024,7 @@ main(int argc, const char *argv[])
|
||||
if (-1 == first_data) first_data = i;
|
||||
}
|
||||
/* skip to leadout? */
|
||||
if (i == num_tracks) i = CDIO_CDROM_LEADOUT_TRACK-1;
|
||||
if (i == i_tracks) i = CDIO_CDROM_LEADOUT_TRACK-1;
|
||||
}
|
||||
|
||||
/* get MCN */
|
||||
@@ -1111,13 +1121,13 @@ main(int argc, const char *argv[])
|
||||
}
|
||||
}
|
||||
print_analysis(ms_offset, cdio_iso_analysis, fs, first_data, num_audio,
|
||||
num_tracks, first_track_num,
|
||||
i_tracks, i_first_track,
|
||||
cdio_get_track_format(cdio, 1), cdio);
|
||||
} else {
|
||||
/* we have data track(s) */
|
||||
int j;
|
||||
|
||||
for (j = 2, i = first_data; i <= num_tracks; i++) {
|
||||
for (j = 2, i = first_data; i <= i_tracks; i++) {
|
||||
msf_t msf;
|
||||
track_format_t track_format = cdio_get_track_format(cdio, i);
|
||||
|
||||
@@ -1158,7 +1168,7 @@ main(int argc, const char *argv[])
|
||||
fs |= CDIO_FS_ANAL_MULTISESSION;
|
||||
} else {
|
||||
print_analysis(ms_offset, cdio_iso_analysis, fs, first_data,
|
||||
num_audio, num_tracks, first_track_num,
|
||||
num_audio, i_tracks, i_first_track,
|
||||
track_format, cdio);
|
||||
}
|
||||
|
||||
|
||||
@@ -31,4 +31,5 @@ __________________________________
|
||||
CD Analysis Report
|
||||
Audio CD, CDDB disc ID is 02000701
|
||||
|
||||
CD-TEXT info:
|
||||
CD-TEXT for Disc:
|
||||
CD-TEXT for Track 1:
|
||||
|
||||
@@ -31,6 +31,9 @@ __________________________________
|
||||
CD Analysis Report
|
||||
Audio CD, CDDB disc ID is 02000401
|
||||
|
||||
CD-TEXT info:
|
||||
CD-TEXT for Disc:
|
||||
PERFORMER: Richard Stallman
|
||||
TITLE: Join us now we have the software
|
||||
CD-TEXT for Track 1:
|
||||
PERFORMER: Richard Stallman
|
||||
TITLE: Join us now we have the software
|
||||
|
||||
Reference in New Issue
Block a user