Commit d8940cdc authored by Alexandre Savard's avatar Alexandre Savard
Browse files

#5709: Add always recording option in audio conference panel

parent e7145c6c
......@@ -63,6 +63,9 @@ enum {
CODEC_COLUMN_COUNT
};
static void active_is_always_recording (void);
/**
* Fills the tree list with supported codecs
*/
......@@ -767,11 +770,8 @@ active_noise_suppress (void)
gchar *state;
gchar *newstate;
DEBUG ("Audio: Active noise suppression clicked");
state = dbus_get_noise_suppress_state();
DEBUG ("Audio: Get noise suppression cancel state %s", state);
if (strcmp (state, "enabled") == 0) {
newstate = "disabled";
} else {
......@@ -781,6 +781,23 @@ active_noise_suppress (void)
dbus_set_noise_suppress_state (newstate);
}
void
active_is_always_recording (void)
{
gboolean enabled = FALSE;
enabled = dbus_get_is_always_recording();
if(enabled) {
enabled = FALSE;
}
else {
enabled = TRUE;
}
dbus_set_is_always_recording(enabled);
}
GtkWidget* alsa_box()
{
GtkWidget *ret;
......@@ -957,9 +974,9 @@ GtkWidget* create_audio_configuration()
/* Get the path where to save audio files */
dftPath = dbus_get_record_path ();
DEBUG ("load recording path %s\n", dftPath);
DEBUG ("AudioConf: Load recording path %s", dftPath);
gnome_main_section_new_with_table (_ ("Recordings"), &frame, &table, 1, 2);
gnome_main_section_new_with_table (_ ("Recordings"), &frame, &table, 2, 3);
gtk_box_pack_start (GTK_BOX (ret), frame, FALSE, FALSE, 0);
// label
......@@ -972,6 +989,16 @@ GtkWidget* create_audio_configuration()
g_signal_connect (G_OBJECT (folderChooser) , "selection_changed" , G_CALLBACK (record_path_changed) , NULL);
gtk_table_attach (GTK_TABLE (table), folderChooser, 1, 2, 0, 1, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 5);
// isAlwaysRecording functionality checkbox
GtkWidget *enableIsAlwaysRecording = NULL;
gboolean isAlwaysRecording = FALSE;
isAlwaysRecording = dbus_get_is_always_recording();
enableIsAlwaysRecording = gtk_check_button_new_with_mnemonic(_("_Always recording"));
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(enableIsAlwaysRecording), isAlwaysRecording);
g_signal_connect(G_OBJECT(enableIsAlwaysRecording), "clicked", active_is_always_recording, NULL);
gtk_table_attach(GTK_TABLE(table), enableIsAlwaysRecording, 0, 1, 1, 2, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 5);
gtk_widget_show(GTK_WIDGET(enableIsAlwaysRecording));
// Box for the voice enhancement configuration
gnome_main_section_new_with_table (_ ("Voice enhancement settings"), &frame, &table, 2, 1);
......@@ -980,12 +1007,10 @@ GtkWidget* create_audio_configuration()
enableNoiseReduction = gtk_check_button_new_with_mnemonic (_ ("_Noise Reduction"));
state = dbus_get_noise_suppress_state();
noisesuppressActive = FALSE;
if (strcmp (state, "enabled") == 0)
noisesuppressActive = TRUE;
else
noisesuppressActive = FALSE;
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (enableNoiseReduction), noisesuppressActive);
g_signal_connect (G_OBJECT (enableNoiseReduction), "clicked", active_noise_suppress, NULL);
gtk_table_attach (GTK_TABLE (table), enableNoiseReduction, 0, 1, 1, 2, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);
......
......@@ -386,6 +386,24 @@
</tp:docstring>
</arg>
</method>
<method name="getIsAlwaysRecording" tp:name-for-bindings="getIsAlwaysRecording">
<tp:docstring>
</tp:docstring>
<arg type="b" name="res" direction="out">
<tp:docstring>
</tp:docstring>
</arg>
</method>
<method name="setIsAlwaysRecording" tp:name-for-bindings="setIsAlwaysRecording">
<tp:docstring>
</tp:docstring>
<arg type="b" name="enabled" direction="in">
<tp:docstring>
</tp:docstring>
</arg>
</method>
<!-- /////////////////////// -->
......
......@@ -1750,6 +1750,33 @@ dbus_get_record_path (void)
return path;
}
void dbus_set_is_always_recording(const gboolean alwaysRec)
{
GError *error = NULL;
org_sflphone_SFLphone_ConfigurationManager_set_is_always_recording(
configurationManagerProxy, alwaysRec, &error);
if(error) {
ERROR("DBUS: Could not set isAlwaysRecording");
g_error_free(error);
}
}
gboolean dbus_get_is_always_recording(void)
{
GError *error = NULL;
int alwaysRec;
org_sflphone_SFLphone_ConfigurationManager_get_is_always_recording(
configurationManagerProxy, &alwaysRec, &error);
if(error) {
ERROR("DBUS: Could not get isAlwaysRecording");
g_error_free(error);
}
return alwaysRec;
}
void
dbus_set_history_limit (const guint days)
{
......
......@@ -464,6 +464,18 @@ void dbus_set_record_path (const gchar *path);
*/
gchar* dbus_get_record_path (void);
/**
* Set the always recording functionality, once true all call
* will be set in recording mode once answered
*/
void dbus_set_is_always_recording(const gboolean);
/**
* Test if the always recording functionality is activated
* @return true if call are always recording
*/
gboolean dbus_get_is_always_recording(void);
/**
* Encapsulate all the address book-related configuration
* Get the configuration
......
......@@ -386,6 +386,24 @@
</tp:docstring>
</arg>
</method>
<method name="getIsAlwaysRecording" tp:name-for-bindings="getIsAlwaysRecording">
<tp:docstring>
</tp:docstring>
<arg type="b" name="res" direction="out">
<tp:docstring>
</tp:docstring>
</arg>
</method>
<method name="setIsAlwaysRecording" tp:name-for-bindings="setIsAlwaysRecording">
<tp:docstring>
</tp:docstring>
<arg type="b" name="enabled" direction="in">
<tp:docstring>
</tp:docstring>
</arg>
</method>
<!-- /////////////////////// -->
......
......@@ -575,7 +575,6 @@ std::vector<std::string> ConfigurationManager::getRecordDeviceList()
{
std::vector<std::string> ret;
return ret;
}
bool ConfigurationManager::isMd5CredentialHashing (void)
......@@ -623,6 +622,15 @@ void ConfigurationManager::setRecordPath (const std::string& recPath)
Manager::instance().setRecordPath (recPath);
}
bool ConfigurationManager::getIsAlwaysRecording(void)
{
return Manager::instance().getIsAlwaysRecording();
}
void ConfigurationManager::setIsAlwaysRecording(const bool& rec)
{
Manager::instance().setIsAlwaysRecording(rec);
}
/*
int32_t ConfigurationManager::getDialpad(void) {
return Manager::instance().getDialpad();
......
......@@ -110,7 +110,8 @@ class ConfigurationManager
void setRingtoneChoice (const std::string& accountID, const std::string& tone);
std::string getRecordPath (void);
void setRecordPath (const std::string& recPath);
bool getIsAlwaysRecording(void);
void setIsAlwaysRecording(const bool& rec);
void setHistoryLimit (const int32_t& days);
int32_t getHistoryLimit (void);
......
......@@ -2886,6 +2886,16 @@ void ManagerImpl::setRecordPath (const std::string& recPath)
audioPreference.setRecordpath (recPath);
}
bool ManagerImpl::getIsAlwaysRecording(void)
{
return audioPreference.getIsAlwaysRecording();
}
void ManagerImpl::setIsAlwaysRecording(bool isAlwaysRec)
{
return audioPreference.setIsAlwaysRecording(isAlwaysRec);
}
bool ManagerImpl::getMd5CredentialHashing (void)
{
return preferences.getMd5Hash();
......
......@@ -694,6 +694,17 @@ class ManagerImpl
*/
void setRecordPath (const std::string& recPath);
/**
* Get is always recording functionality
*/
bool getIsAlwaysRecording(void);
/**
* Set is always recording functionality, every calls will then be set in RECORDING mode
* once answered
*/
void setIsAlwaysRecording(bool isAlwaysRec);
/**
* Set a credential for a given account. If it
* does not exist yet, it will be created.
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment