summaryrefslogtreecommitdiffstats
path: root/meta-efl/recipes-efl
diff options
context:
space:
mode:
authorDenis 'GNUtoo' Carikli <GNUtoo@no-log.org>2012-09-09 15:59:12 +0200
committerMartin Jansa <Martin.Jansa@gmail.com>2012-09-11 12:26:03 +0200
commitfac9e9c8b523ae617f348a0a3c8a9e31f55a1c0d (patch)
tree281b235f8519318e976f1bc6301084371babedc1 /meta-efl/recipes-efl
parent469c1599ceef77295ee1729fe67689e39badffa2 (diff)
downloadmeta-openembedded-fac9e9c8b523ae617f348a0a3c8a9e31f55a1c0d.tar.gz
meta-efl: enjoy: fix scrolling
* [SHR bug #2058] http://www.shr-project.org/trac/ticket/2058 * [EFL bug #1477] http://trac.enlightenment.org/e/ticket/1477 Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@no-log.org> Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Diffstat (limited to 'meta-efl/recipes-efl')
-rw-r--r--meta-efl/recipes-efl/e17/enjoy/0001-always-use-position-as-percent-and-define-a-1-second.patch133
-rw-r--r--meta-efl/recipes-efl/e17/enjoy_svn.bb7
2 files changed, 139 insertions, 1 deletions
diff --git a/meta-efl/recipes-efl/e17/enjoy/0001-always-use-position-as-percent-and-define-a-1-second.patch b/meta-efl/recipes-efl/e17/enjoy/0001-always-use-position-as-percent-and-define-a-1-second.patch
new file mode 100644
index 000000000..45f02b730
--- /dev/null
+++ b/meta-efl/recipes-efl/e17/enjoy/0001-always-use-position-as-percent-and-define-a-1-second.patch
@@ -0,0 +1,133 @@
1From ac4c8a57e8a042acd4b8ff803d3d3574b0e7a7fb Mon Sep 17 00:00:00 2001
2From: Alban Browaeys <prahal@yahoo.com>
3Date: Wed, 5 Sep 2012 02:58:26 +0000
4Subject: [PATCH] always use position as percent and define a 1 seconds
5 tolerance.
6
7Fix "reverb" effect: ie loop between setting the slider to match
8the position and handling slider to position (seek).
9---
10 data/themes/default.edc | 8 +++-----
11 src/bin/win.c | 28 ++++++++++++++++++++++------
12 2 files changed, 25 insertions(+), 11 deletions(-)
13
14diff --git a/data/themes/default.edc b/data/themes/default.edc
15index 65efddf..27bb9e4 100644
16--- a/data/themes/default.edc
17+++ b/data/themes/default.edc
18@@ -186,7 +186,6 @@ collections {
19 group {
20 name: "nowplaying";
21 script {
22- public cur_length;
23 public mute;
24
25 public get_time_str(Float:time, time_str[6])
26@@ -201,16 +200,15 @@ collections {
27 new Float:position = getfarg(2);
28 new Float:length = getfarg(3);
29 if (length > 0)
30- external_param_set_float(PART:"progress.slider", "value", position / length * 100);
31+ external_param_set_float(PART:"progress.slider", "value", position * 100);
32 else
33 external_param_set_float(PART:"progress.slider", "value", 0);
34
35 new time_str[6];
36- get_time_str(position, time_str);
37+ get_time_str(position * length, time_str);
38 set_text(PART:"ejy.text.current_time", time_str);
39 get_time_str(length, time_str);
40 set_text(PART:"ejy.text.total_time", time_str);
41- set_float(cur_length, length);
42 } else if (type == MSG_INT && id == MSG_SHUFFLE) {
43 external_param_set_bool(PART:"buttons.shuffle", "state", getarg(2));
44 } else if (type == MSG_INT && id == MSG_LOOP) {
45@@ -687,7 +685,7 @@ collections {
46 source: "progress.slider";
47 signal: "changed";
48 script {
49- send_message(MSG_FLOAT, MSG_POSITION, (external_param_get_float(PART:"progress.slider", "value") * get_float(cur_length) / 100));
50+ send_message(MSG_FLOAT, MSG_POSITION, (external_param_get_float(PART:"progress.slider", "value") / 100));
51 }
52 }
53 program {
54diff --git a/src/bin/win.c b/src/bin/win.c
55index 63951db..ad93ab5 100644
56--- a/src/bin/win.c
57+++ b/src/bin/win.c
58@@ -194,8 +194,8 @@ _win_play_eval(Win *w)
59 {
60 Edje_Message_Float_Set *mf;
61
62- w->play.position = emotion_object_position_get(w->emotion);
63 w->play.length = emotion_object_play_length_get(w->emotion);
64+ w->play.position = emotion_object_position_get(w->emotion) / w->play.length;
65
66 if ((w->song) && (w->song->length != (int)w->play.length))
67 db_song_length_set(w->db, w->song, w->play.length);
68@@ -542,8 +542,14 @@ _win_edje_msg(void *data, Evas_Object *o __UNUSED__, Edje_Message_Type type, int
69 else
70 {
71 Edje_Message_Float *m = msg;
72+
73+ if ((((m->val - w->play.position) * w->play.length) < 1.0)
74+ && (((w->play.position - m->val) * w->play.length) < 1.0))
75+ return;
76+
77 w->play.position = m->val;
78- emotion_object_position_set(w->emotion, w->play.position);
79+ emotion_object_position_set(w->emotion, w->play.position
80+ * w->play.length);
81 ecore_event_add(ENJOY_EVENT_POSITION_CHANGE, NULL, NULL, NULL);
82 }
83 break;
84@@ -617,16 +623,21 @@ enjoy_control_seek(uint64_t position)
85 {
86 Win *w = &_win;
87 double seek_to;
88+ double new_pos = w->play.length / ((double)position / 1e6);
89
90 if (!w->db) return;
91- seek_to = w->play.position + w->play.length / ((double)position / 1e6);
92+
93+ if ((((new_pos - w->play.position) * w->play.length) < 1.0)
94+ && (((w->play.position - new_pos) * w->play.length) < 1.0)) return;
95+
96+ seek_to = w->play.position + new_pos;
97 if (seek_to <= 0.0)
98 seek_to = 0.0;
99 else if (seek_to >= 1.0)
100 seek_to = 1.0;
101
102 w->play.position = seek_to;
103- emotion_object_position_set(w->emotion, w->play.position);
104+ emotion_object_position_set(w->emotion, w->play.position * w->play.length);
105 ecore_event_add(ENJOY_EVENT_POSITION_CHANGE, NULL, NULL, NULL);
106 }
107
108@@ -692,15 +703,20 @@ EAPI void
109 enjoy_position_set(int32_t position)
110 {
111 Win *w = &_win;
112+ double new_pos = w->play.length / ((double)position / 1e6);
113
114 if (!w->db) return;
115- w->play.position = w->play.length / ((double)position / 1e6);
116+
117+ if ((((new_pos - w->play.position) * w->play.length) < 1.0)
118+ && (((w->play.position - new_pos) * w->play.length) < 1.0)) return;
119+
120+ w->play.position = new_pos;
121 if (w->play.position < 0.0)
122 w->play.position = 0.0;
123 else if (w->play.position > 1.0)
124 w->play.position = 1.0;
125
126- emotion_object_position_set(w->emotion, w->play.position);
127+ emotion_object_position_set(w->emotion, w->play.position * w->play.length);
128 ecore_event_add(ENJOY_EVENT_POSITION_CHANGE, NULL, NULL, NULL);
129 }
130
131--
1321.7.7
133
diff --git a/meta-efl/recipes-efl/e17/enjoy_svn.bb b/meta-efl/recipes-efl/e17/enjoy_svn.bb
index 06998cfb0..cfeb00188 100644
--- a/meta-efl/recipes-efl/e17/enjoy_svn.bb
+++ b/meta-efl/recipes-efl/e17/enjoy_svn.bb
@@ -21,9 +21,14 @@ RDEPENDS += "\
21 " 21 "
22 22
23inherit e gettext 23inherit e gettext
24SRC_URI = "${E_SVN}/trunk;module=${SRCNAME};protocol=http;scmdata=keep" 24SRC_URI = " \
25 ${E_SVN}/trunk;module=${SRCNAME};protocol=http;scmdata=keep \
26 file://0001-always-use-position-as-percent-and-define-a-1-second.patch \
27"
25S = "${WORKDIR}/${SRCNAME}" 28S = "${WORKDIR}/${SRCNAME}"
26 29
30PR = "r1"
31
27FILES_${PN} += "${datadir}/icons/" 32FILES_${PN} += "${datadir}/icons/"
28 33
29EXTRA_OECONF = "\ 34EXTRA_OECONF = "\