AlexaClientSDK  3.0.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
AplLiveViewExtension.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_LIBIPCSERVERSAMPLEAPP_INCLUDE_IPCSERVERSAMPLEAPP_EXTENSIONS_LIVEVIEW_APLLIVEVIEWEXTENSION_H_
17 #define ALEXA_CLIENT_SDK_LIBIPCSERVERSAMPLEAPP_INCLUDE_IPCSERVERSAMPLEAPP_EXTENSIONS_LIVEVIEW_APLLIVEVIEWEXTENSION_H_
18 
20 
21 // Disable warnings from APLClient
22 #pragma GCC diagnostic push
23 #pragma GCC diagnostic ignored "-Wsign-compare"
24 #include <APLClient/Extensions/AplCoreExtensionInterface.h>
25 
26 namespace alexaClientSDK {
27 namespace sampleApplications {
28 namespace ipcServerSampleApp {
29 namespace extensions {
30 namespace liveView {
31 
32 using namespace APLClient::Extensions;
33 
34 static const std::string URI = "aplext:liveview:10";
35 
39 class AplLiveViewExtension : public AplCoreExtensionInterface {
40 public:
44  explicit AplLiveViewExtension(std::shared_ptr<AplLiveViewExtensionObserverInterface> observer);
45 
46  ~AplLiveViewExtension() = default;
47 
50  std::string getUri() override;
51 
52  apl::Object getEnvironment() override;
53 
54  std::list<apl::ExtensionCommandDefinition> getCommandDefinitions() override;
55 
56  std::list<apl::ExtensionEventHandler> getEventHandlers() override;
57 
58  std::unordered_map<std::string, apl::LiveObjectPtr> getLiveDataObjects() override;
59 
60  void applySettings(const apl::Object& settings) override;
62 
65  void onExtensionEvent(
66  const std::string& uri,
67  const std::string& name,
68  const apl::Object& source,
69  const apl::Object& params,
70  unsigned int event,
71  std::shared_ptr<AplCoreExtensionEventCallbackResultInterface> resultCallback) override;
73 
78  void setCameraState(const std::string& cameraState);
79 
84  void setCameraMicrophoneState(bool enabled);
85 
92  void setAsrProfile(const std::string& asrProfile);
93 
97  void onCameraFirstFrameRendered();
98 
102  void onCameraCleared();
103 
104 private:
106  std::shared_ptr<AplLiveViewExtensionObserverInterface> m_observer;
107 
109  std::string m_cameraStateName;
110 
112  apl::LiveMapPtr m_cameraState;
113 };
114 
115 using AplLiveViewExtensionPtr = std::shared_ptr<AplLiveViewExtension>;
116 
117 } // namespace liveView
118 } // namespace extensions
119 } // namespace ipcServerSampleApp
120 } // namespace sampleApplications
121 } // namespace alexaClientSDK
122 
123 #endif // ALEXA_CLIENT_SDK_LIBIPCSERVERSAMPLEAPP_INCLUDE_IPCSERVERSAMPLEAPP_EXTENSIONS_LIVEVIEW_APLLIVEVIEWEXTENSION_H_
::std::string string
Definition: gtest-port.h:1097
std::shared_ptr< AplLiveViewExtension > AplLiveViewExtensionPtr
Definition: AplLiveViewExtension.h:115
Whether or not curl logs should be emitted.
Definition: AVSConnectionManager.h:36
static const std::string URI
Definition: AplLiveViewExtension.h:34

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