#include <tizen.h>
#include <tzplatform_config.h>
+#include "multi_assistant_main.h"
+
#ifdef __cplusplus
extern "C"
{
#endif
-#define MAX_WAKEUP_LIST_NUM 32
-#define MAX_SUPPORTED_LANGUAGE_NUM 128
-
/**************************************************************************************
*** Definitions for xml file
*************************************************************************************/
#define VOICE_KEY_SUPPORT_MODE_STRING_TAP_TO_TALK "tap_to_talk"
#define VOICE_KEY_SUPPORT_MODE_STRING_ALL "all"
-typedef enum {
- VOICE_KEY_SUPPORT_MODE_NONE,
- VOICE_KEY_SUPPORT_MODE_PUSH_TO_TALK,
- VOICE_KEY_SUPPORT_MODE_TAP_TO_TALK,
- VOICE_KEY_SUPPORT_MODE_ALL,
-} VOICE_KEY_SUPPORT_MODE;
-
typedef struct {
const char* app_id;
const char* name;
const char* icon_path;
- const char* wakeup_list[MAX_WAKEUP_LIST_NUM];
- const char* wakeup_language[MAX_WAKEUP_LIST_NUM];
+ const char* wakeup_list[MAX_WAKEUP_WORDS_NUM];
+ const char* wakeup_language[MAX_WAKEUP_WORDS_NUM];
int cnt_wakeup;
- const char* supported_lang[MAX_SUPPORTED_LANGUAGE_NUM];
+ const char* supported_lang[MAX_SUPPORTED_LANGUAGES_NUM];
int cnt_lang;
const char* wakeup_engine;
bool custom_ui_option;
-#ifndef __MULTI_ASSISTANT_SERVICE_H__
-#define __MULTI_ASSISTANT_SERVICE_H__
+#ifndef __MULTI_ASSISTANT_MAIN_H__
+#define __MULTI_ASSISTANT_MAIN_H__
#include <app.h>
#include <glib.h>
#define MAS_UI_METHOD_SEND_RECOGNITION_RESULT "mas_ui_method_send_recognition_result"
#define MAS_UI_METHOD_ENABLE_COMMON_UI "mas_ui_method_enable_common_ui"
-#endif /* __MULTI_ASSISTANT_SERVICE_H__ */
+#define MAX_WAKEUP_WORDS_NUM 255
+#define MAX_WAKEUP_WORD_LEN 32
+#define MAX_SUPPORTED_LANGUAGES_NUM 255
+#define MAX_SUPPORTED_LANGUAGE_LEN 16
+
+#define MAX_APPID_LEN 255
+
+typedef enum {
+ VOICE_KEY_SUPPORT_MODE_NONE,
+ VOICE_KEY_SUPPORT_MODE_PUSH_TO_TALK,
+ VOICE_KEY_SUPPORT_MODE_TAP_TO_TALK,
+ VOICE_KEY_SUPPORT_MODE_ALL,
+} VOICE_KEY_SUPPORT_MODE;
+
+#endif /* __MULTI_ASSISTANT_MAIN_H__ */
*/
-#ifndef _MULTI_ASSISTANT_SERVICE_H_
-#define _MULTI_ASSISTANT_SERVICE_H_
+#ifndef _MULTI_ASSISTANT_SERVICE_CLIENT_H_
+#define _MULTI_ASSISTANT_SERVICE_CLIENT_H_
#include <dlog/dlog.h>
+#include "multi_assistant_main.h"
#ifdef __cplusplus
extern "C" {
#endif
-#define MAX_APPID_LEN 255
-
typedef enum {
CLIENT_LAUNCH_MODE_ACTIVATION,
CLIENT_LAUNCH_MODE_PRELAUNCH,
int mas_update_voice_key_support_mode();
+typedef struct {
+ bool used;
+ char appid[MAX_APPID_LEN];
+ char wakeup_word[MAX_WAKEUP_WORDS_NUM][MAX_WAKEUP_WORD_LEN];
+ char wakeup_language[MAX_WAKEUP_WORDS_NUM][MAX_SUPPORTED_LANGUAGE_LEN];
+ char wakeup_engine[MAX_APPID_LEN];
+ char supported_language[MAX_SUPPORTED_LANGUAGES_NUM][MAX_SUPPORTED_LANGUAGE_LEN];
+ bool custom_ui_option;
+ VOICE_KEY_SUPPORT_MODE voice_key_support_mode;
+ float voice_key_tap_duration;
+
+ ma_preprocessing_allow_mode_e preprocessing_allow_mode;
+ char preprocessing_allow_appid[MAX_APPID_LEN];
+} ma_client_info;
#ifdef __cplusplus
}
#endif
-#endif /* _MULTI_ASSISTANT_SERVICE_H_ */
+#endif /* _MULTI_ASSISTANT_SERVICE_CLIENT_H_ */
extern "C" {
#endif
-typedef void (*wakeup_service_wakeup_event_cb)(mas_wakeup_event_info wakeup_info, const char* wakeup_word, void* user_data);
+typedef void (*wakeup_service_wakeup_event_cb)(mas_wakeup_event_info wakeup_info, void* user_data);
-typedef void (*wakeup_service_speech_streaming_cb)(mas_speech_streaming_event_e event, unsigned char* buffer, int len, void *user_data);
+typedef void (*wakeup_service_speech_streaming_cb)(mas_speech_streaming_event_e event, void* buffer, int len, void *user_data);
typedef void (*wakeup_service_speech_status_cb)(mas_speech_status_e status, void *user_data);
bool mVoiceKeyPressed{false};
string mCurrentLanguage;
string mCurrentDefaultAssistant;
- VOICE_KEY_SUPPORT_MODE mCurrentVoiceKeySupportMode;
+ /* Assume Push-to-talk is the default mode */
+ VOICE_KEY_SUPPORT_MODE mCurrentVoiceKeySupportMode{VOICE_KEY_SUPPORT_MODE_PUSH_TO_TALK};
STREAMING_MODE mStreamingMode{STREAMING_MODE::NONE};
Ecore_Timer* mStreamingDurationTimer{nullptr};
} // wakeup
} // multiassistant
-#endif /* _WAKEUP_MANAGER_H_ */
\ No newline at end of file
+#endif /* _WAKEUP_MANAGER_H_ */
MA_VOICE_KEY_STATUS_RELEASED_AFTER_TAP == status) {
mVoiceKeyPressed = false;
}
+ return true;
}
bool CWakeupManager::process_plugin_event(mas_plugin_event_e event, void* data, int len)
#define WAKEUP_SETTINGS_KEY_PRELAUNCH_MODE "db/multi-assistant/prelaunch_mode"
#define MAX_MACLIENT_INFO_NUM 16
-#define MAX_WAKEUP_WORDS_NUM 255
-#define MAX_WAKEUP_WORD_LEN 32
-#define MAX_SUPPORTED_LANGUAGES_NUM 255
-#define MAX_SUPPORTED_LANGUAGE_LEN 16
-typedef struct {
- bool used;
- char appid[MAX_APPID_LEN];
- char wakeup_word[MAX_WAKEUP_WORDS_NUM][MAX_WAKEUP_WORD_LEN];
- char wakeup_language[MAX_WAKEUP_WORDS_NUM][MAX_SUPPORTED_LANGUAGE_LEN];
- char wakeup_engine[MAX_APPID_LEN];
- char supported_language[MAX_SUPPORTED_LANGUAGES_NUM][MAX_SUPPORTED_LANGUAGE_LEN];
- bool custom_ui_option;
- VOICE_KEY_SUPPORT_MODE voice_key_support_mode;
- float voice_key_tap_duration;
-
- ma_preprocessing_allow_mode_e preprocessing_allow_mode;
- char preprocessing_allow_appid[MAX_APPID_LEN];
-} ma_client_info;
static ma_client_info g_maclient_info[MAX_MACLIENT_INFO_NUM];
}
}
}
- for (inner_loop = 0; inner_loop < MAX_SUPPORTED_LANGUAGE_NUM; inner_loop++) {
+ for (inner_loop = 0; inner_loop < MAX_SUPPORTED_LANGUAGES_NUM; inner_loop++) {
if (0 < strlen(g_maclient_info[loop].supported_language[inner_loop])) {
MAS_LOGD("Adding language %s for app %s",
g_maclient_info[loop].supported_language[inner_loop], g_maclient_info[loop].appid);