File indexing completed on 2024-05-05 09:02:43
0001 /* 0002 SPDX-FileCopyrightText: 2006-2009 Sebastian Trueg <trueg@k3b.org> 0003 SPDX-FileCopyrightText: 1998-2009 Sebastian Trueg <trueg@k3b.org> 0004 0005 SPDX-License-Identifier: GPL-2.0-or-later 0006 */ 0007 0008 #ifndef _K3B_VIDEODVD_H_ 0009 #define _K3B_VIDEODVD_H_ 0010 0011 #include "k3bvideodvdtitle.h" 0012 0013 #include "k3b_export.h" 0014 0015 #include <QString> 0016 #include <QVector> 0017 0018 0019 namespace K3b { 0020 namespace Device { 0021 class Device; 0022 } 0023 0024 /** 0025 * The VideoDVD classes do not provide a complete playback frontend to 0026 * libdvdread but are merely intended for Video DVD analysis. 0027 * 0028 * They are title based and thus treat a Video DVD to be a set of titles. 0029 * Additional Video DVD constructs such as title sets, parts of titles (chapters), 0030 * program chains, or cells are not handled explicitly. 0031 * 0032 * The usage is very simple. One creates a VideoDVD instance and calls the open() 0033 * method with a device containing a Video DVD. If the method returns true the 0034 * analysis was successful and the structures are filled. 0035 * 0036 * After open() has returned the device has already been closed. 0037 */ 0038 namespace VideoDVD 0039 { 0040 /** 0041 * libdvdread wrapper class 0042 */ 0043 class LIBK3B_EXPORT VideoDVD 0044 { 0045 public: 0046 VideoDVD(); 0047 ~VideoDVD(); 0048 0049 /** 0050 * \return true if a Video DVD was successfully opened via open() 0051 */ 0052 bool valid() const; 0053 0054 /** 0055 * Open a video dvd and parse it's contents. The device will be closed after this 0056 * method returns, regardless of it's success. 0057 */ 0058 bool open( Device::Device* dev ); 0059 0060 Device::Device* device() const { return m_device; } 0061 const QString& volumeIdentifier() const { return m_volumeIdentifier; } 0062 unsigned int numTitles() const { return m_titles.count(); } 0063 0064 /** 0065 * Get a title from the Video DVD. Index starts at 0. 0066 */ 0067 const Title& title( unsigned int num ) const; 0068 const Title& operator[]( unsigned int num ) const; 0069 0070 void debug() const; 0071 0072 private: 0073 Device::Device* m_device; 0074 QVector<Title> m_titles; 0075 QString m_volumeIdentifier; 0076 }; 0077 0078 LIBK3B_EXPORT QString audioFormatString( int format ); 0079 LIBK3B_EXPORT QString audioCodeExtensionString( int ext ); 0080 LIBK3B_EXPORT QString subPictureCodeModeString( int mode ); 0081 LIBK3B_EXPORT QString subPictureCodeExtensionString( int ext ); 0082 } 0083 } 0084 0085 #endif