Modify callback(name and parameter) and Remove unused return value 15/317615/3
authorsungwook79.park <sungwook79.park@samsung.com>
Thu, 12 Sep 2024 08:17:42 +0000 (17:17 +0900)
committersungwook park <sungwook79.park@samsung.com>
Mon, 23 Sep 2024 10:12:37 +0000 (10:12 +0000)
Change-Id: I397cfe504e372fa3fb954d04d28ec77ef6118d99
Signed-off-by: sungwook79.park <sungwook79.park@samsung.com>
include/tts.h
include/ttse.h
server/ttsd_engine_agent.c
server/ttsd_engine_agent.h
server/ttsd_main.h
server/ttsd_server.c
server/ttsd_server.h
server/ttse.c

index 0c72554d57783fc043cd04f16fc1d5466780f63d..5b48c65ff68b19509b983d365e562f39f420b29e 100644 (file)
@@ -1338,7 +1338,6 @@ int tts_synthesis_parameter_set_background_volume_ratio(tts_synthesis_parameter_
  *         otherwise a negative error value
  * @retval #TTS_ERROR_NONE Successful
  * @retval #TTS_ERROR_NOT_SUPPORTED TTS NOT supported
- * @retval #TTS_ERROR_NOT_SUPPORTED_FEATURE Not supported feature.
  * @retval #TTS_ERROR_INVALID_PARAMETER Invalid parameter
  * @retval #TTS_ERROR_INVALID_STATE Invalid state
  * @retval #TTS_ERROR_OPERATION_FAILED Operation failure
@@ -1375,7 +1374,6 @@ int tts_get_volume_range(tts_h tts, int* min, int* max);
  *         otherwise a negative error value
  * @retval #TTS_ERROR_NONE Successful
  * @retval #TTS_ERROR_NOT_SUPPORTED TTS NOT supported
- * @retval #TTS_ERROR_PERMISSION_DENIED Permission denied
  * @retval #TTS_ERROR_INVALID_PARAMETER Invalid parameter
  * @retval #TTS_ERROR_INVALID_STATE Invalid state
  * @retval #TTS_ERROR_INVALID_VOICE Invalid voice about language, voice type
index cffe6791ccab15d0f45be7230bb7caf1d947f3c1..fd54f6f63e5672f95f3dee916d9a0d9f3685a4f6 100755 (executable)
@@ -219,6 +219,7 @@ typedef int (*ttse_set_pitch_cb)(int pitch);
 * @since_tizen 9.0
 * @remarks This callback function is optional and is registered using ttse_set_personal_tts_id_set_cb().
 * @param[in] ptts_id The personal tts id
+* @param[in] user_data The user data to be passed to the callback function
 * @return @c 0 on success,
 *         otherwise a negative error value
 * @retval #TTSE_ERROR_NONE Successful
@@ -226,7 +227,7 @@ typedef int (*ttse_set_pitch_cb)(int pitch);
 * @retval #TTSE_ERROR_INVALID_STATE Not initialized
 * @retval #TTSE_ERROR_OPERATION_FAILED Operation failure
 */
-typedef int (*ttse_set_personal_tts_id_cb)(const char* ptts_id);
+typedef int (*ttse_personal_tts_id_set_cb)(const char* ptts_id, void* user_data);
 
 
 /**
@@ -712,8 +713,9 @@ int ttse_set_activated_mode_changed_cb(ttse_activated_mode_changed_cb callback);
 /**
 * @brief Sets a callback function to be called when a personal TTS id is set.
 * @since_tizen 9.0
-* @remarks The ttse_set_personal_tts_id_cb() function is called when the engine service user sends the ptts_id.
+* @remarks The ttse_personal_tts_id_set_cb() function is called when the engine service user sends the ptts_id.
 * @param[in] callback ttse_set_personal_tts_id event callback function
+* @param[in] user_data The user data passed from engine
 * @return @c 0 on success,
 *         otherwise a negative error value
 * @retval #TTSE_ERROR_NONE Successful
@@ -721,9 +723,9 @@ int ttse_set_activated_mode_changed_cb(ttse_activated_mode_changed_cb callback);
 * @retval #TTSE_ERROR_INVALID_PARAMETER Invalid parameter
 * @retval #TTSE_ERROR_INVALID_STATE Not initialized
 * @pre The ttse_main() function should be invoked before this function is called.
-* @see ttse_set_personal_tts_id_cb()
+* @see ttse_personal_tts_id_set_cb()
 */
-int ttse_set_personal_tts_id_set_cb(ttse_set_personal_tts_id_cb callback);
+int ttse_set_personal_tts_id_set_cb(ttse_personal_tts_id_set_cb callback, void* user_data);
 
 
 /**
index 44937d62b16646b3321a5f29e04679ab410e70e7..1f0d4ce8ed08e058f1d912ff447bba95d5095723 100644 (file)
@@ -868,7 +868,7 @@ int ttsd_engine_agent_set_personal_tts_id(const char* ptts_id)
                return TTSD_ERROR_NOT_SUPPORTED_FEATURE;
        }
 
-       ret = g_engine_info->callbacks->set_personal_tts_id(ptts_id);
+       ret = g_engine_info->callbacks->set_personal_tts_id(ptts_id, NULL);
        if (0 != ret) {
                SLOG(LOG_ERROR, tts_tag(), "[Engine Agent ERROR] Fail to set personal tts id : ptts_id(%s), result(%s)",
                         ptts_id, __ttsd_get_engine_error_code(ret));
@@ -1409,7 +1409,7 @@ int ttsd_engine_agent_set_activated_mode_changed_cb(ttse_activated_mode_changed_
        return TTSD_ERROR_NONE;
 }
 
-int ttsd_engine_agent_set_personal_tts_id_set_cb(ttse_set_personal_tts_id_cb callback)
+int ttsd_engine_agent_set_personal_tts_id_set_cb(ttse_personal_tts_id_set_cb callback)
 {
        if (false == __is_agent_initialized()) {
                SLOG(LOG_ERROR, tts_tag(), "[Engine Agent ERROR] Not Initialized");
index fe2bb37ea3b9bd5ebf5e63346f78df963a3a61d8..366ee388fde1f71ba2ee2fca3e6a28c323fe1772 100644 (file)
@@ -40,7 +40,7 @@ int ttsd_engine_agent_load_current_engine();
 int ttsd_engine_agent_set_private_data_set_cb(ttse_private_data_set_cb callback);
 int ttsd_engine_agent_set_private_data_requested_cb(ttse_private_data_requested_cb callback);
 int ttsd_engine_agent_set_activated_mode_changed_cb(ttse_activated_mode_changed_cb callback);
-int ttsd_engine_agent_set_personal_tts_id_set_cb(ttse_set_personal_tts_id_cb callback);
+int ttsd_engine_agent_set_personal_tts_id_set_cb(ttse_personal_tts_id_set_cb callback);
 
 /** Unload current engine */
 int ttsd_engine_agent_unload_current_engine();
index 7f80001cbbcf989baefdf174e02340b7827eefa0..68908f976fa6f0b1106a24fcdd3ff23976fe9241 100644 (file)
@@ -112,7 +112,7 @@ typedef struct {
        ttse_private_data_set_cb                private_data_set;
        ttse_private_data_requested_cb          private_data_requested;
        ttse_activated_mode_changed_cb          activated_mode_changed;
-       ttse_set_personal_tts_id_cb             set_personal_tts_id;
+       ttse_personal_tts_id_set_cb             set_personal_tts_id;
 } tts_engine_callback_s;
 
 
index 122fe9a3941c9fd677dd9c7190f59ba6abb766b3..0fbc0ebd27369913d8ae6bd27ed7201e4fc7d9cb 100644 (file)
@@ -1663,7 +1663,7 @@ int ttsd_set_activated_mode_changed_cb(ttse_activated_mode_changed_cb callback)
        return ret;
 }
 
-int ttsd_set_personal_tts_id_set_cb(ttse_set_personal_tts_id_cb callback)
+int ttsd_set_personal_tts_id_set_cb(ttse_personal_tts_id_set_cb callback, void* user_data)
 {
        int ret = ttsd_engine_agent_set_personal_tts_id_set_cb(callback);
        if (TTSD_ERROR_NONE != ret) {
index d7d9afedf7befc3b91ef690665ecbd1c25340a9a..fbdaf92da646a4516cbcbdf9af6efd1e3663e9a6 100644 (file)
@@ -43,7 +43,7 @@ int ttsd_set_private_data_requested_cb(ttse_private_data_requested_cb callback);
 int ttsd_get_activated_mode(int* activated_mode);
 int ttsd_set_activated_mode_changed_cb(ttse_activated_mode_changed_cb callback);
 
-int ttsd_set_personal_tts_id_set_cb(ttse_set_personal_tts_id_cb callback);
+int ttsd_set_personal_tts_id_set_cb(ttse_personal_tts_id_set_cb callback, void* user_data);
 
 int ttsd_send_personal_voice(const char* language, const char* unique_id, const char* display_name, const char* device_name, void* user_data);
 
index a6bc4a23381f57d9bbfd1ad7c666981c2b611a33..996c94b38dee94ae8533ed3099d1ecab408d8e69 100755 (executable)
@@ -365,7 +365,7 @@ int ttse_set_activated_mode_changed_cb(ttse_activated_mode_changed_cb callback)
        return ret;
 }
 
-int ttse_set_personal_tts_id_set_cb(ttse_set_personal_tts_id_cb callback)
+int ttse_set_personal_tts_id_set_cb(ttse_personal_tts_id_set_cb callback, void* user_data)
 {
        if (false == is_feature_enabled()) {
                return TTSE_ERROR_NOT_SUPPORTED;
@@ -381,7 +381,7 @@ int ttse_set_personal_tts_id_set_cb(ttse_set_personal_tts_id_cb callback)
                return TTSE_ERROR_INVALID_STATE;
        }
 
-       int ret = ttsd_set_personal_tts_id_set_cb(callback);
+       int ret = ttsd_set_personal_tts_id_set_cb(callback, user_data);
        if (TTSD_ERROR_NONE != ret) {
                SLOG(LOG_ERROR, tts_tag(), "[ERROR] Fail to set personal tts id set cb. ret(%d/%s)", ret, get_error_message(ret));
        }