Hi,
this patches adds the missing optical drive/disc values from HAL for all
Dual-Layer DVD, Blu-Ray and HD-DVD capabilities.
Changed also the DiscType enum to start with UnknownDiscType = -1 to be able
to extend the enum without break something.
Danny
kde4-kdelibs-solid-opticaldisc.diff:
backends/fakehw/fakeopticaldisc.cpp | 32 ++++++++++++++++++++++++++++++++
backends/hal/halopticaldisc.cpp | 32 ++++++++++++++++++++++++++++++++
opticaldisc.h | 18 +++++++++++++++---
3 files changed, 79 insertions(+), 3 deletions(-)
kde4-kdelibs-solid-opticaldrive.diff
backends/fakehw/fakecdrom.cpp | 7 +++++++
backends/hal/halcdrom.cpp | 7 +++++++
opticaldrive.h | 17 +++++++++++++----
3 files changed, 27 insertions(+), 4 deletions(-)
Index: opticaldisc.h
===================================================================
--- opticaldisc.h (Revision 659745)
+++ opticaldisc.h (Arbeitskopie)
@@ -66,6 +66,7 @@
/**
* This enum type defines the type of optical disc it can be.
*
+ * - UnknownDiscType : An undetermined disc type
* - CdRom : A Compact Disc Read-Only Memory (CD-ROM)
* - CdRecordable : A Compact Disc Recordable (CD-R)
* - CdRewritable : A Compact Disc ReWritable (CD-RW)
@@ -75,11 +76,22 @@
* - DvdRewritable : A Digital Versatile Disc ReWritable (DVD-RW)
* - DvdPlusRecordable : A Digital Versatile Disc Recordable (DVD+R)
* - DvdPlusRewritable : A Digital Versatile Disc ReWritable (DVD+RW)
- * - UnknownDiscType : An undetermined disc type
+ * - DvdPlusRecordableDuallayer : A Digital Versatile Disc Recordable Dual-Layer (DVD+R DL)
+ * - DvdPlusRewritableDuallayer : A Digital Versatile Disc ReWritable Dual-Layer (DVD+RW DL)
+ * - BluRayRom : A Blu-ray Disc (BD)
+ * - BluRayRecordable : A Blu-ray Disc Recordable (BD-R)
+ * - BluRayRewritable : A Blu-ray Disc (BD-RE)
+ * - HdDvdRom: A High Density Digital Versatile Disc (HD DVD)
+ * - HdDvdRecordable : A High Density Digital Versatile Disc Recordable (HD DVD-R)
+ * - HdDvdRewritable : A High Density Digital Versatile Disc ReWritable (HD DVD-RW)
*/
- enum DiscType { CdRom, CdRecordable, CdRewritable, DvdRom, DvdRam,
+ enum DiscType { UnknownDiscType = -1,
+ CdRom, CdRecordable, CdRewritable, DvdRom, DvdRam,
DvdRecordable, DvdRewritable,
- DvdPlusRecordable, DvdPlusRewritable, UnknownDiscType };
+ DvdPlusRecordable, DvdPlusRewritable,
+ DvdPlusRecordableDuallayer, DvdPlusRewritableDuallayer,
+ BluRayRom, BluRayRecordable, BluRayRewritable,
+ HdDvdRom, HdDvdRecordable, HdDvdRewritable };
/**
Index: backends/hal/halopticaldisc.cpp
===================================================================
--- backends/hal/halopticaldisc.cpp (Revision 659745)
+++ backends/hal/halopticaldisc.cpp (Arbeitskopie)
@@ -93,6 +93,38 @@
{
return Solid::OpticalDisc::DvdPlusRewritable;
}
+ else if (type == "dvd_plus_r_dl")
+ {
+ return Solid::OpticalDisc::DvdPlusRecordableDuallayer;
+ }
+ else if (type == "dvd_plus_rw_dl")
+ {
+ return Solid::OpticalDisc::DvdPlusRewritableDuallayer;
+ }
+ else if (type == "bd_rom")
+ {
+ return Solid::OpticalDisc::BluRayRom;
+ }
+ else if (type == "bd_r")
+ {
+ return Solid::OpticalDisc::BluRayRecordable;
+ }
+ else if (type == "bd_re")
+ {
+ return Solid::OpticalDisc::BluRayRewritable;
+ }
+ else if (type == "hddvd_rom")
+ {
+ return Solid::OpticalDisc::HdDvdRom;
+ }
+ else if (type == "hddvd_r")
+ {
+ return Solid::OpticalDisc::HdDvdRecordable;
+ }
+ else if (type == "hddvd_rw")
+ {
+ return Solid::OpticalDisc::HdDvdRewritable;
+ }
else
{
return Solid::OpticalDisc::UnknownDiscType;
Index: backends/fakehw/fakeopticaldisc.cpp
===================================================================
--- backends/fakehw/fakeopticaldisc.cpp (Revision 659745)
+++ backends/fakehw/fakeopticaldisc.cpp (Arbeitskopie)
@@ -96,6 +96,38 @@
{
return Solid::OpticalDisc::DvdPlusRewritable;
}
+ else if (type == "dvd_plus_r_dl")
+ {
+ return Solid::OpticalDisc::DvdPlusRecordableDuallayer;
+ }
+ else if (type == "dvd_plus_rw_dl")
+ {
+ return Solid::OpticalDisc::DvdPlusRewritableDuallayer;
+ }
+ else if (type == "bd_rom")
+ {
+ return Solid::OpticalDisc::BluRayRom;
+ }
+ else if (type == "bd_r")
+ {
+ return Solid::OpticalDisc::BluRayRecordable;
+ }
+ else if (type == "bd_re")
+ {
+ return Solid::OpticalDisc::BluRayRewritable;
+ }
+ else if (type == "hddvd_rom")
+ {
+ return Solid::OpticalDisc::HdDvdRom;
+ }
+ else if (type == "hddvd_r")
+ {
+ return Solid::OpticalDisc::HdDvdRecordable;
+ }
+ else if (type == "hddvd_rw")
+ {
+ return Solid::OpticalDisc::HdDvdRewritable;
+ }
else
{
return Solid::OpticalDisc::UnknownDiscType;
Index: opticaldrive.h
===================================================================
--- opticaldrive.h (Revision 659745)
+++ opticaldrive.h (Arbeitskopie)
@@ -59,11 +59,20 @@
* - Dvdplusr : A Recordable Digital Versatile Disc (DVD+R)
* - Dvdplusrw : A ReWritable Digital Versatile Disc (DVD+RW)
* - Dvdplusdl : A Dual Layer Digital Versatile Disc (DVD+R DL)
+ * - Dvdplusdlrw : A Dual Layer Digital Versatile Disc (DVD+RW DL)
+ * - Bd : A Blu-ray Disc (BD)
+ * - Bdr : A Blu-ray Disc Recordable (BD-R)
+ * - Bdre : A Blu-ray Disc (BD-RE)
+ * - HdDvd : A High Density Digital Versatile Disc (HD DVD)
+ * - HdDvdr : A High Density Digital Versatile Disc Recordable (HD DVD-R)
+ * - HdDvdrw : A High Density Digital Versatile Disc ReWritable (HD DVD-RW)
*/
- enum MediumType { Cdr=0x001, Cdrw=0x002, Dvd=0x004, Dvdr=0x008,
- Dvdrw=0x010, Dvdram=0x020, Dvdplusr=0x040,
- Dvdplusrw=0x080, Dvdplusdl=0x100 };
-
+ enum MediumType { Cdr=0x00001, Cdrw=0x00002, Dvd=0x00004, Dvdr=0x00008,
+ Dvdrw=0x00010, Dvdram=0x00020, Dvdplusr=0x00040,
+ Dvdplusrw=0x00080, Dvdplusdl=0x00100, Dvdplusdlrw=0x00200,
+ Bd=0x00400, Bdr=0x00800, Bdre=0x01000,
+ HdDvd=0x02000, HdDvdr=0x04000, HdDvdrw=0x08000 };
+
/**
* This type stores an OR combination of MediumType values.
*/
Index: backends/hal/halcdrom.cpp
===================================================================
--- backends/hal/halcdrom.cpp (Revision 659745)
+++ backends/hal/halcdrom.cpp (Arbeitskopie)
@@ -48,6 +49,13 @@
map[Solid::OpticalDrive::Dvdplusr] ="storage.cdrom.dvdplusr";
map[Solid::OpticalDrive::Dvdplusrw] ="storage.cdrom.dvdplusrw";
map[Solid::OpticalDrive::Dvdplusdl] ="storage.cdrom.dvdplusrdl";
+ map[Solid::OpticalDrive::Dvdplusdlrw] ="storage.cdrom.dvdplusrwdl";
+ map[Solid::OpticalDrive::Bd] ="storage.cdrom.bd";
+ map[Solid::OpticalDrive::Bdr] ="storage.cdrom.bdr";
+ map[Solid::OpticalDrive::Bdre] ="storage.cdrom.bdre";
+ map[Solid::OpticalDrive::HdDvd] ="storage.cdrom.hddvd";
+ map[Solid::OpticalDrive::HdDvdr] ="storage.cdrom.hddvdr";
+ map[Solid::OpticalDrive::HdDvdrw] ="storage.cdrom.hddvdrw";
foreach (const Solid::OpticalDrive::MediumType type, map.keys())
{
Index: backends/fakehw/fakecdrom.cpp
===================================================================
--- backends/fakehw/fakecdrom.cpp (Revision 659745)
+++ backends/fakehw/fakecdrom.cpp (Arbeitskopie)
@@ -46,6 +46,13 @@
map[Solid::OpticalDrive::Dvdplusr] ="dvdplusr";
map[Solid::OpticalDrive::Dvdplusrw] ="dvdplusrw";
map[Solid::OpticalDrive::Dvdplusdl] ="dvdplusrdl";
+ map[Solid::OpticalDrive::Dvdplusdlrw] ="dvdplusrwdl";
+ map[Solid::OpticalDrive::Bd] ="bd";
+ map[Solid::OpticalDrive::Bdr] ="bdr";
+ map[Solid::OpticalDrive::Bdre] ="bdre";
+ map[Solid::OpticalDrive::HdDvd] ="hddvd";
+ map[Solid::OpticalDrive::HdDvdr] ="hddvdr";
+ map[Solid::OpticalDrive::HdDvdrw] ="hddvdrw";
QStringList supported_medialist = fakeDevice()->property("supportedMedia").toString().simplified().split(',');
_______________________________________________
Kde-hardware-devel mailing list
[email protected]
https://mail.kde.org/mailman/listinfo/kde-hardware-devel