AlexaClientSDK  1.26.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
Namespaces | Macros | Functions | Variables
ExternalMediaPlayer.cpp File Reference
#include <utility>
#include <vector>
#include <rapidjson/error/en.h>
#include <rapidjson/stringbuffer.h>
#include <rapidjson/writer.h>
#include <acsdkExternalMediaPlayerInterfaces/AdapterUtils.h>
#include <acsdkExternalMediaPlayerInterfaces/ExternalMediaAdapterConstants.h>
#include <acsdkExternalMediaPlayerInterfaces/ExternalMediaAdapterHandlerInterface.h>
#include <AVSCommon/AVS/SpeakerConstants/SpeakerConstants.h>
#include <AVSCommon/Utils/JSON/JSONUtils.h>
#include <AVSCommon/Utils/Memory/Memory.h>
#include <AVSCommon/Utils/Metrics/DataPointCounterBuilder.h>
#include <AVSCommon/Utils/Metrics/DataPointStringBuilder.h>
#include <AVSCommon/Utils/Metrics/MetricEventBuilder.h>
#include <AVSCommon/Utils/String/StringUtils.h>
#include "acsdkExternalMediaPlayer/ExternalMediaPlayer.h"
#include "acsdkExternalMediaPlayer/StaticExternalMediaPlayerAdapterHandler.h"
Include dependency graph for ExternalMediaPlayer.cpp:

Namespaces

 alexaClientSDK
 Whether or not curl logs should be emitted.
 
 alexaClientSDK::acsdkExternalMediaPlayer
 

Macros

#define LX(event)   alexaClientSDK::avsCommon::utils::logger::LogEntry(TAG, event)
 

Functions

static const std::string alexaClientSDK::acsdkExternalMediaPlayer::TAG ("ExternalMediaPlayer")
 String to identify log entries originating from this file. More...
 
static void alexaClientSDK::acsdkExternalMediaPlayer::submitMetric (const std::shared_ptr< MetricRecorderInterface > &metricRecorder, const std::string &metricName, const DataPoint &dataPoint, const std::string &msgId, const std::string &trackId, const std::string &playerId)
 
static std::shared_ptr< avsCommon::avs::CapabilityConfiguration > alexaClientSDK::acsdkExternalMediaPlayer::getExternalMediaPlayerCapabilityConfiguration ()
 
static std::shared_ptr< CapabilityConfiguration > alexaClientSDK::acsdkExternalMediaPlayer::generateCapabilityConfiguration (const std::string &type, const std::string &interfaceName, const std::string &version)
 

Variables

static const std::string alexaClientSDK::acsdkExternalMediaPlayer::EXTERNALMEDIAPLAYER_STATE_NAMESPACE = "ExternalMediaPlayer"
 
static const std::string alexaClientSDK::acsdkExternalMediaPlayer::PLAYBACKSTATEREPORTER_STATE_NAMESPACE = "Alexa.PlaybackStateReporter"
 
static const std::string alexaClientSDK::acsdkExternalMediaPlayer::EXTERNALMEDIAPLAYER_NAME = "ExternalMediaPlayerState"
 
static const std::string alexaClientSDK::acsdkExternalMediaPlayer::PLAYBACKSTATEREPORTER_NAME = "playbackState"
 
static const std::string alexaClientSDK::acsdkExternalMediaPlayer::EXTERNALMEDIAPLAYER_NAMESPACE = "ExternalMediaPlayer"
 
static const std::string alexaClientSDK::acsdkExternalMediaPlayer::PLAYBACKCONTROLLER_NAMESPACE = "Alexa.PlaybackController"
 
static const std::string alexaClientSDK::acsdkExternalMediaPlayer::PLAYLISTCONTROLLER_NAMESPACE = "Alexa.PlaylistController"
 
static const std::string alexaClientSDK::acsdkExternalMediaPlayer::SEEKCONTROLLER_NAMESPACE = "Alexa.SeekController"
 
static const std::string alexaClientSDK::acsdkExternalMediaPlayer::FAVORITESCONTROLLER_NAMESPACE = "Alexa.FavoritesController"
 
static const std::string alexaClientSDK::acsdkExternalMediaPlayer::ALEXA_INTERFACE_TYPE = "AlexaInterface"
 The AlexaInterface constant type. More...
 
static const std::string alexaClientSDK::acsdkExternalMediaPlayer::EXTERNALMEDIAPLAYER_CAPABILITY_INTERFACE_TYPE = ALEXA_INTERFACE_TYPE
 
static const std::string alexaClientSDK::acsdkExternalMediaPlayer::EXTERNALMEDIAPLAYER_CAPABILITY_INTERFACE_NAME = "ExternalMediaPlayer"
 ExternalMediaPlayer interface name. More...
 
static const std::string alexaClientSDK::acsdkExternalMediaPlayer::EXTERNALMEDIAPLAYER_CAPABILITY_INTERFACE_VERSION = "1.2"
 ExternalMediaPlayer interface version. More...
 
static const std::string alexaClientSDK::acsdkExternalMediaPlayer::PLAYBACKSTATEREPORTER_CAPABILITY_INTERFACE_NAME = PLAYBACKSTATEREPORTER_STATE_NAMESPACE
 Alexa.PlaybackStateReporter name. More...
 
static const std::string alexaClientSDK::acsdkExternalMediaPlayer::PLAYBACKSTATEREPORTER_CAPABILITY_INTERFACE_VERSION = "1.0"
 Alexa.PlaybackStateReporter version. More...
 
static const std::string alexaClientSDK::acsdkExternalMediaPlayer::PLAYBACKCONTROLLER_CAPABILITY_INTERFACE_NAME = PLAYBACKCONTROLLER_NAMESPACE
 Alexa.PlaybackController name. More...
 
static const std::string alexaClientSDK::acsdkExternalMediaPlayer::PLAYBACKCONTROLLER_CAPABILITY_INTERFACE_VERSION = "1.0"
 Alexa.PlaybackController version. More...
 
static const std::string alexaClientSDK::acsdkExternalMediaPlayer::PLAYLISTCONTROLLER_CAPABILITY_INTERFACE_NAME = PLAYLISTCONTROLLER_NAMESPACE
 Alexa.PlaylistController name. More...
 
static const std::string alexaClientSDK::acsdkExternalMediaPlayer::PLAYLISTCONTROLLER_CAPABILITY_INTERFACE_VERSION = "1.0"
 Alexa.PlaylistController version. More...
 
static const std::string alexaClientSDK::acsdkExternalMediaPlayer::SEEKCONTROLLER_CAPABILITY_INTERFACE_NAME = SEEKCONTROLLER_NAMESPACE
 Alexa.SeekController name. More...
 
static const std::string alexaClientSDK::acsdkExternalMediaPlayer::SEEKCONTROLLER_CAPABILITY_INTERFACE_VERSION = "1.0"
 Alexa.SeekController version. More...
 
static const std::string alexaClientSDK::acsdkExternalMediaPlayer::FAVORITESCONTROLLER_CAPABILITY_INTERFACE_NAME = FAVORITESCONTROLLER_NAMESPACE
 Alexa.FavoritesController name. More...
 
static const std::string alexaClientSDK::acsdkExternalMediaPlayer::FAVORITESCONTROLLER_CAPABILITY_INTERFACE_VERSION = "1.0"
 Alexa.FavoritesController version. More...
 
static const NamespaceAndName alexaClientSDK::acsdkExternalMediaPlayer::PLAY_DIRECTIVE {EXTERNALMEDIAPLAYER_NAMESPACE, "Play"}
 
static const NamespaceAndName alexaClientSDK::acsdkExternalMediaPlayer::LOGIN_DIRECTIVE {EXTERNALMEDIAPLAYER_NAMESPACE, "Login"}
 
static const NamespaceAndName alexaClientSDK::acsdkExternalMediaPlayer::LOGOUT_DIRECTIVE {EXTERNALMEDIAPLAYER_NAMESPACE, "Logout"}
 
static const NamespaceAndName alexaClientSDK::acsdkExternalMediaPlayer::AUTHORIZEDISCOVEREDPLAYERS_DIRECTIVE
 
static const NamespaceAndName alexaClientSDK::acsdkExternalMediaPlayer::RESUME_DIRECTIVE {PLAYBACKCONTROLLER_NAMESPACE, "Play"}
 
static const NamespaceAndName alexaClientSDK::acsdkExternalMediaPlayer::PAUSE_DIRECTIVE {PLAYBACKCONTROLLER_NAMESPACE, "Pause"}
 
static const NamespaceAndName alexaClientSDK::acsdkExternalMediaPlayer::STOP_DIRECTIVE {PLAYBACKCONTROLLER_NAMESPACE, "Stop"}
 
static const NamespaceAndName alexaClientSDK::acsdkExternalMediaPlayer::NEXT_DIRECTIVE {PLAYBACKCONTROLLER_NAMESPACE, "Next"}
 
static const NamespaceAndName alexaClientSDK::acsdkExternalMediaPlayer::PREVIOUS_DIRECTIVE {PLAYBACKCONTROLLER_NAMESPACE, "Previous"}
 
static const NamespaceAndName alexaClientSDK::acsdkExternalMediaPlayer::STARTOVER_DIRECTIVE {PLAYBACKCONTROLLER_NAMESPACE, "StartOver"}
 
static const NamespaceAndName alexaClientSDK::acsdkExternalMediaPlayer::REWIND_DIRECTIVE {PLAYBACKCONTROLLER_NAMESPACE, "Rewind"}
 
static const NamespaceAndName alexaClientSDK::acsdkExternalMediaPlayer::FASTFORWARD_DIRECTIVE {PLAYBACKCONTROLLER_NAMESPACE, "FastForward"}
 
static const NamespaceAndName alexaClientSDK::acsdkExternalMediaPlayer::ENABLEREPEATONE_DIRECTIVE {PLAYLISTCONTROLLER_NAMESPACE, "EnableRepeatOne"}
 
static const NamespaceAndName alexaClientSDK::acsdkExternalMediaPlayer::ENABLEREPEAT_DIRECTIVE {PLAYLISTCONTROLLER_NAMESPACE, "EnableRepeat"}
 
static const NamespaceAndName alexaClientSDK::acsdkExternalMediaPlayer::DISABLEREPEAT_DIRECTIVE {PLAYLISTCONTROLLER_NAMESPACE, "DisableRepeat"}
 
static const NamespaceAndName alexaClientSDK::acsdkExternalMediaPlayer::ENABLESHUFFLE_DIRECTIVE {PLAYLISTCONTROLLER_NAMESPACE, "EnableShuffle"}
 
static const NamespaceAndName alexaClientSDK::acsdkExternalMediaPlayer::DISABLESHUFFLE_DIRECTIVE {PLAYLISTCONTROLLER_NAMESPACE, "DisableShuffle"}
 
static const NamespaceAndName alexaClientSDK::acsdkExternalMediaPlayer::SEEK_DIRECTIVE {SEEKCONTROLLER_NAMESPACE, "SetSeekPosition"}
 
static const NamespaceAndName alexaClientSDK::acsdkExternalMediaPlayer::ADJUSTSEEK_DIRECTIVE {SEEKCONTROLLER_NAMESPACE, "AdjustSeekPosition"}
 
static const NamespaceAndName alexaClientSDK::acsdkExternalMediaPlayer::FAVORITE_DIRECTIVE {FAVORITESCONTROLLER_NAMESPACE, "Favorite"}
 
static const NamespaceAndName alexaClientSDK::acsdkExternalMediaPlayer::UNFAVORITE_DIRECTIVE {FAVORITESCONTROLLER_NAMESPACE, "Unfavorite"}
 
static const NamespaceAndName alexaClientSDK::acsdkExternalMediaPlayer::SESSION_STATE {EXTERNALMEDIAPLAYER_STATE_NAMESPACE, EXTERNALMEDIAPLAYER_NAME}
 
static const NamespaceAndName alexaClientSDK::acsdkExternalMediaPlayer::PLAYBACK_STATE {PLAYBACKSTATEREPORTER_STATE_NAMESPACE, PLAYBACKSTATEREPORTER_NAME}
 
static const int64_t alexaClientSDK::acsdkExternalMediaPlayer::MAX_PAST_OFFSET = -86400000
 
static const int64_t alexaClientSDK::acsdkExternalMediaPlayer::MAX_FUTURE_OFFSET = 86400000
 
static const char alexaClientSDK::acsdkExternalMediaPlayer::AUTHORIZED [] = "authorized"
 The authorized key. More...
 
static const char alexaClientSDK::acsdkExternalMediaPlayer::DEAUTHORIZED [] = "deauthorized"
 The deauthorized key. More...
 
static const char alexaClientSDK::acsdkExternalMediaPlayer::LOCAL_PLAYER_ID [] = "localPlayerId"
 The localPlayerId key. More...
 
static const char alexaClientSDK::acsdkExternalMediaPlayer::METADATA [] = "metadata"
 The metadata key. More...
 
static const char alexaClientSDK::acsdkExternalMediaPlayer::SPI_VERSION_KEY [] = "spiVersion"
 The spiVersion key. More...
 
static const char alexaClientSDK::acsdkExternalMediaPlayer::VALIDATION_METHOD [] = "validationMethod"
 The validationMethod key. More...
 
static const char alexaClientSDK::acsdkExternalMediaPlayer::VALIDATION_DATA [] = "validationData"
 The validationData key. More...
 
static const char alexaClientSDK::acsdkExternalMediaPlayer::REPORT_DISCOVERED_PLAYERS [] = "ReportDiscoveredPlayers"
 The ReportDiscoveredPlayers Event key. More...
 
static const char alexaClientSDK::acsdkExternalMediaPlayer::AUTHORIZATION_COMPLETE [] = "AuthorizationComplete"
 The AuthorizationComplete Event key. More...
 
static const std::string alexaClientSDK::acsdkExternalMediaPlayer::AUDIO_PLAYER_METRIC_PREFIX = "AUDIO_PLAYER-"
 Metric name prefix for AudioPlayer metric source. More...
 
static const std::string alexaClientSDK::acsdkExternalMediaPlayer::PLAY_DIRECTIVE_RECEIVED = "PLAY_DIRECTIVE_RECEIVED"
 
static const std::string alexaClientSDK::acsdkExternalMediaPlayer::STOP_DIRECTIVE_RECEIVED = "STOP_DIRECTIVE_RECEIVED"
 
auto alexaClientSDK::acsdkExternalMediaPlayer::audioNonBlockingPolicy = BlockingPolicy(BlockingPolicy::MEDIUM_AUDIO, false)
 
auto alexaClientSDK::acsdkExternalMediaPlayer::neitherNonBlockingPolicy = BlockingPolicy(BlockingPolicy::MEDIUMS_NONE, false)
 
static DirectiveHandlerConfiguration alexaClientSDK::acsdkExternalMediaPlayer::g_configuration
 
static std::unordered_map< PlaybackButton, RequestType > alexaClientSDK::acsdkExternalMediaPlayer::g_buttonToRequestType
 
static std::unordered_map< PlaybackToggle, std::pair< RequestType, RequestType > > alexaClientSDK::acsdkExternalMediaPlayer::g_toggleToRequestType
 

Detailed Description

Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.

Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with the License. A copy of the License is located at

http://aws.amazon.com/apache2.0/

or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Macro Definition Documentation

◆ LX

#define LX (   event)    alexaClientSDK::avsCommon::utils::logger::LogEntry(TAG, event)

Create a LogEntry using this file's TAG and the specified event string.

Parameters
Theevent string for this LogEntry.

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