![]() |
AlexaClientSDK
3.0.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
|
#include <DialogUXStateAggregator.h>
Static Public Member Functions | |
static std::shared_ptr< DialogUXStateAggregator > | createDialogUXStateAggregator (const std::shared_ptr< avsCommon::utils::metrics::MetricRecorderInterface > &metricRecorder, const std::shared_ptr< avsCommon::sdkInterfaces::AVSConnectionManagerInterface > &connectionManager, const std::shared_ptr< acsdkInteractionModelInterfaces::InteractionModelNotifierInterface > &interactionModelNotifier) |
![]() | |
static std::string | stateToString (State state) |
Static Public Attributes | |
static constexpr std::chrono::milliseconds | SHORT_TIMEOUT_FOR_THINKING_TO_IDLE = std::chrono::milliseconds{200} |
static constexpr std::chrono::seconds | LONG_TIMEOUT_FOR_THINKING_TO_IDLE = std::chrono::seconds{8} |
static constexpr std::chrono::seconds | LONG_TIMEOUT_FOR_LISTENING_TO_IDLE = std::chrono::seconds{8} |
This class serves as a component to aggregate other observer interfaces into one UX component that notifies observers of AVS dialog specific UX changes based on events that occur within these components.
alexaClientSDK::avsCommon::avs::DialogUXStateAggregator::DialogUXStateAggregator | ( | std::shared_ptr< avsCommon::utils::metrics::MetricRecorderInterface > | metricRecorder = nullptr , |
std::chrono::milliseconds | timeoutForThinkingToIdle = LONG_TIMEOUT_FOR_THINKING_TO_IDLE , |
||
std::chrono::milliseconds | timeoutForListeningToIdle = LONG_TIMEOUT_FOR_LISTENING_TO_IDLE , |
||
std::chrono::milliseconds | shortTimeoutForThinkingToIdle = SHORT_TIMEOUT_FOR_THINKING_TO_IDLE |
||
) |
Constructor.
Note: Additional parameters to this class must be added before the timeout parameters
metricRecorder | The metric recorder. |
timeoutForThinkingToIdle | This timeout will be used to time out from the THINKING state in case no messages arrive from AVS. |
timeoutForListeningToIdle | This timeout will be used to time out from the LISTENING state in case the Request Processing Started (RPS) directive is not received from AVS. |
shortTimeoutForThinkingToIdle | This timeout will be used to avoid going to the IDLE state immediately |
void alexaClientSDK::avsCommon::avs::DialogUXStateAggregator::addObserver | ( | std::shared_ptr< sdkInterfaces::DialogUXStateObserverInterface > | observer | ) |
Adds an observer to be notified of UX state changes.
observer | The new observer to notify of UX state changes. |
|
static |
Factory method for the DialogUXStateAggregator
.
metricRecorder | The metric recorder. |
connectionManager | The connection manager that this DialogUXStateAggregator will observe. |
interactionModelNotifier | The object that will relay InteractionModel notifications to this DialogUXStateAggregator . |
std::shared_ptr<DialogUXStateAggregator>
.
|
overridevirtual |
Called when the AVS connection state changes.
status | The current connection status. |
reason | The reason the status change occurred. |
Implements alexaClientSDK::avsCommon::sdkInterfaces::ConnectionStatusObserverInterface.
|
overridevirtual |
Called when any of the connection state changes.
status | A summarized status based on one or more engines' connection status. Most applications should use this to identify Alexa connectivity. |
engineStatuses | Detailed status for each connection. Gives more granular connection status when more than one connection is possible. |
Reimplemented from alexaClientSDK::avsCommon::sdkInterfaces::ConnectionStatusObserverInterface.
|
overridevirtual |
Used to notify the observer that a Request Processing Completed was received.
Implements alexaClientSDK::acsdkInteractionModelInterfaces::InteractionModelRequestProcessingObserverInterface.
|
overridevirtual |
Used to notify the observer that a Request Processing Started was received.
Implements alexaClientSDK::acsdkInteractionModelInterfaces::InteractionModelRequestProcessingObserverInterface.
|
overridevirtual |
This function is called when the state of the observed AudioInputProcessor
changes. This function will block processing of audio inputs, so implementations should return quickly.
state | The new state of the AudioInputProcessor . |
Implements alexaClientSDK::avsCommon::sdkInterfaces::AudioInputProcessorObserverInterface.
|
overridevirtual |
Notification that the SpeechSynthesizer
state has changed. Callback functions must return as soon as possible.
state | The new state of the speechSynthesizer . |
mediaSourceId | The current media source id for SpeechSynthesizer |
mediaPlayerState | Optional state of the media player as of this state change. The Optional is blank if the state is unavailable. |
audioAnalyzerState | states of the audio analyzers related to the speech output. |
Implements alexaClientSDK::avsCommon::sdkInterfaces::SpeechSynthesizerObserverInterface.
void alexaClientSDK::avsCommon::avs::DialogUXStateAggregator::removeObserver | ( | std::shared_ptr< sdkInterfaces::DialogUXStateObserverInterface > | observer | ) |
Removes an observer from the internal collection of observers synchronously. If the observer is not present, nothing will happen.
removeObserver()
from DialogUXStateObserverInterface::onDialogUXStateChanged()
will result in a deadlock.observer | The observer to remove. |
|
static |
This timeout will be used to time out from the LISTENING state in case the Request Processing Started (RPS) directive is not received from AVS so that the client may move back to an IDLE state.
|
static |
This timeout will be used to time out from the THINKING state in case no messages arrive from AVS so that the client may move back to an IDLE state.
|
static |
This timeout will be used to avoid going to the IDLE state immediately after receiving a message from AVS so that other UX states (such as speech starting) may be processed and propagated before going to IDLE.
AlexaClientSDK 3.0.0 - Copyright 2016-2022 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0