AlexaClientSDK  1.19.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::capabilityAgents::alerts::renderer::Renderer Class Reference

#include <Renderer.h>

Inheritance diagram for alexaClientSDK::capabilityAgents::alerts::renderer::Renderer:
Inheritance graph
[legend]
Collaboration diagram for alexaClientSDK::capabilityAgents::alerts::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
 
- Public Member Functions inherited from alexaClientSDK::capabilityAgents::alerts::renderer::RendererInterface
virtual ~RendererInterface ()=default
 
virtual void start (std::shared_ptr< capabilityAgents::alerts::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::utils::mediaPlayer::MediaPlayerObserverInterface
virtual ~MediaPlayerObserverInterface ()=default
 
virtual void onPlaybackPaused (SourceId id, const MediaPlayerState &state)
 
virtual void onPlaybackResumed (SourceId id, const MediaPlayerState &state)
 
virtual void onBufferUnderrun (SourceId id, const MediaPlayerState &state)
 
virtual void onBufferRefilled (SourceId id, const MediaPlayerState &state)
 
virtual void onBufferingComplete (SourceId id, const MediaPlayerState &state)
 
virtual void onTags (SourceId id, std::unique_ptr< const VectorOfTags > vectorOfTags, const MediaPlayerState &state)
 

Static Public Member Functions

static std::shared_ptr< Renderercreate (std::shared_ptr< avsCommon::utils::mediaPlayer::MediaPlayerInterface > mediaPlayer)
 

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()

std::shared_ptr< Renderer > alexaClientSDK::capabilityAgents::alerts::renderer::Renderer::create ( std::shared_ptr< avsCommon::utils::mediaPlayer::MediaPlayerInterface mediaPlayer)
static

Creates a Renderer.

Parameters
mediaPlayerthe MediaPlayerInterface that the Renderer object will interact with.
Returns
The Renderer object.

◆ onFirstByteRead()

void alexaClientSDK::capabilityAgents::alerts::renderer::Renderer::onFirstByteRead ( SourceId  id,
const avsCommon::utils::mediaPlayer::MediaPlayerState state 
)
overridevirtual

This is an indication to the observer that the MediaPlayer has read its first byte of data.

Parameters
idThe id of the source to which this callback corresponds to.
stateMetadata about the media player state

Implements alexaClientSDK::avsCommon::utils::mediaPlayer::MediaPlayerObserverInterface.

◆ onPlaybackError()

void alexaClientSDK::capabilityAgents::alerts::renderer::Renderer::onPlaybackError ( SourceId  id,
const avsCommon::utils::mediaPlayer::ErrorType type,
std::string  error,
const avsCommon::utils::mediaPlayer::MediaPlayerState state 
)
overridevirtual

This is an indication to the observer that the MediaPlayer encountered an error. Errors can occur during playback.

Note
The observer must quickly return from this callback. Failure to do so could block the MediaPlayer from further processing.
Parameters
idThe id of the source to which this callback corresponds to.
typeThe type of error encountered by the MediaPlayerInterface.
errorThe error encountered by the MediaPlayerInterface.
stateMetadata about the media player state

Implements alexaClientSDK::avsCommon::utils::mediaPlayer::MediaPlayerObserverInterface.

◆ onPlaybackFinished()

void alexaClientSDK::capabilityAgents::alerts::renderer::Renderer::onPlaybackFinished ( SourceId  id,
const avsCommon::utils::mediaPlayer::MediaPlayerState state 
)
overridevirtual

This is an indication to the observer that the MediaPlayer finished the source.

Note
The observer must quickly return to quickly from this callback. Failure to do so could block the MediaPlayer from further processing.
Parameters
idThe id of the source to which this callback corresponds to.
stateMetadata about the media player state

Implements alexaClientSDK::avsCommon::utils::mediaPlayer::MediaPlayerObserverInterface.

◆ onPlaybackStarted()

void alexaClientSDK::capabilityAgents::alerts::renderer::Renderer::onPlaybackStarted ( SourceId  id,
const avsCommon::utils::mediaPlayer::MediaPlayerState state 
)
overridevirtual

This is an indication to the observer that the MediaPlayer has started playing the source specified by the id.

Note
The observer must quickly return to quickly from this callback. Failure to do so could block the MediaPlayer from further processing.
Parameters
idThe id of the source to which this callback corresponds to.
stateMetadata about the media player state

Implements alexaClientSDK::avsCommon::utils::mediaPlayer::MediaPlayerObserverInterface.

◆ onPlaybackStopped()

void alexaClientSDK::capabilityAgents::alerts::renderer::Renderer::onPlaybackStopped ( SourceId  id,
const avsCommon::utils::mediaPlayer::MediaPlayerState state 
)
overridevirtual

This is an indication to the observer that the MediaPlayer has stopped the source.

Note
The observer must quickly return from this callback. Failure to do so could block the MediaPlayer from further processing.
Parameters
idThe id of the source to which this callback corresponds to.
stateMetadata about the media player state

Reimplemented from alexaClientSDK::avsCommon::utils::mediaPlayer::MediaPlayerObserverInterface.

◆ start()

void alexaClientSDK::capabilityAgents::alerts::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::capabilityAgents::alerts::renderer::Renderer::stop ( )
overridevirtual

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

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