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

#include <StaticExternalMediaPlayerAdapterHandler.h>

Inheritance diagram for alexaClientSDK::acsdkExternalMediaPlayer::StaticExternalMediaPlayerAdapterHandler:
Inheritance graph
[legend]
Collaboration diagram for alexaClientSDK::acsdkExternalMediaPlayer::StaticExternalMediaPlayerAdapterHandler:
Collaboration graph
[legend]

Public Member Functions

 StaticExternalMediaPlayerAdapterHandler ()
 Constructor. More...
 
 ~StaticExternalMediaPlayerAdapterHandler () override=default
 Destructor. More...
 
void addAdapter (const std::string &localPlayerId, std::shared_ptr< acsdkExternalMediaPlayerInterfaces::ExternalMediaAdapterInterface > adapter)
 
virtual void doShutdown () override
 alexaClientSDK::avsCommon::utils::RequiresShutdown More...
 
std::vector< acsdkExternalMediaPlayerInterfaces::PlayerInfoupdatePlayerInfo (const std::vector< acsdkExternalMediaPlayerInterfaces::PlayerInfo > &playerList) override
 
bool login (const std::string &localPlayerId, const std::string &accessToken, const std::string &userName, bool forceLogin, std::chrono::milliseconds tokenRefreshInterval) override
 
bool logout (const std::string &localPlayerId) override
 
bool play (const PlayParams &params) override
 
bool playControl (const std::string &localPlayerId, acsdkExternalMediaPlayerInterfaces::RequestType requestType, const std::string &playbackTarget) override
 
bool seek (const std::string &localPlayerId, std::chrono::milliseconds offset) override
 
bool adjustSeek (const std::string &localPlayerId, std::chrono::milliseconds deltaOffset) override
 
acsdkExternalMediaPlayerInterfaces::AdapterState getAdapterState (const std::string &localPlayerId) override
 
std::vector< acsdkExternalMediaPlayerInterfaces::AdapterStategetAdapterStates () override
 
std::chrono::milliseconds getOffset (const std::string &localPlayerId) override
 
void setExternalMediaPlayer (const std::shared_ptr< acsdkExternalMediaPlayerInterfaces::ExternalMediaPlayerInterface > externalMediaPlayer) override
 
- Public Member Functions inherited from alexaClientSDK::acsdkExternalMediaPlayerInterfaces::ExternalMediaAdapterHandlerInterface
 ExternalMediaAdapterHandlerInterface (const std::string &name)
 
virtual ~ExternalMediaAdapterHandlerInterface ()=default
 
virtual std::vector< PlayerInfoupdatePlayerInfo (const std::vector< PlayerInfo > &playerList)=0
 
virtual void setExternalMediaPlayer (const std::shared_ptr< ExternalMediaPlayerInterface > externalMediaPlayer)=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

Constructor & Destructor Documentation

◆ StaticExternalMediaPlayerAdapterHandler()

alexaClientSDK::acsdkExternalMediaPlayer::StaticExternalMediaPlayerAdapterHandler::StaticExternalMediaPlayerAdapterHandler ( )

Constructor.

◆ ~StaticExternalMediaPlayerAdapterHandler()

alexaClientSDK::acsdkExternalMediaPlayer::StaticExternalMediaPlayerAdapterHandler::~StaticExternalMediaPlayerAdapterHandler ( )
overridedefault

Destructor.

Member Function Documentation

◆ addAdapter()

void alexaClientSDK::acsdkExternalMediaPlayer::StaticExternalMediaPlayerAdapterHandler::addAdapter ( const std::string &  localPlayerId,
std::shared_ptr< acsdkExternalMediaPlayerInterfaces::ExternalMediaAdapterInterface adapter 
)

Adds an adapter implementing the ExternalMediaAdapterInterface to the list of adapters and associates it with the provided localPlayerId

Parameters
localPlayerIdthe local player id
adapterAn adapter implementing ExternalMediaAdapterInterface

◆ adjustSeek()

bool alexaClientSDK::acsdkExternalMediaPlayer::StaticExternalMediaPlayerAdapterHandler::adjustSeek ( const std::string &  localPlayerId,
std::chrono::milliseconds  deltaOffset 
)
overridevirtual

Method to seek to an offset from the current position.

Parameters
localPlayerIdThe localPlayerId that this seek control is targeted at
deltaOffsetThe offset to seek to relative to the current offset.
Returns
True if the call was handled

Implements alexaClientSDK::acsdkExternalMediaPlayerInterfaces::ExternalMediaAdapterHandlerInterface.

◆ doShutdown()

void alexaClientSDK::acsdkExternalMediaPlayer::StaticExternalMediaPlayerAdapterHandler::doShutdown ( )
overridevirtual

◆ getAdapterState()

acsdkExternalMediaPlayerInterfaces::AdapterState alexaClientSDK::acsdkExternalMediaPlayer::StaticExternalMediaPlayerAdapterHandler::getAdapterState ( const std::string &  localPlayerId)
overridevirtual

Method to fetch the state(session state and playback state) of an adapter.

Parameters
localPlayerIdThe player ID for which the state is being requested
Returns
The adapter state

Implements alexaClientSDK::acsdkExternalMediaPlayerInterfaces::ExternalMediaAdapterHandlerInterface.

◆ getAdapterStates()

std::vector< acsdkExternalMediaPlayerInterfaces::AdapterState > alexaClientSDK::acsdkExternalMediaPlayer::StaticExternalMediaPlayerAdapterHandler::getAdapterStates ( )
overridevirtual

Method to fetch the state for all adapters handled by this adapter handler

Returns
Vector of all adapter states

Implements alexaClientSDK::acsdkExternalMediaPlayerInterfaces::ExternalMediaAdapterHandlerInterface.

◆ getOffset()

std::chrono::milliseconds alexaClientSDK::acsdkExternalMediaPlayer::StaticExternalMediaPlayerAdapterHandler::getOffset ( const std::string &  localPlayerId)
overridevirtual

This function retrieves the offset of the current track the adapter is handling.

Parameters
localPlayerIdThe player ID for which the offset is being requested
Returns
The offset in milliseconds

Implements alexaClientSDK::acsdkExternalMediaPlayerInterfaces::ExternalMediaAdapterHandlerInterface.

◆ login()

bool alexaClientSDK::acsdkExternalMediaPlayer::StaticExternalMediaPlayerAdapterHandler::login ( const std::string &  localPlayerId,
const std::string &  accessToken,
const std::string &  userName,
bool  forceLogin,
std::chrono::milliseconds  tokenRefreshInterval 
)
overridevirtual

Method to allow a user to login to a third party music provider.

Parameters
localPlayerIdThe local player ID being logged in
accessTokenThe access context of the user identifier.
userNameThe userName of the user logging in.
forceLoginbool which signifies if the adapter has to a force a login or merely cache the access token.
tokenRefreshIntervalThe duration in milliseconds for which the accessToken is valid.
Returns
True if the call was handled

Implements alexaClientSDK::acsdkExternalMediaPlayerInterfaces::ExternalMediaAdapterHandlerInterface.

◆ logout()

bool alexaClientSDK::acsdkExternalMediaPlayer::StaticExternalMediaPlayerAdapterHandler::logout ( const std::string &  localPlayerId)
overridevirtual

Method that handles logging out a user from a third party library/cloud.

Parameters
localPlayerIdThe local player ID being logged out
Returns
True if the call was handled

Implements alexaClientSDK::acsdkExternalMediaPlayerInterfaces::ExternalMediaAdapterHandlerInterface.

◆ play()

bool alexaClientSDK::acsdkExternalMediaPlayer::StaticExternalMediaPlayerAdapterHandler::play ( const PlayParams params)
overridevirtual

Method to allow a user to initiate play from a third party music service provider based on a play context.

Parameters
paramsPlay parameters required for playback
Returns
True if the call was handled

Implements alexaClientSDK::acsdkExternalMediaPlayerInterfaces::ExternalMediaAdapterHandlerInterface.

◆ playControl()

bool alexaClientSDK::acsdkExternalMediaPlayer::StaticExternalMediaPlayerAdapterHandler::playControl ( const std::string &  localPlayerId,
acsdkExternalMediaPlayerInterfaces::RequestType  requestType,
const std::string &  playbackTarget 
)
overridevirtual

Method to initiate the different types of play control like PLAY/PAUSE/RESUME/NEXT/...

Parameters
localPlayerIdThe localPlayerId that this play control is targeted at
requestTypeThe type of REQUEST. Will always be PLAY/PAUSE/RESUME/NEXT...
playbackTargetPlayback target to handle play control with
Returns
True if the call was handled

Implements alexaClientSDK::acsdkExternalMediaPlayerInterfaces::ExternalMediaAdapterHandlerInterface.

◆ seek()

bool alexaClientSDK::acsdkExternalMediaPlayer::StaticExternalMediaPlayerAdapterHandler::seek ( const std::string &  localPlayerId,
std::chrono::milliseconds  offset 
)
overridevirtual

Method to seek to the given offset.

Parameters
localPlayerIdThe localPlayerId that this seek control is targeted at
offsetThe offset to seek to.
Returns
True if the call was handled

Implements alexaClientSDK::acsdkExternalMediaPlayerInterfaces::ExternalMediaAdapterHandlerInterface.

◆ setExternalMediaPlayer()

void alexaClientSDK::acsdkExternalMediaPlayer::StaticExternalMediaPlayerAdapterHandler::setExternalMediaPlayer ( const std::shared_ptr< acsdkExternalMediaPlayerInterfaces::ExternalMediaPlayerInterface externalMediaPlayer)
override

◆ updatePlayerInfo()

std::vector< PlayerInfo > alexaClientSDK::acsdkExternalMediaPlayer::StaticExternalMediaPlayerAdapterHandler::updatePlayerInfo ( const std::vector< acsdkExternalMediaPlayerInterfaces::PlayerInfo > &  playerList)
override

ExternalMediaPlayerAdapterHandlerInterface functions


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

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