Enlightenment CVS committal

Author  : dj2
Project : e17
Module  : libs/ewl

Dir     : e17/libs/ewl/src/bin/tests


Modified Files:
        ewl_media.c 


Log Message:
- fix the media test so you can open files correctly
- Note, there is something wrong with the layering in the media object at
  the moment. if you play a video you can hear the audio, but the video
  dosen't appear.

===================================================================
RCS file: /cvs/e/e17/libs/ewl/src/bin/tests/ewl_media.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -3 -r1.3 -r1.4
--- ewl_media.c 22 May 2006 18:09:00 -0000      1.3
+++ ewl_media.c 28 May 2006 01:32:17 -0000      1.4
@@ -4,6 +4,10 @@
 #include <stdlib.h>
 #include <string.h>
 
+#ifndef PATH_MAX
+#define PATH_MAX 1024
+#endif
+
 static Ewl_Widget *video, *seeker, *fd_win;
 static Ewl_Media_Module_Type module_type;
 
@@ -43,7 +47,7 @@
 create_test(Ewl_Container *box)
 {
        Ewl_Widget *o, *o2;
-#if 0
+
        if (!ewl_media_is_available())
        {
                o = ewl_label_new();
@@ -56,7 +60,7 @@
 
                return 1;
        }
-#endif
+
        o = ewl_radiobutton_new();
        ewl_button_label_set(EWL_BUTTON(o), "Gstreamer");
        ewl_radiobutton_checked_set(EWL_RADIOBUTTON(o), FALSE);
@@ -188,29 +192,35 @@
 open_file_cb(Ewl_Widget *w, void *event, void *data __UNUSED__)
 {
        Ewl_Dialog_Event *e;
-       char *file = NULL;
 
        ewl_widget_hide(fd_win);
 
        e = event;
-       if (e->response == EWL_STOCK_OPEN)
+       if (e->response == EWL_STOCK_OK)
+       {
+               char *file = NULL;
+               char buf[PATH_MAX];
+
                file = ewl_filedialog_selected_file_get(EWL_FILEDIALOG(w));
+               snprintf(buf, PATH_MAX, "%s/%s", 
+                               ewl_filedialog_directory_get(EWL_FILEDIALOG(w)),
+                               file);
 
-       if (file) 
-               ewl_media_media_set(EWL_MEDIA(video), file);
+               ewl_media_media_set(EWL_MEDIA(video), buf);
+               IF_FREE(file);
+       }
 }
 
 static void
 open_cb(Ewl_Widget *w __UNUSED__, void *event __UNUSED__,
                                        void *data __UNUSED__)
 {
-       if (fd_win) {
-               ewl_widget_show(fd_win);
-               return;
+       if (!fd_win) 
+       {
+               fd_win = ewl_filedialog_new();
+               ewl_callback_append(fd_win, EWL_CALLBACK_VALUE_CHANGED, 
open_file_cb, NULL);
        }
 
-       fd_win = ewl_filedialog_new();
-       ewl_callback_append(fd_win, EWL_CALLBACK_VALUE_CHANGED, open_file_cb, 
NULL);
        ewl_widget_show(fd_win);
 }
 
@@ -234,7 +244,6 @@
 {
        Ewl_Widget *win, *o = NULL, *b = NULL;
        Ewl_Widget *controls = NULL, *time = NULL;
-       char * file = NULL;
 
        win = ewl_window_new();
        ewl_window_title_set(EWL_WINDOW(win), "EWL Media test");
@@ -260,7 +269,6 @@
        video = ewl_media_new();
        ewl_container_child_append(EWL_CONTAINER(b), video);
        ewl_media_module_set(EWL_MEDIA(video), type);
-       ewl_media_media_set(EWL_MEDIA(video), file);
        ewl_object_fill_policy_set(EWL_OBJECT(video), EWL_FLAG_FILL_ALL);
        ewl_callback_append(video, EWL_CALLBACK_REALIZE, video_realize_cb, 
NULL);
        ewl_callback_append(video, EWL_CALLBACK_VALUE_CHANGED, video_change_cb, 
time);




-------------------------------------------------------
All the advantages of Linux Managed Hosting--Without the Cost and Risk!
Fully trained technicians. The highest number of Red Hat certifications in
the hosting industry. Fanatical Support. Click to learn more
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=107521&bid=248729&dat=121642
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to