diff options
author | Carsten Haitzler (Rasterman) <raster@rasterman.com> | 2017-02-19 21:15:35 +0900 |
---|---|---|
committer | Carsten Haitzler (Rasterman) <raster@rasterman.com> | 2017-02-19 21:15:35 +0900 |
commit | 718f0fe0f443c1841c65fcad27c0d75c863c9948 (patch) | |
tree | 067282d36293d60ef28c1d9d5fca01b117959551 | |
parent | bcea8893403644a016ba04ce3d7c96da60138a09 (diff) | |
download | enlightenment-718f0fe0f443c1841c65fcad27c0d75c863c9948.tar.gz |
e client mixer - stop messing with mute + volume state just for display
so add a new sink or get an update on state and e will SEt volume/mute
settings, not just passively disdplay them. this has been messing up
rage's winlist (mouse over on right) for several months now... and e
is/was wrong.
this doesnt fix all. if an app has multiple streams really this client
mixer needs to display a control per stream, not a single one - eg in
a popup. in fact volume shoud likely be done in a popup instead of
inside titlebar anyway :)
but this fixes the most annoying problem where withotu users doing
anything, the audio starts to play from streams explicitly muted by
the app...
-rw-r--r-- | src/bin/e_client_volume.c | 23 | ||||
-rw-r--r-- | src/bin/e_client_volume.h | 2 |
2 files changed, 16 insertions, 9 deletions
diff --git a/src/bin/e_client_volume.c b/src/bin/e_client_volume.c index f45e0d8f76..6526b209d5 100644 --- a/src/bin/e_client_volume.c +++ b/src/bin/e_client_volume.c @@ -199,14 +199,8 @@ e_client_volume_sink_append(E_Client *ec, E_Client_Volume_Sink *sink) volume_max = e_client_volume_sink_max_get(sink); if (ec->volume_max > volume_max) ec->volume_max = volume_max; - if ((ec->volume_min > ec->volume) - || (ec->volume_max < ec->volume)) - e_client_volume_set(ec, ec->volume); e_client_volume_sink_get(sink, &volume, &mute); - if ((ec->volume != volume) || (ec->mute != mute)) - { - e_client_volume_sink_set(sink, ec->volume, ec->mute); - } + e_client_volume_display_set(ec, volume, mute); } else { @@ -242,12 +236,23 @@ e_client_volume_sink_update(E_Client_Volume_Sink *sink) e_client_volume_sink_get(sink, &volume, &mute); EINA_LIST_FOREACH(sink->clients, l, ec) { - e_client_volume_set(ec, volume); - e_client_volume_mute_set(ec, mute); + e_client_volume_display_set(ec, volume, mute); } } E_API void +e_client_volume_display_set(E_Client *ec, int volume, Eina_Bool mute) +{ + ec->volume = volume; + ec->mute = !!mute; + if (mute) + _e_client_volume_event_simple(ec, E_EVENT_CLIENT_MUTE); + else + _e_client_volume_event_simple(ec, E_EVENT_CLIENT_UNMUTE); + _e_client_volume_event_simple(ec, E_EVENT_CLIENT_VOLUME); +} + +E_API void e_client_volume_set(E_Client *ec, int volume) { Eina_List *l; diff --git a/src/bin/e_client_volume.h b/src/bin/e_client_volume.h index 1f66cdaa72..3ef0e164ab 100644 --- a/src/bin/e_client_volume.h +++ b/src/bin/e_client_volume.h @@ -41,4 +41,6 @@ E_API void e_client_volume_sink_append(E_Client *ec, E_Client_Volume_Sin E_API void e_client_volume_sink_remove(E_Client *ec, E_Client_Volume_Sink *mixer); E_API void e_client_volume_sink_update(E_Client_Volume_Sink *mixer); +E_API void e_client_volume_display_set(E_Client *ec, int volume, Eina_Bool mute); + #endif |