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

[#4068] Remove echo cancel from configuration

parent bb592ffb
......@@ -752,28 +752,6 @@ select_audio_manager (void)
}
void
active_echo_cancel (void)
{
gchar* state;
gchar* newstate;
DEBUG ("Audio: Active echo cancel clicked");
state = dbus_get_echo_cancel_state();
DEBUG ("Audio: Get echo cancel state %s", state);
if (strcmp (state, "enabled") == 0)
newstate = "disabled";
else
newstate = "enabled";
dbus_set_echo_cancel_state (newstate);
}
void
active_noise_suppress (void)
{
......@@ -781,10 +759,10 @@ active_noise_suppress (void)
gchar *state;
gchar *newstate;
DEBUG ("Audio: Active noise suppress clicked");
DEBUG ("Audio: Active noise suppression clicked");
state = dbus_get_noise_suppress_state();
DEBUG ("Audio: Get echo cancel state %s", state);
DEBUG ("Audio: Get noise suppression cancel state %s", state);
if (strcmp (state, "enabled") == 0)
newstate = "disabled";
......@@ -919,9 +897,8 @@ GtkWidget* create_audio_configuration()
GtkWidget *ret;
// Sub boxes
GtkWidget *frame;
GtkWidget *enableEchoCancel;
GtkWidget *enableNoiseReduction;
gboolean echocancelActive, noisesuppressActive;
gboolean noisesuppressActive;
gchar *state;
ret = gtk_vbox_new (FALSE, 10);
......@@ -988,19 +965,6 @@ GtkWidget* create_audio_configuration()
gnome_main_section_new_with_table (_ ("Voice enhancement settings"), &frame, &table, 2, 1);
gtk_box_pack_start (GTK_BOX (ret), frame, FALSE, FALSE, 0);
enableEchoCancel = gtk_check_button_new_with_mnemonic (_ ("_Echo Suppression"));
state = dbus_get_echo_cancel_state();
echocancelActive = FALSE;
if (strcmp (state, "enabled") == 0)
echocancelActive = TRUE;
else
echocancelActive = FALSE;
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (enableEchoCancel), echocancelActive);
g_signal_connect (G_OBJECT (enableEchoCancel), "clicked", active_echo_cancel, NULL);
gtk_table_attach (GTK_TABLE (table), enableEchoCancel, 0, 1, 0, 1, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);
enableNoiseReduction = gtk_check_button_new_with_mnemonic (_ ("_Noise Reduction"));
state = dbus_get_noise_suppress_state();
noisesuppressActive = FALSE;
......
......@@ -545,22 +545,6 @@
</arg>
</method>
<method name="getEchoCancelState" tp:name-for-bindings="getEchoCancelState">
<tp:docstring>
</tp:docstring>
<arg type="s" name="state" direction="out">
<tp:docstring>
</tp:docstring>
</arg>
</method>
<method name="setEchoCancelState" tp:name-for-bindings="setEchoCancelState">
<tp:docstring>
</tp:docstring>
<arg type="s" name="state" direction="in">
</arg>
</method>
<method name="getNoiseSuppressState" tp:name-for-bindings="getNoiseSuppressState">
<tp:docstring>
</tp:docstring>
......
......@@ -1465,40 +1465,6 @@ dbus_get_current_audio_output_plugin()
return plugin;
}
/**
* Get echo canceller state
*/
gchar*
dbus_get_echo_cancel_state()
{
gchar* state = "";
GError* error = NULL;
org_sflphone_SFLphone_ConfigurationManager_get_echo_cancel_state (configurationManagerProxy, &state, &error);
if (error) {
ERROR ("DBus: Failed to call get_echo_cancel_state() on ConfigurationManager: %s", error->message);
g_error_free (error);
}
return state;
}
/**
* Set echo canceller state
*/
void
dbus_set_echo_cancel_state (gchar* state)
{
GError* error = NULL;
org_sflphone_SFLphone_ConfigurationManager_set_echo_cancel_state (
configurationManagerProxy, state, &error);
if (error) {
ERROR ("Failed to call set_echo_cancel_state() on ConfigurationManager: %s", error->message);
g_error_free (error);
}
}
/**
* Get noise reduction state
......@@ -1519,7 +1485,7 @@ dbus_get_noise_suppress_state()
}
/**
* Set echo canceller state
* Set noise reduction state
*/
void
dbus_set_noise_suppress_state (gchar* state)
......
......@@ -315,19 +315,6 @@ int dbus_get_audio_device_index (const gchar* name);
*/
gchar* dbus_get_current_audio_output_plugin();
/**
* ConfigurationManager - Get the current state of echo canceller
* @return gchar* The state (enabled/disabled)
*/
gchar *dbus_get_echo_cancel_state (void);
/**
* ConfigurationManager - Set the crrent state of echo canceller
* @param gchar* The state (enabled/disabled)
*/
void dbus_set_echo_cancel_state (gchar *state);
/**
* ConfigurationManager - Get the current noise suppressor state
* @return gchar* The state (enabled/disabled)
......
......@@ -62,7 +62,6 @@ AlsaLayer::AlsaLayer (ManagerImpl* manager)
_audioPlugin = AudioLayer::_manager->audioPreference.getPlugin();
AudioLayer::_echocancelstate = true;
AudioLayer::_noisesuppressstate = true;
// captureFile = new ofstream ("probeFile", ofstream::binary);
......@@ -253,13 +252,6 @@ bool AlsaLayer::isCaptureActive (void)
return false;
}
void AlsaLayer::setEchoCancelState (bool state)
{
// if a stream already running
AudioLayer::_echocancelstate = state;
}
void AlsaLayer::setNoiseSuppressState (bool state)
{
// if a stream already opened
......
......@@ -159,20 +159,6 @@ class AlsaLayer : public AudioLayer
bool isCaptureActive (void);
/**
* Get the echo canceller state
* @return true if echo cancel activated
*/
virtual bool getEchoCancelState (void) {
return AudioLayer::_echocancelstate;
}
/**
* Set the echo canceller state
* @param state true if echocancel active, false elsewhere
*/
virtual void setEchoCancelState (bool state);
/**
* Get the noise suppressor state
* @return true if noise suppressor activated
......
......@@ -254,18 +254,6 @@ class AudioLayer
return _recorder;
}
/**
* Get the echo canceller state
* @return true if echo cancel activated
*/
virtual bool getEchoCancelState (void) = 0;
/**
* Set the echo canceller state
* @param state true if echocancel active, false elsewhere
*/
virtual void setEchoCancelState (bool state) = 0;
/**
* Get the noise suppressor state
* @return true if noise suppressor activated
......@@ -367,14 +355,9 @@ class AudioLayer
*/
ost::Mutex _mutex;
EchoCancel *_echoCancel;
AudioProcessing *_echoCanceller;
DcBlocker *_dcblocker;
AudioProcessing *_audiofilter;
bool _echocancelstate;
bool _noisesuppressstate;
};
......
......@@ -245,7 +245,6 @@ PulseLayer::PulseLayer (ManagerImpl* manager)
is_started = false;
AudioLayer::_echocancelstate = true;
AudioLayer::_noisesuppressstate = true;
byteCounter = 0;
......@@ -735,12 +734,6 @@ void PulseLayer::processData (void)
}
void PulseLayer::setEchoCancelState (bool state)
{
// if a stream already running
AudioLayer::_echocancelstate = state;
}
void PulseLayer::setNoiseSuppressState (bool state)
{
// if a stream already opened
......
......@@ -191,20 +191,6 @@ class PulseLayer : public AudioLayer
void processData (void);
/**
* Get the echo canceller state
* @return true if echo cancel activated
*/
bool getEchoCancelState (void) {
return AudioLayer::_echocancelstate;
}
/**
* Set the echo canceller state
* @param state true if echocancel active, false elsewhere
*/
void setEchoCancelState (bool state);
/**
* Get the noise suppressor state
* @return true if noise suppressor activated
......
......@@ -545,22 +545,6 @@
</arg>
</method>
<method name="getEchoCancelState" tp:name-for-bindings="getEchoCancelState">
<tp:docstring>
</tp:docstring>
<arg type="s" name="state" direction="out">
<tp:docstring>
</tp:docstring>
</arg>
</method>
<method name="setEchoCancelState" tp:name-for-bindings="setEchoCancelState">
<tp:docstring>
</tp:docstring>
<arg type="s" name="state" direction="in">
</arg>
</method>
<method name="getNoiseSuppressState" tp:name-for-bindings="getNoiseSuppressState">
<tp:docstring>
</tp:docstring>
......
......@@ -558,16 +558,6 @@ std::string ConfigurationManager::getCurrentAudioOutputPlugin (void)
return Manager::instance().getCurrentAudioOutputPlugin();
}
std::string ConfigurationManager::getEchoCancelState (void)
{
return Manager::instance().getEchoCancelState();
}
void ConfigurationManager::setEchoCancelState (const std::string& state)
{
Manager::instance().setEchoCancelState (state);
}
std::string ConfigurationManager::getNoiseSuppressState (void)
{
return Manager::instance().getNoiseSuppressState();
......
......@@ -89,8 +89,6 @@ class ConfigurationManager
std::vector< std::string > getCurrentAudioDevicesIndex();
int32_t getAudioDeviceIndex (const std::string& name);
std::string getCurrentAudioOutputPlugin (void);
std::string getEchoCancelState (void);
void setEchoCancelState (const std::string& state);
std::string getNoiseSuppressState (void);
void setNoiseSuppressState (const std::string& state);
......
......@@ -2824,30 +2824,6 @@ std::string ManagerImpl::getCurrentAudioOutputPlugin (void)
}
std::string ManagerImpl::getEchoCancelState (void)
{
std::string state;
state = audioPreference.getEchoCancel() ? "enabled" : "disabled";
return state;
}
void ManagerImpl::setEchoCancelState (std::string state)
{
_debug ("Manager: Set echo suppress state: %s", state.c_str());
bool isEnabled = state == "enabled" ? true : false;
audioPreference.setEchoCancel (isEnabled);
if (_audiodriver) {
_audiodriver->setEchoCancelState (isEnabled);
}
}
std::string ManagerImpl::getNoiseSuppressState (void)
{
......
......@@ -619,12 +619,16 @@ class ManagerImpl
*/
std::string getCurrentAudioOutputPlugin (void);
std::string getEchoCancelState (void);
void setEchoCancelState (std::string state);
/**
* Get the noise reduction engin state from
* the current audio layer.
*/
std::string getNoiseSuppressState (void);
/**
* Set the noise reduction engin state in the current
* audio layer.
*/
void setNoiseSuppressState (std::string state);
/**
......
......@@ -489,7 +489,6 @@ AudioPreference::AudioPreference() : _cardin (atoi (ALSA_DFT_CARD)) // ALSA_DFT_
, _volumemic (atoi (DFT_VOL_SPKR_STR)) // DFT_VOL_SPKR_STR
, _volumespkr (atoi (DFT_VOL_MICRO_STR)) // DFT_VOL_MICRO_STR
, _noisereduce (true)
, _echocancel (true)
{
}
......@@ -536,8 +535,6 @@ void AudioPreference::serialize (Conf::YamlEmitter *emitter)
spkrstr << _volumespkr;
Conf::ScalarNode volumespkr (spkrstr.str()); //: 100
Conf::ScalarNode noise (_noisereduce ? "true":"false");
Conf::ScalarNode echo (_echocancel ? "true":"false");
preferencemap.setKeyValue (recordpathKey, &recordpath);
preferencemap.setKeyValue (volumemicKey, &volumemic);
preferencemap.setKeyValue (volumespkrKey, &volumespkr);
......@@ -556,7 +553,6 @@ void AudioPreference::serialize (Conf::YamlEmitter *emitter)
pulsepreferencemap.setKeyValue (deviceRingtoneKey, &deviceRingtone);
preferencemap.setKeyValue (noiseReduceKey, &noise);
preferencemap.setKeyValue (echocancelKey, &echo);
emitter->serializeAudioPreference (&preferencemap);
......@@ -603,13 +599,6 @@ void AudioPreference::unserialize (Conf::MappingNode *map)
val = NULL;
}
val = (Conf::ScalarNode *) (map->getValue (echocancelKey));
if (val) {
_echocancel = (val->getValue() == "true");
val = NULL;
}
alsamap = (Conf::MappingNode *) (map->getValue ("alsa"));
// did found alsa
......
......@@ -87,8 +87,6 @@ const Conf::Key recordpathKey ("recordpath");//: /home/msavard/Bureau
const Conf::Key volumemicKey ("volumemic");//: 100
const Conf::Key volumespkrKey ("volumespkr");//: 100
const Conf::Key noiseReduceKey ("noiseReduce");
const Conf::Key echocancelKey ("echocancel");
// shortcut preferences
const Conf::Key hangupShortKey ("hangUp");
......@@ -524,14 +522,6 @@ class AudioPreference : public Serializable
_noisereduce = noise;
}
bool getEchoCancel (void) {
return _echocancel;
}
void setEchoCancel (bool echo) {
_echocancel = echo;
}
private:
// alsa preference
......@@ -553,7 +543,6 @@ class AudioPreference : public Serializable
int _volumespkr; //: 100
bool _noisereduce;
bool _echocancel;
};
......
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