summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichaƫl Bouchaud (yoz) <yoz@efl.so>2016-10-31 14:36:23 +0100
committerMichael Bouchaud <michael.bouchaud@ext.actia.fr>2017-02-22 22:59:13 +0100
commitfba185798cf75eaeaba4a95d2be25fb2fea6ef1a (patch)
tree9187dba317d18f5094bffea8372f562eb26c8244
parentdbdf411b488fd4d3f37a26d8cb142b25aba784d6 (diff)
Revert "mixer: do not set back the value from emix once the drag is finished"
This reverts commit 8724313b8e4c9799c5d20b876d5aaa9e5341d519.
-rw-r--r--src/modules/mixer/e_mod_main.c11
-rw-r--r--src/modules/mixer/emixer.c13
2 files changed, 24 insertions, 0 deletions
diff --git a/src/modules/mixer/e_mod_main.c b/src/modules/mixer/e_mod_main.c
index 42fc20b4a..d10bfb6af 100644
--- a/src/modules/mixer/e_mod_main.c
+++ b/src/modules/mixer/e_mod_main.c
@@ -481,6 +481,16 @@ _slider_changed_cb(void *data EINA_UNUSED, Evas_Object *obj,
481} 481}
482 482
483static void 483static void
484_slider_drag_stop_cb(void *data EINA_UNUSED, Evas_Object *obj,
485 void *event EINA_UNUSED)
486{
487 EINA_SAFETY_ON_NULL_RETURN(mixer_context->sink_default);
488 Emix_Sink *s = (Emix_Sink *)mixer_context->sink_default;
489 int val = s->volume.volumes[0];
490 elm_slider_value_set(obj, val);
491}
492
493static void
484_sink_selected_cb(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED) 494_sink_selected_cb(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
485{ 495{
486 Emix_Sink *s = data; 496 Emix_Sink *s = data;
@@ -544,6 +554,7 @@ _popup_new(Instance *inst)
544 evas_object_show(slider); 554 evas_object_show(slider);
545 elm_slider_min_max_set(slider, 0.0, emix_max_volume_get()); 555 elm_slider_min_max_set(slider, 0.0, emix_max_volume_get());
546 evas_object_smart_callback_add(slider, "changed", _slider_changed_cb, NULL); 556 evas_object_smart_callback_add(slider, "changed", _slider_changed_cb, NULL);
557 evas_object_smart_callback_add(slider, "slider,drag,stop", _slider_drag_stop_cb, NULL);
547 elm_slider_value_set(slider, volume); 558 elm_slider_value_set(slider, volume);
548 elm_box_pack_end(bx, slider); 559 elm_box_pack_end(bx, slider);
549 evas_object_show(slider); 560 evas_object_show(slider);
diff --git a/src/modules/mixer/emixer.c b/src/modules/mixer/emixer.c
index 1bcd96c1f..5cde88127 100644
--- a/src/modules/mixer/emixer.c
+++ b/src/modules/mixer/emixer.c
@@ -49,6 +49,17 @@ _cb_sink_volume_change(void *data,
49} 49}
50 50
51static void 51static void
52_cb_sink_volume_drag_stop(void *data,
53 Evas_Object *obj,
54 void *event EINA_UNUSED)
55{
56 Evas_Object *bxv = data;
57 Emix_Sink *sink = evas_object_data_get(bxv, "sink");
58 int vol = sink->volume.volumes[0];
59 elm_slider_value_set(obj, vol);
60}
61
62static void
52_cb_sink_mute_change(void *data, 63_cb_sink_mute_change(void *data,
53 Evas_Object *obj, 64 Evas_Object *obj,
54 void *event_info EINA_UNUSED) 65 void *event_info EINA_UNUSED)
@@ -123,6 +134,8 @@ _emix_sink_add(Emix_Sink *sink)
123 elm_box_pack_end(bx, sl); 134 elm_box_pack_end(bx, sl);
124 evas_object_show(sl); 135 evas_object_show(sl);
125 evas_object_smart_callback_add(sl, "changed", _cb_sink_volume_change, bxv); 136 evas_object_smart_callback_add(sl, "changed", _cb_sink_volume_change, bxv);
137 evas_object_smart_callback_add(sl, "slider,drag,stop",
138 _cb_sink_volume_drag_stop, bxv);
126 139
127 ck = elm_check_add(win); 140 ck = elm_check_add(win);
128 evas_object_data_set(bxv, "mute", ck); 141 evas_object_data_set(bxv, "mute", ck);