 |
AlexaClientSDK
1.26.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
|
Go to the documentation of this file.
16 #ifndef ALEXA_CLIENT_SDK_AVSCOMMON_SDKINTERFACES_INCLUDE_AVSCOMMON_SDKINTERFACES_FOCUSMANAGERINTERFACE_H_
17 #define ALEXA_CLIENT_SDK_AVSCOMMON_SDKINTERFACES_INCLUDE_AVSCOMMON_SDKINTERFACES_FOCUSMANAGERINTERFACE_H_
31 namespace sdkInterfaces {
74 static std::shared_ptr<Activity>
create(
75 const std::string& interfaceName,
76 const std::shared_ptr<avsCommon::sdkInterfaces::ChannelObserverInterface>& channelObserver,
77 const std::chrono::milliseconds& patienceDuration = std::chrono::milliseconds::zero(),
81 return this->m_interface == rhs.m_interface;
126 std::shared_ptr<avsCommon::sdkInterfaces::ChannelObserverInterface>
getChannelObserver()
const;
145 const std::string& interfaceName,
146 const std::chrono::milliseconds& patienceDuration,
147 const std::shared_ptr<avsCommon::sdkInterfaces::ChannelObserverInterface>& channelObserver,
149 m_interface{interfaceName},
150 m_patienceDuration{patienceDuration},
151 m_channelObserver{channelObserver},
152 m_contentType{contentType},
164 mutable std::mutex m_mutex;
167 const std::string m_interface;
170 const std::chrono::milliseconds m_patienceDuration;
173 const std::shared_ptr<avsCommon::sdkInterfaces::ChannelObserverInterface> m_channelObserver;
229 const std::string& channelName,
230 std::shared_ptr<avsCommon::sdkInterfaces::ChannelObserverInterface> channelObserver,
231 const std::string& interfaceName) = 0;
244 const std::string& channelName,
245 std::shared_ptr<avsCommon::sdkInterfaces::FocusManagerInterface::Activity> channelActivity) = 0;
258 const std::string& channelName,
259 std::shared_ptr<avsCommon::sdkInterfaces::ChannelObserverInterface> channelObserver) = 0;
281 const std::shared_ptr<avsCommon::sdkInterfaces::FocusManagerObserverInterface>& observer) = 0;
289 const std::shared_ptr<avsCommon::sdkInterfaces::FocusManagerObserverInterface>& observer) = 0;
301 const std::string& channelName,
302 const std::string& interfaceName,
307 const std::string& interfaceName,
308 const std::shared_ptr<avsCommon::sdkInterfaces::ChannelObserverInterface>& channelObserver,
309 const std::chrono::milliseconds& patienceDuration,
311 if (interfaceName.empty() || patienceDuration.count() < 0 || channelObserver ==
nullptr) {
315 auto activity = std::shared_ptr<FocusManagerInterface::Activity>(
325 return m_patienceDuration;
329 std::unique_lock<std::mutex> lock(m_mutex);
330 return m_contentType;
334 std::unique_lock<std::mutex> lock(m_mutex);
335 m_contentType = contentType;
339 std::lock_guard<std::mutex> lock(m_mutex);
340 return m_mixingBehavior;
345 return m_channelObserver;
351 if (m_channelObserver) {
359 m_channelObserver->onFocusChanged(focus, overrideBehavior);
361 setMixingBehavior(overrideBehavior);
368 std::unique_lock<std::mutex> lock(m_mutex);
369 m_mixingBehavior = behavior;
376 #endif // ALEXA_CLIENT_SDK_AVSCOMMON_SDKINTERFACES_INCLUDE_AVSCOMMON_SDKINTERFACES_FOCUSMANAGERINTERFACE_H_
virtual void stopForegroundActivity()=0
static constexpr unsigned int COMMUNICATIONS_CHANNEL_PRIORITY
The default Communications Channel priority.
Definition: FocusManagerInterface.h:192
FocusState
Definition: FocusState.h:29
@ MUST_PAUSE
Indicates that the corresponding Activity must pause.
static constexpr const char * VISUAL_CHANNEL_NAME
The default Visual Channel name.
Definition: FocusManagerInterface.h:207
bool notifyObserver(avs::FocusState focus, avsCommon::avs::MixingBehavior behavior)
Definition: FocusManagerInterface.h:348
static constexpr unsigned int CONTENT_CHANNEL_PRIORITY
The default Content Channel priority.
Definition: FocusManagerInterface.h:204
const std::string getInterface() const
Definition: FocusManagerInterface.h:320
static constexpr const char * DIALOG_CHANNEL_NAME
The default Dialog Channel name.
Definition: FocusManagerInterface.h:183
@ UNDEFINED
Indicates that the corresponding Activity may adopt any one of the above behaviors.
std::chrono::milliseconds getPatienceDuration() const
Definition: FocusManagerInterface.h:324
static constexpr unsigned int DIALOG_CHANNEL_PRIORITY
The default dialog Channel priority.
Definition: FocusManagerInterface.h:186
virtual void addObserver(const std::shared_ptr< avsCommon::sdkInterfaces::FocusManagerObserverInterface > &observer)=0
virtual void stopAllActivities()=0
virtual ~FocusManagerInterface()=default
Destructor.
Whether or not curl logs should be emitted.
Definition: AVSConnectionManager.h:36
virtual void modifyContentType(const std::string &channelName, const std::string &interfaceName, avsCommon::avs::ContentType contentType)=0
Definition: FocusManagerInterface.h:64
avsCommon::avs::ContentType getContentType() const
Definition: FocusManagerInterface.h:328
static constexpr const char * CONTENT_CHANNEL_NAME
The default Content Channel name.
Definition: FocusManagerInterface.h:201
avsCommon::avs::MixingBehavior getMixingBehavior() const
Definition: FocusManagerInterface.h:338
virtual bool acquireChannel(const std::string &channelName, std::shared_ptr< avsCommon::sdkInterfaces::ChannelObserverInterface > channelObserver, const std::string &interfaceName)=0
ContentType
Definition: ContentType.h:25
static constexpr unsigned int ALERT_CHANNEL_PRIORITY
The default Alert Channel priority.
Definition: FocusManagerInterface.h:198
std::shared_ptr< avsCommon::sdkInterfaces::ChannelObserverInterface > getChannelObserver() const
Definition: FocusManagerInterface.h:344
static constexpr const char * ALERT_CHANNEL_NAME
The default Alert Channel name.
Definition: FocusManagerInterface.h:195
static constexpr const char * COMMUNICATIONS_CHANNEL_NAME
The default Communications Channel name.
Definition: FocusManagerInterface.h:189
MixingBehavior getMixingBehavior(const std::string &input)
Definition: MixingBehavior.h:72
static constexpr unsigned int VISUAL_CHANNEL_PRIORITY
The default Visual Channel priority.
Definition: FocusManagerInterface.h:210
Definition: FocusManagerInterface.h:54
virtual std::future< bool > releaseChannel(const std::string &channelName, std::shared_ptr< avsCommon::sdkInterfaces::ChannelObserverInterface > channelObserver)=0
bool operator==(const Activity &rhs)
Definition: FocusManagerInterface.h:80
void setContentType(avsCommon::avs::ContentType contentType)
Definition: FocusManagerInterface.h:333
static std::shared_ptr< Activity > create(const std::string &interfaceName, const std::shared_ptr< avsCommon::sdkInterfaces::ChannelObserverInterface > &channelObserver, const std::chrono::milliseconds &patienceDuration=std::chrono::milliseconds::zero(), const avsCommon::avs::ContentType contentType=avsCommon::avs::ContentType::NONMIXABLE)
Definition: FocusManagerInterface.h:306
MixingBehavior
Definition: MixingBehavior.h:25
virtual void removeObserver(const std::shared_ptr< avsCommon::sdkInterfaces::FocusManagerObserverInterface > &observer)=0
AlexaClientSDK 1.26.0 - Copyright 2016-2022 Amazon.com, Inc. or its affiliates. All Rights Reserved.
Licensed under the Apache License, Version 2.0