16 #ifndef ALEXA_CLIENT_SDK_AVSCOMMON_AVS_INCLUDE_AVSCOMMON_AVS_DIALOGUXSTATEAGGREGATOR_H_ 17 #define ALEXA_CLIENT_SDK_AVSCOMMON_AVS_INCLUDE_AVSCOMMON_AVS_DIALOGUXSTATEAGGREGATOR_H_ 21 #include <unordered_set> 79 const std::shared_ptr<avsCommon::utils::metrics::MetricRecorderInterface>&
metricRecorder,
80 const std::shared_ptr<avsCommon::sdkInterfaces::AVSConnectionManagerInterface>& connectionManager,
81 const std::shared_ptr<acsdkInteractionModelInterfaces::InteractionModelNotifierInterface>&
82 interactionModelNotifier);
97 std::shared_ptr<avsCommon::utils::metrics::MetricRecorderInterface> metricRecorder =
nullptr,
98 std::chrono::milliseconds timeoutForThinkingToIdle = LONG_TIMEOUT_FOR_THINKING_TO_IDLE,
99 std::chrono::milliseconds timeoutForListeningToIdle = LONG_TIMEOUT_FOR_LISTENING_TO_IDLE,
100 std::chrono::milliseconds shortTimeoutForThinkingToIdle = SHORT_TIMEOUT_FOR_THINKING_TO_IDLE);
111 void addObserver(std::shared_ptr<sdkInterfaces::DialogUXStateObserverInterface> observer);
123 void removeObserver(std::shared_ptr<sdkInterfaces::DialogUXStateObserverInterface> observer);
136 const std::vector<avsCommon::utils::audioAnalyzer::AudioAnalyzerState>& audioAnalyzerState)
override;
159 void notifyObserversOfState();
172 void executeTryEnterIdleState();
178 void executeTryExitThinkingState();
183 void transitionFromThinkingTimedOut();
188 void transitionFromListeningTimedOut();
194 void tryEnterIdleStateOnTimer();
199 void onActivityStarted();
210 std::shared_ptr<avsCommon::utils::metrics::MetricRecorderInterface> m_metricRecorder;
213 std::unordered_set<std::shared_ptr<sdkInterfaces::DialogUXStateObserverInterface>> m_observers;
219 const std::chrono::milliseconds m_timeoutForThinkingToIdle;
225 const std::chrono::milliseconds m_shortTimeoutForThinkingToIdle;
235 const std::chrono::milliseconds m_timeoutForListeningToIdle;
252 std::atomic<alexaClientSDK::avsCommon::sdkInterfaces::SpeechSynthesizerObserverInterface::SpeechSynthesizerState>
253 m_speechSynthesizerState;
256 std::atomic<alexaClientSDK::avsCommon::sdkInterfaces::AudioInputProcessorObserverInterface::State>
257 m_audioInputProcessorState;
264 #endif // ALEXA_CLIENT_SDK_AVSCOMMON_AVS_INCLUDE_AVSCOMMON_AVS_DIALOGUXSTATEAGGREGATOR_H_ 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)
ChangedReason
Definition: ConnectionStatusObserverInterface.h:50
void addObserver(std::shared_ptr< sdkInterfaces::DialogUXStateObserverInterface > observer)
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)
void onStateChanged(sdkInterfaces::AudioInputProcessorObserverInterface::State state) override
Single-thread executor implementation.
Definition: Executor.h:45
void onRequestProcessingCompleted() override
Definition: ConnectionStatusObserverInterface.h:31
static constexpr std::chrono::seconds LONG_TIMEOUT_FOR_LISTENING_TO_IDLE
Definition: DialogUXStateAggregator.h:66
DialogUXState
The different dialog specific AVS UX states.
Definition: DialogUXStateObserverInterface.h:32
static std::shared_ptr< avsCommon::utils::metrics::MetricRecorderInterface > metricRecorder
Metric recorder shared ptr.
Definition: BaseAPLCapabilityAgentTest.cpp:261
static constexpr std::chrono::milliseconds SHORT_TIMEOUT_FOR_THINKING_TO_IDLE
Definition: DialogUXStateAggregator.h:54
Definition: Optional.h:32
A directive observer for an InteractionModelCapabilityAgent.
Definition: InteractionModelRequestProcessingObserverInterface.h:23
Timer to schedule task for delayed and periodic execution.
Definition: Timer.h:39
static constexpr std::chrono::seconds LONG_TIMEOUT_FOR_THINKING_TO_IDLE
Definition: DialogUXStateAggregator.h:60
Whether or not curl logs should be emitted.
Definition: AVSConnectionManager.h:36
Definition: SpeechSynthesizerObserverInterface.h:32
SpeechSynthesizerState
Definition: SpeechSynthesizerObserverInterface.h:37
void onRequestProcessingStarted() override
Definition: DialogUXStateAggregator.h:44
void removeObserver(std::shared_ptr< sdkInterfaces::DialogUXStateObserverInterface > observer)
void onConnectionStatusChanged(const avsCommon::sdkInterfaces::ConnectionStatusObserverInterface::Status status, const avsCommon::sdkInterfaces::ConnectionStatusObserverInterface::ChangedReason reason) override
Status
Definition: ConnectionStatusObserverInterface.h:36