Added set/unset background volume ratio fucntion.
[platform/core/uifw/tts.git] / include / tts_setting.h
index cada3e7..75351e0 100644 (file)
@@ -148,6 +148,18 @@ typedef void (*tts_setting_speed_changed_cb)(int speed, void *user_data);
 */
 typedef void (*tts_setting_pitch_changed_cb)(int pitch, void *user_data);
 
+/**
+* @brief Called when the current background volume ratio is changed.
+*
+* @param[in] ratio Current background volume ratio
+* @param[in] user_data The user data passed from the callback registration function
+*
+* @pre An application registers this callback using registration function.
+*
+* @see tts_setting_set_background_volume_ratio_changed_cb()
+* @see tts_setting_unset_background_volume_ratio_changed_cb()
+*/
+typedef void (*tts_setting_background_volume_ratio_changed_cb)(double ratio, void *user_data);
 
 /**
 * @brief Initialize TTS setting.
@@ -426,6 +438,40 @@ int tts_setting_get_pitch(int* pitch);
 int tts_setting_set_pitch(int pitch);
 
 /**
+* @brief Gets a current background volume ratio.
+*
+* @param[out] ratio Current background volume ratio
+*
+* @return 0 on success, otherwise a negative error value.
+* @retval #TTS_SETTING_ERROR_NONE Success.
+* @retval #TTS_SETTING_ERROR_INVALID_PARAMETER Invalid parameter.
+* @retval #TTS_SETTING_ERROR_INVALID_STATE Not initialized.
+* @retval #TTS_SETTING_ERROR_OPERATION_FAILED Operation failure.
+* @retval #TTS_SETTING_ERROR_NOT_SUPPORTED_FEATURE Not supported feature.
+* @retval #TTS_SETTING_ERROR_NOT_SUPPORTED TTS NOT supported
+*
+* @see tts_setting_set_background_volume_ratio()
+*/
+int tts_setting_get_background_volume_ratio(double *ratio);
+
+/**
+* @brief Sets a current background volume ratio.
+*
+* @param[in] ratio Current background volume ratio (Range 0.0 ~ 1.0)
+*
+* @return 0 on success, otherwise a negative error value.
+* @retval #TTS_SETTING_ERROR_NONE Success.
+* @retval #TTS_SETTING_ERROR_INVALID_PARAMETER Invalid parameter.
+* @retval #TTS_SETTING_ERROR_INVALID_STATE Not initialized.
+* @retval #TTS_SETTING_ERROR_OPERATION_FAILED Operation failure.
+* @retval #TTS_SETTING_ERROR_NOT_SUPPORTED_FEATURE Not supported feature.
+* @retval #TTS_SETTING_ERROR_NOT_SUPPORTED TTS NOT supported
+*
+* @see tts_setting_get_background_volume_ratio()
+*/
+int tts_setting_set_background_volume_ratio(double ratio);
+
+/**
 * @brief Registers a callback function to be called when engine information is changed
 *
 * @param[in] callback The callback function to register
@@ -542,6 +588,35 @@ int tts_setting_set_pitch_changed_cb(tts_setting_pitch_changed_cb callback, void
 int tts_setting_unset_pitch_changed_cb();
 
 
+/**
+* @brief Sets a callback function to be called when current background volume is changed
+*
+* @param[in] callback The callback function to register
+* @param[in] user_data The user data to be passed to the callback function
+*
+* @return 0 on success, otherwise a negative error value
+* @retval #TTS_SETTING_ERROR_NONE Successful
+* @retval #TTS_SETTING_ERROR_INVALID_PARAMETER Invalid parameter
+* @retval #TTS_SETTING_ERROR_OPERATION_FAILED Invalid state
+* @retval #TTS_SETTING_ERROR_NOT_SUPPORTED TTS NOT supported
+*
+* @see tts_setting_background_volume_ratio_changed_cb()
+* @see tts_setting_unset_background_volume_ratio_changed_cb()
+*/
+int tts_setting_set_background_volume_ratio_changed_cb(tts_setting_background_volume_ratio_changed_cb callback, void* user_data);
+
+/**
+* @brief Unsets the callback function
+*
+* @return 0 on success, otherwise a negative error value
+* @retval #TTS_SETTING_ERROR_NONE Successful
+* @retval #TTS_SETTING_ERROR_OPERATION_FAILED Invalid state
+* @retval #TTS_SETTING_ERROR_NOT_SUPPORTED TTS NOT supported
+*
+* @see tts_setting_set_background_volume_ratio_changed_cb()
+*/
+int tts_setting_unset_background_volume_ratio_changed_cb();
+
 #ifdef __cplusplus
 }
 #endif