summaryrefslogtreecommitdiff
path: root/legacy/emotion/src/bin
diff options
context:
space:
mode:
authorGustavo Sverzut Barbieri <barbieri@gmail.com>2008-09-25 23:15:21 +0000
committerGustavo Sverzut Barbieri <barbieri@gmail.com>2008-09-25 23:15:21 +0000
commitd29b7694cb99cfcbf9598976733824bea02fa0b8 (patch)
tree624fb2973b2ea9516417d09f8dd53ad5f36fb48e /legacy/emotion/src/bin
parent42d39725b43c3739744114d361e826c7bf014aff (diff)
emotion+visualization: export and reorder.
done: * module api changed, vis_set is not close to vis_get, vis_supported was added. * exported these properties in emotion_object. * gstreamer plugin now starts with no visualization. todo: * add xine support. * make gstreamer able to dynamically change visualization. PS: gstreamer module really needs a cleanup, losts of functions need "static" or add proper prefix, including "gst" to avoid it clash with other symbols. SVN revision: 36260
Diffstat (limited to 'legacy/emotion/src/bin')
-rw-r--r--legacy/emotion/src/bin/emotion_test_main.c40
1 files changed, 39 insertions, 1 deletions
diff --git a/legacy/emotion/src/bin/emotion_test_main.c b/legacy/emotion/src/bin/emotion_test_main.c
index 16bb1a5aaa..fbf2a0442f 100644
--- a/legacy/emotion/src/bin/emotion_test_main.c
+++ b/legacy/emotion/src/bin/emotion_test_main.c
@@ -46,6 +46,7 @@ static int startw = 800;
46static int starth = 600; 46static int starth = 600;
47 47
48static Evas_List *video_objs = NULL; 48static Evas_List *video_objs = NULL;
49static Emotion_Vis vis = EMOTION_VIS_NONE;
49 50
50static int 51static int
51main_start(int argc, char **argv) 52main_start(int argc, char **argv)
@@ -92,6 +93,11 @@ main_start(int argc, char **argv)
92 { 93 {
93 mode = 3; 94 mode = 3;
94 } 95 }
96 else if ((!strcmp(argv[i], "-vis")) && (i < (argc - 1)))
97 {
98 vis = atoi(argv[i + 1]);
99 i++;
100 }
95 } 101 }
96 } 102 }
97#if HAVE_ECORE_EVAS_X 103#if HAVE_ECORE_EVAS_X
@@ -370,6 +376,33 @@ bg_key_down(void *data, Evas * e, Evas_Object * obj, void *event_info)
370 printf("done\n"); 376 printf("done\n");
371 } 377 }
372 } 378 }
379 else if (!strcmp(ev->keyname, "z"))
380 {
381 Evas_List *l;
382
383 vis = (vis + 1) % EMOTION_VIS_LAST;
384 printf("new visualization: %d\n", vis);
385
386
387 for (l = video_objs; l; l = l->next)
388 {
389 Evas_Object *obj;
390 Evas_Bool supported;
391
392 obj = l->data;
393 supported = emotion_object_vis_supported(obj, vis);
394 if (supported)
395 emotion_object_vis_set(obj, vis);
396 else
397 {
398 const char *file;
399
400 file = emotion_object_file_get(obj);
401 printf("object %p (%s) does not support visualization %d\n",
402 obj, file, vis);
403 }
404 }
405 }
373 else 406 else
374 { 407 {
375 printf("UNHANDLED: %s\n", ev->keyname); 408 printf("UNHANDLED: %s\n", ev->keyname);
@@ -736,6 +769,7 @@ init_video_object(char *module_filename, char *filename)
736 o = emotion_object_add(evas); 769 o = emotion_object_add(evas);
737 if (!emotion_object_init(o, module_filename)) 770 if (!emotion_object_init(o, module_filename))
738 return; 771 return;
772 emotion_object_vis_set(o, vis);
739 emotion_object_file_set(o, filename); 773 emotion_object_file_set(o, filename);
740 emotion_object_play_set(o, 1); 774 emotion_object_play_set(o, 1);
741 evas_object_move(o, 0, 0); 775 evas_object_move(o, 0, 0);
@@ -836,7 +870,7 @@ main(int argc, char **argv)
836 (!strcmp(argv[i], "--help")))) 870 (!strcmp(argv[i], "--help"))))
837 { 871 {
838 printf("Usage:\n"); 872 printf("Usage:\n");
839 printf(" %s [-gl] [-g WxH] [-xine] [-gstreamer] filename\n", argv[0]); 873 printf(" %s [-gl] [-g WxH] [-vis NUMBER] [-xine] [-gstreamer] filename\n", argv[0]);
840 exit(-1); 874 exit(-1);
841 } 875 }
842 else if (!strcmp(argv[i], "-gl")) 876 else if (!strcmp(argv[i], "-gl"))
@@ -856,6 +890,10 @@ main(int argc, char **argv)
856 { 890 {
857 module_filename = "gstreamer"; 891 module_filename = "gstreamer";
858 } 892 }
893 else if ((!strcmp(argv[i], "-vis")) && (i < (argc - 1)))
894 {
895 i++;
896 }
859 else 897 else
860 { 898 {
861 printf ("module : %s\n", module_filename); 899 printf ("module : %s\n", module_filename);