Tizen 2.0 Release
[platform/core/uifw/libttssmt.git] / src / ttsp.c
1 /*\r
2  * Samsung TTS\r
3  * Copyright 2012  Samsung Electronics Co., Ltd\r
4  *\r
5  * Licensed under the Flora License, Version 1.0 (the License);\r
6  * you may not use this file except in compliance with the License.\r
7  * You may obtain a copy of the License at\r
8  *\r
9  * http://floralicense.org/license/\r
10  *\r
11  * Unless required by applicable law or agreed to in writing, software\r
12  * distributed under the License is distributed on an AS IS BASIS,\r
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
14  * See the License for the specific language governing permissions and\r
15  * limitations under the License.\r
16  */\r
17 \r
18 #include "stdio.h"\r
19 #include "memory.h"\r
20 \r
21 #include <ttsp.h>\r
22 #include "plugin_internal.h"\r
23 \r
24 char * _psz             = NULL;\r
25 char * _pszEngineUUID;\r
26 char * _pszEngineName;\r
27 char * _pszEngineUgName;\r
28 \r
29 \r
30 \r
31 int ttsp_load_engine(ttspd_funcs_s* pdfuncs, ttspe_funcs_s* pefuncs)\r
32 {\r
33   if (! pdfuncs)\r
34   {\r
35     printf("parameter1, pdfuncs is NULL.");\r
36     return TTSP_ERROR_INVALID_PARAMETER;\r
37   }\r
38   if (! pefuncs)\r
39   {\r
40     printf("parameter2, pefuncs is NULL.");\r
41     return TTSP_ERROR_INVALID_PARAMETER;\r
42   }\r
43 \r
44   pefuncs->size              = sizeof(ttspe_funcs_s);\r
45   pefuncs->version           = 1;\r
46 \r
47   pefuncs->initialize        = plugin_Initialize;\r
48   pefuncs->deinitialize      = plugin_Finalize;\r
49 \r
50   pefuncs->start_synth       = plugin_SynthesizeText;\r
51   pefuncs->cancel_synth      = plugin_StopSynthesis;\r
52   pefuncs->get_audio_format  = plugin_GetAudioFormat;\r
53 \r
54   pefuncs->foreach_voices    = plugin_ForeachVoices;\r
55   pefuncs->is_valid_voice    = plugin_IsValidVoice;\r
56 \r
57   pefuncs->set_engine_setting  = plugin_SetSettingInfo;\r
58   pefuncs->foreach_engine_setting  = plugin_ForeachEngineSetting;\r
59 \r
60   plugin_SetDaemonAPIs(pdfuncs);\r
61 \r
62   printf("[SMT] ttsp_load_engine() : version(%d), (6.20110527), size(%d)\n", pefuncs->version, pefuncs->size);\r
63 \r
64   return TTSP_ERROR_NONE;\r
65 }\r
66 \r
67 void ttsp_unload_engine(void)\r
68 {\r
69   printf("[SMT] ttsp_unload_engine() \n");\r
70 }\r
71 \r
72 int ttsp_get_engine_info(ttsp_engine_info_cb callback, void* user_data)\r
73 {\r
74 \r
75         callback(ENGINE_UUID, ENGINE_NAME, ENGINE_UG_NAME, false, user_data);\r
76 \r
77         return 0;\r
78 }\r