+ else if (command == "lad")
+ {
+ cout << "listing active devices:" << endl;
+ cec_logical_addresses addresses = parser->GetActiveDevices();
+ for (unsigned iPtr = 0; iPtr < 16; iPtr++)
+ if (addresses[iPtr])
+ cout << "logical address " << iPtr << endl;
+ }
+ else if (command == "ad")
+ {
+ CStdString strDev;
+ if (GetWord(input, strDev))
+ {
+ int iDev = atoi(strDev);
+ if (iDev >= 0 && iDev < 15)
+ cout << "logical address " << iDev << " is " << (parser->IsActiveDevice((cec_logical_address)iDev) ? "active" : "not active") << endl;
+ }
+ }
+ else if (command == "at")
+ {
+ CStdString strType;
+ if (GetWord(input, strType))
+ {
+ cec_device_type type = CEC_DEVICE_TYPE_TV;
+ if (strType.Equals("a"))
+ type = CEC_DEVICE_TYPE_AUDIO_SYSTEM;
+ else if (strType.Equals("p"))
+ type = CEC_DEVICE_TYPE_PLAYBACK_DEVICE;
+ else if (strType.Equals("r"))
+ type = CEC_DEVICE_TYPE_RECORDING_DEVICE;
+ else if (strType.Equals("t"))
+ type = CEC_DEVICE_TYPE_TUNER;
+ cout << "device " << type << " is " << (parser->IsActiveDeviceType(type) ? "active" : "not active") << endl;
+ }
+ }