From: Suyeon Hwang Date: Tue, 18 Apr 2023 02:39:17 +0000 (+0900) Subject: Move unreleased definitions to the internal header X-Git-Tag: accepted/tizen/7.0/unified/20230526.164235~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=33ec7e005eb5f9e399748c8ad6f81f8ae856b58b;p=platform%2Fcore%2Fuifw%2Ftts.git Move unreleased definitions to the internal header Change-Id: I4746d219d5385713b278bca58abf9115061837c3 Signed-off-by: Suyeon Hwang --- diff --git a/client/tts_client.h b/client/tts_client.h index 4faebc06..1a7d0468 100644 --- a/client/tts_client.h +++ b/client/tts_client.h @@ -18,6 +18,7 @@ #include #include "tts.h" +#include "tts_internal.h" #include "tts_config_mgr.h" #include "tts_main.h" diff --git a/include/tts.h b/include/tts.h index 985d6387..f337fcba 100644 --- a/include/tts.h +++ b/include/tts.h @@ -96,18 +96,6 @@ typedef enum { } tts_service_state_e; -/** - * @brief Enumeration for synthesized pcm event. - * @since_tizen 7.5 -*/ -typedef enum { - TTS_SYNTHESIZED_PCM_EVENT_FAIL = -1, /**< 'Error' event */ - TTS_SYNTHESIZED_PCM_EVENT_START, /**< 'Started' event */ - TTS_SYNTHESIZED_PCM_EVENT_CONTINUE, /**< 'Finished' event */ - TTS_SYNTHESIZED_PCM_EVENT_FINISH, /**< 'Finished' event */ -} tts_synthesized_pcm_event_e; - - /** * @brief Definition for automatic speaking speed. * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif @@ -281,22 +269,6 @@ typedef void (*tts_screen_reader_changed_cb)(tts_h tts, bool is_on, void* user_d typedef void (*tts_service_state_changed_cb)(tts_h tts, tts_service_state_e previous, tts_service_state_e current, void* user_data); -/** - * @brief Called when the synthesized pcm data is come from the engine. - * @since_tizen 7.5 - * @remarks The @a tts handle should not be destroyed in the callback. - * @param[in] tts The TTS handle, the same handle for which the callback was set. - * @param[in] event The event type - * @param[in] buffer The synthesized pcm data - * @param[in] buffer_size The size of the buffer - * @param[in] user_data The user data passed from the callback registration function - * @pre An application registers this callback using tts_set_synthesized_pcm_cb() to get pcm data. - * @see tts_set_synthesized_pcm_cb() - * @see tts_unset_synthesized_pcm_cb() - */ -typedef void (*tts_synthesized_pcm_cb)(tts_h tts, tts_synthesized_pcm_event_e event, char* buffer, int buffer_size, void *user_data); - - /** * @brief Creates a handle for TTS. * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif @@ -1042,41 +1014,6 @@ int tts_set_service_state_changed_cb(tts_h tts, tts_service_state_changed_cb cal */ int tts_unset_service_state_changed_cb(tts_h tts); - -/** - * @brief Sets the default to be called when the synthesized pcm data is recieved. - * @since_tizen 7.5 - * @param[in] tts The TTS handle - * @param callback The callback function to register - * @param user_data The user data to be passed to the callback function - * @return @c 0 on success, - * otherwise a negative error value - * @retval #TTS_ERROR_NONE Successful - * @retval #TTS_ERROR_NOT_SUPPORTED TTS NOT supported - * @retval #TTS_ERROR_INVALID_PARAMETER Invalid parameter - * @retval #TTS_ERROR_INVALID_STATE Invalid state - * @pre The TTS state should be #TTS_STATE_CREATED. - * @see tts_synthesized_pcm_cb() - * @see tts_unset_synthesized_pcm_cb() - */ -int tts_set_synthesized_pcm_cb(tts_h tts, tts_synthesized_pcm_cb callback, void* user_data); - - -/** - * @brief Unsets the callback function. - * @since_tizen 7.5 - * @param tts The TTS handle - * @return @c 0 on success, - * otherwise a negative error value - * @retval #TTS_ERROR_NONE Successful - * @retval #TTS_ERROR_NOT_SUPPORTED TTS NOT supported - * @retval #TTS_ERROR_INVALID_PARAMETER Invalid parameter - * @retval #TTS_ERROR_INVALID_STATE Invalid state - * @pre The TTS state should be #TTS_STATE_CREATED. - * @see tts_set_synthesized_pcm_cb() - */ -int tts_unset_synthesized_pcm_cb(tts_h tts); - #ifdef __cplusplus } #endif diff --git a/include/tts_internal.h b/include/tts_internal.h index ab07e245..0aeee265 100644 --- a/include/tts_internal.h +++ b/include/tts_internal.h @@ -27,11 +27,41 @@ extern "C" { #endif + +/** + * @brief Enumeration for synthesized pcm event. + * @since_tizen 7.5 +*/ +typedef enum { + TTS_SYNTHESIZED_PCM_EVENT_FAIL = -1, /**< 'Error' event */ + TTS_SYNTHESIZED_PCM_EVENT_START, /**< 'Started' event */ + TTS_SYNTHESIZED_PCM_EVENT_CONTINUE, /**< 'Finished' event */ + TTS_SYNTHESIZED_PCM_EVENT_FINISH, /**< 'Finished' event */ +} tts_synthesized_pcm_event_e; + + /** * @brief Definition for TTS interrupt mode */ #define TTS_MODE_INTERRUPT 3 + +/** + * @brief Called when the synthesized pcm data is come from the engine. + * @since_tizen 7.5 + * @remarks The @a tts handle should not be destroyed in the callback. + * @param[in] tts The TTS handle, the same handle for which the callback was set. + * @param[in] event The event type + * @param[in] buffer The synthesized pcm data + * @param[in] buffer_size The size of the buffer + * @param[in] user_data The user data passed from the callback registration function + * @pre An application registers this callback using tts_set_synthesized_pcm_cb() to get pcm data. + * @see tts_set_synthesized_pcm_cb() + * @see tts_unset_synthesized_pcm_cb() + */ +typedef void (*tts_synthesized_pcm_cb)(tts_h tts, tts_synthesized_pcm_event_e event, char* buffer, int buffer_size, void *user_data); + + /** * @brief Sets server tts. * @details Using this API, the application can ask server tts with a credential. @@ -121,6 +151,41 @@ int tts_play_pcm(tts_h tts); int tts_stop_pcm(tts_h tts); +/** + * @brief Sets the default to be called when the synthesized pcm data is recieved. + * @since_tizen 7.5 + * @param[in] tts The TTS handle + * @param callback The callback function to register + * @param user_data The user data to be passed to the callback function + * @return @c 0 on success, + * otherwise a negative error value + * @retval #TTS_ERROR_NONE Successful + * @retval #TTS_ERROR_NOT_SUPPORTED TTS NOT supported + * @retval #TTS_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #TTS_ERROR_INVALID_STATE Invalid state + * @pre The TTS state should be #TTS_STATE_CREATED. + * @see tts_synthesized_pcm_cb() + * @see tts_unset_synthesized_pcm_cb() + */ +int tts_set_synthesized_pcm_cb(tts_h tts, tts_synthesized_pcm_cb callback, void* user_data); + + +/** + * @brief Unsets the callback function. + * @since_tizen 7.5 + * @param tts The TTS handle + * @return @c 0 on success, + * otherwise a negative error value + * @retval #TTS_ERROR_NONE Successful + * @retval #TTS_ERROR_NOT_SUPPORTED TTS NOT supported + * @retval #TTS_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #TTS_ERROR_INVALID_STATE Invalid state + * @pre The TTS state should be #TTS_STATE_CREATED. + * @see tts_set_synthesized_pcm_cb() + */ +int tts_unset_synthesized_pcm_cb(tts_h tts); + + #ifdef __cplusplus }