sync with master
authorJinkun Jang <jinkun.jang@samsung.com>
Mon, 1 Apr 2013 04:33:29 +0000 (13:33 +0900)
committerJinkun Jang <jinkun.jang@samsung.com>
Mon, 1 Apr 2013 04:33:29 +0000 (13:33 +0900)
16 files changed:
packaging/org.tizen.music-player.spec
src/common/include/mp-app.h
src/common/mp-app.c
src/common/mp-common.c
src/common/mp-media-info.c
src/common/mp-menu.c
src/common/mp-play.c
src/common/mp-util.c
src/common/mp-view-manager.c
src/core/include/mp-setting-ctrl.h
src/core/mp-player-control.c
src/core/mp-setting-ctrl.c
src/include/mp-define.h
src/include/music.h [changed mode: 0644->0755]
src/mp-main.c
src/view/mp-playlist-view.c

index 8ff4d82..b0ae7eb 100644 (file)
@@ -3,7 +3,7 @@
 Name:       org.tizen.music-player
 Summary:    music player application
 Version:    0.1.177
-Release:    2
+Release:    1
 License:    Flora
 Source0:    %{name}-%{version}.tar.gz
 BuildRequires:  pkgconfig(capi-appfw-application)
@@ -126,7 +126,7 @@ chown -R 5000:5000 %{SP_DATA_PREFIX}/data
 /usr/bin/vconftool set -t int db/private/org.tizen.music-player/playlist 7 -g 5000
 
 /usr/bin/vconftool set -t int memory/private/org.tizen.music-player/playing_pid 0 -i -g 5000
-
+/usr/bin/vconftool set -t int db/setting/music-player/menu 7 -g 5000
 
 
 %files
index 81a11a4..c314f1a 100644 (file)
@@ -55,12 +55,4 @@ void mp_app_ungrab_mm_keys(struct appdata *ad);
 void mp_app_live_box_init(struct appdata *ad);
 void mp_app_live_box_deinit(struct appdata *ad);
 
-#ifdef MP_FEATURE_AUTO_OFF
-Eina_Bool mp_app_auto_off_timer_expired_cb(void *data);
-void mp_app_auto_off_changed_cb(int min, void *data);
-#endif
-#ifdef MP_FEATURE_PLAY_SPEED
-void mp_app_play_speed_changed_cb(double speed, void *data);
-#endif
-
 #endif // __MP_APP_H__
index 15a640b..183b024 100755 (executable)
@@ -1121,53 +1121,3 @@ mp_app_ungrab_mm_keys(struct appdata *ad)
        utilx_ungrab_key(ecore_x_display_get(), ad->xwin, KEY_MEDIA);
 }
 
-
-#ifdef MP_FEATURE_AUTO_OFF
-Eina_Bool
-mp_app_auto_off_timer_expired_cb(void *data)
-{
-       struct appdata *ad = data;
-       MP_CHECK_VAL(ad, ECORE_CALLBACK_CANCEL);
-
-       mp_debug("#### auto off ####");
-
-       ad->auto_off_timer = NULL;
-       mp_setting_reset_auto_off_time();
-
-       mp_app_exit(ad);
-
-       return ECORE_CALLBACK_DONE;
-}
-
-void
-mp_app_auto_off_changed_cb(int min, void *data)
-{
-       struct appdata *ad = data;
-       MP_CHECK(ad);
-
-       mp_ecore_timer_del(ad->auto_off_timer);
-       mp_debug("auto off time set [%d]", min);
-
-       if (min <= 0) {
-               mp_debug("disable auto off");
-               return;
-       }
-
-       double timeout = min * 60;
-       ad->auto_off_timer = ecore_timer_add(timeout, mp_app_auto_off_timer_expired_cb, ad);
-}
-#endif
-
-#ifdef MP_FEATURE_PLAY_SPEED
-void
-mp_app_play_speed_changed_cb(double speed, void *data)
-{
-       struct appdata *ad = data;
-       MP_CHECK(ad);
-
-       DEBUG_TRACE("playspeed: %f", speed);
-       mp_player_mgr_set_play_speed(speed);
-}
-#endif
-
-
index c811440..8bc6a2d 100755 (executable)
@@ -610,11 +610,6 @@ mp_common_set_toolbar_button_sensitivity(mp_layout_data_t * layout_data, int sel
                        item = mp_view_manager_get_controlbar_item(layout_data->ad, MP_NAVI_CONTROL_BUTTON_EDIT);
                        if (item)
                                elm_object_disabled_set(item, disable);
-
-                       item = mp_view_manager_get_controlbar_item(layout_data->ad, MP_NAVI_CONTROL_BUTTON_SEARCH);
-                       if (item)
-                               elm_object_disabled_set(item, disable);
-
                }
                else
                {
@@ -625,10 +620,6 @@ mp_common_set_toolbar_button_sensitivity(mp_layout_data_t * layout_data, int sel
                        item = mp_view_manager_get_controlbar_item(layout_data->ad, MP_NAVI_CONTROL_BUTTON_EDIT);
                        if(item)
                                elm_object_disabled_set(item, disable);
-
-                       item = mp_view_manager_get_controlbar_item(layout_data->ad, MP_NAVI_CONTROL_BUTTON_SEARCH);
-                       if(item)
-                               elm_object_disabled_set(item, disable_search);
                }
        }
 
index d2e01ad..7ba90ef 100755 (executable)
@@ -1758,7 +1758,7 @@ int mp_media_info_playlist_add_media(int playlist_id, const char *media_id)
        int res = MEDIA_CONTENT_ERROR_NONE;
        media_playlist_h playlist = NULL;
 
-       res = media_playlist_get_playlist_from_db(playlist_id, NULL, &playlist);
+       res = media_playlist_get_playlist_from_db(playlist_id, &playlist);
        if(res != 0) {
                media_playlist_destroy(playlist);
                return res;
index f427794..b814616 100755 (executable)
@@ -898,6 +898,15 @@ mp_menu_set_as_select_cb(void *data, Evas_Object * obj, void *event_info)
        return;
 }
 
+static void
+_mp_menu_ctx_del_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
+{
+       DEBUG_TRACE("");
+       struct appdata *ad = data;
+       MP_CHECK(ad);
+
+       ad->ctx_popup = NULL;
+}
 
 void
 mp_menu_share_cb(void *data, Evas_Object * obj, void *event_info)
@@ -957,6 +966,9 @@ mp_menu_share_cb(void *data, Evas_Object * obj, void *event_info)
                MP_CHECK(share_popup);
        }
 
+       ad->ctx_popup = share_popup;
+       evas_object_event_callback_add(ad->ctx_popup, EVAS_CALLBACK_DEL, _mp_menu_ctx_del_cb, ad);
+
        return;
 
 }
@@ -994,6 +1006,9 @@ mp_menu_set_cb(void *data, Evas_Object * obj, void *event_info)
                evas_object_data_set(popup, "layout_data", layout_data);
        }
 
+       ad->ctx_popup = popup;
+       evas_object_event_callback_add(ad->ctx_popup, EVAS_CALLBACK_DEL, _mp_menu_ctx_del_cb, ad);
+
        return;
 
 }
index 6e7cd22..7631115 100644 (file)
@@ -281,15 +281,6 @@ mp_play_next_file(void *data, bool forced)
 #endif
                {
                        DEBUG_TRACE("End of playlist");
-#ifdef MP_FEATURE_AUTO_OFF
-                       if (mp_playlist_mgr_get_repeat(ad->playlist_mgr)== MP_PLST_REPEAT_NONE
-                               && ad->auto_off_timer)
-                       {
-                               mp_ecore_timer_del(ad->auto_off_timer);
-                               mp_setting_reset_auto_off_time();
-                               mp_app_exit(ad);
-                       }
-#endif
                }
        }
 
@@ -348,21 +339,6 @@ mp_play_start(void *data)
        endfunc;
 }
 
-#ifdef MP_FEATURE_AUTO_OFF
-static Eina_Bool
-_mp_play_control_paused_off_timer_cb(void *data)
-{
-       struct appdata *ad = data;
-       MP_CHECK_VAL(ad, ECORE_CALLBACK_CANCEL);
-       ad->pause_off_timer = NULL;
-
-       if (ad->auto_off_timer && ad->player_state == PLAY_STATE_PAUSED)
-               mp_app_auto_off_timer_expired_cb(ad);
-
-       return ECORE_CALLBACK_DONE;
-}
-#endif
-
 void
 mp_play_pause(void *data)
 {
@@ -397,15 +373,6 @@ mp_play_pause(void *data)
        ad->player_state = PLAY_STATE_PAUSED;
        ad->paused_by_other_player = FALSE;
 
-#ifdef MP_FEATURE_AUTO_OFF
-       mp_ecore_timer_del(ad->pause_off_timer);
-       if (ad->auto_off_timer)
-       {
-               mp_debug("auto off set");
-               ad->pause_off_timer = ecore_timer_add(PAUSE_OFF_TIMEOUT, _mp_play_control_paused_off_timer_cb, ad);
-       }
-#endif
-
 #ifdef MP_FEATURE_AVRCP_13
        mp_avrcp_noti_player_state(MP_AVRCP_STATE_PAUSED);
 #endif
index e910e79..45249ad 100755 (executable)
@@ -987,7 +987,13 @@ mp_util_get_uri_from_app_svc(service_h service, struct appdata *ad, char **path)
                service_get_uri(service, &uri);
                if (uri && strlen(uri))
                {
-                       *path = uri;
+                       if(strstr(uri,MP_UTIL_FILE_PREFIX))
+                       {
+                               *path = g_strdup(uri+strlen(MP_UTIL_FILE_PREFIX));
+                               free(uri);
+                       }
+                       else
+                               *path = uri;
                }
                else
                {
index 508dd08..feda211 100755 (executable)
@@ -593,7 +593,12 @@ mp_view_manager_set_title_and_buttons(view_data_t * view_data, char *text_ID, vo
 
        //destroy back button
        mp_view_manager_set_back_button(last_history->view_layout, navi_it, NULL, NULL);
-       elm_object_item_part_content_set(navi_it, "toolbar_more_btn", NULL);
+       btn = elm_object_item_part_content_get(navi_it, "toolbar_more_btn");
+       if(btn)
+       {
+               evas_object_del(btn);
+               elm_object_item_part_content_set(navi_it, "toolbar_more_btn", NULL);
+       }
 
        if (last_history->content_type == MP_VIEW_CONTENT_LIST)
        {
index 04451da..65dbf8e 100644 (file)
@@ -43,18 +43,6 @@ void mp_setting_save_now_playing(void *ad);
 void mp_setting_save_shortcut(char *shortcut_title, char *artist, char *shortcut_description,
                              char *shortcut_image_path);
 
-#ifdef MP_FEATURE_AUTO_OFF
-int mp_setting_auto_off_set_callback(MpSettingAutoOff_Cb func, void *data);
-void mp_setting_reset_auto_off_time();
-int mp_setting_get_auto_off_time();
-#endif
-
-#ifdef MP_FEATURE_PLAY_SPEED
-int mp_setting_set_play_speed_change_callback(MpSettingPlaySpeed_Cb func, void *data);
-int mp_setting_reset_play_speed();
-double mp_setting_get_play_speed();
-#endif
-
 void mp_setting_update_active_device();
 
 #endif // __MP_SETTING_CTRL_H_
index 2fa7f07..517e445 100755 (executable)
@@ -301,10 +301,6 @@ _mp_play_control_prepare_cb(void *userdata)
        struct appdata *ad = userdata;
        MP_CHECK(ad);
 
-#ifdef MP_FEATURE_PLAY_SPEED
-       mp_player_mgr_set_play_speed(mp_setting_get_play_speed());
-#endif
-
        mp_play_current_file(ad);
 }
 
@@ -424,10 +420,6 @@ mp_play_control_play_pause(struct appdata *ad, bool play)
                        //silentmode -> go to listview -> click one track -> silent mode play no -> go to playing view -> click play icon
                        mp_play_new_file(ad, TRUE);
                }
-
-#ifdef MP_FEATURE_AUTO_OFF
-               mp_ecore_timer_del(ad->pause_off_timer);
-#endif
        }
        else
        {
index 5e104d2..55cfc97 100755 (executable)
@@ -54,15 +54,6 @@ typedef struct _mp_setting_t
        MpSettingPlaylist_Cb playlist_cb;
        void *playlist_udata;
 
-
-#ifdef MP_FEATURE_AUTO_OFF
-       MpSettingAutoOff_Cb auto_off_cb;
-       void *auto_off_udata;
-#endif
-#ifdef MP_FEATURE_PLAY_SPEED
-       MpSettingPlaySpeed_Cb play_speed_cb;
-       void *play_speed_udata;
-#endif
 } mp_setting_t;
 
 static mp_setting_t *g_setting = NULL;
@@ -102,57 +93,6 @@ _mp_setting_playlist_changed_cb(keynode_t * node, void *user_data)
        return;
 }
 
-
-#ifdef MP_FEATURE_AUTO_OFF
-static void
-_mp_setting_auto_off_changed_cb(keynode_t * node, void *user_data)
-{
-       mp_setting_t *sd = NULL;
-
-       mp_retm_if(node == NULL, "keymode is NULL");
-       mp_retm_if(user_data == NULL, "user_date is NULL");
-       sd = (mp_setting_t *) user_data;
-
-       int min = 0;
-       if (vconf_get_int(VCONFKEY_MUSIC_AUTO_OFF_TIME_VAL, &min))
-       {
-               ERROR_TRACE("Fail to get %s", VCONFKEY_MUSIC_AUTO_OFF_TIME_VAL);
-               return;
-       }
-
-       mp_debug("auto off time changed [%d] miniute", min);
-       if (sd->auto_off_cb)
-               sd->auto_off_cb(min, sd->auto_off_udata);
-
-       return;
-}
-#endif
-
-#ifdef MP_FEATURE_PLAY_SPEED
-static void
-_mp_setting_play_speed_changed_cb(keynode_t * node, void *user_data)
-{
-       mp_setting_t *sd = NULL;
-
-       mp_retm_if(node == NULL, "keymode is NULL");
-       mp_retm_if(user_data == NULL, "user_date is NULL");
-       sd = (mp_setting_t *) user_data;
-
-       double speed = 0;
-       if (vconf_get_dbl(VCONFKEY_MUSIC_PLAY_SPEED, &speed))
-       {
-               ERROR_TRACE("Fail to get %s", VCONFKEY_MUSIC_PLAY_SPEED);
-               return;
-       }
-
-       mp_debug("play speed changed [%d]", speed);
-       if (sd->play_speed_cb)
-               sd->play_speed_cb(speed, sd->play_speed_udata);
-
-       return;
-}
-#endif
-
 static int
 mp_setting_key_cb_init(void)
 {
@@ -167,22 +107,6 @@ mp_setting_key_cb_init(void)
                ret = -1;
        }
 
-#ifdef MP_FEATURE_AUTO_OFF
-       if (vconf_notify_key_changed(VCONFKEY_MUSIC_AUTO_OFF_TIME_VAL, _mp_setting_auto_off_changed_cb, g_setting) < 0)
-       {
-               ERROR_TRACE("Fail to register VCONFKEY_MUSIC_AUTO_OFF_TIME_VAL key callback");
-               ret = -1;
-       }
-#endif
-
-#ifdef MP_FEATURE_PLAY_SPEED
-       if (vconf_notify_key_changed(VCONFKEY_MUSIC_PLAY_SPEED, _mp_setting_play_speed_changed_cb, g_setting) < 0)
-       {
-               ERROR_TRACE("Fail to register VCONFKEY_MUSIC_AUTO_OFF_TIME_VAL key callback");
-               ret = -1;
-       }
-#endif
-
        return ret;
 }
 
@@ -190,13 +114,6 @@ static void
 mp_setting_key_cb_deinit(void)
 {
        vconf_ignore_key_changed(MP_VCONFKEY_PLAYLIST_VAL_INT, _mp_setting_playlist_changed_cb);
-#ifdef MP_FEATURE_AUTO_OFF
-       vconf_ignore_key_changed(VCONFKEY_MUSIC_AUTO_OFF_TIME_VAL, _mp_setting_auto_off_changed_cb);
-#endif
-
-#ifdef MP_FEATURE_PLAY_SPEED
-       vconf_ignore_key_changed(VCONFKEY_MUSIC_PLAY_SPEED, _mp_setting_play_speed_changed_cb);
-#endif
        return;
 }
 
@@ -238,11 +155,6 @@ mp_setting_init(struct appdata *ad)
        mp_setting_get_shuffle_state(&shuffle);
        mp_playlist_mgr_set_shuffle(ad->playlist_mgr, shuffle);
 
-#ifdef MP_FEATURE_AUTO_OFF
-       /* reset auto off in music player only */
-       mp_setting_reset_auto_off_time();
-#endif
-
        return ret;
 }
 
@@ -432,81 +344,6 @@ mp_setting_save_shortcut(char *shortcut_title, char *artist, char *shortcut_desc
 
 #endif
 
-#ifdef MP_FEATURE_AUTO_OFF
-int
-mp_setting_auto_off_set_callback(MpSettingAutoOff_Cb func, void *data)
-{
-       mp_retvm_if(g_setting == NULL, -1, "setting data is not initialized, init first!!!!!");
-
-       g_setting->auto_off_cb = func;
-       g_setting->auto_off_udata = data;
-
-       return 0;
-}
-
-void
-mp_setting_reset_auto_off_time()
-{
-       int ret = vconf_set_int(VCONFKEY_MUSIC_AUTO_OFF_TIME_VAL, 0);
-       if (ret) {
-               mp_error("vconf_set_int().. err[%d]", ret);
-       }
-       ret = vconf_set_int(VCONFKEY_MUSIC_AUTO_OFF_TYPE_VAL, 0);
-       if (ret) {
-               mp_error("vconf_set_int().. err[%d]", ret);
-       }
-}
-
-int
-mp_setting_get_auto_off_time()
-{
-       int min = 0;
-
-       if (vconf_get_int(VCONFKEY_MUSIC_AUTO_OFF_TIME_VAL, &min)){
-               mp_error("vconf_get_int()");
-               min = 0;
-       }
-
-       return min;
-}
-#endif
-
-#ifdef MP_FEATURE_PLAY_SPEED
-int mp_setting_set_play_speed_change_callback(MpSettingPlaySpeed_Cb func, void *data)
-{
-       mp_retvm_if(g_setting == NULL, -1, "setting data is not initialized, init first!!!!!");
-
-       g_setting->play_speed_cb= func;
-       g_setting->play_speed_udata= data;
-
-       return 0;
-}
-int mp_setting_reset_play_speed(void)
-{
-       int ret = vconf_set_dbl(VCONFKEY_MUSIC_PLAY_SPEED, 1.0);
-       if (ret) {
-               mp_error("vconf_set_int().. err[%d]", ret);
-       }
-
-       return ret;
-}
-
-double mp_setting_get_play_speed(void)
-{
-       double speed = 1.0;
-       if (vconf_get_dbl(VCONFKEY_MUSIC_PLAY_SPEED, &speed)){
-               mp_error("vconf_get_int()");
-       }
-       if(speed > 2.0 || speed < 0.5)
-       {
-               ERROR_TRACE("inavlid speed: %f", speed);
-               speed = 1.0;
-       }
-       return speed;
-}
-
-#endif
-
 void
 mp_setting_update_active_device()
 {
index be05239..79b85df 100644 (file)
 #define MP_FEATURE_MOTION
 #define MP_FEATURE_NFC_SHARE
 #define MP_FEATURE_SVOICE
-#define MP_FEATURE_PLAY_SPEED
 #ifndef MP_SOUND_PLAYER        /* music player only*/
 #define MP_FEATURE_ASF_ALLSHARE
 #define MP_FEATURE_LIVE_BOX
 #define MP_FEATURE_SPLIT_VIEW
-#define MP_FEATURE_AUTO_OFF
 #define MP_FEATURE_CONTEXT_ENGINE
 #endif
 #ifdef MP_SOUND_PLAYER
old mode 100644 (file)
new mode 100755 (executable)
index 60c722b..5e240db
@@ -235,6 +235,7 @@ struct appdata
        Evas_Object *win_main;
        Evas_Object *bg;
        Evas_Object *popup[MP_POPUP_MAX];
+       Evas_Object *ctx_popup;
        Ecore_Idler *popup_del_idler;
        int win_angle;
 
@@ -433,15 +434,6 @@ struct appdata
 
        mp_track_info_t *current_track_info;
 
-
-
-
-#ifdef MP_FEATURE_AUTO_OFF
-       Ecore_Timer *auto_off_timer;
-       Ecore_Timer *pause_off_timer;
-#endif
-
-
        Evas_Object *more_btn_popup;
        mp_more_button_type_e more_btn_type;
 
index 5aefe08..f5bc9cf 100755 (executable)
@@ -433,16 +433,6 @@ _mp_main_app_init_idler_cb(void *data)
 
        ad->app_init_idler = NULL;
 
-
-#ifdef MP_FEATURE_AUTO_OFF
-       mp_setting_auto_off_set_callback(mp_app_auto_off_changed_cb, ad);
-#endif
-
-#ifdef MP_FEATURE_PLAY_SPEED
-       mp_setting_reset_play_speed();
-       mp_setting_set_play_speed_change_callback(mp_app_play_speed_changed_cb, ad);
-#endif
-
        power_set_changed_cb(__mp_main_lcd_state_changed_cb, ad);
 
 
@@ -740,10 +730,6 @@ mp_terminate(void *data)
        mp_ecore_idler_del(ad->app_init_idler);
        mp_ecore_idler_del(ad->popup_del_idler);
        mp_ecore_timer_del(ad->longpress_timer);
-#ifdef MP_FEATURE_AUTO_OFF
-       mp_ecore_timer_del(ad->auto_off_timer);
-       mp_ecore_timer_del(ad->pause_off_timer);
-#endif
 
        mp_app_ungrab_mm_keys(ad);
 
@@ -899,6 +885,7 @@ mp_service(service_h service, void *data)
                ad->naviframe = navibar;
        }
 
+       mp_evas_object_del(ad->ctx_popup);
        mp_play_destory(ad);
        mp_play_view_load(ad);
        ad->paused_by_user = FALSE;
index 100bbb2..c2ddc32 100755 (executable)
@@ -386,6 +386,8 @@ mp_playlist_view_create_playlist_button_cb(void *data, Evas_Object * obj, void *
        mp_retm_if(create_plst_layout == NULL, "create_plst_layout is NULL");
 
        Elm_Object_Item *it = mp_view_manager_push_view_content(view_data, create_plst_layout, MP_VIEW_CONTENT_NEW_PLAYLIST);
+       elm_object_item_text_set(it, GET_STR("IDS_MUSIC_BODY_CREATE_PLAYLIST"));
+       mp_language_mgr_register_object_item(it, "IDS_MUSIC_BODY_CREATE_PLAYLIST");
 
        Evas_Object *btn = mp_widget_create_button(create_plst_layout, "naviframe/toolbar/default", GET_SYS_STR("IDS_COM_OPT_SAVE"), NULL, mp_playlist_view_create_new_done_cb, view_data);
        elm_object_item_part_content_set(it, "title_toolbar_button1", btn);
@@ -394,7 +396,7 @@ mp_playlist_view_create_playlist_button_cb(void *data, Evas_Object * obj, void *
 
        mp_common_add_keypad_state_callback(view_data->ad->conformant, create_plst_layout, it);
 
-       mp_view_manager_set_back_button(create_plst_layout, it, NULL, NULL);
+       mp_view_manager_set_back_button(create_plst_layout, it, mp_playlist_view_create_new_cancel_cb, view_data);
 
        evas_object_show(create_plst_layout);