![]() |
AlexaClientSDK
3.0.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
|
#include <EndpointFocusAdapter.h>
Public Types | |
using | FocusAcquiredCallback = std::function< void(void)> |
Public Member Functions | |
virtual | ~EndpointFocusAdapter ()=default |
void | acquireFocus (const std::string &interfaceName, FocusAcquiredCallback callback) |
ChannelObserverInterface Functions | |
void | onFocusChanged (avsCommon::avs::FocusState focusState, avsCommon::avs::MixingBehavior behavior) override |
![]() | |
virtual | ~ChannelObserverInterface ()=default |
Static Public Member Functions | |
static std::shared_ptr< EndpointFocusAdapter > | create (std::shared_ptr< avsCommon::sdkInterfaces::FocusManagerInterface > focusManager, std::shared_ptr< presentationOrchestratorInterfaces::PresentationOrchestratorInterface > presentationOrchestrator, std::shared_ptr< presentationOrchestratorInterfaces::PresentationOrchestratorStateTrackerInterface > presentationOrchestratorStateTracker) |
Class to handle focus management.
using alexaClientSDK::sampleApplications::common::EndpointFocusAdapter::FocusAcquiredCallback = std::function<void(void)> |
|
virtualdefault |
Destructor
void alexaClientSDK::sampleApplications::common::EndpointFocusAdapter::acquireFocus | ( | const std::string & | interfaceName, |
FocusAcquiredCallback | callback | ||
) |
Acquire visual and audio focus.
interfaceName | The interface requesting focus. |
callback | The function to be invoked when focus is acquired. |
|
static |
Create an EndpointFocusAdapter
object.
focusManager | The FocusManager , to handle audio focus. |
presentationOrchestrator | The PresentationOrchestrator , to dismiss any existing presentations. |
presentationOrchestratorStateTracker | The PresentationOrchestratorStateTracker , to set and release the interface for visual focus. |
EndpointFocusAdapter
object if it succeeds; otherwise, nullptr
.
|
overridevirtual |
Used to notify the observer of the Channel of focus changes. Once called, the client should make a user observable change only and return immediately. Any additional work that needs to be done should be done on a separate thread or after returning. "User observable change" here refers to events that the end user of the product can visibly see or hear. For example, Alexa speech or music playing would be examples of user observable changes. Other work, such as database storing, logging, or communicating via network should be done on a different thread. Not doing so could result in delays for other clients trying to access the Channel.
newFocus | The new Focus of the channel. |
behavior | The mixingBehavior for the ChannelObserver to take as per the interrupt model |
Implements alexaClientSDK::avsCommon::sdkInterfaces::ChannelObserverInterface.
AlexaClientSDK 3.0.0 - Copyright 2016-2022 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0