/*
-* Copyright (c) 2012, 2013 Samsung Electronics Co., Ltd All Rights Reserved
+* Copyright (c) 2011-2016 Samsung Electronics Co., Ltd All Rights Reserved
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
#ifndef __TTSD_DATA_H_
#define __TTSD_DATA_H_
-#include <vector>
-#include "ttsp.h"
-
-using namespace std;
+#include "ttse.h"
#ifdef __cplusplus
extern "C" {
#endif
+
typedef enum {
APP_STATE_CREATED = 0,
APP_STATE_READY,
APP_STATE_PLAYING,
APP_STATE_PAUSED
-}app_state_e;
-
-typedef struct
-{
- int utt_id;
- char* text;
- char* lang;
- ttsp_voice_type_e vctype;
- ttsp_speed_e speed;
-}speak_data_s;
-
-typedef struct
-{
+} app_tts_state_e;
+
+typedef enum {
+ TTSD_SYNTHESIS_CONTROL_DOING = 0,
+ TTSD_SYNTHESIS_CONTROL_DONE = 1,
+ TTSD_SYNTHESIS_CONTROL_EXPIRED = 2
+} ttsd_synthesis_control_e;
+
+typedef struct {
+ int utt_id;
+ char* text;
+ char* lang;
+ int vctype;
+ int speed;
+} speak_data_s;
+
+typedef struct {
int utt_id;
void* data;
- unsigned int data_size;
+ unsigned int data_size;
- ttsp_result_event_e event;
- ttsp_audio_type_e audio_type;
+ ttse_result_event_e event;
+ ttse_audio_type_e audio_type;
int rate;
int channels;
-}sound_data_s;
-
-typedef struct
-{
- int pid;
- int uid;
- int utt_id_stopped;
- app_state_e state;
-
- std::vector<speak_data_s> m_speak_data;
- std::vector<sound_data_s> m_wav_data;
-}app_data_s;
+} sound_data_s;
-typedef struct {
- int pid;
-} setting_app_data_s;
+int ttsd_set_synth_control(ttsd_synthesis_control_e control);
+
+ttsd_synthesis_control_e ttsd_get_synth_control();
+
+typedef void (* ttsd_used_voice_cb)(const char* lang, int type);
int ttsd_data_new_client(int pid, int uid);
int ttsd_data_get_pid(int uid);
-int ttsd_data_add_speak_data(int uid, speak_data_s data);
+/* speak data */
+int ttsd_data_add_speak_data(int uid, speak_data_s* data);
-int ttsd_data_get_speak_data(int uid, speak_data_s* data);
+int ttsd_data_get_speak_data(int uid, speak_data_s** data);
int ttsd_data_get_speak_data_size(int uid);
-int ttsd_data_add_sound_data(int uid, sound_data_s data);
+int ttsd_data_clear_speak_data(int uid, speak_data_s** speak_data);
+
+/* sound data */
+int ttsd_data_add_sound_data(int uid, sound_data_s* data);
-int ttsd_data_get_sound_data(int uid, sound_data_s* data);
+int ttsd_data_get_sound_data(int uid, sound_data_s** data);
int ttsd_data_get_sound_data_size(int uid);
+int ttsd_data_clear_sound_data(sound_data_s** sound_data);
+
int ttsd_data_clear_data(int uid);
-int ttsd_data_get_client_state(int pid, app_state_e* state);
-int ttsd_data_set_client_state(int pid, app_state_e state);
+int ttsd_data_set_used_voice(int uid, const char* lang, int type);
+
+int ttsd_data_reset_used_voice(int uid, ttsd_used_voice_cb callback);
+
+int ttsd_data_get_client_state(int pid, app_tts_state_e* state);
+
+int ttsd_data_set_client_state(int pid, app_tts_state_e state);
+
int ttsd_data_get_current_playing();
-typedef bool(*ttsd_data_get_client_cb)(int pid, int uid, app_state_e state, void* user_data);
+typedef bool(*ttsd_data_get_client_cb)(int pid, int uid, app_tts_state_e state, void* user_data);
int ttsd_data_foreach_clients(ttsd_data_get_client_cb callback, void* user_data);
bool ttsd_data_is_uttid_valid(int uid, int uttid);
-int ttsd_data_is_current_playing();
-
-
-int ttsd_setting_data_add(int pid);
+int ttsd_data_get_same_pid_client_count(int pid);
-int ttsd_setting_data_delete(int pid);
+/* For error handing */
+int ttsd_data_save_error_log(int uid, FILE* fp);
-int ttsd_setting_data_is_setting(int pid);
#ifdef __cplusplus
}