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

A class which describes an optical disc drive in the system. More...

Public Member Functions

 QtlOpticalDrive ()
 Constructor. More...
 
QString burnerDeviceName () const
 Get the drive device name for burning media. More...
 
bool canReadBluRay () const
 Check if the drive can read Blu-Ray media. More...
 
bool canReadCd () const
 Check if the drive can read CD media. More...
 
bool canReadDvd () const
 Check if the drive can read DVD media. More...
 
bool canWriteBluRay () const
 Check if the drive can write Blu-Ray media. More...
 
bool canWriteCd () const
 Check if the drive can write CD media. More...
 
bool canWriteDvd () const
 Check if the drive can write DVD media. More...
 
QString deviceName () const
 Get the drive device name. More...
 
bool isValid () const
 Check if a drive is valid, ie. More...
 
QString name () const
 Get the drive name. More...
 
QString productId () const
 Get the device product id. More...
 
QString productRevision () const
 Get the device product revision. More...
 
QString vendorId () const
 Get the device vendor id. More...
 

Static Public Member Functions

static QtlOpticalDrive firstBluRayReader ()
 Locate the first Blu-Ray reader in the system. More...
 
static QtlOpticalDrive firstBluRayWriter ()
 Locate the first Blu-Ray writer in the system. More...
 
static QtlOpticalDrive firstCdReader ()
 Locate the first CD reader in the system. More...
 
static QtlOpticalDrive firstCdWriter ()
 Locate the first CD writer in the system. More...
 
static QtlOpticalDrive firstDvdReader ()
 Locate the first DVD reader in the system. More...
 
static QtlOpticalDrive firstDvdWriter ()
 Locate the first DVD writer in the system. More...
 
static QList< QtlOpticalDrivegetAllDrives ()
 Get the list of all optical drives in the system. More...
 
static QtlOpticalDrive getDrive (const QString &name)
 Get the description of a drive. More...
 

Static Private Member Functions

static QtlOpticalDrive firstDriveWithCheck (bool QtlOpticalDrive::*check)
 Locate the first drive in the system matching a boolean member. More...
 
static bool lessThanByName (const QtlOpticalDrive &o1, const QtlOpticalDrive &o2)
 A function helper to sort optical drives by name. More...
 
static void updateCapability (QList< QtlOpticalDrive > &drives, const QStringList &fields, bool QtlOpticalDrive::*capability)
 Update a boolean field in all elements in an array of QtlOpticalDrive. More...
 

Private Attributes

QString _burnerDeviceName
 Drive device name for burning operations. More...
 
bool _canReadBluRay
 The drive can read Blu-Ray media. More...
 
bool _canReadCd
 The drive can read CD media. More...
 
bool _canReadDvd
 The drive can read DVD media. More...
 
bool _canWriteBluRay
 The drive can write Blu-Ray media. More...
 
bool _canWriteCd
 The drive can write CD media. More...
 
bool _canWriteDvd
 The drive can write DVD media. More...
 
QString _deviceName
 Drive device name. More...
 
QString _name
 Drive name. More...
 
QString _productId
 Device product id. More...
 
QString _productRevision
 Device product revision. More...
 
QString _vendorId
 Device vendor id. More...
 

Detailed Description

A class which describes an optical disc drive in the system.

Limitation: Implemented on Windows, Mac and Linux only.

Constructor & Destructor Documentation

◆ QtlOpticalDrive()

QtlOpticalDrive::QtlOpticalDrive ( )

Constructor.

Member Function Documentation

◆ getAllDrives()

QList< QtlOpticalDrive > QtlOpticalDrive::getAllDrives ( )
static

Get the list of all optical drives in the system.

Returns
The list of all optical drives in the system.

◆ getDrive()

QtlOpticalDrive QtlOpticalDrive::getDrive ( const QString &  name)
static

Get the description of a drive.

Parameters
[in]nameA drive name as returned by name().
Returns
The description of the corresponding drive. If the drive is not found, isValid() will return false.

◆ isValid()

bool QtlOpticalDrive::isValid ( ) const
inline

Check if a drive is valid, ie.

contains the description of a real existing drive.

◆ name()

QString QtlOpticalDrive::name ( ) const
inline

Get the drive name.

All existing drives have a name. But, on Mac, a drive has no device name if the drive is empty. On Mac, a drive has a device name only when a media is inserted and when the media is ejected and another one inserted later, the device name may have changed.

Returns
The drive name.

◆ deviceName()

QString QtlOpticalDrive::deviceName ( ) const
inline

Get the drive device name.

Returns
The drive device name.
See also
burnerDeviceName()

◆ burnerDeviceName()

QString QtlOpticalDrive::burnerDeviceName ( ) const
inline

Get the drive device name for burning media.

On some systems like Mac OS X, the general device name of the drive to mount a device deviceName() and the device name to burn a media in the drive is not the same.

Returns
The drive device name.
See also
deviceName()

◆ vendorId()

QString QtlOpticalDrive::vendorId ( ) const
inline

Get the device vendor id.

Returns
The device vendor id.

◆ productId()

QString QtlOpticalDrive::productId ( ) const
inline

Get the device product id.

Returns
The device product id.

◆ productRevision()

QString QtlOpticalDrive::productRevision ( ) const
inline

Get the device product revision.

Returns
The device product revision.

◆ canReadCd()

bool QtlOpticalDrive::canReadCd ( ) const
inline

Check if the drive can read CD media.

Returns
True if the drive can read CD media, false otherwise.

◆ canWriteCd()

bool QtlOpticalDrive::canWriteCd ( ) const
inline

Check if the drive can write CD media.

Returns
True if the drive can write CD media, false otherwise.

◆ canReadDvd()

bool QtlOpticalDrive::canReadDvd ( ) const
inline

Check if the drive can read DVD media.

Returns
True if the drive can read DVD media, false otherwise.

◆ canWriteDvd()

bool QtlOpticalDrive::canWriteDvd ( ) const
inline

Check if the drive can write DVD media.

Returns
True if the drive can write DVD media, false otherwise.

◆ canReadBluRay()

bool QtlOpticalDrive::canReadBluRay ( ) const
inline

Check if the drive can read Blu-Ray media.

Returns
True if the drive can read Blu-Ray media, false otherwise.

◆ canWriteBluRay()

bool QtlOpticalDrive::canWriteBluRay ( ) const
inline

Check if the drive can write Blu-Ray media.

Returns
True if the drive can write Blu-Ray media, false otherwise.

◆ firstCdReader()

static QtlOpticalDrive QtlOpticalDrive::firstCdReader ( )
inlinestatic

Locate the first CD reader in the system.

Returns
The located drive or an invalid object if none was found.

◆ firstCdWriter()

static QtlOpticalDrive QtlOpticalDrive::firstCdWriter ( )
inlinestatic

Locate the first CD writer in the system.

Returns
The located drive or an invalid object if none was found.

◆ firstDvdReader()

static QtlOpticalDrive QtlOpticalDrive::firstDvdReader ( )
inlinestatic

Locate the first DVD reader in the system.

Returns
The located drive or an invalid object if none was found.

◆ firstDvdWriter()

static QtlOpticalDrive QtlOpticalDrive::firstDvdWriter ( )
inlinestatic

Locate the first DVD writer in the system.

Returns
The located drive or an invalid object if none was found.

◆ firstBluRayReader()

static QtlOpticalDrive QtlOpticalDrive::firstBluRayReader ( )
inlinestatic

Locate the first Blu-Ray reader in the system.

Returns
The located drive or an invalid object if none was found.

◆ firstBluRayWriter()

static QtlOpticalDrive QtlOpticalDrive::firstBluRayWriter ( )
inlinestatic

Locate the first Blu-Ray writer in the system.

Returns
The located drive or an invalid object if none was found.

◆ firstDriveWithCheck()

QtlOpticalDrive QtlOpticalDrive::firstDriveWithCheck ( bool QtlOpticalDrive::*  check)
staticprivate

Locate the first drive in the system matching a boolean member.

Parameters
[in]checkPointer to bool member to check. Typically one of _canReadBluRay(), _canWriteDvd, etc.
Returns
The specified value in the located drive or an empty string if none is found.

◆ lessThanByName()

static bool QtlOpticalDrive::lessThanByName ( const QtlOpticalDrive o1,
const QtlOpticalDrive o2 
)
inlinestaticprivate

A function helper to sort optical drives by name.

Parameters
[in]o1First object to compare.
[in]o2Second object to compare.
Returns
True is o1 is logically less the o2.

◆ updateCapability()

static void QtlOpticalDrive::updateCapability ( QList< QtlOpticalDrive > &  drives,
const QStringList &  fields,
bool QtlOpticalDrive::*  capability 
)
staticprivate

Update a boolean field in all elements in an array of QtlOpticalDrive.

Parameters
[in,out]drivesArray of QtlOpticalDrive to update.
[in]fieldsArray of strings, one for each element in
  • drives. When a string is not empty and not "0", the capability is set. Otherwise, it is left unchanged.
[in]capabilityPointer to bool member to update. Typically one of _canReadBluRay(), _canWriteDvd, etc.

Member Data Documentation

◆ _name

QString QtlOpticalDrive::_name
private

Drive name.

◆ _deviceName

QString QtlOpticalDrive::_deviceName
private

Drive device name.

◆ _burnerDeviceName

QString QtlOpticalDrive::_burnerDeviceName
private

Drive device name for burning operations.

◆ _vendorId

QString QtlOpticalDrive::_vendorId
private

Device vendor id.

◆ _productId

QString QtlOpticalDrive::_productId
private

Device product id.

◆ _productRevision

QString QtlOpticalDrive::_productRevision
private

Device product revision.

◆ _canReadCd

bool QtlOpticalDrive::_canReadCd
private

The drive can read CD media.

◆ _canWriteCd

bool QtlOpticalDrive::_canWriteCd
private

The drive can write CD media.

◆ _canReadDvd

bool QtlOpticalDrive::_canReadDvd
private

The drive can read DVD media.

◆ _canWriteDvd

bool QtlOpticalDrive::_canWriteDvd
private

The drive can write DVD media.

◆ _canReadBluRay

bool QtlOpticalDrive::_canReadBluRay
private

The drive can read Blu-Ray media.

◆ _canWriteBluRay

bool QtlOpticalDrive::_canWriteBluRay
private

The drive can write Blu-Ray media.


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