First cut at a C++ wrapper for libcdio libcdio++. What's not done are
audio and MMC commands. No doubt it may be a little rough and I expect further changes.
This commit is contained in:
32
include/cdio++/Makefile.am
Normal file
32
include/cdio++/Makefile.am
Normal file
@@ -0,0 +1,32 @@
|
||||
# $Id: Makefile.am,v 1.1 2005/11/10 11:11:16 rocky Exp $
|
||||
#
|
||||
# Copyright (C) 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
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
#
|
||||
########################################################
|
||||
# Things to make the install (public) libcdio++ headers
|
||||
########################################################
|
||||
#
|
||||
|
||||
libcdioincludedir=$(includedir)/cdio++
|
||||
libcdioinclude_HEADERS = \
|
||||
cdio.hpp \
|
||||
cdtext.hpp \
|
||||
device.hpp \
|
||||
devices.hpp \
|
||||
disc.hpp \
|
||||
read.hpp \
|
||||
track.hpp
|
||||
117
include/cdio++/cdio.hpp
Normal file
117
include/cdio++/cdio.hpp
Normal file
@@ -0,0 +1,117 @@
|
||||
/* -*- C++ -*-
|
||||
$Id: cdio.hpp,v 1.1 2005/11/10 11:11:16 rocky Exp $
|
||||
|
||||
Copyright (C) 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
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
/** \file cdio.hpp
|
||||
*
|
||||
* \brief C++ class for libcdio: the CD Input and Control
|
||||
* library. Applications use this for anything regarding libcdio.
|
||||
*/
|
||||
|
||||
#ifndef __CDIO_HPP__
|
||||
#define __CDIO_HPP__
|
||||
|
||||
#include <cdio/cdio.h>
|
||||
|
||||
class Cdio {
|
||||
|
||||
public:
|
||||
|
||||
// Other member functions
|
||||
#include "devices.hpp"
|
||||
};
|
||||
|
||||
/** A class relating to tracks. A track object basically saves device
|
||||
and track number information so that in track operations these
|
||||
don't have be specified. Note use invalid track number 0 to specify
|
||||
CD-Text for the CD (as opposed to a specific track).
|
||||
*/
|
||||
class CdioCDText
|
||||
{
|
||||
public:
|
||||
CdioCDText(cdtext_t *p)
|
||||
{
|
||||
p_cdtext = p;
|
||||
cdtext_init(p); // make sure we're initialized on the C side
|
||||
}
|
||||
|
||||
~CdioCDText()
|
||||
{
|
||||
cdtext_destroy(p_cdtext);
|
||||
p_cdtext = (cdtext_t *) NULL;
|
||||
}
|
||||
|
||||
// Other member functions
|
||||
#include "cdtext.hpp"
|
||||
|
||||
private:
|
||||
cdtext_t *p_cdtext;
|
||||
};
|
||||
|
||||
/** A class relating to tracks. A track object basically saves device
|
||||
and track number information so that in track operations these
|
||||
don't have be specified.
|
||||
*/
|
||||
class CdioTrack
|
||||
{
|
||||
|
||||
public:
|
||||
CdioTrack(CdIo_t *p, track_t t)
|
||||
{
|
||||
i_track = t;
|
||||
p_cdio = p;
|
||||
}
|
||||
|
||||
// Other member functions
|
||||
#include "track.hpp"
|
||||
|
||||
private:
|
||||
track_t i_track;
|
||||
CdIo_t *p_cdio;
|
||||
};
|
||||
|
||||
/** A class relating to a CD-ROM device or pseudo CD-ROM device with
|
||||
has a particular CD image. A device basically saves the libcdio
|
||||
"object" (of type CdIo *).
|
||||
*/
|
||||
class CdioDevice
|
||||
{
|
||||
|
||||
public:
|
||||
CdioDevice(CdIo_t *p = (CdIo_t *) NULL)
|
||||
{
|
||||
p_cdio=p;
|
||||
};
|
||||
|
||||
~CdioDevice()
|
||||
{
|
||||
cdio_destroy(p_cdio);
|
||||
p_cdio = (CdIo_t *) NULL;
|
||||
};
|
||||
|
||||
// Other member functions
|
||||
#include "device.hpp"
|
||||
#include "disc.hpp"
|
||||
#include "read.hpp"
|
||||
|
||||
private:
|
||||
CdIo_t *p_cdio;
|
||||
};
|
||||
|
||||
#endif /* __CDIO_HPP__ */
|
||||
91
include/cdio++/cdtext.hpp
Normal file
91
include/cdio++/cdtext.hpp
Normal file
@@ -0,0 +1,91 @@
|
||||
/*
|
||||
$Id: cdtext.hpp,v 1.1 2005/11/10 11:11:16 rocky Exp $
|
||||
|
||||
Copyright (C) 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
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
/** \file cdtext.hpp
|
||||
* \brief methods relating to CD-Text information. This file
|
||||
* should not be #included directly.
|
||||
*/
|
||||
|
||||
/*! Return string representation of the enum values above */
|
||||
const char *field2str (cdtext_field_t i)
|
||||
{
|
||||
return cdtext_field2str (i);
|
||||
}
|
||||
|
||||
/*! returns an allocated string associated with the given field. NULL is
|
||||
returned if key is CDTEXT_INVALID or the field is not set.
|
||||
|
||||
The user needs to free the string when done with it.
|
||||
|
||||
@see getConst to retrieve a constant string that doesn't
|
||||
have to be freed.
|
||||
|
||||
*/
|
||||
char *get (cdtext_field_t key)
|
||||
{
|
||||
return cdtext_get (key, p_cdtext);
|
||||
}
|
||||
|
||||
/*! returns the C cdtext_t pointer associated with this object. */
|
||||
cdtext_t *get ()
|
||||
{
|
||||
return p_cdtext;
|
||||
}
|
||||
|
||||
/*! returns a const string associated with the given field. NULL is
|
||||
returned if key is CDTEXT_INVALID or the field is not set.
|
||||
|
||||
Don't use the string when the cdtext object (i.e. the CdIo_t object
|
||||
you got it from) is no longer valid.
|
||||
|
||||
@see cdio_get to retrieve an allocated string that persists past the
|
||||
cdtext object.
|
||||
|
||||
*/
|
||||
const char *getConst (cdtext_field_t key)
|
||||
{
|
||||
return cdtext_get_const (key, p_cdtext);
|
||||
}
|
||||
|
||||
/*!
|
||||
returns enum of keyword if key is a CD-Text keyword,
|
||||
returns MAX_CDTEXT_FIELDS non-zero otherwise.
|
||||
*/
|
||||
cdtext_field_t isKeyword (const char *key)
|
||||
{
|
||||
return cdtext_is_keyword (key);
|
||||
}
|
||||
|
||||
/*!
|
||||
sets cdtext's keyword entry to field
|
||||
*/
|
||||
void set (cdtext_field_t key, const char *value)
|
||||
{
|
||||
cdtext_set (key, value, p_cdtext);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Local variables:
|
||||
* c-file-style: "gnu"
|
||||
* tab-width: 8
|
||||
* indent-tabs-mode: nil
|
||||
* End:
|
||||
*/
|
||||
495
include/cdio++/device.hpp
Normal file
495
include/cdio++/device.hpp
Normal file
@@ -0,0 +1,495 @@
|
||||
/* -*- C++ -*-
|
||||
$Id: device.hpp,v 1.1 2005/11/10 11:11:16 rocky Exp $
|
||||
|
||||
Copyright (C) 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
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
/** \file device.hpp
|
||||
*
|
||||
* \brief C++ header for driver- or device-related libcdio calls.
|
||||
* ("device" includes CD-image reading devices.)
|
||||
*/
|
||||
|
||||
/*!
|
||||
Free resources associated with CD-ROM Device/Image. After this we
|
||||
must do another open before any more reading.
|
||||
*/
|
||||
bool
|
||||
close()
|
||||
{
|
||||
cdio_destroy(p_cdio);
|
||||
p_cdio = (CdIo_t *) NULL;
|
||||
return true;
|
||||
}
|
||||
|
||||
/*!
|
||||
Close media tray in CD drive if there is a routine to do so.
|
||||
|
||||
@param psz_drive the name of CD-ROM to be closed.
|
||||
@param driver_id is the driver to be used or that got used if
|
||||
it was DRIVER_UNKNOWN or DRIVER_DEVICE; If this is NULL, we won't
|
||||
report back the driver used.
|
||||
*/
|
||||
driver_return_code_t closeTray (const char *psz_drive,
|
||||
/*in/out*/ driver_id_t &driver_id)
|
||||
{
|
||||
return cdio_close_tray (psz_drive, &driver_id);
|
||||
}
|
||||
|
||||
|
||||
/*!
|
||||
Close media tray in CD drive if there is a routine to do so.
|
||||
|
||||
@param psz_drive the name of CD-ROM to be closed.
|
||||
*/
|
||||
driver_return_code_t closeTray (const char *psz_drive)
|
||||
{
|
||||
driver_id_t driver_id = DRIVER_UNKNOWN;
|
||||
return closeTray(psz_drive, driver_id);
|
||||
}
|
||||
|
||||
|
||||
/*!
|
||||
Eject media in CD drive if there is a routine to do so.
|
||||
|
||||
If the CD is ejected, object is destroyed.
|
||||
*/
|
||||
driver_return_code_t
|
||||
ejectMedia ()
|
||||
{
|
||||
return cdio_eject_media(&p_cdio);
|
||||
}
|
||||
|
||||
/*!
|
||||
Eject media in CD drive if there is a routine to do so.
|
||||
|
||||
If the CD is ejected, object is destroyed.
|
||||
*/
|
||||
driver_return_code_t
|
||||
ejectMedia (const char *psz_drive)
|
||||
{
|
||||
return cdio_eject_media_drive(psz_drive);
|
||||
}
|
||||
|
||||
/*!
|
||||
Get a string decribing driver_id.
|
||||
|
||||
@param driver_id the driver you want the description for
|
||||
@return a sring of driver description
|
||||
*/
|
||||
const char *
|
||||
driverDescribe (driver_id_t driver_id)
|
||||
{
|
||||
return cdio_driver_describe(driver_id);
|
||||
}
|
||||
|
||||
/*!
|
||||
Free device list returned by GetDevices
|
||||
|
||||
@param device_list list returned by GetDevices
|
||||
|
||||
@see GetDevices
|
||||
|
||||
*/
|
||||
void
|
||||
freeDeviceList (char * device_list[])
|
||||
{
|
||||
cdio_free_device_list(device_list);
|
||||
}
|
||||
|
||||
/*!
|
||||
Get the value associatied with key.
|
||||
|
||||
@param key the key to retrieve
|
||||
@return the value associatd with "key" or NULL if p_cdio is NULL
|
||||
or "key" does not exist.
|
||||
*/
|
||||
const char *
|
||||
getArg (const char key[])
|
||||
{
|
||||
return cdio_get_arg (p_cdio, key);
|
||||
}
|
||||
|
||||
/*!
|
||||
Return an opaque CdIo_t pointer for the given track object.
|
||||
*/
|
||||
CdIo_t *getCdIo()
|
||||
{
|
||||
return p_cdio;
|
||||
}
|
||||
|
||||
/*!
|
||||
Return an opaque CdIo_t pointer for the given track object.
|
||||
*/
|
||||
cdtext_t *getCdtext(track_t i_track)
|
||||
{
|
||||
return cdio_get_cdtext (p_cdio, i_track);
|
||||
}
|
||||
|
||||
/*!
|
||||
Get the default CD device.
|
||||
|
||||
@return a string containing the default CD device or NULL is
|
||||
if we couldn't get a default device.
|
||||
|
||||
In some situations of drivers or OS's we can't find a CD device if
|
||||
there is no media in it and it is possible for this routine to return
|
||||
NULL even though there may be a hardware CD-ROM.
|
||||
*/
|
||||
char *
|
||||
getDefaultDevice ()
|
||||
{
|
||||
return cdio_get_default_device(p_cdio);
|
||||
}
|
||||
|
||||
/*!
|
||||
Return a string containing the default CD device if none is specified.
|
||||
if p_driver_id is DRIVER_UNKNOWN or DRIVER_DEVICE
|
||||
then find a suitable one set the default device for that.
|
||||
|
||||
NULL is returned if we couldn't get a default device.
|
||||
*/
|
||||
char *
|
||||
getDefaultDevice(/*in/out*/ driver_id_t &driver_id)
|
||||
{
|
||||
return cdio_get_default_device_driver(&driver_id);
|
||||
}
|
||||
|
||||
/*! Return an array of device names. If you want a specific
|
||||
devices for a driver, give that device. If you want hardware
|
||||
devices, give DRIVER_DEVICE and if you want all possible devices,
|
||||
image drivers and hardware drivers give DRIVER_UNKNOWN.
|
||||
|
||||
NULL is returned if we couldn't return a list of devices.
|
||||
|
||||
In some situations of drivers or OS's we can't find a CD device if
|
||||
there is no media in it and it is possible for this routine to return
|
||||
NULL even though there may be a hardware CD-ROM.
|
||||
*/
|
||||
char **
|
||||
getDevices(driver_id_t driver_id)
|
||||
{
|
||||
return cdio_get_devices(driver_id);
|
||||
}
|
||||
|
||||
/*! Like GetDevices above, but we may change the p_driver_id if we
|
||||
were given DRIVER_DEVICE or DRIVER_UNKNOWN. This is because
|
||||
often one wants to get a drive name and then *open* it
|
||||
afterwards. Giving the driver back facilitates this, and speeds
|
||||
things up for libcdio as well.
|
||||
*/
|
||||
|
||||
char **
|
||||
getDevices (driver_id_t &driver_id)
|
||||
{
|
||||
return cdio_get_devices_ret(&driver_id);
|
||||
}
|
||||
|
||||
/*!
|
||||
Get an array of device names in search_devices that have at least
|
||||
the capabilities listed by the capabities parameter. If
|
||||
search_devices is NULL, then we'll search all possible CD drives.
|
||||
|
||||
If "b_any" is set false then every capability listed in the
|
||||
extended portion of capabilities (i.e. not the basic filesystem)
|
||||
must be satisified. If "any" is set true, then if any of the
|
||||
capabilities matches, we call that a success.
|
||||
|
||||
To find a CD-drive of any type, use the mask CDIO_FS_MATCH_ALL.
|
||||
|
||||
@return the array of device names or NULL if we couldn't get a
|
||||
default device. It is also possible to return a non NULL but
|
||||
after dereferencing the the value is NULL. This also means nothing
|
||||
was found.
|
||||
*/
|
||||
char **
|
||||
getDevices(/*in*/ char *ppsz_search_devices[],
|
||||
cdio_fs_anal_t capabilities, bool b_any)
|
||||
{
|
||||
return cdio_get_devices_with_cap(ppsz_search_devices, capabilities, b_any);
|
||||
}
|
||||
|
||||
/*!
|
||||
Like GetDevices above but we return the driver we found
|
||||
as well. This is because often one wants to search for kind of drive
|
||||
and then *open* it afterwards. Giving the driver back facilitates this,
|
||||
and speeds things up for libcdio as well.
|
||||
*/
|
||||
char **
|
||||
getDevices(/*in*/ char* ppsz_search_devices[],
|
||||
cdio_fs_anal_t capabilities, bool b_any,
|
||||
/*out*/ driver_id_t &driver_id)
|
||||
{
|
||||
return cdio_get_devices_with_cap_ret(ppsz_search_devices, capabilities,
|
||||
b_any, &driver_id);
|
||||
}
|
||||
|
||||
|
||||
/*!
|
||||
Get the what kind of device we've got.
|
||||
|
||||
@param p_read_cap pointer to return read capabilities
|
||||
@param p_write_cap pointer to return write capabilities
|
||||
@param p_misc_cap pointer to return miscellaneous other capabilities
|
||||
|
||||
In some situations of drivers or OS's we can't find a CD device if
|
||||
there is no media in it and it is possible for this routine to return
|
||||
NULL even though there may be a hardware CD-ROM.
|
||||
*/
|
||||
void
|
||||
getDriveCap (cdio_drive_read_cap_t &read_cap,
|
||||
cdio_drive_write_cap_t &write_cap,
|
||||
cdio_drive_misc_cap_t &misc_cap)
|
||||
{
|
||||
cdio_get_drive_cap(p_cdio, &read_cap, &write_cap, &misc_cap);
|
||||
}
|
||||
|
||||
/*!
|
||||
Get the drive capabilities for a specified device.
|
||||
|
||||
@return a list of device capabilities.
|
||||
|
||||
In some situations of drivers or OS's we can't find a CD device if
|
||||
there is no media in it and it is possible for this routine to return
|
||||
NULL even though there may be a hardware CD-ROM.
|
||||
*/
|
||||
void
|
||||
getDriveCap (const char *device,
|
||||
cdio_drive_read_cap_t &read_cap,
|
||||
cdio_drive_write_cap_t &write_cap,
|
||||
cdio_drive_misc_cap_t &misc_cap)
|
||||
{
|
||||
cdio_get_drive_cap(p_cdio, &read_cap, &write_cap, &misc_cap);
|
||||
}
|
||||
|
||||
/*!
|
||||
Get a string containing the name of the driver in use.
|
||||
|
||||
@return a string with driver name or NULL if CdIo_t is NULL (we
|
||||
haven't initialized a specific device.
|
||||
*/
|
||||
const char *
|
||||
getDriverName ()
|
||||
{
|
||||
return cdio_get_driver_name(p_cdio);
|
||||
}
|
||||
|
||||
/*!
|
||||
Get the driver id.
|
||||
if CdIo_t is NULL (we haven't initialized a specific device driver),
|
||||
then return DRIVER_UNKNOWN.
|
||||
|
||||
@return the driver id..
|
||||
*/
|
||||
driver_id_t
|
||||
getDriverId ()
|
||||
{
|
||||
return cdio_get_driver_id(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
|
||||
getHWinfo ( /*out*/ cdio_hwinfo_t &hw_info )
|
||||
{
|
||||
return cdio_get_hwinfo(p_cdio, &hw_info);
|
||||
}
|
||||
|
||||
/*! Get the LSN of the first track of the last session of
|
||||
on the CD.
|
||||
|
||||
@param i_last_session pointer to the session number to be returned.
|
||||
*/
|
||||
driver_return_code_t
|
||||
getLastSession (/*out*/ lsn_t &i_last_session)
|
||||
{
|
||||
return cdio_get_last_session(p_cdio, &i_last_session);
|
||||
}
|
||||
|
||||
/*!
|
||||
Find out if media has changed since the last call.
|
||||
@return 1 if media has changed since last call, 0 if not. Error
|
||||
return codes are the same as driver_return_code_t
|
||||
*/
|
||||
int
|
||||
getMediaChanged()
|
||||
{
|
||||
return cdio_get_media_changed(p_cdio);
|
||||
}
|
||||
|
||||
/*! True if CD-ROM understand ATAPI commands. */
|
||||
bool_3way_t
|
||||
haveATAPI ()
|
||||
{
|
||||
return cdio_have_atapi(p_cdio);
|
||||
}
|
||||
|
||||
/*! Like cdio_have_xxx but uses an enumeration instead. */
|
||||
bool
|
||||
haveDriver (driver_id_t driver_id)
|
||||
{
|
||||
return cdio_have_driver(driver_id);
|
||||
}
|
||||
|
||||
/*!
|
||||
|
||||
Sets up to read from the device specified by psz_source. An open
|
||||
routine should be called before using any read routine. If device
|
||||
object was previously opened it is "closed".
|
||||
|
||||
@return true if open succeeded or false if error.
|
||||
|
||||
*/
|
||||
bool
|
||||
open(const char *psz_source)
|
||||
{
|
||||
if (p_cdio) cdio_destroy(p_cdio);
|
||||
p_cdio = cdio_open_cd(psz_source);
|
||||
return NULL != p_cdio ;
|
||||
}
|
||||
|
||||
/*!
|
||||
Sets up to read from the device specified by psz_source and
|
||||
driver_id. An open routine should be called before using any read
|
||||
routine. If device object was previously opened it is "closed".
|
||||
|
||||
@return true if open succeeded or false if error.
|
||||
*/
|
||||
bool
|
||||
open (const char *psz_source, driver_id_t driver_id)
|
||||
{
|
||||
if (p_cdio) cdio_destroy(p_cdio);
|
||||
p_cdio = cdio_open(psz_source, driver_id);
|
||||
return NULL != p_cdio ;
|
||||
}
|
||||
|
||||
/*!
|
||||
|
||||
Sets up to read from the device specified by psz_source and access
|
||||
mode. An open routine should be called before using any read
|
||||
routine. If device object was previously opened it is "closed".
|
||||
|
||||
@return true if open succeeded or false if error.
|
||||
*/
|
||||
bool
|
||||
open (const char *psz_source, driver_id_t driver_id,
|
||||
const char *psz_access_mode)
|
||||
{
|
||||
if (p_cdio) cdio_destroy(p_cdio);
|
||||
p_cdio = cdio_open_am(psz_source, driver_id, psz_access_mode);
|
||||
return NULL != p_cdio ;
|
||||
}
|
||||
|
||||
/*!
|
||||
|
||||
Determine if bin_name is the bin file part of a CDRWIN CD disk image.
|
||||
|
||||
@param bin_name location of presumed CDRWIN bin image file.
|
||||
@return the corresponding CUE file if bin_name is a BIN file or
|
||||
NULL if not a BIN file.
|
||||
*/
|
||||
char *
|
||||
isBinFile(const char *bin_name)
|
||||
{
|
||||
return cdio_is_binfile(bin_name);
|
||||
}
|
||||
|
||||
/*!
|
||||
Determine if cue_name is the cue sheet for a CDRWIN CD disk image.
|
||||
|
||||
@return corresponding BIN file if cue_name is a CDRWIN cue file or
|
||||
NULL if not a CUE file.
|
||||
*/
|
||||
char *
|
||||
isCueFile(const char *cue_name)
|
||||
{
|
||||
return cdio_is_cuefile(cue_name);
|
||||
}
|
||||
|
||||
/*!
|
||||
Determine if psg_nrg is a Nero CD disk image.
|
||||
|
||||
@param psz_nrg location of presumed NRG image file.
|
||||
@return true if psz_nrg is a Nero NRG image or false
|
||||
if not a NRG image.
|
||||
*/
|
||||
bool
|
||||
isNero(const char *psz_nrg)
|
||||
{
|
||||
return cdio_is_nrg(psz_nrg);
|
||||
}
|
||||
|
||||
/*!
|
||||
Determine if psg_toc is a TOC file for a cdrdao CD disk image.
|
||||
|
||||
@param psz_toc location of presumed TOC image file.
|
||||
@return true if toc_name is a cdrdao TOC file or false
|
||||
if not a TOC file.
|
||||
*/
|
||||
bool
|
||||
isTocFile(const char *psz_toc)
|
||||
{
|
||||
return cdio_is_tocfile(psz_toc);
|
||||
}
|
||||
|
||||
/*!
|
||||
Determine if psz_source refers to a real hardware CD-ROM.
|
||||
|
||||
@param psz_source location name of object
|
||||
@param driver_id driver for reading object. Use DRIVER_UNKNOWN if you
|
||||
don't know what driver to use.
|
||||
@return true if psz_source is a device; If false is returned we
|
||||
could have a CD disk image.
|
||||
*/
|
||||
bool
|
||||
isDevice(const char *psz_source, driver_id_t driver_id)
|
||||
{
|
||||
return cdio_is_device(psz_source, driver_id);
|
||||
}
|
||||
|
||||
/*!
|
||||
Set the blocksize for subsequent reads.
|
||||
*/
|
||||
driver_return_code_t
|
||||
setBlocksize ( int i_blocksize )
|
||||
{
|
||||
return cdio_set_blocksize ( p_cdio, i_blocksize );
|
||||
}
|
||||
|
||||
/*!
|
||||
Set the drive speed.
|
||||
*/
|
||||
driver_return_code_t
|
||||
setSpeed ( int i_speed )
|
||||
{
|
||||
return cdio_set_speed ( p_cdio, i_speed );
|
||||
}
|
||||
|
||||
/*!
|
||||
Set the arg "key" with "value" in "p_cdio".
|
||||
|
||||
@param key the key to set
|
||||
@param value the value to assocaiate with key
|
||||
*/
|
||||
driver_return_code_t
|
||||
setArg (const char key[], const char value[])
|
||||
{
|
||||
return cdio_set_arg (p_cdio, key, value);
|
||||
}
|
||||
|
||||
107
include/cdio++/devices.hpp
Normal file
107
include/cdio++/devices.hpp
Normal file
@@ -0,0 +1,107 @@
|
||||
/* -*- C++ -*-
|
||||
$Id: devices.hpp,v 1.1 2005/11/10 11:11:16 rocky Exp $
|
||||
|
||||
Copyright (C) 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
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
/** \file devices.hpp
|
||||
*
|
||||
* \brief methods relating to getting lists of devices. This file
|
||||
* should not be #included directly.
|
||||
*/
|
||||
/*!
|
||||
Free device list returned by GetDevices
|
||||
|
||||
@param device_list list returned by GetDevices
|
||||
|
||||
@see GetDevices
|
||||
|
||||
*/
|
||||
void
|
||||
freeDeviceList (char * device_list[])
|
||||
{
|
||||
cdio_free_device_list(device_list);
|
||||
}
|
||||
|
||||
/*! Return an array of device names. If you want a specific
|
||||
devices for a driver, give that device. If you want hardware
|
||||
devices, give DRIVER_DEVICE and if you want all possible devices,
|
||||
image drivers and hardware drivers give DRIVER_UNKNOWN.
|
||||
|
||||
NULL is returned if we couldn't return a list of devices.
|
||||
|
||||
In some situations of drivers or OS's we can't find a CD device if
|
||||
there is no media in it and it is possible for this routine to return
|
||||
NULL even though there may be a hardware CD-ROM.
|
||||
*/
|
||||
char **
|
||||
getDevices(driver_id_t driver_id)
|
||||
{
|
||||
return cdio_get_devices(driver_id);
|
||||
}
|
||||
|
||||
/*! Like GetDevices above, but we may change the p_driver_id if we
|
||||
were given DRIVER_DEVICE or DRIVER_UNKNOWN. This is because
|
||||
often one wants to get a drive name and then *open* it
|
||||
afterwards. Giving the driver back facilitates this, and speeds
|
||||
things up for libcdio as well.
|
||||
*/
|
||||
|
||||
char **
|
||||
getDevices (driver_id_t &driver_id)
|
||||
{
|
||||
return cdio_get_devices_ret(&driver_id);
|
||||
}
|
||||
|
||||
/*!
|
||||
Get an array of device names in search_devices that have at least
|
||||
the capabilities listed by the capabities parameter. If
|
||||
search_devices is NULL, then we'll search all possible CD drives.
|
||||
|
||||
If "b_any" is set false then every capability listed in the
|
||||
extended portion of capabilities (i.e. not the basic filesystem)
|
||||
must be satisified. If "any" is set true, then if any of the
|
||||
capabilities matches, we call that a success.
|
||||
|
||||
To find a CD-drive of any type, use the mask CDIO_FS_MATCH_ALL.
|
||||
|
||||
@return the array of device names or NULL if we couldn't get a
|
||||
default device. It is also possible to return a non NULL but
|
||||
after dereferencing the the value is NULL. This also means nothing
|
||||
was found.
|
||||
*/
|
||||
char **
|
||||
getDevices(/*in*/ char *ppsz_search_devices[],
|
||||
cdio_fs_anal_t capabilities, bool b_any)
|
||||
{
|
||||
return cdio_get_devices_with_cap(ppsz_search_devices, capabilities, b_any);
|
||||
}
|
||||
|
||||
/*!
|
||||
Like GetDevices above but we return the driver we found
|
||||
as well. This is because often one wants to search for kind of drive
|
||||
and then *open* it afterwards. Giving the driver back facilitates this,
|
||||
and speeds things up for libcdio as well.
|
||||
*/
|
||||
char **
|
||||
getDevices(/*in*/ char* ppsz_search_devices[],
|
||||
cdio_fs_anal_t capabilities, bool b_any,
|
||||
/*out*/ driver_id_t &driver_id)
|
||||
{
|
||||
return cdio_get_devices_with_cap_ret(ppsz_search_devices, capabilities,
|
||||
b_any, &driver_id);
|
||||
}
|
||||
175
include/cdio++/disc.hpp
Normal file
175
include/cdio++/disc.hpp
Normal file
@@ -0,0 +1,175 @@
|
||||
/* -*- C++ -*-
|
||||
$Id: disc.hpp,v 1.1 2005/11/10 11:11:16 rocky Exp $
|
||||
|
||||
Copyright (C) 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
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
/** \file disc.hpp
|
||||
* \brief methods relating to getting Compact Disc information. This file
|
||||
* should not be #included directly.
|
||||
*/
|
||||
|
||||
/*!
|
||||
Get disc mode - the kind of CD (CD-DA, CD-ROM mode 1, CD-MIXED, etc.
|
||||
that we've got. The notion of "CD" is extended a little to include
|
||||
DVD's.
|
||||
*/
|
||||
discmode_t getDiscmode ()
|
||||
{
|
||||
return cdio_get_discmode(p_cdio);
|
||||
}
|
||||
|
||||
/*!
|
||||
Get the lsn of the end of the CD
|
||||
|
||||
@return the lsn. On error 0 or CDIO_INVALD_LSN.
|
||||
*/
|
||||
lsn_t getDiscLastLsn()
|
||||
{
|
||||
return cdio_get_disc_last_lsn(p_cdio);
|
||||
}
|
||||
|
||||
/*!
|
||||
Get the number of the first track.
|
||||
|
||||
@return a track object or NULL;
|
||||
on error.
|
||||
*/
|
||||
CdioTrack *getFirstTrack()
|
||||
{
|
||||
track_t i_track = cdio_get_first_track_num(p_cdio);
|
||||
return (CDIO_INVALID_TRACK != i_track)
|
||||
? new CdioTrack(p_cdio, i_track)
|
||||
: (CdioTrack *) NULL;
|
||||
}
|
||||
|
||||
/*!
|
||||
Get the number of the first track.
|
||||
|
||||
@return the track number or CDIO_INVALID_TRACK
|
||||
on error.
|
||||
*/
|
||||
track_t getFirstTrackNum()
|
||||
{
|
||||
return cdio_get_first_track_num(p_cdio);
|
||||
}
|
||||
|
||||
|
||||
/*!
|
||||
Get the number of the first track.
|
||||
|
||||
@return a track object or NULL;
|
||||
on error.
|
||||
*/
|
||||
CdioTrack *getLastTrack()
|
||||
{
|
||||
track_t i_track = cdio_get_last_track_num(p_cdio);
|
||||
return (CDIO_INVALID_TRACK != i_track)
|
||||
? new CdioTrack(p_cdio, i_track)
|
||||
: (CdioTrack *) NULL;
|
||||
}
|
||||
|
||||
/*!
|
||||
Get the number of the first track.
|
||||
|
||||
@return the track number or CDIO_INVALID_TRACK
|
||||
on error.
|
||||
*/
|
||||
track_t getLastTrackNum()
|
||||
{
|
||||
return cdio_get_last_track_num(p_cdio);
|
||||
}
|
||||
|
||||
/*!
|
||||
Return the Joliet level recognized for p_cdio.
|
||||
*/
|
||||
uint8_t getJolietLevel()
|
||||
{
|
||||
return cdio_get_joliet_level(p_cdio);
|
||||
}
|
||||
|
||||
/*!
|
||||
Get the media catalog number (MCN) from the CD.
|
||||
|
||||
@return the media catalog number r NULL if there is none or we
|
||||
don't have the ability to get it.
|
||||
|
||||
Note: string is malloc'd so caller has to free() the returned
|
||||
string when done with it.
|
||||
|
||||
*/
|
||||
char * getMcn ()
|
||||
{
|
||||
return cdio_get_mcn (p_cdio);
|
||||
}
|
||||
|
||||
/*!
|
||||
Get the number of tracks on the CD.
|
||||
|
||||
@return the number of tracks, or CDIO_INVALID_TRACK if there is
|
||||
an error.
|
||||
*/
|
||||
track_t getNumTracks ()
|
||||
{
|
||||
return cdio_get_num_tracks(p_cdio);
|
||||
}
|
||||
|
||||
/*! Find the track which contans lsn.
|
||||
CDIO_INVALID_TRACK is returned if the lsn outside of the CD or
|
||||
if there was some error.
|
||||
|
||||
If the lsn is before the pregap of the first track 0 is returned.
|
||||
Otherwise we return the track that spans the lsn.
|
||||
*/
|
||||
CdioTrack *getTrackFromNum(track_t i_track)
|
||||
{
|
||||
return new CdioTrack(p_cdio, i_track);
|
||||
}
|
||||
|
||||
/*! Find the track which contans lsn.
|
||||
CDIO_INVALID_TRACK is returned if the lsn outside of the CD or
|
||||
if there was some error.
|
||||
|
||||
If the lsn is before the pregap of the first track 0 is returned.
|
||||
Otherwise we return the track that spans the lsn.
|
||||
*/
|
||||
CdioTrack *getTrackFromLsn(lsn_t lsn)
|
||||
{
|
||||
track_t i_track = cdio_get_track(p_cdio, lsn);
|
||||
return (CDIO_INVALID_TRACK != i_track)
|
||||
? new CdioTrack(p_cdio, i_track)
|
||||
: (CdioTrack *) NULL;
|
||||
}
|
||||
|
||||
|
||||
/*!
|
||||
Return true if discmode is some sort of CD.
|
||||
*/
|
||||
bool isDiscmodeCdrom (discmode_t discmode) {
|
||||
return cdio_is_discmode_cdrom(discmode);
|
||||
}
|
||||
|
||||
|
||||
/*!
|
||||
Return true if discmode is some sort of DVD.
|
||||
*/
|
||||
bool isDiscmodeDvd (discmode_t discmode)
|
||||
{
|
||||
return cdio_is_discmode_dvd (discmode) ;
|
||||
}
|
||||
|
||||
|
||||
158
include/cdio++/read.hpp
Normal file
158
include/cdio++/read.hpp
Normal file
@@ -0,0 +1,158 @@
|
||||
/* -*- C++ -*-
|
||||
$Id: read.hpp,v 1.1 2005/11/10 11:11:16 rocky Exp $
|
||||
|
||||
Copyright (C) 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
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
/** \file read.hpp
|
||||
*
|
||||
* \brief methods relating to reading blocks of Compact Discs. This file
|
||||
* should not be #included directly.
|
||||
*/
|
||||
|
||||
/*!
|
||||
Reposition read offset
|
||||
Similar to (if not the same as) libc's lseek()
|
||||
|
||||
@param offset amount to seek
|
||||
@param whence like corresponding parameter in libc's lseek, e.g.
|
||||
SEEK_SET or SEEK_END.
|
||||
@return (off_t) -1 on error.
|
||||
*/
|
||||
|
||||
off_t lseek(off_t offset, int whence)
|
||||
{
|
||||
return cdio_lseek(p_cdio, offset, whence);
|
||||
}
|
||||
|
||||
/*!
|
||||
Reads into buf the next size bytes.
|
||||
Similar to (if not the same as) libc's read()
|
||||
|
||||
@param p_buf place to read data into. The caller should make sure
|
||||
this location can store at least i_size bytes.
|
||||
@param i_size number of bytes to read
|
||||
|
||||
@return (ssize_t) -1 on error.
|
||||
*/
|
||||
ssize_t read(void *p_buf, size_t i_size)
|
||||
{
|
||||
return cdio_read(p_cdio, p_buf, i_size);
|
||||
}
|
||||
|
||||
/*!
|
||||
Reads a number of sectors (AKA blocks).
|
||||
|
||||
@param p_buf place to read data into. The caller should make sure
|
||||
this location is large enough. See below for size information.
|
||||
@param read_mode the kind of "mode" to use in reading.
|
||||
@param i_lsn sector to read
|
||||
@param i_blocks number of sectors to read
|
||||
@return DRIVER_OP_SUCCESS (0) if no error, other (negative) enumerations
|
||||
are returned on error.
|
||||
|
||||
If read_mode is CDIO_MODE_AUDIO,
|
||||
*p_buf should hold at least CDIO_FRAMESIZE_RAW * i_blocks bytes.
|
||||
|
||||
If read_mode is CDIO_MODE_DATA,
|
||||
*p_buf should hold at least i_blocks times either ISO_BLOCKSIZE,
|
||||
M1RAW_SECTOR_SIZE or M2F2_SECTOR_SIZE depending on the kind of
|
||||
sector getting read. If you don't know whether you have a Mode 1/2,
|
||||
Form 1/ Form 2/Formless sector best to reserve space for the maximum
|
||||
which is M2RAW_SECTOR_SIZE.
|
||||
|
||||
If read_mode is CDIO_MODE_M2F1,
|
||||
*p_buf should hold at least M2RAW_SECTOR_SIZE * i_blocks bytes.
|
||||
|
||||
If read_mode is CDIO_MODE_M2F2,
|
||||
*p_buf should hold at least CDIO_CD_FRAMESIZE * i_blocks bytes.
|
||||
|
||||
|
||||
*/
|
||||
|
||||
driver_return_code_t readSectors(void *p_buf, lsn_t i_lsn,
|
||||
cdio_read_mode_t read_mode, uint32_t i_blocks)
|
||||
{
|
||||
return cdio_read_sectors(p_cdio, p_buf, i_lsn, read_mode, i_blocks);
|
||||
}
|
||||
|
||||
/** The special case of reading a single block is a common one so we
|
||||
provide a routine for that as a convenience.
|
||||
*/
|
||||
driver_return_code_t readSector(void *p_buf, lsn_t i_lsn,
|
||||
cdio_read_mode_t read_mode)
|
||||
{
|
||||
return cdio_read_sectors(p_cdio, p_buf, i_lsn, read_mode, 1);
|
||||
}
|
||||
|
||||
|
||||
/*!
|
||||
Reads a number of data sectors (AKA blocks).
|
||||
|
||||
@param p_buf place to read data into. The caller should make sure
|
||||
this location is large enough. See below for size information.
|
||||
|
||||
*p_buf should hold at least i_blocks times either ISO_BLOCKSIZE,
|
||||
M1RAW_SECTOR_SIZE or M2F2_SECTOR_SIZE depending on the kind of
|
||||
sector getting read. If you don't know whether you have a Mode 1/2,
|
||||
Form 1/ Form 2/Formless sector best to reserve space for the maximum
|
||||
which is M2RAW_SECTOR_SIZE.
|
||||
|
||||
@param i_lsn sector to read
|
||||
|
||||
@param i_blocksize size of block. Should be either CDIO_CD_FRAMESIZE,
|
||||
M2RAW_SECTOR_SIZE, or M2F2_SECTOR_SIZE. See comment above under p_buf.
|
||||
|
||||
@param i_blocks number of sectors to read
|
||||
|
||||
@return DRIVER_OP_SUCCESS (0) if no error, other (negative) enumerations
|
||||
are returned on error.
|
||||
|
||||
*/
|
||||
|
||||
driver_return_code_t readDataBlocks(void *p_buf, lsn_t i_lsn,
|
||||
uint16_t i_blocksize, uint32_t i_blocks)
|
||||
{
|
||||
return cdio_read_data_sectors (p_cdio, p_buf, i_lsn, i_blocksize, i_blocks);
|
||||
}
|
||||
|
||||
/** The special case of reading a single block is a common one so we
|
||||
provide a routine for that as a convenience.
|
||||
|
||||
@param p_buf place to read data into. The caller should make sure
|
||||
this location is large enough. See below for size information.
|
||||
|
||||
*p_buf should hold at least i_blocks times either ISO_BLOCKSIZE,
|
||||
M1RAW_SECTOR_SIZE or M2F2_SECTOR_SIZE depending on the kind of
|
||||
sector getting read. If you don't know whether you have a Mode 1/2,
|
||||
Form 1/ Form 2/Formless sector best to reserve space for the maximum
|
||||
which is M2RAW_SECTOR_SIZE.
|
||||
|
||||
@param i_lsn sector to read
|
||||
|
||||
@param i_blocksize size of block. Should be either CDIO_CD_FRAMESIZE,
|
||||
M2RAW_SECTOR_SIZE, or M2F2_SECTOR_SIZE. See comment above under p_buf.
|
||||
|
||||
@return DRIVER_OP_SUCCESS (0) if no error, other (negative) enumerations
|
||||
are returned on error.
|
||||
|
||||
*/
|
||||
driver_return_code_t readDataBlock(void *p_buf, lsn_t i_lsn,
|
||||
uint16_t i_blocksize)
|
||||
{
|
||||
return readDataBlocks(p_buf, i_lsn, i_blocksize, 1);
|
||||
}
|
||||
148
include/cdio++/track.hpp
Normal file
148
include/cdio++/track.hpp
Normal file
@@ -0,0 +1,148 @@
|
||||
/* -*- C++ -*-
|
||||
$Id: track.hpp,v 1.1 2005/11/10 11:11:16 rocky Exp $
|
||||
|
||||
Copyright (C) 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
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
/** \file track.hpp
|
||||
* \brief methods relating to getting Compact Discs. This file
|
||||
* should not be #included directly.
|
||||
*/
|
||||
|
||||
/*!
|
||||
Return an opaque CdIo_t pointer for the given track object.
|
||||
*/
|
||||
CdIo_t *getCdIo()
|
||||
{
|
||||
return p_cdio;
|
||||
}
|
||||
|
||||
/*!
|
||||
Get CD-Text information for a CdIo_t object.
|
||||
|
||||
@return the CD-Text object or NULL if obj is NULL
|
||||
or CD-Text information does not exist.
|
||||
*/
|
||||
cdtext_t *getCdtext ()
|
||||
{
|
||||
return cdio_get_cdtext (p_cdio, i_track);
|
||||
}
|
||||
|
||||
/*! Return number of channels in track: 2 or 4; -2 if not
|
||||
implemented or -1 for error.
|
||||
Not meaningful if track is not an audio track.
|
||||
*/
|
||||
int getChannels()
|
||||
{
|
||||
return cdio_get_track_channels(p_cdio, i_track);
|
||||
}
|
||||
|
||||
/*! Return copy protection status on a track. Is this meaningful
|
||||
if not an audio track?
|
||||
*/
|
||||
track_flag_t getCopyPermit()
|
||||
{
|
||||
return cdio_get_track_copy_permit(p_cdio, i_track);
|
||||
}
|
||||
|
||||
/*!
|
||||
Get the format (audio, mode2, mode1) of track.
|
||||
*/
|
||||
track_format_t getFormat()
|
||||
{
|
||||
return cdio_get_track_format(p_cdio, i_track);
|
||||
}
|
||||
|
||||
/*!
|
||||
Return true if we have XA data (green, mode2 form1) or
|
||||
XA data (green, mode2 form2). That is track begins:
|
||||
sync - header - subheader
|
||||
12 4 - 8
|
||||
|
||||
FIXME: there's gotta be a better design for this and get_track_format?
|
||||
*/
|
||||
bool getGreen()
|
||||
{
|
||||
return cdio_get_track_green(p_cdio, i_track);
|
||||
}
|
||||
|
||||
/*!
|
||||
Return the ending LSN. CDIO_INVALID_LSN is returned on error.
|
||||
*/
|
||||
lsn_t getLastLsn()
|
||||
{
|
||||
return cdio_get_track_last_lsn(p_cdio, i_track);
|
||||
}
|
||||
|
||||
/*!
|
||||
Get the starting LBA.
|
||||
|
||||
@return the starting LBA or CDIO_INVALID_LBA on error.
|
||||
*/
|
||||
lba_t getLba()
|
||||
{
|
||||
return cdio_get_track_lba(p_cdio, i_track);
|
||||
}
|
||||
|
||||
/*!
|
||||
@return the starting LSN or CDIO_INVALID_LSN on error.
|
||||
*/
|
||||
lsn_t getLsn()
|
||||
{
|
||||
return cdio_get_track_lsn(p_cdio, i_track);
|
||||
}
|
||||
|
||||
|
||||
/*!
|
||||
Return the starting MSF (minutes/secs/frames) for track number
|
||||
i_track in p_cdio.
|
||||
|
||||
@return true if things worked or false if there is no track entry.
|
||||
*/
|
||||
bool getMsf(/*out*/ msf_t &msf)
|
||||
{
|
||||
return cdio_get_track_msf(p_cdio, i_track,/*out*/ &msf);
|
||||
}
|
||||
|
||||
/*!
|
||||
Return the track number of the track object.
|
||||
*/
|
||||
track_t getTrackNum()
|
||||
{
|
||||
return i_track;
|
||||
}
|
||||
|
||||
/*! Get linear preemphasis status on an audio track
|
||||
This is not meaningful if not an audio track?
|
||||
*/
|
||||
track_flag_t getPreemphasis()
|
||||
{
|
||||
return cdio_get_track_preemphasis(p_cdio, i_track);
|
||||
}
|
||||
|
||||
/*!
|
||||
Get the number of sectors between this track an the next. This
|
||||
includes any pregap sectors before the start of the next track.
|
||||
|
||||
@return the number of sectors or 0 if there is an error.
|
||||
*/
|
||||
unsigned int getSecCount()
|
||||
{
|
||||
return cdio_get_track_sec_count(p_cdio, i_track);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user