common_view* view;
Evas_Object *info_label;
- Evas_Object *device_label;
};
static void _app_destroy_cb(void* this);
void _sound_device_connected_cb(sound_device_h device, bool is_connected, void *user_data);
-void _sound_device_information_changed_cb(sound_device_h device, sound_device_changed_info_e changed_info, void *user_data);
static bool is_not_supported = false;
{
RETVM_IF(NULL == navi, NULL, "navi is null");
int ret;
- soundmanager_view *this = NULL;
- this = calloc(1, sizeof(soundmanager_view));
- RETVM_IF(!this, NULL, "calloc failed");
+ soundmanager_view *this = NULL;
+ this = calloc(1, sizeof(soundmanager_view));
+ RETVM_IF(!this, NULL, "calloc failed");
- this->view = calloc(1, sizeof(common_view));
- RETVM_IF(!this->view, NULL, "calloc failed");
+ this->view = calloc(1, sizeof(common_view));
+ RETVM_IF(!this->view, NULL, "calloc failed");
tbt_info->layout_group = "2_part_cnt_btn";
- tbt_info->layout_file = get_edje_path("2_part_cnt3.5_btn.edj");
+ tbt_info->layout_file = get_edje_path("2_part_cnt3.5_btn.edj");
- common_view_add(navi, tbt_info, item, this->view, _app_destroy_cb, this);
- RETVM_IF(NULL == this->view, NULL, "navi is null");
+ common_view_add(navi, tbt_info, item, this->view, _app_destroy_cb, this);
+ RETVM_IF(NULL == this->view, NULL, "navi is null");
- if(this->view->tbt_info->apptype == TBT_APP_SOUND_MANAGER)
- {
-
- ret = sound_manager_set_device_connected_cb(SOUND_DEVICE_IO_DIRECTION_BOTH_MASK,_sound_device_connected_cb,this);
- RETVM_IF(ret != SOUND_MANAGER_ERROR_NONE && ret != SOUND_MANAGER_ERROR_NOT_SUPPORTED, NULL, "sound_manager_set_device_connected_cb failed : %s", get_soundmanager_error(ret));
-
- this->info_label = ui_utils_label_add(this->view->layout, "Please change Audio Jack state[Insert/Remove]");
- elm_label_line_wrap_set(this->info_label, ELM_WRAP_WORD);
-
- if(ret == SOUND_MANAGER_ERROR_NOT_SUPPORTED)
- {
- is_not_supported = true;
- Evas_Object *popup = ui_utils_popup_add(this->view->navi, "Message");
- elm_object_text_set(popup, "Sound Device is not supported");
- RETVM_IF(!this->view, NULL,"Sound Device is not supported");
- }
- elm_object_part_content_set(this->view->layout, "1cnt", this->info_label);
- return this;
- }
- else if (this->view->tbt_info->apptype == TBT_APP_SOUND_MANAGER_DEVICE)
- {
+ ret = sound_manager_set_device_connected_cb(SOUND_DEVICE_IO_DIRECTION_BOTH_MASK,_sound_device_connected_cb,this);
+ RETVM_IF(ret != SOUND_MANAGER_ERROR_NONE && ret != SOUND_MANAGER_ERROR_NOT_SUPPORTED, NULL, "sound_manager_set_device_connected_cb failed : %s", get_soundmanager_error(ret));
- ret = sound_manager_set_device_information_changed_cb(SOUND_DEVICE_TYPE_EXTERNAL_MASK, _sound_device_information_changed_cb,this);
- RETVM_IF(ret != SOUND_MANAGER_ERROR_NONE && ret != SOUND_MANAGER_ERROR_NOT_SUPPORTED, NULL, "sound_manager_set_device_information_changed_cb failed : %s", get_soundmanager_error(ret));
-
- this->info_label = ui_utils_label_add(this->view->layout, "Insert Audio jack and change sound profile to Sound");
- elm_label_line_wrap_set(this->info_label, ELM_WRAP_WORD);
-
- if(ret == SOUND_MANAGER_ERROR_NOT_SUPPORTED)
- {
- is_not_supported = true;
- Evas_Object *popup = ui_utils_popup_add(this->view->navi, "Message");
- elm_object_text_set(popup, "Sound Device is not supported");
- RETVM_IF(!this->view, NULL,"Sound Device is not supported");
- }
- elm_object_part_content_set(this->view->layout, "1cnt", this->info_label);
- return this;
- }
+ this->info_label = ui_utils_label_add(this->view->layout, "Please change Audio Jack state[Insert/Remove]");
+ elm_label_line_wrap_set(this->info_label, ELM_WRAP_WORD);
+ if(ret == SOUND_MANAGER_ERROR_NOT_SUPPORTED)
+ {
+ is_not_supported = true;
+ Evas_Object *popup = ui_utils_popup_add(this->view->navi, "Message");
+ elm_object_text_set(popup, "Sound Device is not supported");
+ RETVM_IF(!this->view, NULL,"Sound Device is not supported");
+ }
+ elm_object_part_content_set(this->view->layout, "1cnt", this->info_label);
return this;
}
}
-/**
- * @function _sound_device_information_changed_cb
- * @since_tizen 3.0
- * @description sound Device Information Changed Cb
- * @parameter sound_device_h device, sound_device_changed_info_e changed_info, void *user_data
- * @return void
- */
-void _sound_device_information_changed_cb(sound_device_h device, sound_device_changed_info_e changed_info, void *user_data)
-{
-
- RETM_IF(NULL == user_data, "user_data is null");
- soundmanager_view *this = NULL;
- this = (soundmanager_view*) user_data;
-
- DBG("changed_info: %d", changed_info);
-
- switch(changed_info)
- {
- case SOUND_DEVICE_CHANGED_INFO_STATE :
- ui_utils_label_set_text(this->info_label, "State of the device was changed", "left");
- break;
-
- case SOUND_DEVICE_CHANGED_INFO_IO_DIRECTION:
- ui_utils_label_set_text(this->info_label, "IO direction of the device was changed", "left");
- break;
- default:
- ui_utils_label_set_text(this->info_label, "Unknown status", "left");
- break;
- }
-
-}
-
#endif