summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordavemds <dave@gurumeditation.it>2014-02-22 11:45:18 +0100
committerdavemds <dave@gurumeditation.it>2014-02-22 11:45:18 +0100
commit2a85f160b8ba2d31594faf1361299249d540c1f5 (patch)
tree169a8733bde4fcf4f076ffae8483bba6c14c87c7 /src
parenta1ed4cf9d8e947e94323b5ce19dbde2677bda33b (diff)
Emotion test: added --loop and --position args.
* New --loop: restart the playback when end reached * New --position: start the playback from the last know position * Fixed double -R option. now -r is --reflex and -R is --copyright Loop and last-position was implemented yet, this commit just made them optionally, so the default behaviour of the test reflect the default behaviour of emotion.
Diffstat (limited to 'src')
-rw-r--r--src/tests/emotion/emotion_test_main.c23
1 files changed, 16 insertions, 7 deletions
diff --git a/src/tests/emotion/emotion_test_main.c b/src/tests/emotion/emotion_test_main.c
index 8baf23d9eb..434d01241b 100644
--- a/src/tests/emotion/emotion_test_main.c
+++ b/src/tests/emotion/emotion_test_main.c
@@ -18,7 +18,7 @@ static const Ecore_Getopt options = {
18 "emotion_test", 18 "emotion_test",
19 "%prog [options] <filename>", 19 "%prog [options] <filename>",
20 "1.0.0", 20 "1.0.0",
21 "(C) 2011 Enlightenment", 21 "(C) 2011-2014 Enlightenment",
22 "BSD\nThis is a 3 clause bsd bla bla", 22 "BSD\nThis is a 3 clause bsd bla bla",
23 "a simple test program for emotion.", 23 "a simple test program for emotion.",
24 1, 24 1,
@@ -31,7 +31,9 @@ static const Ecore_Getopt options = {
31 ECORE_GETOPT_STORE_STR('b', "backend", "backend to use"), 31 ECORE_GETOPT_STORE_STR('b', "backend", "backend to use"),
32 ECORE_GETOPT_STORE_INT('v', "vis", "visualization type"), 32 ECORE_GETOPT_STORE_INT('v', "vis", "visualization type"),
33 ECORE_GETOPT_STORE_TRUE('w', "webcams", "show all the available v4l streams"), 33 ECORE_GETOPT_STORE_TRUE('w', "webcams", "show all the available v4l streams"),
34 ECORE_GETOPT_STORE_TRUE('R', "reflex", "show video reflex effect"), 34 ECORE_GETOPT_STORE_TRUE('r', "reflex", "show video reflex effect"),
35 ECORE_GETOPT_STORE_TRUE('l', "loop", "restart the video when end reached"),
36 ECORE_GETOPT_STORE_TRUE('p', "position", "start the video from last know position"),
35 ECORE_GETOPT_VERSION('V', "version"), 37 ECORE_GETOPT_VERSION('V', "version"),
36 ECORE_GETOPT_COPYRIGHT('R', "copyright"), 38 ECORE_GETOPT_COPYRIGHT('R', "copyright"),
37 ECORE_GETOPT_LICENSE('L', "license"), 39 ECORE_GETOPT_LICENSE('L', "license"),
@@ -68,6 +70,8 @@ static int starth = 600;
68static Eina_List *video_objs = NULL; 70static Eina_List *video_objs = NULL;
69static Emotion_Vis vis = EMOTION_VIS_NONE; 71static Emotion_Vis vis = EMOTION_VIS_NONE;
70static unsigned char reflex = 0; 72static unsigned char reflex = 0;
73static unsigned char loop = 0;
74static unsigned char last_position_load = 0;
71static const char *theme_file = NULL; 75static const char *theme_file = NULL;
72 76
73static void 77static void
@@ -369,8 +373,11 @@ static void
369video_obj_stopped_cb(void *data EINA_UNUSED, Evas_Object *obj, void *event_info EINA_UNUSED) 373video_obj_stopped_cb(void *data EINA_UNUSED, Evas_Object *obj, void *event_info EINA_UNUSED)
370{ 374{
371 printf("video stopped!\n"); 375 printf("video stopped!\n");
372 emotion_object_position_set(obj, 0.0); 376 if (loop)
373 emotion_object_play_set(obj, 1); 377 {
378 emotion_object_position_set(obj, 0.0);
379 emotion_object_play_set(obj, 1);
380 }
374} 381}
375 382
376static void 383static void
@@ -419,7 +426,6 @@ video_obj_button_cb(void *data EINA_UNUSED, Evas_Object *obj, void *event_info E
419} 426}
420 427
421 428
422
423static void 429static void
424video_obj_signal_play_cb(void *data, Evas_Object *o, const char *emission EINA_UNUSED, const char *source EINA_UNUSED) 430video_obj_signal_play_cb(void *data, Evas_Object *o, const char *emission EINA_UNUSED, const char *source EINA_UNUSED)
425{ 431{
@@ -573,8 +579,9 @@ init_video_object(const char *module_filename, const char *filename)
573 return; 579 return;
574 emotion_object_vis_set(o, vis); 580 emotion_object_vis_set(o, vis);
575 if (!emotion_object_file_set(o, filename)) 581 if (!emotion_object_file_set(o, filename))
576 return; 582 return;
577 emotion_object_last_position_load(o); 583 if (last_position_load)
584 emotion_object_last_position_load(o);
578 emotion_object_play_set(o, 1); 585 emotion_object_play_set(o, 1);
579 emotion_object_audio_volume_set(o, 0.5); 586 emotion_object_audio_volume_set(o, 0.5);
580 evas_object_move(o, 0, 0); 587 evas_object_move(o, 0, 0);
@@ -659,6 +666,8 @@ main(int argc, char **argv)
659 ECORE_GETOPT_VALUE_INT(visual), 666 ECORE_GETOPT_VALUE_INT(visual),
660 ECORE_GETOPT_VALUE_BOOL(webcams), 667 ECORE_GETOPT_VALUE_BOOL(webcams),
661 ECORE_GETOPT_VALUE_BOOL(reflex), 668 ECORE_GETOPT_VALUE_BOOL(reflex),
669 ECORE_GETOPT_VALUE_BOOL(loop),
670 ECORE_GETOPT_VALUE_BOOL(last_position_load),
662 ECORE_GETOPT_VALUE_NONE, 671 ECORE_GETOPT_VALUE_NONE,
663 ECORE_GETOPT_VALUE_NONE, 672 ECORE_GETOPT_VALUE_NONE,
664 ECORE_GETOPT_VALUE_NONE, 673 ECORE_GETOPT_VALUE_NONE,