int ended_handle = 0;
g_variant_get(params, "(i)", &ended_handle);
((mm_sound_stop_callback_wrapper_func)(cb_data->user_cb))(ended_handle, cb_data->user_data);
+ } else if (event == AUDIO_EVENT_DUCKING_STATE_CHANGED) {
+ int idx = 0;
+ int is_ducked = 0;
+
+ g_variant_get(params, "(ii)", &idx, &is_ducked);
+
+ ((mm_sound_ducking_state_changed_wrapper_cb)(cb_data->user_cb))(idx, is_ducked, cb_data->user_data);
}
}
return ret;
}
+int mm_sound_proxy_add_ducking_state_changed_callback(mm_sound_ducking_state_changed_wrapper_cb func, void* userdata, mm_sound_proxy_userdata_free freefunc, unsigned *subs_id)
+{
+ int ret = MM_ERROR_NONE;
+ struct callback_data *cb_data;
+
+ debug_fenter();
+
+ CB_DATA_NEW(cb_data, func, userdata, freefunc);
+
+ if ((ret = mm_sound_dbus_signal_subscribe_to(AUDIO_PROVIDER_STREAM_MANAGER, AUDIO_EVENT_DUCKING_STATE_CHANGED, dbus_callback, cb_data, simple_callback_data_free_func, &cb_data->subs_id)) != MM_ERROR_NONE)
+ debug_error("Add Duckding State changed callback failed");
+ else
+ *subs_id = cb_data->subs_id;
+
+ debug_fleave();
+
+ return ret;
+}
+
+int mm_sound_proxy_remove_ducking_state_changed_callback(unsigned subs_id)
+{
+ int ret = MM_ERROR_NONE;
+ debug_fenter();
+
+ if ((ret = mm_sound_dbus_signal_unsubscribe(subs_id)) != MM_ERROR_NONE)
+ debug_error("Remove Ducking State changed callback failed");
+
+ debug_fleave();
+ return ret;
+}
+
int mm_sound_proxy_set_mute_by_type(const char *volume_type, bool mute)
{
int ret = MM_ERROR_NONE;
debug_fenter();
- mm_sound_client_is_focus_cb_thread(g_thread_self(), &is_in_focus_cb_thread);
+ mm_sound_client_is_focus_cb_thread(g_thread_self(), &is_in_focus_cb_thread, NULL);
if (!is_in_focus_cb_thread) {
if ((ret = mm_sound_focus_socket_acquire(pid, client_fd, id,
type, option, ext_info ? ext_info : "", true)))
debug_fenter();
- mm_sound_client_is_focus_cb_thread(g_thread_self(), &is_in_focus_cb_thread);
+ mm_sound_client_is_focus_cb_thread(g_thread_self(), &is_in_focus_cb_thread, NULL);
if (!is_in_focus_cb_thread) {
if ((ret = mm_sound_focus_socket_release(pid, client_fd, id, type, option, ext_info ? ext_info : "", true)))
debug_error("failed to mm_sound_focus_socket_release(), ret[0x%x]", ret);