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

#include <AudioPlayer.h>

Inheritance diagram for alexaClientSDK::acsdkAudioPlayer::AudioPlayer:
Inheritance graph
[legend]
Collaboration diagram for alexaClientSDK::acsdkAudioPlayer::AudioPlayer:
Collaboration graph
[legend]

Public Member Functions

virtual ~AudioPlayer ()
 
StateProviderInterface Functions
void provideState (const avsCommon::avs::NamespaceAndName &stateProviderName, unsigned int stateRequestToken) override
 
CapabilityAgent/DirectiveHandlerInterface Functions
void handleDirectiveImmediately (std::shared_ptr< avsCommon::avs::AVSDirective > directive) override
 
void preHandleDirective (std::shared_ptr< DirectiveInfo > info) override
 
void handleDirective (std::shared_ptr< DirectiveInfo > info) override
 
void cancelDirective (std::shared_ptr< DirectiveInfo > info) override
 
void onDeregistered () override
 
avsCommon::avs::DirectiveHandlerConfiguration getConfiguration () const override
 
ChannelObserverInterface Functions
void onFocusChanged (avsCommon::avs::FocusState newFocus, avsCommon::avs::MixingBehavior behavior) override
 
MediaPlayerObserverInterface Functions
void onFirstByteRead (SourceId id, const avsCommon::utils::mediaPlayer::MediaPlayerState &state) override
 
void onPlaybackStarted (SourceId id, const avsCommon::utils::mediaPlayer::MediaPlayerState &state) override
 
void onPlaybackStopped (SourceId id, const avsCommon::utils::mediaPlayer::MediaPlayerState &state) override
 
void onPlaybackFinished (SourceId id, const avsCommon::utils::mediaPlayer::MediaPlayerState &state) override
 
void onPlaybackError (SourceId id, const avsCommon::utils::mediaPlayer::ErrorType &type, std::string error, const avsCommon::utils::mediaPlayer::MediaPlayerState &state) override
 
void onPlaybackPaused (SourceId id, const avsCommon::utils::mediaPlayer::MediaPlayerState &state) override
 
void onPlaybackResumed (SourceId id, const avsCommon::utils::mediaPlayer::MediaPlayerState &state) override
 
void onBufferUnderrun (SourceId id, const avsCommon::utils::mediaPlayer::MediaPlayerState &state) override
 
void onBufferRefilled (SourceId id, const avsCommon::utils::mediaPlayer::MediaPlayerState &state) override
 
void onBufferingComplete (SourceId id, const avsCommon::utils::mediaPlayer::MediaPlayerState &state) override
 
void onSeeked (SourceId id, const avsCommon::utils::mediaPlayer::MediaPlayerState &startState, const avsCommon::utils::mediaPlayer::MediaPlayerState &endState) override
 
void onTags (SourceId id, std::unique_ptr< const VectorOfTags > vectorOfTags, const avsCommon::utils::mediaPlayer::MediaPlayerState &state) override
 
MediaPlayerFactoryObserverInterface Functions
void onReadyToProvideNextPlayer () override
 
ProgressTimer::ContextInterface methods
void onProgressReportDelayElapsed () override
 
void onProgressReportIntervalElapsed () override
 
void onProgressReportIntervalUpdated () override
 
void requestProgress () override
 
AudioPlayerInterface Functions
void addObserver (std::shared_ptr< acsdkAudioPlayerInterfaces::AudioPlayerObserverInterface > observer) override
 
void removeObserver (std::shared_ptr< acsdkAudioPlayerInterfaces::AudioPlayerObserverInterface > observer) override
 
void stopPlayback () override
 
RenderPlayerInfoCardsProviderInterface Functions
void setObserver (std::shared_ptr< avsCommon::sdkInterfaces::RenderPlayerInfoCardsObserverInterface > observer) override
 
LocalPlaybackHandlerInterface Functions
bool localOperation (PlaybackOperation op) override
 
bool localSeekTo (std::chrono::milliseconds location, bool fromStart) override
 
MediaPropertiesInterface Functions
std::chrono::milliseconds getAudioItemOffset () override
 
std::chrono::milliseconds getAudioItemDuration () override
 
CapabilityConfigurationInterface Functions
std::unordered_set< std::shared_ptr< avsCommon::avs::CapabilityConfiguration > > getCapabilityConfigurations () override
 
RequiresShutdown Functions
void doShutdown () override
 
- Public Member Functions inherited from alexaClientSDK::avsCommon::avs::CapabilityAgent
virtual ~CapabilityAgent ()=default
 
void preHandleDirective (std::shared_ptr< AVSDirective > directive, std::unique_ptr< sdkInterfaces::DirectiveHandlerResultInterface > result) override final
 
bool handleDirective (const std::string &messageId) override final
 
void cancelDirective (const std::string &messageId) override final
 
- Public Member Functions inherited from alexaClientSDK::avsCommon::sdkInterfaces::DirectiveHandlerInterface
virtual ~DirectiveHandlerInterface ()=default
 
virtual void preHandleDirective (std::shared_ptr< avsCommon::avs::AVSDirective > directive, std::unique_ptr< DirectiveHandlerResultInterface > result)=0
 
- Public Member Functions inherited from alexaClientSDK::avsCommon::sdkInterfaces::ChannelObserverInterface
virtual ~ChannelObserverInterface ()=default
 
- Public Member Functions inherited from alexaClientSDK::avsCommon::sdkInterfaces::StateProviderInterface
virtual ~StateProviderInterface ()=default
 
virtual void provideState (const avs::CapabilityTag &stateProviderName, const ContextRequestToken stateRequestToken)
 
virtual bool canStateBeRetrieved ()
 
virtual bool hasReportableStateProperties ()
 
virtual bool shouldQueryState ()
 
- Public Member Functions inherited from alexaClientSDK::avsCommon::sdkInterfaces::ContextRequesterInterface
virtual ~ContextRequesterInterface ()=default
 
virtual void onContextAvailable (const std::string &jsonContext)
 
virtual void onContextAvailable (const endpoints::EndpointIdentifier &endpointId, const avs::AVSContext &endpointContext, ContextRequestToken requestToken)
 
virtual void onContextFailure (const ContextRequestError error)
 
virtual void onContextFailure (const ContextRequestError error, ContextRequestToken token)
 
- Public Member Functions inherited from alexaClientSDK::acsdkAudioPlayer::ProgressTimer::ContextInterface
virtual ~ContextInterface ()=default
 
- Public Member Functions inherited from alexaClientSDK::acsdkAudioPlayerInterfaces::AudioPlayerInterface
virtual ~AudioPlayerInterface ()=default
 
virtual void addObserver (std::shared_ptr< acsdkAudioPlayerInterfaces::AudioPlayerObserverInterface > observer)=0
 
virtual void removeObserver (std::shared_ptr< acsdkAudioPlayerInterfaces::AudioPlayerObserverInterface > observer)=0
 
- Public Member Functions inherited from alexaClientSDK::avsCommon::sdkInterfaces::MediaPropertiesInterface
virtual ~MediaPropertiesInterface ()=default
 
- Public Member Functions inherited from alexaClientSDK::avsCommon::sdkInterfaces::RenderPlayerInfoCardsProviderInterface
virtual ~RenderPlayerInfoCardsProviderInterface ()=default
 
virtual void setObserver (std::shared_ptr< avsCommon::sdkInterfaces::RenderPlayerInfoCardsObserverInterface > observer)=0
 
- Public Member Functions inherited from alexaClientSDK::avsCommon::sdkInterfaces::CapabilityConfigurationInterface
virtual ~CapabilityConfigurationInterface ()=default
 
- Public Member Functions inherited from alexaClientSDK::avsCommon::sdkInterfaces::LocalPlaybackHandlerInterface
virtual ~LocalPlaybackHandlerInterface ()=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::mediaPlayer::MediaPlayerFactoryObserverInterface
virtual ~MediaPlayerFactoryObserverInterface ()=default
 
- 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< acsdkAudioPlayerInterfaces::AudioPlayerInterfacecreateAudioPlayerInterface (const std::shared_ptr< avsCommon::utils::mediaPlayer::PooledMediaResourceProviderInterface > &mediaResourceProvider, const std::shared_ptr< avsCommon::sdkInterfaces::MessageSenderInterface > &messageSender, const acsdkManufactory::Annotated< avsCommon::sdkInterfaces::AudioFocusAnnotation, avsCommon::sdkInterfaces::FocusManagerInterface > &annotatedFocusManager, const std::shared_ptr< avsCommon::sdkInterfaces::ContextManagerInterface > &contextManager, const std::shared_ptr< avsCommon::sdkInterfaces::ExceptionEncounteredSenderInterface > &exceptionSender, const std::shared_ptr< avsCommon::sdkInterfaces::PlaybackRouterInterface > &playbackRouter, const std::shared_ptr< captions::CaptionManagerInterface > &captionManager, const std::shared_ptr< avsCommon::utils::metrics::MetricRecorderInterface > &metricRecorder, const std::shared_ptr< acsdkShutdownManagerInterfaces::ShutdownNotifierInterface > &shutdownNotifier, const acsdkManufactory::Annotated< avsCommon::sdkInterfaces::endpoints::DefaultEndpointAnnotation, avsCommon::sdkInterfaces::endpoints::EndpointCapabilitiesRegistrarInterface > &endpointCapabilitiesRegistrar, const std::shared_ptr< avsCommon::sdkInterfaces::RenderPlayerInfoCardsProviderRegistrarInterface > &renderPlayerInfoCardsProviderRegistrar, const std::shared_ptr< cryptoInterfaces::CryptoFactoryInterface > &cryptoFactory)
 
static std::shared_ptr< AudioPlayercreate (std::shared_ptr< avsCommon::utils::mediaPlayer::PooledMediaResourceProviderInterface > mediaResourceProvider, std::shared_ptr< avsCommon::sdkInterfaces::MessageSenderInterface > messageSender, std::shared_ptr< avsCommon::sdkInterfaces::FocusManagerInterface > focusManager, std::shared_ptr< avsCommon::sdkInterfaces::ContextManagerInterface > contextManager, std::shared_ptr< avsCommon::sdkInterfaces::ExceptionEncounteredSenderInterface > exceptionSender, std::shared_ptr< avsCommon::sdkInterfaces::PlaybackRouterInterface > playbackRouter, std::shared_ptr< cryptoInterfaces::CryptoFactoryInterface > cryptoFactory, std::shared_ptr< captions::CaptionManagerInterface > captionManager=nullptr, std::shared_ptr< avsCommon::utils::metrics::MetricRecorderInterface > metricRecorder=nullptr)
 

Additional Inherited Members

- Public Types inherited from alexaClientSDK::avsCommon::sdkInterfaces::LocalPlaybackHandlerInterface
enum  PlaybackOperation { STOP_PLAYBACK, RESUMABLE_STOP, RESUME_PLAYBACK, TRANSIENT_PAUSE }
 
- 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
 
- Protected Member Functions inherited from alexaClientSDK::avsCommon::avs::CapabilityAgent
 CapabilityAgent (const std::string &nameSpace, std::shared_ptr< sdkInterfaces::ExceptionEncounteredSenderInterface > exceptionEncounteredSender)
 
virtual std::shared_ptr< DirectiveInfocreateDirectiveInfo (std::shared_ptr< AVSDirective > directive, std::unique_ptr< sdkInterfaces::DirectiveHandlerResultInterface > result)
 
void removeDirective (const std::string &messageId)
 
void sendExceptionEncounteredAndReportFailed (std::shared_ptr< DirectiveInfo > info, const std::string &message, avsCommon::avs::ExceptionErrorType type=avsCommon::avs::ExceptionErrorType::INTERNAL_ERROR)
 
const std::pair< std::string, std::string > buildJsonEventString (const std::string &eventName, const std::string &dialogRequestIdString="", const std::string &payload="{}", const std::string &context="") const
 
- Protected Attributes inherited from alexaClientSDK::avsCommon::avs::CapabilityAgent
const std::string m_namespace
 The namespace of the capability agent. More...
 
std::shared_ptr< sdkInterfaces::ExceptionEncounteredSenderInterfacem_exceptionEncounteredSender
 Object to use to send exceptionEncountered messages. More...
 

Detailed Description

This class implements the AudioPlayer capability agent.

See also
https://developer.amazon.com/public/solutions/alexa/alexa-voice-service/reference/audioplayer
Note
For instances of this class to be cleaned up correctly, shutdown() must be called.

Constructor & Destructor Documentation

◆ ~AudioPlayer()

virtual alexaClientSDK::acsdkAudioPlayer::AudioPlayer::~AudioPlayer ( )
virtual

Destructor.

Member Function Documentation

◆ addObserver()

void alexaClientSDK::acsdkAudioPlayer::AudioPlayer::addObserver ( std::shared_ptr< acsdkAudioPlayerInterfaces::AudioPlayerObserverInterface observer)
override

◆ cancelDirective()

void alexaClientSDK::acsdkAudioPlayer::AudioPlayer::cancelDirective ( std::shared_ptr< DirectiveInfo info)
overridevirtual

Cancel an ongoing preHandleDirective() or handleDirective() operation for the AVSDirective in . Once this has been called the CapabilityAgent should not expect to receive further calls regarding this directive.

Note
The implementation of this method MUST be thread-safe.
The implementation of this method MUST return quickly. Failure to do so blocks the processing of subsequent AVSDirectives.
Parameters
infoThe DirectiveInfo instance for the AVSDirective to process.

Implements alexaClientSDK::avsCommon::avs::CapabilityAgent.

◆ create()

static std::shared_ptr<AudioPlayer> alexaClientSDK::acsdkAudioPlayer::AudioPlayer::create ( std::shared_ptr< avsCommon::utils::mediaPlayer::PooledMediaResourceProviderInterface mediaResourceProvider,
std::shared_ptr< avsCommon::sdkInterfaces::MessageSenderInterface messageSender,
std::shared_ptr< avsCommon::sdkInterfaces::FocusManagerInterface focusManager,
std::shared_ptr< avsCommon::sdkInterfaces::ContextManagerInterface contextManager,
std::shared_ptr< avsCommon::sdkInterfaces::ExceptionEncounteredSenderInterface exceptionSender,
std::shared_ptr< avsCommon::sdkInterfaces::PlaybackRouterInterface playbackRouter,
std::shared_ptr< cryptoInterfaces::CryptoFactoryInterface cryptoFactory,
std::shared_ptr< captions::CaptionManagerInterface captionManager = nullptr,
std::shared_ptr< avsCommon::utils::metrics::MetricRecorderInterface metricRecorder = nullptr 
)
static

Creates a new AudioPlayer instance.

Parameters
mediaResourceProviderThe instance of the PooledMediaResourceProviderInterface used to manage players for playing audio.
messageSenderThe object to use for sending events.
focusManagerThe channel focus manager used to manage usage of the dialog channel.
contextManagerThe AVS Context manager used to generate system context for events.
exceptionSenderThe object to use for sending AVS Exception messages.
playbackRouterThe PlaybackRouterInterface instance to use when AudioPlayer becomes active.
captionManagerThe optional CaptionManagerInterface instance to use for handling captions.
metricRecorderThe metric recorder.
cryptoFactoryEncryption facilities factory.
Returns
A std::shared_ptr to the new AudioPlayer instance.

◆ createAudioPlayerInterface()

static std::shared_ptr<acsdkAudioPlayerInterfaces::AudioPlayerInterface> alexaClientSDK::acsdkAudioPlayer::AudioPlayer::createAudioPlayerInterface ( const std::shared_ptr< avsCommon::utils::mediaPlayer::PooledMediaResourceProviderInterface > &  mediaResourceProvider,
const std::shared_ptr< avsCommon::sdkInterfaces::MessageSenderInterface > &  messageSender,
const acsdkManufactory::Annotated< avsCommon::sdkInterfaces::AudioFocusAnnotation, avsCommon::sdkInterfaces::FocusManagerInterface > &  annotatedFocusManager,
const std::shared_ptr< avsCommon::sdkInterfaces::ContextManagerInterface > &  contextManager,
const std::shared_ptr< avsCommon::sdkInterfaces::ExceptionEncounteredSenderInterface > &  exceptionSender,
const std::shared_ptr< avsCommon::sdkInterfaces::PlaybackRouterInterface > &  playbackRouter,
const std::shared_ptr< captions::CaptionManagerInterface > &  captionManager,
const std::shared_ptr< avsCommon::utils::metrics::MetricRecorderInterface > &  metricRecorder,
const std::shared_ptr< acsdkShutdownManagerInterfaces::ShutdownNotifierInterface > &  shutdownNotifier,
const acsdkManufactory::Annotated< avsCommon::sdkInterfaces::endpoints::DefaultEndpointAnnotation, avsCommon::sdkInterfaces::endpoints::EndpointCapabilitiesRegistrarInterface > &  endpointCapabilitiesRegistrar,
const std::shared_ptr< avsCommon::sdkInterfaces::RenderPlayerInfoCardsProviderRegistrarInterface > &  renderPlayerInfoCardsProviderRegistrar,
const std::shared_ptr< cryptoInterfaces::CryptoFactoryInterface > &  cryptoFactory 
)
static

Factory method to create a new AudioPlayerInterface.

Parameters
mediaResourceProviderThe instance of the PooledMediaResourceProviderInterface used to manage players for playing audio.
messageSenderThe object to use for sending events.
annotatedFocusManagerThe annotated audio focus manager used to manage usage of the dialog channel.
contextManagerThe AVS Context manager used to generate system context for events.
exceptionSenderThe object to use for sending AVS Exception messages.
playbackRouterThe PlaybackRouterInterface instance to use when AudioPlayer becomes active.
captionManagerThe CaptionManagerInterface instance to use for handling captions.
metricRecorderThe metric recorder.
shutdownNotifierThe object to notify this AudioPlayer when to shut down.
endpointCapabilitiesRegistrarThe object with which to register this AudioPlayer's capabilities for the default endpoint.
renderPlayerInfoCardsProviderRegistrarThe object with which to register this AudioPlayer as a RenderPlayerInfoCardsProviderInterface.
cryptoFactoryEncryption facilities factory.
Returns
A shared_ptr to a new AudioPlayerInterface.

◆ doShutdown()

void alexaClientSDK::acsdkAudioPlayer::AudioPlayer::doShutdown ( )
overridevirtual

Prepares/enables this object to be deleted. This should be the last function called on this object prior to deleting (or resetting) its shared_ptr.

Warning
  • Attempting to call functions on this object after calling shutdown() can result in undefined behavior.
  • Neglecting to call shutdown() on this object can result in resource leaks or other undefined behavior.

Implements alexaClientSDK::avsCommon::utils::RequiresShutdown.

◆ getAudioItemDuration()

std::chrono::milliseconds alexaClientSDK::acsdkAudioPlayer::AudioPlayer::getAudioItemDuration ( )
overridevirtual

Returns the duration of the current AudioItem the player is handling.

Returns
returns the duration.

Reimplemented from alexaClientSDK::avsCommon::sdkInterfaces::MediaPropertiesInterface.

◆ getAudioItemOffset()

std::chrono::milliseconds alexaClientSDK::acsdkAudioPlayer::AudioPlayer::getAudioItemOffset ( )
overridevirtual

This function retrieves the offset of the current AudioItem the player is handling.

Returns
This returns the offset in milliseconds.

Implements alexaClientSDK::avsCommon::sdkInterfaces::MediaPropertiesInterface.

◆ getCapabilityConfigurations()

std::unordered_set<std::shared_ptr<avsCommon::avs::CapabilityConfiguration> > alexaClientSDK::acsdkAudioPlayer::AudioPlayer::getCapabilityConfigurations ( )
overridevirtual

Returns the configurations of the capability interfaces being implemented.

Returns
A set of CapabilityConfigurations

Implements alexaClientSDK::avsCommon::sdkInterfaces::CapabilityConfigurationInterface.

◆ getConfiguration()

avsCommon::avs::DirectiveHandlerConfiguration alexaClientSDK::acsdkAudioPlayer::AudioPlayer::getConfiguration ( ) const
overridevirtual

Returns the configuration of the directive handler.

The configuration consists of multiple directive routing rules and their respective blocking policy. The directives will be matched from the most specific rule (with all fields defined) to the least specific rule (which only matches the directive endpointId).

Returns
The avs::DirectiveHandlerConfiguration of the handler.

Implements alexaClientSDK::avsCommon::sdkInterfaces::DirectiveHandlerInterface.

◆ handleDirective()

void alexaClientSDK::acsdkAudioPlayer::AudioPlayer::handleDirective ( std::shared_ptr< DirectiveInfo info)
overridevirtual

Handle the action specified by the AVSDirective in info. The handling of subsequent directives with the same DialogRequestId may be blocked until the DirectiveHandler calls the setSucceeded() method of the DirectiveHandlingResult present in info. If handling of this directive fails setFailed() should be called to indicate a failure.

Note
The implementation of this method MUST be thread-safe.
The implementation of this method MUST return quickly. Failure to do so blocks the processing of subsequent AVSDirectives.
Parameters
infoThe DirectiveInfo instance for the AVSDirective to process.

Implements alexaClientSDK::avsCommon::avs::CapabilityAgent.

◆ handleDirectiveImmediately()

void alexaClientSDK::acsdkAudioPlayer::AudioPlayer::handleDirectiveImmediately ( std::shared_ptr< avsCommon::avs::AVSDirective directive)
overridevirtual

Handle the action specified AVSDirective. Once this has been called the DirectiveHandler should not expect to receive further calls regarding this directive.

Note
The implementation of this method MUST be thread-safe.
The implementation of this method MUST return quickly. Failure to do so blocks the processing of subsequent AVSDirectives.
If this operation fails, an ExceptionEncountered message should be sent to AVS.
Parameters
directiveThe directive to handle.

Implements alexaClientSDK::avsCommon::sdkInterfaces::DirectiveHandlerInterface.

◆ localOperation()

bool alexaClientSDK::acsdkAudioPlayer::AudioPlayer::localOperation ( PlaybackOperation  op)
overridevirtual

Request the handler to perform a local playback operation.

Parameters
opOperation to request
Returns
true if successful, false if the operation cannot be performed locally.

Implements alexaClientSDK::avsCommon::sdkInterfaces::LocalPlaybackHandlerInterface.

◆ localSeekTo()

bool alexaClientSDK::acsdkAudioPlayer::AudioPlayer::localSeekTo ( std::chrono::milliseconds  location,
bool  fromStart 
)
overridevirtual

Request the handler to perform a local seek operation.

Parameters
locationPosition to seek to
fromStarttrue to seek to absolute location, false to seek reletive to current location.
Returns
true if successful, false if the operation cannot be performed locally.

Implements alexaClientSDK::avsCommon::sdkInterfaces::LocalPlaybackHandlerInterface.

◆ onBufferingComplete()

void alexaClientSDK::acsdkAudioPlayer::AudioPlayer::onBufferingComplete ( SourceId  id,
const avsCommon::utils::mediaPlayer::MediaPlayerState state 
)
override

◆ onBufferRefilled()

void alexaClientSDK::acsdkAudioPlayer::AudioPlayer::onBufferRefilled ( SourceId  id,
const avsCommon::utils::mediaPlayer::MediaPlayerState state 
)
override

◆ onBufferUnderrun()

void alexaClientSDK::acsdkAudioPlayer::AudioPlayer::onBufferUnderrun ( SourceId  id,
const avsCommon::utils::mediaPlayer::MediaPlayerState state 
)
override

◆ onDeregistered()

void alexaClientSDK::acsdkAudioPlayer::AudioPlayer::onDeregistered ( )
overridevirtual

Notification that this handler has been de-registered and will not receive any more calls.

Reimplemented from alexaClientSDK::avsCommon::avs::CapabilityAgent.

◆ onFirstByteRead()

void alexaClientSDK::acsdkAudioPlayer::AudioPlayer::onFirstByteRead ( SourceId  id,
const avsCommon::utils::mediaPlayer::MediaPlayerState state 
)
override

◆ onFocusChanged()

void alexaClientSDK::acsdkAudioPlayer::AudioPlayer::onFocusChanged ( avsCommon::avs::FocusState  newFocus,
avsCommon::avs::MixingBehavior  behavior 
)
overridevirtual

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.

Parameters
newFocusThe new Focus of the channel.
behaviorThe mixingBehavior for the ChannelObserver to take as per the interrupt model
Note
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

Reimplemented from alexaClientSDK::avsCommon::avs::CapabilityAgent.

◆ onPlaybackError()

void alexaClientSDK::acsdkAudioPlayer::AudioPlayer::onPlaybackError ( SourceId  id,
const avsCommon::utils::mediaPlayer::ErrorType type,
std::string  error,
const avsCommon::utils::mediaPlayer::MediaPlayerState state 
)
override

◆ onPlaybackFinished()

void alexaClientSDK::acsdkAudioPlayer::AudioPlayer::onPlaybackFinished ( SourceId  id,
const avsCommon::utils::mediaPlayer::MediaPlayerState state 
)
override

◆ onPlaybackPaused()

void alexaClientSDK::acsdkAudioPlayer::AudioPlayer::onPlaybackPaused ( SourceId  id,
const avsCommon::utils::mediaPlayer::MediaPlayerState state 
)
override

◆ onPlaybackResumed()

void alexaClientSDK::acsdkAudioPlayer::AudioPlayer::onPlaybackResumed ( SourceId  id,
const avsCommon::utils::mediaPlayer::MediaPlayerState state 
)
override

◆ onPlaybackStarted()

void alexaClientSDK::acsdkAudioPlayer::AudioPlayer::onPlaybackStarted ( SourceId  id,
const avsCommon::utils::mediaPlayer::MediaPlayerState state 
)
override

◆ onPlaybackStopped()

void alexaClientSDK::acsdkAudioPlayer::AudioPlayer::onPlaybackStopped ( SourceId  id,
const avsCommon::utils::mediaPlayer::MediaPlayerState state 
)
override

◆ onProgressReportDelayElapsed()

void alexaClientSDK::acsdkAudioPlayer::AudioPlayer::onProgressReportDelayElapsed ( )
overridevirtual

Notification that it is time to send a ProgressReportDelayElapsed event.

Implements alexaClientSDK::acsdkAudioPlayer::ProgressTimer::ContextInterface.

◆ onProgressReportIntervalElapsed()

void alexaClientSDK::acsdkAudioPlayer::AudioPlayer::onProgressReportIntervalElapsed ( )
overridevirtual

Notification that it is time to send a ProgressReportIntervalElapsed event.

Implements alexaClientSDK::acsdkAudioPlayer::ProgressTimer::ContextInterface.

◆ onProgressReportIntervalUpdated()

void alexaClientSDK::acsdkAudioPlayer::AudioPlayer::onProgressReportIntervalUpdated ( )
overridevirtual

Notification that it is time to send a ProgressReportIntervalUpdated event.

Implements alexaClientSDK::acsdkAudioPlayer::ProgressTimer::ContextInterface.

◆ onReadyToProvideNextPlayer()

void alexaClientSDK::acsdkAudioPlayer::AudioPlayer::onReadyToProvideNextPlayer ( )
overridevirtual

Called when an instance of a MediaPlayerInterface is available. This may be called synchronously with MediaPlayerFactoryInterface::releaseMediaPlayer()

Implements alexaClientSDK::avsCommon::utils::mediaPlayer::MediaPlayerFactoryObserverInterface.

◆ onSeeked()

void alexaClientSDK::acsdkAudioPlayer::AudioPlayer::onSeeked ( SourceId  id,
const avsCommon::utils::mediaPlayer::MediaPlayerState startState,
const avsCommon::utils::mediaPlayer::MediaPlayerState endState 
)
override

◆ onTags()

void alexaClientSDK::acsdkAudioPlayer::AudioPlayer::onTags ( SourceId  id,
std::unique_ptr< const VectorOfTags vectorOfTags,
const avsCommon::utils::mediaPlayer::MediaPlayerState state 
)
override

◆ preHandleDirective()

void alexaClientSDK::acsdkAudioPlayer::AudioPlayer::preHandleDirective ( std::shared_ptr< DirectiveInfo info)
overridevirtual

Notification that a directive has arrived. This notification gives the DirectiveHandler a chance to prepare for handling of an AVSDirective. If an error occurs during the pre-Handling phase and that error should cancel the handling of subsequent AVSDirectives with the same DialogRequestId, the DirectiveHandler should call the setFailed method on the result instance passed in to this call.

Note
The implementation of this method MUST be thread-safe.
The implementation of this method MUST return quickly. Failure to do so blocks the processing of subsequent AVSDirectives.
Parameters
infoThe DirectiveInfo instance for the AVSDirective to process.

Implements alexaClientSDK::avsCommon::avs::CapabilityAgent.

◆ provideState()

void alexaClientSDK::acsdkAudioPlayer::AudioPlayer::provideState ( const avsCommon::avs::NamespaceAndName stateProviderName,
unsigned int  stateRequestToken 
)
overridevirtual

A request to a StateProvider to provide the state. The StateProvider should perform minimum processing and return quickly, otherwise it will block the processing of updating the states of other StateProviders. The ContextManager specifies a token which it uses to track the getContext request associated with this provideState request. The stateProviderInterface must use the same token when it updates its state via the setState call.

: The setState method MUST be called from a different thread from where the provideState method is being called from.

Parameters
stateProviderNameThe name of the state provider.
stateRequestTokenThe token to use in the setState call.
Deprecated:
NamespaceAndName is being deprecated. Use the CapabilityMessageIdentifier version instead.

Reimplemented from alexaClientSDK::avsCommon::sdkInterfaces::StateProviderInterface.

◆ removeObserver()

void alexaClientSDK::acsdkAudioPlayer::AudioPlayer::removeObserver ( std::shared_ptr< acsdkAudioPlayerInterfaces::AudioPlayerObserverInterface observer)
override

◆ requestProgress()

void alexaClientSDK::acsdkAudioPlayer::AudioPlayer::requestProgress ( )
overridevirtual

Request a (potentially asynchronous) callback to onProgress() with the current progress.

Implements alexaClientSDK::acsdkAudioPlayer::ProgressTimer::ContextInterface.

◆ setObserver()

void alexaClientSDK::acsdkAudioPlayer::AudioPlayer::setObserver ( std::shared_ptr< avsCommon::sdkInterfaces::RenderPlayerInfoCardsObserverInterface observer)
override

◆ stopPlayback()

void alexaClientSDK::acsdkAudioPlayer::AudioPlayer::stopPlayback ( )
overridevirtual

This function stops playback of the current song.

Deprecated:
Use LocalPlayerControlInterface.playbackStop instead

Implements alexaClientSDK::acsdkAudioPlayerInterfaces::AudioPlayerInterface.


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