mirror of
https://git.jami.net/savoirfairelinux/jami-daemon.git
synced 2025-08-12 22:09:25 +08:00
* #19154: gnome: add checkbox to mute/unmute DTMF
This commit is contained in:
@ -842,6 +842,17 @@ static void record_path_changed(GtkFileChooser *chooser, G_GNUC_UNUSED gpointer
|
||||
g_free(path);
|
||||
}
|
||||
|
||||
static
|
||||
void
|
||||
mute_dtmf_toggled(GtkToggleButton *tb, G_GNUC_UNUSED gpointer data)
|
||||
{
|
||||
if (gtk_toggle_button_get_active(tb))
|
||||
dbus_mute_dtmf(TRUE);
|
||||
else
|
||||
dbus_mute_dtmf(FALSE);
|
||||
}
|
||||
|
||||
|
||||
GtkWidget* create_audio_configuration(SFLPhoneClient *client)
|
||||
{
|
||||
/* Main widget */
|
||||
@ -930,6 +941,15 @@ GtkWidget* create_audio_configuration(SFLPhoneClient *client)
|
||||
g_signal_connect(G_OBJECT(enableAGC), "clicked", toggle_agc, NULL);
|
||||
gtk_grid_attach(GTK_GRID(grid), enableAGC, 0, 2, 1, 1);
|
||||
|
||||
gnome_main_section_new_with_grid(_("Tone settings"), &frame, &grid);
|
||||
gtk_box_pack_start(GTK_BOX(audio_vbox), frame, FALSE, FALSE, 0);
|
||||
|
||||
GtkWidget *muteDtmf = gtk_check_button_new_with_mnemonic(_("_Mute DTMF"));
|
||||
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(muteDtmf), dbus_is_dtmf_muted());
|
||||
|
||||
g_signal_connect(G_OBJECT(muteDtmf), "toggled", mute_dtmf_toggled, NULL);
|
||||
gtk_grid_attach(GTK_GRID(grid), muteDtmf, 0, 1, 1, 1);
|
||||
|
||||
gtk_widget_show_all(audio_vbox);
|
||||
|
||||
if (!using_pulse)
|
||||
|
@ -267,6 +267,13 @@
|
||||
</arg>
|
||||
</signal>
|
||||
|
||||
<!-- For now only expose these two options to clients -->
|
||||
<method name="muteDtmf" tp:name-for-bindings="muteDtmf">
|
||||
<arg type="b" name="muteDtmf" direction="in"/>
|
||||
</method>
|
||||
<method name="isDtmfMuted" tp:name-for-bindings="isDtmfMuted">
|
||||
<arg type="b" name="muted" direction="out"/>
|
||||
</method>
|
||||
|
||||
<method name="muteCapture" tp:name-for-bindings="muteCapture">
|
||||
<arg type="b" name="mute" direction="in">
|
||||
|
@ -1311,6 +1311,14 @@ dbus_mute_capture(gboolean muted)
|
||||
check_error(error);
|
||||
}
|
||||
|
||||
void
|
||||
dbus_mute_dtmf(gboolean muted)
|
||||
{
|
||||
GError *error = NULL;
|
||||
org_sflphone_SFLphone_ConfigurationManager_mute_dtmf(config_proxy, muted, &error);
|
||||
check_error(error);
|
||||
}
|
||||
|
||||
void
|
||||
dbus_mute_playback(gboolean muted)
|
||||
{
|
||||
@ -1319,6 +1327,16 @@ dbus_mute_playback(gboolean muted)
|
||||
check_error(error);
|
||||
}
|
||||
|
||||
gboolean
|
||||
dbus_is_dtmf_muted()
|
||||
{
|
||||
GError *error = NULL;
|
||||
gboolean muted;
|
||||
org_sflphone_SFLphone_ConfigurationManager_is_dtmf_muted(config_proxy, &muted, &error);
|
||||
check_error(error);
|
||||
return muted;
|
||||
}
|
||||
|
||||
gboolean
|
||||
dbus_is_capture_muted()
|
||||
{
|
||||
|
@ -194,6 +194,9 @@ void dbus_mute_playback(gboolean mute);
|
||||
gboolean dbus_is_capture_muted();
|
||||
gboolean dbus_is_playback_muted();
|
||||
|
||||
void dbus_mute_dtmf(gboolean mute);
|
||||
gboolean dbus_is_dtmf_muted();
|
||||
|
||||
/**
|
||||
* ConfigurationManager - Play DTMF
|
||||
* @param key The DTMF to send
|
||||
|
Reference in New Issue
Block a user