summaryrefslogtreecommitdiff
path: root/legacy/emotion/src/examples/emotion_generic_example.c
diff options
context:
space:
mode:
authorRafael Antognolli <antognolli@gmail.com>2012-03-23 19:42:38 +0000
committerRafael Antognolli <antognolli@gmail.com>2012-03-23 19:42:38 +0000
commita39a4f612e629509bcc457855bb769b53df4fe57 (patch)
tree536510e11a4faf87894b26a6ca023dae15f4ed75 /legacy/emotion/src/examples/emotion_generic_example.c
parent8e73b14577f737c918dd9a41fed7075220064123 (diff)
emotion/generic-vlc: Don't try to stop the player from event thread.
Must send the command through the pipe so the main thread can stop it. SVN revision: 69591
Diffstat (limited to '')
-rw-r--r--legacy/emotion/src/examples/emotion_generic_example.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/legacy/emotion/src/examples/emotion_generic_example.c b/legacy/emotion/src/examples/emotion_generic_example.c
index 8710c54747..53398c86d4 100644
--- a/legacy/emotion/src/examples/emotion_generic_example.c
+++ b/legacy/emotion/src/examples/emotion_generic_example.c
@@ -18,6 +18,13 @@ _playback_started_cb(void *data, Evas_Object *o, void *event_info)
18 printf("Emotion object started playback.\n"); 18 printf("Emotion object started playback.\n");
19} 19}
20 20
21static void
22_playback_stopped_cb(void *data, Evas_Object *o, void *event_info)
23{
24 emotion_object_play_set(o, EINA_FALSE);
25 emotion_object_position_set(o, 0);
26}
27
21static Evas_Object * 28static Evas_Object *
22_create_emotion_object(Evas *e) 29_create_emotion_object(Evas *e)
23{ 30{
@@ -27,6 +34,8 @@ _create_emotion_object(Evas *e)
27 34
28 evas_object_smart_callback_add( 35 evas_object_smart_callback_add(
29 em, "playback_started", _playback_started_cb, NULL); 36 em, "playback_started", _playback_started_cb, NULL);
37 evas_object_smart_callback_add(
38 em, "playback_stopped", _playback_stopped_cb, NULL);
30 39
31 return em; 40 return em;
32} 41}
@@ -57,8 +66,11 @@ _on_key_down(void *data, Evas *e, Evas_Object *o, void *event_info)
57 } 66 }
58 else if (!strcmp(ev->keyname, "s")) 67 else if (!strcmp(ev->keyname, "s"))
59 { 68 {
60 fprintf(stderr, "skipping to position 60\n"); 69 float len, pos;
61 emotion_object_position_set(em, 60); 70 len = emotion_object_play_length_get(em);
71 pos = 0.98 * len;
72 fprintf(stderr, "skipping to position %0.3f\n", pos);
73 emotion_object_position_set(em, pos);
62 } 74 }
63 else if (!strcmp(ev->keyname, "1")) 75 else if (!strcmp(ev->keyname, "1"))
64 { 76 {