Solid::OpticalDrive Class

class Solid::OpticalDrive

This device interface is available on CD-R*,DVD*,Blu-Ray,HD-DVD drives. More...

Header: #include <Solid/OpticalDrive>
CMake: find_package(KF6 REQUIRED COMPONENTS Solid)
target_link_libraries(mytarget PRIVATE KF6::Solid)
Inherits: Solid::StorageDrive

Public Types

enum MediumType { UnknownMediumType, Cdr, Cdrw, Dvd, Dvdr, …, HdDvdrw }
flags MediumTypes

Properties

Public Functions

bool eject()
int readSpeed() const
Solid::OpticalDrive::MediumTypes supportedMedia() const
int writeSpeed() const
QList<int> writeSpeeds() const

Signals

void ejectDone(Solid::ErrorType error, QVariant errorData, const QString &udi)
void ejectPressed(const QString &udi)
void ejectRequested(const QString &udi)

Static Public Members

Solid::DeviceInterface::Type deviceInterfaceType()

Detailed Description

An OpticalDrive is a storage that can handle optical discs.

Member Type Documentation

enum OpticalDrive::MediumType
flags OpticalDrive::MediumTypes

This enum type defines the type of medium an optical drive supports.

ConstantValueDescription
Solid::OpticalDrive::UnknownMediumType0x00000 
Solid::OpticalDrive::Cdr0x00001A Recordable Compact Disc (CD-R)
Solid::OpticalDrive::Cdrw0x00002A ReWritable Compact Disc (CD-RW)
Solid::OpticalDrive::Dvd0x00004A Digital Versatile Disc (DVD)
Solid::OpticalDrive::Dvdr0x00008A Recordable Digital Versatile Disc (DVD-R)
Solid::OpticalDrive::Dvdrw0x00010A ReWritable Digital Versatile Disc (DVD-RW)
Solid::OpticalDrive::Dvdram0x00020A Random Access Memory Digital Versatile Disc (DVD-RAM)
Solid::OpticalDrive::Dvdplusr0x00040A Recordable Digital Versatile Disc (DVD+R)
Solid::OpticalDrive::Dvdplusrw0x00080A ReWritable Digital Versatile Disc (DVD+RW)
Solid::OpticalDrive::Dvdplusdl0x00100A Dual Layer Digital Versatile Disc (DVD+R DL)
Solid::OpticalDrive::Dvdplusdlrw0x00200A Dual Layer Digital Versatile Disc (DVD+RW DL)
Solid::OpticalDrive::Bd0x00400A Blu-ray Disc (BD)
Solid::OpticalDrive::Bdr0x00800A Blu-ray Disc Recordable (BD-R)
Solid::OpticalDrive::Bdre0x01000A Blu-ray Disc Recordable and Eraseable (BD-RE)
Solid::OpticalDrive::HdDvd0x02000A High Density Digital Versatile Disc (HD DVD)
Solid::OpticalDrive::HdDvdr0x04000A High Density Digital Versatile Disc Recordable (HD DVD-R)
Solid::OpticalDrive::HdDvdrw0x08000A High Density Digital Versatile Disc ReWritable (HD DVD-RW)

The MediumTypes type is a typedef for QFlags<MediumType>. It stores an OR combination of MediumType values.

Property Documentation

[read-only] readSpeed : const int

Access functions:

int readSpeed() const

[read-only] supportedMedia : const MediumTypes

Access functions:

Solid::OpticalDrive::MediumTypes supportedMedia() const

[read-only] writeSpeed : const int

Access functions:

int writeSpeed() const

[read-only] writeSpeeds : const QList<int>

Access functions:

QList<int> writeSpeeds() const

Member Function Documentation

[static] Solid::DeviceInterface::Type OpticalDrive::deviceInterfaceType()

Get the Solid::DeviceInterface::Type of the OpticalDrive device interface.

Returns the OpticalDrive device interface type

See also Solid::Ifaces::Enums::DeviceInterface::Type.

bool OpticalDrive::eject()

Ejects any disc that could be contained in this drive. If this drive is empty, but has a tray it'll be opened.

Returns the status of the eject operation

[signal] void OpticalDrive::ejectDone(Solid::ErrorType error, QVariant errorData, const QString &udi)

This signal is emitted when the attempted eject process on this drive is completed. The signal might be spontaneous, i.e. it can be triggered by another process.

error type of error that occurred, if any

errorData more information about the error, if any

udi the UDI of the volume

[signal] void OpticalDrive::ejectPressed(const QString &udi)

This signal is emitted when the eject button is pressed on the drive.

Please note that some (broken) drives doesn't report this event.

udi the UDI of the drive

[signal] void OpticalDrive::ejectRequested(const QString &udi)

This signal is emitted when eject on this drive is requested. The signal might be spontaneous, i.e. it can be triggered by another process.

udi the UDI of the volume

int OpticalDrive::readSpeed() const

Retrieves the maximum read speed of this drive in kilobytes per second.

Returns the maximum read speed

Note: Getter function for property readSpeed.

Solid::OpticalDrive::MediumTypes OpticalDrive::supportedMedia() const

Retrieves the medium types this drive supports.

Returns the flag set indicating the supported medium types

Note: Getter function for property supportedMedia.

int OpticalDrive::writeSpeed() const

Retrieves the maximum write speed of this drive in kilobytes per second.

Returns the maximum write speed

Note: Getter function for property writeSpeed.

QList<int> OpticalDrive::writeSpeeds() const

Retrieves the list of supported write speeds of this drive in kilobytes per second.

Returns the list of supported write speeds

Note: Getter function for property writeSpeeds.