AlexaClientSDK  3.0.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
Public Member Functions | List of all members
alexaClientSDK::avsCommon::sdkInterfaces::ChannelObserverInterface Class Referenceabstract

#include <ChannelObserverInterface.h>

Inheritance diagram for alexaClientSDK::avsCommon::sdkInterfaces::ChannelObserverInterface:
Inheritance graph

Public Member Functions

virtual ~ChannelObserverInterface ()=default
virtual void onFocusChanged (avs::FocusState newFocus, avs::MixingBehavior behavior)=0

Detailed Description

A ChannelObserverInterface is an interface class that clients can extend to register for focus changes.

Constructor & Destructor Documentation

◆ ~ChannelObserverInterface()

virtual alexaClientSDK::avsCommon::sdkInterfaces::ChannelObserverInterface::~ChannelObserverInterface ( )


Member Function Documentation

◆ onFocusChanged()

virtual void alexaClientSDK::avsCommon::sdkInterfaces::ChannelObserverInterface::onFocusChanged ( avs::FocusState  newFocus,
avs::MixingBehavior  behavior 
pure virtual

Used to notify the observer of the Channel of focus changes. Once called, the client should make a user observable change only and return immediately. Any additional work that needs to be done should be done on a separate thread or after returning. "User observable change" here refers to events that the end user of the product can visibly see or hear. For example, Alexa speech or music playing would be examples of user observable changes. Other work, such as database storing, logging, or communicating via network should be done on a different thread. Not doing so could result in delays for other clients trying to access the Channel.

newFocusThe new Focus of the channel.
behaviorThe mixingBehavior for the ChannelObserver to take as per the interrupt model
when newFocus is FocusState::FOREGROUND, the MixingBehavior shall be guaranteed to be PRIMARY when newFocus is FocusState::NONE, the MixingBehavior shall be guaranteed to be MUST_STOP

Implemented in alexaClientSDK::sampleApplications::ipcServerSampleApp::gui::GUIManager, alexaClientSDK::capabilityAgents::aip::AudioInputProcessor, alexaClientSDK::acsdkBluetooth::Bluetooth, alexaClientSDK::afml::test::TestClient, alexaClientSDK::acsdkAudioPlayer::AudioPlayer, alexaClientSDK::acsdkAlerts::AlertsCapabilityAgent, alexaClientSDK::capabilityAgents::speechSynthesizer::SpeechSynthesizer, alexaClientSDK::acsdkNotifications::NotificationRenderer, alexaClientSDK::afml::test::MockChannelObserver, alexaClientSDK::avsCommon::avs::CapabilityAgent, and alexaClientSDK::sampleApplications::common::EndpointFocusAdapter.

The documentation for this class was generated from the following file:

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