From 1409b32eebafa76df32fe271df137daa24093bfe Mon Sep 17 00:00:00 2001
From: Tristan Matthews <tristan.matthews@savoirfairelinux.com>
Date: Tue, 5 Mar 2013 16:04:07 -0500
Subject: [PATCH] * #21184: daemon: remove unused echo state

---
 .../dbus/configurationmanager-introspec.xml   | 22 +----------
 daemon/src/dbus/configurationmanager.cpp      | 20 ----------
 daemon/src/dbus/configurationmanager.h        |  4 --
 daemon/src/managerimpl.cpp                    | 20 ----------
 daemon/src/managerimpl.h                      |  8 ----
 daemon/src/preferences.cpp                    | 12 ------
 daemon/src/preferences.h                      | 18 ---------
 .../dbus/configurationmanager-introspec.xml   | 22 +----------
 gnome/src/dbus/dbus.c                         | 38 -------------------
 9 files changed, 2 insertions(+), 162 deletions(-)

diff --git a/daemon/src/dbus/configurationmanager-introspec.xml b/daemon/src/dbus/configurationmanager-introspec.xml
index ebdc88067c..bc6f3d7b9d 100644
--- a/daemon/src/dbus/configurationmanager-introspec.xml
+++ b/daemon/src/dbus/configurationmanager-introspec.xml
@@ -358,29 +358,9 @@
                </arg>
        </method>
 
-       <method name="setEchoCancelTailLength" tp:name-for-bindings="setEchoCancelTailLength">
-           <arg type="i" name="index" direction="in">
-           </arg>
-       </method>
-
-       <method name="getEchoCancelTailLength" tp:name-for-bindings="getEchoCancelTailLength">
-           <arg type="i" name="index" direction="out">
-           </arg>
-       </method>
-
-       <method name="setEchoCancelDelay" tp:name-for-bindings="setEchoCancelDelay">
-           <arg type="i" name="index" direction="in">
-           </arg>
-       </method>
-
-       <method name="getEchoCancelDelay" tp:name-for-bindings="getEchoCancelDelay">
-           <arg type="i" name="index" direction="out">
-           </arg>
-       </method>
-
        <!--    General Settings Panel         -->
 
-       <method name="getNoiseSuppressState" tp:name-for-bindings="getEchoCancelState">
+       <method name="getNoiseSuppressState" tp:name-for-bindings="getNoiseSuppressState">
            <arg type="s" name="state" direction="out">
            </arg>
        </method>
diff --git a/daemon/src/dbus/configurationmanager.cpp b/daemon/src/dbus/configurationmanager.cpp
index 8343657fa4..d0f9c29e8e 100644
--- a/daemon/src/dbus/configurationmanager.cpp
+++ b/daemon/src/dbus/configurationmanager.cpp
@@ -341,26 +341,6 @@ void ConfigurationManager::setEchoCancelState(const std::string& state)
     Manager::instance().setEchoCancelState(state);
 }
 
-int ConfigurationManager::getEchoCancelTailLength()
-{
-    return Manager::instance().getEchoCancelTailLength();
-}
-
-void ConfigurationManager::setEchoCancelTailLength(const int32_t& length)
-{
-    Manager::instance().setEchoCancelTailLength(length);
-}
-
-int ConfigurationManager::getEchoCancelDelay()
-{
-    return Manager::instance().getEchoCancelDelay();
-}
-
-void ConfigurationManager::setEchoCancelDelay(const int32_t& delay)
-{
-    Manager::instance().setEchoCancelDelay(delay);
-}
-
 int32_t ConfigurationManager::isIax2Enabled()
 {
     return HAVE_IAX;
diff --git a/daemon/src/dbus/configurationmanager.h b/daemon/src/dbus/configurationmanager.h
index 56f851e220..65277d3e79 100644
--- a/daemon/src/dbus/configurationmanager.h
+++ b/daemon/src/dbus/configurationmanager.h
@@ -92,10 +92,6 @@ class ConfigurationManager
         void setNoiseSuppressState(const std::string& state);
         std::string getEchoCancelState();
         void setEchoCancelState(const std::string& state);
-        void setEchoCancelTailLength(const int32_t& length);
-        int getEchoCancelTailLength();
-        void setEchoCancelDelay(const int32_t& length);
-        int getEchoCancelDelay();
 
         std::map<std::string, std::string> getRingtoneList();
 
diff --git a/daemon/src/managerimpl.cpp b/daemon/src/managerimpl.cpp
index f91a363761..cf2817fa90 100644
--- a/daemon/src/managerimpl.cpp
+++ b/daemon/src/managerimpl.cpp
@@ -2215,26 +2215,6 @@ void ManagerImpl::setEchoCancelState(const std::string &state)
     audioPreference.setEchoCancel(state == "enabled");
 }
 
-int ManagerImpl::getEchoCancelTailLength() const
-{
-    return audioPreference.getEchoCancelTailLength();
-}
-
-void ManagerImpl::setEchoCancelTailLength(int length)
-{
-    audioPreference.setEchoCancelTailLength(length);
-}
-
-int ManagerImpl::getEchoCancelDelay() const
-{
-    return audioPreference.getEchoCancelDelay();
-}
-
-void ManagerImpl::setEchoCancelDelay(int delay)
-{
-    audioPreference.setEchoCancelDelay(delay);
-}
-
 /**
  * Initialization: Main Thread
  */
diff --git a/daemon/src/managerimpl.h b/daemon/src/managerimpl.h
index 041e03d82c..3c8e527d96 100644
--- a/daemon/src/managerimpl.h
+++ b/daemon/src/managerimpl.h
@@ -581,14 +581,6 @@ class ManagerImpl {
          */
         void setEchoCancelState(const std::string &state);
 
-        int getEchoCancelTailLength() const;
-
-        void setEchoCancelTailLength(int);
-
-        int getEchoCancelDelay() const;
-
-        void setEchoCancelDelay(int);
-
         /**
          * Convert a list of payload in a special format, readable by the server.
          * Required format: payloads separated with one slash.
diff --git a/daemon/src/preferences.cpp b/daemon/src/preferences.cpp
index d6c35e295c..dba4c6f31e 100644
--- a/daemon/src/preferences.cpp
+++ b/daemon/src/preferences.cpp
@@ -95,8 +95,6 @@ static const char * const VOLUMEMIC_KEY = "volumeMic";
 static const char * const VOLUMESPKR_KEY = "volumeSpkr";
 static const char * const NOISE_REDUCE_KEY = "noiseReduce";
 static const char * const ECHO_CANCEL_KEY = "echoCancel";
-static const char * const ECHO_TAIL_KEY = "echoTailLength";
-static const char * const ECHO_DELAY_KEY = "echoDelayLength";
 
 // shortcut preferences
 static const char * const HANGUP_SHORT_KEY = "hangUp";
@@ -296,8 +294,6 @@ AudioPreference::AudioPreference() :
     , volumespkr_(atoi(DFT_VOL_MICRO_STR))
     , noisereduce_(true)
     , echocancel_(false)
-    , echoCancelTailLength_(100)
-    , echoCancelDelay_(0)
 {}
 
 namespace {
@@ -374,12 +370,6 @@ void AudioPreference::serialize(Conf::YamlEmitter &emitter)
     Conf::ScalarNode volumespkr(spkrstr.str()); //: 100
     Conf::ScalarNode noise(noisereduce_);
     Conf::ScalarNode echo(echocancel_);
-    std::stringstream tailstr;
-    tailstr << echoCancelTailLength_;
-    Conf::ScalarNode echotail(tailstr.str());
-    std::stringstream delaystr;
-    delaystr << echoCancelDelay_;
-    Conf::ScalarNode echodelay(delaystr.str());
 
     Conf::MappingNode preferencemap(NULL);
     preferencemap.setKeyValue(AUDIO_API_KEY, &audioapi);
@@ -406,8 +396,6 @@ void AudioPreference::serialize(Conf::YamlEmitter &emitter)
 
     preferencemap.setKeyValue(NOISE_REDUCE_KEY, &noise);
     preferencemap.setKeyValue(ECHO_CANCEL_KEY, &echo);
-    preferencemap.setKeyValue(ECHO_TAIL_KEY, &echotail);
-    preferencemap.setKeyValue(ECHO_DELAY_KEY, &echodelay);
 
     emitter.serializePreference(&preferencemap, "audio");
 }
diff --git a/daemon/src/preferences.h b/daemon/src/preferences.h
index 4a9b72f119..e05db5d991 100644
--- a/daemon/src/preferences.h
+++ b/daemon/src/preferences.h
@@ -338,22 +338,6 @@ class AudioPreference : public Serializable {
             echocancel_ = echo;
         }
 
-        int getEchoCancelTailLength() const {
-            return echoCancelTailLength_;
-        }
-
-        void setEchoCancelTailLength(int length) {
-            echoCancelTailLength_ = length;
-        }
-
-        int getEchoCancelDelay() const {
-            return echoCancelDelay_;
-        }
-
-        void setEchoCancelDelay(int delay) {
-            echoCancelDelay_ = delay;
-        }
-
     private:
         std::string audioApi_;
 
@@ -377,8 +361,6 @@ class AudioPreference : public Serializable {
 
         bool noisereduce_;
         bool echocancel_;
-        int echoCancelTailLength_;
-        int echoCancelDelay_;
 };
 
 class ShortcutPreferences : public Serializable {
diff --git a/gnome/src/dbus/configurationmanager-introspec.xml b/gnome/src/dbus/configurationmanager-introspec.xml
index ebdc88067c..bc6f3d7b9d 100644
--- a/gnome/src/dbus/configurationmanager-introspec.xml
+++ b/gnome/src/dbus/configurationmanager-introspec.xml
@@ -358,29 +358,9 @@
                </arg>
        </method>
 
-       <method name="setEchoCancelTailLength" tp:name-for-bindings="setEchoCancelTailLength">
-           <arg type="i" name="index" direction="in">
-           </arg>
-       </method>
-
-       <method name="getEchoCancelTailLength" tp:name-for-bindings="getEchoCancelTailLength">
-           <arg type="i" name="index" direction="out">
-           </arg>
-       </method>
-
-       <method name="setEchoCancelDelay" tp:name-for-bindings="setEchoCancelDelay">
-           <arg type="i" name="index" direction="in">
-           </arg>
-       </method>
-
-       <method name="getEchoCancelDelay" tp:name-for-bindings="getEchoCancelDelay">
-           <arg type="i" name="index" direction="out">
-           </arg>
-       </method>
-
        <!--    General Settings Panel         -->
 
-       <method name="getNoiseSuppressState" tp:name-for-bindings="getEchoCancelState">
+       <method name="getNoiseSuppressState" tp:name-for-bindings="getNoiseSuppressState">
            <arg type="s" name="state" direction="out">
            </arg>
        </method>
diff --git a/gnome/src/dbus/dbus.c b/gnome/src/dbus/dbus.c
index b3d3707c11..68e688856a 100644
--- a/gnome/src/dbus/dbus.c
+++ b/gnome/src/dbus/dbus.c
@@ -1451,44 +1451,6 @@ dbus_set_echo_cancel_state(const gchar *state)
     check_error(error);
 }
 
-int
-dbus_get_echo_cancel_tail_length(void)
-{
-    GError *error = NULL;
-    int length = 0;
-    org_sflphone_SFLphone_ConfigurationManager_get_echo_cancel_tail_length(config_proxy, &length, &error);
-    check_error(error);
-    return length;
-}
-
-void
-dbus_set_echo_cancel_tail_length(int length)
-{
-    GError *error = NULL;
-    org_sflphone_SFLphone_ConfigurationManager_set_echo_cancel_tail_length(config_proxy, length, &error);
-    check_error(error);
-}
-
-int
-dbus_get_echo_cancel_delay(void)
-{
-    GError *error = NULL;
-    int delay = 0;
-    org_sflphone_SFLphone_ConfigurationManager_get_echo_cancel_delay(config_proxy, &delay, &error);
-    check_error(error);
-
-    return delay;
-}
-
-void
-dbus_set_echo_cancel_delay(int delay)
-{
-    GError *error = NULL;
-    org_sflphone_SFLphone_ConfigurationManager_set_echo_cancel_delay(config_proxy, delay, &error);
-    check_error(error);
-}
-
-
 int
 dbus_is_iax2_enabled()
 {
-- 
GitLab