Solid::OpticalDrive Class
class Solid::OpticalDriveThis 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
- readSpeed : int
- supportedMedia : MediumTypes
- writeSpeed : int
- writeSpeeds : QList<int>
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.
Commonly used in conjunction with OpticalDisk.
Member Type Documentation
enum OpticalDrive::MediumType
flags OpticalDrive::MediumTypes
This enum type defines the type of medium an optical drive supports.
| Constant | Value | Description |
|---|---|---|
Solid::OpticalDrive::UnknownMediumType | 0x00000 | |
Solid::OpticalDrive::Cdr | 0x00001 | A Recordable Compact Disc (CD-R) |
Solid::OpticalDrive::Cdrw | 0x00002 | A ReWritable Compact Disc (CD-RW) |
Solid::OpticalDrive::Dvd | 0x00004 | A Digital Versatile Disc (DVD) |
Solid::OpticalDrive::Dvdr | 0x00008 | A Recordable Digital Versatile Disc (DVD-R) |
Solid::OpticalDrive::Dvdrw | 0x00010 | A ReWritable Digital Versatile Disc (DVD-RW) |
Solid::OpticalDrive::Dvdram | 0x00020 | A Random Access Memory Digital Versatile Disc (DVD-RAM) |
Solid::OpticalDrive::Dvdplusr | 0x00040 | A Recordable Digital Versatile Disc (DVD+R) |
Solid::OpticalDrive::Dvdplusrw | 0x00080 | A ReWritable Digital Versatile Disc (DVD+RW) |
Solid::OpticalDrive::Dvdplusdl | 0x00100 | A Dual Layer Digital Versatile Disc (DVD+R DL) |
Solid::OpticalDrive::Dvdplusdlrw | 0x00200 | A Dual Layer Digital Versatile Disc (DVD+RW DL) |
Solid::OpticalDrive::Bd | 0x00400 | A Blu-ray Disc (BD) |
Solid::OpticalDrive::Bdr | 0x00800 | A Blu-ray Disc Recordable (BD-R) |
Solid::OpticalDrive::Bdre | 0x01000 | A Blu-ray Disc Recordable and Eraseable (BD-RE) |
Solid::OpticalDrive::HdDvd | 0x02000 | A High Density Digital Versatile Disc (HD DVD) |
Solid::OpticalDrive::HdDvdr | 0x04000 | A High Density Digital Versatile Disc Recordable (HD DVD-R) |
Solid::OpticalDrive::HdDvdrw | 0x08000 | A 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 : int
Access functions:
| int | readSpeed() const |
[read-only] supportedMedia : MediumTypes
Access functions:
| Solid::OpticalDrive::MediumTypes | supportedMedia() const |
[read-only] writeSpeed : int
Access functions:
| int | writeSpeed() const |
[read-only] writeSpeeds : QList<int>
Access functions:
| QList<int> | writeSpeeds() const |
Member Function Documentation
[static] Solid::DeviceInterface::Type OpticalDrive::deviceInterfaceType()
Returns the Solid::DeviceInterface::Type of the OpticalDrive device interface.
See also Solid::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 the drive with the given udi is completed.
The signal might be spontaneous, i.e. it can be triggered by another process.
Returns an error followed by additional errorData information, if any.
[signal] void OpticalDrive::ejectPressed(const QString &udi)
This signal is emitted when the eject button is pressed on the drive with the given udi.
Please note that some (broken) drives don't report this event.
[signal] void OpticalDrive::ejectRequested(const QString &udi)
This signal is emitted when eject on the drive with the given udi is requested.
The signal might be spontaneous, i.e. it can be triggered by another process.
int OpticalDrive::readSpeed() const
Returns the maximum read speed of this drive in kilobytes per second.
Note: Getter function for property readSpeed.
Solid::OpticalDrive::MediumTypes OpticalDrive::supportedMedia() const
Returns the flag set indicating the medium types this drive supports.
Note: Getter function for property supportedMedia.
int OpticalDrive::writeSpeed() const
Returns the maximum write speed of this drive in kilobytes per second.
Note: Getter function for property writeSpeed.
QList<int> OpticalDrive::writeSpeeds() const
Returns the list of supported write speeds of this drive in kilobytes per second.
Note: Getter function for property writeSpeeds.