From a6d3999830e26dcea743ac08a1a95dc37f92f0b8 Mon Sep 17 00:00:00 2001 From: "bhutani.92" Date: Wed, 14 Dec 2016 12:17:41 +0530 Subject: [PATCH] [TSAM-11554] Music Widget not work Change-Id: I9c8b4d3669ce8cf84ec3fce2dcd71e7b5f7ff5c2 Signed-off-by: bhutani.92 --- widget/src/mp-widget-create.c | 114 ++++++++++++++++++++++-------------------- 1 file changed, 59 insertions(+), 55 deletions(-) diff --git a/widget/src/mp-widget-create.c b/widget/src/mp-widget-create.c index a3aae57..59cf300 100644 --- a/widget/src/mp-widget-create.c +++ b/widget/src/mp-widget-create.c @@ -34,20 +34,20 @@ #define WIDGET_HEIGHT 500 #define WIDGET_WIDTH 712 -#define EDJE_FILE "music_widget.edj" -#define APP_ID "org.tizen.music-player" -#define MP_LB_EVENT_KEY "LiveboxEvent" -#define MP_LB_EVENT_PLAY_CLICKED "OnLBPlayClicked" -#define MP_LB_EVENT_PAUSE_CLICKED "OnLBPauseClicked" -#define MP_LB_EVENT_NEXT_RELEASED "OnLBNextRelease" -#define MP_LB_EVENT_PREV_RELEASED "OnLBPreviousRelease" +#define EDJE_FILE "music_widget.edj" +#define APP_ID "org.tizen.music-player" +#define MP_LB_EVENT_KEY "LiveboxEvent" +#define MP_LB_EVENT_PLAY_CLICKED "OnLBPlayClicked" +#define MP_LB_EVENT_PAUSE_CLICKED "OnLBPauseClicked" +#define MP_LB_EVENT_NEXT_RELEASED "OnLBNextRelease" +#define MP_LB_EVENT_PREV_RELEASED "OnLBPreviousRelease" #define EVENT_SIZE (sizeof(struct inotify_event)) #define EVENT_BUF_LEN (1024 * (EVENT_SIZE + 16)) #define domain_name "music-player" #define BROKEN_ALBUMART_IMAGE_PATH "/opt/usr/share/media/.thumb/thumb_default.png" #define DEFAULT_ALBUM_ART_ICON "default_albumart.png" -#define NOW_PLAYING_INI_PATH "NowPlayingStatus" +#define NOW_PLAYING_INI_PATH "NowPlayingStatus" static Eina_Bool is_play = EINA_FALSE; Eina_List *widget_list = NULL; @@ -356,9 +356,9 @@ static void mp_widget_read_ini_file(char *path, void *data) } static void mp_widget_music_player_result_callback(app_control_h request, - app_control_h reply, - app_control_result_e - result, void *user_data) + app_control_h reply, + app_control_result_e + result, void *user_data) { if (!user_data) { return; @@ -413,11 +413,11 @@ static int message_port_init(const char *event) } static int mp_widget_music_player_launch(void *data, - char **extra_data_keys, - char **extra_data_values, - int extra_data_length, - Eina_Bool show_player, - char *filepath) + char **extra_data_keys, + char **extra_data_values, + int extra_data_length, + Eina_Bool show_player, + char *filepath) { Evas_Object *layout = (Evas_Object *) data; if (layout == NULL) { @@ -459,8 +459,8 @@ static int mp_widget_music_player_launch(void *data, } static void mp_widget_click_on_add_tracks_cb(void *data, Evas_Object * obj, - const char *emission, - const char *source) + const char *emission, + const char *source) { if (!data) { DEBUG_TRACE("Invalid data"); @@ -508,9 +508,9 @@ static void mp_widget_click_on_add_tracks_cb(void *data, Evas_Object * obj, } static void mp_widget_click_on_track_image_cb(void *data, - Evas_Object * obj, - const char *emission, - const char *source) + Evas_Object * obj, + const char *emission, + const char *source) { if (!data) { DEBUG_TRACE("Invalid data"); @@ -615,11 +615,11 @@ static void mp_widget_click_on_play_cb(void *data, Evas_Object * obj, WARN_TRACE("receive PLAYER_INTERRUPTED_BY_CALL"); if (message) { int ret = - notification_status_message_post(dgettext - (domain_name, message)); + notification_status_message_post(dgettext + (domain_name, message)); if (ret != 0) { ERROR_TRACE("notification_status_message_post()... [0x%x]", - ret); + ret); } else { DEBUG_TRACE("message: [%s]", message); } @@ -670,8 +670,8 @@ static void mp_widget_click_on_play_cb(void *data, Evas_Object * obj, if (message_port_init(extra_data_values[0]) != MESSAGE_PORT_ERROR_NONE) { mp_widget_music_player_launch(layout, extra_data_keys, - extra_data_values, extra_data_len, - EINA_FALSE, wgtdata->file_path); + extra_data_values, extra_data_len, + EINA_FALSE, wgtdata->file_path); mp_widget_music_player_result(layout); } for (i = 0; i < extra_data_len; ++i) { @@ -735,8 +735,8 @@ static void mp_widget_click_on_previous_cb(void *data, Evas_Object * obj, if (message_port_init(extra_data_values[0]) != MESSAGE_PORT_ERROR_NONE) { mp_widget_music_player_launch(layout, extra_data_keys, - extra_data_values, extra_data_len, - EINA_FALSE, wgtdata->file_path); + extra_data_values, extra_data_len, + EINA_FALSE, wgtdata->file_path); mp_widget_music_player_result(layout); } @@ -816,16 +816,16 @@ static void mp_widget_click_on_next_cb(void *data, Evas_Object * obj, } static void __mp_change_multiple_widgets(void *data, - Ecore_File_Monitor * em, - Ecore_File_Event event, - const char *path) + Ecore_File_Monitor * em, + Ecore_File_Event event, + const char *path) { Eina_List *temp_list = NULL; WidgetData *wgtdata = NULL; if (event == ECORE_FILE_EVENT_MODIFIED - || event == ECORE_FILE_EVENT_CREATED_FILE) { + || event == ECORE_FILE_EVENT_CREATED_FILE) { DEBUG_TRACE("The monitored file path is: %s", - ecore_file_monitor_path_get(em)); + ecore_file_monitor_path_get(em)); EINA_LIST_FOREACH(widget_list, temp_list, wgtdata) { char *path = app_get_data_path(); char playing_status[1024] = { 0 }; @@ -833,7 +833,7 @@ static void __mp_change_multiple_widgets(void *data, return; } snprintf(playing_status, 1024, "%s%s", path, - NOW_PLAYING_INI_PATH); + NOW_PLAYING_INI_PATH); free(path); mp_widget_read_ini_file_ecore(wgtdata, playing_status); } @@ -890,12 +890,12 @@ int mp_widget_create(WidgetData * data, int w, int h) DEBUG_TRACE("Number of widgets: %d", eina_list_count(widget_list)); elm_object_domain_translatable_part_text_set(layout, "noitems_title", - "music-player", - "IDS_MUSIC_BODY_MUSIC"); + "music-player", + "IDS_MUSIC_BODY_MUSIC"); elm_object_domain_translatable_part_text_set(layout, - "noitems_subtitle", - "music-player", - "IDS_MUSIC_SK3_ADD_TRACKS"); + "noitems_subtitle", + "music-player", + "IDS_MUSIC_SK3_ADD_TRACKS"); char *path = app_get_data_path(); DEBUG_TRACE("Path is: %s", path); char playing_status[1024] = { 0 }; @@ -908,29 +908,33 @@ int mp_widget_create(WidgetData * data, int w, int h) if (data->em == NULL) { data->em = - ecore_file_monitor_add(playing_status, - __mp_change_multiple_widgets, NULL); + ecore_file_monitor_add(playing_status, + __mp_change_multiple_widgets, NULL); } elm_object_signal_callback_add(layout, "mouse,down,1", - "noitems_subtitle", - mp_widget_click_on_add_tracks_cb, - (void *) data); + "noitems_title", + mp_widget_click_on_add_tracks_cb, + (void *) data); + elm_object_signal_callback_add(layout, "mouse,down,1", + "noitems_subtitle", + mp_widget_click_on_add_tracks_cb, + (void *) data); elm_object_signal_callback_add(layout, "mouse,down,1", "track_image", - mp_widget_click_on_track_image_cb, - (void *) data); + mp_widget_click_on_track_image_cb, + (void *) data); elm_object_signal_callback_add(layout, "mouse,down,1", - "track_play_image", - mp_widget_click_on_play_cb, - (void *) data); + "track_play_image", + mp_widget_click_on_play_cb, + (void *) data); elm_object_signal_callback_add(layout, "mouse,down,1", - "track_prev_image", - mp_widget_click_on_previous_cb, - (void *) data); + "track_prev_image", + mp_widget_click_on_previous_cb, + (void *) data); elm_object_signal_callback_add(layout, "mouse,down,1", - "track_next_image", - mp_widget_click_on_next_cb, - (void *) data); + "track_next_image", + mp_widget_click_on_next_cb, + (void *) data); return 0; -- 2.7.4