summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Bouchaud <michael.bouchaud@ext.actia.fr>2017-02-23 00:36:17 +0100
committerMichael Bouchaud <michael.bouchaud@ext.actia.fr>2017-02-23 00:36:17 +0100
commitcb6ea9f747be869612fe7915f5380d9300cc5d83 (patch)
treefa0677dcc18bdbb0c82dcce1a80c860d129bc908
parentfba185798cf75eaeaba4a95d2be25fb2fea6ef1a (diff)
e_client_volume: check volume setted after a slider drag
-rw-r--r--src/bin/e_client_volume.c15
-rw-r--r--src/modules/mixer/e_mod_main.c33
2 files changed, 48 insertions, 0 deletions
diff --git a/src/bin/e_client_volume.c b/src/bin/e_client_volume.c
index 3c417656b..187da949d 100644
--- a/src/bin/e_client_volume.c
+++ b/src/bin/e_client_volume.c
@@ -11,6 +11,7 @@ static void _e_client_volume_event_simple_free(void *d, E_Event_Client *ev);
11static void _e_client_volume_event_simple(E_Client *ec, int type); 11static void _e_client_volume_event_simple(E_Client *ec, int type);
12static void _e_client_volume_object_mouse_down_cb(void *data, Evas *e, Evas_Object *obj, void *event_info); 12static void _e_client_volume_object_mouse_down_cb(void *data, Evas *e, Evas_Object *obj, void *event_info);
13static void _e_client_volume_object_volume_changed(void *data, Evas_Object *obj, void *event_info); 13static void _e_client_volume_object_volume_changed(void *data, Evas_Object *obj, void *event_info);
14static void _e_client_volume_object_volume_drag_stop(void *data, Evas_Object *obj, void *event_info);
14static Eina_Bool _e_client_volume_object_changed(void *data, int type, void *event); 15static Eina_Bool _e_client_volume_object_changed(void *data, int type, void *event);
15static void _e_client_volume_object_del_cb(void *data, Evas *evas, Evas_Object *obj, void *event_info); 16static void _e_client_volume_object_del_cb(void *data, Evas *evas, Evas_Object *obj, void *event_info);
16 17
@@ -77,6 +78,16 @@ _e_client_volume_object_volume_changed(void *data, Evas_Object *obj, void *event
77 e_client_volume_set(ec, elm_slider_value_get(obj)); 78 e_client_volume_set(ec, elm_slider_value_get(obj));
78} 79}
79 80
81static void
82_e_client_volume_object_volume_drag_stop(void *data, Evas_Object *obj, void *event_info EINA_UNUSED)
83{
84 E_Client *ec;
85
86 ec = data;
87
88 e_client_volume_set(ec, elm_slider_value_get(obj));
89}
90
80static Eina_Bool 91static Eina_Bool
81_e_client_volume_object_changed(void *data, int type EINA_UNUSED, void *event) 92_e_client_volume_object_changed(void *data, int type EINA_UNUSED, void *event)
82{ 93{
@@ -353,6 +364,7 @@ e_client_volume_set(E_Client *ec, int volume)
353 e_client_volume_sink_set(sink, ec->volume, ec->mute); 364 e_client_volume_sink_set(sink, ec->volume, ec->mute);
354 } 365 }
355 366
367 _e_client_volume_update(ec);
356 _e_client_volume_event_simple(ec, E_EVENT_CLIENT_VOLUME); 368 _e_client_volume_event_simple(ec, E_EVENT_CLIENT_VOLUME);
357} 369}
358 370
@@ -423,6 +435,9 @@ e_client_volume_object_add(E_Client *ec, Evas *evas)
423 evas_object_smart_callback_add(o, "changed", 435 evas_object_smart_callback_add(o, "changed",
424 _e_client_volume_object_volume_changed, 436 _e_client_volume_object_volume_changed,
425 ec); 437 ec);
438 evas_object_smart_callback_add(o, "slider,drag,stop",
439 _e_client_volume_object_volume_drag_stop,
440 ec);
426 elm_slider_value_set(o, ec->volume); 441 elm_slider_value_set(o, ec->volume);
427 edje_object_part_swallow(bx, "e.swallow.volume", o); 442 edje_object_part_swallow(bx, "e.swallow.volume", o);
428 evas_object_show(o); 443 evas_object_show(o);
diff --git a/src/modules/mixer/e_mod_main.c b/src/modules/mixer/e_mod_main.c
index d10bfb6af..ac805cce8 100644
--- a/src/modules/mixer/e_mod_main.c
+++ b/src/modules/mixer/e_mod_main.c
@@ -1050,6 +1050,17 @@ _bd_hook_volume_changed(void *data, Evas_Object *obj, void *event_info EINA_UNUS
1050} 1050}
1051 1051
1052static void 1052static void
1053_bd_hook_volume_drag_stop(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
1054{
1055 E_Client *ec;
1056
1057 ec = data;
1058
1059 elm_slider_value_set(obj, ec->volume);
1060}
1061
1062
1063static void
1053_bd_hook_mute_changed(void *data, Evas_Object *obj, void *event_info EINA_UNUSED) 1064_bd_hook_mute_changed(void *data, Evas_Object *obj, void *event_info EINA_UNUSED)
1054{ 1065{
1055 E_Client *ec; 1066 E_Client *ec;
@@ -1075,6 +1086,24 @@ _bd_hook_sink_volume_changed(void *data, Evas_Object *obj, void *event_info EINA
1075} 1086}
1076 1087
1077static void 1088static void
1089_bd_hook_sink_volume_drag_stop(void *data, Evas_Object *obj, void *event_info EINA_UNUSED)
1090{
1091 E_Client_Volume_Sink *sink;
1092 Evas_Object *check;
1093 Eina_Bool mute;
1094 int vol;
1095
1096 sink = data;
1097
1098 check = evas_object_data_get(obj, "e_sink_check");
1099
1100 e_client_volume_sink_get(sink, &vol, &mute);
1101 elm_slider_value_set(obj, vol);
1102 elm_check_state_set(check, mute);
1103}
1104
1105
1106static void
1078_bd_hook_sink_mute_changed(void *data, Evas_Object *obj, void *event_info EINA_UNUSED) 1107_bd_hook_sink_mute_changed(void *data, Evas_Object *obj, void *event_info EINA_UNUSED)
1079{ 1108{
1080 E_Client_Volume_Sink *sink; 1109 E_Client_Volume_Sink *sink;
@@ -1187,6 +1216,8 @@ _e_client_mixer_sink_append(E_Client_Volume_Sink *sink, Client_Mixer *cm)
1187 elm_slider_value_set(slider, volume); 1216 elm_slider_value_set(slider, volume);
1188 evas_object_smart_callback_add(slider, "changed", 1217 evas_object_smart_callback_add(slider, "changed",
1189 _bd_hook_sink_volume_changed, sink); 1218 _bd_hook_sink_volume_changed, sink);
1219 evas_object_smart_callback_add(slider, "slider,drag,stop",
1220 _bd_hook_sink_volume_drag_stop, sink);
1190 elm_box_pack_end(cm->bx, slider); 1221 elm_box_pack_end(cm->bx, slider);
1191 evas_object_show(slider); 1222 evas_object_show(slider);
1192 1223
@@ -1379,6 +1410,8 @@ _bd_hook_cb(void *data, E_Menu *m EINA_UNUSED, E_Menu_Item *it EINA_UNUSED)
1379 evas_object_size_hint_align_set(o, EVAS_HINT_FILL, EVAS_HINT_FILL); 1410 evas_object_size_hint_align_set(o, EVAS_HINT_FILL, EVAS_HINT_FILL);
1380 elm_slider_value_set(o, ec->volume); 1411 elm_slider_value_set(o, ec->volume);
1381 evas_object_smart_callback_add(o, "changed", _bd_hook_volume_changed, ec); 1412 evas_object_smart_callback_add(o, "changed", _bd_hook_volume_changed, ec);
1413 evas_object_smart_callback_add(o, "slider,drag,stop",
1414 _bd_hook_volume_drag_stop, ec);
1382 elm_box_pack_end(bx, o); 1415 elm_box_pack_end(bx, o);
1383 evas_object_show(o); 1416 evas_object_show(o);
1384 cm->volume = o; 1417 cm->volume = o;