AlexaClientSDK  3.0.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
MRMCapabilityAgent.h
Go to the documentation of this file.
1 /*
2  * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License").
5  * You may not use this file except in compliance with the License.
6  * A copy of the License is located at
7  *
8  * http://aws.amazon.com/apache2.0/
9  *
10  * or in the "license" file accompanying this file. This file is distributed
11  * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
12  * express or implied. See the License for the specific language governing
13  * permissions and limitations under the License.
14  */
15 #ifndef ALEXA_CLIENT_SDK_ACSDKMULTIROOMMUSIC_INCLUDE_ACSDKMULTIROOMMUSIC_MRMCAPABILITYAGENT_H_
16 #define ALEXA_CLIENT_SDK_ACSDKMULTIROOMMUSIC_INCLUDE_ACSDKMULTIROOMMUSIC_MRMCAPABILITYAGENT_H_
17 
18 #include <memory>
19 #include <string>
20 
38 
39 #include "MRMHandlerInterface.h"
40 
41 namespace alexaClientSDK {
42 namespace capabilityAgents {
43 namespace mrm {
44 
57  , public std::enable_shared_from_this<MRMCapabilityAgent> {
58 public:
73  static std::shared_ptr<MRMCapabilityAgent> create(
74  std::shared_ptr<MRMHandlerInterface> mrmHandler,
75  std::shared_ptr<avsCommon::sdkInterfaces::SpeakerManagerInterface> speakerManager,
76  std::shared_ptr<avsCommon::sdkInterfaces::UserInactivityMonitorInterface> userInactivityMonitor,
77  std::shared_ptr<avsCommon::sdkInterfaces::ExceptionEncounteredSenderInterface> exceptionEncounteredSender);
78 
82  ~MRMCapabilityAgent() override;
83 
86  void preHandleDirective(std::shared_ptr<DirectiveInfo> info) override;
87  void handleDirective(std::shared_ptr<DirectiveInfo> info) override;
88  void cancelDirective(std::shared_ptr<DirectiveInfo> info) override;
90 
94  void handleDirectiveImmediately(std::shared_ptr<avsCommon::avs::AVSDirective> directive) override;
97 
105 
108  void onUserInactivityReportSent() override;
110 
115 
121 
124  std::unordered_set<std::shared_ptr<avsCommon::avs::CapabilityConfiguration>> getCapabilityConfigurations() override;
126 
129  void setObserver(
130  std::shared_ptr<avsCommon::sdkInterfaces::RenderPlayerInfoCardsObserverInterface> observer) override;
132 
135  void doShutdown() override;
137 
146 
147 private:
161  std::shared_ptr<MRMHandlerInterface> handler,
162  std::shared_ptr<avsCommon::sdkInterfaces::SpeakerManagerInterface> speakerManager,
163  std::shared_ptr<avsCommon::sdkInterfaces::UserInactivityMonitorInterface> userInactivityMonitor,
164  std::shared_ptr<avsCommon::sdkInterfaces::ExceptionEncounteredSenderInterface> exceptionEncounteredSender);
165 
175 
182  void executeHandleDirectiveImmediately(std::shared_ptr<DirectiveInfo> info);
183 
191  void executeOnSpeakerSettingsChanged(
195 
199  void executeOnCallStateChange(const avsCommon::sdkInterfaces::CallStateObserverInterface::CallState state);
200 
204  void executeOnDialogUXStateChanged(
206 
211  void executeOnUserInactivityReportSent();
212 
218  void executeSetObserver(std::shared_ptr<avsCommon::sdkInterfaces::RenderPlayerInfoCardsObserverInterface> observer);
219 
221 
223  std::shared_ptr<MRMHandlerInterface> m_mrmHandler;
225  std::shared_ptr<avsCommon::sdkInterfaces::SpeakerManagerInterface> m_speakerManager;
227  std::shared_ptr<avsCommon::sdkInterfaces::UserInactivityMonitorInterface> m_userInactivityMonitor;
229  bool m_wasPreviouslyActive;
232 
236 };
237 
238 } // namespace mrm
239 } // namespace capabilityAgents
240 } // namespace alexaClientSDK
241 
242 #endif // ALEXA_CLIENT_SDK_ACSDKMULTIROOMMUSIC_INCLUDE_ACSDKMULTIROOMMUSIC_MRMCAPABILITYAGENT_H_
Definition: CapabilityAgent.h:47
void onSpeakerSettingsChanged(const avsCommon::sdkInterfaces::SpeakerManagerObserverInterface::Source &source, const avsCommon::sdkInterfaces::ChannelVolumeInterface::Type &type, const avsCommon::sdkInterfaces::SpeakerInterface::SpeakerSettings &settings) override
void onDialogUXStateChanged(avsCommon::sdkInterfaces::DialogUXStateObserverInterface::DialogUXState newState) override
void setObserver(std::shared_ptr< avsCommon::sdkInterfaces::RenderPlayerInfoCardsObserverInterface > observer) override
::std::string string
Definition: gtest-port.h:1097
Single-thread executor implementation.
Definition: Executor.h:45
avsCommon::avs::DirectiveHandlerConfiguration getConfiguration() const override
DialogUXState
The different dialog specific AVS UX states.
Definition: DialogUXStateObserverInterface.h:32
Definition: UserInactivityMonitorObserverInterface.h:26
CallState
An enumeration representing the state of a call.
Definition: CallStateObserverInterface.h:31
std::unordered_map< directiveRoutingRule::DirectiveRoutingRule, BlockingPolicy > DirectiveHandlerConfiguration
Definition: DirectiveHandlerConfiguration.h:32
std::unordered_set< std::shared_ptr< avsCommon::avs::CapabilityConfiguration > > getCapabilityConfigurations() override
static std::shared_ptr< MRMCapabilityAgent > create(std::shared_ptr< MRMHandlerInterface > mrmHandler, std::shared_ptr< avsCommon::sdkInterfaces::SpeakerManagerInterface > speakerManager, std::shared_ptr< avsCommon::sdkInterfaces::UserInactivityMonitorInterface > userInactivityMonitor, std::shared_ptr< avsCommon::sdkInterfaces::ExceptionEncounteredSenderInterface > exceptionEncounteredSender)
Whether or not curl logs should be emitted.
Definition: AVSConnectionManager.h:36
void cancelDirective(std::shared_ptr< DirectiveInfo > info) override
type
Definition: upload.py:443
void handleDirective(std::shared_ptr< DirectiveInfo > info) override
void onCallStateChange(avsCommon::sdkInterfaces::CallStateObserverInterface::CallState callState) override
Source
Indicates whether the source of the call is from an AVS Directive or through a Local API call...
Definition: SpeakerManagerObserverInterface.h:35
void handleDirectiveImmediately(std::shared_ptr< avsCommon::avs::AVSDirective > directive) override
Definition: RenderPlayerInfoCardsProviderInterface.h:30
void preHandleDirective(std::shared_ptr< DirectiveInfo > info) override
A dialog specific UX state observer.
Definition: DialogUXStateObserverInterface.h:29

AlexaClientSDK 3.0.0 - Copyright 2016-2022 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0