MCPcopy Create free account
hub / github.com/Pulse-Eight/libcec / HandleMenuRequest

Method HandleMenuRequest

src/libcec/implementations/CECCommandHandler.cpp:465–493  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

463}
464
465int CCECCommandHandler::HandleMenuRequest(const cec_command &command)
466{
467 if (m_processor->CECInitialised() && m_processor->IsHandledByLibCEC(command.destination))
468 {
469 CCECBusDevice *device = GetDevice(command.destination);
470 if (device)
471 {
472 CECClientPtr client = device->GetClient();
473 if (client)
474 {
475 if (command.parameters[0] == CEC_MENU_REQUEST_TYPE_ACTIVATE)
476 {
477 if (client->QueueMenuStateChanged(CEC_MENU_STATE_ACTIVATED) == 1)
478 device->SetMenuState(CEC_MENU_STATE_ACTIVATED);
479 }
480 else if (command.parameters[0] == CEC_MENU_REQUEST_TYPE_DEACTIVATE)
481 {
482 if (client->QueueMenuStateChanged(CEC_MENU_STATE_DEACTIVATED) == 1)
483 device->SetMenuState(CEC_MENU_STATE_DEACTIVATED);
484 }
485 }
486 device->TransmitMenuState(command.initiator, true);
487 return COMMAND_HANDLED;
488 }
489 return CEC_ABORT_REASON_INVALID_OPERAND;
490 }
491
492 return CEC_ABORT_REASON_NOT_IN_CORRECT_MODE_TO_RESPOND;
493}
494
495bool CCECCommandHandler::HandlePoll(const cec_command &command)
496{

Callers

nothing calls this directly

Calls 6

CECInitialisedMethod · 0.80
QueueMenuStateChangedMethod · 0.80
IsHandledByLibCECMethod · 0.45
GetClientMethod · 0.45
SetMenuStateMethod · 0.45
TransmitMenuStateMethod · 0.45

Tested by

no test coverage detected