AlexaClientSDK  3.0.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
AVRCPTargetInterface.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_AVSCOMMON_SDKINTERFACES_INCLUDE_AVSCOMMON_SDKINTERFACES_BLUETOOTH_SERVICES_AVRCPTARGETINTERFACE_H_
17 #define ALEXA_CLIENT_SDK_AVSCOMMON_SDKINTERFACES_INCLUDE_AVSCOMMON_SDKINTERFACES_BLUETOOTH_SERVICES_AVRCPTARGETINTERFACE_H_
18 
19 #include <ostream>
20 #include <string>
21 
23 
24 namespace alexaClientSDK {
25 namespace avsCommon {
26 namespace sdkInterfaces {
27 namespace bluetooth {
28 namespace services {
29 
30 // TODO: Move to own enum file.
32 enum class MediaCommand {
34  PLAY,
35 
37  PAUSE,
38 
40  NEXT,
41 
43  PREVIOUS,
44 
47 };
48 
56  switch (cmd) {
57  case MediaCommand::PLAY:
58  return "PLAY";
60  return "PAUSE";
61  case MediaCommand::NEXT:
62  return "NEXT";
64  return "PREVIOUS";
66  return "PLAY_PAUSE";
67  }
68 
69  return "UNKNOWN";
70 }
71 
79 inline std::ostream& operator<<(std::ostream& stream, const MediaCommand cmd) {
80  return stream << commandToString(cmd);
81 }
82 
85 public:
87  static constexpr const char* UUID = "0000110c-0000-1000-8000-00805f9b34fb";
88 
90  static constexpr const char* NAME = "A/V_RemoteControlTarget";
91 
97  virtual bool play() = 0;
98 
104  virtual bool pause() = 0;
105 
111  virtual bool next() = 0;
112 
118  virtual bool previous() = 0;
119 
123  virtual ~AVRCPTargetInterface() = default;
124 };
125 
126 } // namespace services
127 } // namespace bluetooth
128 } // namespace sdkInterfaces
129 } // namespace avsCommon
130 } // namespace alexaClientSDK
131 
132 #endif // ALEXA_CLIENT_SDK_AVSCOMMON_SDKINTERFACES_INCLUDE_AVSCOMMON_SDKINTERFACES_BLUETOOTH_SERVICES_AVRCPTARGETINTERFACE_H_
std::ostream & operator<<(std::ostream &stream, const MediaCommand cmd)
Definition: AVRCPTargetInterface.h:79
::std::string string
Definition: gtest-port.h:1097
static const std::string NAME
An example name that would be returned by the Customer Profile API.
Definition: LWAAuthorizationAdapterTest.cpp:53
A Previous command. If issued at the beginning of a song, the previous track will be selected...
Used to implement an instance of AVRCPTarget (Audio/Video Remote Control Profile).
Definition: AVRCPTargetInterface.h:84
MediaCommand
An Enum representing Media commands.
Definition: AVRCPTargetInterface.h:32
Whether or not curl logs should be emitted.
Definition: AVSConnectionManager.h:36
std::string commandToString(MediaCommand cmd)
Definition: AVRCPTargetInterface.h:55
def next(obj)
Definition: ast.py:58

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