/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
-
-
#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
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
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);