QtlMovie 1.12 (A specialized FFmpeg front-end)
QtsDvdTitleSet Class Reference

Description of a "Title Set" in a DVD. More...

Public Member Functions

 QtsDvdTitleSet (const QString &fileName=QString(), QtlLogger *log=0)
 Constructor. More...
 
 QtsDvdTitleSet (const QtsDvdTitleSet &other)
 Copy constructor. More...
 
QtsDvdProgramChainList allTitles (int titleNumber) const
 Get the description of all sequential titles (or program chain, or PGC) in the title set. More...
 
int allTitlesDurationInSeconds (int titleNumber) const
 Get the duration of all sequential titles (or program chain, or PGC) in the title set. More...
 
void clear ()
 Clear object content. More...
 
QString deviceName () const
 Get the device name of the DVD reader containing the title set. More...
 
QString ifoFileName () const
 Get the full absolute file name of the IFO file for the title set. More...
 
bool isEncrypted () const
 Check if the title set is on an encrypted DVD media. More...
 
bool isLoaded () const
 Check if a title set was successfully loaded. More...
 
bool load (const QString &fileName=QString(), const QtsDvdMedia *dvd=0)
 Load the description of a title set. More...
 
int longestDurationInSeconds () const
 Get the longest duration of all sets of sequential titles in the title set. More...
 
int maximumAngleCount () const
 Get the maximum number of specific angles in all titles. More...
 
QtsDvdOriginalCellList originalCells () const
 Get the list of cells in original VOB files, before DVD production. More...
 
int originalVobCount () const
 Get the number of original input VOB's, before DVD production. More...
 
int streamCount () const
 Get the number of video, audio and subtitle streams in the title set. More...
 
QtlMediaStreamInfoList streams () const
 Get the description of all video, audio and subtitle streams in the title set. More...
 
QtsDvdProgramChainPtr title (int titleNumber) const
 Get the description of a given title (or program chain, or PGC) in the title set. More...
 
int titleCount () const
 Get the number of titles (or program chains, or PGC) in the title set. More...
 
int vobCount () const
 Get the number of VOB files for the title set. More...
 
QStringList vobFileNames () const
 Get the list of VOB files for the title set. More...
 
int vobSectorCount () const
 Get the total size in sectors of the MPEG content of the VTS. More...
 
qint64 vobSizeInBytes () const
 Get the total size in bytes of all VOB's. More...
 
int vobStartSector () const
 Get the first sector of the MPEG content of the VTS on DVD media. 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 vtsNumber () const
 Get the "title set number", ie the "nn" in "VTS_nn_0.IFO". More...
 

Static Public Member Functions

static bool isDvdTitleSetFileName (const QString &fileName)
 Check if a file is a .IFO or .VOB. More...
 
static bool lessThan (const QtlMediaStreamInfoPtr &p1, const QtlMediaStreamInfoPtr &p2)
 Compare two QtlMediaStreamInfoPtr for DVD stream ordering. More...
 

Private Member Functions

bool buildFileNames (const QString &fileName)
 Build the IFO and VOB file names for the VTS. More...
 
bool readVtsIfo ()
 Read the content of the VTS IFO. More...
 

Private Attributes

QString _deviceName
 DVD device name. More...
 
QString _ifoFileName
 IFO file name. More...
 
bool _isEncrypted
 DVD is encrypted, need libdvdcss. More...
 
QtlLogger_log
 Where to log errors. More...
 
QtlNullLogger _nullLog
 Dummy null logger if none specified by caller. More...
 
QtsDvdOriginalCellList _originalCells
 List of cells in original input files. More...
 
int _originalVobCount
 Number of original input VOB's, before DVD production. More...
 
QtsDvdProgramChainList _pgcs
 List program chains in the VTS. More...
 
QtlMediaStreamInfoList _streams
 List of streams in the VTS. More...
 
QStringList _vobFileNames
 List of VOB files. More...
 
qint64 _vobSizeInBytes
 Total size in bytes of all VOB's. More...
 
int _vobStartSector
 First sector of VOB files on DVD media. More...
 
QString _volumeId
 Volume identifier. More...
 
int _volumeSectors
 Volume size in sectors. More...
 
int _vtsNumber
 Title set number. More...
 

Detailed Description

Description of a "Title Set" in a DVD.

A "standard" DVD structure contains one or more "video title set" (VTS). Each VTS is a movie, documentary, bonus, etc. The VTS are numbered on two digits "nn" (01, 02, etc.) Each VTS contains the following files:

  • VTS_nn_0.IFO <- information file.
  • VTS_nn_0.VOB <- optional title set menu, not part of the movie.
  • VTS_nn_1.VOB <- first MPEG-PS file in the movie
  • VTS_nn_2.VOB
  • etc ...
  • VTS_nn_0.BUP <- optional backup units

The complete MPEG-PS content of the movie is simply the concatenation of all .VOB file. There are at most 9 VOB files per VTS (1GB per VOB).

The content of a VTS is physically contiguous on the DVD, starting from VTS_nn_0.VOB, VTS_nn_1.VOB, etc., ending with the VTS_nn_0.BUP.

Constructor & Destructor Documentation

◆ QtsDvdTitleSet() [1/2]

QtsDvdTitleSet::QtsDvdTitleSet ( const QString &  fileName = QString(),
QtlLogger log = 0 
)

Constructor.

Parameters
[in]fileNameName of the IFO file or name of one of the VOB files in the title set.
[in]logWhere to log errors.

◆ QtsDvdTitleSet() [2/2]

QtsDvdTitleSet::QtsDvdTitleSet ( const QtsDvdTitleSet other)
explicit

Copy constructor.

Parameters
[in]otherOther instance to copy (except parent).

Member Function Documentation

◆ load()

bool QtsDvdTitleSet::load ( const QString &  fileName = QString(),
const QtsDvdMedia dvd = 0 
)

Load the description of a title set.

Parameters
[in]fileNameName of the IFO file or name of one of the VOB files in the title set.
[in]dvdIf the caller already knows that the file is on a DVD media and this DVD media is already open, pass it as an optimization. This is optional, using 0 always works.
Returns
True on success, false on error.

◆ clear()

void QtsDvdTitleSet::clear ( )

Clear object content.

◆ isLoaded()

bool QtsDvdTitleSet::isLoaded ( ) const
inline

Check if a title set was successfully loaded.

Returns
True if this object contains a valid VTS description, false otherwise.

◆ vtsNumber()

int QtsDvdTitleSet::vtsNumber ( ) const
inline

Get the "title set number", ie the "nn" in "VTS_nn_0.IFO".

Returns
The title set number.

◆ titleCount()

int QtsDvdTitleSet::titleCount ( ) const
inline

Get the number of titles (or program chains, or PGC) in the title set.

Returns
The number of titles in the title set.

◆ title()

QtsDvdProgramChainPtr QtsDvdTitleSet::title ( int  titleNumber) const
inline

Get the description of a given title (or program chain, or PGC) in the title set.

Parameters
[in]titleNumberThe title number to get. The first title in the VTS is #1.
Returns
A smart pointer to the description of the title. Return a null pointer if titleNumber is invalid or if the description of the title was invalid.

◆ allTitles()

QtsDvdProgramChainList QtsDvdTitleSet::allTitles ( int  titleNumber) const

Get the description of all sequential titles (or program chain, or PGC) in the title set.

Sometimes, a PGC is not viewed alone, it can have a previous or next PCG to play in sequence. While title() returns only the description of a given title, allTitles() returns the list of all PGC's that should be played in sequence.

Parameters
[in]titleNumberA title number to get. The first title in the VTS is #1.
Returns
A list of smart pointers to the description of all titles in the chain containing the specified titleNumber. Return an empty list if titleNumber is invalid or if the description of the title was invalid. When the list is not empty, all pointers are not null.

◆ allTitlesDurationInSeconds()

int QtsDvdTitleSet::allTitlesDurationInSeconds ( int  titleNumber) const

Get the duration of all sequential titles (or program chain, or PGC) in the title set.

Parameters
[in]titleNumberA title number to get. The first title in the VTS is #1.
Returns
The total duration in seconds of all titles in the chain containing the specified titleNumber.

◆ longestDurationInSeconds()

int QtsDvdTitleSet::longestDurationInSeconds ( ) const

Get the longest duration of all sets of sequential titles in the title set.

For each title, we consider the full sequence, using its previous and next title.

Returns
The longest duration in seconds.

◆ maximumAngleCount()

int QtsDvdTitleSet::maximumAngleCount ( ) const

Get the maximum number of specific angles in all titles.

Returns
The maximum number of specific angles in all titles. If there is no specific angle, only common content as in most cases, return 0.

◆ ifoFileName()

QString QtsDvdTitleSet::ifoFileName ( ) const
inline

Get the full absolute file name of the IFO file for the title set.

Returns
The full absolute file name of the IFO file for the title set.

◆ vobCount()

int QtsDvdTitleSet::vobCount ( ) const
inline

Get the number of VOB files for the title set.

Returns
The number of VOB files for the title set.

◆ vobFileNames()

QStringList QtsDvdTitleSet::vobFileNames ( ) const
inline

Get the list of VOB files for the title set.

Returns
The list of VOB files for the title set. The returned list is sorted in replay order. All file names are full absolute paths.

◆ vobSizeInBytes()

qint64 QtsDvdTitleSet::vobSizeInBytes ( ) const
inline

Get the total size in bytes of all VOB's.

Returns
The total size in bytes of all VOB's.

◆ isEncrypted()

bool QtsDvdTitleSet::isEncrypted ( ) const
inline

Check if the title set is on an encrypted DVD media.

Returns
True if the title set is on an encrypted DVD media.

◆ deviceName()

QString QtsDvdTitleSet::deviceName ( ) const
inline

Get the device name of the DVD reader containing the title set.

The returned device name can be used by libdvdcss.

Returns
The device name or en empty string if no DVD reader was found.

◆ volumeId()

QString QtsDvdTitleSet::volumeId ( ) const
inline

Get the volume identifier of the DVD.

Returns
DVD volume identifier, empty if not on a DVD media.

◆ volumeSizeInSectors()

int QtsDvdTitleSet::volumeSizeInSectors ( ) const
inline

Get the volume size (in sectors) of the DVD.

Returns
DVD volume size (in sectors).

◆ vobStartSector()

int QtsDvdTitleSet::vobStartSector ( ) const
inline

Get the first sector of the MPEG content of the VTS on DVD media.

All VOB's of a given title set are always contiguous on a DVD media.

Returns
The first sector or -1 if the not on a DVD media.

◆ vobSectorCount()

int QtsDvdTitleSet::vobSectorCount ( ) const
inline

Get the total size in sectors of the MPEG content of the VTS.

Returns
The total size in sectors.

◆ streamCount()

int QtsDvdTitleSet::streamCount ( ) const
inline

Get the number of video, audio and subtitle streams in the title set.

Returns
The number of video, audio and subtitle streams in the title set.

◆ streams()

QtlMediaStreamInfoList QtsDvdTitleSet::streams ( ) const
inline

Get the description of all video, audio and subtitle streams in the title set.

Returns
A list of smart pointers to the description of all streams.

◆ originalVobCount()

int QtsDvdTitleSet::originalVobCount ( ) const
inline

Get the number of original input VOB's, before DVD production.

Returns
The number of original input VOB's, before DVD production.

◆ originalCells()

QtsDvdOriginalCellList QtsDvdTitleSet::originalCells ( ) const
inline

Get the list of cells in original VOB files, before DVD production.

This is different from the cells inside a Program Chain which describe a cell inside the VOB files of the DVD.

Returns
List of cells in original VOB files.

◆ isDvdTitleSetFileName()

bool QtsDvdTitleSet::isDvdTitleSetFileName ( const QString &  fileName)
static

Check if a file is a .IFO or .VOB.

Parameters
[in]fileNameName of a file.
Returns
True if the file name is valid for a .IFO or .VOB.

◆ lessThan()

bool QtsDvdTitleSet::lessThan ( const QtlMediaStreamInfoPtr p1,
const QtlMediaStreamInfoPtr p2 
)
static

Compare two QtlMediaStreamInfoPtr for DVD stream ordering.

We reorder stream in "DVD order" for user convenience.

Parameters
[in]p1First pointer.
[in]p2Second pointer.
Returns
True is p1 is logically less than p2.

◆ buildFileNames()

bool QtsDvdTitleSet::buildFileNames ( const QString &  fileName)
private

Build the IFO and VOB file names for the VTS.

Also compute the total VOB size.

Parameters
[in]fileNameName of the IFO file or name of one of the VOB files in the title set.
Returns
True on success, false on error.

◆ readVtsIfo()

bool QtsDvdTitleSet::readVtsIfo ( )
private

Read the content of the VTS IFO.

Returns
True on success, false on error.

Member Data Documentation

◆ _nullLog

QtlNullLogger QtsDvdTitleSet::_nullLog
private

Dummy null logger if none specified by caller.

◆ _log

QtlLogger* QtsDvdTitleSet::_log
private

Where to log errors.

◆ _deviceName

QString QtsDvdTitleSet::_deviceName
private

DVD device name.

◆ _volumeId

QString QtsDvdTitleSet::_volumeId
private

Volume identifier.

◆ _volumeSectors

int QtsDvdTitleSet::_volumeSectors
private

Volume size in sectors.

◆ _isEncrypted

bool QtsDvdTitleSet::_isEncrypted
private

DVD is encrypted, need libdvdcss.

◆ _vtsNumber

int QtsDvdTitleSet::_vtsNumber
private

Title set number.

◆ _ifoFileName

QString QtsDvdTitleSet::_ifoFileName
private

IFO file name.

◆ _vobFileNames

QStringList QtsDvdTitleSet::_vobFileNames
private

List of VOB files.

◆ _vobSizeInBytes

qint64 QtsDvdTitleSet::_vobSizeInBytes
private

Total size in bytes of all VOB's.

◆ _vobStartSector

int QtsDvdTitleSet::_vobStartSector
private

First sector of VOB files on DVD media.

◆ _originalVobCount

int QtsDvdTitleSet::_originalVobCount
private

Number of original input VOB's, before DVD production.

◆ _streams

QtlMediaStreamInfoList QtsDvdTitleSet::_streams
private

List of streams in the VTS.

◆ _pgcs

QtsDvdProgramChainList QtsDvdTitleSet::_pgcs
private

List program chains in the VTS.

◆ _originalCells

QtsDvdOriginalCellList QtsDvdTitleSet::_originalCells
private

List of cells in original input files.


The documentation for this class was generated from the following files: