*/
-#include <notification_setting.h>
-#include <notification_setting_internal.h>
-
#include "setting-profile.h"
#include "setting-common-general-func.h"
#include "setting-profile-sound-mode.h"
#include "setting-profile-sound-mode-view.h"
+#include <notification_setting.h>
+#include <notification_setting_internal.h>
+#include <sound_manager_internal.h>
+
#define NOTIFICATIONS_ON_LOCK_SCREEN \
"http://tizen.org/appcontrol/operation/setting/notification_on_lock_screen"
.cleanup = NULL
};
+
+static void __vconf_change_cb(keynode_t *key, void *data)
+{
+ SETTING_TRACE_BEGIN;
+ setting_retm_if(NULL == key, "key is NULL");
+ setting_retm_if(NULL == data, "data is NULL");
+ char *vconf_name = vconf_keynode_get_name(key);
+
+ if (!safeStrCmp(vconf_name, VCONFKEY_SETAPPL_DEVELOPER_OPTION_STATE)) {
+ int stateDeveloperOption;
+ int err = vconf_get_bool(VCONFKEY_SETAPPL_DEVELOPER_OPTION_STATE, &stateDeveloperOption);
+ if (err != VCONF_OK) {
+ SETTING_TRACE_ERROR(">>>>>>>>>> Failed to get vconf[%s]", VCONFKEY_SETAPPL_DEVELOPER_OPTION_STATE);
+ }
+ } else {
+ SETTING_TRACE_ERROR("vconf_name is error");
+ }
+}
+
+
+typedef struct {
+ sound_rpi_playback_route_type type;
+ char *description;
+} SM_PBRouteType;
+
+
+SM_PBRouteType type_strings[] = {
+ {SOUND_RPI_PLAYBACK_AUTO, "Auto"},
+ {SOUND_RPI_PLAYBACK_HEADPHONE, "Headphone"},
+ {SOUND_RPI_PLAYBACK_HDMI1, "HDMI1"},
+ {SOUND_RPI_PLAYBACK_HDMI2, "HDMI2"},
+};
+
+const char *getStringOfSoundRouteType(sound_rpi_playback_route_type type)
+{
+ SETTING_TRACE_BEGIN;
+
+ int count = sizeof(type_strings)/sizeof(SM_PBRouteType);
+
+ int i = 0;
+ while(i < count){
+ if(type == type_strings[i].type){
+ return type_strings[i].description;
+ }
+ i++;
+ }
+
+ return _("IDS_ST_HEADER_UNAVAILABLE");
+}
+
+static const char *get_current_sounddevice_str()
+{
+ SETTING_TRACE_BEGIN;
+
+ sound_rpi_playback_route_type type;
+ int ret = sound_manager_get_rpi_playback_route(&type);
+ SETTING_TRACE_DEBUG("ret of sound_manager_get_rpi_playback_route() : %x", ret);
+ if (SOUND_MANAGER_ERROR_NONE != ret) {
+ SETTING_TRACE_ERROR("Fail in sound_manager_get_rpi_playback_route()");
+ return _("IDS_ST_HEADER_UNAVAILABLE");
+ }
+ return getStringOfSoundRouteType(type);
+}
+
/* ***************************************************
*
* Public functions
elm_genlist_item_selected_set(event_info, EINA_FALSE);
}
+static void __device_cb(void *data, Evas_Object *obj, void *event_info)
+{
+ SETTING_TRACE_BEGIN;
+
+ Elm_Object_Item *item = (Elm_Object_Item *)event_info;
+ SettingSoundData *ad = data;
+
+ ret_if(data == NULL);
+ retm_if(event_info == NULL, "Invalid argument: event info is NULL");
+
+ elm_genlist_item_selected_set(item, 0);
+ Setting_GenGroupItem_Data *list_item = (Setting_GenGroupItem_Data *) elm_object_item_data_get(item);
+ SETTING_TRACE("clicking item[%s, %s, %d]", _(list_item->keyStr), list_item->sub_desc, list_item->chk_id);
+
+ int selected_id = list_item->chk_id;
+ SETTING_TRACE_DEBUG("selected_id : %x", selected_id);
+
+ int ret = sound_manager_set_rpi_playback_route((sound_rpi_playback_route_type)selected_id);
+ if (!ret)
+ SETTING_TRACE_DEBUG("success to set rpi playback route\n");
+ else
+ SETTING_TRACE_DEBUG("fail to set rpi playback route\n");
+
+ if (ad->device_popup) {
+ evas_object_del(ad->device_popup);
+ ad->device_popup = NULL;
+ }
+
+}
+
+static void __genlist_item_sound_device_clicked_cb(void *data, Evas_Object *obj, void *event_info)
+{
+ SETTING_TRACE_BEGIN;
+
+ sound_rpi_playback_route_type cur_type;
+ int ret = sound_manager_get_rpi_playback_route(&cur_type);
+ if(ret != SOUND_MANAGER_ERROR_NONE) {
+ SETTING_TRACE_ERROR("Fail to get rpi_playback_route");
+ return;
+ }
+
+ SettingSoundData *ad = (SettingSoundData *)data;
+ Evas_Object *menu_glist = NULL;
+ Evas_Object *rdg = NULL;
+
+
+ setting_retm_if(data == NULL, "data is NULL");
+
+
+ ad->device_popup = setting_create_popup_with_list(
+ &menu_glist, ad, ad->md.window,
+ KeyStr_SoundOut, NULL, 0, false, false, 0);
+ if(ad->device_popup)
+ evas_object_event_callback_add(ad->device_popup,
+ EVAS_CALLBACK_DEL, setting_protect_cb, &(ad->device_popup));
+
+ rdg = elm_radio_add(menu_glist);
+ elm_object_style_set(rdg, "list");
+ evas_object_propagate_events_set(rdg, EINA_TRUE);
+ elm_radio_state_value_set(rdg, -1);
+ evas_object_data_set(menu_glist, "radio", rdg);
+// ad->theme_rdg = rdg;
+
+ int count = sizeof(type_strings) / sizeof(SM_PBRouteType);
+
+ int cur_radio_num = -1;
+ int radio_num = 0;
+ for(int i=0; i < count; i++) {
+ char *name = type_strings[i].description;
+ Setting_GenGroupItem_Data *data_device = setting_create_Gendial_field_1radio(
+ menu_glist,
+ &(ad->itc_1line),
+ __device_cb,
+ ad,
+ SWALLOW_Type_1RADIO_RIGHT,
+ rdg,
+ radio_num, /* Always ON */
+ name,
+ NULL);
+
+ if (data_device) {
+ data_device->chk_id = (int) type_strings[i].type;
+ data_device->userdata = ad;
+ __BACK_POINTER_SET(data_device);
+
+ } else {
+ SETTING_TRACE_ERROR("data_device is NULL");
+ }
+
+ if(type_strings[i].type == cur_type) {
+ cur_radio_num = radio_num;
+ SETTING_TRACE_DEBUG("cur_radio_num : %d", cur_radio_num);
+ }
+ radio_num++;
+ }
+
+ /* update radio */
+ if(cur_radio_num>=0)
+ elm_radio_value_set(rdg, cur_radio_num);
+}
+
+
static void _get_lite_main_list(void *data)
{
SETTING_TRACE_BEGIN;
ret_if(!data);
SettingSoundData *ad = (SettingSoundData *)data;
- char *app_id = NULL;
const char *left_icon = NULL;
int mm_value = 0;
int sound_value = 0;
&sound_value) < 0)
sound_value = TRUE; /* default value of sound : on */
- (void)app_get_id(&app_id);
-
/* Sound Mode */
sound_mode_e mode = setting_profile_get_sound_mode();
ad->sound_mode = setting_create_Gendial_field_def(
NULL,
NULL);
+
+ int stateDeveloperOption;
+ int err = vconf_get_bool(VCONFKEY_SETAPPL_DEVELOPER_OPTION_STATE, &stateDeveloperOption);
+ if (err == VCONF_OK) {
+ if(stateDeveloperOption){
+
+ /* group separator */
+ setting_create_Gendial_field_titleItem(
+ genlist,
+ &(ad->itc_group),
+ NULL,
+ NULL);
+
+ /* Sound Device */
+ char *pa_device = (char *)get_current_sounddevice_str();
+ SETTING_TRACE_DEBUG("pa_device : %s", pa_device);
+ ad->data_device =
+ setting_create_Gendial_field_def(
+ ad->md.genlist,
+ &(ad->itc_2line),
+ __genlist_item_sound_device_clicked_cb,
+ ad,
+ SWALLOW_Type_1ICON_1IMAGE, NULL, NULL,
+ 0, KeyStr_SoundOut,
+ pa_device,
+ NULL);
+ }
+ }
+
/* separator */
setting_create_Gendial_field_titleItem(
genlist,
NULL,
NULL);
- /* Notifications group */
-/*
- group_item_data = setting_create_Gendial_field_def(
- ad->md.genlist,
- &(ad->itc_1line),
- NULL,
- NULL,
- SWALLOW_Type_1ICON_1IMAGE,
- NULL,
- NULL,
- 0,
- _("IDS_ST_BODY_NOTIFICATIONS"),
- NULL,
- NULL);
- if (group_item_data)
- group_item_data->hide_bottom_line = TRUE;
- else
- SETTING_TRACE_ERROR("group_item_data is NULL");
-*/
/* 4.noti volumn */
if (sound_manager_get_volume(SOUND_TYPE_NOTIFICATION, &mm_value)
!= SOUND_MANAGER_ERROR_NONE)
__BACK_POINTER_SET(ad->data_touch_volume);
- free(app_id);
- app_id = NULL;
}
ad->md.naviframe_it, SETTING_PACKAGE,
EINA_TRUE);
+
+ ret = vconf_notify_key_changed(VCONFKEY_SETAPPL_DEVELOPER_OPTION_STATE,
+ __vconf_change_cb, ad);
+ if (ret != 0)
+ SETTING_TRACE_ERROR("call vconf_ignore_key_changed failed");
+
setting_view_sound_main.is_create = TRUE;
setting_view_update(&setting_view_sound_main, ad);
SettingSoundData *ad = (SettingSoundData *) cb;
+ int ret = vconf_ignore_key_changed(VCONFKEY_SETAPPL_DEVELOPER_OPTION_STATE,
+ __vconf_change_cb);
+ if (ret != 0)
+ SETTING_TRACE_ERROR("call vconf_ignore_key_changed failed");
+
/* 1.Ungrab Key */
setting_sound_key_ungrab(ad);
setting_sound_update_slider_icon(appdata->data_noti_volume, SND_SLIDER_NOTI);
setting_sound_update_slider_icon(appdata->data_touch_volume, SND_SLIDER_SYSTEM);
+ int stateDeveloperOption;
+ int err = vconf_get_bool(VCONFKEY_SETAPPL_DEVELOPER_OPTION_STATE, &stateDeveloperOption);
+ if (err == VCONF_OK) {
+ if(stateDeveloperOption){
+ if (appdata->data_device) {
+ G_FREE(appdata->data_device->sub_desc);
+ appdata->data_device->sub_desc = strdup(get_current_sounddevice_str());
+ SETTING_TRACE_DEBUG("appdata->data_device->sub_desc = %s", appdata->data_device->sub_desc);
+ elm_object_item_data_set(
+ appdata->data_device->item, appdata->data_device);
+ elm_genlist_item_update(appdata->data_device->item);
+ }
+ }
+ }
+
SETTING_TRACE_END;
return SETTING_RETURN_SUCCESS;