AlexaClientSDK  1.26.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
AipStateObserver.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_INTEGRATION_INCLUDE_INTEGRATION_AIPSTATEOBSERVER_H_
17 #define ALEXA_CLIENT_SDK_INTEGRATION_INCLUDE_INTEGRATION_AIPSTATEOBSERVER_H_
18 
19 #include <chrono>
20 #include <deque>
21 #include <condition_variable>
22 #include <mutex>
23 
25 
26 namespace alexaClientSDK {
27 namespace integration {
28 
30 public:
33  bool checkState(
35  const std::chrono::seconds duration = std::chrono::seconds(10));
37  const std::chrono::seconds duration);
38 
39 private:
41  std::mutex m_mutex;
42  std::condition_variable m_wakeTrigger;
43  std::deque<avsCommon::sdkInterfaces::AudioInputProcessorObserverInterface::State> m_queue;
44 };
45 
46 } // namespace integration
47 } // namespace alexaClientSDK
48 
49 #endif // ALEXA_CLIENT_SDK_INTEGRATION_INCLUDE_INTEGRATION_AIPSTATEOBSERVER_H_
alexaClientSDK::integration::AipStateObserver::AipStateObserver
AipStateObserver()
Definition: AipStateObserver.cpp:23
alexaClientSDK::integration::AipStateObserver::onStateChanged
void onStateChanged(avsCommon::sdkInterfaces::AudioInputProcessorObserverInterface::State newState) override
Definition: AipStateObserver.cpp:26
alexaClientSDK::integration::AipStateObserver::checkState
bool checkState(const avsCommon::sdkInterfaces::AudioInputProcessorObserverInterface::State expectedState, const std::chrono::seconds duration=std::chrono::seconds(10))
Definition: AipStateObserver.cpp:33
alexaClientSDK::integration::AipStateObserver
Definition: AipStateObserver.h:29
alexaClientSDK::integration::AipStateObserver::waitForNext
avsCommon::sdkInterfaces::AudioInputProcessorObserverInterface::State waitForNext(const std::chrono::seconds duration)
Definition: AipStateObserver.cpp:40
AudioInputProcessorObserverInterface.h
alexaClientSDK
Whether or not curl logs should be emitted.
Definition: AVSConnectionManager.h:36
alexaClientSDK::avsCommon::sdkInterfaces::AudioInputProcessorObserverInterface::State
State
The different states the AudioInputProcessor can be in.
Definition: AudioInputProcessorObserverInterface.h:30
alexaClientSDK::avsCommon::sdkInterfaces::AudioInputProcessorObserverInterface
A state observer for an AudioInputProcessor.
Definition: AudioInputProcessorObserverInterface.h:27

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