Page MenuHomePhabricator

emixer issus/wishes
Open, TODOPublic

Description

using and comparing emixer with gnome-sound.
i noticed some issues and wishes.
in gnome-sound i can see the name of the audiostream



would be cool to have this in emixer too.

In gnome-sound i can set the balance, but i'am not able to do that in emixer.
also, if i change the balance to left in gnome-sound, emixer decrease the output level and the slider moves left.

in gnome-sound i can choose profiles of the devices. not found this option in emixer

Thanks
Greeting Simon

jf_simon created this task.Jul 3 2017, 8:19 AM
zmike reassigned this task from zmike to bu5hm4n.Jul 3 2017, 8:22 AM

Soooo the better Sink name is now pushed.

To the rest: emixer is build as mono mixer, we only have one volume per port. To get the stereo into something monostyle we are just doing (right+left)/2, if you change the balance in your pavucontrol, then this just impacts the both right and left in a way that you will end in the beginning ... sadly for now, nothing different, since this would require rebuilding a big part of emixer. Same basically applies for the profile, we dont have yet support for something like this at all in emix...

Anyway, while i added the names i wanted to add icons, i almost got it in the way i want to have it, if someone wants to continue fiddeling the size hints, here is my work:

From 77e40276524a067484778a8311cfe8365e4711b7 Mon Sep 17 00:00:00 2001
From: Marcel Hollerbach <marcel-hollerbach@t-online.de>
Date: Tue, 4 Jul 2017 11:01:49 +0200
Subject: [PATCH] stupid size hints

---
 src/modules/mixer/emixer.c                        | 14 +++++++++++---
 src/modules/mixer/lib/backends/pulseaudio/pulse.c |  9 ++++-----
 src/modules/mixer/lib/emix.h                      |  1 +
 3 files changed, 16 insertions(+), 8 deletions(-)

diff --git a/src/modules/mixer/emixer.c b/src/modules/mixer/emixer.c
index 1bcd96c1f..ac1642a2b 100644
--- a/src/modules/mixer/emixer.c
+++ b/src/modules/mixer/emixer.c
@@ -242,7 +242,7 @@ _cb_sink_input_mute_change(void *data,
 static void
 _emix_sink_input_add(Emix_Sink_Input *input)
 {
-   Evas_Object *bxv, *bx, *lb, *ck, *sl, *hv, *sep;
+   Evas_Object *bxv, *bx, *lb, *ck, *sl, *hv, *sep, *ic;
    const Eina_List *l;
    Emix_Sink *sink;
 
@@ -259,10 +259,18 @@ _emix_sink_input_add(Emix_Sink_Input *input)
    elm_box_pack_end(bxv, bx);
    evas_object_show(bx);
 
+   ic = elm_icon_add(win);
+   elm_icon_standard_set(ic, input->icon);
+   evas_object_size_hint_weight_set(ic, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   evas_object_size_hint_align_set(ic, 0.0, EVAS_HINT_FILL);
+   evas_object_size_hint_aspect_set(ic, EVAS_ASPECT_CONTROL_BOTH, 1.0, 1.0);
+   elm_box_pack_end(bx, ic);
+   evas_object_show(ic);
+
    lb = elm_label_add(win);
    elm_object_text_set(lb, input->name);
    evas_object_size_hint_weight_set(lb, EVAS_HINT_EXPAND, 0.5);
-   evas_object_size_hint_align_set(lb, 0.0, 0.5);
+   evas_object_size_hint_align_set(lb, EVAS_HINT_FILL, 0.5);
    elm_box_pack_end(bx, lb);
    evas_object_show(lb);
 
@@ -277,7 +285,7 @@ _emix_sink_input_add(Emix_Sink_Input *input)
                               _cb_sink_input_port_change, sink);
         if (input->sink == sink) elm_object_text_set(hv, sink->name);
      }
-   evas_object_size_hint_weight_set(hv, 0.0, 0.5);
+   evas_object_size_hint_weight_set(hv, EVAS_HINT_EXPAND, 0.5);
    evas_object_size_hint_align_set(hv, EVAS_HINT_FILL, 0.5);
    elm_box_pack_end(bx, hv);
    evas_object_show(hv);
diff --git a/src/modules/mixer/lib/backends/pulseaudio/pulse.c b/src/modules/mixer/lib/backends/pulseaudio/pulse.c
index a92c4ae92..c88962635 100644
--- a/src/modules/mixer/lib/backends/pulseaudio/pulse.c
+++ b/src/modules/mixer/lib/backends/pulseaudio/pulse.c
@@ -40,7 +40,6 @@ typedef struct _Sink
 typedef struct _Sink_Input
 {
    Emix_Sink_Input base;
-   const char *icon;
    int idx;
 } Sink_Input;
 
@@ -110,7 +109,7 @@ _sink_input_del(Sink_Input *input)
 
    free(input->base.volume.volumes);
    eina_stringshare_del(input->base.name);
-   eina_stringshare_del(input->icon);
+   eina_stringshare_del(input->base.icon);
    free(input);
 }
 
@@ -335,9 +334,9 @@ _sink_input_cb(pa_context *c EINA_UNUSED, const pa_sink_input_info *info,
 
    input_name = eina_strbuf_new();
    eina_strbuf_append(input_name, pa_proplist_gets(info->proplist, PA_PROP_APPLICATION_NAME));
-   eina_strbuf_append(input_name, ":");
+   eina_strbuf_append(input_name, " : ");
    eina_strbuf_append(input_name, info->name);
-   input->base.name = eina_strbuf_release(input_name);
+   input->base.name = eina_stringshare_add(eina_strbuf_string_steal(input_name));
    input->base.volume = _pa_cvolume_convert(&info->volume);
    input->base.mute = !!info->mute;
    EINA_LIST_FOREACH(ctx->sinks, l, s)
@@ -345,7 +344,7 @@ _sink_input_cb(pa_context *c EINA_UNUSED, const pa_sink_input_info *info,
         if (s->idx == (int)info->sink)
           input->base.sink = (Emix_Sink *)s;
      }
-   input->icon = eina_stringshare_add(_icon_from_properties(info->proplist));
+   input->base.icon = eina_stringshare_add(_icon_from_properties(info->proplist));
    ctx->inputs = eina_list_append(ctx->inputs, input);
 
    if ((t = pa_proplist_gets(info->proplist, PA_PROP_APPLICATION_PROCESS_ID)))
diff --git a/src/modules/mixer/lib/emix.h b/src/modules/mixer/lib/emix.h
index 29dc17da2..541b863fa 100644
--- a/src/modules/mixer/lib/emix.h
+++ b/src/modules/mixer/lib/emix.h
@@ -65,6 +65,7 @@ typedef struct _Emix_Sink_Input {
    Eina_Bool mute;
    Emix_Sink *sink;
    pid_t pid;
+   const char *icon;
 } Emix_Sink_Input;
 
 typedef struct _Emix_Source {
-- 
2.13.2

It looks like that now: https://www.enlightenment.org/ss/e-595b53dcdcb6b5.32084911.png

bu5hm4n triaged this task as TODO priority.Jul 4 2017, 2:19 AM
jpeg added a subscriber: jpeg.Jul 10 2017, 7:55 PM

After some testing and reading of the code it seems having A/R hints changes the layout algorithm and other hints may not work as expected anymore.

jpeg added a project: efl.Jul 10 2017, 7:55 PM

i found a way to display the icons correctly.
it seems, that

evas_object_size_hint_weight_set(ic, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);

beaks in some way the align.
if i comment out

evas_object_size_hint_weight_set(ic, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);

and use instead

evas_object_size_hint_min_set(ic, 28, 28);

the icon is shown an align correct.
https://www.enlightenment.org/ss/display.php?image=e-59648b5f780df5.62957841.jpg
But then there may be a problem if a user scales e.
What do you think. Could we push this changes?

Simon

zmike added a comment.Jul 11 2017, 6:21 AM

The original patch attempt would likely have worked fine if a horizontal box padding was used; an aspected size using BOTH will logically fill all available space, so it will look strange for some images when there is 0px between the image and the adjacent text..

zmike, with the padding you are right. with this, it will look better.

but we have an align issue
see https://www.enlightenment.org/ss/e-595b53dcdcb6b5.32084911.png

have you an idea, what is wrong?
or do you think it would be ok to push the patch with my changes in the post above to show the icons?
its not nice, but it will work

zmike added a comment.Jul 13 2017, 7:48 AM

I've resolved the layout issue, but there's still something happening where randomly the icon for the second item in the list will be placed at 0,0. @bu5hm4n I wonder if this is something you may have done?

@zmike thanks for working on it.

with your patch, it looks sadly like this. maybe only for me?

http://www.enlightenment.org/ss/e-5968681f902c76.31099565.png

zmike added a comment.Jul 14 2017, 6:13 AM

Hm probably the button should be right-aligned. I didn't spend much time resizing the window.

yes, and this is exactly the problem :) the "align"

zmike edited projects, added Restricted Project; removed efl.Jun 11 2018, 6:57 AM
bu5hm4n edited projects, added efl: layout engine; removed Restricted Project.Jun 11 2018, 7:16 AM

today i played a little bit with the code.
for me, it seems, that using

evas_object_size_hint_weight_set()

breaks the align. of the hbox.

if i add

evas_object_size_hint_min_set

and dont use

evas_object_size_hint_weight_set()

it works as it should

https://www.enlightenment.org/ss/display.php?image=e-5c3388044ba716.49123735.png

more i cant do on this issue. need help :)

Greetings Simon

Not adding a balance option but per channel volume control.
look at my patch here D7639