Alexa Auto SDK
4.3
|
Classes | |
class | LocalMediaSourceState |
class | PlaybackState |
class | SessionState |
Public Member Functions | |
virtual bool | play (ContentSelector contentSelectorType, const std::string &payload) |
virtual bool | play (ContentSelector contentSelectorType, const std::string &payload, const std::string &sessionId) |
virtual bool | playControl (PlayControlType controlType)=0 |
virtual bool | seek (std::chrono::milliseconds offset)=0 |
virtual bool | adjustSeek (std::chrono::milliseconds deltaOffset)=0 |
virtual LocalMediaSourceState | getState ()=0 |
virtual bool | volumeChanged (float volume)=0 |
virtual bool | mutedStateChanged (MutedState state)=0 |
Source | getSource () |
void | playerEvent (const std::string &eventName, const std::string &sessionId="") |
void | playerError (const std::string &errorName, long code, const std::string &description, bool fatal, const std::string &sessionId="") |
void | setFocus (bool focusAcquire=true) |
LocalMediaSource
should be extended to use Alexa to switch among media sources local to the device. It supports bluetooth, USB, FM radio, AM radio, satellite radio, audio line, and CD player sources.
|
strong |
The Local Media Source type
|
strong |
|
virtual |
LocalMediaSource::play(ContentSelector contentSelectorType, const std::string& payload, const std::string& sessionId)
instead Called when the user calls play with a content selection type[in] | ContentSelector | Content selection type |
[in] | payload | Content selector payload (e.g. "1", "98.7 FM HD 1", "bbc radio four") |
true
if the platform implementation successfully handled the call, else false
|
virtual |
Called when the user calls play with a content selection type
[in] | ContentSelector | Content selection type |
[in] | payload | Content selector payload (e.g. "1", "98.7 FM HD 1", "bbc radio four") |
sessionId | A universally unique identifier (UUID) generated according to the RFC 4122 specification. Since Alexa is starting the session here, use this session Id for further events and errors. |
true
if the platform implementation successfully handled the call, else false
|
pure virtual |
Occurs during playback control via voice interaction
[in] | controlType | Playback control type being invoked |
true
if the platform implementation successfully handled the call, else false
|
pure virtual |
Called when the user invokes media seek via speech.
[in] | offset | Offset position within media item, in milliseconds |
true
if the platform implementation successfully handled the call, else false
|
pure virtual |
Called when the user invokes media seek adjustment via speech.
[in] | deltaOffset | Change in offset position within media item, in milliseconds |
true
if the platform implementation successfully handled the call, else false
|
pure virtual |
Must provide the local media source , and information to maintain cloud sync
|
pure virtual |
Notifies the platform implementation to set the volume of the output channel. The volume
value should be scaled to fit the needs of the platform.
[in] | volume | The volume to set on the output channel. volume is in the range [0,1]. |
true
if the platform implementation successfully handled the call, else false
|
pure virtual |
Notifies the platform implementation to apply a muted state has changed for the output channel
[in] | state | The muted state to apply to the output channel. MutedState::MUTED when the output channel be muted, MutedState::UNMUTED when unmuted |
true
if the platform implementation successfully handled the call, else false
LocalMediaSource::Source aace::alexa::LocalMediaSource::getSource | ( | ) |
Return the source type the interface registered with
void aace::alexa::LocalMediaSource::playerEvent | ( | const std::string & | eventName, |
const std::string & | sessionId = "" |
||
) |
Should be called on a local media source player event. This will sync the context with AVS. Note: PlaybackSessionStarted and PlaybackSessionEnded handles the setFocus(true) and setFocus(false) internally. Do not call the deprecated setFocus method.
[in] | eventName | Canonical event name. Accepted values:
|
[in] | sessionId | A universally unique identifier (UUID) generated according to the RFC 4122 specification. If playback session is started because of LocalMediaSource::play(ContentSelector contentSelectorType, const std::string& payload, const std::string& sessionId) , use the same session Id. If the session is started due to any other reason, generate unique UUID and use it as a session ID until session is not ended. |
void aace::alexa::LocalMediaSource::playerError | ( | const std::string & | errorName, |
long | code, | ||
const std::string & | description, | ||
bool | fatal, | ||
const std::string & | sessionId = "" |
||
) |
Should be called on a local media source player error.
[in] | errorName | The name of the error. Accepted values:
|
[in] | code | The error code |
[in] | description | The detailed error description |
[in] | fatal | true if the error is fatal |
[in] | sessionId | A universally unique identifier (UUID) generated according to the RFC 4122 specification. If playback session is started because of LocalMediaSource::play(ContentSelector contentSelectorType, const std::string& payload, const std::string& sessionId) , use the same session Id. If the session is started due to any other reason, generate unique UUID and use it as a session ID until session is not ended. |
void aace::alexa::LocalMediaSource::setFocus | ( | bool | focusAcquire = true | ) |
LocalMediaSource::playerEvent(const std::string& eventName, const std::string& sessionId)
instead with playbackSessionStarted and playbackSessionEnded events Should be called on local media source player events. This will switch the media focus to that context. Note: PlaybackSessionStarted and PlaybackSessionEnded handles the setFocus(true) and setFocus(false) internally. Do not call the deprecated setFocus method. Alexa Auto SDK 4.3 - Copyright 2017-2023 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0