1st attempt to reduce duplicate CD-Text code. (It works on GNU/Linux)...
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
$Id: aspi32.c,v 1.47 2004/08/05 02:58:46 rocky Exp $
|
$Id: aspi32.c,v 1.48 2004/08/10 03:03:27 rocky Exp $
|
||||||
|
|
||||||
Copyright (C) 2004 Rocky Bernstein <rocky@panix.com>
|
Copyright (C) 2004 Rocky Bernstein <rocky@panix.com>
|
||||||
|
|
||||||
@@ -27,7 +27,7 @@
|
|||||||
# include "config.h"
|
# include "config.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static const char _rcsid[] = "$Id: aspi32.c,v 1.47 2004/08/05 02:58:46 rocky Exp $";
|
static const char _rcsid[] = "$Id: aspi32.c,v 1.48 2004/08/10 03:03:27 rocky Exp $";
|
||||||
|
|
||||||
#include <cdio/cdio.h>
|
#include <cdio/cdio.h>
|
||||||
#include <cdio/sector.h>
|
#include <cdio/sector.h>
|
||||||
@@ -762,21 +762,6 @@ wnaspi32_eject_media (void *user_data) {
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*
|
|
||||||
Read cdtext information for a CdIo object .
|
|
||||||
|
|
||||||
return true on success, false on error or CD-TEXT information does
|
|
||||||
not exist.
|
|
||||||
*/
|
|
||||||
bool
|
|
||||||
init_cdtext_aspi (_img_private_t *p_env)
|
|
||||||
{
|
|
||||||
return scsi_mmc_init_cdtext_private( p_env,
|
|
||||||
&run_scsi_cmd_aspi,
|
|
||||||
set_cdtext_field_win32
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
Return the the kind of drive capabilities of device.
|
Return the the kind of drive capabilities of device.
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
$Id: win32.c,v 1.40 2004/08/08 00:20:21 rocky Exp $
|
$Id: win32.c,v 1.41 2004/08/10 03:03:27 rocky Exp $
|
||||||
|
|
||||||
Copyright (C) 2003, 2004 Rocky Bernstein <rocky@panix.com>
|
Copyright (C) 2003, 2004 Rocky Bernstein <rocky@panix.com>
|
||||||
|
|
||||||
@@ -26,7 +26,7 @@
|
|||||||
# include "config.h"
|
# include "config.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static const char _rcsid[] = "$Id: win32.c,v 1.40 2004/08/08 00:20:21 rocky Exp $";
|
static const char _rcsid[] = "$Id: win32.c,v 1.41 2004/08/10 03:03:27 rocky Exp $";
|
||||||
|
|
||||||
#include <cdio/cdio.h>
|
#include <cdio/cdio.h>
|
||||||
#include <cdio/sector.h>
|
#include <cdio/sector.h>
|
||||||
@@ -482,23 +482,6 @@ _get_arg_win32 (void *user_data, const char key[])
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
|
||||||
set_cdtext_field_win32(void *user_data, track_t i_track,
|
|
||||||
track_t i_first_track,
|
|
||||||
cdtext_field_t e_field, const char *psz_value)
|
|
||||||
{
|
|
||||||
char **pp_field;
|
|
||||||
_img_private_t *env = user_data;
|
|
||||||
|
|
||||||
if( i_track == 0 )
|
|
||||||
pp_field = &(env->cdtext.field[e_field]);
|
|
||||||
|
|
||||||
else
|
|
||||||
pp_field = &(env->tocent[i_track-i_first_track].cdtext.field[e_field]);
|
|
||||||
|
|
||||||
*pp_field = strdup(psz_value);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
Return the value associated with the key "arg".
|
Return the value associated with the key "arg".
|
||||||
*/
|
*/
|
||||||
@@ -514,19 +497,15 @@ _get_cdtext_win32 (void *user_data, track_t i_track)
|
|||||||
&& i_track >= p_env->gen.i_tracks + p_env->gen.i_first_track ) )
|
&& i_track >= p_env->gen.i_tracks + p_env->gen.i_first_track ) )
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
if (!p_env->gen.b_cdtext_init) {
|
if (!p_env->gen.b_cdtext_init)
|
||||||
if (p_env->hASPI) {
|
init_cdtext_generic(p_env);
|
||||||
p_env->gen.b_cdtext_init = init_cdtext_aspi(p_env);
|
|
||||||
} else
|
|
||||||
p_env->gen.b_cdtext_init = init_cdtext_win32ioctl(p_env);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!p_env->gen.b_cdtext_init) return NULL;
|
if (!p_env->gen.b_cdtext_init) return NULL;
|
||||||
|
|
||||||
if (0 == i_track)
|
if (0 == i_track)
|
||||||
return &(p_env->cdtext);
|
return &(p_env->gen.cdtext);
|
||||||
else
|
else
|
||||||
return &(p_env->tocent[i_track-p_env->gen.i_first_track].cdtext);
|
return &(p_env->gen.cdtext_track[i_track-p_env->gen.i_first_track]);
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
$Id: win32.h,v 1.19 2004/08/07 22:58:51 rocky Exp $
|
$Id: win32.h,v 1.20 2004/08/10 03:03:27 rocky Exp $
|
||||||
|
|
||||||
Copyright (C) 2004 Rocky Bernstein <rocky@panix.com>
|
Copyright (C) 2004 Rocky Bernstein <rocky@panix.com>
|
||||||
|
|
||||||
@@ -40,10 +40,6 @@ typedef struct {
|
|||||||
This must be first. */
|
This must be first. */
|
||||||
generic_img_private_t gen;
|
generic_img_private_t gen;
|
||||||
|
|
||||||
/* Entry info for each track, add 1 for leadout. */
|
|
||||||
track_info_t tocent[CDIO_CD_MAX_TRACKS+1];
|
|
||||||
|
|
||||||
cdtext_t cdtext; /* CD-TEXT */
|
|
||||||
access_mode_t access_mode;
|
access_mode_t access_mode;
|
||||||
|
|
||||||
/* Some of the more OS specific things. */
|
/* Some of the more OS specific things. */
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
$Id: win32_ioctl.c,v 1.34 2004/08/05 02:58:46 rocky Exp $
|
$Id: win32_ioctl.c,v 1.35 2004/08/10 03:03:27 rocky Exp $
|
||||||
|
|
||||||
Copyright (C) 2004 Rocky Bernstein <rocky@panix.com>
|
Copyright (C) 2004 Rocky Bernstein <rocky@panix.com>
|
||||||
|
|
||||||
@@ -26,7 +26,7 @@
|
|||||||
# include "config.h"
|
# include "config.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static const char _rcsid[] = "$Id: win32_ioctl.c,v 1.34 2004/08/05 02:58:46 rocky Exp $";
|
static const char _rcsid[] = "$Id: win32_ioctl.c,v 1.35 2004/08/10 03:03:27 rocky Exp $";
|
||||||
|
|
||||||
#include <cdio/cdio.h>
|
#include <cdio/cdio.h>
|
||||||
#include <cdio/sector.h>
|
#include <cdio/sector.h>
|
||||||
@@ -503,22 +503,6 @@ read_toc_win32ioctl (_img_private_t *env)
|
|||||||
return 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.
|
|
||||||
*/
|
|
||||||
bool
|
|
||||||
init_cdtext_win32ioctl (_img_private_t *p_env)
|
|
||||||
{
|
|
||||||
return scsi_mmc_init_cdtext_private( p_env,
|
|
||||||
&run_scsi_cmd_win32ioctl,
|
|
||||||
set_cdtext_field_win32
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
Return the media catalog number MCN.
|
Return the media catalog number MCN.
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
$Id: _cdio_bsdi.c,v 1.37 2004/08/07 23:17:36 rocky Exp $
|
$Id: _cdio_bsdi.c,v 1.38 2004/08/10 03:03:27 rocky Exp $
|
||||||
|
|
||||||
Copyright (C) 2001 Herbert Valerio Riedel <hvr@gnu.org>
|
Copyright (C) 2001 Herbert Valerio Riedel <hvr@gnu.org>
|
||||||
Copyright (C) 2002, 2003, 2004 Rocky Bernstein <rocky@panix.com>
|
Copyright (C) 2002, 2003, 2004 Rocky Bernstein <rocky@panix.com>
|
||||||
@@ -27,7 +27,7 @@
|
|||||||
# include "config.h"
|
# include "config.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static const char _rcsid[] = "$Id: _cdio_bsdi.c,v 1.37 2004/08/07 23:17:36 rocky Exp $";
|
static const char _rcsid[] = "$Id: _cdio_bsdi.c,v 1.38 2004/08/10 03:03:27 rocky Exp $";
|
||||||
|
|
||||||
#include <cdio/sector.h>
|
#include <cdio/sector.h>
|
||||||
#include <cdio/util.h>
|
#include <cdio/util.h>
|
||||||
@@ -68,21 +68,13 @@ typedef struct {
|
|||||||
This must be first. */
|
This must be first. */
|
||||||
generic_img_private_t gen;
|
generic_img_private_t gen;
|
||||||
|
|
||||||
char *source_name;
|
|
||||||
|
|
||||||
access_mode_t access_mode;
|
access_mode_t access_mode;
|
||||||
|
|
||||||
|
/* Some of the more OS specific things. */
|
||||||
/* Track information */
|
/* Track information */
|
||||||
bool toc_init; /* if true, info below is valid. */
|
|
||||||
struct cdrom_tochdr tochdr;
|
struct cdrom_tochdr tochdr;
|
||||||
struct cdrom_tocentry tocent[CDIO_CD_MAX_TRACKS+1];
|
struct cdrom_tocentry tocent[CDIO_CD_MAX_TRACKS+1];
|
||||||
|
|
||||||
cdtext_t cdtext; /* CD-TEXT */
|
|
||||||
|
|
||||||
/* Some of the more OS specific things. */
|
|
||||||
cdtext_t cdtext_track[CDIO_CD_MAX_TRACKS+1]; /*CD-TEXT for each track*/
|
|
||||||
/* Track information */
|
|
||||||
|
|
||||||
} _img_private_t;
|
} _img_private_t;
|
||||||
|
|
||||||
/* Define the Cdrom Generic Command structure */
|
/* Define the Cdrom Generic Command structure */
|
||||||
@@ -521,38 +513,6 @@ read_toc_bsdi (void *p_user_data)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
|
||||||
set_cdtext_field_bsdi(void *p_user_data, track_t i_track,
|
|
||||||
track_t i_first_track,
|
|
||||||
cdtext_field_t e_field, const char *psz_value)
|
|
||||||
{
|
|
||||||
char **pp_field;
|
|
||||||
_img_private_t *p_env = p_user_data;
|
|
||||||
|
|
||||||
if( i_track == 0 )
|
|
||||||
pp_field = &(p_env->cdtext.field[e_field]);
|
|
||||||
|
|
||||||
else
|
|
||||||
pp_field = &(p_env->cdtext_track[i_track-i_first_track].field[e_field]);
|
|
||||||
|
|
||||||
*pp_field = strdup(psz_value);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
Read cdtext information for a CdIo object .
|
|
||||||
|
|
||||||
return true on success, false on error or CD-TEXT information does
|
|
||||||
not exist.
|
|
||||||
*/
|
|
||||||
static bool
|
|
||||||
init_cdtext_bsdi (_img_private_t *p_env)
|
|
||||||
{
|
|
||||||
return scsi_mmc_init_cdtext_private( p_env->gen.cdio,
|
|
||||||
&run_scsi_cmd_bsdi,
|
|
||||||
set_cdtext_field_bsdi
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
Get cdtext information for a CdIo object .
|
Get cdtext information for a CdIo object .
|
||||||
|
|
||||||
@@ -571,13 +531,13 @@ get_cdtext_bsdi (void *p_user_data, track_t i_track)
|
|||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
if (!p_env->gen.b_cdtext_init)
|
if (!p_env->gen.b_cdtext_init)
|
||||||
init_cdtext_bsdi(p_env);
|
init_cdtext_generic(&(p_env->gen));
|
||||||
if (!p_env->gen.b_cdtext_init) return NULL;
|
if (!p_env->gen.b_cdtext_init) return NULL;
|
||||||
|
|
||||||
if (0 == i_track)
|
if (0 == i_track)
|
||||||
return &(p_env->cdtext);
|
return &(p_env->gen.cdtext);
|
||||||
else
|
else
|
||||||
return &(p_env->cdtext_track[i_track-p_env->gen.i_first_track]);
|
return &(p_env->gen.cdtext_track[i_track-p_env->gen.i_first_track]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
$Id: _cdio_generic.c,v 1.21 2004/08/07 22:58:51 rocky Exp $
|
$Id: _cdio_generic.c,v 1.22 2004/08/10 03:03:27 rocky Exp $
|
||||||
|
|
||||||
Copyright (C) 2001 Herbert Valerio Riedel <hvr@gnu.org>
|
Copyright (C) 2001 Herbert Valerio Riedel <hvr@gnu.org>
|
||||||
Copyright (C) 2002, 2003, 2004 Rocky Bernstein <rocky@panix.com>
|
Copyright (C) 2002, 2003, 2004 Rocky Bernstein <rocky@panix.com>
|
||||||
@@ -27,7 +27,7 @@
|
|||||||
# include "config.h"
|
# include "config.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static const char _rcsid[] = "$Id: _cdio_generic.c,v 1.21 2004/08/07 22:58:51 rocky Exp $";
|
static const char _rcsid[] = "$Id: _cdio_generic.c,v 1.22 2004/08/10 03:03:27 rocky Exp $";
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
@@ -347,3 +347,35 @@ get_num_tracks_generic(void *p_user_data)
|
|||||||
return p_env->toc_init ? p_env->i_tracks : CDIO_INVALID_TRACK;
|
return p_env->toc_init ? p_env->i_tracks : CDIO_INVALID_TRACK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
set_cdtext_field_generic(void *user_data, track_t i_track,
|
||||||
|
track_t i_first_track,
|
||||||
|
cdtext_field_t e_field, const char *psz_value)
|
||||||
|
{
|
||||||
|
char **pp_field;
|
||||||
|
generic_img_private_t *env = user_data;
|
||||||
|
|
||||||
|
if( i_track == 0 )
|
||||||
|
pp_field = &(env->cdtext.field[e_field]);
|
||||||
|
|
||||||
|
else
|
||||||
|
pp_field = &(env->cdtext_track[i_track-i_first_track].field[e_field]);
|
||||||
|
|
||||||
|
*pp_field = strdup(psz_value);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*!
|
||||||
|
Read cdtext information for a CdIo object .
|
||||||
|
|
||||||
|
return true on success, false on error or CD-TEXT information does
|
||||||
|
not exist.
|
||||||
|
*/
|
||||||
|
bool
|
||||||
|
init_cdtext_generic (generic_img_private_t *p_env)
|
||||||
|
{
|
||||||
|
return scsi_mmc_init_cdtext_private( p_env,
|
||||||
|
p_env->cdio->op.run_scsi_mmc_cmd,
|
||||||
|
set_cdtext_field_generic
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
$Id: _cdio_linux.c,v 1.89 2004/08/07 22:58:51 rocky Exp $
|
$Id: _cdio_linux.c,v 1.90 2004/08/10 03:03:27 rocky Exp $
|
||||||
|
|
||||||
Copyright (C) 2001 Herbert Valerio Riedel <hvr@gnu.org>
|
Copyright (C) 2001 Herbert Valerio Riedel <hvr@gnu.org>
|
||||||
Copyright (C) 2002, 2003, 2004 Rocky Bernstein <rocky@panix.com>
|
Copyright (C) 2002, 2003, 2004 Rocky Bernstein <rocky@panix.com>
|
||||||
@@ -27,7 +27,7 @@
|
|||||||
# include "config.h"
|
# include "config.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static const char _rcsid[] = "$Id: _cdio_linux.c,v 1.89 2004/08/07 22:58:51 rocky Exp $";
|
static const char _rcsid[] = "$Id: _cdio_linux.c,v 1.90 2004/08/10 03:03:27 rocky Exp $";
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
@@ -82,15 +82,12 @@ typedef struct {
|
|||||||
This must be first. */
|
This must be first. */
|
||||||
generic_img_private_t gen;
|
generic_img_private_t gen;
|
||||||
|
|
||||||
/* Entry info for each track, add 1 for leadout. */
|
|
||||||
struct cdrom_tocentry tocent[CDIO_CD_MAX_TRACKS+1];
|
|
||||||
|
|
||||||
cdtext_t cdtext; /* CD-TEXT */
|
|
||||||
|
|
||||||
access_mode_t access_mode;
|
access_mode_t access_mode;
|
||||||
|
|
||||||
/* Some of the more OS specific things. */
|
/* Some of the more OS specific things. */
|
||||||
cdtext_t cdtext_track[CDIO_CD_MAX_TRACKS+1]; /*CD-TEXT for each track*/
|
/* Entry info for each track, add 1 for leadout. */
|
||||||
|
struct cdrom_tocentry tocent[CDIO_CD_MAX_TRACKS+1];
|
||||||
|
|
||||||
struct cdrom_tochdr tochdr;
|
struct cdrom_tochdr tochdr;
|
||||||
|
|
||||||
} _img_private_t;
|
} _img_private_t;
|
||||||
@@ -954,38 +951,6 @@ set_arg_linux (void *p_user_data, const char key[], const char value[])
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
|
||||||
set_cdtext_field_linux(void *user_data, track_t i_track,
|
|
||||||
track_t i_first_track,
|
|
||||||
cdtext_field_t e_field, const char *psz_value)
|
|
||||||
{
|
|
||||||
char **pp_field;
|
|
||||||
_img_private_t *env = user_data;
|
|
||||||
|
|
||||||
if( i_track == 0 )
|
|
||||||
pp_field = &(env->cdtext.field[e_field]);
|
|
||||||
|
|
||||||
else
|
|
||||||
pp_field = &(env->cdtext_track[i_track-i_first_track].field[e_field]);
|
|
||||||
|
|
||||||
*pp_field = strdup(psz_value);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
Read cdtext information for a CdIo object .
|
|
||||||
|
|
||||||
return true on success, false on error or CD-TEXT information does
|
|
||||||
not exist.
|
|
||||||
*/
|
|
||||||
static bool
|
|
||||||
init_cdtext_linux (_img_private_t *p_env)
|
|
||||||
{
|
|
||||||
return scsi_mmc_init_cdtext_private( p_env,
|
|
||||||
&run_scsi_cmd_linux,
|
|
||||||
set_cdtext_field_linux
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
Get cdtext information for a CdIo object .
|
Get cdtext information for a CdIo object .
|
||||||
|
|
||||||
@@ -1004,13 +969,13 @@ get_cdtext_linux (void *p_user_data, track_t i_track)
|
|||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
if (!p_env->gen.b_cdtext_init)
|
if (!p_env->gen.b_cdtext_init)
|
||||||
init_cdtext_linux(p_env);
|
init_cdtext_generic(&(p_env->gen));
|
||||||
if (!p_env->gen.b_cdtext_init) return NULL;
|
if (!p_env->gen.b_cdtext_init) return NULL;
|
||||||
|
|
||||||
if (0 == i_track)
|
if (0 == i_track)
|
||||||
return &(p_env->cdtext);
|
return &(p_env->gen.cdtext);
|
||||||
else
|
else
|
||||||
return &(p_env->cdtext_track[i_track-p_env->gen.i_first_track]);
|
return &(p_env->gen.cdtext_track[i_track-p_env->gen.i_first_track]);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
$Id: _cdio_sunos.c,v 1.69 2004/08/07 22:58:51 rocky Exp $
|
$Id: _cdio_sunos.c,v 1.70 2004/08/10 03:03:27 rocky Exp $
|
||||||
|
|
||||||
Copyright (C) 2001 Herbert Valerio Riedel <hvr@gnu.org>
|
Copyright (C) 2001 Herbert Valerio Riedel <hvr@gnu.org>
|
||||||
Copyright (C) 2002, 2003, 2004 Rocky Bernstein <rocky@panix.com>
|
Copyright (C) 2002, 2003, 2004 Rocky Bernstein <rocky@panix.com>
|
||||||
@@ -38,7 +38,7 @@
|
|||||||
|
|
||||||
#ifdef HAVE_SOLARIS_CDROM
|
#ifdef HAVE_SOLARIS_CDROM
|
||||||
|
|
||||||
static const char _rcsid[] = "$Id: _cdio_sunos.c,v 1.69 2004/08/07 22:58:51 rocky Exp $";
|
static const char _rcsid[] = "$Id: _cdio_sunos.c,v 1.70 2004/08/10 03:03:27 rocky Exp $";
|
||||||
|
|
||||||
#ifdef HAVE_GLOB_H
|
#ifdef HAVE_GLOB_H
|
||||||
#include <glob.h>
|
#include <glob.h>
|
||||||
@@ -86,15 +86,12 @@ typedef struct {
|
|||||||
This must be first. */
|
This must be first. */
|
||||||
generic_img_private_t gen;
|
generic_img_private_t gen;
|
||||||
|
|
||||||
/* Entry info for each track, add 1 for leadout. */
|
|
||||||
struct cdrom_tocentry tocent[CDIO_CD_MAX_TRACKS+1];
|
|
||||||
|
|
||||||
cdtext_t cdtext; /* CD-TEXT */
|
|
||||||
|
|
||||||
access_mode_t access_mode;
|
access_mode_t access_mode;
|
||||||
|
|
||||||
/* Some of the more OS specific things. */
|
/* Some of the more OS specific things. */
|
||||||
cdtext_t cdtext_track[CDIO_CD_MAX_TRACKS+1]; /*CD-TEXT for each track*/
|
/* Entry info for each track, add 1 for leadout. */
|
||||||
|
struct cdrom_tocentry tocent[CDIO_CD_MAX_TRACKS+1];
|
||||||
|
|
||||||
/* Track information */
|
/* Track information */
|
||||||
struct cdrom_tochdr tochdr;
|
struct cdrom_tochdr tochdr;
|
||||||
} _img_private_t;
|
} _img_private_t;
|
||||||
@@ -448,38 +445,6 @@ read_toc_solaris (void *p_user_data)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
|
||||||
set_cdtext_field_solaris(void *p_user_data, track_t i_track,
|
|
||||||
track_t i_first_track,
|
|
||||||
cdtext_field_t e_field, const char *psz_value)
|
|
||||||
{
|
|
||||||
char **pp_field;
|
|
||||||
_img_private_t *p_env = p_user_data;
|
|
||||||
|
|
||||||
if( i_track == 0 )
|
|
||||||
pp_field = &(p_env->cdtext.field[e_field]);
|
|
||||||
|
|
||||||
else
|
|
||||||
pp_field = &(p_env->cdtext_track[i_track-i_first_track].field[e_field]);
|
|
||||||
|
|
||||||
*pp_field = strdup(psz_value);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
Read cdtext information for a CdIo object .
|
|
||||||
|
|
||||||
return true on success, false on error or CD-TEXT information does
|
|
||||||
not exist.
|
|
||||||
*/
|
|
||||||
static bool
|
|
||||||
init_cdtext_solaris (_img_private_t *p_env)
|
|
||||||
{
|
|
||||||
return scsi_mmc_init_cdtext_private( p_env->gen.cdio,
|
|
||||||
&run_scsi_cmd_solaris,
|
|
||||||
set_cdtext_field_solaris
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
Get cdtext information for a CdIo object .
|
Get cdtext information for a CdIo object .
|
||||||
|
|
||||||
@@ -498,14 +463,14 @@ get_cdtext_solaris (void *p_user_data, track_t i_track)
|
|||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
if (!p_env->gen.b_cdtext_init)
|
if (!p_env->gen.b_cdtext_init)
|
||||||
init_cdtext_solaris(p_env);
|
init_cdtext_generic(&p_env->gen));
|
||||||
|
|
||||||
if (!p_env->gen.b_cdtext_init) return NULL;
|
if (!p_env->gen.b_cdtext_init) return NULL;
|
||||||
|
|
||||||
if (0 == i_track)
|
if (0 == i_track)
|
||||||
return &(p_env->cdtext);
|
return &(p_env->gen.cdtext);
|
||||||
else
|
else
|
||||||
return &(p_env->cdtext_track[i_track-p_env->gen.i_first_track]);
|
return &(p_env->gen.cdtext_track[i_track-p_env->gen.i_first_track]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
$Id: cdio_private.h,v 1.37 2004/08/07 22:58:51 rocky Exp $
|
$Id: cdio_private.h,v 1.38 2004/08/10 03:03:27 rocky Exp $
|
||||||
|
|
||||||
Copyright (C) 2003, 2004 Rocky Bernstein <rocky@panix.com>
|
Copyright (C) 2003, 2004 Rocky Bernstein <rocky@panix.com>
|
||||||
|
|
||||||
@@ -262,6 +262,9 @@ extern "C" {
|
|||||||
track_t i_tracks; /**< The number of tracks. */
|
track_t i_tracks; /**< The number of tracks. */
|
||||||
CdioDataSource *data_source;
|
CdioDataSource *data_source;
|
||||||
CdIo *cdio; /**< a way to call general cdio routines. */
|
CdIo *cdio; /**< a way to call general cdio routines. */
|
||||||
|
cdtext_t cdtext; /**< CD-Text for disc. */
|
||||||
|
cdtext_t cdtext_track[CDIO_CD_MAX_TRACKS+1]; /*CD-TEXT for each track*/
|
||||||
|
|
||||||
} generic_img_private_t;
|
} generic_img_private_t;
|
||||||
|
|
||||||
/* This is used in drivers that must keep their own internal
|
/* This is used in drivers that must keep their own internal
|
||||||
@@ -390,6 +393,17 @@ extern "C" {
|
|||||||
*/
|
*/
|
||||||
discmode_t get_discmode_generic (void *p_user_data );
|
discmode_t get_discmode_generic (void *p_user_data );
|
||||||
|
|
||||||
|
void set_cdtext_field_generic(void *user_data, track_t i_track,
|
||||||
|
track_t i_first_track,
|
||||||
|
cdtext_field_t e_field, const char *psz_value);
|
||||||
|
/*!
|
||||||
|
Read cdtext information for a CdIo object .
|
||||||
|
|
||||||
|
return true on success, false on error or CD-Text information does
|
||||||
|
not exist.
|
||||||
|
*/
|
||||||
|
bool init_cdtext_generic (generic_img_private_t *p_env);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif /* __cplusplus */
|
#endif /* __cplusplus */
|
||||||
|
|||||||
Reference in New Issue
Block a user