Add function to change system volume in internal header 26/217226/1 accepted/tizen/unified/20191111.105509 submit/tizen/20191108.070543
authorwn.jang <wn.jang@samsung.com>
Thu, 7 Nov 2019 23:08:37 +0000 (08:08 +0900)
committerwn.jang <wn.jang@samsung.com>
Thu, 7 Nov 2019 23:08:37 +0000 (08:08 +0900)
Change-Id: Ie0e798049c02419db298a028ed243287ac3f6c0e

client/stt.c
include/stt_internal.h

index c3d68c2..8bf8bc1 100644 (file)
@@ -55,13 +55,6 @@ static bool g_err_callback_status = false;
 static sound_stream_info_h     g_stream_for_volume_h = NULL;
 static virtual_sound_stream_h  g_virtual_sound_stream_h = NULL;
 
-typedef enum {
-       STT_SYSTEM_VOLUME_EVENT_CHANGE_FOR_NEARFIELD,
-       STT_SYSTEM_VOLUME_EVENT_CHANGE_FOR_FARFIELD,
-       STT_SYSTEM_VOLUME_EVENT_RECOVER
-} stt_system_volume_event_e;
-
-
 const char* stt_tag()
 {
        //LCOV_EXCL_START
index ec7c81c..334c3f5 100644 (file)
@@ -39,6 +39,15 @@ typedef enum {
 } stt_audio_type_e;
 
 /**
+* @brief Enumerations of system volume event.
+*/
+typedef enum {
+       STT_SYSTEM_VOLUME_EVENT_CHANGE_FOR_NEARFIELD,   /**< Change system volume event for nearfield */
+       STT_SYSTEM_VOLUME_EVENT_CHANGE_FOR_FARFIELD,    /**< Change system volume event for farfield */
+       STT_SYSTEM_VOLUME_EVENT_RECOVER                                 /**< Recover system volume event */
+} stt_system_volume_event_e;
+
+/**
  * @brief Sets server STT.
  * @details Using this API, the application can set server STT with a @a key as a @a user_data
  *     The key is a private data to set STT server.
@@ -129,6 +138,46 @@ int stt_start_file(stt_h stt, const char* language, const char* type, const char
 */
 int stt_cancel_file(stt_h stt);
 
+/**
+ * @brief Changes system volume with event.
+ * @since_tizen 5.5
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/recorder
+ * @param[in] stt The STT handle
+ * @param[in] volume_event System volume event
+ * @return @c 0 on success,
+ *         otherwise a negative error value
+ * @retval #STT_ERROR_NONE Successful
+ * @retval #STT_ERROR_NOT_SUPPORTED STT NOT supported
+ * @retval #STT_ERROR_PERMISSION_DENIED Permission denied
+ * @retval #STT_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #STT_ERROR_INVALID_STATE Invalid state
+ * @retval #STT_ERROR_OPERATION_FAILED STT Operation failure
+ * @pre The state should be #STT_STATE_CREATED or #STT_STATE_READY.
+ * @see stt_recover_system_volume()
+*/
+int stt_change_system_volume(stt_h stt, stt_system_volume_event_e volume_event);
+
+/**
+ * @brief Recovers system volume.
+ * @since_tizen 5.5
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/recorder
+ * @param[in] stt The STT handle
+ * @param[in] volume_event System volume event
+ * @return @c 0 on success,
+ *         otherwise a negative error value
+ * @retval #STT_ERROR_NONE Successful
+ * @retval #STT_ERROR_NOT_SUPPORTED STT NOT supported
+ * @retval #STT_ERROR_PERMISSION_DENIED Permission denied
+ * @retval #STT_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #STT_ERROR_INVALID_STATE Invalid state
+ * @retval #STT_ERROR_OPERATION_FAILED STT Operation failure
+ * @pre The state should be #STT_STATE_CREATED or #STT_STATE_READY.
+ * @see stt_recover_system_volume()
+*/
+int stt_recover_system_volume(stt_h stt);
+
 #ifdef __cplusplus
 }
 #endif