AlexaClientSDK  3.0.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
AudioFocusManagerNamespace.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_AUDIOFOCUSMANAGERNAMESPACE_H_
17 #define ALEXA_CLIENT_SDK_LIBIPCSERVERSAMPLEAPP_INCLUDE_IPCSERVERSAMPLEAPP_IPC_NAMESPACES_AUDIOFOCUSMANAGERNAMESPACE_H_
18 
20 
21 namespace alexaClientSDK {
22 namespace sampleApplications {
23 namespace ipcServerSampleApp {
24 namespace ipc {
25 namespace IPCNamespaces {
26 
28 static const char IPC_MSG_NAMESPACE_AUDIO_FOCUS_MANAGER[] = "AudioFocusManager";
29 
31 static const int IPC_MSG_VERSION_AUDIO_FOCUS_MANAGER(1);
32 
34 static const char IPC_MSG_NAME_PROCESS_CHANNEL_RESULT[] = "processChannelResult";
35 
37 static const char IPC_MSG_RESULT_TAG[] = "result";
38 
40 static const char IPC_MSG_NAME_PROCESS_FOCUS_CHANGED[] = "processFocusChanged";
41 
43 static const char IPC_MSG_FOCUS_STATE_TAG[] = "focusState";
44 
49 public:
57  Message(
58  IPC_MSG_NAMESPACE_AUDIO_FOCUS_MANAGER,
60  IPC_MSG_NAME_PROCESS_FOCUS_CHANGED) {
61  setTokenInPayload(token);
62  addMemberInPayload(IPC_MSG_FOCUS_STATE_TAG, focusStateToString(focusState));
63  addPayload();
64  }
65 };
66 
72 public:
79  ProcessChannelResultMessage(unsigned token, bool result) :
80  Message(
81  IPC_MSG_NAMESPACE_AUDIO_FOCUS_MANAGER,
83  IPC_MSG_NAME_PROCESS_CHANNEL_RESULT) {
84  setTokenInPayload(token);
85  addMemberInPayload(IPC_MSG_RESULT_TAG, result ? "true" : "false");
86  addPayload();
87  }
88 };
89 
90 } // namespace IPCNamespaces
91 } // namespace ipc
92 } // namespace ipcServerSampleApp
93 } // namespace sampleApplications
94 } // namespace alexaClientSDK
95 #endif // ALEXA_CLIENT_SDK_LIBIPCSERVERSAMPLEAPP_INCLUDE_IPCSERVERSAMPLEAPP_IPC_NAMESPACES_AUDIOFOCUSMANAGERNAMESPACE_H_
static const int IPC_MSG_VERSION_AUDIO_FOCUS_MANAGER(1)
The namespace version for AudioFocusManager.
ProcessChannelResultMessage(unsigned token, bool result)
Definition: AudioFocusManagerNamespace.h:79
Message & addMemberInPayload(const std::string &name, const std::string &value)
Definition: Message.h:101
static const char IPC_MSG_RESULT_TAG[]
The result json key in the message.
Definition: AudioFocusManagerNamespace.h:37
ProcessFocusChangedMessage(unsigned token, avsCommon::avs::FocusState focusState)
Definition: AudioFocusManagerNamespace.h:56
FocusState
Definition: FocusState.h:29
Message(const std::string &nameSpace, const int version, const std::string &name)
Definition: Message.h:64
static const char IPC_MSG_FOCUS_STATE_TAG[]
The focusState json key in the message.
Definition: AudioFocusManagerNamespace.h:43
static const char IPC_MSG_NAME_PROCESS_FOCUS_CHANGED[]
The message name for processFocusChanged.
Definition: AudioFocusManagerNamespace.h:40
Whether or not curl logs should be emitted.
Definition: AVSConnectionManager.h:36
static const char IPC_MSG_NAMESPACE_AUDIO_FOCUS_MANAGER[]
The message namespace for AudioFocusManager.
Definition: AudioFocusManagerNamespace.h:28
static const char IPC_MSG_NAME_PROCESS_CHANNEL_RESULT[]
The message name for processChannelResult.
Definition: AudioFocusManagerNamespace.h:34
std::string focusStateToString(FocusState state)
Definition: FocusState.h:46
Message & setTokenInPayload(const std::string &token)
Definition: Message.h:159

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