Compare commits

...

3 Commits

Author SHA1 Message Date
Marcel Hollerbach 04308ab8aa POC 6 years ago
Marcel Hollerbach 4304036e51 mixer: set the value we set to emix not the value from the backend 6 years ago
Marcel Hollerbach 245aca973e mixer: set the slider value again when the barrier feature is applied 6 years ago
  1. 12
      src/modules/mixer/e_mod_main.c
  2. 13
      src/modules/mixer/emixer.c
  3. 7
      src/modules/mixer/lib/emix.c
  4. 1
      src/modules/mixer/lib/emix.h

@ -476,10 +476,21 @@ _slider_changed_cb(void *data EINA_UNUSED, Evas_Object *obj,
val = (int)elm_slider_value_get(obj);
VOLSET(val, s->volume, s, emix_sink_volume_set);
elm_slider_value_set(obj, val);
emix_config_save_state_get();
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->set_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)
{
@ -544,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->set_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);

@ -280,6 +280,13 @@ emix_sink_volume_set(Emix_Sink *sink, Emix_Volume volume)
ctx->loaded->ebackend_sink_volume_set &&
sink));
sink->set_volume.channel_count = volume.channel_count;
sink->set_volume.volumes = calloc(volume.channel_count, sizeof(int));
for (unsigned int i = 0; i < volume.channel_count; i++)
{
sink->set_volume.volumes[i] = volume.volumes[i];
}
ctx->loaded->ebackend_sink_volume_set(sink, volume);
}

@ -55,6 +55,7 @@ typedef struct _Emix_Port {
typedef struct _Emix_Sink {
const char *name;
Emix_Volume volume;
Emix_Volume set_volume;
Eina_Bool mute;
Eina_List *ports;
} Emix_Sink;

Loading…
Cancel
Save