diff --git a/src/Makefile.am b/src/Makefile.am index 8ef596118265105b0dea2fee604c81b60eb5a3a3..705794de16efad0f6fe5d75bf6202984952ae009 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -12,9 +12,9 @@ endif SUBDIRS = audio config gui $(ZEROCONFDIR) -sflphoned_SOURCES = call.cpp eventthread.cpp error.cpp main.cpp sipvoiplink.cpp voIPLink.cpp \ +sflphoned_SOURCES = call.cpp eventthread.cpp main.cpp sipvoiplink.cpp voIPLink.cpp \ sipcall.cpp managerimpl.cpp managerimpl.h manager.h global.h \ - eventthread.h error.h \ + eventthread.h \ sipvoiplink.h user_cfg.h call.h voIPLink.h sipcall.h \ observer.cpp diff --git a/src/audio/audiolayer.h b/src/audio/audiolayer.h index 8349d9e6558f456e4e96c30aa1b98c7a31c3d313..5112b48c4cbdfcc3626d29afa6def0ef54e8535d 100644 --- a/src/audio/audiolayer.h +++ b/src/audio/audiolayer.h @@ -25,7 +25,6 @@ #include "portaudiocpp/PortAudioCpp.hxx" - #include "../global.h" #include "ringbuffer.h" #include <cc++/thread.h> diff --git a/src/audio/ringbuffer.h b/src/audio/ringbuffer.h index c0ba8027a90bd89155a85976019ee02b8d399693..02c4a1e8f01695bcc72aea801d88a68843a60f27 100644 --- a/src/audio/ringbuffer.h +++ b/src/audio/ringbuffer.h @@ -22,15 +22,10 @@ #ifndef __RING_BUFFER__ #define __RING_BUFFER__ - #include <cc++/thread.h> -#include "../global.h" - - typedef unsigned char* samplePtr; -// template <typename T> class RingBuffer { public: RingBuffer(int size); @@ -55,7 +50,6 @@ class RingBuffer { int Len() const; private: - // T getNextSample(void); int mStart; int mEnd; diff --git a/src/error.cpp b/src/error.cpp deleted file mode 100644 index f27ec012151817e589cdbb402bf0d4776a2d1259..0000000000000000000000000000000000000000 --- a/src/error.cpp +++ /dev/null @@ -1,70 +0,0 @@ -/** - * Copyright (C) 2004-2005 Savoir-Faire Linux inc. - * Author: Yan Morin <yan.morin@savoirfairelinux.com> - * Author: Laurielle Lea <laurielle.lea@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 2 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. - */ - -#include <string> - -#include "global.h" -#include "error.h" -#include "manager.h" - -Error::Error (){ - issetError = 0; -} - -int -Error::errorName (Error_enum num_name) { - switch (num_name){ - // Handle opening device errors - case OPEN_FAILED_DEVICE: - Manager::instance().displayError("Open device failed "); - issetError = 2; - break; - - // Handle setup errors - case HOST_PART_FIELD_EMPTY: - Manager::instance().displayError("Fill host part field"); - issetError = 2; - break; - case USER_PART_FIELD_EMPTY: - Manager::instance().displayError("Fill user part field"); - issetError = 2; - break; - case PASSWD_FIELD_EMPTY: - Manager::instance().displayError("Fill password field"); - issetError = 2; - break; - - // Handle sip uri - case FROM_ERROR: - Manager::instance().displayError("Error for 'From' header"); - issetError = 1; - break; - case TO_ERROR: - Manager::instance().displayError("Error for 'To' header"); - issetError = 1; - break; - - default: - issetError = 0; - break; - } - return issetError; -} - diff --git a/src/error.h b/src/error.h deleted file mode 100644 index 93db4e034e06540eccd7830b1b13de1f5d8b3b03..0000000000000000000000000000000000000000 --- a/src/error.h +++ /dev/null @@ -1,53 +0,0 @@ -/** - * Copyright (C) 2004-2005 Savoir-Faire Linux inc. - * Author: Yan Morin <yan.morin@savoirfairelinux.com> - * Author: Laurielle Lea <laurielle.lea@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 2 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. - */ - -#ifndef __ERROR_H__ -#define __ERROR_H__ - -#include <stdio.h> - - -typedef enum { - OPEN_FAILED_DEVICE = 0, - - HOST_PART_FIELD_EMPTY, - USER_PART_FIELD_EMPTY, - PASSWD_FIELD_EMPTY, - - FROM_ERROR, - TO_ERROR - -} Error_enum; - -class Error { -public: - Error (); - ~Error (void) {}; - - int errorName (Error_enum); - inline int getError (void) { return issetError; } - inline void setError(int err) { issetError = err; } - -private: - int issetError; - -}; - -#endif // __ERROR_H__ diff --git a/src/managerimpl.cpp b/src/managerimpl.cpp index 704f633c1901bcfde9ee515e45aebe75c27de60b..2b97be5efbb24bf4830d43552cbbd63776b1fb8c 100644 --- a/src/managerimpl.cpp +++ b/src/managerimpl.cpp @@ -42,7 +42,7 @@ #include "audio/tonelist.h" #include "call.h" -#include "error.h" +//#include "error.h" #include "user_cfg.h" #include "voIPLink.h" #include "gui/guiframework.h" @@ -62,7 +62,7 @@ ManagerImpl::ManagerImpl (void) { // Init private variables - _error = new Error(); + //_error = new Error(); _hasZeroconf = false; #ifdef USE_ZEROCONF @@ -107,7 +107,7 @@ ManagerImpl::~ManagerImpl (void) delete _DNSService; _DNSService = NULL; #endif - delete _error; _error = NULL; + //delete _error; _error = NULL; _debug("%s stop correctly.\n", PROGNAME); } diff --git a/src/managerimpl.h b/src/managerimpl.h index bda3c92b65d2c709c796c681e4ae23b71e826d1f..7b20064f2eb6e92bf3cc01271e6ac7836df3d5d5 100644 --- a/src/managerimpl.h +++ b/src/managerimpl.h @@ -36,7 +36,7 @@ class AudioLayer; class CodecDescriptor; -class Error; +//class Error; class GuiFramework; class ToneGenerator; @@ -92,7 +92,7 @@ public: void setGui (GuiFramework* gui); // Accessor to error - Error* error(void) const { return _error; } + //Error* error(void) const { return _error; } // Accessor to audiodriver // it multi-thread and use mutex internally @@ -332,7 +332,7 @@ private: ost::Mutex _toneMutex; int _toneType; - Error* _error; + //Error* _error; GuiFramework* _gui; AudioLayer* _audiodriverPA; DTMF _key; diff --git a/src/sipvoiplink.cpp b/src/sipvoiplink.cpp index 5ccc5631e18c0d5b76b6730ea062cfabb39e47ee..c62464975b5c7274517721769aa7b43031d8d7f0 100644 --- a/src/sipvoiplink.cpp +++ b/src/sipvoiplink.cpp @@ -25,7 +25,6 @@ #include "sipvoiplink.h" #include "global.h" #include "audio/codecDescriptor.h" -#include "error.h" #include "manager.h" #include "sipcall.h" #include "user_cfg.h" @@ -226,8 +225,6 @@ SipVoIPLink::setRegister (void) } eXosip_unlock(); - manager.error()->setError(0); - // subscribe to message one time? // subscribeMessageSummary(); @@ -270,7 +267,6 @@ SipVoIPLink::setUnregister (void) return -1; } eXosip_unlock(); - Manager::instance().error()->setError(0); return i; } else { // no registration send before @@ -1349,11 +1345,11 @@ SipVoIPLink::startCall (CALLID id, const std::string& from, const std::string& t osip_message_t *invite; if (checkUrl(from) != 0) { - Manager::instance().displayConfigError("Error for 'From' header"); + Manager::instance().displayConfigError("Error in source address"); return -1; } if (checkUrl(to) != 0) { - Manager::instance().error()->errorName(TO_ERROR); + Manager::instance().displayErrorText(id, "Error in destination address"); return -1; }