int sound_manager_get_focus_state(sound_stream_info_h stream_info, sound_stream_focus_state_e *state_for_playback, sound_stream_focus_state_e *state_for_recording);
/**
+ * @brief Sets auto focus reacquisition property.
+ * @since_tizen 3.0
+ * @param[in] stream_info The handle of stream information
+ * @param[in] enable The auto focus reacquisition property to set : (@c true = enable, @c false = disable)
+ *
+ * @remarks The focus reacquistion is set as default.
+ * If you don't want to reacquire the focus you've lost automatically, disable the focus reacqusition setting by using this API and vice versa.
+ *
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ * @retval #SOUND_MANAGER_ERROR_NONE Success
+ * @retval #SOUND_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
+ * @pre Call sound_manager_create_stream_information() before calling this function.
+ * @see sound_manager_create_stream_information()
+ */
+int sound_manager_set_focus_reacquisition(sound_stream_info_h stream_info, bool enable);
+
+/**
+ * @brief Gets auto focus reacquisition property.
+ * @since_tizen 3.0
+ * @param[in] stream_info The handle of stream information
+ * @param[out] enabled The value of focus auto reacquisition property : (@c true = enabled, @c false = disabled)
+ *
+ * @remarks The default value is true.
+ *
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ * @retval #SOUND_MANAGER_ERROR_NONE Success
+ * @retval #SOUND_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
+ * @pre Call sound_manager_create_stream_information() before calling this function.
+ * @see sound_manager_create_stream_information()
+ */
+int sound_manager_get_focus_reacquisition(sound_stream_info_h stream_info, bool *enabled);
+
+/**
* @brief Gets the sound type of the stream information.
* @since_tizen 3.0
* @param[in] stream_info The handle of stream information
return _convert_sound_manager_error_code(__func__, ret);
}
+int sound_manager_set_focus_reacquisition(sound_stream_info_h stream_info, bool enable)
+{
+ int ret = MM_ERROR_NONE;
+ sound_stream_info_s *stream_h = (sound_stream_info_s*)stream_info;
+
+ LOGI(">> enter");
+
+ SM_INSTANCE_CHECK(stream_h);
+
+ ret = mm_sound_set_focus_reacquisition(stream_h->index, enable);
+
+ LOGI("<< leave : ret(%p)", ret);
+
+ return _convert_sound_manager_error_code(__func__, ret);
+}
+
+int sound_manager_get_focus_reacquisition(sound_stream_info_h stream_info, bool *enabled)
+{
+ int ret = MM_ERROR_NONE;
+ sound_stream_info_s *stream_h = (sound_stream_info_s*)stream_info;
+
+ LOGI(">> enter");
+
+ SM_INSTANCE_CHECK(stream_h);
+ SM_NULL_ARG_CHECK(enabled);
+
+ ret = mm_sound_get_focus_reacquisition(stream_h->index, enabled);
+
+ LOGI("<< leave : ret(%p)", ret);
+
+ return _convert_sound_manager_error_code(__func__, ret);
+}
+
int sound_manager_acquire_focus(sound_stream_info_h stream_info, sound_stream_focus_mask_e focus_mask, const char *additional_info)
{
int ret = MM_ERROR_NONE;
CURRENT_STATUS_DESTROY_STREAM_INFO,
CURRENT_STATUS_SET_FOCUS_WATCH_CB,
CURRENT_STATUS_UNSET_FOCUS_WATCH_CB,
+ CURRENT_STATUS_SET_FOCUS_REACQUISITION,
+ CURRENT_STATUS_GET_FOCUS_REACQUISITION,
CURRENT_STATUS_CREATE_VIRTUAL_STREAM,
CURRENT_STATUS_START_VIRTUAL_STREAM,
CURRENT_STATUS_STOP_VIRTUAL_STREAM,
g_menu_state = CURRENT_STATUS_SET_FOCUS_WATCH_CB;
else if (strncmp(cmd, "ufw", 3) == 0)
g_menu_state = CURRENT_STATUS_UNSET_FOCUS_WATCH_CB;
+ else if (strncmp(cmd, "sfr", 3) == 0)
+ g_menu_state = CURRENT_STATUS_SET_FOCUS_REACQUISITION;
+ else if (strncmp(cmd, "gfr", 3) == 0)
+ g_menu_state = CURRENT_STATUS_GET_FOCUS_REACQUISITION;
else if (strncmp(cmd, "dsi", 3) == 0)
g_menu_state = CURRENT_STATUS_DESTROY_STREAM_INFO;
else if (strncmp(cmd, "vcr", 3) == 0)
g_print("gfs. Get Focus State\n");
g_print("sfw. Set Focus State Watch CB\t");
g_print("ufw. Unset Focus State Watch CB\n");
+ g_print("sfr. Set Focus Reacquisition\t");
+ g_print("gfr. Get Focus Reacquisition\n");
g_print("sso. *Set option for stream routing\n");
g_print("vcr. *Create VStream\t");
g_print("vsr. *Start VStream\t");
g_print("*** input focus type to watch for (0:playback, 1:recording, 2:both)\n");
else if (g_menu_state == CURRENT_STATUS_UNSET_FOCUS_WATCH_CB)
g_print("*** press enter to unset focus state watch cb\n");
+ else if (g_menu_state == CURRENT_STATUS_SET_FOCUS_REACQUISITION)
+ g_print("*** input focus reacquisition property (1:enable, 2:disable)\n");
+ else if (g_menu_state == CURRENT_STATUS_GET_FOCUS_REACQUISITION)
+ g_print("*** press enter to get focus reacquisition property (1:enabled, 2:disabled)\n");
else if (g_menu_state == CURRENT_STATUS_CREATE_VIRTUAL_STREAM)
g_print("*** press enter to create virtual stream\n");
else if (g_menu_state == CURRENT_STATUS_START_VIRTUAL_STREAM)
reset_menu_state();
break;
}
+ case CURRENT_STATUS_SET_FOCUS_REACQUISITION: {
+ int ret = SOUND_MANAGER_ERROR_NONE;
+ bool enable;
+
+ switch (atoi(cmd)) {
+ case 1: /* enable */
+ enable = true;
+ break;
+ case 2: /* disable */
+ enable = false;
+ break;
+ default:
+ enable = true;
+ break;
+ }
+ ret = sound_manager_set_focus_reacquisition(g_stream_info_h, enable);
+ if (ret)
+ g_print("fail to sound_manager_set_focus_reacquisition, ret(0x%x)\n", ret);
+ reset_menu_state();
+ break;
+ }
+ case CURRENT_STATUS_GET_FOCUS_REACQUISITION: {
+ int ret = SOUND_MANAGER_ERROR_NONE;
+ bool enabled;
+
+ ret = sound_manager_get_focus_reacquisition(g_stream_info_h, &enabled);
+ if (ret)
+ g_print("fail to sound_manager_get_focus_reacquisition, ret(0x%x)\n", ret);
+ if (enabled)
+ g_print("auto focus reacquisition is enabled\n");
+ else
+ g_print("auto focus reacquisition is disabled\n");
+ reset_menu_state();
+ break;
+ }
case CURRENT_STATUS_CREATE_VIRTUAL_STREAM: {
int ret = SOUND_MANAGER_ERROR_NONE;
if (!g_stream_info_h || g_vstream_h) {