NUGU SDK Linux  1.7.6
wakeup_interface.hh
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2019 SK Telecom Co., Ltd. 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  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #ifndef __NUGU_WAKEUP_INTERFACE_H__
18 #define __NUGU_WAKEUP_INTERFACE_H__
19 
20 #include <string>
21 
22 #include <nugu.h>
23 
24 namespace NuguClientKit {
25 
40 enum class WakeupDetectState {
41  WAKEUP_IDLE,
45 };
46 
51 typedef struct _WakeupModelFile {
52  std::string net;
53  std::string search;
55 
60 class NUGU_API IWakeupListener {
61 public:
62  virtual ~IWakeupListener() = default;
63 
71  virtual void onWakeupState(WakeupDetectState state, float power_noise, float power_speech) = 0;
72 };
73 
78 class NUGU_API IWakeupHandler {
79 public:
80  virtual ~IWakeupHandler() = default;
81 
87  virtual void setListener(IWakeupListener* listener) = 0;
88 
93  virtual bool startWakeup() = 0;
94 
98  virtual void stopWakeup() = 0;
99 
104  virtual void changeModel(const WakeupModelFile& model_file) = 0;
105 };
106 
111 } // NuguClientKit
112 
113 #endif /* __NUGU_WAKEUP_INTERFACE_H__ */
Wakeup handler interface.
Definition: wakeup_interface.hh:78
virtual void stopWakeup()=0
Stop the wakeup detection.
virtual void changeModel(const WakeupModelFile &model_file)=0
Change wakeup word model.
virtual void setListener(IWakeupListener *listener)=0
Set the Listener object.
virtual bool startWakeup()=0
Start the wakeup detection.
Wakeup listener interface.
Definition: wakeup_interface.hh:60
virtual void onWakeupState(WakeupDetectState state, float power_noise, float power_speech)=0
Report to the user wakeup detection state changed.
struct NuguClientKit::_WakeupModelFile WakeupModelFile
Model for holding Wakeup model file info.
WakeupDetectState
WakeupDetectState.
Definition: wakeup_interface.hh:40
Model for holding Wakeup model file info.
Definition: wakeup_interface.hh:51
std::string search
Definition: wakeup_interface.hh:53
std::string net
Definition: wakeup_interface.hh:52