From 61ef1e0d9f80416bdc24c36adf11ff44b3c548e6 Mon Sep 17 00:00:00 2001 From: llea <llea> Date: Mon, 1 Aug 2005 21:41:13 +0000 Subject: [PATCH] Improve scrolling, add comments in header files --- ChangeLog | 3 ++ TODO | 3 +- src/call.cpp | 38 -------------- src/call.h | 79 ++++++++++++++--------------- src/gui/qt/jpushbutton.cpp | 2 +- src/gui/qt/jpushbutton.h | 3 +- src/gui/qt/mydisplay.cpp | 53 ++++++++++++++++---- src/gui/qt/mydisplay.h | 64 +++++++++++++++++++---- src/gui/qt/phoneline.cpp | 14 +----- src/gui/qt/phoneline.h | 40 ++++++++------- src/gui/qt/qtGUImainwindow.cpp | 14 ++++-- src/gui/qt/qtGUImainwindow.h | 92 ++++++++++++++++++++++++++++------ src/gui/qt/transqwidget.cpp | 2 +- src/gui/qt/transqwidget.h | 2 +- src/gui/qt/volumecontrol.cpp | 2 + src/managerimpl.h | 42 ++++++++++++++-- 16 files changed, 295 insertions(+), 158 deletions(-) diff --git a/ChangeLog b/ChangeLog index d8981b5ecd..3cf42029ec 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,6 @@ +Laurielle LEA (1st August 2005) version 0.4 +- Add comments in header files + Laurielle LEA (29 July 2005) version 0.4 - Add scrolling message diff --git a/TODO b/TODO index 73435c7418..c669c66b53 100644 --- a/TODO +++ b/TODO @@ -5,6 +5,7 @@ Add screen shell to display debug For project core: ---------------- +Management of message blinking-notification Management Config like about:config in Mozilla Improvement of STUN Add ZeroConf @@ -15,4 +16,4 @@ Add unregister method when application is closed For project dependencies: ------------------------ -Improve the autotools scripts of PortAudioCpp \ No newline at end of file +Improve the autotools scripts of PortAudioCpp diff --git a/src/call.cpp b/src/call.cpp index 89ce0d2d41..997bcde064 100644 --- a/src/call.cpp +++ b/src/call.cpp @@ -60,30 +60,6 @@ Call::setId (short id) _id = id; } -unsigned int -Call::getTimestamp(void) -{ - return _timestamp; -} - -void -Call::setTimestamp (unsigned int timestamp) -{ - _timestamp = timestamp; -} - -short -Call::getVoIPLinkId (void) -{ - return _voIPLinkId; -} - -void -Call::setVoIPLinkId (short voIPLinkId) -{ - _voIPLinkId = voIPLinkId; -} - void Call::setVoIPLink (VoIPLink* voIPLink) { @@ -108,18 +84,6 @@ Call::setStatus (const string& status) _status = status; } -string -Call::getTo (void) -{ - return _to; -} - -void -Call::setTo (const string& to) -{ - _to = to; -} - string Call::getCallerIdName (void) { @@ -320,8 +284,6 @@ Call::refuse (void) void Call::initConstructor(void) { - _timestamp = 0; _state = NotExist; _type = Null; - _voIPLinkId = 1; } diff --git a/src/call.h b/src/call.h index 177e8f0275..7c520fcbd4 100644 --- a/src/call.h +++ b/src/call.h @@ -52,75 +52,72 @@ class VoIPLink; class Call { public: + // Constructor Call(short id, CallType type, VoIPLink* voiplink); - + // Destructor ~Call(void); + + // Handle call-id short getId (void); void setId (short id); - unsigned int getTimestamp(void); - void setTimestamp (unsigned int timestamp); - - short getVoIPLinkId(void); - void setVoIPLinkId (short voIPLinkId); - void setVoIPLink (VoIPLink* voIPLink); + // Accessor and modifior of VoIPLink VoIPLink* getVoIPLink(void); + void setVoIPLink (VoIPLink* voIPLink); + // Accessor and modifior of status string getStatus (void); void setStatus (const string& status); - string getTo (void); - void setTo (const string& to); - + // Handle id name and id number string getCallerIdName (void); void setCallerIdName (const string& callerId_name); string getCallerIdNumber (void); void setCallerIdNumber (const string& callerId_number); + // Handle state enum CallState getState (void); void setState (enum CallState state); + + // Handle type of call (incoming or outoing) enum CallType getType (void); void setType (enum CallType type); - bool isBusy (void); - bool isOnHold (void); - bool isOffHold (void); - bool isOnMute (void); - bool isOffMute (void); - bool isTransfered (void); - bool isHungup (void); - bool isRinging (void); - bool isRefused (void); - bool isCancelled (void); - bool isAnswered (void); - bool isProgressing (void); + bool isBusy (void); + bool isOnHold (void); + bool isOffHold (void); + bool isOnMute (void); + bool isOffMute (void); + bool isTransfered (void); + bool isHungup (void); + bool isRinging (void); + bool isRefused (void); + bool isCancelled (void); + bool isAnswered (void); + bool isProgressing (void); bool isOutgoingType (void); bool isIncomingType (void); - int outgoingCall (short id, const string& to); - int hangup (void); - int cancel (void); - int answer (void); - int onHold (void); - int offHold (void); - int transfer (const string& to); - int refuse (void); + int outgoingCall (short id, const string& to); + int hangup (void); + int cancel (void); + int answer (void); + int onHold (void); + int offHold (void); + int transfer (const string& to); + int refuse (void); private: void initConstructor (void); - VoIPLink* _voIPLink; - - short _id; - short _voIPLinkId; - unsigned int _timestamp; - enum CallState _state; - enum CallType _type; - string _to; - string _callerIdName; - string _callerIdNumber; - string _status; + VoIPLink *_voIPLink; + short _id; + enum CallState _state; + enum CallType _type; + string _callerIdName; + string _callerIdNumber; + string _status; }; #endif // __CALL_H__ diff --git a/src/gui/qt/jpushbutton.cpp b/src/gui/qt/jpushbutton.cpp index 99cdddb06c..f6c266c1c7 100644 --- a/src/gui/qt/jpushbutton.cpp +++ b/src/gui/qt/jpushbutton.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004 Savoir-Faire Linux inc. + * Copyright (C) 2004-2005 Savoir-Faire Linux inc. * Author: Jerome Oufella (jerome.oufella@savoirfairelinux.com) * * Portions (c) Valentin Heinitz diff --git a/src/gui/qt/jpushbutton.h b/src/gui/qt/jpushbutton.h index e69c818451..0ef7ac7fa9 100644 --- a/src/gui/qt/jpushbutton.h +++ b/src/gui/qt/jpushbutton.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004 Savoir-Faire Linux inc. + * Copyright (C) 2004-2005 Savoir-Faire Linux inc. * Author: Jerome Oufella (jerome.oufella@savoirfairelinux.com) * * Portions (c) Valentin Heinitz @@ -21,6 +21,7 @@ #ifndef __J_PUSH_BUTTON_H__ #define __J_PUSH_BUTTON_H__ + #include <qbitmap.h> #include <qevent.h> #include <qimage.h> diff --git a/src/gui/qt/mydisplay.cpp b/src/gui/qt/mydisplay.cpp index c1432d522b..107a112f7c 100644 --- a/src/gui/qt/mydisplay.cpp +++ b/src/gui/qt/mydisplay.cpp @@ -17,7 +17,6 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ - #include <qapplication.h> #include <qdatetime.h> #include <qfont.h> @@ -243,7 +242,9 @@ MyDisplay::renderText (QPainter &painter, QFontMetrics &fm, QString &str) { str.replace (extra_chars, backup_string.length(),QString("<")); } // Render text + _mutex.enterMutex(); painter.drawText (TABULATION - x_offset, fm.height() * TEXT_LINE, str); + _mutex.leaveMutex(); if (fm.width(str) > (_centerImage.width() - 5)) { // Restore initial string. str.replace(extra_chars, backup_string.length(), backup_string); @@ -265,23 +266,15 @@ MyDisplay::renderText (QPainter &painter, QFontMetrics &fm, QString &str) { len_to_shift = 0; } + _mutex.enterMutex(); painter.drawText (TABULATION + _centerImage.width() - len_to_shift * fm.width(str[0]), fm.height() * TEXT_LINE, str_tmp); + _mutex.leaveMutex(); } } -void -MyDisplay::shift (void) -{ - if (getReset()) { - _shift = false; - len_to_shift = 0; - } else { - _shift = true; - } -} /** * Draw status text. @@ -420,6 +413,30 @@ MyDisplay::getTextBuffer (void) { return *_textBuffer; } +void +MyDisplay::setIsScrolling (bool s) +{ + _mutex.enterMutex(); + _isScrolling = s; + _mutex.leaveMutex(); +} + +void +MyDisplay::resetForScrolling (bool r) +{ + _mutex.enterMutex(); + _reset = r; + _mutex.leaveMutex(); +} + +void +MyDisplay::setLenToShift (unsigned int len) +{ + _mutex.enterMutex(); + len_to_shift = len; + _mutex.leaveMutex(); +} + /////////////////////////////////////////////////////////////////////////////// // Implementation of the public slots // /////////////////////////////////////////////////////////////////////////////// @@ -463,4 +480,18 @@ MyDisplay::backspace (void) { _textBuffer->remove(_textBuffer->length() - 1, 1); } +void +MyDisplay::shift (void) +{ + _mutex.enterMutex(); + if (getReset()) { + _shift = false; + len_to_shift = 0; + } else { + _shift = true; + } + _mutex.leaveMutex(); +} + +#include "mydisplaymoc.cpp" // EOF diff --git a/src/gui/qt/mydisplay.h b/src/gui/qt/mydisplay.h index aa5c6eb038..0c9e6a902a 100644 --- a/src/gui/qt/mydisplay.h +++ b/src/gui/qt/mydisplay.h @@ -20,6 +20,9 @@ #ifndef __MYDISPLAY_H__ #define __MYDISPLAY_H__ + +#include <cc++/thread.h> + #include <qevent.h> #include <qimage.h> #include <qsettings.h> @@ -30,9 +33,26 @@ #include "../../global.h" + #define FREE_STATUS "Welcome to SFLPhone" + +/* + * The screen looks like this: + * + * --------------------- + * | STATUS | + * | | + * | TextBuffer | + * | | + * | call-timer | + * --------------------- + */ + +using namespace ost; +/////////////////////////////////////////////////////////////////////////////// // Screen animation thread +/////////////////////////////////////////////////////////////////////////////// class MyDisplayThread : public QThread { public: MyDisplayThread (QWidget *); @@ -45,12 +65,16 @@ private: bool alive; }; + class QtGUIMainWindow; +/////////////////////////////////////////////////////////////////////////////// // Display +/////////////////////////////////////////////////////////////////////////////// class MyDisplay : public QWidget { Q_OBJECT public: + // Constructors and destructor MyDisplay (); MyDisplay (QWidget *, const char *, QtGUIMainWindow *); ~MyDisplay (); @@ -61,31 +85,49 @@ public: QString & getTimer (void); void setTextBuffer (const QString &); QString & getTextBuffer (void); + + // To initialize screen image, position void initGraphics (void); + // To switch between time and call-timer function inline bool getInFunction (void) { return _inFunction; } inline void setInFunction (bool b) { _inFunction = b; } + // To set/unset in scrolling mode inline bool getIsScrolling (void) { return _isScrolling; } - inline void setIsScrolling (bool s) { _isScrolling = s; } + void setIsScrolling (bool s); - inline void resetForScrolling (bool r) { _reset = r; } + // To setup to zero X-position for displaying text inline bool getReset (void) { return _reset; } + void resetForScrolling (bool r) ; + void setLenToShift (unsigned int len) ; public slots: - void appendText (const QString &); - void appendText (const char *); - void appendText (const QChar &); - void clear (void); - void clearBuffer(void); - void clear (const QString &); - void backspace (void); - void shift (void); + // To append text which you type + void appendText (const QString &); + void appendText (const char *); + void appendText (const QChar &); + + // To clear caller-id line and set FREE status + void clear (void); + + // To clear just caller-id line + void clearBuffer (void); + + // To clear caller-id line and set new status in parameter + void clear (const QString &); + + // To remove the last char of the string + void backspace (void); + + // Slot for the timeout of the scrolling mode + void shift (void); protected: void paintEvent (QPaintEvent *); private: + Mutex _mutex; QImage _centerImage; // text zone QImage _overImage; QString* _status; @@ -100,7 +142,9 @@ private: bool _reset; unsigned int len_to_shift; + // To initialize status, textbuffer and variables void initText (void); + void renderText (QPainter &, QFontMetrics &, QString &); void renderStatus (QPainter &, QFontMetrics &, QString &); void renderTime (QPainter &, QFontMetrics &); diff --git a/src/gui/qt/phoneline.cpp b/src/gui/qt/phoneline.cpp index 8164cd9d15..db964bc8cb 100644 --- a/src/gui/qt/phoneline.cpp +++ b/src/gui/qt/phoneline.cpp @@ -1,5 +1,5 @@ /** - * Copyright (C) 2004 Savoir-Faire Linux inc. + * Copyright (C) 2004-2005 Savoir-Faire Linux inc. * Author: Laurielle Lea <laurielle.lea@savoirfairelinux.com> * * This program is free software; you can redistribute it and/or modify @@ -25,10 +25,8 @@ PhoneLine::PhoneLine (void) { jpb = NULL; setState (FREE); - setStateLine (FREE); first = true; timer = new QTime(); - b_dial = false; b_ringing = false; _callid = 0; _status = ""; @@ -42,16 +40,6 @@ PhoneLine::~PhoneLine (void) { } } -enum line_state -PhoneLine::getStateLine (void) { - return stateLine; -} - -void -PhoneLine::setStateLine (enum line_state state) { - this->stateLine = state; -} - enum line_state PhoneLine::getState (void) { return state; diff --git a/src/gui/qt/phoneline.h b/src/gui/qt/phoneline.h index 904813793b..56fb1c935b 100644 --- a/src/gui/qt/phoneline.h +++ b/src/gui/qt/phoneline.h @@ -1,5 +1,5 @@ /** - * Copyright (C) 2004 Savoir-Faire Linux inc. + * Copyright (C) 2004-2005 Savoir-Faire Linux inc. * Author: Laurielle Lea <laurielle.lea@savoirfairelinux.com> * * This program is free software; you can redistribute it and/or modify @@ -40,57 +40,61 @@ class PhoneLine { public: PhoneLine (void); ~PhoneLine (void); + + // Handle different state enum line_state getState (void); void setState (enum line_state); - enum line_state getStateLine (void); - void setStateLine (enum line_state); bool isFree (void); bool isBusy (void); bool isOnHold (void); void toggleState(void); + + // Handle a line like a push-button void setButton (JPushButton *); JPushButton *button (void); + + // Handle timer for call-timer void startTimer (void); void stopTimer (void); - QTime *timer; - QString text; - bool first; - + + // Handle status for each phoneline inline QString getStatus (void) { return _status; } inline void setStatus (const QString& status) { _status = status; } - inline void setbDial (bool dial) { b_dial = dial; } - inline bool getbDial (void) { return b_dial; } - inline void setbInProgress (bool prog) { b_inProgress = prog; } - inline bool getbInProgress (void) { return b_inProgress; } - + + // Manage a ringtone notification if there is an incoming call inline bool getbRinging (void) { return b_ringing; } inline void setbRinging (bool ring) { if (this->b_ringing != ring) this->b_ringing = ring; } + + // Handle call-id for each phoneline inline short getCallId (void) { return _callid; } inline void setCallId (short id) { _callid = id; } + // Handle if need scrolling or not inline bool scrolling (void) { return _scrolling; } inline void setScrolling (bool s) { _scrolling = s; } + // Handle stop scrolling inline bool stopScrolling (void) { return _stopScrolling; } inline void setStopScrolling(bool s) { _stopScrolling = s; } + // For call-timer + QTime *timer; + // To start just one time the call-timer per call + bool first; + private: short _callid; QString _status; - bool _scrolling; // if need scrolling message + bool _scrolling; bool _stopScrolling; JPushButton* jpb; enum line_state state; - enum line_state stateLine; - bool b_dial; // if ok button is clicked (->true) - bool b_inProgress; // if outgoing call, - // before remote callee answers (->true) bool b_ringing; // if incoming call, - // before IP-phone user answers (->true) + // before IP-phone user answers (->true) }; #endif // __PHONE_LINE_H__ diff --git a/src/gui/qt/qtGUImainwindow.cpp b/src/gui/qt/qtGUImainwindow.cpp index f7802412d0..45a3da21c2 100644 --- a/src/gui/qt/qtGUImainwindow.cpp +++ b/src/gui/qt/qtGUImainwindow.cpp @@ -700,7 +700,9 @@ QtGUIMainWindow::callIsOnHold(int id, int line, int busyLine) Manager::instance().displayErrorText(id, "Off-hold call failed !\n"); return -1; } + displayContext(id); + _lcd->setLenToShift(0); return 1; } @@ -851,7 +853,7 @@ QtGUIMainWindow::incomingCall (short id) // To store information about stop scrolling text _lcd->resetForScrolling (false); phLines[i]->setStopScrolling(false); - // To store information about scrolling text or not + // Set scrolling mode phLines[i]->setScrolling(true); _lcd->setIsScrolling(true); } @@ -886,6 +888,9 @@ QtGUIMainWindow::peerHungupCall (short id) // To store information about scrolling text _lcd->resetForScrolling (true); phLines[line]->setStopScrolling(true); + // Unset scrolling mode + _lcd->setIsScrolling(false); + phLines[getCurrentLine()]->setScrolling(false); if (line == getCurrentLine() or getCurrentLine() == -1) { stopCallTimer(id); @@ -922,7 +927,7 @@ QtGUIMainWindow::displayErrorText (short id, const string& message) _lcd->clearBuffer(); _lcd->appendText(message); - // To store information about scrolling text + // Set scrolling mode _lcd->setIsScrolling(true); phLines[id2line(id)]->setScrolling(true); } @@ -1238,6 +1243,9 @@ QtGUIMainWindow::hangupLine (void) // To store information about stop scrolling text _lcd->resetForScrolling (true); phLines[line]->setStopScrolling(true); + // Unset scrolling mode + _lcd->setIsScrolling(false); + phLines[getCurrentLine()]->setScrolling(false); if (Manager::instance().getbCongestion() and line != -1) { // If congestion tone @@ -1654,7 +1662,7 @@ QtGUIMainWindow::pressedKeySlot (int id) { // and there is no error in configuration setup _lcd->appendText (code); - // To store information about scrolling text + // Unset scrolling mode _lcd->setIsScrolling(false); phLines[getCurrentLine()]->setScrolling(false); } diff --git a/src/gui/qt/qtGUImainwindow.h b/src/gui/qt/qtGUImainwindow.h index f2524d49a6..8b3accef5f 100644 --- a/src/gui/qt/qtGUImainwindow.h +++ b/src/gui/qt/qtGUImainwindow.h @@ -35,6 +35,8 @@ #include "url_input.h" #define MAIN_INITIAL_POSITION 20 + +// To type with keyboard what you want to appear in the screen. #define TEXT_MODE 0 #define NUM_MODE 1 @@ -79,6 +81,7 @@ public: QtGUIMainWindow (QWidget* = 0, const char* = 0,WFlags = 0); ~QtGUIMainWindow(void); + // To build an array of pixmap according to the state QPixmap TabLinePixmap[NUMBER_OF_LINES][NUMBER_OF_STATES]; // Reimplementation of virtual functions @@ -140,8 +143,9 @@ public: */ int getElapse (void); - // Public functions - void setMainLCD (void); + /* + * Set the skin path from the setup + */ QString setPathSkin (void); /** @@ -159,15 +163,26 @@ public: void stopCallTimer (short); void startCallTimer (short); + /* + * Stop the blinking-signal when you check your voicemail (not used yet) + */ void stopTimerMessage (void); - void dialTone (bool); + /* + * Manage if you selected a line before dialing + */ inline void setChooseLine (bool b) { _chooseLine = b; } inline bool getChooseLine (void) { return _chooseLine; } + /* + * Store the line you selected before dialing + */ inline void setChosenLine (int line) { _chosenLine = line; } inline int getChosenLine (void) { return _chosenLine; } + /* + * Manage if you are in transfer mode + */ inline void setTransfer (bool b) { _transfer = b; } inline bool getTransfer (void) {return _transfer; } @@ -175,17 +190,40 @@ signals: void keyPressed (int); public slots: + // Slot when you click on ok-button or type Enter void dial (void); + + // Notification when you have received incoming call void blinkRingSlot (void); + + // Notification when you have put on-hold a call void blinkLineSlot (void); + + // Notification when you have received message in your mailbox void blinkMessageSlot (void); - void qt_quitApplication (void); + + // Slot to use numeric keypad void pressedKeySlot (int); + + // To remove specified characters before appending the text in url-input void stripSlot (void); + + // To show the address book (not implemented yet) void addressBook (void); + + // To show keypad at the specified position void dtmfKeypad (void); + + // To show setup windows void configuration (void); + + // Slot to hangup call void hangupLine (void); + + // Slot to quit application + void qt_quitApplication (void); + + // Manage different buttons in the phone void button_mute (void); void button_line0 (void); void button_line1 (void); @@ -198,9 +236,8 @@ public slots: void button_conf (void); void clickHandle (void); void reduceHandle (void); - void save (void); - void applySkin (void); + // Handle pressed key of the dtmf keypad void pressedKey0 (void); void pressedKey1 (void); void pressedKey2 (void); @@ -211,12 +248,19 @@ public slots: void pressedKey7 (void); void pressedKey8 (void); void pressedKey9 (void); - void pressedKeyStar (void); - void pressedKeyHash (void); + void pressedKeyStar (void); // (*) + void pressedKeyHash (void); // (#) + // Manage volume control void volumeSpkrChanged (int); void volumeMicChanged (int); + + // To register manually void registerSlot (void); + // To save configuration + void save (void); + // To apply selected skin + void applySkin (void); protected: // To handle the key pressed event @@ -283,8 +327,6 @@ private: bool _chooseLine; int _chosenLine; int _prevLine; - inline void setPrevLine(int line) { _prevLine = line; } - inline int getPrevLine(void) { return _prevLine; } // Array of incoming calls, contains call-id int _TabIncomingCalls[NUMBER_OF_LINES]; @@ -294,20 +336,42 @@ private: bool _dialtone; + //////////////////// + // Private functions + //////////////////// + + inline void setPrevLine(int line) { _prevLine = line; } + inline int getPrevLine(void) { return _prevLine; } + + // Set position for screen + void setMainLCD (void); + + // Handle num/text mode void setMode (int); bool isInTextMode (void); bool isInNumMode (void); + + // Initialize all the skin void initSkin (void); - void initVolume (void); void initButtons (void); - void initBlinkTimer (void); + void initVolume (void); void initSpkrVolumePosition (void); void initMicVolumePosition (void); + + // Delete buttons called in destructor + void deleteButtons (void); + + // Initialize timer for blinking notification + void initBlinkTimer (void); + + // Initialize all the connections (SIGNAL->SLOT) void connections (void); - string ringFile (void); + // Set the ringtone file path + string ringFile (void); + + // Set position for numeric keypad int positionOffsetX (void); - void deleteButtons (void); /* * Associate a phoneline number to a call identifiant diff --git a/src/gui/qt/transqwidget.cpp b/src/gui/qt/transqwidget.cpp index 10646cc9a8..7a91cbed12 100644 --- a/src/gui/qt/transqwidget.cpp +++ b/src/gui/qt/transqwidget.cpp @@ -1,5 +1,5 @@ /** - * Copyright (C) 2004 Savoir-Faire Linux inc. + * Copyright (C) 2004-2005 Savoir-Faire Linux inc. * Author: Laurielle Lea <laurielle.lea@savoirfairelinux.com> * * This program is free software; you can redistribute it and/or modify diff --git a/src/gui/qt/transqwidget.h b/src/gui/qt/transqwidget.h index 8cb058888e..5083aa30e4 100644 --- a/src/gui/qt/transqwidget.h +++ b/src/gui/qt/transqwidget.h @@ -1,5 +1,5 @@ /** - * Copyright (C) 2004 Savoir-Faire Linux inc. + * Copyright (C) 2004-2005 Savoir-Faire Linux inc. * Author: Laurielle Lea <laurielle.lea@savoirfairelinux.com> * * This program is free software; you can redistribute it and/or modify diff --git a/src/gui/qt/volumecontrol.cpp b/src/gui/qt/volumecontrol.cpp index 98e249b125..adbc86af96 100644 --- a/src/gui/qt/volumecontrol.cpp +++ b/src/gui/qt/volumecontrol.cpp @@ -85,3 +85,5 @@ VolumeControl::mousePressEvent (QMouseEvent *e) { } #include "volumecontrolmoc.cpp" + +// EOF diff --git a/src/managerimpl.h b/src/managerimpl.h index be8056323a..58957269c7 100644 --- a/src/managerimpl.h +++ b/src/managerimpl.h @@ -66,6 +66,9 @@ typedef vector<VoIPLink*, allocator<VoIPLink*> > VoIPLinkVector; */ typedef vector<CodecDescriptor*, allocator<CodecDescriptor*> > CodecDescriptorVector; +/* + * Structure for audio device + */ struct device_t{ const char* hostApiName; const char* deviceName; @@ -76,10 +79,19 @@ public: ManagerImpl (void); ~ManagerImpl (void); + // Init a new VoIPLink, audio codec and audio driver void init (void); + + // Set the graphic user interface void setGui (GuiFramework* gui); + + // Accessor to tonegenerator ToneGenerator* getTonegenerator(void); + + // Accessor to error Error* error(void); + + // Accessor to audiodriver AudioLayer* getAudioDriver(void); // Accessor to number of calls @@ -97,13 +109,16 @@ public: // Accessor to the Call with the id 'id' Call* getCall (short id); + // Handle codec number unsigned int getNumberOfCodecs (void); void setNumberOfCodecs (unsigned int nb_codec); + // Accessor to VoIPLinkVector VoIPLinkVector* getVoIPLinkVector (void); CodecDescriptorVector* getCodecDescVector(void); + // Handle specified ring tone inline bool getZonetone (void) { return _zonetone; } inline void setZonetone (bool b) { _zonetone = b; } @@ -189,19 +204,31 @@ public: void getStunInfo (StunAddress4& stunSvrAddr); bool useStun (void); + /* + * Inline functions to manage different kind of ringtone + */ inline bool getbCongestion (void) { return _congestion; } inline bool getbRingback (void) { return _ringback; } inline bool getbRingtone (void) { return _ringtone; } + /* + * Inline functions to manage volume control + */ inline int getSpkrVolume (void) { return _spkr_volume; } inline void setSpkrVolume (int spkr_vol) { _spkr_volume = spkr_vol; } inline int getMicroVolume (void) { return _mic_volume; } inline void setMicroVolume (int mic_vol) { _mic_volume = mic_vol; } + /* + * Manage information about firewall + */ inline int getFirewallPort (void) { return _firewallPort; } inline void setFirewallPort (int port) { _firewallPort = port; } inline string getFirewallAddress (void) { return _firewallAddr; } + /* + * Manage information about audio driver + */ inline bool isDriverLoaded (void) { return _loaded; } inline void loaded (bool l) { _loaded = l; } @@ -233,15 +260,20 @@ private: * 2 if file doesn't exist yet. */ int createSettingsPath (void); - - + /* + * Initialize audiocodec + */ void initAudioCodec(void); + + /* + * Initialize audiodriver + */ void selectAudioDriver (void); -///////////////////// -// Private variables -///////////////////// + ///////////////////// + // Private variables + ///////////////////// ToneGenerator* _tone; Error* _error; GuiFramework* _gui; -- GitLab