1
0
Fork 0
mirror of https://gitlab.gnome.org/GNOME/calls.git synced 2024-06-28 06:39:32 +00:00

ringer: use quiet profile for non-primary calls

This commit is contained in:
Evangelos Ribeiro Tzaras 2021-03-12 18:21:41 +01:00 committed by Guido Gunther
parent 30f30decd4
commit 78c0fb1ed7

View file

@ -38,6 +38,10 @@ struct _CallsRinger
{
GObject parent_instance;
/* call_count keeps track of total ongoing calls.
* ring_count keeps track of ringing calls.
*/
unsigned call_count;
unsigned ring_count;
gboolean playing;
LfbEvent *event;
@ -73,6 +77,10 @@ start (CallsRinger *self)
if (self->event)
{
if (self->call_count > self->ring_count)
{
lfb_event_set_feedback_profile (self->event, "quiet");
}
g_object_ref (self);
lfb_event_trigger_feedback_async (self->event,
NULL,
@ -190,6 +198,8 @@ update_count (CallsRinger *self,
CallsCall *call,
short delta)
{
self->call_count += delta;
if (is_ring_state (calls_call_get_state (call)))
{
self->ring_count += delta;