Alexa Auto SDK  2.0.0
Classes | Public Types | Public Member Functions | List of all members
aace::alexa::LocalMediaSource Class Referenceabstract

Classes

class  LocalMediaSourceState
 
class  PlaybackState
 
class  SessionState
 

Public Types

enum  Source {
  Source::BLUETOOTH,
  Source::USB,
  Source::FM_RADIO,
  Source::AM_RADIO,
  Source::SATELLITE_RADIO,
  Source::LINE_IN,
  Source::COMPACT_DISC,
  Source::SIRIUS_XM,
  Source::DAB
}
 
enum  ContentSelector {
  ContentSelector::FREQUENCY,
  ContentSelector::CHANNEL,
  ContentSelector::PRESET
}
 
using PlayControlType = ExternalMediaAdapter::PlayControlType
 

Public Member Functions

virtual bool play (ContentSelector contentSelectorType, const std::string &payload)=0
 
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)
 
void playerError (const std::string &errorName, long code, const std::string &description, bool fatal)
 
void setFocus ()
 

Detailed Description

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. It enables playback for these sources via Alexa (e.g. "Alexa, play the CD player"), or via the playback controller.

See also
PlaybackController

Member Typedef Documentation

◆ PlayControlType

using aace::alexa::LocalMediaSource::PlayControlType = ExternalMediaAdapter::PlayControlType
See also
ExternalMediaAdapterState

Member Enumeration Documentation

◆ Source

The Local Media Source type

Enumerator
BLUETOOTH 

bluetooth source

USB 

USB source

FM_RADIO 

FM radio source

AM_RADIO 

AM radio source

SATELLITE_RADIO 

satellite radio source

LINE_IN 

audio line source

COMPACT_DISC 

CD player source

SIRIUS_XM 

SIRIUS XM source

DAB 

DAB source

◆ ContentSelector

The Local Media Content Selection type for the play directive

Enumerator
FREQUENCY 

radio station selection

CHANNEL 

radio channel selection

PRESET 

preset selection

Member Function Documentation

◆ play()

virtual bool aace::alexa::LocalMediaSource::play ( ContentSelector  contentSelectorType,
const std::string &  payload 
)
pure virtual

Called when the user calls play with a content selection type

Parameters
[in]ContentSelectorContent selection type
[in]payloadContent selector payload (i.e. "1", "98.7 FM HD 1")
Returns
true if the platform implementation successfully handled the call, else false

◆ playControl()

virtual bool aace::alexa::LocalMediaSource::playControl ( PlayControlType  controlType)
pure virtual

Occurs during playback control via voice interaction or PlaybackController interface

Parameters
[in]controlTypePlayback control type being invoked
Returns
true if the platform implementation successfully handled the call, else false
See also
PlaybackController

◆ seek()

virtual bool aace::alexa::LocalMediaSource::seek ( std::chrono::milliseconds  offset)
pure virtual

Called when the user invokes media seek via speech.

Parameters
[in]offsetOffset position within media item, in milliseconds
Returns
true if the platform implementation successfully handled the call, else false

◆ adjustSeek()

virtual bool aace::alexa::LocalMediaSource::adjustSeek ( std::chrono::milliseconds  deltaOffset)
pure virtual

Called when the user invokes media seek adjustment via speech.

Parameters
[in]deltaOffsetChange in offset position within media item, in milliseconds
Returns
true if the platform implementation successfully handled the call, else false

◆ getState()

virtual LocalMediaSourceState aace::alexa::LocalMediaSource::getState ( )
pure virtual

Must provide the local media source , and information to maintain cloud sync

◆ volumeChanged()

virtual bool aace::alexa::LocalMediaSource::volumeChanged ( float  volume)
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.

Parameters
[in]volumeThe volume to set on the output channel. volume is in the range [0,1].
Returns
true if the platform implementation successfully handled the call, else false

◆ mutedStateChanged()

virtual bool aace::alexa::LocalMediaSource::mutedStateChanged ( MutedState  state)
pure virtual

Notifies the platform implementation to apply a muted state has changed for the output channel

Parameters
[in]stateThe muted state to apply to the output channel. MutedState::MUTED when the output channel be muted, MutedState::UNMUTED when unmuted
Returns
true if the platform implementation successfully handled the call, else false

◆ getSource()

LocalMediaSource::Source aace::alexa::LocalMediaSource::getSource ( )

Return the source type the interface registered with

◆ playerEvent()

void aace::alexa::LocalMediaSource::playerEvent ( const std::string &  eventName)

Should be called on a local media source player event. This will sync the context with AVS.

Parameters
[in]eventNameCanonical event name

◆ playerError()

void aace::alexa::LocalMediaSource::playerError ( const std::string &  errorName,
long  code,
const std::string &  description,
bool  fatal 
)

Should be called on a local media source player error.

Parameters
[in]errorNameThe name of the error
[in]codeThe error code
[in]descriptionThe detailed error description
[in]fataltrue if the error is fatal

◆ setFocus()

void aace::alexa::LocalMediaSource::setFocus ( )

Should be called on local media source player events. This will switch the media focus to that context.


Alexa Auto SDK 2.0.0 - Copyright 2017-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0