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

#include <NotificationRendererInterface.h>

Inheritance diagram for alexaClientSDK::acsdkNotificationsInterfaces::NotificationRendererInterface:
Inheritance graph
[legend]

Public Member Functions

virtual ~NotificationRendererInterface ()=default
 
virtual void addObserver (std::shared_ptr< NotificationRendererObserverInterface > observer)=0
 
virtual void removeObserver (std::shared_ptr< NotificationRendererObserverInterface > observer)=0
 
virtual bool renderNotification (std::function< std::pair< std::unique_ptr< std::istream >, const avsCommon::utils::MediaType >()> audioFactory, const std::string &url)=0
 
virtual bool cancelNotificationRendering ()=0
 

Detailed Description

Interface to an object that handles rendering notification audio clips.

Constructor & Destructor Documentation

◆ ~NotificationRendererInterface()

virtual alexaClientSDK::acsdkNotificationsInterfaces::NotificationRendererInterface::~NotificationRendererInterface ( )
virtualdefault

Member Function Documentation

◆ addObserver()

virtual void alexaClientSDK::acsdkNotificationsInterfaces::NotificationRendererInterface::addObserver ( std::shared_ptr< NotificationRendererObserverInterface observer)
pure virtual

Add an observer to receive a notifications about rendering notification audio clips.

Parameters
observerThe observer to call back.

◆ cancelNotificationRendering()

virtual bool alexaClientSDK::acsdkNotificationsInterfaces::NotificationRendererInterface::cancelNotificationRendering ( )
pure virtual

Cancel any ongoing rendering of a notification audio clip. Further render requests will be refused until an observer callback is made to indicate that rendering has finished (i.e. cancellation is complete).

Returns
Whether or not the cancellation was allowed.

Implemented in alexaClientSDK::acsdkNotifications::test::MockNotificationRenderer, and alexaClientSDK::acsdkNotifications::NotificationRenderer.

◆ removeObserver()

virtual void alexaClientSDK::acsdkNotificationsInterfaces::NotificationRendererInterface::removeObserver ( std::shared_ptr< NotificationRendererObserverInterface observer)
pure virtual

Remove an observer from the set of observers to receive a notifications about rendering notification audio clips.

Parameters
observerThe observer to call back.

◆ renderNotification()

virtual bool alexaClientSDK::acsdkNotificationsInterfaces::NotificationRendererInterface::renderNotification ( std::function< std::pair< std::unique_ptr< std::istream >, const avsCommon::utils::MediaType >()>  audioFactory,
const std::string &  url 
)
pure virtual

Render (play) a notification audio clip. If the asset at the specified url cannot be played for some reason, the default notification audio clip should be played, instead. If renderNotification is called while another rendering operation is in progress, this method fails and returns false.

Note
: Calling this method from a NotificationRendererObserverInterface callback will lead to a deadlock.
Parameters
audioFactoryA function that produces a pair of audio stream and media type char to play if the audio specified by url can not be played.
urlURL of the preferred audio asset to play.
Returns
Whether rendering the notification was initiated.

Implemented in alexaClientSDK::acsdkNotifications::NotificationRenderer.


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

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