AlexaClientSDK  3.0.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
Public Member Functions | List of all members
alexaClientSDK::mediaPlayer::test::MockPlayerObserver Class Reference
Inheritance diagram for alexaClientSDK::mediaPlayer::test::MockPlayerObserver:
Inheritance graph
[legend]
Collaboration diagram for alexaClientSDK::mediaPlayer::test::MockPlayerObserver:
Collaboration graph
[legend]

Public Member Functions

 ~MockPlayerObserver ()
 
void onPlaybackStarted (SourceId id, const MediaPlayerState &state) override
 
void onPlaybackFinished (SourceId id, const MediaPlayerState &state) override
 
void onPlaybackError (SourceId id, const ErrorType &type, std::string error, const MediaPlayerState &state) override
 
void onPlaybackPaused (SourceId id, const MediaPlayerState &state) override
 
void onPlaybackResumed (SourceId id, const MediaPlayerState &state) override
 
void onPlaybackStopped (SourceId id, const MediaPlayerState &state) override
 
void onBufferingComplete (SourceId id, const MediaPlayerState &state) override
 
void onTags (SourceId id, std::unique_ptr< const VectorOfTags > vectorOfTags, const MediaPlayerState &state) override
 
void onFirstByteRead (SourceId id, const MediaPlayerState &state) override
 
bool waitForPlaybackStarted (SourceId id, const std::chrono::milliseconds duration=std::chrono::milliseconds(5000))
 
bool waitForPlaybackFinished (SourceId id, const std::chrono::milliseconds duration=std::chrono::milliseconds(5000))
 
bool waitForPlaybackPaused (SourceId id, const std::chrono::milliseconds duration=std::chrono::milliseconds(5000))
 
bool waitForPlaybackResumed (SourceId id, const std::chrono::milliseconds duration=std::chrono::milliseconds(5000))
 
bool waitForPlaybackStopped (SourceId id, const std::chrono::milliseconds duration=std::chrono::milliseconds(5000))
 
bool waitForPlaybackError (SourceId id, const std::chrono::milliseconds duration=std::chrono::milliseconds(5000))
 
bool waitForBufferingComplete (SourceId id, const std::chrono::milliseconds duration=std::chrono::milliseconds(5000))
 
bool waitForTags (SourceId id, const std::chrono::milliseconds duration=std::chrono::milliseconds(5000))
 
int getOnPlaybackStartedCallCount ()
 
int getOnPlaybackFinishedCallCount ()
 
int getOnTagsCallCount ()
 
- 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 &)
 

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
 

Constructor & Destructor Documentation

◆ ~MockPlayerObserver()

alexaClientSDK::mediaPlayer::test::MockPlayerObserver::~MockPlayerObserver ( )
inline

Destructor.

Member Function Documentation

◆ getOnPlaybackFinishedCallCount()

int alexaClientSDK::mediaPlayer::test::MockPlayerObserver::getOnPlaybackFinishedCallCount ( )

TODO: Make this class a mock and remove this.

This gets the number of times onPlaybackFinished was called.

◆ getOnPlaybackStartedCallCount()

int alexaClientSDK::mediaPlayer::test::MockPlayerObserver::getOnPlaybackStartedCallCount ( )

TODO: Make this class a mock and remove this.

This gets the number of times onPlaybackStarted was called.

◆ getOnTagsCallCount()

int alexaClientSDK::mediaPlayer::test::MockPlayerObserver::getOnTagsCallCount ( )

TODO: Make this class a mock and remove this.

This gets the number of times onTags was called.

◆ onBufferingComplete()

void alexaClientSDK::mediaPlayer::test::MockPlayerObserver::onBufferingComplete ( SourceId  id,
const MediaPlayerState state 
)
override

◆ onFirstByteRead()

void alexaClientSDK::mediaPlayer::test::MockPlayerObserver::onFirstByteRead ( SourceId  id,
const MediaPlayerState state 
)
override

◆ onPlaybackError()

void alexaClientSDK::mediaPlayer::test::MockPlayerObserver::onPlaybackError ( SourceId  id,
const ErrorType type,
std::string  error,
const MediaPlayerState state 
)
override

◆ onPlaybackFinished()

void alexaClientSDK::mediaPlayer::test::MockPlayerObserver::onPlaybackFinished ( SourceId  id,
const MediaPlayerState state 
)
override

◆ onPlaybackPaused()

void alexaClientSDK::mediaPlayer::test::MockPlayerObserver::onPlaybackPaused ( SourceId  id,
const MediaPlayerState state 
)
override

◆ onPlaybackResumed()

void alexaClientSDK::mediaPlayer::test::MockPlayerObserver::onPlaybackResumed ( SourceId  id,
const MediaPlayerState state 
)
override

◆ onPlaybackStarted()

void alexaClientSDK::mediaPlayer::test::MockPlayerObserver::onPlaybackStarted ( SourceId  id,
const MediaPlayerState state 
)
override

◆ onPlaybackStopped()

void alexaClientSDK::mediaPlayer::test::MockPlayerObserver::onPlaybackStopped ( SourceId  id,
const MediaPlayerState state 
)
override

◆ onTags()

void alexaClientSDK::mediaPlayer::test::MockPlayerObserver::onTags ( SourceId  id,
std::unique_ptr< const VectorOfTags vectorOfTags,
const MediaPlayerState state 
)
override

◆ waitForBufferingComplete()

bool alexaClientSDK::mediaPlayer::test::MockPlayerObserver::waitForBufferingComplete ( SourceId  id,
const std::chrono::milliseconds  duration = std::chrono::milliseconds(5000) 
)

Wait for a buffering complete message to be received.

This function waits for a specified number of milliseconds for a message to arrive.

Parameters
idThe SourceId expected in a callback.
durationNumber of milliseconds to wait before giving up.
Returns
true if a message was received within the specified duration, else false.

◆ waitForPlaybackError()

bool alexaClientSDK::mediaPlayer::test::MockPlayerObserver::waitForPlaybackError ( SourceId  id,
const std::chrono::milliseconds  duration = std::chrono::milliseconds(5000) 
)

Wait for a playback error message to be received.

This function waits for a specified number of milliseconds for a message to arrive.

Parameters
idThe SourceId expected in a callback.
durationNumber of milliseconds to wait before giving up.
Returns
true if a message was received within the specified duration, else false.

◆ waitForPlaybackFinished()

bool alexaClientSDK::mediaPlayer::test::MockPlayerObserver::waitForPlaybackFinished ( SourceId  id,
const std::chrono::milliseconds  duration = std::chrono::milliseconds(5000) 
)

Wait for a message to be received.

This function waits for a specified number of milliseconds for a message to arrive.

Parameters
idThe SourceId expected in a callback.
durationNumber of milliseconds to wait before giving up.
Returns
true if a message was received within the specified duration, else false.

◆ waitForPlaybackPaused()

bool alexaClientSDK::mediaPlayer::test::MockPlayerObserver::waitForPlaybackPaused ( SourceId  id,
const std::chrono::milliseconds  duration = std::chrono::milliseconds(5000) 
)

Wait for a message to be received.

This function waits for a specified number of milliseconds for a message to arrive.

Parameters
idThe SourceId expected in a callback.
durationNumber of milliseconds to wait before giving up.
Returns
true if a message was received within the specified duration, else false.

◆ waitForPlaybackResumed()

bool alexaClientSDK::mediaPlayer::test::MockPlayerObserver::waitForPlaybackResumed ( SourceId  id,
const std::chrono::milliseconds  duration = std::chrono::milliseconds(5000) 
)

Wait for a message to be received.

This function waits for a specified number of milliseconds for a message to arrive.

Parameters
idThe SourceId expected in a callback.
durationNumber of milliseconds to wait before giving up.
Returns
true if a message was received within the specified duration, else false.

◆ waitForPlaybackStarted()

bool alexaClientSDK::mediaPlayer::test::MockPlayerObserver::waitForPlaybackStarted ( SourceId  id,
const std::chrono::milliseconds  duration = std::chrono::milliseconds(5000) 
)

Wait for a message to be received.

This function waits for a specified number of milliseconds for a message to arrive.

Parameters
idThe SourceId expected in a callback.
durationNumber of milliseconds to wait before giving up.
Returns
true if a message was received within the specified duration, else false.

◆ waitForPlaybackStopped()

bool alexaClientSDK::mediaPlayer::test::MockPlayerObserver::waitForPlaybackStopped ( SourceId  id,
const std::chrono::milliseconds  duration = std::chrono::milliseconds(5000) 
)

Wait for a message to be received.

This function waits for a specified number of milliseconds for a message to arrive.

Parameters
idThe SourceId expected in a callback.
durationNumber of milliseconds to wait before giving up.
Returns
true if a message was received within the specified duration, else false.

◆ waitForTags()

bool alexaClientSDK::mediaPlayer::test::MockPlayerObserver::waitForTags ( SourceId  id,
const std::chrono::milliseconds  duration = std::chrono::milliseconds(5000) 
)

Wait for a message to be received. This function waits for a specified number of milliseconds for a message to arrive.

Parameters
idThe SourceId expected in a callback.
durationNumber of milliseconds to wait before giving up.
Returns
true if a message was received within the specified duration, else false.

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