Removed Pause icon on start of Music Application 20/79820/2
authorbhutani.92 <bhutani.92@samsung.com>
Wed, 13 Jul 2016 06:44:23 +0000 (12:14 +0530)
committerbhutani.92 <bhutani.92@samsung.com>
Wed, 13 Jul 2016 07:23:02 +0000 (12:53 +0530)
Change-Id: I320d9d5da25b417993e8fb3b5305cf24805f9b43
Signed-off-by: bhutani.92 <bhutani.92@samsung.com>
music-chooser/src/mc-list-play.c
music-chooser/src/mc-track-list.c
music-chooser/src/music-chooser.c
src/common/mp-play.c
src/mp-main.c

index 34253ac36ee64883c8f81e0d58c1d3992e7c1ef2..8fc358c67408347de6c7e41d723eadf9045571c9 100755 (executable)
@@ -250,6 +250,40 @@ void mc_player_play(void)
        player_state_e play_status = mc_pre_play_get_player_state();
 
        if (PLAYER_STATE_PLAYING == play_status) {
+#if 0  //Enable notification post for play and pause in indicator
+               MP_CHECK(cur_item_data->ad);
+
+               struct app_data *ad = cur_item_data->ad;
+               MP_CHECK(ad);
+               if (!ad->noti) {
+                       DEBUG_TRACE("notification create");
+
+                       int applist = NOTIFICATION_DISPLAY_APP_INDICATOR;
+                       notification_type_e noti_type = NOTIFICATION_TYPE_NOTI;
+                       notification_image_type_e img_type = NOTIFICATION_IMAGE_TYPE_ICON_FOR_INDICATOR;
+                       int ret = NOTIFICATION_ERROR_NONE;
+
+                       char *path = app_get_shared_resource_path();
+
+                       char icon_path[1024] = {0};
+                       snprintf(icon_path, 1024, "%sshared_images/T02_control_circle_icon_play.png", path);
+                       DEBUG_TRACE("Icon Path is : %s", icon_path);
+                       free(path);
+
+                       notification_delete_all(NOTIFICATION_TYPE_NOTI);
+                       ad->noti = notification_create(noti_type);
+                       ret = notification_set_image(ad->noti, img_type, icon_path);
+                       if (ret != NOTIFICATION_ERROR_NONE) {
+                               DEBUG_TRACE("Cannot set the notification image");
+                       }
+                       ret = notification_set_display_applist(ad->noti, applist);
+                       if (ret != NOTIFICATION_ERROR_NONE) {
+                               DEBUG_TRACE("Cannot set the display applist");
+                               notification_free(ad->noti);
+                       }
+                       notification_post(ad->noti);
+               }
+#endif
                _mc_pre_play_mgr_player_start();
        }
        _mc_pre_play_mgr_update_play_button_status(cur_item_data);
index 976f9896bc644993471beafea6a7a8649b6ada81..65f8a0753ce696b9ba0ca396975a27d7534083b6 100755 (executable)
@@ -184,7 +184,9 @@ static Evas_Object *_gl_content_get(void *data, Evas_Object *obj, const char *pa
                        } else {
                                elm_object_signal_emit(part_content, "show_pause", "*");
                        }
+#if 0          //Posts play and pause icon in notification indicator area
                        mc_post_notification_indicator(it_data, state);
+#endif
 
                        //elm_object_item_signal_emit(cur_item_data->it, "show_color" ,"*");
                }
index 954bd4aff8a9bce24abee91cfe9c3585a984a339..62e7aea0f482dd94bf6f53a5477d793d8d1a5712 100755 (executable)
@@ -199,23 +199,6 @@ mc_create(void *data)
        elm_theme_extension_add(NULL, edje_path);
        free(path);
 
-       if (!ad->noti) {
-               DEBUG_TRACE("notification create");
-
-               int applist = NOTIFICATION_DISPLAY_APP_INDICATOR;
-               notification_type_e noti_type = NOTIFICATION_TYPE_NOTI;
-               int ret = NOTIFICATION_ERROR_NONE;
-
-               notification_delete_all(NOTIFICATION_TYPE_NOTI);
-               ad->noti = notification_create(noti_type);
-               ret = notification_set_display_applist(ad->noti, applist);
-               if (ret != NOTIFICATION_ERROR_NONE) {
-                       DEBUG_TRACE("Cannot set the display applist");
-                       notification_free(ad->noti);
-               }
-               notification_post(ad->noti);
-       }
-
        DEBUG_TRACE("end");
 
        return EINA_TRUE;
@@ -363,8 +346,13 @@ mc_destroy(void *data)
                        ad->smat_pipe = NULL;
                }
 
-               notification_delete(ad->noti);
-               notification_free(ad->noti);
+#if 0          //Free notification handle
+               if (ad->noti) {
+                       notification_delete(ad->noti);
+                       notification_free(ad->noti);
+               }
+#endif
+
        }
 }
 
index 34bc8eb9907a0d62d5dde5becaf9d19a5e5ccf78..09047d45e11d8e78d05b7b268ef8dda59792e082 100755 (executable)
@@ -556,6 +556,55 @@ mp_play_start(void *data)
 
 
 #ifndef MP_SOUND_PLAYER
+
+       if (!ad->noti) {
+               DEBUG_TRACE("notification create");
+
+               int applist = NOTIFICATION_DISPLAY_APP_INDICATOR;
+               notification_type_e noti_type = NOTIFICATION_TYPE_NOTI;
+               notification_image_type_e img_type = NOTIFICATION_IMAGE_TYPE_ICON_FOR_INDICATOR;
+               int ret = NOTIFICATION_ERROR_NONE;
+
+               char *shared_path = app_get_shared_resource_path();
+               if (!shared_path) {
+                       ERROR_TRACE("Shared Resource Path is NULL");
+               }
+
+               char icon_path[1024] = {0};
+               snprintf(icon_path, 1024, "%sshared_images/T02_control_circle_icon_play.png", shared_path);
+               free(shared_path);
+
+               notification_delete_all(NOTIFICATION_TYPE_NOTI);
+               ad->noti = notification_create(noti_type);
+               ret = notification_set_property(ad->noti, NOTIFICATION_PROP_VOLATILE_DISPLAY);
+               if (ret != NOTIFICATION_ERROR_NONE) {
+                       DEBUG_TRACE("Cannot set the notification property");
+               }
+               ret = notification_set_image(ad->noti, img_type, icon_path);
+               if (ret != NOTIFICATION_ERROR_NONE) {
+                       DEBUG_TRACE("Cannot set the notification image");
+               }
+               ret = notification_set_display_applist(ad->noti, applist);
+               if (ret != NOTIFICATION_ERROR_NONE) {
+                       DEBUG_TRACE("Cannot set the display applist");
+                       notification_free(ad->noti);
+               }
+               notification_post(ad->noti);
+
+               char *data_path = app_get_data_path();
+               DEBUG_TRACE("Path is: %s", data_path);
+               char playing_status[1024] = {0};
+               if (data_path == NULL) {
+                       ERROR_TRACE("unable to get data path");
+               }
+               snprintf(playing_status, 1024, "%s%s", data_path, "NowPlayingStatus");
+               free(data_path);
+
+               if (ad->monitor == NULL) {
+                       ad->monitor = ecore_file_monitor_add(playing_status, mp_noti_read_ini_file, NULL);
+               }
+       }
+
        if (mp_view_mgr_count_view(GET_VIEW_MGR) == 0) {
                mp_common_create_initial_view(ad, NULL, NULL);
                evas_object_show(ad->win_main);
index 5aac870df8c62388016eaab2b0c5ca98ac9b309f..cfbd8917f7d564097e11bb41e325142faea2e72e 100755 (executable)
@@ -1465,56 +1465,6 @@ mp_create(void *data)
        conformant = elm_conformant_add(ad->win_main);
        MP_CHECK_FALSE(conformant);
 
-#ifndef MP_SOUND_PLAYER
-       if (!ad->noti) {
-               DEBUG_TRACE("notification create");
-
-               int applist = NOTIFICATION_DISPLAY_APP_INDICATOR;
-               notification_type_e noti_type = NOTIFICATION_TYPE_NOTI;
-               notification_image_type_e img_type = NOTIFICATION_IMAGE_TYPE_ICON_FOR_INDICATOR;
-               int ret = NOTIFICATION_ERROR_NONE;
-
-               char *shared_path = app_get_shared_resource_path();
-               if (!shared_path) {
-                       ERROR_TRACE("Shared Resource Path is NULL");
-               }
-
-               char icon_path[1024] = {0};
-               snprintf(icon_path, 1024, "%sshared_images/T02_control_circle_icon_pause.png", shared_path);
-               free(shared_path);
-
-               notification_delete_all(NOTIFICATION_TYPE_NOTI);
-               ad->noti = notification_create(noti_type);
-               ret = notification_set_property(ad->noti, NOTIFICATION_PROP_VOLATILE_DISPLAY);
-               if (ret != NOTIFICATION_ERROR_NONE) {
-                       DEBUG_TRACE("Cannot set the notification property");
-               }
-               ret = notification_set_image(ad->noti, img_type, icon_path);
-               if (ret != NOTIFICATION_ERROR_NONE) {
-                       DEBUG_TRACE("Cannot set the notification image");
-               }
-               ret = notification_set_display_applist(ad->noti, applist);
-               if (ret != NOTIFICATION_ERROR_NONE) {
-                       DEBUG_TRACE("Cannot set the display applist");
-                       notification_free(ad->noti);
-               }
-               notification_post(ad->noti);
-
-               char *data_path = app_get_data_path();
-               DEBUG_TRACE("Path is: %s", data_path);
-               char playing_status[1024] = {0};
-               if (data_path == NULL) {
-                       ERROR_TRACE("unable to get data path");
-               }
-               snprintf(playing_status, 1024, "%s%s", data_path, "NowPlayingStatus");
-               free(data_path);
-
-               if (ad->monitor == NULL) {
-                       ad->monitor = ecore_file_monitor_add(playing_status, mp_noti_read_ini_file, NULL);
-               }
-       }
-#endif
-
        elm_object_signal_emit(conformant, "elm,state,indicator,overlap", "");
        evas_object_data_set(conformant, "overlap", (void *)EINA_TRUE);
 
@@ -1563,7 +1513,9 @@ mp_terminate(void *data)
        mp_setting_set_nowplaying_id(0);
 #endif
 
-       ecore_file_monitor_del(ad->monitor);
+       if (ad->monitor) {
+               ecore_file_monitor_del(ad->monitor);
+       }
        mp_language_mgr_destroy();
        mp_ecore_idler_del(ad->app_init_idler);
        mp_ecore_timer_del(ad->longpress_timer);
@@ -1671,8 +1623,10 @@ mp_terminate(void *data)
 #endif
 
 #ifndef MP_SOUND_PLAYER
-       notification_delete(ad->noti);
-       notification_free(ad->noti);
+       if (ad->noti) {
+               notification_delete(ad->noti);
+               notification_free(ad->noti);
+       }
 #endif
        return;
 }