Description of a DVD media. More...
Signals | |
void | closed () |
Emitted when the DVD media is closed. More... | |
void | newMedia (const QString &volumeId) |
Emitted when a new DVD media is open. More... | |
Public Member Functions | |
QtsDvdMedia (const QString &fileName=QString(), QtlLogger *log=0, QObject *parent=0, bool useMaxReadSpeed=false) | |
Constructor. More... | |
~QtsDvdMedia () | |
Destructor. More... | |
QList< QtsDvdFilePtr > | allFiles () const |
Get the list of all files on the DVD media. More... | |
void | close () |
Close a DVD media. More... | |
QString | deviceName () const |
Get the device name of the DVD reader containing the DVD media. More... | |
bool | isEncrypted () const |
Check if the DVD media is encrypted. More... | |
bool | isOpen () const |
Check if a DVD media was successfully open. More... | |
bool | loadAllEncryptionKeys () |
Load all encryption keys into the cache of libdvdcss. More... | |
QtlLogger * | log () const |
Get the message logger. More... | |
int | nextSector () const |
Get the position of the next sector to read. More... | |
bool | openFromDevice (const QString &deviceName, bool useMaxReadSpeed=false) |
Open and load the description of a DVD media starting from its device name. More... | |
bool | openFromFile (const QString &fileName, bool useMaxReadSpeed=false) |
Open and load the description of a DVD media starting from a file on the DVD. More... | |
int | readSectors (void *buffer, int count, int position=-1, Qts::BadSectorPolicy badSectorPolicy=Qts::SkipBadSectors) |
Read a given number of sectors from the DVD media. More... | |
QtsDvdDirectory | rootDirectory () const |
Get a description of the root directory. More... | |
QString | rootName () const |
Get the root directory name of the DVD (ie mount point). More... | |
QtsDvdFile | searchFile (const QString &fileName, Qt::CaseSensitivity cs=Qt::CaseInsensitive) const |
Locate a file in the DVD. More... | |
bool | seekSector (int position) |
Set the position of the next sector to read. More... | |
QString | volumeId () const |
Get the volume identifier of the DVD. More... | |
int | volumeSizeInSectors () const |
Get the volume size (in sectors) of the DVD. More... | |
int | vtsCount () const |
Get the number of Video Title Sets (VTS) on the DVD. More... | |
QtsDvdFile | vtsInformationFile (int vtsNumber) const |
Get the description of a Video Title Set information file on the DVD. More... | |
QString | vtsInformationFileName (int vtsNumber) const |
Build the full path name of a Video Title Set information file on the DVD. More... | |
QtsDvdFile | vtsVideoFile (int vtsNumber, int vobIndex) const |
Get the description of a Video Title Set video file on the DVD. More... | |
QString | vtsVideoFileName (int vtsNumber, int vobIndex) const |
Build the full path name of a Video Title Set video file on the DVD. More... | |
Static Public Member Functions | |
static int | vtsInformationFileNumber (const QString &fileName) |
Check if a file name matches a Video Title Set information file (VTS_nn_0.IFO). More... | |
Private Member Functions | |
bool | readDirectoryStructure (QtsDvdDirectory &dir, int depth, bool inRoot, bool inVideoTs) |
Read the file structure under the specified directory. More... | |
Private Attributes | |
QList< QtsDvdFilePtr > | _allFiles |
List of all files on DVD. More... | |
QList< QtsDvdFilePtr >::ConstIterator | _currentFile |
File area where _nextSector is. More... | |
QString | _deviceName |
DVD device name. More... | |
struct dvdcss_s * | _dvdcss |
Handle to libdvdcss (don't include dvdcss.h in this .h). More... | |
bool | _isOpen |
Is fully open and ready. More... | |
QtlLogger * | _log |
Where to log errors. More... | |
int | _nextSector |
Next sector to read. More... | |
QtlNullLogger | _nullLog |
Dummy null logger if none specified by caller. More... | |
QtsDvdDirectory | _rootDirectory |
Description of root directory. More... | |
QString | _rootName |
DVD root directory (ie. mount point). More... | |
QString | _volumeId |
Volume identifier. More... | |
int | _volumeSize |
Volume size in sectors. More... | |
int | _vtsCount |
Number of video title sets. More... | |
Description of a DVD media.
QtsDvdMedia::QtsDvdMedia | ( | const QString & | fileName = QString() , |
QtlLogger * | log = 0 , |
||
QObject * | parent = 0 , |
||
bool | useMaxReadSpeed = false |
||
) |
Constructor.
[in] | fileName | Name of a file or directory anywhere on the DVD media. |
[in] | log | Where to log errors. |
[in] | parent | Optional parent widget. |
[in] | useMaxReadSpeed | If true, try to set the DVD reader to maximum speed. |
QtsDvdMedia::~QtsDvdMedia | ( | ) |
Destructor.
|
inline |
Get the message logger.
bool QtsDvdMedia::openFromFile | ( | const QString & | fileName, |
bool | useMaxReadSpeed = false |
||
) |
Open and load the description of a DVD media starting from a file on the DVD.
The description of the file structure is also loaded.
[in] | fileName | Name of a file or directory anywhere on the DVD media. |
[in] | useMaxReadSpeed | If true, try to set the DVD reader to maximum speed. |
bool QtsDvdMedia::openFromDevice | ( | const QString & | deviceName, |
bool | useMaxReadSpeed = false |
||
) |
Open and load the description of a DVD media starting from its device name.
[in] | deviceName | Name of the device containing the DVD media. |
[in] | useMaxReadSpeed | If true, try to set the DVD reader to maximum speed. |
void QtsDvdMedia::close | ( | ) |
Close a DVD media.
|
inline |
Check if a DVD media was successfully open.
bool QtsDvdMedia::isEncrypted | ( | ) | const |
Check if the DVD media is encrypted.
|
inline |
Get the root directory name of the DVD (ie mount point).
This information is only available if the DVD was open using a constructor or openFromFile().
|
inline |
Get the device name of the DVD reader containing the DVD media.
|
inline |
Get the volume identifier of the DVD.
|
inline |
Get the volume size (in sectors) of the DVD.
bool QtsDvdMedia::seekSector | ( | int | position | ) |
Set the position of the next sector to read.
[in] | position | Index of the next sector to read. Valid values are in the range 0 to volumeSizeInSectors()-1. |
|
inline |
Get the position of the next sector to read.
int QtsDvdMedia::readSectors | ( | void * | buffer, |
int | count, | ||
int | position = -1 , |
||
Qts::BadSectorPolicy | badSectorPolicy = Qts::SkipBadSectors |
||
) |
Read a given number of sectors from the DVD media.
[out] | buffer | Where to read sectors into. Must be at least as large as 2048 x count bytes. |
[in] | count | Number of sectors to read. |
[in] | position | Index of the sector where to seek first. Read at current sector if negative. Valid values are in the range 0 to volumeSizeInSectors()-1. |
[in] | badSectorPolicy | How to handle bad sectors. |
|
inline |
Get the number of Video Title Sets (VTS) on the DVD.
|
inline |
Get a description of the root directory.
Can be used to describe the complete file system on DVD.
QtsDvdFile QtsDvdMedia::searchFile | ( | const QString & | fileName, |
Qt::CaseSensitivity | cs = Qt::CaseInsensitive |
||
) | const |
Locate a file in the DVD.
[in] | fileName | Name of the file to locate. It the absolute path name of the file starts with the mount point of the DVD, then only the relative part is used. Otherwise, the fileName must be a path relative to the DVD root directory. |
[in] | cs | Case sensitivity when looking for file names. |
QString QtsDvdMedia::vtsInformationFileName | ( | int | vtsNumber | ) | const |
Build the full path name of a Video Title Set information file on the DVD.
[in] | vtsNumber | VTS number. It is not necessary that the VTS exists. |
QString QtsDvdMedia::vtsVideoFileName | ( | int | vtsNumber, |
int | vobIndex | ||
) | const |
Build the full path name of a Video Title Set video file on the DVD.
[in] | vtsNumber | VTS number. It is not necessary that the VTS exists. |
[in] | vobIndex | Index of the VOB file, starting at 1. |
QtsDvdFile QtsDvdMedia::vtsInformationFile | ( | int | vtsNumber | ) | const |
Get the description of a Video Title Set information file on the DVD.
[in] | vtsNumber | VTS number. |
QtsDvdFile QtsDvdMedia::vtsVideoFile | ( | int | vtsNumber, |
int | vobIndex | ||
) | const |
Get the description of a Video Title Set video file on the DVD.
[in] | vtsNumber | VTS number. |
[in] | vobIndex | Index of the VOB file, starting at 1. |
|
static |
Check if a file name matches a Video Title Set information file (VTS_nn_0.IFO).
[in] | fileName | File name. |
|
inline |
Get the list of all files on the DVD media.
The list is sorted by physical placement of files on the media. Non-file space (meta-data, directories, unused space) is represented by "place holders", ie. QtsDvdFile with an empty file name.
bool QtsDvdMedia::loadAllEncryptionKeys | ( | ) |
Load all encryption keys into the cache of libdvdcss.
|
signal |
Emitted when a new DVD media is open.
[in] | volumeId | Volume identifier of the new media. |
|
signal |
Emitted when the DVD media is closed.
|
private |
Read the file structure under the specified directory.
[in,out] | dir | A directory to update. |
[in] | depth | Depth in the file system. |
[in] | inRoot | True when dir is the root directory of the DVD. |
[in] | inVideoTs | True when dir is VIDEO_TS. |
|
private |
Dummy null logger if none specified by caller.
|
private |
Where to log errors.
|
private |
Is fully open and ready.
|
private |
DVD device name.
|
private |
DVD root directory (ie. mount point).
|
private |
Volume identifier.
|
private |
Volume size in sectors.
|
private |
Number of video title sets.
|
private |
Handle to libdvdcss (don't include dvdcss.h in this .h).
|
private |
Next sector to read.
|
private |
Description of root directory.
|
private |
List of all files on DVD.
|
private |
File area where _nextSector is.