Skip to content
Snippets Groups Projects
Commit 65eb4448 authored by yanmorin's avatar yanmorin
Browse files

Removing error class
parent afeae31b
Branches
Tags
No related merge requests found
...@@ -12,9 +12,9 @@ endif ...@@ -12,9 +12,9 @@ endif
SUBDIRS = audio config gui $(ZEROCONFDIR) 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 \ 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 \ sipvoiplink.h user_cfg.h call.h voIPLink.h sipcall.h \
observer.cpp observer.cpp
......
...@@ -25,7 +25,6 @@ ...@@ -25,7 +25,6 @@
#include "portaudiocpp/PortAudioCpp.hxx" #include "portaudiocpp/PortAudioCpp.hxx"
#include "../global.h" #include "../global.h"
#include "ringbuffer.h" #include "ringbuffer.h"
#include <cc++/thread.h> #include <cc++/thread.h>
......
...@@ -22,15 +22,10 @@ ...@@ -22,15 +22,10 @@
#ifndef __RING_BUFFER__ #ifndef __RING_BUFFER__
#define __RING_BUFFER__ #define __RING_BUFFER__
#include <cc++/thread.h> #include <cc++/thread.h>
#include "../global.h"
typedef unsigned char* samplePtr; typedef unsigned char* samplePtr;
// template <typename T>
class RingBuffer { class RingBuffer {
public: public:
RingBuffer(int size); RingBuffer(int size);
...@@ -55,7 +50,6 @@ class RingBuffer { ...@@ -55,7 +50,6 @@ class RingBuffer {
int Len() const; int Len() const;
private: private:
// T getNextSample(void);
int mStart; int mStart;
int mEnd; int mEnd;
......
/**
* 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;
}
/**
* 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__
...@@ -42,7 +42,7 @@ ...@@ -42,7 +42,7 @@
#include "audio/tonelist.h" #include "audio/tonelist.h"
#include "call.h" #include "call.h"
#include "error.h" //#include "error.h"
#include "user_cfg.h" #include "user_cfg.h"
#include "voIPLink.h" #include "voIPLink.h"
#include "gui/guiframework.h" #include "gui/guiframework.h"
...@@ -62,7 +62,7 @@ ...@@ -62,7 +62,7 @@
ManagerImpl::ManagerImpl (void) ManagerImpl::ManagerImpl (void)
{ {
// Init private variables // Init private variables
_error = new Error(); //_error = new Error();
_hasZeroconf = false; _hasZeroconf = false;
#ifdef USE_ZEROCONF #ifdef USE_ZEROCONF
...@@ -107,7 +107,7 @@ ManagerImpl::~ManagerImpl (void) ...@@ -107,7 +107,7 @@ ManagerImpl::~ManagerImpl (void)
delete _DNSService; _DNSService = NULL; delete _DNSService; _DNSService = NULL;
#endif #endif
delete _error; _error = NULL; //delete _error; _error = NULL;
_debug("%s stop correctly.\n", PROGNAME); _debug("%s stop correctly.\n", PROGNAME);
} }
......
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
class AudioLayer; class AudioLayer;
class CodecDescriptor; class CodecDescriptor;
class Error; //class Error;
class GuiFramework; class GuiFramework;
class ToneGenerator; class ToneGenerator;
...@@ -92,7 +92,7 @@ public: ...@@ -92,7 +92,7 @@ public:
void setGui (GuiFramework* gui); void setGui (GuiFramework* gui);
// Accessor to error // Accessor to error
Error* error(void) const { return _error; } //Error* error(void) const { return _error; }
// Accessor to audiodriver // Accessor to audiodriver
// it multi-thread and use mutex internally // it multi-thread and use mutex internally
...@@ -332,7 +332,7 @@ private: ...@@ -332,7 +332,7 @@ private:
ost::Mutex _toneMutex; ost::Mutex _toneMutex;
int _toneType; int _toneType;
Error* _error; //Error* _error;
GuiFramework* _gui; GuiFramework* _gui;
AudioLayer* _audiodriverPA; AudioLayer* _audiodriverPA;
DTMF _key; DTMF _key;
......
...@@ -25,7 +25,6 @@ ...@@ -25,7 +25,6 @@
#include "sipvoiplink.h" #include "sipvoiplink.h"
#include "global.h" #include "global.h"
#include "audio/codecDescriptor.h" #include "audio/codecDescriptor.h"
#include "error.h"
#include "manager.h" #include "manager.h"
#include "sipcall.h" #include "sipcall.h"
#include "user_cfg.h" #include "user_cfg.h"
...@@ -226,8 +225,6 @@ SipVoIPLink::setRegister (void) ...@@ -226,8 +225,6 @@ SipVoIPLink::setRegister (void)
} }
eXosip_unlock(); eXosip_unlock();
manager.error()->setError(0);
// subscribe to message one time? // subscribe to message one time?
// subscribeMessageSummary(); // subscribeMessageSummary();
...@@ -270,7 +267,6 @@ SipVoIPLink::setUnregister (void) ...@@ -270,7 +267,6 @@ SipVoIPLink::setUnregister (void)
return -1; return -1;
} }
eXosip_unlock(); eXosip_unlock();
Manager::instance().error()->setError(0);
return i; return i;
} else { } else {
// no registration send before // no registration send before
...@@ -1349,11 +1345,11 @@ SipVoIPLink::startCall (CALLID id, const std::string& from, const std::string& t ...@@ -1349,11 +1345,11 @@ SipVoIPLink::startCall (CALLID id, const std::string& from, const std::string& t
osip_message_t *invite; osip_message_t *invite;
if (checkUrl(from) != 0) { if (checkUrl(from) != 0) {
Manager::instance().displayConfigError("Error for 'From' header"); Manager::instance().displayConfigError("Error in source address");
return -1; return -1;
} }
if (checkUrl(to) != 0) { if (checkUrl(to) != 0) {
Manager::instance().error()->errorName(TO_ERROR); Manager::instance().displayErrorText(id, "Error in destination address");
return -1; return -1;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment