AlexaClientSDK  3.0.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
ExternalMediaAdapterHandlerInterface.h
Go to the documentation of this file.
1 /*
2  * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License").
5  * You may not use this file except in compliance with the License.
6  * A copy of the License is located at
7  *
8  * http://aws.amazon.com/apache2.0/
9  *
10  * or in the "license" file accompanying this file. This file is distributed
11  * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
12  * express or implied. See the License for the specific language governing
13  * permissions and limitations under the License.
14  */
15 
16 #ifndef ALEXA_CLIENT_SDK_ACSDKEXTERNALMEDIAPLAYERINTERFACES_INCLUDE_ACSDKEXTERNALMEDIAPLAYERINTERFACES_EXTERNALMEDIAADAPTERHANDLERINTERFACE_H_
17 #define ALEXA_CLIENT_SDK_ACSDKEXTERNALMEDIAPLAYERINTERFACES_INCLUDE_ACSDKEXTERNALMEDIAPLAYERINTERFACES_EXTERNALMEDIAADAPTERHANDLERINTERFACE_H_
18 
19 #include <chrono>
20 #include <string>
21 #include <vector>
22 
25 
28 
29 namespace alexaClientSDK {
30 namespace acsdkExternalMediaPlayerInterfaces {
31 
35 class ExternalMediaPlayerInterface;
36 
48 public:
54 
58  virtual ~ExternalMediaAdapterHandlerInterface() = default;
59 
61  struct PlayParams {
67  int64_t index;
69  std::chrono::milliseconds offset;
77  bool preload;
82 
99  const std::string& localPlayerId,
100  const std::string& playContextToken,
101  int64_t index,
102  std::chrono::milliseconds offset,
103  const std::string& skillToken,
104  const std::string& playbackSessionId,
105  Navigation navigation,
106  bool preload,
108  const std::string& playbackTarget) :
109  localPlayerId{localPlayerId},
110  playContextToken{playContextToken},
111  index{index},
112  offset{offset},
113  skillToken{skillToken},
114  playbackSessionId{playbackSessionId},
115  navigation{navigation},
116  preload{preload},
117  playRequestor(playRequestor),
118  playbackTarget{playbackTarget} {
119  }
120  };
121 
131  virtual std::vector<PlayerInfo> updatePlayerInfo(const std::vector<PlayerInfo>& playerList) = 0;
132 
143  virtual bool login(
144  const std::string& localPlayerId,
145  const std::string& accessToken,
146  const std::string& userName,
147  bool forceLogin,
148  std::chrono::milliseconds tokenRefreshInterval) = 0;
149 
155  virtual bool logout(const std::string& localPlayerId) = 0;
156 
163  virtual bool play(const PlayParams& params) = 0;
164 
173  virtual bool playControl(
174  const std::string& localPlayerId,
176  const std::string& playbackTarget) = 0;
177 
185  virtual bool seek(const std::string& localPlayerId, std::chrono::milliseconds offset) = 0;
186 
194  virtual bool adjustSeek(const std::string& localPlayerId, std::chrono::milliseconds deltaOffset) = 0;
195 
203 
209  virtual std::vector<acsdkExternalMediaPlayerInterfaces::AdapterState> getAdapterStates() = 0;
210 
217  virtual std::chrono::milliseconds getOffset(const std::string& localPlayerId) = 0;
218 
224  virtual void setExternalMediaPlayer(const std::shared_ptr<ExternalMediaPlayerInterface> externalMediaPlayer) = 0;
225 };
226 
228  alexaClientSDK::avsCommon::utils::RequiresShutdown{name} {
229 }
230 
231 } // namespace acsdkExternalMediaPlayerInterfaces
232 } // namespace alexaClientSDK
233 
234 #endif // ALEXA_CLIENT_SDK_ACSDKEXTERNALMEDIAPLAYERINTERFACES_INCLUDE_ACSDKEXTERNALMEDIAPLAYERINTERFACES_EXTERNALMEDIAADAPTERHANDLERINTERFACE_H_
std::string playContextToken
Play context token for specifying what to play.
Definition: ExternalMediaAdapterHandlerInterface.h:65
int64_t index
Index for track.
Definition: ExternalMediaAdapterHandlerInterface.h:67
virtual std::chrono::milliseconds getOffset(const std::string &localPlayerId)=0
RequestType
Definition: ExternalMediaAdapterInterface.h:32
::std::string string
Definition: gtest-port.h:1097
std::string localPlayerId
Local player id to play with.
Definition: ExternalMediaAdapterHandlerInterface.h:63
Navigation
Definition: ExternalMediaAdapterInterface.h:259
virtual std::vector< acsdkExternalMediaPlayerInterfaces::AdapterState > getAdapterStates()=0
virtual std::vector< PlayerInfo > updatePlayerInfo(const std::vector< PlayerInfo > &playerList)=0
bool preload
Whether or not to preload first.
Definition: ExternalMediaAdapterHandlerInterface.h:77
virtual bool seek(const std::string &localPlayerId, std::chrono::milliseconds offset)=0
Definition: ExternalMediaAdapterInterface.h:495
std::string playbackTarget
Playback target to play on.
Definition: ExternalMediaAdapterHandlerInterface.h:81
virtual bool adjustSeek(const std::string &localPlayerId, std::chrono::milliseconds deltaOffset)=0
PlayParams is a struct that contains the parameters for the play method.
Definition: ExternalMediaAdapterHandlerInterface.h:61
std::string playbackSessionId
Playback session id for identifying the session.
Definition: ExternalMediaAdapterHandlerInterface.h:73
std::chrono::milliseconds offset
Offset to play from.
Definition: ExternalMediaAdapterHandlerInterface.h:69
virtual acsdkExternalMediaPlayerInterfaces::AdapterState getAdapterState(const std::string &localPlayerId)=0
ExternalMediaAdapterHandlerInterface(const std::string &name)
Definition: ExternalMediaAdapterHandlerInterface.h:227
Whether or not curl logs should be emitted.
Definition: AVSConnectionManager.h:36
std::string skillToken
Associated skillToken.
Definition: ExternalMediaAdapterHandlerInterface.h:71
virtual void setExternalMediaPlayer(const std::shared_ptr< ExternalMediaPlayerInterface > externalMediaPlayer)=0
virtual bool playControl(const std::string &localPlayerId, acsdkExternalMediaPlayerInterfaces::RequestType requestType, const std::string &playbackTarget)=0
alexaClientSDK::avsCommon::avs::PlayRequestor playRequestor
PlayRequestor for indicating who requested playback.
Definition: ExternalMediaAdapterHandlerInterface.h:79
Definition: PlayRequestor.h:29
Navigation navigation
Navigation for indicating foreground or not.
Definition: ExternalMediaAdapterHandlerInterface.h:75
PlayParams(const std::string &localPlayerId, const std::string &playContextToken, int64_t index, std::chrono::milliseconds offset, const std::string &skillToken, const std::string &playbackSessionId, Navigation navigation, bool preload, const alexaClientSDK::avsCommon::avs::PlayRequestor &playRequestor, const std::string &playbackTarget)
Definition: ExternalMediaAdapterHandlerInterface.h:98
virtual bool login(const std::string &localPlayerId, const std::string &accessToken, const std::string &userName, bool forceLogin, std::chrono::milliseconds tokenRefreshInterval)=0

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