mixer: set the value we set to emix not the value from the backend

devs/bu5hm4n/mixer-fix
Marcel Hollerbach 6 years ago
parent 245aca973e
commit 4304036e51
  1. 11
      src/modules/mixer/e_mod_main.c
  2. 13
      src/modules/mixer/emixer.c

@ -481,6 +481,16 @@ _slider_changed_cb(void *data EINA_UNUSED, Evas_Object *obj,
if (emix_config_save_get()) e_config_save_queue();
}
static void
_slider_drag_stop_cb(void *data EINA_UNUSED, Evas_Object *obj,
void *event EINA_UNUSED)
{
EINA_SAFETY_ON_NULL_RETURN(mixer_context->sink_default);
Emix_Sink *s = (Emix_Sink *)mixer_context->sink_default;
int val = s->volume.volumes[0];
elm_slider_value_set(obj, val);
}
static void
_sink_selected_cb(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
{
@ -545,6 +555,7 @@ _popup_new(Instance *inst)
evas_object_show(slider);
elm_slider_min_max_set(slider, 0.0, emix_max_volume_get());
evas_object_smart_callback_add(slider, "changed", _slider_changed_cb, NULL);
evas_object_smart_callback_add(slider, "slider,drag,stop", _slider_drag_stop_cb, NULL);
elm_slider_value_set(slider, volume);
elm_box_pack_end(bx, slider);
evas_object_show(slider);

@ -48,6 +48,17 @@ _cb_sink_volume_change(void *data,
elm_slider_value_set(obj, vol);
}
static void
_cb_sink_volume_drag_stop(void *data,
Evas_Object *obj,
void *event EINA_UNUSED)
{
Evas_Object *bxv = data;
Emix_Sink *sink = evas_object_data_get(bxv, "sink");
int vol = sink->volume.volumes[0];
elm_slider_value_set(obj, vol);
}
static void
_cb_sink_mute_change(void *data,
Evas_Object *obj,
@ -123,6 +134,8 @@ _emix_sink_add(Emix_Sink *sink)
elm_box_pack_end(bx, sl);
evas_object_show(sl);
evas_object_smart_callback_add(sl, "changed", _cb_sink_volume_change, bxv);
evas_object_smart_callback_add(sl, "slider,drag,stop",
_cb_sink_volume_drag_stop, bxv);
ck = elm_check_add(win);
evas_object_data_set(bxv, "mute", ck);

Loading…
Cancel
Save