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

#include <Renderer.h>

Inheritance diagram for alexaClientSDK::acsdkAlerts::renderer::Renderer:
Inheritance graph
[legend]
Collaboration diagram for alexaClientSDK::acsdkAlerts::renderer::Renderer:
Collaboration graph
[legend]

Public Member Functions

void start (std::shared_ptr< 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) override
 
void stop () override
 
void onFirstByteRead (SourceId sourceId, const avsCommon::utils::mediaPlayer::MediaPlayerState &state) override
 
void onPlaybackStarted (SourceId sourceId, const avsCommon::utils::mediaPlayer::MediaPlayerState &state) override
 
void onPlaybackStopped (SourceId sourceId, const avsCommon::utils::mediaPlayer::MediaPlayerState &state) override
 
void onPlaybackFinished (SourceId sourceId, const avsCommon::utils::mediaPlayer::MediaPlayerState &state) override
 
void onPlaybackError (SourceId sourceId, const avsCommon::utils::mediaPlayer::ErrorType &type, std::string error, const avsCommon::utils::mediaPlayer::MediaPlayerState &state) override
 
void onConnectionStatusChanged (bool connected) override
 
- Public Member Functions inherited from alexaClientSDK::acsdkAlerts::renderer::RendererInterface
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
 
- Public Member Functions inherited from alexaClientSDK::avsCommon::sdkInterfaces::InternetConnectionObserverInterface
virtual ~InternetConnectionObserverInterface ()=default
 
- Public Member Functions inherited from alexaClientSDK::avsCommon::utils::mediaPlayer::MediaPlayerObserverInterface
virtual ~MediaPlayerObserverInterface ()=default
 
virtual void onFirstByteRead (SourceId id, const MediaPlayerState &state)=0
 
virtual void onPlaybackStarted (SourceId id, const MediaPlayerState &state)=0
 
virtual void onPlaybackFinished (SourceId id, const MediaPlayerState &state)=0
 
virtual void onPlaybackError (SourceId id, const ErrorType &type, std::string error, const MediaPlayerState &state)=0
 
virtual void onPlaybackPaused (SourceId, const MediaPlayerState &)
 
virtual void onPlaybackResumed (SourceId, const MediaPlayerState &)
 
virtual void onPlaybackStopped (SourceId, const MediaPlayerState &)
 
virtual void onBufferUnderrun (SourceId, const MediaPlayerState &)
 
virtual void onBufferRefilled (SourceId, const MediaPlayerState &)
 
virtual void onBufferingComplete (SourceId, const MediaPlayerState &)
 
virtual void onSeeked (SourceId, const MediaPlayerState &, const MediaPlayerState &)
 
virtual void onTags (SourceId, std::unique_ptr< const VectorOfTags >, const MediaPlayerState &)
 
- Public Member Functions inherited from alexaClientSDK::avsCommon::utils::RequiresShutdown
 RequiresShutdown (const std::string &name)
 
virtual ~RequiresShutdown ()
 Destructor. More...
 
const std::string & name () const
 
void shutdown ()
 
bool isShutdown () const
 

Static Public Member Functions

static std::shared_ptr< RenderercreateAlertRenderer (const std::shared_ptr< acsdkApplicationAudioPipelineFactoryInterfaces::ApplicationAudioPipelineFactoryInterface > &audioPipelineFactory, const std::shared_ptr< avsCommon::utils::metrics::MetricRecorderInterface > &metricRecorder, const std::shared_ptr< acsdkShutdownManagerInterfaces::ShutdownNotifierInterface > &shutdownNotifier, const std::shared_ptr< avsCommon::sdkInterfaces::InternetConnectionMonitorInterface > &internetConnectionMonitor)
 
static std::shared_ptr< Renderercreate (std::shared_ptr< avsCommon::utils::mediaPlayer::MediaPlayerInterface > mediaPlayer, std::shared_ptr< avsCommon::utils::metrics::MetricRecorderInterface > metricRecorder=nullptr, std::shared_ptr< avsCommon::sdkInterfaces::InternetConnectionMonitorInterface > internetConnectionMonitor=nullptr)
 

Additional Inherited Members

- Public Types inherited from alexaClientSDK::avsCommon::utils::mediaPlayer::MediaPlayerObserverInterface
enum  TagType {
  TagType::STRING, TagType::UINT, TagType::INT, TagType::DOUBLE,
  TagType::BOOLEAN
}
 The different types of metadata "stream tags". More...
 
using SourceId = MediaPlayerInterface::SourceId
 A type that identifies which source is currently being operated on. More...
 
typedef std::vector< TagKeyValueTypeVectorOfTags
 

Detailed Description

An implementation of an alert renderer. This class is thread-safe.

Member Function Documentation

◆ create()

static std::shared_ptr<Renderer> alexaClientSDK::acsdkAlerts::renderer::Renderer::create ( std::shared_ptr< avsCommon::utils::mediaPlayer::MediaPlayerInterface mediaPlayer,
std::shared_ptr< avsCommon::utils::metrics::MetricRecorderInterface metricRecorder = nullptr,
std::shared_ptr< avsCommon::sdkInterfaces::InternetConnectionMonitorInterface internetConnectionMonitor = nullptr 
)
static

Creates a Renderer.

Deprecated:
Use createAlertRenderer.
Parameters
mediaPlayerthe MediaPlayerInterface that the Renderer object will interact with.
metricRecorderthe metric recorder.
internetConnectionMonitorThe object use to monitor connectivity with the internet.
Returns
The Renderer object.

◆ createAlertRenderer()

static std::shared_ptr<Renderer> alexaClientSDK::acsdkAlerts::renderer::Renderer::createAlertRenderer ( const std::shared_ptr< acsdkApplicationAudioPipelineFactoryInterfaces::ApplicationAudioPipelineFactoryInterface > &  audioPipelineFactory,
const std::shared_ptr< avsCommon::utils::metrics::MetricRecorderInterface > &  metricRecorder,
const std::shared_ptr< acsdkShutdownManagerInterfaces::ShutdownNotifierInterface > &  shutdownNotifier,
const std::shared_ptr< avsCommon::sdkInterfaces::InternetConnectionMonitorInterface > &  internetConnectionMonitor 
)
static

Factory method to create an Alerts Renderer.

Parameters
audioPipelineFactoryThe ApplicationAudioPlayerInterface instance to use to create the notifications media player for rendering audio.
internetConnectionMonitorThe object use to monitor connectivity with the internet.
metricRecorderthe metric recorder.
shutdownNotifierthe ShutdownNotifier to notify if a shutdown occurred.
Returns
The Renderer object.

◆ onConnectionStatusChanged()

void alexaClientSDK::acsdkAlerts::renderer::Renderer::onConnectionStatusChanged ( bool  connected)
overridevirtual

Take necessary actions as a result of an internet connection change.

Parameters
connectedWhether or not we are currently connected to the internet.

Implements alexaClientSDK::avsCommon::sdkInterfaces::InternetConnectionObserverInterface.

◆ onFirstByteRead()

void alexaClientSDK::acsdkAlerts::renderer::Renderer::onFirstByteRead ( SourceId  sourceId,
const avsCommon::utils::mediaPlayer::MediaPlayerState state 
)
override

◆ onPlaybackError()

void alexaClientSDK::acsdkAlerts::renderer::Renderer::onPlaybackError ( SourceId  sourceId,
const avsCommon::utils::mediaPlayer::ErrorType type,
std::string  error,
const avsCommon::utils::mediaPlayer::MediaPlayerState state 
)
override

◆ onPlaybackFinished()

void alexaClientSDK::acsdkAlerts::renderer::Renderer::onPlaybackFinished ( SourceId  sourceId,
const avsCommon::utils::mediaPlayer::MediaPlayerState state 
)
override

◆ onPlaybackStarted()

void alexaClientSDK::acsdkAlerts::renderer::Renderer::onPlaybackStarted ( SourceId  sourceId,
const avsCommon::utils::mediaPlayer::MediaPlayerState state 
)
override

◆ onPlaybackStopped()

void alexaClientSDK::acsdkAlerts::renderer::Renderer::onPlaybackStopped ( SourceId  sourceId,
const avsCommon::utils::mediaPlayer::MediaPlayerState state 
)
override

◆ start()

void alexaClientSDK::acsdkAlerts::renderer::Renderer::start ( std::shared_ptr< 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 
)
override

◆ stop()

void alexaClientSDK::acsdkAlerts::renderer::Renderer::stop ( )
overridevirtual

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