Enlightenment CVS committal
Author : moom16
Project : e17
Module : apps/eclair
Dir : e17/apps/eclair/src
Modified Files:
eclair.c eclair_callbacks.c eclair_callbacks.h eclair_utils.c
eclair_window.c
Log Message:
* Fix some resize problems by handling emotion "frame_resize" callback.
* Fix a bug with local cover that happened when trying to play an URL.
* Fix the way eclair_windows are deleted (do not call ecore_evas_free
since it seems to cause problems when pressing 'q' to quit). We now let
ecore delete the windows.
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/eclair/src/eclair.c,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -3 -r1.23 -r1.24
--- eclair.c 2 Jul 2005 13:04:55 -0000 1.23
+++ eclair.c 2 Jul 2005 23:25:45 -0000 1.24
@@ -348,8 +348,6 @@
//Play a new file
void eclair_play_file(Eclair *eclair, const char *path)
{
- int video_width, video_height;
-
if (!eclair)
return;
@@ -372,12 +370,7 @@
if (eclair->video_window)
{
if (emotion_object_video_handled_get(eclair->video_object))
- {
ecore_evas_show(eclair->video_window);
- emotion_object_size_get(eclair->video_object, &video_width,
&video_height);
- ecore_evas_resize(eclair->video_window, video_width, video_height);
- eclair_video_window_resize_cb(eclair->video_window);
- }
else
ecore_evas_hide(eclair->video_window);
}
@@ -667,6 +660,7 @@
evas_object_smart_callback_add(new_video_object, "frame_decode",
eclair_video_frame_decode_cb, eclair);
evas_object_smart_callback_add(new_video_object, "playback_finished",
eclair_video_playback_finished_cb, eclair);
evas_object_smart_callback_add(new_video_object, "audio_level_change",
eclair_video_audio_level_change_cb, eclair);
+ evas_object_smart_callback_add(new_video_object, "frame_resize",
eclair_video_frame_resize_change_cb, eclair);
eclair_audio_level_set(eclair,
emotion_object_audio_volume_get(new_video_object));
eclair->video_object = new_video_object;
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/eclair/src/eclair_callbacks.c,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -3 -r1.16 -r1.17
--- eclair_callbacks.c 10 Jun 2005 18:30:46 -0000 1.16
+++ eclair_callbacks.c 2 Jul 2005 23:25:45 -0000 1.17
@@ -56,7 +56,10 @@
eclair_play(eclair);
}
else if (strcmp(ev->key, "escape") == 0 || strcmp(ev->key, "q") == 0)
+ {
eclair_shutdown(eclair);
+ return;
+ }
else if (eclair->video_object && (strcmp(ev->key, "Left") == 0 ||
strcmp(ev->key, "Right") == 0 || strcmp(ev->key, "Down") == 0 ||
strcmp(ev->key, "Up") == 0 || strcmp(ev->key, "Prior") == 0 ||
@@ -138,6 +141,24 @@
edje_object_part_drag_value_set(eclair->gui_window->edje_object,
"volume_bar_drag", emotion_object_audio_volume_get(eclair->video_object), 0);
}
+//Called when the video has to be resized
+void eclair_video_frame_resize_change_cb(void *data, Evas_Object *obj, void
*event_info)
+{
+ Eclair *eclair;
+ int w, h;
+ double ratio;
+
+ if (!(eclair = data) || !eclair->video_window || !eclair->video_object)
+ return;
+
+ emotion_object_size_get(eclair->video_object, &w, &h);
+ ratio = emotion_object_ratio_get(eclair->video_object);
+ if (ratio > 0.0)
+ ecore_evas_resize(eclair->video_window, h * ratio, h);
+ else
+ ecore_evas_resize(eclair->video_window, w, h);
+}
+
//Called when the video window is resized:
//Resize the video object and the black background object
void eclair_video_window_resize_cb(Ecore_Evas *window)
@@ -154,8 +175,7 @@
if (eclair->video_object)
{
ratio = emotion_object_ratio_get(eclair->video_object);
- //TODO: emotion bug? ratio is sometimes 0?!
- if (ratio <= -0.01 || ratio >= 0.01)
+ if (ratio > 0.0)
{
if (window_width / ratio > window_height)
{
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/eclair/src/eclair_callbacks.h,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -3 -r1.8 -r1.9
--- eclair_callbacks.h 10 Jun 2005 18:30:46 -0000 1.8
+++ eclair_callbacks.h 2 Jul 2005 23:25:45 -0000 1.9
@@ -17,6 +17,7 @@
void eclair_video_frame_decode_cb(void *data, Evas_Object *obj, void
*event_info);
void eclair_video_playback_finished_cb(void *data, Evas_Object *obj, void
*event_info);
void eclair_video_audio_level_change_cb(void *data, Evas_Object *obj, void
*event_info);
+void eclair_video_frame_resize_change_cb(void *data, Evas_Object *obj, void
*event_info);
void eclair_open_cb(void *data, Evas_Object *edje_object, const char
*emission, const char *source);
void eclair_play_cb(void *data, Evas_Object *edje_object, const char
*emission, const char *source);
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/eclair/src/eclair_utils.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -3 -r1.8 -r1.9
--- eclair_utils.c 2 Jul 2005 13:04:55 -0000 1.8
+++ eclair_utils.c 2 Jul 2005 23:25:45 -0000 1.9
@@ -157,10 +157,9 @@
char *file;
char *result = NULL;
- if (!filename || !root_dir)
+ if (!filename || !root_dir || !(files = ecore_file_ls(root_dir)))
return NULL;
- files = ecore_file_ls(root_dir);
ecore_list_goto_first(files);
while ((file = ecore_list_next(files)))
{
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/eclair/src/eclair_window.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -3 -r1.1 -r1.2
--- eclair_window.c 10 Jun 2005 18:30:46 -0000 1.1
+++ eclair_window.c 2 Jul 2005 23:25:45 -0000 1.2
@@ -154,7 +154,6 @@
evas_object_del(window->draggies);
evas_object_del(window->edje_object);
- ecore_evas_free(window->ecore_window);
}
//Add the default callbacks to the window
-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
enlightenment-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs