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

#include <PlaybackRouter.h>

Inheritance diagram for alexaClientSDK::capabilityAgents::playbackController::PlaybackRouter:
Inheritance graph
[legend]
Collaboration diagram for alexaClientSDK::capabilityAgents::playbackController::PlaybackRouter:
Collaboration graph
[legend]

Public Member Functions

virtual ~PlaybackRouter ()=default
 
@c PlaybackRouterInterface functions.
virtual void buttonPressed (avsCommon::avs::PlaybackButton button) override
 
virtual void togglePressed (avsCommon::avs::PlaybackToggle toggle, bool action) override
 
virtual void switchToDefaultHandler () override
 
virtual void setHandler (std::shared_ptr< avsCommon::sdkInterfaces::PlaybackHandlerInterface > handler, std::shared_ptr< avsCommon::sdkInterfaces::LocalPlaybackHandlerInterface > localHandler=nullptr) override
 
virtual void useDefaultHandlerWith (std::shared_ptr< avsCommon::sdkInterfaces::LocalPlaybackHandlerInterface > localHandler) override
 
virtual bool localOperation (avsCommon::sdkInterfaces::LocalPlaybackHandlerInterface::PlaybackOperation op) override
 
virtual bool localSeekTo (std::chrono::milliseconds location, bool fromStart) override
 
- Public Member Functions inherited from alexaClientSDK::avsCommon::sdkInterfaces::PlaybackRouterInterface
virtual ~PlaybackRouterInterface ()=default
 
virtual void setHandler (std::shared_ptr< PlaybackHandlerInterface > handler, std::shared_ptr< LocalPlaybackHandlerInterface > localHandler=nullptr)=0
 
virtual void useDefaultHandlerWith (std::shared_ptr< LocalPlaybackHandlerInterface > localHandler)
 
- 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< PlaybackRouterInterfacecreatePlaybackRouterInterface (std::shared_ptr< avsCommon::sdkInterfaces::PlaybackHandlerInterface > defaultHandler, std::shared_ptr< acsdkShutdownManagerInterfaces::ShutdownNotifierInterface > shutdownNotifier)
 
static std::shared_ptr< PlaybackRoutercreate (std::shared_ptr< avsCommon::sdkInterfaces::PlaybackHandlerInterface > defaultHandler)
 

Additional Inherited Members

Constructor & Destructor Documentation

◆ ~PlaybackRouter()

virtual alexaClientSDK::capabilityAgents::playbackController::PlaybackRouter::~PlaybackRouter ( )
virtualdefault

Destructor.

Member Function Documentation

◆ buttonPressed()

void alexaClientSDK::capabilityAgents::playbackController::PlaybackRouter::buttonPressed ( avsCommon::avs::PlaybackButton  button)
overridevirtual

This method can be called by the client when a Button is pressed on a physical button or on the GUI. A ButtonCommandIssued event message will be sent to the observer. NOTE: Instances may attempt to handle button locally first.

Parameters
buttonThe PlaybackButton type being pressed

Implements alexaClientSDK::avsCommon::sdkInterfaces::PlaybackRouterInterface.

◆ create()

std::shared_ptr< PlaybackRouter > alexaClientSDK::capabilityAgents::playbackController::PlaybackRouter::create ( std::shared_ptr< avsCommon::sdkInterfaces::PlaybackHandlerInterface defaultHandler)
static

Create an instance of @ PlaybackRouter.

Parameters
defaultHandlerThe default playback handler.
Deprecated:
Use createPlaybackRouterInterface.
Returns
A std::shared_ptr to the new @ PlaybackRouter instance.

◆ createPlaybackRouterInterface()

std::shared_ptr< PlaybackRouterInterface > alexaClientSDK::capabilityAgents::playbackController::PlaybackRouter::createPlaybackRouterInterface ( std::shared_ptr< avsCommon::sdkInterfaces::PlaybackHandlerInterface defaultHandler,
std::shared_ptr< acsdkShutdownManagerInterfaces::ShutdownNotifierInterface shutdownNotifier 
)
static

Create an instance of @ PlaybackRouterInterface.

Parameters
defaultHandlerThe default playback handler.
shutdownNotifierThe ShutdownNotifierInterface to notify this instance when to shut down.
Returns
A std::shared_ptr to the new @ PlaybackRouterInterface instance.

◆ localOperation()

bool alexaClientSDK::capabilityAgents::playbackController::PlaybackRouter::localOperation ( avsCommon::sdkInterfaces::LocalPlaybackHandlerInterface::PlaybackOperation  op)
overridevirtual

Request the handler to perform a local playback operation. NOTE: If local operation is not possable, Instances may fall back on ButtonPressed

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

Reimplemented from alexaClientSDK::avsCommon::sdkInterfaces::PlaybackRouterInterface.

◆ localSeekTo()

bool alexaClientSDK::capabilityAgents::playbackController::PlaybackRouter::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.

Reimplemented from alexaClientSDK::avsCommon::sdkInterfaces::PlaybackRouterInterface.

◆ setHandler()

void alexaClientSDK::capabilityAgents::playbackController::PlaybackRouter::setHandler ( std::shared_ptr< avsCommon::sdkInterfaces::PlaybackHandlerInterface handler,
std::shared_ptr< avsCommon::sdkInterfaces::LocalPlaybackHandlerInterface localHandler = nullptr 
)
overridevirtual

◆ switchToDefaultHandler()

void alexaClientSDK::capabilityAgents::playbackController::PlaybackRouter::switchToDefaultHandler ( )
overridevirtual

This method switches playback button pressess handling to the default handler.

Implements alexaClientSDK::avsCommon::sdkInterfaces::PlaybackRouterInterface.

◆ togglePressed()

void alexaClientSDK::capabilityAgents::playbackController::PlaybackRouter::togglePressed ( avsCommon::avs::PlaybackToggle  toggle,
bool  action 
)
overridevirtual

This method can be called by the client when a Toggle is pressed on a physical button or on the GUI. A ToggleCommandIssued event message will be sent to the observer.

Parameters
toggleThe PlaybackToggle type being pressed
actionThe boolean action for the toggle state

Implements alexaClientSDK::avsCommon::sdkInterfaces::PlaybackRouterInterface.

◆ useDefaultHandlerWith()

void alexaClientSDK::capabilityAgents::playbackController::PlaybackRouter::useDefaultHandlerWith ( std::shared_ptr< avsCommon::sdkInterfaces::LocalPlaybackHandlerInterface localHandler)
overridevirtual

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