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

#include <RendererInterface.h>

Inheritance diagram for alexaClientSDK::acsdkAlerts::renderer::RendererInterface:
Inheritance graph
[legend]

Public Member Functions

virtual ~RendererInterface ()=default
 
virtual void start (std::shared_ptr< acsdkAlerts::renderer::RendererObserverInterface > observer, std::function< std::pair< std::unique_ptr< std::istream >, const avsCommon::utils::MediaType >()> audioFactory, bool volumeRampEnabled, const std::vector< std::string > &urls=std::vector< std::string >(), int loopCount=0, std::chrono::milliseconds loopPause=std::chrono::milliseconds{0}, bool startWithPause=false)=0
 
virtual void stop ()=0
 

Detailed Description

An interface class which specifies an Alert renderer.

Constructor & Destructor Documentation

◆ ~RendererInterface()

virtual alexaClientSDK::acsdkAlerts::renderer::RendererInterface::~RendererInterface ( )
virtualdefault

Destructor.

Member Function Documentation

◆ start()

virtual void alexaClientSDK::acsdkAlerts::renderer::RendererInterface::start ( std::shared_ptr< acsdkAlerts::renderer::RendererObserverInterface observer,
std::function< std::pair< std::unique_ptr< std::istream >, const avsCommon::utils::MediaType >()>  audioFactory,
bool  volumeRampEnabled,
const std::vector< std::string > &  urls = std::vector< std::string >(),
int  loopCount = 0,
std::chrono::milliseconds  loopPause = std::chrono::milliseconds{0},
bool  startWithPause = false 
)
pure virtual

Start rendering. This api takes two sets of parameters - a local audio file, and a vector of urls. If the urls container is empty, then the local audio file will be played for either a maximum time of one hour, or until explicitly being stopped.

If the urls are non-empty, then they will be rendered in sequence, for loopCount number of times, with a pause of loopPauseInMilliseconds in between each sequence.

If any url fails to render (for example, if the url is invalid, or the media player cannot acquire it), then the renderer will default to the local audio file, with the behavior described above.

TODO : ACSDK-389 Investigate changing explicit file paths to a std::istream-based interface.

Parameters
observerThe observer that will receive renderer events.
audioFactoryA function that produces a pair of unique stream of audio and audio format that is used for the default if nothing else is available.
volumeRampEnabledwhether this media should ramp
urlsA container of urls to be rendered per the above description.
loopCountThe number of times the urls should be rendered.
loopPauseThe duration which must expire between the beginning of rendering of any loop of audio. Therefore if the audio (either urls or local audio file) finishes before this duration, then the renderer will wait for the remainder of this time before starting the next loop.
startWithPauseIndicates if the renderer should begin with an initial pause before rendering audio. This initial pause will be for the same duration as loopPause, and will not be considered part of the loopCount.

◆ stop()

virtual void alexaClientSDK::acsdkAlerts::renderer::RendererInterface::stop ( )
pure virtual

Stop rendering.

Implemented in alexaClientSDK::acsdkAlerts::renderer::Renderer.


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