summaryrefslogtreecommitdiff
path: root/legacy/emotion/src/lib/emotion_smart.c
diff options
context:
space:
mode:
authorCedric BAIL <cedric.bail@free.fr>2011-07-01 08:57:54 +0000
committerCedric BAIL <cedric.bail@free.fr>2011-07-01 08:57:54 +0000
commit8578459813359aa760fae80ae4dafed3035b1fd8 (patch)
tree890cc68ece9a9a67d658071359a2923b9664edf8 /legacy/emotion/src/lib/emotion_smart.c
parent4d9ad50d67dc968eef808d4aabda2464d2fb9c93 (diff)
emotion: add empty infrastructure for suspending the pipeline.
SVN revision: 60909
Diffstat (limited to '')
-rw-r--r--legacy/emotion/src/lib/emotion_smart.c66
1 files changed, 52 insertions, 14 deletions
diff --git a/legacy/emotion/src/lib/emotion_smart.c b/legacy/emotion/src/lib/emotion_smart.c
index a4a2fb9ea9..648c0116af 100644
--- a/legacy/emotion/src/lib/emotion_smart.c
+++ b/legacy/emotion/src/lib/emotion_smart.c
@@ -55,18 +55,18 @@ struct _Smart_Data
55 55
56 const char *file; 56 const char *file;
57 Evas_Object *obj; 57 Evas_Object *obj;
58 double ratio;
59 double pos;
60 double seek_pos;
61 double len;
62 58
63 Ecore_Job *job; 59 Ecore_Job *job;
64 60
65 unsigned char play : 1;
66 unsigned char seek : 1;
67 unsigned char seeking : 1;
68
69 char *title; 61 char *title;
62
63#ifdef HAVE_EIO
64 Eio_File *load_xattr;
65 Eio_File *save_xattr;
66
67 const char *time_seek;
68#endif
69
70 struct { 70 struct {
71 char *info; 71 char *info;
72 double stat; 72 double stat;
@@ -80,14 +80,18 @@ struct _Smart_Data
80 int button; 80 int button;
81 } spu; 81 } spu;
82 82
83#ifdef HAVE_EIO 83 double ratio;
84 Eio_File *load_xattr; 84 double pos;
85 Eio_File *save_xattr; 85 double seek_pos;
86 86 double len;
87 const char *time_seek;
88#endif
89 87
90 Emotion_Module_Options module_options; 88 Emotion_Module_Options module_options;
89
90 Emotion_Suspend state;
91
92 Eina_Bool play : 1;
93 Eina_Bool seek : 1;
94 Eina_Bool seeking : 1;
91}; 95};
92 96
93static void _mouse_move(void *data, Evas *ev, Evas_Object *obj, void *event_info); 97static void _mouse_move(void *data, Evas *ev, Evas_Object *obj, void *event_info);
@@ -424,6 +428,7 @@ emotion_object_play_set(Evas_Object *obj, Eina_Bool play)
424 if (!sd->module) return; 428 if (!sd->module) return;
425 if (!sd->video) return; 429 if (!sd->video) return;
426 sd->play = play; 430 sd->play = play;
431 if (sd->state != EMOTION_WAKEUP) emotion_object_suspend_set(obj, EMOTION_WAKEUP);
427 if (sd->play) sd->module->play(sd->video, sd->pos); 432 if (sd->play) sd->module->play(sd->video, sd->pos);
428 else sd->module->stop(sd->video); 433 else sd->module->stop(sd->video);
429} 434}
@@ -1214,6 +1219,38 @@ emotion_object_extension_may_play_get(const char *file)
1214 return result; 1219 return result;
1215} 1220}
1216 1221
1222EAPI void
1223emotion_object_suspend_set(Evas_Object *obj, Emotion_Suspend state)
1224{
1225 Smart_Data *sd;
1226
1227 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME);
1228 switch (state)
1229 {
1230 case EMOTION_WAKEUP:
1231 /* Restore the rendering pipeline, offset and everything back to play again (this will be called automatically by play_set) */
1232 case EMOTION_SLEEP:
1233 /* This destroy some part of the rendering pipeline */
1234 case EMOTION_DEEP_SLEEP:
1235 /* This destroy all the rendering pipeline and just keep the last rendered image (fullscreen) */
1236 case EMOTION_HIBERNATE:
1237 /* This destroy all the rendering pipeline and keep 1/4 of the last rendered image */
1238 default:
1239 break;
1240 }
1241
1242 sd->state = state;
1243}
1244
1245EAPI Emotion_Suspend
1246motion_object_suspend_get(Evas_Object *obj)
1247{
1248 Smart_Data *sd;
1249
1250 E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, EMOTION_WAKEUP);
1251 return sd->state;
1252}
1253
1217/*****************************/ 1254/*****************************/
1218/* Utility calls for modules */ 1255/* Utility calls for modules */
1219/*****************************/ 1256/*****************************/
@@ -1748,6 +1785,7 @@ _smart_add(Evas_Object * obj)
1748 sd = calloc(1, sizeof(Smart_Data)); 1785 sd = calloc(1, sizeof(Smart_Data));
1749 if (!sd) return; 1786 if (!sd) return;
1750 EINA_REFCOUNT_INIT(sd); 1787 EINA_REFCOUNT_INIT(sd);
1788 sd->state = EMOTION_WAKEUP;
1751 sd->obj = evas_object_image_add(evas_object_evas_get(obj)); 1789 sd->obj = evas_object_image_add(evas_object_evas_get(obj));
1752 evas_object_event_callback_add(sd->obj, EVAS_CALLBACK_MOUSE_MOVE, _mouse_move, sd); 1790 evas_object_event_callback_add(sd->obj, EVAS_CALLBACK_MOUSE_MOVE, _mouse_move, sd);
1753 evas_object_event_callback_add(sd->obj, EVAS_CALLBACK_MOUSE_DOWN, _mouse_down, sd); 1791 evas_object_event_callback_add(sd->obj, EVAS_CALLBACK_MOUSE_DOWN, _mouse_down, sd);