From 449d32ceb112eac1b8d9cbc1343b5e61a5b40eee Mon Sep 17 00:00:00 2001 From: Jehun Lim Date: Wed, 22 Jul 2015 21:22:27 +0900 Subject: [PATCH 01/16] listmgr: modify the value of scroller step size Change-Id: I85689f9a7779c8a441b001ac68bc60f64fbffae9 Signed-off-by: Jehun Lim --- src/util/listmgr.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/util/listmgr.c b/src/util/listmgr.c index f2635c6..ff25f0c 100644 --- a/src/util/listmgr.c +++ b/src/util/listmgr.c @@ -510,20 +510,23 @@ bool listmgr_update_play_info(struct listmgr *lmgr, app_media_info *info) bool listmgr_draw_list_area(struct listmgr *lmgr) { Evas_Object *scr, *box; + struct listmgr_data *data; if (!lmgr) { _ERR("invalid argument"); return false; } + data = lmgr->data; + scr = util_add_scroller(lmgr->base); if (!scr) { _ERR("failed to create scroller object"); return false; } - elm_scroller_step_size_set(scr, - SCROLLER_STEP_SIZE(lmgr->data->box_padding), 0); + elm_scroller_step_size_set(scr, SCROLLER_STEP_SIZE( + data->box_padding + data->grid_item_x), 0); inputmgr_add_callback(scr, LISTMGR_SCROLLER, &_handler, lmgr); @@ -534,7 +537,7 @@ bool listmgr_draw_list_area(struct listmgr *lmgr) return false; } - elm_box_padding_set(box, lmgr->data->box_padding, 0); + elm_box_padding_set(box, data->box_padding, 0); evas_object_show(box); elm_object_content_set(scr, box); @@ -544,7 +547,7 @@ bool listmgr_draw_list_area(struct listmgr *lmgr) lmgr->scr = scr; lmgr->box = box; - if (lmgr->data->pops) { + if (data->pops) { if (!_draw_play_info(lmgr)) { _ERR("failed to draw play info"); evas_object_del(scr); @@ -552,8 +555,7 @@ bool listmgr_draw_list_area(struct listmgr *lmgr) } } - elm_object_focus_next_object_set(lmgr->data->menu_btn, scr, - ELM_FOCUS_DOWN); + elm_object_focus_next_object_set(data->menu_btn, scr, ELM_FOCUS_DOWN); return true; } -- 2.7.4 From aeedf5532fdebe900c6a7d7b11abab91c4b664f1 Mon Sep 17 00:00:00 2001 From: Minkyu Kang Date: Wed, 22 Jul 2015 21:44:14 +0900 Subject: [PATCH 02/16] musicplayer: implement the complete callback at progressbar (workaround) Since the complete callback of player have bug, we implemented it on progressbar Change-Id: I69f1afd6751b49a3523daf6fe80e5301a2049523 Signed-off-by: Minkyu Kang --- include/util/progressbar.h | 1 + src/util/progressbar.c | 27 +++++++++++++++++++++++++++ src/view/mplayer.c | 20 ++++++++------------ 3 files changed, 36 insertions(+), 12 deletions(-) diff --git a/include/util/progressbar.h b/include/util/progressbar.h index 884761e..b788a3c 100644 --- a/include/util/progressbar.h +++ b/include/util/progressbar.h @@ -22,6 +22,7 @@ struct progressbar; struct progressbar_ops { int (*get_value)(void *data); int (*set_value)(void *data); + void (*complete_cb)(void *data); }; enum progressbar_time_format { diff --git a/src/util/progressbar.c b/src/util/progressbar.c index ed0a28f..3623016 100644 --- a/src/util/progressbar.c +++ b/src/util/progressbar.c @@ -26,6 +26,8 @@ #define SLIDER_STEP 0.03 #define PROGRESSBAR_INTERVAL 0.1 +#define COMPLETE_INTERVAL 1.0 +#define COMPLETE_BUFFER 500 struct progressbar { Evas_Object *base; @@ -41,6 +43,7 @@ struct progressbar { char *str_separator; enum progressbar_time_format fmt; + int duration; }; static void _update_progress_info(struct progressbar *m, int position) @@ -64,6 +67,21 @@ static void _update_time_info(struct progressbar *m, int position, int duration) _update_progress_info(m, position); } +static Eina_Bool _complete_cb(void *data) +{ + struct progressbar *m; + + if (!data) + return ECORE_CALLBACK_CANCEL; + + m = data; + + if (m->ops->complete_cb) + m->ops->complete_cb(m->ops_data); + + return ECORE_CALLBACK_CANCEL; +} + static Eina_Bool _timer_cb(void *data) { struct progressbar *m; @@ -79,6 +97,13 @@ static Eina_Bool _timer_cb(void *data) elm_slider_value_set(m->slider, position); _update_progress_info(m, position); + if (position + COMPLETE_BUFFER > m->duration) { + ecore_timer_add(COMPLETE_INTERVAL, _complete_cb, m); + m->timer = NULL; + + return ECORE_CALLBACK_CANCEL; + } + return ECORE_CALLBACK_RENEW; } @@ -167,6 +192,8 @@ void progressbar_reset(struct progressbar *m, int position, int duration) return; } + m->duration = duration; + elm_slider_min_max_set(m->slider, 0, duration); elm_slider_step_set(m->slider, SLIDER_STEP); elm_slider_value_set(m->slider, position); diff --git a/src/view/mplayer.c b/src/view/mplayer.c index a438cf1..c5c77f8 100644 --- a/src/view/mplayer.c +++ b/src/view/mplayer.c @@ -124,7 +124,6 @@ static void _draw_music_info(struct _priv *priv, app_media_info *mi) static void _draw_progressbar(struct _priv *priv, app_media_info *mi) { - progressbar_reset(priv->progress, 0, mi->audio->duration); progressbar_show(priv->progress); } @@ -152,6 +151,9 @@ static void _update_info(struct _priv *priv, app_media_info *mi) { struct view_update_data vdata; + /* update progressbar */ + progressbar_reset(priv->progress, 0, mi->audio->duration); + /* update history */ app_contents_recent_add(CONTENTS_MEDIA, mi->media_id); @@ -250,10 +252,6 @@ static int _player_get_position(void *data) return playermgr_get_position(priv->player); } -static struct progressbar_ops _progressbar_ops = { - .get_value = _player_get_position, -}; - static void _player_play_pause(struct _priv *priv) { app_media_info *mi; @@ -388,6 +386,11 @@ static void _player_complete_cb(void *data) _player_next(priv); } +static struct progressbar_ops _progressbar_ops = { + .get_value = _player_get_position, + .complete_cb = _player_complete_cb, +}; + static void _callback_music(void *data, const char *ev) { struct _priv *priv; @@ -713,13 +716,6 @@ static Evas_Object *_create(Evas_Object *win, void *data) return NULL; } - r = playermgr_set_completed_cb(player, _player_complete_cb, priv); - if (!r) { - _ERR("failed to set callback"); - playermgr_destroy(player); - return NULL; - } - priv->player = player; r = _ui_init(priv); -- 2.7.4 From 94ef8b977f829030c3e0c10a1de6a22f04a9946f Mon Sep 17 00:00:00 2001 From: Minkyu Kang Date: Thu, 23 Jul 2015 09:54:27 +0900 Subject: [PATCH 03/16] musicplayer: don't bring in the item if the list has a focus Change-Id: I0a523128878ba26050463e3d87474a8356cf326a Signed-off-by: Minkyu Kang --- include/define.h | 2 ++ src/view/mplayer.c | 16 +++++++++++++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/include/define.h b/include/define.h index 8608add..64d7cca 100644 --- a/include/define.h +++ b/include/define.h @@ -68,7 +68,9 @@ #define SIG_BTN_UNSELECTED "btn,unselected" #define SIG_ITEM_SELECTED "item,selected" #define SIG_ITEM_UNSELECTED "item,unselected" +#define SIG_ELM_UNFOCUSED "elm,state,unfocused" #define SIG_SOURCE_EDC "edc" +#define SIG_SOURCE_ELM "elm" #define SIG_SOURCE_SRC "src" #endif /* __AIR_MEDIAHUB_DEFINE_H__ */ diff --git a/src/view/mplayer.c b/src/view/mplayer.c index c5c77f8..5cb99ef 100644 --- a/src/view/mplayer.c +++ b/src/view/mplayer.c @@ -93,7 +93,11 @@ static void _draw_playlist(struct _priv *priv) return; } - elm_genlist_item_bring_in(ld->item, ELM_GENLIST_ITEM_SCROLLTO_IN); + if (!elm_object_focus_get(priv->list)) { + elm_genlist_item_bring_in(ld->item, + ELM_GENLIST_ITEM_SCROLLTO_IN); + } + elm_genlist_realized_items_update(priv->list); } @@ -538,6 +542,15 @@ static void _list_realized(int id, void *data, } } +static void _list_unrealized(int id, void *data, + Evas_Object *obj, Elm_Object_Item *it) +{ + if (!it) + return; + + elm_object_item_signal_emit(it, SIG_ELM_UNFOCUSED, SIG_SOURCE_ELM); +} + static void _list_mouse_move(int id, void *data, Evas *e, Evas_Object *obj, Evas_Event_Mouse_Move *ev) { @@ -558,6 +571,7 @@ static void _list_mouse_move(int id, void *data, Evas *e, Evas_Object *obj, static input_handler _list_handler = { .realized = _list_realized, + .unrealized = _list_unrealized, .selected = _list_selected, .mouse_move = _list_mouse_move, .key_down = _key_down, -- 2.7.4 From 3c3645b339e9ce92789b2c52aa2331b622212100 Mon Sep 17 00:00:00 2001 From: Minkyu Kang Date: Thu, 23 Jul 2015 11:40:38 +0900 Subject: [PATCH 04/16] viewer: use signal to showing/hiding favorite icon Change-Id: I2ac14ea49e80387543ee6325159deb424984a04c Signed-off-by: Minkyu Kang --- include/view/viewer.h | 5 +++-- res/{ => edc}/images/ic_title_favorite.png | Bin res/edc/view/viewer.edc | 27 ++++++++++++++++++++++++++- src/view/viewer.c | 22 +++++----------------- 4 files changed, 34 insertions(+), 20 deletions(-) rename res/{ => edc}/images/ic_title_favorite.png (100%) diff --git a/include/view/viewer.h b/include/view/viewer.h index d3d494e..bfc9c8c 100644 --- a/include/view/viewer.h +++ b/include/view/viewer.h @@ -44,6 +44,8 @@ #define SIG_HIDE_BAR "hide,bar" #define SIG_SHOW_BAR "show,bar" #define SIG_SHOWED_BAR "showed,bar" +#define SIG_VIEWER_SHOW_FAV "show,favorite" +#define SIG_VIEWER_HIDE_FAV "hide,favorite" /* source */ #define SRC_BTN_PREV "prev" @@ -55,8 +57,7 @@ #define SRC_BTN_PHOTO_NEXT "next_photo" /* images */ -#define IMAGE_VIEWER_FAVORITE IMAGEDIR"/ic_title_favorite.png" - +#define IMAGE_VIEWER_FAVORITE "ic_title_favorite.png" #define IMAGE_VIEWER_PREV_FOCUS "btn_view_contr_previous_foc.png" #define IMAGE_VIEWER_PREV_NORMAL "btn_view_contr_previous_nor.png" #define IMAGE_VIEWER_REW_FOCUS "btn_view_contr_rewind_foc.png" diff --git a/res/images/ic_title_favorite.png b/res/edc/images/ic_title_favorite.png similarity index 100% rename from res/images/ic_title_favorite.png rename to res/edc/images/ic_title_favorite.png diff --git a/res/edc/view/viewer.edc b/res/edc/view/viewer.edc index bf7bb02..7bd52c4 100644 --- a/res/edc/view/viewer.edc +++ b/res/edc/view/viewer.edc @@ -18,6 +18,9 @@ group { name: GRP_VIEWER_VIEW; + images { + image: IMAGE_VIEWER_FAVORITE COMP; + } parts { part { name: "bg"; @@ -202,7 +205,8 @@ group { } part { name: PART_VIEWER_FAVORITE; - type: SWALLOW; + type: IMAGE; + clip_to: "toparea"; scale: 1; description { state: "default" 0.0; @@ -217,6 +221,13 @@ group { } fixed: 1 1; align: 1.0 0.5; + visible: 0; + } + description { + state: "show" 0.0; + inherit: "default" 0.0; + image.normal: IMAGE_VIEWER_FAVORITE; + visible: 1; } } @@ -495,5 +506,19 @@ group { name: SIG_SHOWED_BAR; action: SIGNAL_EMIT SIG_SHOWED_BAR ""; } + program { + name: SIG_VIEWER_SHOW_FAV; + signal: SIG_VIEWER_SHOW_FAV; + source: ""; + action: STATE_SET "show" 0.0; + target: PART_VIEWER_FAVORITE; + } + program { + name: SIG_VIEWER_HIDE_FAV; + signal: SIG_VIEWER_HIDE_FAV; + source: ""; + action: STATE_SET "default" 0.0; + target: PART_VIEWER_FAVORITE; + } } } diff --git a/src/view/viewer.c b/src/view/viewer.c index c9f736c..0d128d8 100644 --- a/src/view/viewer.c +++ b/src/view/viewer.c @@ -70,7 +70,6 @@ struct _priv { Evas_Object *base; Evas_Object *photo; Evas_Object *photo_pre; - Evas_Object *favorite; struct _viewer viewer; struct _playlist playlist; @@ -370,11 +369,10 @@ static void _draw_progressbar(struct _priv *priv, int id, app_media_info *mi) static void _draw_favorite_icon(struct _priv *priv, int id, app_media_info *mi) { - if (!mi->favorite) - return; - - elm_object_part_content_set(priv->base, - PART_VIEWER_FAVORITE, priv->favorite); + if (mi->favorite) + elm_object_signal_emit(priv->base, SIG_VIEWER_SHOW_FAV, ""); + else + elm_object_signal_emit(priv->base, SIG_VIEWER_HIDE_FAV, ""); } static app_media_info *_get_current_media_info(struct _priv *priv) @@ -498,7 +496,7 @@ static void _viewer_hide(struct _priv *priv) ctl = priv->viewer.ctl[priv->viewer.cur]; ctl->ops->hide(ctl->handle); - elm_object_part_content_unset(priv->base, PART_VIEWER_FAVORITE); + elm_object_signal_emit(priv->base, SIG_VIEWER_HIDE_FAV, ""); } static bool _viewer_add(struct _priv *priv, int id) @@ -821,7 +819,6 @@ static void _callback_video(void *data, const char *ev) static bool _ui_init(struct _priv *priv) { - Evas_Object *obj; struct progressbar *prog; bool r; int i; @@ -845,15 +842,6 @@ static bool _ui_init(struct _priv *priv) priv->progress = prog; - obj = elm_image_add(priv->base); - if (!obj) { - _ERR("failed to adding image"); - goto err; - } - - elm_image_file_set(obj, IMAGE_VIEWER_FAVORITE, NULL); - priv->favorite = obj; - priv->timeout = timeout_handler_init(VIEWER_TIMEOUT, _timeout_cb, priv, _event_cb, priv); -- 2.7.4 From 290949ca808eecb09aa2c69a5c19b3cce54dcbb7 Mon Sep 17 00:00:00 2001 From: Minkyu Kang Date: Thu, 23 Jul 2015 14:19:52 +0900 Subject: [PATCH 05/16] viewer: use same icon for prev/next on gallery viewer According to the UX guide, use same icon on gallery viewer Change-Id: I9dc2a6cd6e8963d3a37ea36d652757b646b89597 Signed-off-by: Minkyu Kang --- include/view/viewer.h | 4 ++-- res/edc/widgets/button.edc | 8 ++++---- src/view/viewer.c | 16 ++++++++-------- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/include/view/viewer.h b/include/view/viewer.h index bfc9c8c..7b1dbb5 100644 --- a/include/view/viewer.h +++ b/include/view/viewer.h @@ -53,8 +53,8 @@ #define SRC_BTN_PLAY "play" #define SRC_BTN_FF "ff" #define SRC_BTN_NEXT "next" -#define SRC_BTN_PHOTO_PREV "prev_photo" -#define SRC_BTN_PHOTO_NEXT "next_photo" +#define SRC_BTN_GALLERY_PREV "prev_gallery" +#define SRC_BTN_GALLERY_NEXT "next_gallery" /* images */ #define IMAGE_VIEWER_FAVORITE "ic_title_favorite.png" diff --git a/res/edc/widgets/button.edc b/res/edc/widgets/button.edc index 52cecca..c67bfc2 100644 --- a/res/edc/widgets/button.edc +++ b/res/edc/widgets/button.edc @@ -559,7 +559,7 @@ group { } group { - name: "elm/button/base/viewer_btn_prev_photo"; + name: "elm/button/base/viewer_btn_prev_gallery"; inherit: "elm/button/base/viewer_btn_prev"; images { image: IMAGE_VIEWER_PHOTO_PREV_NORMAL COMP; @@ -587,13 +587,13 @@ group { programs { program { name: "emit,signal"; - action: SIGNAL_EMIT SIG_BTN_CALLBACK SRC_BTN_PHOTO_PREV; + action: SIGNAL_EMIT SIG_BTN_CALLBACK SRC_BTN_GALLERY_PREV; } } } group { - name: "elm/button/base/viewer_btn_next_photo"; + name: "elm/button/base/viewer_btn_next_gallery"; inherit: "elm/button/base/viewer_btn_prev"; images { image: IMAGE_VIEWER_PHOTO_NEXT_NORMAL COMP; @@ -621,7 +621,7 @@ group { programs { program { name: "emit,signal"; - action: SIGNAL_EMIT SIG_BTN_CALLBACK SRC_BTN_PHOTO_NEXT; + action: SIGNAL_EMIT SIG_BTN_CALLBACK SRC_BTN_GALLERY_NEXT; } } } diff --git a/src/view/viewer.c b/src/view/viewer.c index 0d128d8..77fec5d 100644 --- a/src/view/viewer.c +++ b/src/view/viewer.c @@ -110,18 +110,18 @@ static struct _btn_info btn_movie[] = { static struct _btn_info btn_photo[] = { { - .name = SRC_BTN_PHOTO_PREV, + .name = SRC_BTN_GALLERY_PREV, .loc = 0, }, { - .name = SRC_BTN_PHOTO_NEXT, + .name = SRC_BTN_GALLERY_NEXT, .loc = 4, }, }; static struct _btn_info btn_video[] = { { - .name = SRC_BTN_PREV, + .name = SRC_BTN_GALLERY_PREV, .loc = 0, }, { @@ -137,7 +137,7 @@ static struct _btn_info btn_video[] = { .loc = 3, }, { - .name = SRC_BTN_NEXT, + .name = SRC_BTN_GALLERY_NEXT, .loc = 4, }, }; @@ -791,9 +791,9 @@ static void _callback_photo(void *data, const char *ev) priv = data; - if (!strcmp(ev, SRC_BTN_PHOTO_PREV)) + if (!strcmp(ev, SRC_BTN_GALLERY_PREV)) _viewer_prev(priv); - else if (!strcmp(ev, SRC_BTN_PHOTO_NEXT)) + else if (!strcmp(ev, SRC_BTN_GALLERY_NEXT)) _viewer_next(priv); } @@ -806,10 +806,10 @@ static void _callback_video(void *data, const char *ev) priv = data; - if (!strcmp(ev, SRC_BTN_PREV)) { + if (!strcmp(ev, SRC_BTN_GALLERY_PREV)) { _player_stop(priv); _viewer_prev(priv); - } else if (!strcmp(ev, SRC_BTN_NEXT)) { + } else if (!strcmp(ev, SRC_BTN_GALLERY_NEXT)) { _player_stop(priv); _viewer_next(priv); } else if (!strcmp(ev, SRC_BTN_PLAY)) { -- 2.7.4 From e51d60505650dcbd3a89b09209f0a50093cdbdf2 Mon Sep 17 00:00:00 2001 From: Minkyu Kang Date: Thu, 23 Jul 2015 14:30:42 +0900 Subject: [PATCH 06/16] viewer: disable ff/rew button Since have problem about callback of player, disabled ff/rew button for a while. Change-Id: I44d89f5f0a8889b0e8a1f6c532b2eb1485f2833e Signed-off-by: Minkyu Kang --- src/view/viewer.c | 28 ++++++---------------------- 1 file changed, 6 insertions(+), 22 deletions(-) diff --git a/src/view/viewer.c b/src/view/viewer.c index 77fec5d..9f78195 100644 --- a/src/view/viewer.c +++ b/src/view/viewer.c @@ -35,7 +35,7 @@ #define STYLE_VIEWER_BTN "viewer_btn" #define PART_VIEWER_BTN "control_btn" -#define PLAY_BTN_LOC 2 +#define PLAY_BTN_LOC 1 #define VIEWER_TIMEOUT 3.0 #define VIEWER_SEPARATOR "/ " @@ -88,10 +88,6 @@ struct _btn_info { static struct _btn_info btn_movie[] = { { .name = SRC_BTN_PREV, - .loc = 0, - }, - { - .name = SRC_BTN_REW, .loc = 1, }, { @@ -99,12 +95,8 @@ static struct _btn_info btn_movie[] = { .loc = 2, }, { - .name = SRC_BTN_FF, - .loc = 3, - }, - { .name = SRC_BTN_NEXT, - .loc = 4, + .loc = 3, }, }; @@ -125,18 +117,10 @@ static struct _btn_info btn_video[] = { .loc = 0, }, { - .name = SRC_BTN_REW, - .loc = 1, - }, - { .name = SRC_BTN_PLAY, .loc = 2, }, { - .name = SRC_BTN_FF, - .loc = 3, - }, - { .name = SRC_BTN_GALLERY_NEXT, .loc = 4, }, @@ -159,8 +143,8 @@ static void _callback_video(void *data, const char *ev); static struct _viewer_info viewer_info[] = { { .btns = btn_movie, - .btn_count = 5, - .focus_loc = 2, + .btn_count = 3, + .focus_loc = 1, .callback = _callback_movie, }, { @@ -171,8 +155,8 @@ static struct _viewer_info viewer_info[] = { }, { .btns = btn_video, - .btn_count = 5, - .focus_loc = 4, + .btn_count = 3, + .focus_loc = 2, .callback = _callback_video, }, }; -- 2.7.4 From 29c48a5e3b4be084b89893e0a0c475653e1b6b5a Mon Sep 17 00:00:00 2001 From: Jehun Lim Date: Thu, 23 Jul 2015 21:38:28 +0900 Subject: [PATCH 07/16] base: modify the argument of layoutmgr_update_layout Change-Id: Id483943c3917acf0eb1f916a653e102e7875313d Signed-off-by: Jehun Lim --- src/layout/gallery.c | 11 +++++------ src/layout/movie.c | 11 +++++------ src/layout/music.c | 11 +++++------ src/view/base.c | 2 +- 4 files changed, 16 insertions(+), 19 deletions(-) diff --git a/src/layout/gallery.c b/src/layout/gallery.c index eac45df..5dad688 100644 --- a/src/layout/gallery.c +++ b/src/layout/gallery.c @@ -376,8 +376,8 @@ static void _hide(void *layout_data) static void _update(void *layout_data, int update_type, void *data) { + struct view_update_data *vdata; struct _priv *priv; - int index; bool update; if (!layout_data) { @@ -386,25 +386,24 @@ static void _update(void *layout_data, int update_type, void *data) } priv = layout_data; + vdata = data; switch (update_type) { case UPDATE_CONTENT: _update_content_list(priv); break; case UPDATE_FOCUS: - if (!data) { + if (!vdata) { _ERR("invalid argument"); return; } - index = *(int *)data; - - if (priv->cur_index != index) + if (priv->cur_index != vdata->index) update = true; else update = false; - listmgr_update_focus_item(priv->listmgr, index, update); + listmgr_update_focus_item(priv->listmgr, vdata->index, update); break; default: diff --git a/src/layout/movie.c b/src/layout/movie.c index 3e92362..e6c5289 100644 --- a/src/layout/movie.c +++ b/src/layout/movie.c @@ -579,8 +579,8 @@ static void _hide(void *layout_data) static void _update(void *layout_data, int update_type, void *data) { + struct view_update_data *vdata; struct _priv *priv; - int index; bool update; if (!layout_data) { @@ -589,6 +589,7 @@ static void _update(void *layout_data, int update_type, void *data) } priv = layout_data; + vdata = data; switch (update_type) { case UPDATE_CONTENT: @@ -596,19 +597,17 @@ static void _update(void *layout_data, int update_type, void *data) _update_recent_item(priv); break; case UPDATE_FOCUS: - if (!data) { + if (!vdata) { _ERR("invalid argument"); return; } - index = *(int *)data; - - if (priv->cur_index != index) + if (priv->cur_index != vdata->index) update = true; else update = false; - listmgr_update_focus_item(priv->listmgr, index, update); + listmgr_update_focus_item(priv->listmgr, vdata->index, update); _update_recent_item(priv); break; default: diff --git a/src/layout/music.c b/src/layout/music.c index 2c8b373..76313b5 100644 --- a/src/layout/music.c +++ b/src/layout/music.c @@ -548,8 +548,8 @@ static void _hide(void *layout_data) static void _update(void *layout_data, int update_type, void *data) { + struct view_update_data *vdata; struct _priv *priv; - int index; bool update; if (!layout_data) { @@ -558,6 +558,7 @@ static void _update(void *layout_data, int update_type, void *data) } priv = layout_data; + vdata = data; switch (update_type) { case UPDATE_CONTENT: @@ -565,19 +566,17 @@ static void _update(void *layout_data, int update_type, void *data) _update_playing_item(priv); break; case UPDATE_FOCUS: - if (!data) { + if (!vdata) { _ERR("invalid argument"); return; } - index = *(int *)data; - - if (priv->cur_index != index) + if (priv->cur_index != vdata->index) update = true; else update = false; - listmgr_update_focus_item(priv->listmgr, index, update); + listmgr_update_focus_item(priv->listmgr, vdata->index, update); _update_playing_item(priv); break; default: diff --git a/src/view/base.c b/src/view/base.c index 928031a..9e50dd9 100644 --- a/src/view/base.c +++ b/src/view/base.c @@ -308,7 +308,7 @@ static void _update(void *view_data, int update_type, void *data) layoutmgr_update_layout(priv->lmgr, g_menu_item[priv->current_layout].layout_id, - update_type, (void *)&vdata->index); + update_type, vdata); } static void _destroy(void *view_data) -- 2.7.4 From baa5c776e27b319c506124e609a5cfd4e4669cfa Mon Sep 17 00:00:00 2001 From: Jehun Lim Date: Thu, 23 Jul 2015 22:03:12 +0900 Subject: [PATCH 08/16] music: update now playing item Change-Id: I1af01a4b4558f974636750aa99b4e369d6b61bc8 Signed-off-by: Jehun Lim --- src/layout/music.c | 56 +++++++++++++++++++----------------------------------- 1 file changed, 20 insertions(+), 36 deletions(-) diff --git a/src/layout/music.c b/src/layout/music.c index 76313b5..746e4f7 100644 --- a/src/layout/music.c +++ b/src/layout/music.c @@ -14,11 +14,9 @@ * limitations under the License. */ -#include #include #include #include -#include #include #include #include @@ -358,49 +356,29 @@ static void _update_content_list(struct _priv *priv) _update_content_info(priv); } -static void _update_playing_item(struct _priv *priv) +static void _update_playing_item(struct _priv *priv, int index) { - GList *list; + Eina_List *list; app_media *am; app_media_info *info; - struct recent_data *recent; - int r; - - list = NULL; - info = NULL; - r = app_contents_get_recent_list(CONTENTS_MUSIC, 1, &list); - if (r != APP_CONTENTS_ERROR_NONE) { - _ERR("failed to get movie recent list"); + list = mediadata_get_medialist(priv->md); + am = eina_list_nth(list, index); + if (!am) { + _ERR("failed to get app media"); return; } - recent = (struct recent_data *)g_list_nth_data(list, 0); - - if (recent) { - am = util_find_media_info(mediadata_get_medialist(priv->md), - recent->id); - if (!am) { - _ERR("failed to get app media"); - g_list_free(list); - return; - } - - info = app_media_get_info(am); - if (!info) { - _ERR("failed to get app media info"); - g_list_free(list); - return; - } - - priv->playing_info = am; + info = app_media_get_info(am); + if (!info) { + _ERR("failed to get app media info"); + return; } + priv->playing_info = am; + if (!listmgr_update_play_info(priv->listmgr, info)) _ERR("failed to update now playing item"); - - - g_list_free(list); } static bool _create(layoutmgr *lmgr, void *data) @@ -563,7 +541,14 @@ static void _update(void *layout_data, int update_type, void *data) switch (update_type) { case UPDATE_CONTENT: _update_content_list(priv); - _update_playing_item(priv); + break; + case UPDATE_PLAY_INFO: + if (!vdata) { + _ERR("invalid argument"); + return; + } + + _update_playing_item(priv, vdata->index); break; case UPDATE_FOCUS: if (!vdata) { @@ -577,7 +562,6 @@ static void _update(void *layout_data, int update_type, void *data) update = false; listmgr_update_focus_item(priv->listmgr, vdata->index, update); - _update_playing_item(priv); break; default: break; -- 2.7.4 From 5cb6a9d874ecbe5ed9777702e4ae87e459fc7ae2 Mon Sep 17 00:00:00 2001 From: Jehun Lim Date: Thu, 23 Jul 2015 19:08:20 +0900 Subject: [PATCH 09/16] listmgr: add the function to update focus to play info Change-Id: I62e2aed712596bcddac31b9f0da11ba1914b41f5 Signed-off-by: Jehun Lim --- include/util/listmgr.h | 3 ++- src/layout/gallery.c | 2 +- src/layout/movie.c | 8 +------- src/layout/music.c | 13 +------------ src/util/listmgr.c | 47 ++++++++++++++++++++++++++++++++++++++--------- 5 files changed, 43 insertions(+), 30 deletions(-) diff --git a/include/util/listmgr.h b/include/util/listmgr.h index d146532..48f21fe 100644 --- a/include/util/listmgr.h +++ b/include/util/listmgr.h @@ -54,6 +54,7 @@ bool listmgr_draw_list_area(struct listmgr *lmgr); bool listmgr_update_content_list(struct listmgr *lmgr, Eina_List *list); bool listmgr_update_play_info(struct listmgr *lmgr, app_media_info *info); -bool listmgr_update_focus_item(struct listmgr *lmgr, int index, bool update); +bool listmgr_focus_content_list(struct listmgr *lmgr, int index, bool update); +bool listmgr_focus_play_info(struct listmgr *lmgr); #endif /* __AIR_MEDIAHUB_LISTMGR_H__ */ diff --git a/src/layout/gallery.c b/src/layout/gallery.c index 5dad688..3e3e839 100644 --- a/src/layout/gallery.c +++ b/src/layout/gallery.c @@ -403,7 +403,7 @@ static void _update(void *layout_data, int update_type, void *data) else update = false; - listmgr_update_focus_item(priv->listmgr, vdata->index, update); + listmgr_focus_content_list(priv->listmgr, vdata->index, update); break; default: diff --git a/src/layout/movie.c b/src/layout/movie.c index e6c5289..ceb236f 100644 --- a/src/layout/movie.c +++ b/src/layout/movie.c @@ -581,7 +581,6 @@ static void _update(void *layout_data, int update_type, void *data) { struct view_update_data *vdata; struct _priv *priv; - bool update; if (!layout_data) { _ERR("failed to get layout data"); @@ -602,12 +601,7 @@ static void _update(void *layout_data, int update_type, void *data) return; } - if (priv->cur_index != vdata->index) - update = true; - else - update = false; - - listmgr_update_focus_item(priv->listmgr, vdata->index, update); + listmgr_focus_play_info(priv->listmgr); _update_recent_item(priv); break; default: diff --git a/src/layout/music.c b/src/layout/music.c index 746e4f7..4d6f3c5 100644 --- a/src/layout/music.c +++ b/src/layout/music.c @@ -528,7 +528,6 @@ static void _update(void *layout_data, int update_type, void *data) { struct view_update_data *vdata; struct _priv *priv; - bool update; if (!layout_data) { _ERR("failed to get layout data"); @@ -551,17 +550,7 @@ static void _update(void *layout_data, int update_type, void *data) _update_playing_item(priv, vdata->index); break; case UPDATE_FOCUS: - if (!vdata) { - _ERR("invalid argument"); - return; - } - - if (priv->cur_index != vdata->index) - update = true; - else - update = false; - - listmgr_update_focus_item(priv->listmgr, vdata->index, update); + listmgr_focus_play_info(priv->listmgr); break; default: break; diff --git a/src/util/listmgr.c b/src/util/listmgr.c index ff25f0c..9ea9d6c 100644 --- a/src/util/listmgr.c +++ b/src/util/listmgr.c @@ -375,21 +375,50 @@ static Evas_Object *_draw_list_item(struct listmgr *lmgr, struct group_info *gi) return ly; } -bool listmgr_update_focus_item(struct listmgr *lmgr, int index, bool update) +bool _focus_to_content(struct listmgr *lmgr, Evas_Object *base) +{ + Evas_Object *content; + + content = elm_object_part_content_get(base, PART_ITEM_CONTENT); + if (!content) { + _ERR("failed to get content"); + return false; + } + + lmgr->scr_focus = EINA_FALSE; + elm_object_focus_set(content, EINA_TRUE); + + return true; +} + +bool listmgr_focus_play_info(struct listmgr *lmgr) +{ + if (!lmgr) { + _ERR("failed to get listmgr"); + return false; + } + + if (!_focus_to_content(lmgr, lmgr->play_info)) { + _ERR("failed to focus to content"); + return false; + } + + return true; +} + +bool listmgr_focus_content_list(struct listmgr *lmgr, int index, bool update) { Eina_List *item, *l; - Evas_Object *ly, *grid, *content; + Evas_Object *ly, *grid; Elm_Object_Item *it; int count; + int r; if (!update) { - content = elm_object_part_content_get(lmgr->focused, - PART_ITEM_CONTENT); - - lmgr->scr_focus = EINA_FALSE; - elm_object_focus_set(content, EINA_TRUE); - - return true; + r = _focus_to_content(lmgr, lmgr->focused); + if (!r) + _ERR("failed to focus to content"); + return r; } item = elm_box_children_get(lmgr->box); -- 2.7.4 From 85a1ff422afccebecc76ad56342609d61de05c48 Mon Sep 17 00:00:00 2001 From: Minkyu Kang Date: Thu, 23 Jul 2015 21:34:41 +0900 Subject: [PATCH 10/16] update the app media info after adding item to recent Change-Id: I9b3b5ed1fc93c456343bc1cbf23ec7b167a7f1af Signed-off-by: Minkyu Kang --- src/view/mplayer.c | 36 ++++++++++++++++++++++++++++++------ src/view/viewer.c | 32 +++++++++++++++++++++++++++++--- 2 files changed, 59 insertions(+), 9 deletions(-) diff --git a/src/view/mplayer.c b/src/view/mplayer.c index 5cb99ef..a548f46 100644 --- a/src/view/mplayer.c +++ b/src/view/mplayer.c @@ -83,6 +83,28 @@ static struct _btn_info btn_player[] = { }, }; +static void _add_to_recent(struct _priv *priv) +{ + app_media *am; + app_media_info *mi; + + am = eina_list_nth(priv->playlist.list, priv->playlist.cur); + if (!am) { + _ERR("failed to get app_media"); + return; + } + + mi = app_media_get_info(am); + if (!mi) { + _ERR("failed to getting media info"); + return; + } + + app_contents_recent_add(CONTENTS_MEDIA, mi->media_id); + + app_media_update(am); +} + static void _draw_playlist(struct _priv *priv) { struct _list_data *ld; @@ -158,12 +180,12 @@ static void _update_info(struct _priv *priv, app_media_info *mi) /* update progressbar */ progressbar_reset(priv->progress, 0, mi->audio->duration); - /* update history */ - app_contents_recent_add(CONTENTS_MEDIA, mi->media_id); - /* update play info */ vdata.index = priv->playlist.cur; viewmgr_update_view(VIEW_BASE, UPDATE_PLAY_INFO, &vdata); + + /* update history */ + _add_to_recent(priv); } static void _mplayer_show(struct _priv *priv) @@ -177,10 +199,10 @@ static void _mplayer_show(struct _priv *priv) return; } - _update_info(priv, mi); - - if (!priv->bar_show) + if (!priv->bar_show) { + _update_info(priv, mi); return; + } ctl = priv->ctl; ctl->ops->show(ctl->handle); @@ -189,6 +211,8 @@ static void _mplayer_show(struct _priv *priv) _draw_music_info(priv, mi); _draw_progressbar(priv, mi); _draw_playlist(priv); + + _update_info(priv, mi); } static void _mplayer_hide(struct _priv *priv) diff --git a/src/view/viewer.c b/src/view/viewer.c index 9f78195..2948ec7 100644 --- a/src/view/viewer.c +++ b/src/view/viewer.c @@ -161,6 +161,28 @@ static struct _viewer_info viewer_info[] = { }, }; +static void _add_to_recent(struct _priv *priv) +{ + app_media *am; + app_media_info *mi; + + am = eina_list_nth(priv->playlist.list, priv->playlist.cur); + if (!am) { + _ERR("failed to get app_media"); + return; + } + + mi = app_media_get_info(am); + if (!mi) { + _ERR("failed to getting media info"); + return; + } + + app_contents_recent_add(CONTENTS_MEDIA, mi->media_id); + + app_media_update(am); +} + /* * NOTE: Workaround * we assumed that if video content have the copyright then it's a movie. @@ -257,6 +279,8 @@ static void _image_loaded_detail(void *data, Evas_Object *obj, void *ev) priv = data; priv->photo_pre = NULL; + + _add_to_recent(priv); } static void _draw_contents(struct _priv *priv, int id, app_media_info *mi) @@ -404,8 +428,10 @@ static void _set_played_position(struct _priv *priv, int position) } r = video_meta_update_to_db(video); - if (r != MEDIA_CONTENT_ERROR_NONE) + if (r != MEDIA_CONTENT_ERROR_NONE) { _ERR("failed to update db"); + return; + } app_media_update(am); } @@ -468,8 +494,6 @@ static bool _viewer_show(struct _priv *priv) _draw_contents(priv, id, mi); - app_contents_recent_add(CONTENTS_MEDIA, mi->media_id); - return true; } @@ -684,6 +708,8 @@ static void _player_play(struct _priv *priv) playermgr_play(priv->player, mi->file_path, mi->video->position); + _add_to_recent(priv); + break; default: _ERR("player was not created"); -- 2.7.4 From f27b05b1d3cfae299ce5f9eb092578d48fc29e5d Mon Sep 17 00:00:00 2001 From: Jehun Lim Date: Fri, 24 Jul 2015 14:39:35 +0900 Subject: [PATCH 11/16] movie: modify the method to get recently watched item Change-Id: I493d4314f25d3b86015254ca20202871569192ad Signed-off-by: Jehun Lim --- CMakeLists.txt | 1 - packaging/org.tizen.mediahub.spec | 1 - src/layout/movie.c | 49 +++++++++++---------------------------- 3 files changed, 13 insertions(+), 38 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1138f9e..9245e39 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -18,7 +18,6 @@ PROJECT("mediahub" C) INCLUDE(FindPkgConfig) pkg_check_modules(PKGS REQUIRED - glib-2.0 elementary capi-appfw-application capi-media-player diff --git a/packaging/org.tizen.mediahub.spec b/packaging/org.tizen.mediahub.spec index 89f74f0..969283d 100644 --- a/packaging/org.tizen.mediahub.spec +++ b/packaging/org.tizen.mediahub.spec @@ -8,7 +8,6 @@ Source0: %{name}-%{version}.tar.gz Source1: %{name}.manifest BuildRequires: cmake -BuildRequires: pkgconfig(glib-2.0) BuildRequires: pkgconfig(elementary) BuildRequires: pkgconfig(capi-appfw-application) BuildRequires: pkgconfig(capi-media-player) diff --git a/src/layout/movie.c b/src/layout/movie.c index ceb236f..9d8d39a 100644 --- a/src/layout/movie.c +++ b/src/layout/movie.c @@ -14,11 +14,9 @@ * limitations under the License. */ -#include #include #include #include -#include #include #include #include @@ -386,49 +384,29 @@ static void _update_content_list(struct _priv *priv) _update_content_info(priv); } -static void _update_recent_item(struct _priv *priv) +static void _update_recent_item(struct _priv *priv, int index) { - GList *list; + Eina_List *list; app_media *am; app_media_info *info; - struct recent_data *recent; - int r; - - list = NULL; - info = NULL; - r = app_contents_get_recent_list(CONTENTS_MOVIE, 1, &list); - if (r != APP_CONTENTS_ERROR_NONE) { - _ERR("failed to get movie recent list"); + list = mediadata_get_medialist(priv->md); + am = eina_list_nth(list, index); + if (!am) { + _ERR("failed to get app media"); return; } - recent = (struct recent_data *)g_list_nth_data(list, 0); - - if (recent) { - am = util_find_media_info(mediadata_get_medialist(priv->md), - recent->id); - if (!am) { - _ERR("failed to get app media"); - g_list_free(list); - return; - } - - info = app_media_get_info(am); - if (!info) { - _ERR("failed to get app media info"); - g_list_free(list); - return; - } - - priv->recent_info = am; + info = app_media_get_info(am); + if (!info) { + _ERR("failed to get app media info"); + return; } + priv->recent_info = am; + if (!listmgr_update_play_info(priv->listmgr, info)) _ERR("failed to update recently watched item"); - - - g_list_free(list); } static bool _create(layoutmgr *lmgr, void *data) @@ -593,7 +571,6 @@ static void _update(void *layout_data, int update_type, void *data) switch (update_type) { case UPDATE_CONTENT: _update_content_list(priv); - _update_recent_item(priv); break; case UPDATE_FOCUS: if (!vdata) { @@ -602,7 +579,7 @@ static void _update(void *layout_data, int update_type, void *data) } listmgr_focus_play_info(priv->listmgr); - _update_recent_item(priv); + _update_recent_item(priv, vdata->index); break; default: break; -- 2.7.4 From acab3c486e748a45be0a8083943e0dd7168e7922 Mon Sep 17 00:00:00 2001 From: Minkyu Kang Date: Fri, 24 Jul 2015 14:45:39 +0900 Subject: [PATCH 12/16] musicplayer: modify play icon Change-Id: Ia2b079afa852632d68fa65f38fe46440ff523ba4 Signed-off-by: Minkyu Kang --- include/view/mplayer.h | 4 ++-- res/edc/images/ic_mini_player_play_foc.png | Bin 0 -> 3609 bytes res/edc/images/ic_mini_player_play_nor.png | Bin 0 -> 2003 bytes res/edc/images/ic_music_list_play.png | Bin 807 -> 0 bytes res/edc/images/ic_music_list_play_foc.png | Bin 687 -> 0 bytes res/edc/widgets/genlist.edc | 10 ++++------ src/view/mplayer.c | 11 ++++------- 7 files changed, 10 insertions(+), 15 deletions(-) create mode 100644 res/edc/images/ic_mini_player_play_foc.png create mode 100644 res/edc/images/ic_mini_player_play_nor.png delete mode 100644 res/edc/images/ic_music_list_play.png delete mode 100644 res/edc/images/ic_music_list_play_foc.png diff --git a/include/view/mplayer.h b/include/view/mplayer.h index 988daf9..94d9897 100644 --- a/include/view/mplayer.h +++ b/include/view/mplayer.h @@ -61,7 +61,7 @@ #define IMAGE_MUSIC_SHUFFLE_DIS_NORMAL "btn_music_contr_shuffle_dis.png" #define IMAGE_MUSIC_REPEAT_FOCUS "btn_music_contr_repeat_foc.png" #define IMAGE_MUSIC_REPEAT_NORMAL "btn_music_contr_repeat_nor.png" -#define IMAGE_MUSIC_LIST_PLAY "ic_music_list_play.png" -#define IMAGE_MUSIC_LIST_PLAY_FOC "ic_music_list_play_foc.png" +#define IMAGE_MUSIC_LIST_PLAY "ic_mini_player_play_nor.png" +#define IMAGE_MUSIC_LIST_PLAY_FOC "ic_mini_player_play_foc.png" #endif diff --git a/res/edc/images/ic_mini_player_play_foc.png b/res/edc/images/ic_mini_player_play_foc.png new file mode 100644 index 0000000000000000000000000000000000000000..bf5d08e85a183c82036a7bf94babf7c3bd25337e GIT binary patch literal 3609 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 literal 0 HcmV?d00001 diff --git a/res/edc/images/ic_mini_player_play_nor.png b/res/edc/images/ic_mini_player_play_nor.png new file mode 100644 index 0000000000000000000000000000000000000000..c06083062e45879abe96ca10e814fa13e03f7aca GIT binary patch literal 2003 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 diff --git a/res/edc/images/ic_music_list_play_foc.png b/res/edc/images/ic_music_list_play_foc.png deleted file mode 100644 index cced49401316ff3afed36a78e81d2d8d21fb981f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 687 zcmV;g0#N;lP)dftjn0U^r_ndjAXYSndo(Z6fwVn&+sm~aVYF1Oasq4Bd z$4KJ&aBT29KmEO1n1pq8wut1y${qz$d&H@`)02D~H2OMA( zfC_1bJ#RNmiV6U$4737<*#)XB5%PH$wue}v3hWX#0mBr53X?{d*oXf#i8$7I@SZPKY#+YXnBAVKLM-a0rVUi zrUIIE+t+XdrP`#{{cAjf|2geyKd_kg$VGdu!DTLJ;T@R&Z2 zoKfJb3p@iuGibKg9yuZ4%-xjE?58Pc11(7-ZNZMTsCkd|5lP=W-;}3Z^~s3?`)vB=s`y^`pzVy zoeO>0Ec8M|*aNDpv>Zj2sRDb=I{s(srQgF+%I8%dBt^O1VafIxiuG}Bois7R1PKx* zMw<2dI9GIcwl&ZmIJbQUPT1z5-@q9#4((CRYf3kCO(T+y^;tz_l`)OPf&cz1;1>}T VOB41>-kbmc002ovPDHLkV1gAqH_ZS5 diff --git a/res/edc/widgets/genlist.edc b/res/edc/widgets/genlist.edc index c93f86d..3e035dc 100644 --- a/res/edc/widgets/genlist.edc +++ b/res/edc/widgets/genlist.edc @@ -14,7 +14,7 @@ * limitations under the License. */ -#define LIST_TRANSITION_TIME 0.30 +#define LIST_TRANSITION_TIME 0.35 group { name: "elm/genlist/item/music_list/default"; @@ -84,7 +84,7 @@ group { description { state: "default" 0.1; inherit: "default" 0.0; - min: 40 140; + min: 54 140; } } part { @@ -93,7 +93,7 @@ group { scale: 1; description { state: "default" 0.0; - min: 40 40; + min: 54 54; rel1 { to: "image_bg"; relative: 0.5 0.5; @@ -109,7 +109,6 @@ group { description { state: "default" 0.1; inherit: "default" 0.0; - min: 40 40; fixed: 1 1; image.normal: IMAGE_MUSIC_LIST_PLAY; visible: 1; @@ -117,7 +116,6 @@ group { description { state: "focused" 0.1; inherit: "default" 0.0; - min: 40 40; fixed: 1 1; image.normal: IMAGE_MUSIC_LIST_PLAY_FOC; visible: 1; @@ -143,7 +141,7 @@ group { description { state: "default" 0.1; inherit: "default" 0.0; - min: 28 140; + min: 18 140; } } part { diff --git a/src/view/mplayer.c b/src/view/mplayer.c index a548f46..64348ab 100644 --- a/src/view/mplayer.c +++ b/src/view/mplayer.c @@ -494,27 +494,24 @@ static void _list_item_del(void *data, Evas_Object *obj) static char *_list_text_get(void *data, Evas_Object *obj, const char *part) { struct _list_data *ld; - app_media *am; app_media_info *mi; - Elm_Object_Item *item; + int index; char buf[1024]; if (!data) return NULL; ld = data; - am = ld->am; - item = ld->item; + index = elm_genlist_item_index_get(ld->item); - mi = app_media_get_info(am); + mi = app_media_get_info(ld->am); if (!mi) { _ERR("failed to get media info"); return NULL; } if (!strcmp(part, PART_ELM_TEXT_TITLE)) { - snprintf(buf, sizeof(buf), "%02d. %s", - elm_genlist_item_index_get(item), mi->title); + snprintf(buf, sizeof(buf), "%02d. %s", index, mi->title); } else if (!strcmp(part, PART_ELM_TEXT_ARTIST)) { snprintf(buf, sizeof(buf), "%s / %s", mi->audio->artist, mi->audio->album); -- 2.7.4 From 9a87a3906e2a63ffa1a7c1afbdd3d29436234c82 Mon Sep 17 00:00:00 2001 From: Minkyu Kang Date: Fri, 24 Jul 2015 15:15:59 +0900 Subject: [PATCH 13/16] workaround: modify query string (due to sqlite bug) Change-Id: Ic020e02c5331426ae6bade8d320eb7427174449d Signed-off-by: Minkyu Kang --- src/layout/gallery.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/layout/gallery.c b/src/layout/gallery.c index 3e3e839..0cd9130 100644 --- a/src/layout/gallery.c +++ b/src/layout/gallery.c @@ -28,8 +28,12 @@ #include "util/listmgr.h" #include "util/util.h" +/* + FIXME #define LIST_MEDIA_COND "media_type=0 OR \ (media_type=1 AND copyright LIKE \"Unknown\")" +*/ +#define LIST_MEDIA_COND "(media_type=0 OR media_type=1) AND copyright LIKE \"Unknown\"" #define TEXT_NOCONTENT "No Photo & Video" -- 2.7.4 From 52c9f5586b35dac146e25d0b732af80a9cf26bb9 Mon Sep 17 00:00:00 2001 From: Minkyu Kang Date: Fri, 24 Jul 2015 18:10:29 +0900 Subject: [PATCH 14/16] stop the musicplayer when play the video Change-Id: Ib6534edb2ec8a94f292a77f7d7adac86a546c644 Signed-off-by: Minkyu Kang --- src/view/mplayer.c | 8 +++----- src/view/viewer.c | 6 ++++++ 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/view/mplayer.c b/src/view/mplayer.c index 64348ab..a981523 100644 --- a/src/view/mplayer.c +++ b/src/view/mplayer.c @@ -816,16 +816,14 @@ static void _update(void *view_data, int update_type, void *data) return; } - if (!data) { - _ERR("invalid parameter"); - return; - } - priv = view_data; vdata = data; switch (update_type) { case UPDATE_CONTENT: + if (!vdata) + break; + priv->playlist.list = vdata->list; priv->playlist.cur = vdata->index; diff --git a/src/view/viewer.c b/src/view/viewer.c index 2948ec7..91553d6 100644 --- a/src/view/viewer.c +++ b/src/view/viewer.c @@ -436,6 +436,11 @@ static void _set_played_position(struct _priv *priv, int position) app_media_update(am); } +static void _update_to_player(struct _priv *priv) +{ + viewmgr_update_view(VIEW_MPLAYER, UPDATE_PLAYER, NULL); +} + static bool _viewer_show(struct _priv *priv) { struct _viewer_info *info; @@ -703,6 +708,7 @@ static void _player_play(struct _priv *priv) } _remove_thumbnail(priv); + _update_to_player(priv); progressbar_start(priv->progress); playermgr_play(priv->player, mi->file_path, -- 2.7.4 From f68cea1063321fc0bc1ecfa18f22eabc2280b082 Mon Sep 17 00:00:00 2001 From: Minkyu Kang Date: Fri, 24 Jul 2015 18:56:51 +0900 Subject: [PATCH 15/16] player: don't use playermgr callbacks It can be occurred some problems. Change-Id: Id0361d5078d0fda73fb059888fc49ef7c6cd4d2c Signed-off-by: Minkyu Kang --- src/view/viewer.c | 42 +++++++++--------------------------------- 1 file changed, 9 insertions(+), 33 deletions(-) diff --git a/src/view/viewer.c b/src/view/viewer.c index 91553d6..2674c58 100644 --- a/src/view/viewer.c +++ b/src/view/viewer.c @@ -679,10 +679,6 @@ static int _player_get_position(void *data) return playermgr_get_position(priv->player); } -static struct progressbar_ops _progressbar_ops = { - .get_value = _player_get_position, -}; - static void _player_play(struct _priv *priv) { app_media_info *mi; @@ -754,27 +750,16 @@ static void _player_complete_cb(void *data) if (priv->viewer.cur == VIEWER_MOVIE) _pop_view(priv); - else if (priv->viewer.cur == VIEWER_VIDEO) + else if (priv->viewer.cur == VIEWER_VIDEO) { _viewer_show(priv); + _show_bar(data); + } } -static void _player_set_position_cb(void *data) -{ - struct _priv *priv; - struct controller *ctl; - - if (!data) - return; - - priv = data; - - /* FIXME: what will you do here? */ - progressbar_pause(priv->progress); - playermgr_pause(priv->player); - - ctl = priv->viewer.ctl[priv->viewer.cur]; - ctl->ops->signal(ctl->handle, PLAY_BTN_LOC, SIG_SET_PLAY); -} +static struct progressbar_ops _progressbar_ops = { + .get_value = _player_get_position, + .complete_cb = _player_complete_cb, +}; static void _callback_movie(void *data, const char *ev) { @@ -787,12 +772,10 @@ static void _callback_movie(void *data, const char *ev) priv = data; if (!strcmp(ev, SRC_BTN_PREV)) { - playermgr_set_position(priv->player, 0, - _player_set_position_cb, priv); + playermgr_set_position(priv->player, 0, NULL, NULL); } else if (!strcmp(ev, SRC_BTN_NEXT)) { ms = playermgr_get_duration(priv->player); - playermgr_set_position(priv->player, ms - 1000, - _player_set_position_cb, priv); + playermgr_set_position(priv->player, ms - 500, NULL, NULL); } else if (!strcmp(ev, SRC_BTN_PLAY)) { _player_play(priv); } @@ -915,13 +898,6 @@ static Evas_Object *_create(Evas_Object *win, void *data) return NULL; } - r = playermgr_set_completed_cb(player, _player_complete_cb, priv); - if (!r) { - _ERR("failed to set callback"); - playermgr_destroy(player); - return NULL; - } - priv->player = player; r = _ui_init(priv); -- 2.7.4 From de440fa5ec040f93aa6ed003b4bc4bf244e764d4 Mon Sep 17 00:00:00 2001 From: Minkyu Kang Date: Fri, 24 Jul 2015 19:26:11 +0900 Subject: [PATCH 16/16] timeout_handler: set to NULL before returning Change-Id: Ie330ba933aff88f0020401d0f3b66dc7b18d1466 Signed-off-by: Minkyu Kang --- src/util/timeout_handler.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/util/timeout_handler.c b/src/util/timeout_handler.c index c4805f1..d66ac3b 100644 --- a/src/util/timeout_handler.c +++ b/src/util/timeout_handler.c @@ -43,11 +43,12 @@ static Eina_Bool _timer_cb(void *data) handle = data; + handle->timer = NULL; + if (!handle->enable) return ECORE_CALLBACK_CANCEL; handle->timeout_cb(handle->timeout_data, 0, NULL); - handle->timer = NULL; return ECORE_CALLBACK_CANCEL; } -- 2.7.4