7#include "winopticaldrive.h"
12using namespace Solid::Backends::Win;
14WinOpticalDrive::WinOpticalDrive(WinDevice *device)
15 : WinStorageDrive(device)
18 for (
const MediaProfiles &p : profiles) {
19 m_supportedTypes |= p.type;
23WinOpticalDrive::~WinOpticalDrive()
29 return m_supportedTypes;
32bool WinOpticalDrive::eject()
34 WinDeviceManager::deviceAction(WinBlock::driveLetterFromUdi(m_device->udi()), IOCTL_STORAGE_EJECT_MEDIA);
43int WinOpticalDrive::writeSpeed()
const
48int WinOpticalDrive::readSpeed()
const
53MediaProfiles::MediaProfiles()
68MediaProfiles::MediaProfiles(FEATURE_DATA_PROFILE_LIST_EX *feature)
73 ulong val = (feature->ProfileNumber[0] << 8 | feature->ProfileNumber[1] << 0);
74 MediaProfiles p = MediaProfiles::getProfile(val);
79 active = feature->Current;
83bool MediaProfiles::isNull()
93 DWORD buffSize = 1024;
95 GET_CONFIGURATION_IOCTL_INPUT input;
96 ZeroMemory(&input,
sizeof(GET_CONFIGURATION_IOCTL_INPUT));
97 input.Feature = FeatureProfileList;
98 input.RequestType = SCSI_GET_CONFIGURATION_REQUEST_TYPE_ALL;
100 WinDeviceManager::getDeviceInfo<char, GET_CONFIGURATION_IOCTL_INPUT>(drive, IOCTL_CDROM_GET_CONFIGURATION, buffer, buffSize, &input);
102 GET_CONFIGURATION_HEADER *info = (GET_CONFIGURATION_HEADER *)buffer;
103 FEATURE_DATA_PROFILE_LIST *profile = (FEATURE_DATA_PROFILE_LIST *)info->Data;
104 FEATURE_DATA_PROFILE_LIST_EX *feature = profile->Profiles;
105 for (
int i = 0; i < profile->Header.AdditionalLength / 4; ++feature, ++i) {
106 MediaProfiles p = MediaProfiles(feature);
115const MediaProfiles MediaProfiles::getProfile(ulong val)
117#define AddProfile(profile, type) profiles.insert(profile, MediaProfiles(profile, type, QString::fromLatin1(#profile)))
120 AddProfile(ProfileCdrom, Solid::OpticalDrive::UnknownMediumType);
121 AddProfile(ProfileCdRecordable, Solid::OpticalDrive::Cdr);
122 AddProfile(ProfileCdRewritable, Solid::OpticalDrive::Cdrw);
123 AddProfile(ProfileDvdRom, Solid::OpticalDrive::Dvd);
124 AddProfile(ProfileDvdRecordable, Solid::OpticalDrive::Dvdr);
125 AddProfile(ProfileDvdRewritable, Solid::OpticalDrive::Dvdrw);
126 AddProfile(ProfileDvdRam, Solid::OpticalDrive::Dvdram);
127 AddProfile(ProfileDvdPlusR, Solid::OpticalDrive::Dvdplusr);
128 AddProfile(ProfileDvdPlusRW, Solid::OpticalDrive::Dvdplusrw);
129 AddProfile(ProfileDvdPlusRDualLayer, Solid::OpticalDrive::Dvdplusdl);
130 AddProfile(ProfileDvdPlusRWDualLayer, Solid::OpticalDrive::Dvdplusdlrw);
131 AddProfile(ProfileBDRom, Solid::OpticalDrive::Bd);
132 AddProfile(ProfileBDRRandomWritable, Solid::OpticalDrive::Bdr);
133 AddProfile(ProfileBDRSequentialWritable, Solid::OpticalDrive::Bdr);
134 AddProfile(ProfileBDRewritable, Solid::OpticalDrive::Bdre);
135 AddProfile(ProfileHDDVDRom, Solid::OpticalDrive::HdDvd);
136 AddProfile(ProfileHDDVDRecordable, Solid::OpticalDrive::HdDvdr);
137 AddProfile(ProfileHDDVDRewritable, Solid::OpticalDrive::HdDvdrw);
139 return profiles[val];
142#include "moc_winopticaldrive.cpp"
Type type(const QSqlDatabase &db)
QString name(StandardAction id)
iterator insert(const Key &key, const T &value)
bool isEmpty() const const
bool isNull() const const