*/
virtual bool SetStreamPath(uint16_t iPhysicalAddress) = 0;
+ /*!
+ * @return The list of addresses that libCEC is controlling
+ */
+ virtual cec_logical_addresses GetLogicalAddresses(void) = 0;
+
virtual const char *ToString(const cec_menu_state state) = 0;
virtual const char *ToString(const cec_version version) = 0;
virtual const char *ToString(const cec_power_status status) = 0;
return m_cec->SetStreamPath(iPhysicalAddress);
}
+cec_logical_addresses CLibCEC::GetLogicalAddresses(void)
+{
+ cec_logical_addresses addr = m_cec->GetLogicalAddresses();
+ return addr;
+}
+
static CLibCEC *g_libCEC_instance(NULL);
CLibCEC *CLibCEC::GetInstance(void)
{
virtual bool IsActiveSource(cec_logical_address iAddress);
virtual bool SetStreamPath(cec_logical_address iAddress);
virtual bool SetStreamPath(uint16_t iPhysicalAddress);
+ virtual cec_logical_addresses GetLogicalAddresses(void);
const char *ToString(const cec_menu_state state);
const char *ToString(const cec_version version);
"[volup] send a volume up command to the amp if present" << endl <<
"[voldown] send a volume down command to the amp if present" << endl <<
"[mute] send a mute/unmute command to the amp if present" << endl <<
+ "[self] show the list of addresses controlled by libCEC" << endl <<
"[scan] scan the CEC bus and display device info" << endl <<
"[mon] {1|0} enable or disable CEC bus monitoring." << endl <<
"[log] {1 - 31} change the log level. see cectypes.h for values." << endl <<
"================================================================================" << endl;
}
+bool ProcessCommandSELF(ICECAdapter *parser, const string &command, string & UNUSED(arguments))
+{
+ if (command == "self")
+ {
+ cec_logical_addresses addr = parser->GetLogicalAddresses();
+ CStdString strOut = "Addresses controlled by libCEC: ";
+ bool bFirst(true);
+ for (uint8_t iPtr = 0; iPtr <= 15; iPtr++)
+ {
+ if (addr[iPtr])
+ {
+ strOut.AppendFormat((bFirst ? "%d%s" : ", %d%s"), iPtr, parser->IsActiveSource((cec_logical_address)iPtr) ? "*" : "");
+ bFirst = false;
+ }
+ }
+ PrintToStdOut(strOut.c_str());
+ return true;
+ }
+
+ return false;
+}
+
bool ProcessCommandSP(ICECAdapter *parser, const string &command, string &arguments)
{
if (command == "sp")
ProcessCommandLOG(parser, command, input) ||
ProcessCommandSCAN(parser, command, input) ||
ProcessCommandSP(parser, command, input) ||
- ProcessCommandSPL(parser, command, input);
+ ProcessCommandSPL(parser, command, input) ||
+ ProcessCommandSELF(parser, command, input);
}
}
return true;