Enlightenment CVS committal Author : moom16 Project : e17 Module : libs/emotion
Dir : e17/libs/emotion/src/lib Modified Files: Emotion.h emotion_smart.c Log Message: * We can now initialize the module without having to play a file (we can now initialize the emotion module on the start of the application and so speed up the first play) =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/emotion/src/lib/Emotion.h,v retrieving revision 1.5 retrieving revision 1.6 diff -u -3 -r1.5 -r1.6 --- Emotion.h 24 Apr 2005 14:42:49 -0000 1.5 +++ Emotion.h 4 May 2005 21:32:37 -0000 1.6 @@ -55,6 +55,7 @@ /* api calls available */ Evas_Object *emotion_object_add (Evas *evas); +Evas_Bool emotion_object_init (Evas_Object *obj); void emotion_object_file_set (Evas_Object *obj, const char *file); const char *emotion_object_file_get (Evas_Object *obj); void emotion_object_play_set (Evas_Object *obj, Evas_Bool play); =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/emotion/src/lib/emotion_smart.c,v retrieving revision 1.10 retrieving revision 1.11 diff -u -3 -r1.10 -r1.11 --- emotion_smart.c 24 Apr 2005 14:42:49 -0000 1.10 +++ emotion_smart.c 4 May 2005 21:32:37 -0000 1.11 @@ -136,14 +136,13 @@ return evas_object_smart_add(evas, smart); } -void -emotion_object_file_set(Evas_Object *obj, const char *file) +Evas_Bool +emotion_object_init(Evas_Object *obj) { Smart_Data *sd; E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME); - - if ((file) && (sd->file) && (!strcmp(file, sd->file))) return; + if (sd->file) free(sd->file); sd->file = NULL; if (sd->title) free(sd->title); @@ -160,21 +159,37 @@ sd->pos = 0; sd->seek_pos = 0; sd->len = 0; + + if (!sd->module || !sd->video) + { + if (!_emotion_module_open("emotion_decoder_xine.so", obj, &sd->module, &sd->video)) + return 0; + } + + return 1; +} + +void +emotion_object_file_set(Evas_Object *obj, const char *file) +{ + Smart_Data *sd; + + E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME); + + if ((file) && (sd->file) && (!strcmp(file, sd->file))) return; + if ((file) && (strlen(file) > 0)) { int w, h; + if (!emotion_object_init(obj)) + return; sd->file = strdup(file); if (sd->module) { sd->module->file_close(sd->video); evas_object_image_size_set(sd->obj, 0, 0); } - if (!sd->module || !sd->video) - { - if (!_emotion_module_open("emotion_decoder_xine.so", obj, &sd->module, &sd->video)) - return; - } if (!sd->module->file_open(sd->file, obj, sd->video)) return; sd->module->size_get(sd->video, &w, &h); @@ -185,7 +200,7 @@ } else { - if (sd->video) + if (sd->video && sd->module) { sd->module->file_close(sd->video); sd->video = NULL; ------------------------------------------------------- This SF.Net email is sponsored by: NEC IT Guy Games. Get your fingers limbered up and give it your best shot. 4 great events, 4 opportunities to win big! Highest score wins.NEC IT Guy Games. Play to win an NEC 61 plasma display. Visit http://www.necitguy.com/?r=20 _______________________________________________ enlightenment-cvs mailing list enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs