summaryrefslogtreecommitdiff
path: root/src/lib/edje/edje_smart.c
diff options
context:
space:
mode:
authorAmitesh Singh <amitesh.sh@samsung.com>2017-07-28 11:48:34 +0900
committerAmitesh Singh <amitesh.sh@samsung.com>2017-08-04 16:22:59 +0900
commit0e7a316a7a05b0c2733403285120a6a59a67d790 (patch)
tree408282a7dd2ce1eebbb4cb3db87ac1e3704a665e /src/lib/edje/edje_smart.c
parentf2082c0412a5e1df6b1a53e209125e7fe37dccf8 (diff)
edje: implement edje.player interface functions
fixes T5560
Diffstat (limited to 'src/lib/edje/edje_smart.c')
-rw-r--r--src/lib/edje/edje_smart.c66
1 files changed, 66 insertions, 0 deletions
diff --git a/src/lib/edje/edje_smart.c b/src/lib/edje/edje_smart.c
index 20ebb0a..72452fa9 100644
--- a/src/lib/edje/edje_smart.c
+++ b/src/lib/edje/edje_smart.c
@@ -554,6 +554,72 @@ _edje_object_efl_observer_update(Eo *obj EINA_UNUSED, Edje *ed, Efl_Object *obs,
554 } 554 }
555} 555}
556 556
557EOLIAN Eina_Bool
558_edje_object_efl_player_playable_get(Eo *obj EINA_UNUSED, Edje *pd EINA_UNUSED)
559{
560 return EINA_TRUE;
561}
562
563EOLIAN void
564_edje_object_efl_player_play_set(Eo *obj EINA_UNUSED, Edje *ed, Eina_Bool play)
565{
566 double t;
567 Eina_List *l;
568 Edje_Running_Program *runp;
569 unsigned short i;
570
571 if (!ed) return;
572 if (ed->delete_me) return;
573 if (play)
574 {
575 if (!ed->paused) return;
576 ed->paused = EINA_FALSE;
577 t = ecore_time_get() - ed->paused_at;
578 EINA_LIST_FOREACH(ed->actions, l, runp)
579 runp->start_time += t;
580 }
581 else
582 {
583 if (ed->paused) return;
584 ed->paused = EINA_TRUE;
585 ed->paused_at = ecore_time_get();
586 }
587
588 for (i = 0; i < ed->table_parts_size; i++)
589 {
590 Edje_Real_Part *rp;
591 rp = ed->table_parts[i];
592 if ((rp->part->type == EDJE_PART_TYPE_GROUP) &&
593 ((rp->type == EDJE_RP_TYPE_SWALLOW) &&
594 (rp->typedata.swallow)) &&
595 (rp->typedata.swallow->swallowed_object))
596 edje_object_play_set(rp->typedata.swallow->swallowed_object, play);
597 }
598}
599
600EOLIAN Eina_Bool
601_edje_object_efl_player_play_get(Eo *obj EINA_UNUSED, Edje *ed)
602{
603 if (!ed) return EINA_FALSE;
604 if (ed->delete_me) return EINA_FALSE;
605 if (ed->paused) return EINA_FALSE;
606
607 return EINA_TRUE;
608}
609
610EOLIAN void
611_edje_object_efl_player_play_speed_set(Eo *obj EINA_UNUSED, Edje *pd , double speed)
612{
613 if (speed <= 0.0) speed = 1.0;
614 pd->duration_scale = 1.0/speed;
615}
616
617EOLIAN double
618_edje_object_efl_player_play_speed_get(Eo *obj EINA_UNUSED, Edje *pd)
619{
620 return 1.0/pd->duration_scale;
621}
622
557/* Internal EO APIs and hidden overrides */ 623/* Internal EO APIs and hidden overrides */
558 624
559#define EDJE_OBJECT_EXTRA_OPS \ 625#define EDJE_OBJECT_EXTRA_OPS \