Go to the documentation of this file.
7 #define _WIN32_WINNT 0x0500
23 unsigned long interval,
28 if (!::GetLogicalDriveStrings(
sizeof(strDrives), strDrives))
30 LOG(VB_GENERAL, LOG_ERR,
31 "Error. MediaMonitorWindows failed at GetLogicalDriveStrings.");
35 for (
char *driveName = strDrives; *driveName;
36 driveName += strlen(driveName) + 1)
39 UINT
type = ::GetDriveType(driveName);
43 LOG(VB_MEDIA, LOG_DEBUG,
44 QString(
"MediaMonitorWindows found cdrom '%1'").arg(driveName));
48 LOG(VB_MEDIA, LOG_DEBUG,
49 QString(
"MediaMonitorWindows found removeable '%1'")
51 media =
MythHDD::Get(
this, driveName,
false, allowEject);
54 LOG(VB_MEDIA, LOG_DEBUG,
55 QString(
"MediaMonitorWindows found unknown '%1'")
59 case DRIVE_NO_ROOT_DIR:
60 LOG(VB_MEDIA, LOG_DEBUG,
61 QString(
"MediaMonitorWindows found '%1' with no root dir")
66 LOG(VB_MEDIA, LOG_INFO, QString(
"MediaMonitorWindows found '%1' type %2")
67 .arg(driveName).arg(
type));
78 char volumeName[MAX_PATH];
79 if (GetVolumeInformation(driveName, volumeName, MAX_PATH,
80 nullptr,
nullptr,
nullptr,
nullptr, 0))
88 LOG(VB_GENERAL, LOG_ALERT,
89 "Error. Couldn't create MythMediaDevice.");
99 LOG(VB_GENERAL, LOG_ERR,
"MediaMonitorWindows::AddDevice(null)");
108 for (
const auto *device : std::as_const(
m_devices))
110 if (device->getDevicePath() == path)
112 LOG(VB_MEDIA, LOG_INFO,
113 "MediamonitorWindows::AddDevice() -- " +
114 QString(
"Not adding '%1', it appears to be a duplicate.")
138 if (::GetLogicalDriveStrings(
sizeof(strDrives), strDrives))
140 for (
char* driveName = strDrives; *driveName;
141 driveName += strlen(driveName) + 1)
143 if (::GetDriveType(driveName) == DRIVE_CDROM)
144 list.append(driveName);
#define LOG(_MASK_, _LEVEL_, _QSTRING_)
static MythHDD * Get(QObject *par, const char *devicePath, bool SuperMount, bool AllowEject)
Helper function used to create a new instance of a hard disk device.
static MythCDROM * get(QObject *par, const QString &devicePath, bool SuperMount, bool AllowEject)