static Ecore_Pipe *gNotiPipe;
typedef enum {
MP_APP_PIPE_CB_AVAILABLE_ROUTE_CHANGED,
- MP_APP_PIPE_CB_ACTIVE_DEVICE_CHANGED,
+ MP_APP_PIPE_CB_DEVICE_RUNNING_CHANGED,
} mp_app_pipe_cb_type_e;
typedef struct {
mp_app_pipe_cb_type_e type;
void *user_data;
//Replaced for _prod dependency
- sound_device_state_e out;
+ bool running;
} mp_app_pipe_data_s;
#ifdef MP_FEATURE_USB_OTG
}
/*
-* The device state changed callback function
+* The device running changed callback function
* @param sound device
* @param Sound device changed info
* @param data appdata
* @return void
*/
static void
-_mp_app_active_device_chaged_cb(sound_device_h in,
- sound_device_state_e out,
+_mp_app_device_running_changed_cb(sound_device_h device,
+ bool is_running,
void *user_data)
{
- EVENT_TRACE("input=[0x%x], output=[0x%x]", in, out);
+ sound_device_type_e type;
+
+ sound_manager_get_device_type(device, &type);
+ EVENT_TRACE("device[type:%d], is_running[%u]", type, is_running);
MP_CHECK(gNotiPipe);
mp_app_pipe_data_s pipe_data;
memset(&pipe_data, 0, sizeof(mp_app_pipe_data_s));
- pipe_data.type = MP_APP_PIPE_CB_ACTIVE_DEVICE_CHANGED;
- pipe_data.out = out;
+ pipe_data.type = MP_APP_PIPE_CB_DEVICE_RUNNING_CHANGED;
+ pipe_data.running = is_running;
pipe_data.user_data = user_data;
ecore_pipe_write(gNotiPipe, &pipe_data, sizeof(mp_app_pipe_data_s));
mp_view_mgr_post_event(GET_VIEW_MGR, MP_ROUTE_CHANGED);
break;
- case MP_APP_PIPE_CB_ACTIVE_DEVICE_CHANGED:
- mp_setting_update_active_device();
+ case MP_APP_PIPE_CB_DEVICE_RUNNING_CHANGED:
+ /* FIXME: check condition to do what it really wants. */
+ mp_setting_update_active_device(); /* empty function */
mp_view_mgr_post_event(GET_VIEW_MGR, MP_ROUTE_CHANGED);
break;
}
WARN_TRACE("Leave sound_manager_set_available_route_changed_cb");
- WARN_TRACE("Enter sound_manager_set_active_device_changed_cb");
+ WARN_TRACE("Enter sound_manager_add_device_running_changed_cb");
ret =
- sound_manager_add_device_state_changed_cb
- (SOUND_DEVICE_ALL_MASK, _mp_app_active_device_chaged_cb, ad, &ad->device_state_id);
+ sound_manager_add_device_running_changed_cb
+ (SOUND_DEVICE_ALL_MASK, _mp_app_device_running_changed_cb, ad, &ad->device_state_id);
if (ret != SOUND_MANAGER_ERROR_NONE) {
ERROR_TRACE
- ("sound_manager_set_active_device_changed_cb().. [0x%x]", ret);
+ ("sound_manager_add_device_running_changed_cb().. [0x%x]", ret);
res = FALSE;
}
- WARN_TRACE("Leave sound_manager_set_active_device_changed_cb");
+ WARN_TRACE("Leave sound_manager_add_device_running_changed_cb");
ret = mp_media_info_set_db_update_cb(_mp_app_db_update_cb, NULL);
if (ret != 0) {