static void _frame_resize_cb(void *data, Evas_Object *o, void *event_info) { int w, h; emotion_object_size_get(o, &w, &h); fprintf(stderr, "smartcb: frame_resize: %dx%d\n", w, h); }
static void _display_info(Evas_Object *o) { int w, h; printf("playing: %d\n", emotion_object_play_get(o)); printf("meta title: %s\n", emotion_object_meta_info_get(o, EMOTION_META_INFO_TRACK_TITLE)); printf("seek position: %0.3f\n", emotion_object_position_get(o)); printf("play length: %0.3f\n", emotion_object_play_length_get(o)); printf("is seekable: %d\n", emotion_object_seekable_get(o)); emotion_object_size_get(o, &w, &h); printf("video geometry: %dx%d\n", w, h); printf("video width / height ratio: %0.3f\n", emotion_object_ratio_get(o)); printf("\n"); }
static void dvb_resize(void) { Evas_Coord w, h; int iw, ih; double ratio; emotion_object_size_get(o_dvb, &iw, &ih); if ((iw == 0) || (ih == 0)) return; ratio = emotion_object_ratio_get(o_dvb); if (ratio > 0.0) iw = (ih * ratio) + 0.5; else ratio = (double)iw / (double)ih; w = 10240 * ratio; h = 10240; // fit so there is no blank space // edje_extern_object_aspect_set(o_dvb, EDJE_ASPECT_CONTROL_NEITHER, w, h); // fit and pad with blank edje_extern_object_aspect_set(o_dvb, EDJE_ASPECT_CONTROL_BOTH, w, h); edje_object_part_swallow(o_dvb_bg, "video", o_dvb); }
static void _on_key_down(void *data, Evas *e, Evas_Object *o, void *event_info) { Evas_Event_Key_Down *ev = event_info; Evas_Object *em = data; if (!strcmp(ev->keyname, "Return")) { emotion_object_play_set(em, EINA_TRUE); } else if (!strcmp(ev->keyname, "space")) { emotion_object_play_set(em, EINA_FALSE); } else if (!strcmp(ev->keyname, "Escape")) { ecore_main_loop_quit(); } else if (!strcmp(ev->keyname, "t")) { int w, h; emotion_object_size_get(em, &w, &h); fprintf(stderr, "example -> size: %dx%d\n", w, h); } else if (!strcmp(ev->keyname, "s")) { float len, pos; len = emotion_object_play_length_get(em); pos = 0.98 * len; fprintf(stderr, "skipping to position %0.3f\n", pos); emotion_object_position_set(em, pos); } else if (!strcmp(ev->keyname, "1")) { fprintf(stderr, "setting speed to 1.0\n"); emotion_object_play_speed_set(em, 1.0); } else if (!strcmp(ev->keyname, "2")) { fprintf(stderr, "setting speed to 2.0\n"); emotion_object_play_speed_set(em, 2.0); } else if (!strcmp(ev->keyname, "n")) { const char *file; if (!curfile) curfile = filenames; else curfile = eina_list_next(curfile); file = eina_list_data_get(curfile); fprintf(stderr, "playing next file: %s\n", file); emotion_object_file_set(em, file); } else if (!strcmp(ev->keyname, "p")) { const char *file; if (!curfile) curfile = eina_list_last(filenames); else curfile = eina_list_prev(curfile); file = eina_list_data_get(curfile); fprintf(stderr, "playing next file: %s\n", file); emotion_object_file_set(em, file); } else if (!strcmp(ev->keyname, "d")) { evas_object_del(em); } else if (!strcmp(ev->keyname, "l")) { // force frame dropping sleep(5); } else { fprintf(stderr, "unhandled key: %s\n", ev->keyname); } }