Enlightenment CVS committal Author : raster Project : e17 Module : libs/emotion
Dir : e17/libs/emotion/src/lib Modified Files: Emotion.h emotion_private.h emotion_smart.c Log Message: support events coming from xine a lot better... still need to support title, artist etc. for mp3's and such... =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/emotion/src/lib/Emotion.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -3 -r1.2 -r1.3 --- Emotion.h 24 Jun 2004 06:11:32 -0000 1.2 +++ Emotion.h 24 Jun 2004 10:55:43 -0000 1.3 @@ -70,12 +70,12 @@ const char *emotion_object_video_channel_name_get(Evas_Object *obj, int channel); void emotion_object_video_channel_set (Evas_Object *obj, int channel); int emotion_object_video_channel_get (Evas_Object *obj); -void emotion_object_spu_mute_set (Evas_Object *obj, Evas_Bool mute); -Evas_Bool emotion_object_spu_mute_get (Evas_Object *obj); -int emotion_object_spu_channel_count (Evas_Object *obj); -const char *emotion_object_spu_channel_name_get(Evas_Object *obj, int channel); -void emotion_object_spu_channel_set (Evas_Object *obj, int channel); -int emotion_object_spu_channel_get (Evas_Object *obj); +void emotion_object_spu_mute_set (Evas_Object *obj, Evas_Bool mute); +Evas_Bool emotion_object_spu_mute_get (Evas_Object *obj); +int emotion_object_spu_channel_count (Evas_Object *obj); +const char *emotion_object_spu_channel_name_get (Evas_Object *obj, int channel); +void emotion_object_spu_channel_set (Evas_Object *obj, int channel); +int emotion_object_spu_channel_get (Evas_Object *obj); int emotion_object_chapter_count (Evas_Object *obj); void emotion_object_chapter_set (Evas_Object *obj, int chapter); int emotion_object_chapter_get (Evas_Object *obj); @@ -83,5 +83,12 @@ void emotion_object_play_speed_set (Evas_Object *obj, double speed); double emotion_object_play_speed_get (Evas_Object *obj); void emotion_object_eject (Evas_Object *obj); - +const char *emotion_object_title_get (Evas_Object *obj); +const char *emotion_object_progress_info_get (Evas_Object *obj); +double emotion_object_progress_status_get (Evas_Object *obj); +const char *emotion_object_ref_file_get (Evas_Object *obj); +int emotion_object_ref_num_get (Evas_Object *obj); +int emotion_object_spu_button_count_get (Evas_Object *obj); +int emotion_object_spu_button_get (Evas_Object *obj); + #endif =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/emotion/src/lib/emotion_private.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -3 -r1.1 -r1.2 --- emotion_private.h 18 Jun 2004 15:38:03 -0000 1.1 +++ emotion_private.h 24 Jun 2004 10:55:43 -0000 1.2 @@ -65,5 +65,12 @@ void _emotion_frame_new(Evas_Object *obj); void _emotion_video_pos_update(Evas_Object *obj, double pos, double len); void _emotion_frame_resize(Evas_Object *obj, int w, int h, double ratio); - +void _emotion_decode_stop(Evas_Object *obj); +void _emotion_channels_change(Evas_Object *obj); +void _emotion_title_set(Evas_Object *obj, char *title); +void _emotion_progress_set(Evas_Object *obj, char *info, double stat); +void _emotion_file_ref_set(Evas_Object *obj, char *file, int num); +void _emotion_spu_button_num_set(Evas_Object *obj, int num); +void _emotion_spu_button_set(Evas_Object *obj, int button); + #endif =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/emotion/src/lib/emotion_smart.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -3 -r1.2 -r1.3 --- emotion_smart.c 20 Jun 2004 03:20:31 -0000 1.2 +++ emotion_smart.c 24 Jun 2004 10:55:43 -0000 1.3 @@ -46,6 +46,20 @@ unsigned char play : 1; unsigned char seek : 1; + + char *title; + struct { + char *info; + double stat; + } progress; + struct { + char *file; + int num; + } ref; + struct { + int button_num; + int button; + } spu; }; static void _mouse_move(void *data, Evas *ev, Evas_Object *obj, void *event_info); @@ -135,7 +149,20 @@ if ((file) && (sd->file) && (!strcmp(file, sd->file))) return; if (sd->file) free(sd->file); sd->file = NULL; - + if (sd->title) free(sd->title); + sd->title = NULL; + if (sd->progress.info) free(sd->progress.info); + sd->progress.info = NULL; + sd->progress.stat = 0.0; + if (sd->ref.file) free(sd->ref.file); + sd->ref.file = NULL; + sd->ref.num = 0; + sd->spu.button_num = 0; + sd->spu.button = -1; + sd->ratio = 1.0; + sd->pos = 0; + sd->seek_pos = 0; + sd->len = 0; if (file) { int w, h; @@ -598,6 +625,70 @@ sd->module->eject(sd->video); } +const char * +emotion_object_title_get(Evas_Object *obj) +{ + Smart_Data *sd; + + E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, NULL); + return sd->title; +} + +const char * +emotion_object_progress_info_get(Evas_Object *obj) +{ + Smart_Data *sd; + + E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, NULL); + return sd->progress.info; +} + +double +emotion_object_progress_status_get(Evas_Object *obj) +{ + Smart_Data *sd; + + E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, 0.0); + return sd->progress.stat; +} + +const char * +emotion_object_ref_file_get(Evas_Object *obj) +{ + Smart_Data *sd; + + E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, NULL); + return sd->ref.file; +} + +int +emotion_object_ref_num_get(Evas_Object *obj) +{ + Smart_Data *sd; + + E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, 0); + return sd->ref.num; +} + +int +emotion_object_spu_button_count_get(Evas_Object *obj) +{ + Smart_Data *sd; + + E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, 0); + return sd->spu.button_num; +} + +int +emotion_object_spu_button_get(Evas_Object *obj) +{ + Smart_Data *sd; + + E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, 0); + return sd->spu.button; +} + + @@ -650,6 +741,8 @@ evas_object_image_size_get(sd->obj, &iw, &ih); if ((w != iw) || (h != ih)) { + if (h > 0) sd->ratio = (double)w / (double)h; + else sd->ratio = 1.0; evas_object_image_size_set(sd->obj, w, h); changed = 1; } @@ -661,6 +754,83 @@ if (changed) evas_object_smart_callback_call(obj, "frame_resize", NULL); } +void +_emotion_decode_stop(Evas_Object *obj) +{ + Smart_Data *sd; + + E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME); + if (sd->play) + { + sd->play = 0; + evas_object_smart_callback_call(obj, "decode_stop", NULL); + } +} + +void +_emotion_channels_change(Evas_Object *obj) +{ + Smart_Data *sd; + + E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME); + evas_object_smart_callback_call(obj, "channels_change", NULL); +} + +void +_emotion_title_set(Evas_Object *obj, char *title) +{ + Smart_Data *sd; + + E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME); + if (sd->title) free(sd->title); + sd->title = strdup(title); + evas_object_smart_callback_call(obj, "title_change", NULL); +} + +void +_emotion_progress_set(Evas_Object *obj, char *info, double stat) +{ + Smart_Data *sd; + + E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME); + if (sd->progress.info) free(sd->progress.info); + sd->progress.info = strdup(info); + sd->progress.stat = stat; + evas_object_smart_callback_call(obj, "progress_change", NULL); +} + +void +_emotion_file_ref_set(Evas_Object *obj, char *file, int num) +{ + Smart_Data *sd; + + E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME); + if (sd->ref.file) free(sd->ref.file); + sd->ref.file = strdup(file); + sd->ref.num = num; + evas_object_smart_callback_call(obj, "ref_change", NULL); +} + +void +_emotion_spu_button_num_set(Evas_Object *obj, int num) +{ + Smart_Data *sd; + + E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME); + sd->spu.button_num = num; + evas_object_smart_callback_call(obj, "button_num_change", NULL); +} + +void +_emotion_spu_button_set(Evas_Object *obj, int button) +{ + Smart_Data *sd; + + E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME); + sd->spu.button = button; + evas_object_smart_callback_call(obj, "button_change", NULL); +} + /****************************/ /* Internal object routines */ @@ -803,6 +973,7 @@ evas_object_image_pixels_get_callback_set(sd->obj, _pixels_get, sd); evas_object_smart_member_add(sd->obj, obj); sd->ratio = 1.0; + sd->spu.button = -1; evas_object_image_alpha_set(sd->obj, 0); evas_object_smart_data_set(obj, sd); } @@ -819,6 +990,8 @@ evas_object_del(sd->obj); if (sd->file) free(sd->file); if (sd->job) ecore_job_del(sd->job); + if (sd->progress.info) free(sd->progress.info); + if (sd->ref.file) free(sd->ref.file); free(sd); } ------------------------------------------------------- This SF.Net email sponsored by Black Hat Briefings & Training. Attend Black Hat Briefings & Training, Las Vegas July 24-29 - digital self defense, top technical experts, no vendor pitches, unmatched networking opportunities. Visit www.blackhat.com _______________________________________________ enlightenment-cvs mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs