Hello,
i have two problem :

i have make a programme who start a video with emotion on elementary 
windows.
the goal is change the video when cliked the butons on the program.
The problem he is on my function played :

First my evas callback on my object button :
============================================
...
   evas_object_smart_callback_add(bt, "clicked", played, obj);
...
=============================================
with this line i says when "clicked" on object "bt" i action the 
function "played" on object "obj".

so on my function played :
=============================================
static void
played(void *data, Evas_Object *obj, void *event_info) {

     Evas_Object * ov = data;

     printf("hello\n");

     if (!emotion_object_file_set(ov, "video2.flv")) {
         printf("Chargement de la video Fail\n");
     }


     printf("played %s\n", emotion_object_file_get(ov));

}
=============================================
on this function i create a new object "ov" who i copy the object "data"
and i says play new video on the object "ob", but at this time i segfault
i have make a bt with gdb :

=============================================
#0  __memset_sse2 () at ../sysdeps/i386/i686/multiarch/memset-sse2.S:365
#1  0x00484eb6 in _emotion_image_data_zero (img=0x80cab28) at 
/usr/include/bits/string3.h:86
#2  0x00485bdc in emotion_object_file_set (obj=0x80caa20, file=0x80494b1 
"video2.flv") at emotion_smart.c:340
#3  0x08048eaa in played (data=0x80caa20, obj=0x80cac30, event_info=0x0) 
at main.c:46
#4  0x002700d6 in evas_object_smart_callback_call (obj=0x80cac30, 
event=0x1f2338 "clicked", event_info=0x0) at evas_object_smart.c:523
#5  0x0016949e in _activate (obj=0x80cac30) at elm_button.c:220
#6  0x005b4d81 in edje_match_callback_exec_check_finals 
(ppat_signal=0x8146330, ppat_source=0x813f3a0, signal=0x814f320 
"elm,action,click", source=0x47df10 "", callbacks=0x816d7c0, 
ed=0x8119bd0) at edje_match.c:472
#7  edje_match_callback_exec (ppat_signal=0x8146330, 
ppat_source=0x813f3a0, signal=0x814f320 "elm,action,click", 
source=0x47df10 "", callbacks=0x816d7c0, ed=0x8119bd0) at edje_match.c:624
#8  0x005ba359 in _edje_emit_cb (ed=0x8119bd0, sig=0x814f320 
"elm,action,click", src=0x47df10 "") at edje_program.c:1309
#9  _edje_emit_handle (ed=0x8119bd0, sig=0x814f320 "elm,action,click", 
src=0x47df10 "") at edje_program.c:1272
#10 0x005b588a in _edje_message_process (em=0xae60de60) at 
edje_message_queue.c:707
#11 0x005b620f in _edje_message_queue_process () at edje_message_queue.c:813
#12 0x005b63d4 in _edje_job (data=0x0) at edje_message_queue.c:230
#13 0x00221222 in _ecore_job_event_handler (data=0x0, type=11, 
ev=0xae601ad0) at ecore_job.c:119
#14 0x0021d979 in _ecore_event_call () at ecore_events.c:641
#15 0x00222d27 in _ecore_main_loop_iterate_internal (once_only=0) at 
ecore_main.c:1529
#16 0x00222fa7 in ecore_main_loop_begin () at ecore_main.c:680
#17 0x00155337 in elm_run () at elm_main.c:985
#18 0x08049155 in elm_main (argc=1, argv=0xbffff1b4) at main.c:112
#19 0x0804918e in main (argc=1, argv=0xbffff1b4) at main.c:118

=============================================

and other think, in the main i can't use :

   elm_box_pack_end (bx,obj);
   elm_box_pack_start (bx,obj);

on my "obj" object because  he is an emotion object
he have no effect on the object when i use it, ?

if someone can explain me where is the the problem, please ?

THanks and long life to EFL


///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
My complete example program who show emotion video on elementary program :
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/**
  * \file main.c
  * \brief Programme de tests.
  * \author YChoucha
  * \version 0.2
  * \date 14 août 2010
  *
  * Programme qui affhiche des videos avec emotion
  *
  */

#include <Elementary.h>
#include <Emotion.h>
#include "lectureFichier.h"

/**
  * \fn win_del(void *data, Evas_Object *obj, void *event_info)
  * \brief Fonction qui permet de fermer le programme en appuynat sur la 
croix de la fenetre
  *
  * \param data Chaîne à stocker dans l'objet Str_t, ne peut être NULL.
  *           *obj
  *         event_info
  */
static void
win_del(void *data, Evas_Object *obj, void *event_info) {
     elm_exit();
}

static void
paused(void *data, Evas_Object *obj, void *event_info) {
     Evas_Object *ov = data;
     emotion_object_play_set(ov, 0);
     emotion_object_position_set(ov, 0);

     printf("paused %s\n", emotion_object_file_get(ov));

}

static void
played(void *data, Evas_Object *obj, void *event_info) {

     Evas_Object * ov = data;

     printf("hello\n");

     if (!emotion_object_file_set(ov, "video2.flv")) {
         printf("Chargement de la video Fail\n");
     }


     printf("played %s\n", emotion_object_file_get(ov));

}

EAPI int
elm_main(int argc, char **argv) {

     Evas_Object *win, *bg, *bx, *obj, *bt;


     //création d'une fenetre de taille 320 x 300
     win = elm_win_add(NULL, "E-Info Memoire", ELM_WIN_BASIC);
     elm_win_title_set(win, "E-Info Memoire");
     evas_object_smart_callback_add(win, "delete,request", win_del, NULL);

     bg = elm_bg_add(win);
     evas_object_size_hint_weight_set(bg, 1.0, 1.0);
     elm_win_resize_object_add(win, bg);
     evas_object_show(bg);

     bx = elm_box_add(win);
     elm_win_resize_object_add(win, bx);
     evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, 
EVAS_HINT_EXPAND);
     evas_object_show(bx);

     evas_object_resize(win, 480, 800);

     //On créer l'objet video
     obj = emotion_object_add(evas_object_evas_get(win));
     if (!emotion_object_init(obj, "xine"))
         printf("emotion_object_init Fail\n");
     emotion_object_vis_set(obj, EMOTION_VIS_NONE);
     if (!emotion_object_file_set(obj, "video1.flv")) {
         printf("Chargement de la video Fail\n");
     }
     emotion_object_play_set(obj, 1);
     evas_object_move(obj, 0, 0);
     evas_object_resize(obj, 320, 240);
     emotion_object_smooth_scale_set(obj, 1);


     // imposible de positionner l'obj video dans elementary
     //elm_box_pack_end (bx,obj);
     //elm_box_pack_start (bx,obj);
     evas_object_show(obj);

     //on ajoute un bouton qui change la video
     bt = elm_button_add(win);
     elm_button_label_set(bt, "Change video");
     elm_box_pack_end(bx, bt);
     elm_button_autorepeat_set(bt, 1);
     elm_button_autorepeat_initial_timeout_set(bt, 2.0);
     elm_button_autorepeat_gap_timeout_set(bt, 0.5);
     evas_object_show(bt);

     evas_object_smart_callback_add(bt, "clicked", played, obj);


     //on affiche a l'écran notre programme
     evas_object_show(win);

     elm_run();

     elm_shutdown();

     return 0;
}
ELM_MAIN()





///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

------------------------------------------------------------------------------
Free Software Download: Index, Search & Analyze Logs and other IT data in 
Real-Time with Splunk. Collect, index and harness all the fast moving IT data 
generated by your applications, servers and devices whether physical, virtual
or in the cloud. Deliver compliance at lower cost and gain new business 
insights. http://p.sf.net/sfu/splunk-dev2dev 
_______________________________________________
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to