Commit 7d410955 authored by llea's avatar llea

Clean up code

parent 4ecd714b
SFLphone (0.4)
* Reorganisation of SFLphone architecture
SFLphone (0.3.1) / 2005-04-21 SFLphone (0.3.1) / 2005-05-27
* Reorganisation of SFLphone architecture
* Handle error messages on screen * Handle error messages on screen
* Handle refused call * Handle refused call
* Notification of remote RINGING event added * Notification of remote RINGING event added
* Management of lines updated * Call management updated
SFLphone (0.3) / 2005-04-05 SFLphone (0.3) / 2005-04-05
* ALSA driver support added * ALSA driver support added
......
This is SFLPhone-0.3 release. This is SFLPhone-0.3.1 release.
You need ccrtp-1.3.0 which needs commoncpp2>=1.3.0 You need ccrtp-1.3.0 which needs commoncpp2>=1.3.0
libeXosip-0.9.0 needs libosip2-2.2.0 libeXosip-0.9.0 needs libosip2-2.2.0
...@@ -42,6 +42,9 @@ make install ...@@ -42,6 +42,9 @@ make install
How to use it ? How to use it ?
--------------- ---------------
If you have old version, remove your sflphonerc file located in $HOME/.sflphone
1. Lauch it, a setup window appears. 1. Lauch it, a setup window appears.
2. If you do have a SIP account, fill the SIP stuff where related. You can use 2. If you do have a SIP account, fill the SIP stuff where related. You can use
......
...@@ -72,8 +72,6 @@ OBJS = \ ...@@ -72,8 +72,6 @@ OBJS = \
gui/qt/configurationpanelui.moc.o \ gui/qt/configurationpanelui.moc.o \
gui/qt/url_inputui.o \ gui/qt/url_inputui.o \
gui/qt/url_inputui.moc.o \ gui/qt/url_inputui.moc.o \
gui/qt/voIPLinkmanagementui.o \
gui/qt/voIPLinkmanagementui.moc.o \
main.o \ main.o \
manager.o \ manager.o \
sipcall.o \ sipcall.o \
...@@ -97,16 +95,12 @@ endif ...@@ -97,16 +95,12 @@ endif
.cpp.o: .cpp.o:
$(CXX) $(DEFVARS) $(CXXFLAGS) -c -o $@ $< $(CXX) $(DEFVARS) $(CXXFLAGS) -c -o $@ $<
prereq: gui/qt/phonebook.ui gui/qt/url_input.ui gui/qt/configurationpanel.ui gui/qt/voIPLinkmanagement.ui prereq: gui/qt/url_input.ui gui/qt/configurationpanel.ui
@echo "Making User Interface files..." @echo "Making User Interface files..."
$(UIC) -o gui/qt/phonebookui.h gui/qt/phonebook.ui
$(UIC) -o gui/qt/phonebookui.cpp -impl gui/qt/phonebookui.h gui/qt/phonebook.ui
$(UIC) -o gui/qt/url_inputui.h gui/qt/url_input.ui $(UIC) -o gui/qt/url_inputui.h gui/qt/url_input.ui
$(UIC) -o gui/qt/url_inputui.cpp -impl gui/qt/url_inputui.h gui/qt/url_input.ui $(UIC) -o gui/qt/url_inputui.cpp -impl gui/qt/url_inputui.h gui/qt/url_input.ui
$(UIC) -o gui/qt/configurationpanelui.h gui/qt/configurationpanel.ui $(UIC) -o gui/qt/configurationpanelui.h gui/qt/configurationpanel.ui
$(UIC) -o gui/qt/configurationpanelui.cpp -impl gui/qt/configurationpanelui.h gui/qt/configurationpanel.ui $(UIC) -o gui/qt/configurationpanelui.cpp -impl gui/qt/configurationpanelui.h gui/qt/configurationpanel.ui
$(UIC) -o gui/qt/voIPLinkmanagementui.h gui/qt/voIPLinkmanagement.ui
$(UIC) -o gui/qt/voIPLinkmanagementui.cpp -impl gui/qt/voIPLinkmanagementui.h gui/qt/voIPLinkmanagement.ui
%.moc.cpp: %.h %.moc.cpp: %.h
$(MOC) -o $@ $< $(MOC) -o $@ $<
......
...@@ -326,7 +326,6 @@ AudioRtpRTX::run (void) { ...@@ -326,7 +326,6 @@ AudioRtpRTX::run (void) {
TimerPort::incTimer(frameSize); // 'frameSize' ms TimerPort::incTimer(frameSize); // 'frameSize' ms
} }
// AudioCodec::destroy(_ca->payload);
delete[] data_for_speakers; delete[] data_for_speakers;
delete[] data_from_mic; delete[] data_from_mic;
delete[] data_from_mic_tmp; delete[] data_from_mic_tmp;
......
...@@ -164,7 +164,6 @@ void DTMFGenerator::getNextSamples(short* buffer, size_t n) throw(DTMFException) ...@@ -164,7 +164,6 @@ void DTMFGenerator::getNextSamples(short* buffer, size_t n) throw(DTMFException)
*/ */
short* DTMFGenerator::generateSample(unsigned char code) throw (DTMFException) { short* DTMFGenerator::generateSample(unsigned char code) throw (DTMFException) {
short* ptr; short* ptr;
// double arg1, arg2;
// try { // try {
ptr = new short[SAMPLING_RATE]; ptr = new short[SAMPLING_RATE];
...@@ -172,16 +171,6 @@ short* DTMFGenerator::generateSample(unsigned char code) throw (DTMFException) { ...@@ -172,16 +171,6 @@ short* DTMFGenerator::generateSample(unsigned char code) throw (DTMFException) {
//throw new DTMFException("No memory left"); //throw new DTMFException("No memory left");
return 0; return 0;
} }
#if 0
arg1 = (double)2 * (double)M_PI * (double)tones[code].higher / (double)SAMPLING_RATE;
arg2 = (double)2 * (double)M_PI * (double)tones[code].lower / (double)SAMPLING_RATE;
for(unsigned int i = 0; i < SAMPLING_RATE; i++) {
ptr[i] = (short)((double)(AMPLITUDE >> 2) * sin(arg1 * i) + (double)(AMPLITUDE >> 2) * sin(arg2 * i));
};
return ptr;
#endif
generateSin(tones[code].higher, tones[code].lower, AMPLITUDE, generateSin(tones[code].higher, tones[code].lower, AMPLITUDE,
SAMPLING_RATE, ptr); SAMPLING_RATE, ptr);
......
...@@ -51,9 +51,6 @@ public: ...@@ -51,9 +51,6 @@ public:
class DTMFGenerator : public ToneGenerator class DTMFGenerator : public ToneGenerator
{ {
private: private:
// unsigned int samplingRate; // Sampling rate used, default is 8000 Hz
// short amplitude; // Amplitude of the resulting signal
struct DTMFTone { struct DTMFTone {
unsigned char code; // Code of the tone unsigned char code; // Code of the tone
int lower; // Lower frequency int lower; // Lower frequency
......
...@@ -18,19 +18,11 @@ ...@@ -18,19 +18,11 @@
*/ */
#include <iostream> #include <iostream>
//#include "audio/audiocodec.h"
#include "call.h" #include "call.h"
#include "manager.h" #include "manager.h"
#include "sipvoiplink.h" #include "sipvoiplink.h"
#include "voIPLink.h" #include "voIPLink.h"
Call::Call (void)
{
initConstructor();
_id = 0;
_manager = NULL;
_voIPLink = NULL;
}
Call::Call (Manager* manager, short id, CallType type, VoIPLink* voiplink) Call::Call (Manager* manager, short id, CallType type, VoIPLink* voiplink)
{ {
...@@ -104,13 +96,6 @@ Call::getVoIPLink (void) ...@@ -104,13 +96,6 @@ Call::getVoIPLink (void)
return _voIPLink; return _voIPLink;
} }
/*
void
Call::setAudioCodec (void)
{
_audiocodec = _voIPLink->getAudioCodec(getId());
}
*/
string string
Call::getStatus (void) Call::getStatus (void)
{ {
...@@ -332,13 +317,6 @@ Call::refuse (void) ...@@ -332,13 +317,6 @@ Call::refuse (void)
return i; return i;
} }
int
Call::cancel (void)
{
int i = _voIPLink->cancel(_id);
_voIPLink->deleteSipCall(_id);
return i;
}
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
// Private functions // Private functions
...@@ -350,5 +328,4 @@ Call::initConstructor(void) ...@@ -350,5 +328,4 @@ Call::initConstructor(void)
_state = NotExist; _state = NotExist;
_type = Null; _type = Null;
_voIPLinkId = 1; _voIPLinkId = 1;
// _audiocodec = NULL;
} }
...@@ -52,11 +52,8 @@ enum CallType { ...@@ -52,11 +52,8 @@ enum CallType {
#include "manager.h" #include "manager.h"
//class AudioCodec;
class Call { class Call {
public: public:
Call(void);
Call(Manager* manager, short id, CallType type, VoIPLink* voiplink); Call(Manager* manager, short id, CallType type, VoIPLink* voiplink);
~Call(void); ~Call(void);
...@@ -71,7 +68,6 @@ public: ...@@ -71,7 +68,6 @@ public:
void setVoIPLinkId (short voIPLinkId); void setVoIPLinkId (short voIPLinkId);
void setVoIPLink (VoIPLink* voIPLink); void setVoIPLink (VoIPLink* voIPLink);
VoIPLink* getVoIPLink(void); VoIPLink* getVoIPLink(void);
// void setAudioCodec(void);
string getStatus (void); string getStatus (void);
void setStatus (const string& status); void setStatus (const string& status);
...@@ -113,15 +109,12 @@ public: ...@@ -113,15 +109,12 @@ public:
int muteOn (void); int muteOn (void);
int muteOff (void); int muteOff (void);
int refuse (void); int refuse (void);
int cancel (void);
private: private:
void initConstructor (void); void initConstructor (void);
Manager* _manager; Manager* _manager;
VoIPLink* _voIPLink; VoIPLink* _voIPLink;
// AudioCodec* _audiocodec;
short _id; short _id;
short _voIPLinkId; short _voIPLinkId;
......
...@@ -43,11 +43,6 @@ Config::get (const string& section, const string& key, const string& defval) { ...@@ -43,11 +43,6 @@ Config::get (const string& section, const string& key, const string& defval) {
return value; return value;
} }
} }
/*
string
Config::getschar (const string& section, const string& key) {
return Config::getchar (section, key, "");
}*/
string string
Config::getchar (const string& section, const string& key, const string& defval){ Config::getchar (const string& section, const string& key, const string& defval){
...@@ -59,13 +54,7 @@ Config::getchar (const string& section, const string& key, const string& defval) ...@@ -59,13 +54,7 @@ Config::getchar (const string& section, const string& key, const string& defval)
return value; return value;
} }
} }
/*
bool
Config::getb (const string& section, const string& key) {
return (bool)Config::get (section, key, 0);
}
*/
int int
Config::geti (const string& section, const string& key) { Config::geti (const string& section, const string& key) {
return Config::get (section, key, 0); return Config::get (section, key, 0);
......
...@@ -33,9 +33,7 @@ public: ...@@ -33,9 +33,7 @@ public:
~Config (void) {}; ~Config (void) {};
static string gets (const string&, const string&); static string gets (const string&, const string&);
// static string getschar(const string&, const string&);
static int geti (const string&, const string&); static int geti (const string&, const string&);
// static bool getb (const string&, const string&);
static string get (const string&, const string&, const string&); static string get (const string&, const string&, const string&);
static string getchar (const string&, const string&, const string&); static string getchar (const string&, const string&, const string&);
......
...@@ -17,7 +17,6 @@ ...@@ -17,7 +17,6 @@
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/ */
//#include <stdio.h>
#include <iostream> #include <iostream>
#include "eventthread.h" #include "eventthread.h"
......
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
#define PREFIX "/usr/local" #define PREFIX "/usr/local"
#endif #endif
#define VERSION "0.4" #define VERSION "0.3.1"
#define PROGNAME "sflphone" #define PROGNAME "sflphone"
#define SKINDIR "skins" #define SKINDIR "skins"
#define PIXDIR "pixmaps" #define PIXDIR "pixmaps"
......
...@@ -116,16 +116,6 @@ GuiFramework::refuseCall (short id) ...@@ -116,16 +116,6 @@ GuiFramework::refuseCall (short id)
} }
} }
int
GuiFramework::cancelCall (short id)
{
if (_manager->cancelCall(id)) {
return 1;
} else {
return 0;
}
}
int int
GuiFramework::saveConfig (void) GuiFramework::saveConfig (void)
{ {
......
...@@ -56,7 +56,6 @@ public: ...@@ -56,7 +56,6 @@ public:
int muteOn (short id); int muteOn (short id);
int muteOff (short id); int muteOff (short id);
int refuseCall (short id); int refuseCall (short id);
int cancelCall (short id);
int saveConfig (void); int saveConfig (void);
int registerVoIPLink (void); int registerVoIPLink (void);
......
This diff is collapsed.
...@@ -89,21 +89,19 @@ void ConfigurationPanel::init() ...@@ -89,21 +89,19 @@ void ConfigurationPanel::init()
// For preferences tab // For preferences tab
SkinChoice->setCurrentText(QString(get_config_fields_str( SkinChoice->setCurrentText(QString(get_config_fields_str(
PREFERENCES, SKIN_CHOICE))); PREFERENCES, SKIN_CHOICE)));
confirmationToQuit->setChecked(get_config_fields_int( confirmationToQuit->setChecked(get_config_fields_int(
PREFERENCES, CONFIRM_QUIT)); PREFERENCES, CONFIRM_QUIT));
zoneToneChoice->setCurrentText(QString(get_config_fields_str( zoneToneChoice->setCurrentText(QString(get_config_fields_str(
PREFERENCES, ZONE_TONE))); PREFERENCES, ZONE_TONE)));
checkedTray->setChecked(get_config_fields_int( checkedTray->setChecked(get_config_fields_int(
PREFERENCES, CHECKED_TRAY)); PREFERENCES, CHECKED_TRAY));
voicemailNumber->setText(QString(get_config_fields_str( voicemailNumber->setText(QString(get_config_fields_str(
PREFERENCES, VOICEMAIL_NUM))); PREFERENCES, VOICEMAIL_NUM)));
// Init tab view order // Init tab view order
Tab_Signalisations->show(); Tab_Signalisations->show();
Tab_Audio->hide(); Tab_Audio->hide();
Tab_Video->hide();
Tab_Network->hide();
Tab_Preferences->hide(); Tab_Preferences->hide();
Tab_About->hide(); Tab_About->hide();
...@@ -113,12 +111,7 @@ void ConfigurationPanel::init() ...@@ -113,12 +111,7 @@ void ConfigurationPanel::init()
new QjListBoxPixmap (QjListBoxPixmap::Above, new QjListBoxPixmap (QjListBoxPixmap::Above,
QPixmap(Skin::getPathPixmap(QString(PIXDIR), QString(PIXMAP_AUDIO))) , QPixmap(Skin::getPathPixmap(QString(PIXDIR), QString(PIXMAP_AUDIO))) ,
"Audio", Menu ); "Audio", Menu );
new QjListBoxPixmap (QjListBoxPixmap::Above,
QPixmap(Skin::getPathPixmap(QString(PIXDIR), QString(PIXMAP_VIDEO))),
"Video", Menu );
new QjListBoxPixmap (QjListBoxPixmap::Above,
QPixmap(Skin::getPathPixmap(QString(PIXDIR), QString(PIXMAP_NETWORK))),
"Network", Menu );
new QjListBoxPixmap (QjListBoxPixmap::Above, new QjListBoxPixmap (QjListBoxPixmap::Above,
QPixmap(Skin::getPathPixmap(QString(PIXDIR), QString(PIXMAP_PREFERENCES))), QPixmap(Skin::getPathPixmap(QString(PIXDIR), QString(PIXMAP_PREFERENCES))),
"Preferences", Menu ); "Preferences", Menu );
...@@ -149,10 +142,10 @@ void ConfigurationPanel::saveSlot() ...@@ -149,10 +142,10 @@ void ConfigurationPanel::saveSlot()
Config::set("Audio", "Codecs.codec5", string(codec5->currentText().ascii())); Config::set("Audio", "Codecs.codec5", string(codec5->currentText().ascii()));
if (ringsChoice->currentText() != NULL) if (ringsChoice->currentText() != NULL)
Config::set("Audio", "Rings.ringChoice", Config::set("Audio", "Rings.ringChoice",
string(ringsChoice->currentText().ascii())); string(ringsChoice->currentText().ascii()));
Config::set("Preferences", "Themes.skinChoice", Config::set("Preferences", "Themes.skinChoice",
string(SkinChoice->currentText().ascii())); string(SkinChoice->currentText().ascii()));
Config::set("Preferences", "Options.zoneToneChoice", Config::set("Preferences", "Options.zoneToneChoice",
string(zoneToneChoice->currentText().ascii())); string(zoneToneChoice->currentText().ascii()));
Config::set("Preferences", "Options.confirmQuit", Config::set("Preferences", "Options.confirmQuit",
...@@ -160,7 +153,7 @@ void ConfigurationPanel::saveSlot() ...@@ -160,7 +153,7 @@ void ConfigurationPanel::saveSlot()
Config::set("Preferences", "Options.checkedTray", checkedTray->isChecked()); Config::set("Preferences", "Options.checkedTray", checkedTray->isChecked());
Config::set("Preferences", "Options.voicemailNumber", Config::set("Preferences", "Options.voicemailNumber",
string(voicemailNumber->text().ascii())); string(voicemailNumber->text().ascii()));
#if 0 #if 0
QMessageBox::information(this, "Save settings", QMessageBox::information(this, "Save settings",
"You must restart SFLPhone", "You must restart SFLPhone",
...@@ -176,8 +169,6 @@ void ConfigurationPanel::changeTabSlot() ...@@ -176,8 +169,6 @@ void ConfigurationPanel::changeTabSlot()
TitleTab->setText("Setup signalisation"); TitleTab->setText("Setup signalisation");
Tab_Signalisations->show(); Tab_Signalisations->show();
Tab_Audio->hide(); Tab_Audio->hide();
Tab_Video->hide();
Tab_Network->hide();
Tab_Preferences->hide(); Tab_Preferences->hide();
Tab_About->hide(); Tab_About->hide();
break; break;
...@@ -185,44 +176,20 @@ void ConfigurationPanel::changeTabSlot() ...@@ -185,44 +176,20 @@ void ConfigurationPanel::changeTabSlot()
TitleTab->setText("Setup audio"); TitleTab->setText("Setup audio");
Tab_Signalisations->hide(); Tab_Signalisations->hide();
Tab_Audio->show(); Tab_Audio->show();
Tab_Video->hide();
Tab_Network->hide();
Tab_Preferences->hide(); Tab_Preferences->hide();
Tab_About->hide(); Tab_About->hide();
break; break;
case 2: case 2:
TitleTab->setText("Setup video");
Tab_Signalisations->hide();
Tab_Audio->hide();
Tab_Video->show();
Tab_Network->hide();
Tab_Preferences->hide();
Tab_About->hide();
break;
case 3:
TitleTab->setText("Setup network");
Tab_Signalisations->hide();
Tab_Audio->hide();
Tab_Video->hide();
Tab_Network->show();
Tab_Preferences->hide();
Tab_About->hide();
break;
case 4:
TitleTab->setText("Setup preferences"); TitleTab->setText("Setup preferences");
Tab_Signalisations->hide(); Tab_Signalisations->hide();
Tab_Audio->hide(); Tab_Audio->hide();
Tab_Video->hide();
Tab_Network->hide();
Tab_Preferences->show(); Tab_Preferences->show();
Tab_About->hide(); Tab_About->hide();
break; break;
case 5: case 3:
TitleTab->setText("About"); TitleTab->setText("About");
Tab_Signalisations->hide(); Tab_Signalisations->hide();
Tab_Audio->hide(); Tab_Audio->hide();
Tab_Video->hide();
Tab_Network->hide();
Tab_Preferences->hide(); Tab_Preferences->hide();
Tab_About->show(); Tab_About->show();
break; break;
......
This diff is collapsed.
/**************************************************************************** /****************************************************************************
** Form interface generated from reading ui file 'gui/qt/configurationpanel.ui' ** Form interface generated from reading ui file 'gui/qt/configurationpanel.ui'
** **
** Created: Thu May 26 16:51:17 2005 ** Created: Fri May 27 17:07:54 2005
** by: The User Interface Compiler ($Id$) ** by: The User Interface Compiler ($Id$)
** **
** WARNING! All changes made in this file will be lost! ** WARNING! All changes made in this file will be lost!
...@@ -18,16 +18,16 @@ class QVBoxLayout; ...@@ -18,16 +18,16 @@ class QVBoxLayout;
class QHBoxLayout; class QHBoxLayout;
class QGridLayout; class QGridLayout;
class QSpacerItem; class QSpacerItem;
class QFrame;
class QPushButton;
class QListBox; class QListBox;
class QListBoxItem; class QListBoxItem;
class QLabel; class QLabel;
class QFrame;
class QTabWidget; class QTabWidget;
class QWidget; class QWidget;
class QGroupBox; class QGroupBox;
class QLineEdit; class QLineEdit;
class QCheckBox; class QCheckBox;
class QPushButton;
class QButtonGroup; class QButtonGroup;
class QRadioButton; class QRadioButton;
class QSpinBox; class QSpinBox;
...@@ -41,6 +41,11 @@ public: ...@@ -41,6 +41,11 @@ public:
ConfigurationPanel( QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 ); ConfigurationPanel( QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 );
~ConfigurationPanel(); ~ConfigurationPanel();
QFrame* line1;
QPushButton* buttonHelp;
QPushButton* buttonSave;
QPushButton* buttonOk;