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

#include <SourceInterface.h>

Inheritance diagram for alexaClientSDK::mediaPlayer::SourceInterface:
Inheritance graph
[legend]
Collaboration diagram for alexaClientSDK::mediaPlayer::SourceInterface:
Collaboration graph
[legend]

Public Member Functions

 SourceInterface (const std::string &className)
 
virtual ~SourceInterface ()=default
 
virtual bool handleEndOfStream ()=0
 
virtual bool hasAdditionalData ()=0
 
virtual void preprocess ()=0
 
virtual bool isPlaybackRemote () const =0
 
virtual void addObserver (std::shared_ptr< SourceObserverInterface > observer)=0
 
virtual void removeObserver (std::shared_ptr< SourceObserverInterface > observer)=0
 
- 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
 

Additional Inherited Members

- Protected Member Functions inherited from alexaClientSDK::avsCommon::utils::RequiresShutdown
virtual void doShutdown ()=0
 

Detailed Description

Interface to request operations on an audio source.

Constructor & Destructor Documentation

◆ SourceInterface()

alexaClientSDK::mediaPlayer::SourceInterface::SourceInterface ( const std::string &  className)
inline

Constructor, which also constructs RequiresShutdown.

Parameters
classNameThe name of the class to be passed to RequiresShutdown.

◆ ~SourceInterface()

virtual alexaClientSDK::mediaPlayer::SourceInterface::~SourceInterface ( )
virtualdefault

Destructor.

Member Function Documentation

◆ addObserver()

virtual void alexaClientSDK::mediaPlayer::SourceInterface::addObserver ( std::shared_ptr< SourceObserverInterface observer)
pure virtual

Adds an observer to be notified of particular events which occur on this source.

Parameters
observerThe observer to add.

Implemented in alexaClientSDK::mediaPlayer::BaseStreamSource.

◆ handleEndOfStream()

virtual bool alexaClientSDK::mediaPlayer::SourceInterface::handleEndOfStream ( )
pure virtual

Internally, a source may need additional processing after EOS is reached. This function will process that data.

Returns
A boolean indicating whether the process operation was successful.

Implemented in alexaClientSDK::mediaPlayer::BaseStreamSource.

◆ hasAdditionalData()

virtual bool alexaClientSDK::mediaPlayer::SourceInterface::hasAdditionalData ( )
pure virtual

Internally, a source may have additional data after processing an EOS. This function indicates whether there is additional data, and should be called after handleEndOfStream().

Returns
A boolean indicating whether the source has additional data to be played.

Implemented in alexaClientSDK::mediaPlayer::BaseStreamSource.

◆ isPlaybackRemote()

virtual bool alexaClientSDK::mediaPlayer::SourceInterface::isPlaybackRemote ( ) const
pure virtual

Indicates whether a source is local or remote from the perspective of the MediaPlayer (e.g. playing out of the SDS is local, playing a URL is remote).

Returns
A boolean indicating whether the source is from a remote or local source

Implemented in alexaClientSDK::mediaPlayer::AttachmentReaderSource.

◆ preprocess()

virtual void alexaClientSDK::mediaPlayer::SourceInterface::preprocess ( )
pure virtual

Perform preprocessing of the source. Must be called before reading from the source.

Implemented in alexaClientSDK::mediaPlayer::BaseStreamSource.

◆ removeObserver()

virtual void alexaClientSDK::mediaPlayer::SourceInterface::removeObserver ( std::shared_ptr< SourceObserverInterface observer)
pure virtual

Removes an observer from being notified of particular events which occur on this source.

Parameters
observerThe observer to remove.

Implemented in alexaClientSDK::mediaPlayer::BaseStreamSource.


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

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