summaryrefslogtreecommitdiffstats
path: root/tdeioslave/media/mediamanager
diff options
context:
space:
mode:
authorMichele Calgaro <[email protected]>2020-05-30 14:52:26 +0900
committerMichele Calgaro <[email protected]>2020-05-30 14:52:26 +0900
commit32381684a2eecaaa43616d5bc8ab51780d42e336 (patch)
tree832f6a82dd958e9a9d0a7baf3a486cad155e592d /tdeioslave/media/mediamanager
parentfadfb67a5c1fc28d4b724a51e36dbe03d8fdd196 (diff)
downloadtdebase-32381684a2eecaaa43616d5bc8ab51780d42e336.tar.gz
tdebase-32381684a2eecaaa43616d5bc8ab51780d42e336.zip
Improved support for bluray discs.
Signed-off-by: Michele Calgaro <[email protected]>
Diffstat (limited to 'tdeioslave/media/mediamanager')
-rw-r--r--tdeioslave/media/mediamanager/halbackend.cpp34
-rw-r--r--tdeioslave/media/mediamanager/linuxcdpolling.cpp46
-rw-r--r--tdeioslave/media/mediamanager/linuxcdpolling.h4
-rw-r--r--tdeioslave/media/mediamanager/tdehardwarebackend.cpp20
4 files changed, 71 insertions, 33 deletions
diff --git a/tdeioslave/media/mediamanager/halbackend.cpp b/tdeioslave/media/mediamanager/halbackend.cpp
index b0cf54b6e..e5fc92dc8 100644
--- a/tdeioslave/media/mediamanager/halbackend.cpp
+++ b/tdeioslave/media/mediamanager/halbackend.cpp
@@ -566,24 +566,45 @@ void HALBackend::setVolumeProperties(Medium* medium)
if ((discType == LIBHAL_VOLUME_DISC_TYPE_CDROM) ||
(discType == LIBHAL_VOLUME_DISC_TYPE_CDR) ||
(discType == LIBHAL_VOLUME_DISC_TYPE_CDRW))
+ {
if (libhal_volume_disc_is_blank(halVolume))
{
mimeType = "media/blankcd";
medium->unmountableState("");
}
else
+ {
mimeType = "media/cdwriter" + MOUNT_MEDIA_SUFFIX;
-
- if ((discType == LIBHAL_VOLUME_DISC_TYPE_DVDROM) || (discType == LIBHAL_VOLUME_DISC_TYPE_DVDRAM) ||
+ }
+ }
+ else if ((discType == LIBHAL_VOLUME_DISC_TYPE_DVDROM) || (discType == LIBHAL_VOLUME_DISC_TYPE_DVDRAM) ||
(discType == LIBHAL_VOLUME_DISC_TYPE_DVDR) || (discType == LIBHAL_VOLUME_DISC_TYPE_DVDRW) ||
(discType == LIBHAL_VOLUME_DISC_TYPE_DVDPLUSR) || (discType == LIBHAL_VOLUME_DISC_TYPE_DVDPLUSRW) )
+ {
if (libhal_volume_disc_is_blank(halVolume))
{
mimeType = "media/blankdvd";
medium->unmountableState("");
}
else
+ {
mimeType = "media/dvd" + MOUNT_MEDIA_SUFFIX;
+ }
+ }
+ else if ((discType == LIBHAL_VOLUME_DISC_TYPE_BDROM) || (discType == LIBHAL_VOLUME_DISC_TYPE_BDR) ||
+ (discType == LIBHAL_VOLUME_DISC_TYPE_BDRE) || (discType == LIBHAL_VOLUME_DISC_TYPE_HDDVDROM) ||
+ (discType == LIBHAL_VOLUME_DISC_TYPE_HDDVDR) || (discType == LIBHAL_VOLUME_DISC_TYPE_HDDVDRW) )
+ {
+ if (libhal_volume_disc_is_blank(halVolume))
+ {
+ mimeType = "media/blankbluray";
+ medium->unmountableState("");
+ }
+ else
+ {
+ mimeType = "media/bluray" + MOUNT_MEDIA_SUFFIX;
+ }
+ }
if (libhal_volume_disc_has_audio(halVolume) && !libhal_volume_disc_has_data(halVolume))
{
@@ -594,13 +615,16 @@ void HALBackend::setVolumeProperties(Medium* medium)
medium->setIconName(TQString::null);
/* check if the disc id a vcd or a video dvd */
- if (libhal_device_get_property_bool(m_halContext, udi, "volume.disc.is_vcd", NULL)) {
+ if (libhal_device_get_property_bool(m_halContext, udi, "volume.disc.is_vcd", NULL))
+ {
mimeType = "media/vcd";
}
- else if (libhal_device_get_property_bool(m_halContext, udi, "volume.disc.is_svcd", NULL)) {
+ else if (libhal_device_get_property_bool(m_halContext, udi, "volume.disc.is_svcd", NULL))
+ {
mimeType = "media/svcd";
}
- else if (libhal_device_get_property_bool(m_halContext, udi, "volume.disc.is_videodvd", NULL)) {
+ else if (libhal_device_get_property_bool(m_halContext, udi, "volume.disc.is_videodvd", NULL))
+ {
mimeType = "media/dvdvideo";
}
diff --git a/tdeioslave/media/mediamanager/linuxcdpolling.cpp b/tdeioslave/media/mediamanager/linuxcdpolling.cpp
index 0fcda8d0f..eccdf1f34 100644
--- a/tdeioslave/media/mediamanager/linuxcdpolling.cpp
+++ b/tdeioslave/media/mediamanager/linuxcdpolling.cpp
@@ -216,7 +216,7 @@ void LinuxCDPolling::slotMediumAdded(const TQString &id)
TQString mime = medium->mimeType();
kdDebug(1219) << "mime == " << mime << endl;
- if (mime.find("dvd")==-1 && mime.find("cd")==-1) return;
+ if (mime.find("dvd")==-1 && mime.find("cd")==-1 && mime.find("bluray")==-1) return;
if (!medium->isMounted())
{
@@ -255,7 +255,7 @@ void LinuxCDPolling::slotMediumStateChanged(const TQString &id)
TQString mime = medium->mimeType();
kdDebug(1219) << "mime == " << mime << endl;
- if (mime.find("dvd")==-1 && mime.find("cd")==-1) return;
+ if (mime.find("dvd")==-1 && mime.find("cd")==-1 && mime.find("bluray")==-1) return;
if (!m_threads.contains(id) && !medium->isMounted())
{
@@ -319,7 +319,12 @@ static TQString baseType(const Medium *medium)
FstabBackend::guess(devNode, mountPoint, fsType, mounted,
mimeType, iconName, label);
- if (devNode.find("dvd")!=-1)
+ if (devNode.find("bluray")!=-1)
+ {
+ kdDebug(1219) << "=> bluray" << endl;
+ return "bluray";
+ }
+ else if (devNode.find("dvd")!=-1)
{
kdDebug(1219) << "=> dvd" << endl;
return "dvd";
@@ -373,25 +378,30 @@ void LinuxCDPolling::applyType(DiscType type, const Medium *medium)
m_mediaList.changeMediumState(id, "audiocd:/?device="+dev,
notify, "media/audiocd");
break;
- case DiscType::VCD:
- m_mediaList.changeMediumState(id, false, notify, "media/vcd");
+ case DiscType::BLURAY:
+ m_mediaList.changeMediumState(id, false, notify, "media/blurayvideo");
+ break;
+ case DiscType::DVD:
+ m_mediaList.changeMediumState(id, false, notify, "media/dvdvideo");
break;
case DiscType::SVCD:
m_mediaList.changeMediumState(id, false, notify, "media/svcd");
break;
- case DiscType::DVD:
- m_mediaList.changeMediumState(id, false, notify, "media/dvdvideo");
+ case DiscType::VCD:
+ m_mediaList.changeMediumState(id, false, notify, "media/vcd");
break;
case DiscType::Blank:
- if (baseType(medium)=="dvd")
+ if (baseType(medium)=="bluray")
{
- m_mediaList.changeMediumState(id, false,
- notify, "media/blankdvd");
+ m_mediaList.changeMediumState(id, false, notify, "media/blankbluray");
+ }
+ else if (baseType(medium)=="dvd")
+ {
+ m_mediaList.changeMediumState(id, false, notify, "media/blankdvd");
}
else
{
- m_mediaList.changeMediumState(id, false,
- notify, "media/blankcd");
+ m_mediaList.changeMediumState(id, false, notify, "media/blankcd");
}
break;
case DiscType::None:
@@ -444,18 +454,22 @@ DiscType LinuxCDPolling::identifyDiscType(const TQCString &devNode,
return DiscType::Audio;
case CDS_DATA_1:
case CDS_DATA_2:
- if (hasDirectory(devNode, "video_ts"))
+ if (hasDirectory(devNode, "BDMV"))
{
- return DiscType::DVD;
+ return DiscType::BLURAY;
}
- else if (hasDirectory(devNode, "vcd"))
+ else if (hasDirectory(devNode, "video_ts"))
{
- return DiscType::VCD;
+ return DiscType::DVD;
}
else if (hasDirectory(devNode, "svcd"))
{
return DiscType::SVCD;
}
+ else if (hasDirectory(devNode, "vcd"))
+ {
+ return DiscType::VCD;
+ }
else
{
return DiscType::Data;
diff --git a/tdeioslave/media/mediamanager/linuxcdpolling.h b/tdeioslave/media/mediamanager/linuxcdpolling.h
index 3dec7e3ee..fc4947470 100644
--- a/tdeioslave/media/mediamanager/linuxcdpolling.h
+++ b/tdeioslave/media/mediamanager/linuxcdpolling.h
@@ -1,5 +1,5 @@
/* This file is part of the KDE Project
- Copyright (c) 2004 K�vin Ottens <ervin ipsquad net>
+ Copyright (c) 2004 Kévin Ottens <ervin ipsquad net>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
@@ -30,7 +30,7 @@ class DiscType
{
public:
enum Type { None, Unknown, Audio, Data, DVD, Mixed,
- Blank, VCD, SVCD, UnknownType, Broken };
+ Blank, VCD, SVCD, BLURAY, UnknownType, Broken };
DiscType(Type type = Unknown);
diff --git a/tdeioslave/media/mediamanager/tdehardwarebackend.cpp b/tdeioslave/media/mediamanager/tdehardwarebackend.cpp
index 754012d9a..c399d280d 100644
--- a/tdeioslave/media/mediamanager/tdehardwarebackend.cpp
+++ b/tdeioslave/media/mediamanager/tdehardwarebackend.cpp
@@ -668,34 +668,34 @@ void TDEBackend::setVolumeProperties(Medium* medium)
if (sdevice->isDiskOfType(TDEDiskDeviceType::BDROM)) {
mimeType = "media/bluray" + MOUNT_MEDIA_SUFFIX;
if (sdevice->checkDiskStatus(TDEDiskDeviceStatus::Blank)) {
- mimeType = "media/blankbd";
+ mimeType = "media/blankbluray";
medium->unmountableState("");
- diskLabel = i18n("Blank BD-ROM");
+ diskLabel = i18n("Blank BLURAY-ROM");
}
}
if (sdevice->isDiskOfType(TDEDiskDeviceType::BDR)) {
mimeType = "media/bluray" + MOUNT_MEDIA_SUFFIX;
if (sdevice->checkDiskStatus(TDEDiskDeviceStatus::Blank)) {
- mimeType = "media/blankbd";
+ mimeType = "media/blankbluray";
medium->unmountableState("");
- diskLabel = i18n("Blank BD-R");
+ diskLabel = i18n("Blank BLURAY-R");
}
}
if (sdevice->isDiskOfType(TDEDiskDeviceType::BDRW)) {
mimeType = "media/bluray" + MOUNT_MEDIA_SUFFIX;
if (sdevice->checkDiskStatus(TDEDiskDeviceStatus::Blank)) {
- mimeType = "media/blankbd";
+ mimeType = "media/blankbluray";
medium->unmountableState("");
- diskLabel = i18n("Blank BD-RW");
+ diskLabel = i18n("Blank BLURAY-RW");
}
}
if (sdevice->isDiskOfType(TDEDiskDeviceType::HDDVDROM)) {
mimeType = "media/bluray" + MOUNT_MEDIA_SUFFIX;
if (sdevice->checkDiskStatus(TDEDiskDeviceStatus::Blank)) {
- mimeType = "media/blankhddvd";
+ mimeType = "media/blankbluray";
medium->unmountableState("");
diskLabel = i18n("Blank HDDVD-ROM");
}
@@ -704,7 +704,7 @@ void TDEBackend::setVolumeProperties(Medium* medium)
if (sdevice->isDiskOfType(TDEDiskDeviceType::HDDVDR)) {
mimeType = "media/bluray" + MOUNT_MEDIA_SUFFIX;
if (sdevice->checkDiskStatus(TDEDiskDeviceStatus::Blank)) {
- mimeType = "media/blankhddvd";
+ mimeType = "media/blankbluray";
medium->unmountableState("");
diskLabel = i18n("Blank HDDVD-R");
}
@@ -713,7 +713,7 @@ void TDEBackend::setVolumeProperties(Medium* medium)
if (sdevice->isDiskOfType(TDEDiskDeviceType::HDDVDRW)) {
mimeType = "media/bluray" + MOUNT_MEDIA_SUFFIX;
if (sdevice->checkDiskStatus(TDEDiskDeviceStatus::Blank)) {
- mimeType = "media/blankhddvd";
+ mimeType = "media/blankbluray";
medium->unmountableState("");
diskLabel = i18n("Blank HDDVD-RW");
}
@@ -732,7 +732,7 @@ void TDEBackend::setVolumeProperties(Medium* medium)
mimeType = "media/dvdvideo";
}
if (sdevice->isDiskOfType(TDEDiskDeviceType::BDVideo)) {
- mimeType = "media/bdvideo";
+ mimeType = "media/blurayvideo";
}
medium->setIconName(TQString::null);