14 if (
auto c = std::shared_ptr<MythDRMConnector>(
new MythDRMConnector(FD, Id)); c.get() && c->m_id)
22 auto match = [&Id](
const auto & Conn) {
return Conn->m_id == Id; };
23 if (
auto found = std::find_if(Connectors.cbegin(), Connectors.cend(), match); found != Connectors.cend())
33 for (
auto i = 0; i < resources->count_connectors; ++i)
34 if (
auto connector =
Create(FD, resources->connectors[i]); connector.get())
35 result.emplace_back(connector);
42 if (
auto * connector = drmModeGetConnector(FD, Id); connector)
44 m_id = connector->connector_id;
46 m_type = connector->connector_type;
47 m_typeId = connector->connector_type_id;
49 m_state = connector->connection;
53 for (
auto i = 0; i < connector->count_modes; ++i)
55 drmModeFreeConnector(connector);
61 return m_state == DRM_MODE_CONNECTED;
66 constexpr
size_t count = DRM_MODE_CONNECTOR_DPI + 1;
67 static const std::array<const QString,count> s_connectorNames
69 "None",
"VGA",
"DVI",
"DVI",
"DVI",
"Composite",
"TV",
"LVDS",
70 "CTV",
"DIN",
"DP",
"HDMI",
"HDMI",
"TV",
"eDP",
"Virtual",
"DSI",
"DPI"
72 uint32_t
type = std::min(Type,
static_cast<uint32_t
>(DRM_MODE_CONNECTOR_DPI));
73 return QString(
"%1%2").arg(s_connectorNames[
type]).arg(Id);
78 for (
const auto & connector : Connectors)
79 if (
Name.compare(connector->m_name, Qt::CaseInsensitive) == 0)