![]() |
AlexaClientSDK
3.0.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
|
#include <AplClientBridge.h>
Public Member Functions | |
RequiresShutdown Functions | |
void | doShutdown () override |
AplOptionsInterface Functions | |
{ | |
void | sendMessage (const std::string &token, const std::string &payload) override |
void | resetViewhost (const std::string &token) override |
std::string | downloadResource (const std::string &source) override |
std::chrono::milliseconds | getTimezoneOffset () override |
void | onActivityStarted (const std::string &token, const std::string &source) override |
void | onActivityEnded (const std::string &token, const std::string &source) override |
void | onSendEvent (const std::string &token, const std::string &event) override |
void | onCommandExecutionComplete (const std::string &token, APLClient::AplCommandExecutionEvent event, const std::string &message) override |
void | onRenderDocumentComplete (const std::string &token, bool result, const std::string &error) override |
void | onVisualContextAvailable (const std::string &token, unsigned int stateRequestToken, const std::string &context) override |
void | onSetDocumentIdleTimeout (const std::string &token, const std::chrono::milliseconds &timeout) override |
void | onRenderingEvent (const std::string &token, APLClient::AplRenderingEvent event) override |
void | onFinish (const std::string &token) override |
void | onDataSourceFetchRequestEvent (const std::string &token, const std::string &type, const std::string &payload) override |
void | onRuntimeErrorEvent (const std::string &token, const std::string &payload) override |
void | onExtensionEvent (const std::string &aplToken, const std::string &uri, const std::string &name, const std::string &source, const std::string ¶ms, unsigned int event, std::shared_ptr< APLClient::Extensions::AplCoreExtensionEventCallbackResultInterface > resultCallback) override |
void | logMessage (APLClient::LogLevel level, const std::string &source, const std::string &message) override |
int | getMaxNumberOfConcurrentDownloads () override |
MessagingServerObserverInterface Functions | |
} | |
void | onConnectionOpened () override |
void | onConnectionClosed () override |
AudioPlayerObserverInterface methods | |
void | onPlayerActivityChanged (avsCommon::avs::PlayerActivity state, const Context &context) override |
TemplateRuntimePresentationAdapterObserverInterface Functions | |
} | |
void | renderTemplateCard (const std::string &jsonPayload) override |
void | renderPlayerInfoCard (const std::string &jsonPayload, templateRuntimeInterfaces::TemplateRuntimeObserverInterface::AudioPlayerInfo audioPlayerInfo) override |
void | clearRenderTemplateCard () override |
void | clearPlayerInfoCard () override |
ExternalMediaPlayerObserverInterface methods | |
void | onLoginStateProvided (const std::string &playerId, acsdkExternalMediaPlayerInterfaces::ObservableSessionProperties sessionStateProperties) override |
void | onPlaybackStateProvided (const std::string &playerId, acsdkExternalMediaPlayerInterfaces::ObservablePlaybackStateProperties playbackStateProperties) override |
AplBackstackExtensionObserverInterface Functions | |
} | |
void | onRestoreDocumentState (std::shared_ptr< APLClient::AplDocumentState > documentState) override |
AplAudioPlayerExtensionObserverInterface methods | |
void | onAudioPlayerPlay () override |
} More... | |
void | onAudioPlayerPause () override |
} More... | |
void | onAudioPlayerNext () override |
} More... | |
void | onAudioPlayerPrevious () override |
} More... | |
void | onAudioPlayerSeekToPosition (int offsetInMilliseconds) override |
} More... | |
void | onAudioPlayerToggle (const std::string &name, bool checked) override |
} More... | |
void | onAudioPlayerSkipForward () override |
} More... | |
void | onAudioPlayerSkipBackward () override |
} More... | |
void | onAudioPlayerLyricDataFlushed (const std::string &token, long durationInMilliseconds, const std::string &lyricData) override |
} More... | |
void | onUpdateTimer () |
} More... | |
void | setGUIManager (std::shared_ptr< gui::GUIServerInterface > guiManager) |
} More... | |
APLViewhostInterface functions | |
void | renderDocument (const aplCapabilityCommonInterfaces::PresentationSession &presentationSession, const std::string &token, const std::string &document, const std::string &datasources, const std::string &supportedViewports, const std::string &windowId) override |
void | clearDocument (const std::string &token) override |
void | executeCommands (const std::string &jsonPayload, const std::string &token) override |
void | interruptCommandSequence (const std::string &token) override |
void | dataSourceUpdate (const std::string &sourceType, const std::string &jsonPayload, const std::string &token) override |
void | addObserver (const APLViewhostObserverInterfacePtr &observer) override |
void | removeObserver (const APLViewhostObserverInterfacePtr &observer) override |
void | onRenderDirectiveReceived (const std::string &token, const std::chrono::steady_clock::time_point &receiveTime) override |
std::string | getMaxAPLVersion () const override |
void | setMetricRecorder (std::shared_ptr< avsCommon::utils::metrics::MetricRecorderInterface > metricRecorder) override |
void | provideState (const std::string &aplToken, const unsigned int stateRequestToken) override |
bool | handleBack (const std::string &windowId) override |
![]() | |
virtual | ~APLViewhostInterface ()=default |
virtual void | clearDocument () |
virtual void | interruptCommandSequence () |
![]() | |
virtual | ~VisualStateProviderInterface ()=default |
![]() | |
virtual | ~AudioPlayerObserverInterface ()=default |
virtual void | onSeekActivity (const SeekStatus seekStatus, const Context &context) |
![]() | |
virtual | ~TemplateRuntimePresentationAdapterObserverInterface ()=default |
![]() | |
virtual | ~ExternalMediaPlayerObserverInterface ()=default |
![]() | |
RequiresShutdown (const std::string &name) | |
virtual | ~RequiresShutdown () |
Destructor. More... | |
const std::string & | name () const |
void | shutdown () |
bool | isShutdown () const |
![]() | |
virtual | ~APLClientHandlerInterface ()=default |
Static Public Member Functions | |
static std::shared_ptr< AplClientBridge > | create (std::shared_ptr< CachingDownloadManager > contentDownloadManager, std::shared_ptr< gui::GUIClientInterface > guiClient, AplClientBridgeParameter parameters) |
APLClientHandlerInterface methods | |
void | initializeRenderersRequest (const std::string &message) override |
Alias for APLViewhostObserverInterface function. More... | |
void | metricsReport (const std::string &message) override |
Alias for APLViewhostObserverInterface function. More... | |
void | viewhostEvent (const std::string &message) override |
Alias for APLViewhostObserverInterface function. More... | |
void | renderCompleted (const std::string &message) override |
Alias for APLViewhostObserverInterface function. More... | |
void | renderDocumentRequest (const std::string &message) override |
Alias for APLViewhostObserverInterface function. More... | |
void | executeCommandsRequest (const std::string &message) override |
Alias for APLViewhostObserverInterface function. More... | |
void | clearDocumentRequest (const std::string &message) override |
Alias for APLViewhostObserverInterface function. More... | |
void | onMessage (const std::string &windowId, const std::string &message) |
} More... | |
void | handleRenderingEvent (const std::string &token, APLClient::AplRenderingEvent event) |
Alias for APLViewhostObserverInterface function. More... | |
void | handleDisplayMetrics (const std::string &windowId, const std::string &jsonPayload) |
Alias for APLViewhostObserverInterface function. More... | |
void | initializeRenderer (const std::string &windowId, const std::set< std::string > &supportedExtensions) |
void | registerSharedExtension (const std::shared_ptr< APLClient::Extensions::AplCoreExtensionInterface > &extension) |
std::shared_ptr< APLClient::AplClientRenderer > | getAplClientRendererFromAplToken (const std::string &aplToken) |
std::shared_ptr< APLClient::AplClientRenderer > | getAplClientRendererFromWindowId (const std::string &windowId) |
void | setMediaProperties (std::shared_ptr< avsCommon::sdkInterfaces::MediaPropertiesInterface > mediaProperties) |
void | initialize () |
Additional Inherited Members | |
![]() | |
enum | SeekStatus { SeekStatus::SEEK_START, SeekStatus::SEEK_COMPLETE } |
Enum representing Seek activities. More... | |
|
overridevirtual |
Adds a viewhost observer
observer | the observer to register |
Implements alexaClientSDK::sampleApplications::ipcServerSampleApp::APLViewhostInterface.
|
overridevirtual |
Clear APL document
token | token of document to clear |
Reimplemented from alexaClientSDK::sampleApplications::ipcServerSampleApp::APLViewhostInterface.
|
overridevirtual |
Alias for APLViewhostObserverInterface function.
Implements alexaClientSDK::sampleApplications::ipcServerSampleApp::ipc::APLClientHandlerInterface.
|
overridevirtual |
Used to notify when the player info card should be cleared.
Implements alexaClientSDK::sampleApplications::common::TemplateRuntimePresentationAdapterObserverInterface.
|
overridevirtual |
Used to notify when the render template card should be cleared.
Implements alexaClientSDK::sampleApplications::common::TemplateRuntimePresentationAdapterObserverInterface.
|
static |
|
overridevirtual |
Update the data source payload for a given APL document
sourceType | APL spec source type for data update |
data | JSON string containing new data payload associated with APL document |
token | Presentation token to identify document to update |
Implements alexaClientSDK::sampleApplications::ipcServerSampleApp::APLViewhostInterface.
|
overridevirtual |
Prepares/enables this object to be deleted. This should be the last function called on this object prior to deleting (or resetting) its shared_ptr.
Implements alexaClientSDK::avsCommon::utils::RequiresShutdown.
|
override |
|
overridevirtual |
Execute commands referenced in APL document
document | JSON string containing APL command to execute |
token | Presentation token to identify document to execute commands on |
Implements alexaClientSDK::sampleApplications::ipcServerSampleApp::APLViewhostInterface.
|
overridevirtual |
Alias for APLViewhostObserverInterface function.
Implements alexaClientSDK::sampleApplications::ipcServerSampleApp::ipc::APLClientHandlerInterface.
std::shared_ptr<APLClient::AplClientRenderer> alexaClientSDK::sampleApplications::ipcServerSampleApp::AplClientBridge::getAplClientRendererFromAplToken | ( | const std::string & | aplToken | ) |
Returns a shared pointer to the AplClientRenderer
holding root-context for a given aplToken Note:- This is not a thread safe method, avoid calling this method outside executor
context
the | APL token in context |
APLClientRenderer
if found, else nullptr std::shared_ptr<APLClient::AplClientRenderer> alexaClientSDK::sampleApplications::ipcServerSampleApp::AplClientBridge::getAplClientRendererFromWindowId | ( | const std::string & | windowId | ) |
Returns a shared pointer to the AplClientRenderer
holding root-context for a target window ID Note:- This is not a thread safe method, avoid calling this method outside executor
context
the | window id in context |
APLClientRenderer
if found, else nullptr
|
overridevirtual |
Retrieves the maximum APL version supported by this runtime
Implements alexaClientSDK::sampleApplications::ipcServerSampleApp::APLViewhostInterface.
|
override |
|
override |
|
overridevirtual |
Handle back navigation
windowId | The window ID on which to perform the back action |
Implements alexaClientSDK::sampleApplications::ipcServerSampleApp::APLViewhostInterface.
void alexaClientSDK::sampleApplications::ipcServerSampleApp::AplClientBridge::handleDisplayMetrics | ( | const std::string & | windowId, |
const std::string & | jsonPayload | ||
) |
Alias for APLViewhostObserverInterface function.
void alexaClientSDK::sampleApplications::ipcServerSampleApp::AplClientBridge::handleRenderingEvent | ( | const std::string & | token, |
APLClient::AplRenderingEvent | event | ||
) |
Alias for APLViewhostObserverInterface function.
void alexaClientSDK::sampleApplications::ipcServerSampleApp::AplClientBridge::initialize | ( | ) |
Initializes the IPC handlers implemented by the APLClientBridge.
void alexaClientSDK::sampleApplications::ipcServerSampleApp::AplClientBridge::initializeRenderer | ( | const std::string & | windowId, |
const std::set< std::string > & | supportedExtensions | ||
) |
Initialize empty client renderer and load corresponding supported extensions
windowId | id of the window to be created |
supportedExtensions | URIs of all supported APL extensions for this window |
|
overridevirtual |
Alias for APLViewhostObserverInterface function.
Implements alexaClientSDK::sampleApplications::ipcServerSampleApp::ipc::APLClientHandlerInterface.
|
overridevirtual |
Interrupt active command sequence
token | token of document to interrupt |
Reimplemented from alexaClientSDK::sampleApplications::ipcServerSampleApp::APLViewhostInterface.
|
override |
|
overridevirtual |
Alias for APLViewhostObserverInterface function.
Implements alexaClientSDK::sampleApplications::ipcServerSampleApp::ipc::APLClientHandlerInterface.
|
override |
|
override |
|
override |
}
|
override |
}
|
override |
}
|
override |
}
|
override |
}
|
override |
}
|
override |
}
|
override |
}
|
override |
}
|
override |
|
overridevirtual |
A connection to the server has been closed.
Implements alexaClientSDK::sampleApplications::ipcServerSampleApp::communication::MessagingServerObserverInterface.
|
overridevirtual |
A new connection to the server has been opened.
Implements alexaClientSDK::sampleApplications::ipcServerSampleApp::communication::MessagingServerObserverInterface.
|
override |
|
override |
|
override |
|
overridevirtual |
This function is called when the login state is provided as a state observer
playerId | the ExternalMediaAdapter being reported on |
sessionStateProperties | the observable session properties being reported |
Implements alexaClientSDK::acsdkExternalMediaPlayerInterfaces::ExternalMediaPlayerObserverInterface.
void alexaClientSDK::sampleApplications::ipcServerSampleApp::AplClientBridge::onMessage | ( | const std::string & | windowId, |
const std::string & | message | ||
) |
}
|
overridevirtual |
This function is called when the playback state is provided as a state observer
playerId | the ExternalMediaAdapter being reported on |
playbackStateProperties | the observable playback state properties being reported |
Implements alexaClientSDK::acsdkExternalMediaPlayerInterfaces::ExternalMediaPlayerObserverInterface.
|
overridevirtual |
Used to notify the observer when the AudioPlayer
has a change in PlayerActivity
.
state | The PlayerActivity of the AudioPlayer . |
context | The Context of the AudioPlayer . |
Implements alexaClientSDK::acsdkAudioPlayerInterfaces::AudioPlayerObserverInterface.
|
overridevirtual |
Used for metrics purposes, notifies the APLRuntime of the time when the directive was received
token | token of the document |
receiveTime | The receive time |
Reimplemented from alexaClientSDK::sampleApplications::ipcServerSampleApp::APLViewhostInterface.
|
override |
|
override |
|
override |
|
override |
|
override |
|
override |
void alexaClientSDK::sampleApplications::ipcServerSampleApp::AplClientBridge::onUpdateTimer | ( | ) |
}
|
override |
|
overridevirtual |
A request to a VisualStateProvider
to provide the state. The requester specifies a token which the VisualStateProvider
must use when it updates the state via the onVisualContextAvailable
call to APL
Capability Agent.
token | The token of the last displaying document to get the correct context in the onVisualContextAvailable call. |
stateRequestToken | The token to use in the onVisualContextAvailable call. |
Implements alexaClientSDK::aplCapabilityCommonInterfaces::VisualStateProviderInterface.
void alexaClientSDK::sampleApplications::ipcServerSampleApp::AplClientBridge::registerSharedExtension | ( | const std::shared_ptr< APLClient::Extensions::AplCoreExtensionInterface > & | extension | ) |
Adds the given extension to m_sharedRegisteredExtensions
map.
extension | Pointer to AplCoreExtensionInterface which is being added to m_sharedRegisteredExtensions . |
|
overridevirtual |
Removes a viewhost observer.
observer | the observer to unregister |
Implements alexaClientSDK::sampleApplications::ipcServerSampleApp::APLViewhostInterface.
|
overridevirtual |
Alias for APLViewhostObserverInterface function.
Implements alexaClientSDK::sampleApplications::ipcServerSampleApp::ipc::APLClientHandlerInterface.
|
overridevirtual |
Render an APL document with extra associated data payload
presentationSession | The presentation session associated with this renderDocument request |
document | JSON string containing APL document |
data | JSON string containing data payload associated with APL document |
token | Presentation token uniquely identifying the document |
supportedViewports | Viewports supported by this document |
windowId | Target windowId to display the document within |
Implements alexaClientSDK::sampleApplications::ipcServerSampleApp::APLViewhostInterface.
|
overridevirtual |
Alias for APLViewhostObserverInterface function.
Implements alexaClientSDK::sampleApplications::ipcServerSampleApp::ipc::APLClientHandlerInterface.
|
overridevirtual |
Used to notify when a RenderPlayerInfo presentation is ready to display. Once called, the client should render the PlayerInfo display card based on the metadata provided in the payload in structured JSON format.
jsonPayload | The payload of the RenderPlayerInfo directive in structured JSON format. |
audioPlayerInfo | Information on the AudioPlayer . |
Implements alexaClientSDK::sampleApplications::common::TemplateRuntimePresentationAdapterObserverInterface.
|
overridevirtual |
Used to notify when a RenderTemplate presentation is ready to display. Once called, the client should render the Template display card based on the metadata provided in the payload in structured JSON format.
jsonPayload | The payload of the RenderTemplate directive in structured JSON format. |
Implements alexaClientSDK::sampleApplications::common::TemplateRuntimePresentationAdapterObserverInterface.
|
override |
|
override |
void alexaClientSDK::sampleApplications::ipcServerSampleApp::AplClientBridge::setGUIManager | ( | std::shared_ptr< gui::GUIServerInterface > | guiManager | ) |
}
void alexaClientSDK::sampleApplications::ipcServerSampleApp::AplClientBridge::setMediaProperties | ( | std::shared_ptr< avsCommon::sdkInterfaces::MediaPropertiesInterface > | mediaProperties | ) |
Sets the media properties to be used to extract the media player state
mediaProperties |
|
overridevirtual |
Sets the metrics recorder to be used by the runtime to record and emit metric events.
metricRecorder | Shared pointer to the MetricRecorderInterface |
Implements alexaClientSDK::sampleApplications::ipcServerSampleApp::APLViewhostInterface.
|
overridevirtual |
Alias for APLViewhostObserverInterface function.
Implements alexaClientSDK::sampleApplications::ipcServerSampleApp::ipc::APLClientHandlerInterface.
AlexaClientSDK 3.0.0 - Copyright 2016-2022 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0