AlexaClientSDK  3.0.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
TemplateRuntimeNamespace.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_IPC_NAMESPACES_TEMPLATERUNTIMENAMESPACE_H_
17 #define ALEXA_CLIENT_SDK_LIBIPCSERVERSAMPLEAPP_INCLUDE_IPCSERVERSAMPLEAPP_IPC_NAMESPACES_TEMPLATERUNTIMENAMESPACE_H_
18 
19 #include <string>
20 
22 
23 namespace alexaClientSDK {
24 namespace sampleApplications {
25 namespace ipcServerSampleApp {
26 namespace ipc {
27 namespace IPCNamespaces {
28 
30 static const char IPC_MSG_NAMESPACE_TEMPLATE_RUNTIME[] = "TemplateRuntime";
31 
33 static const int IPC_MSG_VERSION_TEMPLATE_RUNTIME(1);
34 
36 static const char IPC_MSG_NAME_CLEAR_PLAYER_INFO_CARD[] = "clearPlayerInfoCard";
37 
39 static const char IPC_MSG_NAME_CLEAR_TEMPLATE_CARD[] = "clearTemplateCard";
40 
42 static const char IPC_MSG_NAME_RENDER_PLAYER_INFO[] = "renderPlayerInfo";
43 
45 static const char IPC_MSG_AUDIO_PLAYER_STATE_TAG[] = "audioPlayerState";
46 
48 static const char IPC_MSG_AUDIO_OFFSET_TAG[] = "audioOffset";
49 
51 static const char IPC_MSG_NAME_RENDER_TEMPLATE[] = "renderTemplate";
52 
59 public:
68  const std::string& jsonPayload,
70  Message(
71  IPC_MSG_NAMESPACE_TEMPLATE_RUNTIME,
73  IPC_MSG_NAME_RENDER_PLAYER_INFO) {
74  addMemberInPayload(IPC_MSG_AUDIO_PLAYER_STATE_TAG, playerActivityToString(audioPlayerInfo.audioPlayerState));
75  addMemberInPayload(IPC_MSG_AUDIO_OFFSET_TAG, audioPlayerInfo.mediaProperties->getAudioItemOffset().count());
76  setParsedPayloadInPayload(jsonPayload);
77  addPayload();
78  }
79 };
80 
85 public:
91  RenderTemplateMessage(const std::string& jsonPayload) :
92  Message(
93  IPC_MSG_NAMESPACE_TEMPLATE_RUNTIME,
95  IPC_MSG_NAME_RENDER_TEMPLATE) {
96  setParsedPayload(jsonPayload);
97  }
98 };
99 
104 public:
110  Message(
111  IPC_MSG_NAMESPACE_TEMPLATE_RUNTIME,
113  IPC_MSG_NAME_CLEAR_PLAYER_INFO_CARD) {
114  addPayload();
115  }
116 };
117 
122 public:
128  Message(
129  IPC_MSG_NAMESPACE_TEMPLATE_RUNTIME,
131  IPC_MSG_NAME_CLEAR_TEMPLATE_CARD) {
132  addPayload();
133  }
134 };
135 
136 } // namespace IPCNamespaces
137 } // namespace ipc
138 } // namespace ipcServerSampleApp
139 } // namespace sampleApplications
140 } // namespace alexaClientSDK
141 #endif // ALEXA_CLIENT_SDK_LIBIPCSERVERSAMPLEAPP_INCLUDE_IPCSERVERSAMPLEAPP_IPC_NAMESPACES_TEMPLATERUNTIMENAMESPACE_H_
static const char IPC_MSG_NAME_CLEAR_TEMPLATE_CARD[]
The message name for clearTemplateCard.
Definition: TemplateRuntimeNamespace.h:39
static const char IPC_MSG_AUDIO_OFFSET_TAG[]
The audioOffset json key in the message.
Definition: TemplateRuntimeNamespace.h:48
avsCommon::avs::PlayerActivity audioPlayerState
Definition: TemplateRuntimeObserverInterface.h:43
RenderTemplateMessage(const std::string &jsonPayload)
Definition: TemplateRuntimeNamespace.h:91
Message & addMemberInPayload(const std::string &name, const std::string &value)
Definition: Message.h:101
static const char IPC_MSG_NAMESPACE_TEMPLATE_RUNTIME[]
The message namespace for TemplateRuntime.
Definition: TemplateRuntimeNamespace.h:30
::std::string string
Definition: gtest-port.h:1097
Message & setParsedPayload(const std::string &payload)
Definition: Message.h:179
Message(const std::string &nameSpace, const int version, const std::string &name)
Definition: Message.h:64
static const char IPC_MSG_NAME_RENDER_PLAYER_INFO[]
The message name for renderPlayerInfo.
Definition: TemplateRuntimeNamespace.h:42
static const char IPC_MSG_AUDIO_PLAYER_STATE_TAG[]
The audioPlayerState json key in the message.
Definition: TemplateRuntimeNamespace.h:45
static const int IPC_MSG_VERSION_TEMPLATE_RUNTIME(1)
The namespace version for TemplateRuntime.
std::shared_ptr< alexaClientSDK::avsCommon::sdkInterfaces::MediaPropertiesInterface > mediaProperties
Definition: TemplateRuntimeObserverInterface.h:56
std::string playerActivityToString(PlayerActivity playerActivity)
Definition: PlayerActivity.h:56
Whether or not curl logs should be emitted.
Definition: AVSConnectionManager.h:36
RenderPlayerInfoMessage(const std::string &jsonPayload, templateRuntimeInterfaces::TemplateRuntimeObserverInterface::AudioPlayerInfo audioPlayerInfo)
Definition: TemplateRuntimeNamespace.h:67
static const char IPC_MSG_NAME_CLEAR_PLAYER_INFO_CARD[]
The message name for clearPlayerInfoCard.
Definition: TemplateRuntimeNamespace.h:36
Message & setParsedPayloadInPayload(const std::string &payload)
Definition: Message.h:189
static const char IPC_MSG_NAME_RENDER_TEMPLATE[]
The message handler name for renderTemplate.
Definition: TemplateRuntimeNamespace.h:51

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