22 #include "mythcontrol.h" 26 Control::Control(
const std::string& server,
unsigned protoPort,
unsigned wsapiPort,
const std::string& wsapiSecurityPin)
27 : m_monitor(server, protoPort)
28 , m_wsapi(server, wsapiPort, wsapiSecurityPin)
33 Control::Control(
const std::string& server,
unsigned protoPort,
unsigned wsapiPort,
const std::string& wsapiSecurityPin,
bool frontend)
34 : m_monitor(server, protoPort, frontend)
35 , m_wsapi(server, wsapiPort, wsapiSecurityPin)
47 if (m_monitor.IsOpen())
49 return m_monitor.Open();
55 m_wsapi.InvalidateService();
60 std::string backend_addr;
62 Myth::SettingPtr settingAddr = this->
GetSetting(
"BackendServerIP", hostName);
63 if (settingAddr && !settingAddr->value.empty())
64 backend_addr = settingAddr->value;
70 std::string backend_addr;
72 Myth::SettingPtr settingAddr = this->
GetSetting(
"BackendServerIP6", hostName);
73 if (settingAddr && !settingAddr->value.empty() && settingAddr->value !=
"::1")
74 backend_addr = settingAddr->value;
82 Myth::SettingPtr settingPort = this->
GetSetting(
"BackendServerPort", hostName);
83 if (settingPort && !settingPort->value.empty() && (backend_port = Myth::StringToInt(settingPort->value)) > 0)
90 program.artwork.clear();
91 if (program.inetref.empty())
94 program.artwork.reserve(artworks->size());
95 for (ArtworkList::const_iterator it = artworks->begin(); it < artworks->end(); ++it)
97 program.artwork.push_back(*(it->get()));
99 return (program.artwork.empty() ? false :
true);
SettingPtr GetSetting(const std::string &key, const std::string &hostname)
Query setting by its key.
bool RefreshRecordedArtwork(Program &program)
Refresh artwork available for a recording.
std::string GetBackendServerIP(const std::string &hostName)
Query backend server IP.
std::string GetBackendServerIP6(const std::string &hostName)
Query backend server IP6.
ArtworkListPtr GetRecordingArtworkList(uint32_t chanid, time_t recstartts)
Get a list of artwork available for a recording by start time and channel id.
This is the main namespace that encloses all public classes.
unsigned GetBackendServerPort(const std::string &hostName)
Query backend server port for protocol commands.