From c9f1e9c7e8963df8238491915d8974ea5b4fb588 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Rafa=C3=ABl=20Carr=C3=A9?=
 <rafael.carre@savoirfairelinux.com>
Date: Mon, 29 Aug 2011 15:40:12 -0400
Subject: [PATCH] Remove unused AudioProcessing class

---
 daemon/src/audio/Makefile.am                  |  2 -
 daemon/src/audio/alsa/alsalayer.cpp           |  1 -
 daemon/src/audio/audiolayer.cpp               |  1 -
 daemon/src/audio/audioprocessing.cpp          | 72 --------------
 daemon/src/audio/audioprocessing.h            | 94 -------------------
 .../audio/audiortp/AudioRtpRecordHandler.h    |  1 -
 daemon/src/audio/echocancel.h                 |  1 -
 daemon/src/audio/echosuppress.h               |  1 -
 daemon/src/audio/noisesuppress.h              |  1 -
 daemon/src/audio/pulseaudio/pulselayer.cpp    |  1 -
 10 files changed, 175 deletions(-)
 delete mode 100644 daemon/src/audio/audioprocessing.cpp
 delete mode 100644 daemon/src/audio/audioprocessing.h

diff --git a/daemon/src/audio/Makefile.am b/daemon/src/audio/Makefile.am
index 202aa78f28..a5c00578ea 100644
--- a/daemon/src/audio/Makefile.am
+++ b/daemon/src/audio/Makefile.am
@@ -18,7 +18,6 @@ libaudio_la_SOURCES = \
 		echosuppress.cpp \
 		speexechocancel.cpp \
 		noisesuppress.cpp \
-		audioprocessing.cpp \
 		gaincontrol.cpp \
 		dcblocker.cpp \
 		$(SPEEX_SOURCES_CPP)
@@ -38,7 +37,6 @@ noinst_HEADERS = \
 		echosuppress.h \
 		speexechocancel.h \
 		noisesuppress.h \
-		audioprocessing.h \
 		gaincontrol.h \
 		dcblocker.h \
 		samplerateconverter.h
diff --git a/daemon/src/audio/alsa/alsalayer.cpp b/daemon/src/audio/alsa/alsalayer.cpp
index 29f284f860..7505094acf 100644
--- a/daemon/src/audio/alsa/alsalayer.cpp
+++ b/daemon/src/audio/alsa/alsalayer.cpp
@@ -31,7 +31,6 @@
 
 #include "alsalayer.h"
 #include "audio/dcblocker.h"
-#include "audio/audioprocessing.h"
 #include "eventthread.h"
 #include "audio/samplerateconverter.h"
 #include "managerimpl.h"
diff --git a/daemon/src/audio/audiolayer.cpp b/daemon/src/audio/audiolayer.cpp
index b9a2a66ca7..354a185744 100644
--- a/daemon/src/audio/audiolayer.cpp
+++ b/daemon/src/audio/audiolayer.cpp
@@ -31,7 +31,6 @@
 
 #include <ctime>
 #include "audiolayer.h"
-#include "audioprocessing.h"
 #include "audio/dcblocker.h"
 #include "manager.h"
 
diff --git a/daemon/src/audio/audioprocessing.cpp b/daemon/src/audio/audioprocessing.cpp
deleted file mode 100644
index a728c99442..0000000000
--- a/daemon/src/audio/audioprocessing.cpp
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- *  Copyright (C) 2004, 2005, 2006, 2008, 2009, 2010, 2011 Savoir-Faire Linux Inc.
- *  Author: Alexandre Savard <alexandre.savard@savoirfairelinux.com>
- *
- *  This program is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 3 of the License, or
- *  (at your option) any later version.
- *
- *  This program is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- *  Additional permission under GNU GPL version 3 section 7:
- *
- *  If you modify this program, or any covered work, by linking or
- *  combining it with the OpenSSL project's OpenSSL library (or a
- *  modified version of that library), containing parts covered by the
- *  terms of the OpenSSL or SSLeay licenses, Savoir-Faire Linux Inc.
- *  grants you additional permission to convey the resulting work.
- *  Corresponding Source for a non-source form of such a combination
- *  shall include the source code for the parts of OpenSSL used as well
- *  as that of the covered work.
- */
-
-
-#include "audioprocessing.h"
-#include "audio/algorithm.h"
-
-AudioProcessing::AudioProcessing (Algorithm *_algo) : _algorithm (_algo) {}
-
-
-AudioProcessing::~AudioProcessing (void) {}
-
-void AudioProcessing::resetAlgorithm (void)
-{
-    if (_algorithm)
-        _algorithm->reset();
-}
-
-int AudioProcessing::getData (SFLDataFormat *outputData)
-{
-    if (_algorithm)
-        return _algorithm->getData (outputData);
-    else
-        return 0;
-}
-
-void AudioProcessing::putData (SFLDataFormat *inputData, int nbBytes)
-{
-    if (_algorithm)
-        _algorithm->putData (inputData, nbBytes);
-}
-
-void AudioProcessing::processAudio (SFLDataFormat *inputData, int nbBytes)
-{
-    if (_algorithm)
-        _algorithm->process (inputData, nbBytes);
-}
-
-int AudioProcessing::processAudio (SFLDataFormat *inputData, SFLDataFormat *outputData, int nbBytes)
-{
-    if (_algorithm)
-        return _algorithm->process (inputData, outputData, nbBytes);
-    else
-        return 0;
-}
diff --git a/daemon/src/audio/audioprocessing.h b/daemon/src/audio/audioprocessing.h
deleted file mode 100644
index 7f5a8de046..0000000000
--- a/daemon/src/audio/audioprocessing.h
+++ /dev/null
@@ -1,94 +0,0 @@
-/*
- *  Copyright (C) 2004, 2005, 2006, 2008, 2009, 2010, 2011 Savoir-Faire Linux Inc.
- *  Author: Alexandre Savard <alexandre.savard@savoirfairelinux.com>
- *
- *  This program is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 3 of the License, or
- *  (at your option) any later version.
- *
- *  This program is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- *  Additional permission under GNU GPL version 3 section 7:
- *
- *  If you modify this program, or any covered work, by linking or
- *  combining it with the OpenSSL project's OpenSSL library (or a
- *  modified version of that library), containing parts covered by the
- *  terms of the OpenSSL or SSLeay licenses, Savoir-Faire Linux Inc.
- *  grants you additional permission to convey the resulting work.
- *  Corresponding Source for a non-source form of such a combination
- *  shall include the source code for the parts of OpenSSL used as well
- *  as that of the covered work.
- */
-
-
-#ifndef AUDIOPROCESSING_H
-#define AUDIOPROCESSING_H
-
-#include "global.h"
-
-class Algorithm;
-
-/**
- * Process audio buffers using specified at instantiation which may be
- * changed dynamically at runtime.
- */
-class AudioProcessing
-{
-
-    public:
-
-        /**
-         * The constructor for this class
-         */
-        AudioProcessing (Algorithm *_algo);
-
-        ~AudioProcessing (void);
-
-        /**
-         * Set a new algorithm to process audio. Algorithm must be a subclass of abstract class Algorithm
-         */
-        void setAlgorithm (Algorithm *_algo) {
-            _algorithm = _algo;
-        }
-
-
-        /**
-         * Reset parameters for the algorithm
-         */
-        void resetAlgorithm();
-
-        /**
-         * Put data in internal buffer
-         */
-        void putData (SFLDataFormat *inputData, int nbBytes);
-
-        /**
-         * Get data from internal buffer
-         */
-        int getData (SFLDataFormat *outputData);
-
-        /**
-         * Process some audio data
-         */
-        void processAudio (SFLDataFormat *inputData, int nbBytes);
-
-        /**
-         * Process some audio data
-         */
-        int processAudio (SFLDataFormat *inputData, SFLDataFormat *outputData, int nbBytes);
-
-    private:
-
-        Algorithm *_algorithm;
-
-};
-
-#endif
diff --git a/daemon/src/audio/audiortp/AudioRtpRecordHandler.h b/daemon/src/audio/audiortp/AudioRtpRecordHandler.h
index 5bd3aad367..34da9372d2 100644
--- a/daemon/src/audio/audiortp/AudioRtpRecordHandler.h
+++ b/daemon/src/audio/audiortp/AudioRtpRecordHandler.h
@@ -39,7 +39,6 @@ using std::ptrdiff_t;
 #include "sip/sipcall.h"
 #include "audio/codecs/audiocodec.h"
 #include "audio/samplerateconverter.h"
-#include "audio/audioprocessing.h"
 #include "audio/noisesuppress.h"
 #include "audio/speexechocancel.h"
 #include "audio/echosuppress.h"
diff --git a/daemon/src/audio/echocancel.h b/daemon/src/audio/echocancel.h
index 66802d89f2..acca59c0b0 100644
--- a/daemon/src/audio/echocancel.h
+++ b/daemon/src/audio/echocancel.h
@@ -35,7 +35,6 @@
 #include <cc++/thread.h>
 #include <speex/speex_preprocess.h>
 
-#include "audioprocessing.h"
 #include "ringbuffer.h"
 #include "delaydetection.h"
 
diff --git a/daemon/src/audio/echosuppress.h b/daemon/src/audio/echosuppress.h
index 3df72f13a4..cb34d964a3 100644
--- a/daemon/src/audio/echosuppress.h
+++ b/daemon/src/audio/echosuppress.h
@@ -11,7 +11,6 @@
 #include "pjmedia/echo.h"
 #include "pj/pool.h"
 
-#include "audioprocessing.h"
 #include "audio/algorithm.h"
 
 class EchoSuppress : public Algorithm {
diff --git a/daemon/src/audio/noisesuppress.h b/daemon/src/audio/noisesuppress.h
index 19897cb4b0..485c94f8bf 100644
--- a/daemon/src/audio/noisesuppress.h
+++ b/daemon/src/audio/noisesuppress.h
@@ -33,7 +33,6 @@
 
 #include <speex/speex_preprocess.h>
 #include "algorithm.h"
-#include "audioprocessing.h"
 
 
 class NoiseSuppress : public Algorithm
diff --git a/daemon/src/audio/pulseaudio/pulselayer.cpp b/daemon/src/audio/pulseaudio/pulselayer.cpp
index 1226f1b4b0..fa0f1ff917 100644
--- a/daemon/src/audio/pulseaudio/pulselayer.cpp
+++ b/daemon/src/audio/pulseaudio/pulselayer.cpp
@@ -33,7 +33,6 @@
 #include "audiostream.h"
 #include "pulselayer.h"
 #include "audio/samplerateconverter.h"
-#include "audio/audioprocessing.h"
 #include "audio/dcblocker.h"
 #include "managerimpl.h"
 
-- 
GitLab