summaryrefslogtreecommitdiff
path: root/legacy/emotion/src/bin
diff options
context:
space:
mode:
authorCarsten Haitzler <raster@rasterman.com>2004-06-18 15:38:03 +0000
committerCarsten Haitzler <raster@rasterman.com>2004-06-18 15:38:03 +0000
commit7f3528ec27a1419b927542e6ab3eff62e69aadd4 (patch)
tree95ddf197be0bf244f723478cdeab0e6d09f68adc /legacy/emotion/src/bin
parente1704a29b526ca419f7d85bcc8a2dac3596be2e4 (diff)
it had to happen sooner or later... in in in... we go! :)
SVN revision: 10537
Diffstat (limited to 'legacy/emotion/src/bin')
-rw-r--r--legacy/emotion/src/bin/Makefile.am18
-rw-r--r--legacy/emotion/src/bin/emotion_test_main.c760
2 files changed, 778 insertions, 0 deletions
diff --git a/legacy/emotion/src/bin/Makefile.am b/legacy/emotion/src/bin/Makefile.am
new file mode 100644
index 0000000000..ccaee99c27
--- /dev/null
+++ b/legacy/emotion/src/bin/Makefile.am
@@ -0,0 +1,18 @@
1## Process this file with automake to produce Makefile.in
2
3INCLUDES = \
4-I$(top_srcdir) \
5-I$(top_srcdir)/src/lib \
6@my_cflags@ @edje_cflags@
7
8bin_PROGRAMS = \
9emotion_test
10
11emotion_test_SOURCES = \
12emotion_test_main.c
13
14emotion_test_LDADD = \
15@my_libs@ @edje_libs@ \
16$(top_builddir)/src/lib/libemotion.la
17
18
diff --git a/legacy/emotion/src/bin/emotion_test_main.c b/legacy/emotion/src/bin/emotion_test_main.c
new file mode 100644
index 0000000000..fe1096a265
--- /dev/null
+++ b/legacy/emotion/src/bin/emotion_test_main.c
@@ -0,0 +1,760 @@
1#include <Evas.h>
2#include <Ecore.h>
3#ifndef FB_ONLY
4#include <Ecore_X.h>
5#else
6#include <Ecore_Fb.h>
7#endif
8#include <Ecore_Evas.h>
9#include <Edje.h>
10
11#include "Emotion.h"
12
13#include "config.h"
14
15typedef struct _Frame_Data Frame_Data;
16
17struct _Frame_Data
18{
19 char moving : 1;
20 char resizing : 1;
21 int button;
22 Evas_Coord x, y;
23};
24
25static int main_start(int argc, char **argv);
26static void main_stop(void);
27static void main_resize(Ecore_Evas *ee);
28static int main_signal_exit(void *data, int ev_type, void *ev);
29static void main_delete_request(Ecore_Evas *ee);
30
31void bg_setup(void);
32void bg_resize(Evas_Coord w, Evas_Coord h);
33static void bg_key_down(void *data, Evas * e, Evas_Object * obj, void *event_info);
34
35static Evas_Object *o_bg = NULL;
36
37double start_time = 0.0;
38Ecore_Evas *ecore_evas = NULL;
39Evas *evas = NULL;
40int startw = 800;
41int starth = 600;
42
43Evas_List *video_objs = NULL;
44
45static int
46main_start(int argc, char **argv)
47{
48 int mode = 0;
49
50 start_time = ecore_time_get();
51 if (!ecore_init()) return -1;
52 ecore_app_args_set(argc, (const char **)argv);
53 ecore_event_handler_add(ECORE_EVENT_SIGNAL_EXIT, main_signal_exit, NULL);
54 if (!ecore_evas_init()) return -1;
55#ifndef FB_ONLY
56 {
57 int i;
58
59 for (i = 1; i < argc; i++)
60 {
61 if (((!strcmp(argv[i], "-g")) ||
62 (!strcmp(argv[i], "-geometry")) ||
63 (!strcmp(argv[i], "--geometry"))) && (i < (argc - 1)))
64 {
65 int n, w, h;
66 char buf[16], buf2[16];
67
68 n = sscanf(argv[i +1], "%10[^x]x%10s", buf, buf2);
69 if (n == 2)
70 {
71 w = atoi(buf);
72 h = atoi(buf2);
73 startw = w;
74 starth = h;
75 }
76 i++;
77 }
78 else if (!strcmp(argv[i], "-gl"))
79 {
80 mode = 1;
81 }
82 else if (!strcmp(argv[i], "-fb"))
83 {
84 mode = 2;
85 }
86 }
87 }
88 if (mode == 0)
89 ecore_evas = ecore_evas_software_x11_new(NULL, 0, 0, 0, startw, starth);
90 else if (mode == 1)
91 ecore_evas = ecore_evas_gl_x11_new(NULL, 0, 0, 0, startw, starth);
92 else if (mode == 2)
93 ecore_evas = ecore_evas_fb_new(NULL, 0, startw, starth);
94#else
95 startw = 240;
96 starth = 320;
97 ecore_evas = ecore_evas_fb_new(NULL, 270, startw, starth);
98#endif
99 if (!ecore_evas) return -1;
100 ecore_evas_callback_delete_request_set(ecore_evas, main_delete_request);
101 ecore_evas_callback_resize_set(ecore_evas, main_resize);
102 ecore_evas_title_set(ecore_evas, "Evas Media Test Program");
103 ecore_evas_name_class_set(ecore_evas, "evas_media_test", "main");
104 ecore_evas_show(ecore_evas);
105 evas = ecore_evas_get(ecore_evas);
106 evas_image_cache_set(evas, 8 * 1024 * 1024);
107 evas_font_cache_set(evas, 1 * 1024 * 1024);
108 evas_font_path_append(evas, PACKAGE_DATA_DIR"/data/fonts");
109
110 edje_init();
111 edje_frametime_set(1.0 / 30.0);
112 return 1;
113}
114
115static void
116main_stop(void)
117{
118 ecore_evas_shutdown();
119 ecore_shutdown();
120}
121
122static void
123main_resize(Ecore_Evas *ee)
124{
125 Evas_Coord w, h;
126
127 evas_output_viewport_get(evas, NULL, NULL, &w, &h);
128 bg_resize(w, h);
129}
130
131static int
132main_signal_exit(void *data, int ev_type, void *ev)
133{
134 ecore_main_loop_quit();
135 return 1;
136}
137
138static void
139main_delete_request(Ecore_Evas *ee)
140{
141 ecore_main_loop_quit();
142}
143
144void
145bg_setup(void)
146{
147 Evas_Object *o;
148
149 o = edje_object_add(evas);
150 edje_object_file_set(o, PACKAGE_DATA_DIR"/data/theme.eet", "background");
151 evas_object_move(o, 0, 0);
152 evas_object_resize(o, startw, starth);
153 evas_object_layer_set(o, -999);
154 evas_object_show(o);
155 evas_object_focus_set(o, 1);
156 evas_object_event_callback_add(o, EVAS_CALLBACK_KEY_DOWN, bg_key_down, NULL);
157 o_bg = o;
158}
159
160void
161bg_resize(Evas_Coord w, Evas_Coord h)
162{
163 evas_object_resize(o_bg, w, h);
164}
165
166static void
167broadcast_event(Emotion_Event ev)
168{
169 Evas_List *l;
170
171 for (l = video_objs; l; l = l->next)
172 {
173 Evas_Object *obj;
174
175 obj = l->data;
176 emotion_object_event_simple_send(obj, ev);
177 }
178}
179
180static void
181bg_key_down(void *data, Evas * e, Evas_Object * obj, void *event_info)
182{
183 Evas_Event_Key_Down *ev;
184
185 ev = (Evas_Event_Key_Down *)event_info;
186 if (!strcmp(ev->keyname, "Escape"))
187 ecore_main_loop_quit();
188 else if (!strcmp(ev->keyname, "Up"))
189 broadcast_event(EMOTION_EVENT_UP);
190 else if (!strcmp(ev->keyname, "Down"))
191 broadcast_event(EMOTION_EVENT_DOWN);
192 else if (!strcmp(ev->keyname, "Left"))
193 broadcast_event(EMOTION_EVENT_LEFT);
194 else if (!strcmp(ev->keyname, "Right"))
195 broadcast_event(EMOTION_EVENT_RIGHT);
196 else if (!strcmp(ev->keyname, "Return"))
197 broadcast_event(EMOTION_EVENT_SELECT);
198 else if (!strcmp(ev->keyname, "m"))
199 broadcast_event(EMOTION_EVENT_MENU1);
200 else if (!strcmp(ev->keyname, "Prior"))
201 broadcast_event(EMOTION_EVENT_PREV);
202 else if (!strcmp(ev->keyname, "Next"))
203 broadcast_event(EMOTION_EVENT_NEXT);
204 else if (!strcmp(ev->keyname, "0"))
205 broadcast_event(EMOTION_EVENT_0);
206 else if (!strcmp(ev->keyname, "1"))
207 broadcast_event(EMOTION_EVENT_1);
208 else if (!strcmp(ev->keyname, "2"))
209 broadcast_event(EMOTION_EVENT_2);
210 else if (!strcmp(ev->keyname, "3"))
211 broadcast_event(EMOTION_EVENT_3);
212 else if (!strcmp(ev->keyname, "4"))
213 broadcast_event(EMOTION_EVENT_4);
214 else if (!strcmp(ev->keyname, "5"))
215 broadcast_event(EMOTION_EVENT_5);
216 else if (!strcmp(ev->keyname, "6"))
217 broadcast_event(EMOTION_EVENT_6);
218 else if (!strcmp(ev->keyname, "7"))
219 broadcast_event(EMOTION_EVENT_7);
220 else if (!strcmp(ev->keyname, "8"))
221 broadcast_event(EMOTION_EVENT_8);
222 else if (!strcmp(ev->keyname, "9"))
223 broadcast_event(EMOTION_EVENT_9);
224 else if (!strcmp(ev->keyname, "-"))
225 broadcast_event(EMOTION_EVENT_10);
226 else if (!strcmp(ev->keyname, "bracketleft"))
227 {
228 Evas_List *l;
229
230 for (l = video_objs; l; l = l->next)
231 {
232 Evas_Object *obj;
233
234 obj = l->data;
235 emotion_object_audio_volume_set(obj, emotion_object_audio_volume_get(obj) - 0.1);
236 }
237 }
238 else if (!strcmp(ev->keyname, "bracketright"))
239 {
240 Evas_List *l;
241
242 for (l = video_objs; l; l = l->next)
243 {
244 Evas_Object *obj;
245
246 obj = l->data;
247 emotion_object_audio_volume_set(obj, emotion_object_audio_volume_get(obj) + 0.1);
248 }
249 }
250 else if (!strcmp(ev->keyname, "v"))
251 {
252 Evas_List *l;
253
254 for (l = video_objs; l; l = l->next)
255 {
256 Evas_Object *obj;
257
258 obj = l->data;
259 if (emotion_object_video_mute_get(obj))
260 emotion_object_video_mute_set(obj, 0);
261 else
262 emotion_object_video_mute_set(obj, 1);
263 }
264 }
265 else if (!strcmp(ev->keyname, "a"))
266 {
267 Evas_List *l;
268
269 for (l = video_objs; l; l = l->next)
270 {
271 Evas_Object *obj;
272
273 obj = l->data;
274 if (emotion_object_audio_mute_get(obj))
275 {
276 emotion_object_audio_mute_set(obj, 0);
277 printf("unmute\n");
278 }
279 else
280 {
281 emotion_object_audio_mute_set(obj, 1);
282 printf("mute\n");
283 }
284 }
285 }
286 else if (!strcmp(ev->keyname, "i"))
287 {
288 Evas_List *l;
289
290 for (l = video_objs; l; l = l->next)
291 {
292 Evas_Object *obj;
293
294 obj = l->data;
295 printf("audio channels: %i\n", emotion_object_audio_channel_count(obj));
296 printf("video channels: %i\n", emotion_object_video_channel_count(obj));
297 printf("spu channels: %i\n", emotion_object_spu_channel_count(obj));
298 printf("seekable: %i\n", emotion_object_seekable_get(obj));
299 }
300 }
301 else if (!strcmp(ev->keyname, "f"))
302 {
303 if (!ecore_evas_fullscreen_get(ecore_evas))
304 ecore_evas_fullscreen_set(ecore_evas, 1);
305 else
306 ecore_evas_fullscreen_set(ecore_evas, 0);
307 }
308 else if (!strcmp(ev->keyname, "d"))
309 {
310 if (!ecore_evas_avoid_damage_get(ecore_evas))
311 ecore_evas_avoid_damage_set(ecore_evas, 1);
312 else
313 ecore_evas_avoid_damage_set(ecore_evas, 0);
314 }
315 else if (!strcmp(ev->keyname, "s"))
316 {
317 if (!ecore_evas_shaped_get(ecore_evas))
318 {
319 ecore_evas_shaped_set(ecore_evas, 1);
320 evas_object_hide(o_bg);
321 }
322 else
323 {
324 ecore_evas_shaped_set(ecore_evas, 0);
325 evas_object_show(o_bg);
326 }
327 }
328 else if (!strcmp(ev->keyname, "b"))
329 {
330 if (!ecore_evas_borderless_get(ecore_evas))
331 ecore_evas_borderless_set(ecore_evas, 1);
332 else
333 ecore_evas_borderless_set(ecore_evas, 0);
334 }
335 else
336 {
337 printf("UNHANDLED: %s\n", ev->keyname);
338 }
339}
340
341static void
342video_obj_in_cb(void *data, Evas *ev, Evas_Object *obj, void *event_info)
343{
344// evas_object_color_set(obj, 255, 255, 255, 100);
345}
346
347static void
348video_obj_out_cb(void *data, Evas *ev, Evas_Object *obj, void *event_info)
349{
350// evas_object_color_set(obj, 255, 255, 255, 200);
351}
352
353static void
354video_obj_down_cb(void *data, Evas *ev, Evas_Object *obj, void *event_info)
355{
356 Evas_Event_Mouse_Down *e;
357
358 e = event_info;
359 evas_object_color_set(obj, 255, 50, 40, 200);
360 evas_object_raise(obj);
361}
362
363static void
364video_obj_up_cb(void *data, Evas *ev, Evas_Object *obj, void *event_info)
365{
366 Evas_Event_Mouse_Up *e;
367
368 e = event_info;
369 evas_object_color_set(obj, 255, 255, 255, 100);
370}
371
372static void
373video_obj_move_cb(void *data, Evas *ev, Evas_Object *obj, void *event_info)
374{
375 Evas_Event_Mouse_Move *e;
376
377 e = event_info;
378 if (e->buttons & 0x1)
379 {
380 Evas_Coord x, y;
381
382 evas_object_geometry_get(obj, &x, &y, NULL, NULL);
383 x += e->cur.canvas.x - e->prev.canvas.x;
384 y += e->cur.canvas.y - e->prev.canvas.y;
385 evas_object_move(obj, x, y);
386 }
387 else if (e->buttons & 0x4)
388 {
389 Evas_Coord w, h;
390
391 evas_object_geometry_get(obj, NULL, NULL, &w, &h);
392 w += e->cur.canvas.x - e->prev.canvas.x;
393 h += e->cur.canvas.y - e->prev.canvas.y;
394 evas_object_resize(obj, w, h);
395 }
396}
397
398static void
399video_obj_frame_decode_cb(void *data, Evas_Object *obj, void *event_info)
400{
401 Evas_Object *oe;
402 double pos, len;
403 char buf[256];
404 int ph, pm, ps, pf, lh, lm, ls;
405
406 oe = data;
407 pos = emotion_object_position_get(obj);
408 len = emotion_object_play_length_get(obj);
409// printf("%3.3f, %3.3f\n", pos, len);
410 edje_object_part_drag_value_set(oe, "video_progress", pos / len, 0.0);
411 lh = len / 3600;
412 lm = len / 60 - (lh * 60);
413 ls = len - (lm * 60);
414 ph = pos / 3600;
415 pm = pos / 60 - (ph * 60);
416 ps = pos - (pm * 60);
417 pf = pos * 100 - (ps * 100) - (pm * 60 * 100) - (ph * 60 * 60 * 100);
418 snprintf(buf, sizeof(buf), "%i:%02i:%02i.%02i / %i:%02i:%02i",
419 ph, pm, ps, pf, lh, lm, ls);
420 edje_object_part_text_set(oe, "video_progress_txt", buf);
421
422 if (0)
423 {
424 double t;
425 static double pt = 0.0;
426 t = ecore_time_get();
427 printf("FPS: %3.3f\n", 1.0 / (t - pt));
428 pt = t;
429 }
430}
431
432static void
433video_obj_frame_resize_cb(void *data, Evas_Object *obj, void *event_info)
434{
435 Evas_Object *oe;
436 int iw, ih;
437 Evas_Coord w, h;
438 double ratio;
439
440 oe = data;
441 emotion_object_size_get(obj, &iw, &ih);
442 ratio = emotion_object_ratio_get(obj);
443 printf("HANDLE %ix%i @ %3.3f\n", iw, ih, ratio);
444 if (ratio > 0.0) iw = ih * ratio;
445 edje_extern_object_min_size_set(obj, iw, ih);
446 edje_object_part_swallow(oe, "video_swallow", obj);
447 edje_object_size_min_calc(oe, &w, &h);
448 evas_object_resize(oe, w, h);
449 edje_extern_object_min_size_set(obj, 0, 0);
450 edje_object_part_swallow(oe, "video_swallow", obj);
451}
452
453static void
454video_obj_length_change_cb(void *data, Evas_Object *obj, void *event_info)
455{
456 Evas_Object *oe;
457 double pos, len;
458 char buf[256];
459 int ph, pm, ps, pf, lh, lm, ls;
460
461 oe = data;
462 pos = emotion_object_position_get(obj);
463 len = emotion_object_play_length_get(obj);
464 edje_object_part_drag_value_set(oe, "video_progress", pos / len, 0.0);
465 lh = len / 3600;
466 lm = len / 60 - (lh * 60);
467 ls = len - (lm * 60);
468 ph = pos / 3600;
469 pm = pos / 60 - (ph * 60);
470 ps = pos - (pm * 60);
471 pf = pos * 100 - (ps * 100) - (pm * 60 * 100) - (ph * 60 * 60 * 100);
472 snprintf(buf, sizeof(buf), "%i:%02i:%02i.%02i / %i:%02i:%02i",
473 ph, pm, ps, pf, lh, lm, ls);
474 edje_object_part_text_set(oe, "video_progress_txt", buf);
475}
476
477
478
479
480static void
481video_obj_signal_play_cb(void *data, Evas_Object *o, const char *emission, const char *source)
482{
483 Evas_Object *ov;
484
485 ov = data;
486 emotion_object_play_set(ov, 1);
487 edje_object_signal_emit(o, "video_state", "play");
488}
489
490static void
491video_obj_signal_pause_cb(void *data, Evas_Object *o, const char *emission, const char *source)
492{
493 Evas_Object *ov;
494
495 ov = data;
496 emotion_object_play_set(ov, 0);
497 edje_object_signal_emit(o, "video_state", "pause");
498}
499
500static void
501video_obj_signal_stop_cb(void *data, Evas_Object *o, const char *emission, const char *source)
502{
503 Evas_Object *ov;
504
505 ov = data;
506 emotion_object_play_set(ov, 0);
507 emotion_object_position_set(ov, 0);
508 edje_object_signal_emit(o, "video_state", "stop");
509}
510
511static void
512video_obj_signal_jump_cb(void *data, Evas_Object *o, const char *emission, const char *source)
513{
514 Evas_Object *ov;
515 double pos, len;
516 double x, y;
517
518 ov = data;
519 edje_object_part_drag_value_get(o, source, &x, &y);
520 len = emotion_object_play_length_get(ov);
521 emotion_object_position_set(ov, x * len);
522}
523
524static void
525video_obj_signal_speed_cb(void *data, Evas_Object *o, const char *emission, const char *source)
526{
527 Evas_Object *ov;
528 double spd;
529 double x, y;
530 char buf[256];
531
532 ov = data;
533 edje_object_part_drag_value_get(o, source, &x, &y);
534 spd = (y * 20.0) - 10.0;
535 emotion_object_play_speed_set(ov, spd);
536 snprintf(buf, sizeof(buf), "%1.1f", spd);
537 edje_object_part_text_set(o, "video_speed_txt", buf);
538}
539
540static void
541video_obj_signal_frame_move_start_cb(void *data, Evas_Object *o, const char *emission, const char *source)
542{
543 Frame_Data *fd;
544 Evas_Coord x, y;
545
546 fd = evas_object_data_get(o, "frame_data");
547 fd->moving = 1;
548 evas_pointer_canvas_xy_get(evas_object_evas_get(o), &x, &y);
549 fd->x = x;
550 fd->y = y;
551 evas_object_raise(o);
552}
553
554static void
555video_obj_signal_frame_move_stop_cb(void *data, Evas_Object *o, const char *emission, const char *source)
556{
557 Frame_Data *fd;
558
559 fd = evas_object_data_get(o, "frame_data");
560 fd->moving = 0;
561}
562
563static void
564video_obj_signal_frame_resize_start_cb(void *data, Evas_Object *o, const char *emission, const char *source)
565{
566 Frame_Data *fd;
567 Evas_Coord x, y;
568
569 fd = evas_object_data_get(o, "frame_data");
570 fd->resizing = 1;
571 evas_pointer_canvas_xy_get(evas_object_evas_get(o), &x, &y);
572 fd->x = x;
573 fd->y = y;
574 evas_object_raise(o);
575}
576
577static void
578video_obj_signal_frame_resize_stop_cb(void *data, Evas_Object *o, const char *emission, const char *source)
579{
580 Frame_Data *fd;
581
582 fd = evas_object_data_get(o, "frame_data");
583 fd->resizing = 0;
584}
585
586static void
587video_obj_signal_frame_move_cb(void *data, Evas_Object *o, const char *emission, const char *source)
588{
589 Frame_Data *fd;
590
591 fd = evas_object_data_get(o, "frame_data");
592 if (fd->moving)
593 {
594 Evas_Coord x, y, ox, oy;
595
596 evas_pointer_canvas_xy_get(evas_object_evas_get(o), &x, &y);
597 evas_object_geometry_get(o, &ox, &oy, NULL, NULL);
598 evas_object_move(o, ox + (x - fd->x), oy + (y - fd->y));
599 fd->x = x;
600 fd->y = y;
601 }
602 else if (fd->resizing)
603 {
604 Evas_Coord x, y, ow, oh;
605
606 evas_pointer_canvas_xy_get(evas_object_evas_get(o), &x, &y);
607 evas_object_geometry_get(o, NULL, NULL, &ow, &oh);
608 evas_object_resize(o, ow + (x - fd->x), oh + (y - fd->y));
609 fd->x = x;
610 fd->y = y;
611 }
612}
613
614
615static void
616init_video_object(char *file)
617{
618 Evas_Object *o, *oe;
619 int iw, ih;
620 Evas_Coord w, h;
621 Frame_Data *fd;
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636/* basic video object setup */
637 o = emotion_object_add(evas);
638 emotion_object_file_set(o, file);
639 emotion_object_play_set(o, 1);
640 evas_object_move(o, 0, 0);
641 evas_object_resize(o, 320, 240);
642 emotion_object_smooth_scale_set(o, 1);
643 evas_object_show(o);
644/* end basic video setup. all the rest here is just to be fancy */
645
646
647
648
649
650
651
652
653
654
655
656
657
658 video_objs = evas_list_append(video_objs, o);
659
660 emotion_object_size_get(o, &iw, &ih);
661 w = iw; h = ih;
662
663 fd = calloc(1, sizeof(Frame_Data));
664
665 oe = edje_object_add(evas);
666 evas_object_data_set(oe, "frame_data", fd);
667 edje_object_file_set(oe, PACKAGE_DATA_DIR"/data/theme.eet", "video_controller");
668 edje_extern_object_min_size_set(o, w, h);
669 edje_object_part_swallow(oe, "video_swallow", o);
670 edje_object_size_min_calc(oe, &w, &h);
671// evas_object_move(oe, rand() % (int)(startw - w), rand() % (int)(starth - h));
672 evas_object_move(oe, 0, 0);
673 evas_object_resize(oe, w, h);
674 edje_extern_object_min_size_set(o, 0, 0);
675 edje_object_part_swallow(oe, "video_swallow", o);
676
677 evas_object_smart_callback_add(o, "frame_decode", video_obj_frame_decode_cb, oe);
678 evas_object_smart_callback_add(o, "frame_resize", video_obj_frame_resize_cb, oe);
679 evas_object_smart_callback_add(o, "length_change", video_obj_length_change_cb, oe);
680
681 edje_object_signal_callback_add(oe, "video_control", "play", video_obj_signal_play_cb, o);
682 edje_object_signal_callback_add(oe, "video_control", "pause", video_obj_signal_pause_cb, o);
683 edje_object_signal_callback_add(oe, "video_control", "stop", video_obj_signal_stop_cb, o);
684 edje_object_signal_callback_add(oe, "drag", "video_progress", video_obj_signal_jump_cb, o);
685 edje_object_signal_callback_add(oe, "drag", "video_speed", video_obj_signal_speed_cb, o);
686
687 edje_object_signal_callback_add(oe, "frame_move", "start", video_obj_signal_frame_move_start_cb, oe);
688 edje_object_signal_callback_add(oe, "frame_move", "stop", video_obj_signal_frame_move_stop_cb, oe);
689 edje_object_signal_callback_add(oe, "frame_resize", "start", video_obj_signal_frame_resize_start_cb, oe);
690 edje_object_signal_callback_add(oe, "frame_resize", "stop", video_obj_signal_frame_resize_stop_cb, oe);
691 edje_object_signal_callback_add(oe, "mouse,move", "*", video_obj_signal_frame_move_cb, oe);
692
693 edje_object_part_drag_value_set(oe, "video_speed", 0.0, 11.0 / 20.0);
694 edje_object_part_text_set(oe, "video_speed_txt", "1.0");
695
696 edje_object_signal_emit(o, "video_state", "play");
697
698 evas_object_show(oe);
699}
700
701static int
702enter_idle(void *data)
703{
704 double t;
705 static double pt = 0.0;
706 static int frames = 0;
707
708 t = ecore_time_get();
709 if (frames == 0) pt = t;
710 frames++;
711 if (frames == 100)
712 {
713// printf("FPS: %3.3f\n", frames / (t - pt));
714 frames = 0;
715 }
716 return 1;
717}
718
719int
720main(int argc, char **argv)
721{
722 char *file;
723 int i;
724
725 if (main_start(argc, argv) < 1) return -1;
726 bg_setup();
727
728 for (i = 1; i < argc; i++)
729 {
730 if (((!strcmp(argv[i], "-g")) ||
731 (!strcmp(argv[i], "-geometry")) ||
732 (!strcmp(argv[i], "--geometry"))) && (i < (argc - 1)))
733 i++;
734 else if (((!strcmp(argv[i], "-h")) ||
735 (!strcmp(argv[i], "-help")) ||
736 (!strcmp(argv[i], "--help"))))
737 {
738 printf("Usage:\n");
739 printf(" %s [-gl] [-g WxH] \n", argv[0]);
740 exit(-1);
741 }
742 else if (!strcmp(argv[i], "-gl"))
743 {
744 }
745 else if (!strcmp(argv[i], "-fb"))
746 {
747 }
748 else
749 {
750 init_video_object(argv[i]);
751 }
752 }
753
754 ecore_idle_enterer_add(enter_idle, NULL);
755
756 ecore_main_loop_begin();
757 main_stop();
758 return 0;
759}
760