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

#include <MockMediaPlayer.h>

Inheritance diagram for alexaClientSDK::avsCommon::utils::mediaPlayer::test::MockMediaPlayerHelper:
Inheritance graph
[legend]
Collaboration diagram for alexaClientSDK::avsCommon::utils::mediaPlayer::test::MockMediaPlayerHelper:
Collaboration graph
[legend]

Public Member Functions

virtual SourceId attachmentSetSource (std::shared_ptr< avsCommon::avs::attachment::AttachmentReader > attachmentReader, const avsCommon::utils::AudioFormat *audioFormat)=0
 
virtual SourceId streamSetSource (std::shared_ptr< std::istream > stream, bool repeat)=0
 
virtual SourceId urlSetSource (const std::string &url)=0
 
- Public Member Functions inherited from alexaClientSDK::avsCommon::utils::mediaPlayer::MediaPlayerInterface
virtual ~MediaPlayerInterface ()=default
 
virtual SourceId setSource (std::shared_ptr< avsCommon::avs::attachment::AttachmentReader > attachmentReader, const avsCommon::utils::AudioFormat *format=nullptr, const SourceConfig &config=emptySourceConfig())=0
 
virtual SourceId setSource (std::shared_ptr< avsCommon::avs::attachment::AttachmentReader > attachmentReader, std::chrono::milliseconds offsetAdjustment, const avsCommon::utils::AudioFormat *format=nullptr, const SourceConfig &config=emptySourceConfig())=0
 
virtual SourceId setSource (const std::string &url, std::chrono::milliseconds offset=std::chrono::milliseconds::zero(), const SourceConfig &config=emptySourceConfig(), bool repeat=false, const PlaybackContext &playbackContext=PlaybackContext())=0
 
virtual SourceId setSource (std::shared_ptr< std::istream > stream, bool repeat=false, const SourceConfig &config=emptySourceConfig(), avsCommon::utils::MediaType format=avsCommon::utils::MediaType::UNKNOWN)=0
 
virtual bool play (SourceId id)=0
 
virtual bool stop (SourceId id)=0
 
virtual bool stop (SourceId id, std::chrono::seconds timeToPipelineShutdown)
 
virtual bool pause (SourceId id)=0
 
virtual bool resume (SourceId id)=0
 
virtual bool seekTo (SourceId id, std::chrono::milliseconds location, bool fromStart)
 
virtual std::chrono::milliseconds getOffset (SourceId id)=0
 
virtual uint64_t getNumBytesBuffered ()=0
 
virtual utils::Optional< avsCommon::utils::mediaPlayer::MediaPlayerStategetMediaPlayerState (SourceId id)=0
 
virtual void addObserver (std::shared_ptr< avsCommon::utils::mediaPlayer::MediaPlayerObserverInterface > playerObserver)=0
 
virtual void removeObserver (std::shared_ptr< avsCommon::utils::mediaPlayer::MediaPlayerObserverInterface > playerObserver)=0
 
virtual utils::Optional< PlaybackAttributesgetPlaybackAttributes ()
 
virtual std::vector< PlaybackReportgetPlaybackReports ()
 
virtual utils::Optional< FingerprintgetFingerprint ()
 

Additional Inherited Members

- Public Types inherited from alexaClientSDK::avsCommon::utils::mediaPlayer::MediaPlayerInterface
using SourceId = uint64_t
 A type that identifies which source is currently being operated on. This must be unique across all instances. More...
 
- Static Public Attributes inherited from alexaClientSDK::avsCommon::utils::mediaPlayer::MediaPlayerInterface
static const SourceId ERROR = 0
 An SourceId used to represent an error from calls to setSource(). More...
 

Detailed Description

Interface to add virtual functions to MediaPlayerInterface to allow for mocking / EXPECT of polymorphic methods.

Member Function Documentation

◆ attachmentSetSource()

virtual SourceId alexaClientSDK::avsCommon::utils::mediaPlayer::test::MockMediaPlayerHelper::attachmentSetSource ( std::shared_ptr< avsCommon::avs::attachment::AttachmentReader attachmentReader,
const avsCommon::utils::AudioFormat audioFormat 
)
pure virtual

Variant of setSource() taking an attachment reader.

Parameters
attachmentReaderThe attachment from which to read audio data.
audioFormatThe audioFormat to be used when playing raw PCM data.
Returns
The SourceId used by MediaPlayerInterface to identify this setSource() request.

◆ streamSetSource()

virtual SourceId alexaClientSDK::avsCommon::utils::mediaPlayer::test::MockMediaPlayerHelper::streamSetSource ( std::shared_ptr< std::istream >  stream,
bool  repeat 
)
pure virtual

Variant of setSource() taking an istream from which to read audio data.

Parameters
streamThe stream from which to read audio data.
repeatWhether or not to repeat playing the audio.
Returns
The SourceId used by MediaPlayerInterface to identify this setSource() request.

◆ urlSetSource()

virtual SourceId alexaClientSDK::avsCommon::utils::mediaPlayer::test::MockMediaPlayerHelper::urlSetSource ( const std::string &  url)
pure virtual

Variant of setSource() taking a URL with which to fetch audio data.

Parameters
urlThe URL with which to fetch the audio data.
Returns
The SourceId used by MediaPlayerInterface to identify this setSource() request.

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