1
0
Fork 0
mirror of https://gitlab.gnome.org/GNOME/calls.git synced 2024-12-12 15:47:35 +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; GObject parent_instance;
/* call_count keeps track of total ongoing calls.
* ring_count keeps track of ringing calls.
*/
unsigned call_count;
unsigned ring_count; unsigned ring_count;
gboolean playing; gboolean playing;
LfbEvent *event; LfbEvent *event;
@ -73,6 +77,10 @@ start (CallsRinger *self)
if (self->event) if (self->event)
{ {
if (self->call_count > self->ring_count)
{
lfb_event_set_feedback_profile (self->event, "quiet");
}
g_object_ref (self); g_object_ref (self);
lfb_event_trigger_feedback_async (self->event, lfb_event_trigger_feedback_async (self->event,
NULL, NULL,
@ -190,6 +198,8 @@ update_count (CallsRinger *self,
CallsCall *call, CallsCall *call,
short delta) short delta)
{ {
self->call_count += delta;
if (is_ring_state (calls_call_get_state (call))) if (is_ring_state (calls_call_get_state (call)))
{ {
self->ring_count += delta; self->ring_count += delta;