AlexaClientSDK
3.0.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
|
#include <Channel.h>
Classes | |
struct | State |
Public Member Functions | |
Channel (const std::string &name, const unsigned int priority, bool isVirtual=false) | |
const std::string & | getName () const |
unsigned int | getPriority () const |
bool | setFocus (avsCommon::avs::FocusState focus, avsCommon::avs::MixingBehavior behavior, bool forceUpdate=false) |
void | setPrimaryActivity (std::shared_ptr< avsCommon::sdkInterfaces::FocusManagerInterface::Activity > activity) |
bool | releaseActivity (std::shared_ptr< avsCommon::sdkInterfaces::ChannelObserverInterface > observer) |
bool | releaseActivity (const std::string &interfaceName) |
bool | isActive () |
bool | operator> (const Channel &rhs) const |
std::string | getInterface () const |
Channel::State | getState () const |
std::vector< Channel::State > | getActivityUpdates () |
std::shared_ptr< avsCommon::sdkInterfaces::FocusManagerInterface::Activity > | getPrimaryActivity () |
std::shared_ptr< avsCommon::sdkInterfaces::FocusManagerInterface::Activity > | getActivity (const std::string &interfaceName) |
std::vector< std::string > | getInterfaceList () const |
A Channel represents a focusable layer with a priority, allowing the observer which has acquired the Channel to understand focus changes. A Channel can be acquired by multiple Activities, but only a single Activity can be the primary activity. All other Activities that are not the primary Activity will be backgrounded.
A Channel can optionally be virtual. Activity changes will not be captured for virtual channels.
alexaClientSDK::afml::Channel::Channel | ( | const std::string & | name, |
const unsigned int | priority, | ||
bool | isVirtual = false |
||
) |
Constructs a new Channel object with the provided priority.
name | The channel's name. |
priority | The priority of the channel. |
isVirtual | bool to indicate if this channel is a virtual channel. |
std::shared_ptr<avsCommon::sdkInterfaces::FocusManagerInterface::Activity> alexaClientSDK::afml::Channel::getActivity | ( | const std::string & | interfaceName | ) |
Gets the activity associated with a given interfaceName.
interfaceName | interface name associated with the activity being searched |
interfaceName,nullptr | if not found. |
std::vector<Channel::State> alexaClientSDK::afml::Channel::getActivityUpdates | ( | ) |
Returns a list of Channel::State updates. This API will internally clear the stored updates when called.
std::string alexaClientSDK::afml::Channel::getInterface | ( | ) | const |
Returns the name of the interface of the Primary Activity occupying the Channel.
std::vector<std::string> alexaClientSDK::afml::Channel::getInterfaceList | ( | ) | const |
Retrieve vector of interfaces of all Activites on the Channel.
const std::string& alexaClientSDK::afml::Channel::getName | ( | ) | const |
Returns the name of a channel.
std::shared_ptr<avsCommon::sdkInterfaces::FocusManagerInterface::Activity> alexaClientSDK::afml::Channel::getPrimaryActivity | ( | ) |
Returns the primary activity associated with this channel
unsigned int alexaClientSDK::afml::Channel::getPriority | ( | ) | const |
Channel::State alexaClientSDK::afml::Channel::getState | ( | ) | const |
bool alexaClientSDK::afml::Channel::isActive | ( | ) |
bool alexaClientSDK::afml::Channel::operator> | ( | const Channel & | rhs | ) | const |
bool alexaClientSDK::afml::Channel::releaseActivity | ( | std::shared_ptr< avsCommon::sdkInterfaces::ChannelObserverInterface > | observer | ) |
Activity to be released by observer.
observer | Channel Observer to release. |
true
if Activity was found and released, false
otherwise. bool alexaClientSDK::afml::Channel::releaseActivity | ( | const std::string & | interfaceName | ) |
Activity to be released by interface.
interfaceName | The interface name of the Activity to release. |
bool alexaClientSDK::afml::Channel::setFocus | ( | avsCommon::avs::FocusState | focus, |
avsCommon::avs::MixingBehavior | behavior, | ||
bool | forceUpdate = false |
||
) |
Updates the focus and notifies all activities associated with the Channel
of the focus change. If FocusState
is FOREGROUND, then the most recent Activity added to the Channel will be moved to foreground state, and all other Activites will remain in background state. This method does not return until the ChannelObserverInterface##onFocusChanged() callbacks to all the associated activities return. If the focus is NONE
, the Activity will be removed from the Channel.
MixingBehavior
should pertain to the primary Activity for the Channel.focus | The focus of the Channel. |
behavior | The MixingBehavior of the Channel. |
forceUpdate | bool to indicate if the operation must be forced (irrespective of focus/behavior change). |
true
if focus changed, else false
. void alexaClientSDK::afml::Channel::setPrimaryActivity | ( | std::shared_ptr< avsCommon::sdkInterfaces::FocusManagerInterface::Activity > | activity | ) |
AlexaClientSDK 3.0.0 - Copyright 2016-2022 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0