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)
/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
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__
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
-
-
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
{
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);
}
}
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;
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)
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;
}
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;
}
#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
}
}
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)
{
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
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
{
//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)
{
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_
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);
}
//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
{
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;
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)
{
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;
}
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;
}
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;
}
#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()
{
#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
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;
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;
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);
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);
ad->naviframe = navibar;
}
+ mp_evas_object_del(ad->ctx_popup);
mp_play_destory(ad);
mp_play_view_load(ad);
ad->paused_by_user = FALSE;
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);
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);