Skip to content

Commit

Permalink
frontend: add support for multiple cec adapters
Browse files Browse the repository at this point in the history
If the user has more than 1 HDMI port, the CEC adapter may not use the
default device /dev/cec0. Add a setting so that a different device can
be used.

Fixes #1006
  • Loading branch information
bennettpeter committed Dec 30, 2024
1 parent b1b19f4 commit 2106eae
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions mythtv/programs/mythfrontend/globalsettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2121,6 +2121,23 @@ static HostTextEditSetting *LircDaemonDevice()
return ge;
}

static HostTextEditSetting *CECDevice()
{
auto *ge = new HostTextEditSetting("libCECDevice");

ge->setLabel(MainGeneralSettings::tr("CEC Device"));

ge->setValue("/dev/cec0");

QString help = MainGeneralSettings::tr("CEC Device. Default is /dev/cec0 "
"if you have only 1 HDMI output "
"port.");
ge->setHelpText(help);

return ge;
}


static HostTextEditSetting *ScreenShotPath()
{
auto *ge = new HostTextEditSetting("ScreenShotPath");
Expand Down Expand Up @@ -4246,6 +4263,7 @@ MainGeneralSettings::MainGeneralSettings()
#ifdef USING_LIBCEC
HostCheckBoxSetting *cec = CECEnabled();
remotecontrol->addChild(cec);
cec->addTargetedChild("1",CECDevice());
m_cecPowerOnTVAllowed = CECPowerOnTVAllowed();
m_cecPowerOffTVAllowed = CECPowerOffTVAllowed();
m_cecPowerOnTVOnStart = CECPowerOnTVOnStart();
Expand Down

0 comments on commit 2106eae

Please sign in to comment.