diff --git a/daemon/src/conference.h b/daemon/src/conference.h index 102d7d8e9eca976ab0afda4a1d7ef0ebbe829904..f4f1993095ec2ab64d878a26355e31c0b59b0032 100644 --- a/daemon/src/conference.h +++ b/daemon/src/conference.h @@ -37,7 +37,7 @@ typedef std::set<std::string> ParticipantSet; -class Conference: public Recordable { +class Conference : public Recordable { public: enum ConferenceState {ACTIVE_ATTACHED, ACTIVE_DETACHED, ACTIVE_ATTACHED_REC, ACTIVE_DETACHED_REC, HOLD, HOLD_REC}; diff --git a/daemon/src/eventthread.h b/daemon/src/eventthread.h index b854a37f870d87492b6479fb914ec7b877d436ee..53c357253bd7c0585d2871fe5750a2c54e614ad6 100644 --- a/daemon/src/eventthread.h +++ b/daemon/src/eventthread.h @@ -33,7 +33,6 @@ #include <cc++/thread.h> - class VoIPLink; /** @@ -43,9 +42,6 @@ class VoIPLink; class EventThread : public ost::Thread { public: - /** - * Thread constructor - */ EventThread(VoIPLink* link); ~EventThread() { @@ -55,10 +51,10 @@ class EventThread : public ost::Thread { virtual void run() ; private: - EventThread(const EventThread& rh); // copy constructor - EventThread& operator= (const EventThread& rh); // assignment operator + EventThread(const EventThread& rh); + EventThread& operator= (const EventThread& rh); - /** VoIPLink is the object being called by getEvents() method */ + // VoIPLink is the object being called by getEvents() method VoIPLink* link_; }; diff --git a/daemon/src/fileutils.h b/daemon/src/fileutils.h index 364e80a23323f75729edc6ba3ecab90b18fab803..92f99a6a28a17763f20cf276c78728e980d31bcc 100644 --- a/daemon/src/fileutils.h +++ b/daemon/src/fileutils.h @@ -32,6 +32,6 @@ #define __FILEUTILS_H__ void set_program_dir(char *program_path); -const char *get_program_dir(void); +const char *get_program_dir(); #endif // __FILEUTILS_H__ diff --git a/daemon/src/preferences.cpp b/daemon/src/preferences.cpp index 73ea7ed8d7319bc0264b78eb10eff294e3f5f5f1..4aa49de1041ec252196d17fc15e49138f7c093bb 100644 --- a/daemon/src/preferences.cpp +++ b/daemon/src/preferences.cpp @@ -45,41 +45,40 @@ static const char * const DFT_VOL_SPKR_STR = "100"; /** Default speaker volu static const char * const DFT_VOL_MICRO_STR = "100"; /** Default mic volume */ } // end anonymous namespace -Preferences::Preferences() : _accountOrder("") - , _historyLimit(30) - , _historyMaxCalls(20) - , _notifyMails(false) - , _zoneToneChoice(DFT_ZONE) // DFT_ZONE - , _registrationExpire(180) - , _portNum(5060) - , _searchBarDisplay(true) - , _zeroConfenable(false) - , _md5Hash(false) -{ -} +Preferences::Preferences() : accountOrder_("") + , historyLimit_(30) + , historyMaxCalls_(20) + , notifyMails_(false) + , zoneToneChoice_(DFT_ZONE) // DFT_ZONE + , registrationExpire_(180) + , portNum_(5060) + , searchBarDisplay_(true) + , zeroConfenable_(false) + , md5Hash_(false) +{} void Preferences::serialize(Conf::YamlEmitter *emiter) { Conf::MappingNode preferencemap(NULL); - Conf::ScalarNode order(_accountOrder); + Conf::ScalarNode order(accountOrder_); std::stringstream histlimitstr; - histlimitstr << _historyLimit; + histlimitstr << historyLimit_; Conf::ScalarNode historyLimit(histlimitstr.str()); std::stringstream histmaxstr; - histmaxstr << _historyMaxCalls; + histmaxstr << historyMaxCalls_; Conf::ScalarNode historyMaxCalls(histmaxstr.str()); - Conf::ScalarNode notifyMails(_notifyMails); - Conf::ScalarNode zoneToneChoice(_zoneToneChoice); + Conf::ScalarNode notifyMails(notifyMails_); + Conf::ScalarNode zoneToneChoice(zoneToneChoice_); std::stringstream expirestr; - expirestr << _registrationExpire; + expirestr << registrationExpire_; Conf::ScalarNode registrationExpire(expirestr.str()); std::stringstream portstr; - portstr << _portNum; + portstr << portNum_; Conf::ScalarNode portNum(portstr.str()); - Conf::ScalarNode searchBarDisplay(_searchBarDisplay); - Conf::ScalarNode zeroConfenable(_zeroConfenable); - Conf::ScalarNode md5Hash(_md5Hash); + Conf::ScalarNode searchBarDisplay(searchBarDisplay_); + Conf::ScalarNode zeroConfenable(zeroConfenable_); + Conf::ScalarNode md5Hash(md5Hash_); preferencemap.setKeyValue(orderKey, &order); preferencemap.setKeyValue(historyLimitKey, &historyLimit); @@ -102,37 +101,36 @@ void Preferences::unserialize(Conf::MappingNode *map) return; } - map->getValue(orderKey, &_accountOrder); - map->getValue(historyLimitKey, &_historyLimit); - map->getValue(historyMaxCallsKey, &_historyMaxCalls); - map->getValue(notifyMailsKey, &_notifyMails); - map->getValue(zoneToneChoiceKey, &_zoneToneChoice); - map->getValue(registrationExpireKey, &_registrationExpire); - map->getValue(portNumKey, &_portNum); - map->getValue(searchBarDisplayKey, &_searchBarDisplay); - map->getValue(zeroConfenableKey, &_zeroConfenable); - map->getValue(md5HashKey, &_md5Hash); + map->getValue(orderKey, &accountOrder_); + map->getValue(historyLimitKey, &historyLimit_); + map->getValue(historyMaxCallsKey, &historyMaxCalls_); + map->getValue(notifyMailsKey, ¬ifyMails_); + map->getValue(zoneToneChoiceKey, &zoneToneChoice_); + map->getValue(registrationExpireKey, ®istrationExpire_); + map->getValue(portNumKey, &portNum_); + map->getValue(searchBarDisplayKey, &searchBarDisplay_); + map->getValue(zeroConfenableKey, &zeroConfenable_); + map->getValue(md5HashKey, &md5Hash_); } - -VoipPreference::VoipPreference() : _playDtmf(true) - , _playTones(true) - , _pulseLength(atoi(DFT_PULSE_LENGTH_STR)) // DFT_PULSE_LENGTH_STR - , _symmetricRtp(true) - , _zidFile(ZRTP_ZIDFILE) // ZRTP_ZID_FILENAME +VoipPreference::VoipPreference() : playDtmf_(true) + , playTones_(true) + , pulseLength_(atoi(DFT_PULSE_LENGTH_STR)) + , symmetricRtp_(true) + , zidFile_(ZRTP_ZIDFILE) {} void VoipPreference::serialize(Conf::YamlEmitter *emitter) { Conf::MappingNode preferencemap(NULL); - Conf::ScalarNode playDtmf(_playDtmf); - Conf::ScalarNode playTones(_playTones); + Conf::ScalarNode playDtmf(playDtmf_); + Conf::ScalarNode playTones(playTones_); std::stringstream pulselengthstr; - pulselengthstr << _pulseLength; + pulselengthstr << pulseLength_; Conf::ScalarNode pulseLength(pulselengthstr.str()); - Conf::ScalarNode symmetricRtp(_symmetricRtp); - Conf::ScalarNode zidFile(_zidFile.c_str()); + Conf::ScalarNode symmetricRtp(symmetricRtp_); + Conf::ScalarNode zidFile(zidFile_.c_str()); preferencemap.setKeyValue(playDtmfKey, &playDtmf); preferencemap.setKeyValue(playTonesKey, &playTones); @@ -150,37 +148,35 @@ void VoipPreference::unserialize(Conf::MappingNode *map) return; } - map->getValue(playDtmfKey, &_playDtmf); - map->getValue(playTonesKey, &_playTones); - map->getValue(pulseLengthKey, &_pulseLength); - map->getValue(symmetricRtpKey, &_symmetricRtp); - map->getValue(zidFileKey, &_zidFile); + map->getValue(playDtmfKey, &playDtmf_); + map->getValue(playTonesKey, &playTones_); + map->getValue(pulseLengthKey, &pulseLength_); + map->getValue(symmetricRtpKey, &symmetricRtp_); + map->getValue(zidFileKey, &zidFile_); } - - -AddressbookPreference::AddressbookPreference() : _photo(true) - , _enabled(true) - , _list("") - , _maxResults(25) - , _business(true) - , _home(true) - , _mobile(true) +AddressbookPreference::AddressbookPreference() : photo_(true) + , enabled_(true) + , list_("") + , maxResults_(25) + , business_(true) + , home_(true) + , mobile_(true) {} void AddressbookPreference::serialize(Conf::YamlEmitter *emitter) { Conf::MappingNode preferencemap(NULL); - Conf::ScalarNode photo(_photo); - Conf::ScalarNode enabled(_enabled); - Conf::ScalarNode list(_list); + Conf::ScalarNode photo(photo_); + Conf::ScalarNode enabled(enabled_); + Conf::ScalarNode list(list_); std::stringstream maxresultstr; - maxresultstr << _maxResults; + maxresultstr << maxResults_; Conf::ScalarNode maxResults(maxresultstr.str()); - Conf::ScalarNode business(_business); - Conf::ScalarNode home(_home); - Conf::ScalarNode mobile(_mobile); + Conf::ScalarNode business(business_); + Conf::ScalarNode home(home_); + Conf::ScalarNode mobile(mobile_); preferencemap.setKeyValue(photoKey, &photo); preferencemap.setKeyValue(enabledKey, &enabled); @@ -201,36 +197,33 @@ void AddressbookPreference::unserialize(Conf::MappingNode *map) return; } - map->getValue(photoKey, &_photo); - map->getValue(enabledKey, &_enabled); - map->getValue(listKey, &_list); - map->getValue(maxResultsKey, &_maxResults); - map->getValue(businessKey, &_business); - map->getValue(homeKey, &_home); - map->getValue(mobileKey, &_mobile); + map->getValue(photoKey, &photo_); + map->getValue(enabledKey, &enabled_); + map->getValue(listKey, &list_); + map->getValue(maxResultsKey, &maxResults_); + map->getValue(businessKey, &business_); + map->getValue(homeKey, &home_); + map->getValue(mobileKey, &mobile_); } - -HookPreference::HookPreference() : _iax2Enabled(false) - , _numberAddPrefix("") - , _numberEnabled(false) - , _sipEnabled(false) - , _urlCommand("x-www-browser") - , _urlSipField("X-sflphone-url") -{ - -} +HookPreference::HookPreference() : iax2Enabled_(false) + , numberAddPrefix_("") + , numberEnabled_(false) + , sipEnabled_(false) + , urlCommand_("x-www-browser") + , urlSipField_("X-sflphone-url") +{} void HookPreference::serialize(Conf::YamlEmitter *emitter) { Conf::MappingNode preferencemap(NULL); - Conf::ScalarNode iax2Enabled(_iax2Enabled); - Conf::ScalarNode numberAddPrefix(_numberAddPrefix); - Conf::ScalarNode numberEnabled(_numberEnabled); - Conf::ScalarNode sipEnabled(_sipEnabled); - Conf::ScalarNode urlCommand(_urlCommand); - Conf::ScalarNode urlSipField(_urlSipField); + Conf::ScalarNode iax2Enabled(iax2Enabled_); + Conf::ScalarNode numberAddPrefix(numberAddPrefix_); + Conf::ScalarNode numberEnabled(numberEnabled_); + Conf::ScalarNode sipEnabled(sipEnabled_); + Conf::ScalarNode urlCommand(urlCommand_); + Conf::ScalarNode urlSipField(urlSipField_); preferencemap.setKeyValue(iax2EnabledKey, &iax2Enabled); preferencemap.setKeyValue(numberAddPrefixKey, &numberAddPrefix); @@ -249,34 +242,32 @@ void HookPreference::unserialize(Conf::MappingNode *map) return; } - map->getValue(iax2EnabledKey, &_iax2Enabled); - map->getValue(numberAddPrefixKey, &_numberAddPrefix); - map->getValue(numberEnabledKey, &_numberEnabled); - map->getValue(sipEnabledKey, &_sipEnabled); - map->getValue(urlCommandKey, &_urlCommand); - map->getValue(urlSipFieldKey, &_urlSipField); + map->getValue(iax2EnabledKey, &iax2Enabled_); + map->getValue(numberAddPrefixKey, &numberAddPrefix_); + map->getValue(numberEnabledKey, &numberEnabled_); + map->getValue(sipEnabledKey, &sipEnabled_); + map->getValue(urlCommandKey, &urlCommand_); + map->getValue(urlSipFieldKey, &urlSipField_); } - - AudioPreference::AudioPreference() : - _audioApi(PULSEAUDIO_API_STR) - , _cardin(atoi(ALSA_DFT_CARD)) // ALSA_DFT_CARD - , _cardout(atoi(ALSA_DFT_CARD)) // ALSA_DFT_CARD - , _cardring(atoi(ALSA_DFT_CARD)) // ALSA_DFT_CARD - , _plugin("default") // PCM_DEFAULT - , _smplrate(44100) // DFT_SAMPLE_RATE - , _devicePlayback("") - , _deviceRecord("") - , _deviceRingtone("") - , _recordpath("") // DFT_RECORD_PATH - , _alwaysRecording(false) - , _volumemic(atoi(DFT_VOL_SPKR_STR)) // DFT_VOL_SPKR_STR - , _volumespkr(atoi(DFT_VOL_MICRO_STR)) // DFT_VOL_MICRO_STR - , _noisereduce(true) - , _echocancel(false) - , _echoCancelTailLength(100) - , _echoCancelDelay(0) + audioApi_(PULSEAUDIO_API_STR) + , cardin_(atoi(ALSA_DFT_CARD)) // ALSA_DFT_CARD + , cardout_(atoi(ALSA_DFT_CARD)) // ALSA_DFT_CARD + , cardring_(atoi(ALSA_DFT_CARD)) // ALSA_DFT_CARD + , plugin_("default") // PCM_DEFAULT + , smplrate_(44100) // DFT_SAMPLE_RATE + , devicePlayback_("") + , deviceRecord_("") + , deviceRingtone_("") + , recordpath_("") // DFT_RECORD_PATH + , alwaysRecording_(false) + , volumemic_(atoi(DFT_VOL_SPKR_STR)) // DFT_VOL_SPKR_STR + , volumespkr_(atoi(DFT_VOL_MICRO_STR)) // DFT_VOL_MICRO_STR + , noisereduce_(true) + , echocancel_(false) + , echoCancelTailLength_(100) + , echoCancelDelay_(0) {} namespace { @@ -291,23 +282,23 @@ void checkSoundCard(int &card, int stream) AudioLayer* AudioPreference::createAudioLayer() { - if (_audioApi == PULSEAUDIO_API_STR and system("ps -C pulseaudio") == 0) + if (audioApi_ == PULSEAUDIO_API_STR and system("ps -C pulseaudio") == 0) return new PulseLayer; else { - _audioApi = ALSA_API_STR; - checkSoundCard(_cardin, SFL_PCM_CAPTURE); - checkSoundCard(_cardout, SFL_PCM_PLAYBACK); - checkSoundCard(_cardring, SFL_PCM_RINGTONE); + audioApi_ = ALSA_API_STR; + checkSoundCard(cardin_, SFL_PCM_CAPTURE); + checkSoundCard(cardout_, SFL_PCM_PLAYBACK); + checkSoundCard(cardring_, SFL_PCM_RINGTONE); return new AlsaLayer; } } AudioLayer* AudioPreference::switchAndCreateAudioLayer() { - if (_audioApi == PULSEAUDIO_API_STR) - _audioApi = ALSA_API_STR; + if (audioApi_ == PULSEAUDIO_API_STR) + audioApi_ = ALSA_API_STR; else - _audioApi = PULSEAUDIO_API_STR; + audioApi_ = PULSEAUDIO_API_STR; return createAudioLayer(); } @@ -320,44 +311,44 @@ void AudioPreference::serialize(Conf::YamlEmitter *emitter) // alsa preference std::stringstream instr; - instr << _cardin; - Conf::ScalarNode cardin(instr.str()); // 0 + instr << cardin_; + Conf::ScalarNode cardin(instr.str()); std::stringstream outstr; - outstr << _cardout; - Conf::ScalarNode cardout(outstr.str()); // 0 + outstr << cardout_; + Conf::ScalarNode cardout(outstr.str()); std::stringstream ringstr; - ringstr << _cardring; - Conf::ScalarNode cardring(ringstr.str());// 0 - Conf::ScalarNode plugin(_plugin); // default + ringstr << cardring_; + Conf::ScalarNode cardring(ringstr.str()); + Conf::ScalarNode plugin(plugin_); std::stringstream ratestr; - ratestr << _smplrate; - Conf::ScalarNode smplrate(ratestr.str());// 44100 + ratestr << smplrate_; + Conf::ScalarNode smplrate(ratestr.str()); //pulseaudio preference - Conf::ScalarNode devicePlayback(_devicePlayback);//: - Conf::ScalarNode deviceRecord(_deviceRecord); //: - Conf::ScalarNode deviceRingtone(_deviceRingtone); //: + Conf::ScalarNode devicePlayback(devicePlayback_); + Conf::ScalarNode deviceRecord(deviceRecord_); + Conf::ScalarNode deviceRingtone(deviceRingtone_); // general preference - Conf::ScalarNode audioapi(_audioApi); - Conf::ScalarNode recordpath(_recordpath); //: /home/msavard/Bureau - Conf::ScalarNode alwaysRecording(_alwaysRecording); + Conf::ScalarNode audioapi(audioApi_); + Conf::ScalarNode recordpath(recordpath_); //: /home/msavard/Bureau + Conf::ScalarNode alwaysRecording(alwaysRecording_); std::stringstream micstr; - micstr << _volumemic; + micstr << volumemic_; Conf::ScalarNode volumemic(micstr.str()); //: 100 std::stringstream spkrstr; - spkrstr << _volumespkr; + spkrstr << volumespkr_; Conf::ScalarNode volumespkr(spkrstr.str()); //: 100 - Conf::ScalarNode noise(_noisereduce); - Conf::ScalarNode echo(_echocancel); + Conf::ScalarNode noise(noisereduce_); + Conf::ScalarNode echo(echocancel_); std::stringstream tailstr; - _debug("************************************************** serialize echotail %d", _echoCancelTailLength); - tailstr << _echoCancelTailLength; + _debug("************************************************** serialize echotail %d", echoCancelTailLength_); + tailstr << echoCancelTailLength_; Conf::ScalarNode echotail(tailstr.str()); std::stringstream delaystr; - _debug("************************************************** serialize echodelay %d", _echoCancelTailLength); - delaystr << _echoCancelDelay; + _debug("************************************************** serialize echodelay %d", echoCancelTailLength_); + delaystr << echoCancelDelay_; Conf::ScalarNode echodelay(delaystr.str()); preferencemap.setKeyValue(audioApiKey, &audioapi); @@ -390,30 +381,30 @@ void AudioPreference::unserialize(Conf::MappingNode *map) { assert(map); - map->getValue(audioApiKey, &_audioApi); - map->getValue(recordpathKey, &_recordpath); - map->getValue(alwaysRecordingKey, &_alwaysRecording); - map->getValue(volumemicKey, &_volumemic); - map->getValue(volumespkrKey, &_volumespkr); - map->getValue(noiseReduceKey, &_noisereduce); - map->getValue(echoCancelKey, &_echocancel); + map->getValue(audioApiKey, &audioApi_); + map->getValue(recordpathKey, &recordpath_); + map->getValue(alwaysRecordingKey, &alwaysRecording_); + map->getValue(volumemicKey, &volumemic_); + map->getValue(volumespkrKey, &volumespkr_); + map->getValue(noiseReduceKey, &noisereduce_); + map->getValue(echoCancelKey, &echocancel_); Conf::MappingNode *alsamap =(Conf::MappingNode *)(map->getValue("alsa")); if (alsamap) { - alsamap->getValue(cardinKey, &_cardin); - alsamap->getValue(cardoutKey, &_cardout); - alsamap->getValue(cardringKey, &_cardring); - alsamap->getValue(smplrateKey, &_smplrate); - alsamap->getValue(pluginKey, &_plugin); + alsamap->getValue(cardinKey, &cardin_); + alsamap->getValue(cardoutKey, &cardout_); + alsamap->getValue(cardringKey, &cardring_); + alsamap->getValue(smplrateKey, &smplrate_); + alsamap->getValue(pluginKey, &plugin_); } Conf::MappingNode *pulsemap =(Conf::MappingNode *)(map->getValue("pulse")); if (pulsemap) { - pulsemap->getValue(devicePlaybackKey, &_devicePlayback); - pulsemap->getValue(deviceRecordKey, &_deviceRecord); - pulsemap->getValue(deviceRingtoneKey, &_deviceRingtone); + pulsemap->getValue(devicePlaybackKey, &devicePlayback_); + pulsemap->getValue(deviceRecordKey, &deviceRecord_); + pulsemap->getValue(deviceRingtoneKey, &deviceRingtone_); } } @@ -421,11 +412,11 @@ std::map<std::string, std::string> ShortcutPreferences::getShortcuts() const { std::map<std::string, std::string> shortcutsMap; - shortcutsMap[hangupShortKey] = _hangup; - shortcutsMap[pickupShortKey] = _pickup; - shortcutsMap[popupShortKey] = _popup; - shortcutsMap[toggleHoldShortKey] = _toggleHold; - shortcutsMap[togglePickupHangupShortKey] = _togglePickupHangup; + shortcutsMap[hangupShortKey] = hangup_; + shortcutsMap[pickupShortKey] = pickup_; + shortcutsMap[popupShortKey] = popup_; + shortcutsMap[toggleHoldShortKey] = toggleHold_; + shortcutsMap[togglePickupHangupShortKey] = togglePickupHangup_; return shortcutsMap; } @@ -433,11 +424,11 @@ std::map<std::string, std::string> ShortcutPreferences::getShortcuts() const void ShortcutPreferences::setShortcuts(std::map<std::string, std::string> map) { - _hangup = map[hangupShortKey]; - _pickup = map[pickupShortKey]; - _popup = map[popupShortKey]; - _toggleHold = map[toggleHoldShortKey]; - _togglePickupHangup = map[togglePickupHangupShortKey]; + hangup_ = map[hangupShortKey]; + pickup_ = map[pickupShortKey]; + popup_ = map[popupShortKey]; + toggleHold_ = map[toggleHoldShortKey]; + togglePickupHangup_ = map[togglePickupHangupShortKey]; } @@ -445,11 +436,11 @@ void ShortcutPreferences::serialize(Conf::YamlEmitter *emitter) { Conf::MappingNode preferencemap(NULL); - Conf::ScalarNode hangup(_hangup); - Conf::ScalarNode pickup(_pickup); - Conf::ScalarNode popup(_popup); - Conf::ScalarNode toggleHold(_toggleHold); - Conf::ScalarNode togglePickupHangup(_togglePickupHangup); + Conf::ScalarNode hangup(hangup_); + Conf::ScalarNode pickup(pickup_); + Conf::ScalarNode popup(popup_); + Conf::ScalarNode toggleHold(toggleHold_); + Conf::ScalarNode togglePickupHangup(togglePickupHangup_); preferencemap.setKeyValue(hangupShortKey, &hangup); preferencemap.setKeyValue(pickupShortKey, &pickup); @@ -467,9 +458,10 @@ void ShortcutPreferences::unserialize(Conf::MappingNode *map) return; } - map->getValue(hangupShortKey, &_hangup); - map->getValue(pickupShortKey, &_pickup); - map->getValue(popupShortKey, &_popup); - map->getValue(toggleHoldShortKey, &_toggleHold); - map->getValue(togglePickupHangupShortKey, &_togglePickupHangup); + map->getValue(hangupShortKey, &hangup_); + map->getValue(pickupShortKey, &pickup_); + map->getValue(popupShortKey, &popup_); + map->getValue(toggleHoldShortKey, &toggleHold_); + map->getValue(togglePickupHangupShortKey, &togglePickupHangup_); } + diff --git a/daemon/src/preferences.h b/daemon/src/preferences.h index a0381915f947f17e01ffd401d0c8abed93f3d05c..58892b0dd08956c6c540e1346d68157bbf034128 100644 --- a/daemon/src/preferences.h +++ b/daemon/src/preferences.h @@ -100,9 +100,7 @@ static const char * const togglePickupHangupShortKey = "togglePickupHangup"; class AudioLayer; class Preferences : public Serializable { - public: - static const char * const DFT_ZONE; Preferences(); @@ -111,95 +109,97 @@ class Preferences : public Serializable { virtual void unserialize(Conf::MappingNode *map); - - std::string getAccountOrder(void) const { - return _accountOrder; + std::string getAccountOrder() const { + return accountOrder_; } + void setAccountOrder(const std::string &ord) { - _accountOrder = ord; + accountOrder_ = ord; } - int getHistoryLimit(void) const { - return _historyLimit; + int getHistoryLimit() const { + return historyLimit_; } + void setHistoryLimit(int lim) { - _historyLimit = lim; + historyLimit_ = lim; } - int getHistoryMaxCalls(void) const { - return _historyMaxCalls; + int getHistoryMaxCalls() const { + return historyMaxCalls_; } + void setHistoryMaxCalls(int max) { - _historyMaxCalls = max; + historyMaxCalls_ = max; } - bool getNotifyMails(void) const { - return _notifyMails; + bool getNotifyMails() const { + return notifyMails_; } + void setNotifyMails(bool mails) { - _notifyMails = mails; + notifyMails_ = mails; } - std::string getZoneToneChoice(void) const { - return _zoneToneChoice; + std::string getZoneToneChoice() const { + return zoneToneChoice_; } + void setZoneToneChoice(const std::string &str) { - _zoneToneChoice = str; + zoneToneChoice_ = str; } - int getRegistrationExpire(void) const { - return _registrationExpire; + int getRegistrationExpire() const { + return registrationExpire_; } + void setRegistrationExpire(int exp) { - _registrationExpire = exp; + registrationExpire_ = exp; } - int getPortNum(void) const { - return _portNum; + int getPortNum() const { + return portNum_; } + void setPortNum(int port) { - _portNum = port; + portNum_ = port; } - bool getSearchBarDisplay(void) const { - return _searchBarDisplay; + bool getSearchBarDisplay() const { + return searchBarDisplay_; } + void setSearchBarDisplay(bool search) { - _searchBarDisplay = search; + searchBarDisplay_ = search; } - bool getZeroConfenable(void) const { - return _zeroConfenable; + bool getZeroConfenable() const { + return zeroConfenable_; } void setZeroConfenable(bool enable) { - _zeroConfenable = enable; + zeroConfenable_ = enable; } - bool getMd5Hash(void) const { - return _md5Hash; + bool getMd5Hash() const { + return md5Hash_; } void setMd5Hash(bool md5) { - _md5Hash = md5; + md5Hash_ = md5; } private: - - // account order - std::string _accountOrder; - - int _historyLimit; - int _historyMaxCalls; - bool _notifyMails; - std::string _zoneToneChoice; - int _registrationExpire; - int _portNum; - bool _searchBarDisplay; - bool _zeroConfenable; - bool _md5Hash; - + std::string accountOrder_; + int historyLimit_; + int historyMaxCalls_; + bool notifyMails_; + std::string zoneToneChoice_; + int registrationExpire_; + int portNum_; + bool searchBarDisplay_; + bool zeroConfenable_; + bool md5Hash_; }; - class VoipPreference : public Serializable { public: VoipPreference(); @@ -208,49 +208,51 @@ class VoipPreference : public Serializable { virtual void unserialize(Conf::MappingNode *map); - bool getPlayDtmf(void) const { - return _playDtmf; + bool getPlayDtmf() const { + return playDtmf_; } + void setPlayDtmf(bool dtmf) { - _playDtmf = dtmf; + playDtmf_ = dtmf; } - bool getPlayTones(void) const { - return _playTones; + bool getPlayTones() const { + return playTones_; } + void setPlayTones(bool tone) { - _playTones = tone; + playTones_ = tone; } - int getPulseLength(void) const { - return _pulseLength; + int getPulseLength() const { + return pulseLength_; } + void setPulseLength(int length) { - _pulseLength = length; + pulseLength_ = length; } - bool getSymmetricRtp(void) const { - return _symmetricRtp; + bool getSymmetricRtp() const { + return symmetricRtp_; } void setSymmetricRtp(bool sym) { - _symmetricRtp = sym; + symmetricRtp_ = sym; } - std::string getZidFile(void) const { - return _zidFile; + std::string getZidFile() const { + return zidFile_; } void setZidFile(const std::string &file) { - _zidFile = file; + zidFile_ = file; } private: - bool _playDtmf; - bool _playTones; - int _pulseLength; - bool _symmetricRtp; - std::string _zidFile; - + bool playDtmf_; + bool playTones_; + int pulseLength_; + bool symmetricRtp_; + std::string zidFile_; }; class AddressbookPreference : public Serializable { @@ -261,64 +263,69 @@ class AddressbookPreference : public Serializable { virtual void unserialize(Conf::MappingNode *map); - bool getPhoto(void) const { - return _photo; + bool getPhoto() const { + return photo_; } + void setPhoto(bool p) { - _photo = p; + photo_ = p; } - bool getEnabled(void) const { - return _enabled; + bool getEnabled() const { + return enabled_; } + void setEnabled(bool e) { - _enabled = e; + enabled_ = e; } - std::string getList(void) const { - return _list; + std::string getList() const { + return list_; } + void setList(const std::string &l) { - _list = l; + list_ = l; } - int getMaxResults(void) const { - return _maxResults; + int getMaxResults() const { + return maxResults_; } + void setMaxResults(int r) { - _maxResults = r; + maxResults_ = r; } - bool getBusiness(void) const { - return _business; + bool getBusiness() const { + return business_; } + void setBusiness(bool b) { - _business = b; + business_ = b; } - bool getHome(void) const { - return _home; + bool getHome() const { + return home_; } void setHone(bool h) { - _home = h; + home_ = h; } - bool getMobile(void) const { - return _mobile; + bool getMobile() const { + return mobile_; } void setMobile(bool m) { - _mobile = m; + mobile_ = m; } private: - bool _photo; - bool _enabled; - std::string _list; - int _maxResults; - bool _business; - bool _home; - bool _mobile; + bool photo_; + bool enabled_; + std::string list_; + int maxResults_; + bool business_; + bool home_; + bool mobile_; }; @@ -331,55 +338,59 @@ class HookPreference : public Serializable { virtual void unserialize(Conf::MappingNode *map); - bool getIax2Enabled(void) const { - return _iax2Enabled; + bool getIax2Enabled() const { + return iax2Enabled_; } + void setIax2Enabled(bool i) { - _iax2Enabled = i; + iax2Enabled_ = i; } - std::string getNumberAddPrefix(void) const { - return _numberAddPrefix; + std::string getNumberAddPrefix() const { + return numberAddPrefix_; } + void setNumberAddPrefix(const std::string &n) { - _numberAddPrefix = n; + numberAddPrefix_ = n; } - bool getNumberEnabled(void) const { - return _numberEnabled; + bool getNumberEnabled() const { + return numberEnabled_; } + void setNumberEnabled(bool n) { - _numberEnabled = n; + numberEnabled_ = n; } - bool getSipEnabled(void) const { - return _sipEnabled; + bool getSipEnabled() const { + return sipEnabled_; } + void setSipEnabled(bool s) { - _sipEnabled = s; + sipEnabled_ = s; } - std::string getUrlCommand(void) const { - return _urlCommand; + std::string getUrlCommand() const { + return urlCommand_; } void setUrlCommand(const std::string &u) { - _urlCommand = u; + urlCommand_ = u; } - std::string getUrlSipField(void) const { - return _urlSipField; + std::string getUrlSipField() const { + return urlSipField_; } void setUrlSipField(const std::string &u) { - _urlSipField = u; + urlSipField_ = u; } private: - bool _iax2Enabled;// : false - std::string _numberAddPrefix;//: false - bool _numberEnabled; //: false - bool _sipEnabled; //: false - std::string _urlCommand; //: x-www-browser - std::string _urlSipField; //: X-sflphone-url + bool iax2Enabled_; + std::string numberAddPrefix_; + bool numberEnabled_; + bool sipEnabled_; + std::string urlCommand_; + std::string urlSipField_; }; @@ -389,165 +400,168 @@ class AudioPreference : public Serializable { AudioLayer *createAudioLayer(); AudioLayer *switchAndCreateAudioLayer(); - std::string getAudioApi(void) const { - return _audioApi; + std::string getAudioApi() const { + return audioApi_; } void setAudioApi(const std::string &api) { - _audioApi = api; + audioApi_ = api; } + virtual void serialize(Conf::YamlEmitter *emitter); virtual void unserialize(Conf::MappingNode *map); // alsa preference - int getCardin(void) const { - return _cardin; + int getCardin() const { + return cardin_; } void setCardin(int c) { - _cardin = c; + cardin_ = c; } - int getCardout(void) const { - return _cardout; + int getCardout() const { + return cardout_; } + void setCardout(int c) { - _cardout = c; + cardout_ = c; } - int getCardring(void) const { - return _cardring; + int getCardring() const { + return cardring_; } + void setCardring(int c) { - _cardring = c; + cardring_ = c; } - std::string getPlugin(void) const { - return _plugin; + std::string getPlugin() const { + return plugin_; } void setPlugin(const std::string &p) { - _plugin = p; + plugin_ = p; } - int getSmplrate(void) const { - return _smplrate; + int getSmplrate() const { + return smplrate_; } void setSmplrate(int r) { - _smplrate = r; + smplrate_ = r; } //pulseaudio preference - std::string getDevicePlayback(void) const { - return _devicePlayback; + std::string getDevicePlayback() const { + return devicePlayback_; } void setDevicePlayback(const std::string &p) { - _devicePlayback = p; + devicePlayback_ = p; } - std::string getDeviceRecord(void) const { - return _deviceRecord; + std::string getDeviceRecord() const { + return deviceRecord_; } void setDeviceRecord(const std::string &r) { - _deviceRecord = r; + deviceRecord_ = r; } - std::string getDeviceRingtone(void) const { - return _deviceRingtone; + std::string getDeviceRingtone() const { + return deviceRingtone_; } void setDeviceRingtone(const std::string &r) { - _deviceRingtone = r; + deviceRingtone_ = r; } // general preference - std::string getRecordpath(void) const { - return _recordpath; + std::string getRecordpath() const { + return recordpath_; } void setRecordpath(const std::string &r) { - _recordpath = r; + recordpath_ = r; } - bool getIsAlwaysRecording(void) const { - return _alwaysRecording; + bool getIsAlwaysRecording() const { + return alwaysRecording_; } void setIsAlwaysRecording(bool rec) { - _alwaysRecording = rec; + alwaysRecording_ = rec; } - int getVolumemic(void) const { - return _volumemic; + int getVolumemic() const { + return volumemic_; } void setVolumemic(int m) { - _volumemic = m; + volumemic_ = m; } - int getVolumespkr(void) const { - return _volumespkr; + int getVolumespkr() const { + return volumespkr_; } void setVolumespkr(int s) { - _volumespkr = s; + volumespkr_ = s; } - bool getNoiseReduce(void) const { - return _noisereduce; + bool getNoiseReduce() const { + return noisereduce_; } void setNoiseReduce(bool noise) { - _noisereduce = noise; + noisereduce_ = noise; } - bool getEchoCancel(void) const { - return _echocancel; + bool getEchoCancel() const { + return echocancel_; } void setEchoCancel(bool echo) { - _echocancel = echo; + echocancel_ = echo; } - int getEchoCancelTailLength(void) const { - return _echoCancelTailLength; + int getEchoCancelTailLength() const { + return echoCancelTailLength_; } void setEchoCancelTailLength(int length) { - _echoCancelTailLength = length; + echoCancelTailLength_ = length; } - int getEchoCancelDelay(void) const { - return _echoCancelDelay; + int getEchoCancelDelay() const { + return echoCancelDelay_; } void setEchoCancelDelay(int delay) { - _echoCancelDelay = delay; + echoCancelDelay_ = delay; } private: - std::string _audioApi; + std::string audioApi_; // alsa preference - int _cardin; // 0 - int _cardout; // 0 - int _cardring;// 0 - std::string _plugin; // default - int _smplrate;// 44100 + int cardin_; + int cardout_; + int cardring_; + std::string plugin_; + int smplrate_; //pulseaudio preference - std::string _devicePlayback;//: - std::string _deviceRecord; //: - std::string _deviceRingtone; //: + std::string devicePlayback_; + std::string deviceRecord_; + std::string deviceRingtone_; // general preference - std::string _recordpath; //: /home/msavard/Bureau - bool _alwaysRecording; - int _volumemic; //: 100 - int _volumespkr; //: 100 - - bool _noisereduce; - bool _echocancel; - int _echoCancelTailLength; - int _echoCancelDelay; + std::string recordpath_; //: /home/msavard/Bureau + bool alwaysRecording_; + int volumemic_; + int volumespkr_; + + bool noisereduce_; + bool echocancel_; + int echoCancelTailLength_; + int echoCancelDelay_; }; class ShortcutPreferences : public Serializable { @@ -556,49 +570,54 @@ class ShortcutPreferences : public Serializable { virtual void unserialize(Conf::MappingNode *map); void setShortcuts(std::map<std::string, std::string> shortcuts); - std::map<std::string, std::string> getShortcuts(void) const; + std::map<std::string, std::string> getShortcuts() const; - std::string getHangup(void) const { - return _hangup; + std::string getHangup() const { + return hangup_; } + void setHangup(const std::string &hangup) { - _hangup = hangup; + hangup_ = hangup; } - std::string getPickup(void) const { - return _pickup; + std::string getPickup() const { + return pickup_; } + void setPickup(const std::string &pickup) { - _pickup = pickup; + pickup_ = pickup; } - std::string getPopup(void) const { - return _popup; + std::string getPopup() const { + return popup_; } + void setPopup(const std::string &popup) { - _popup = popup; + popup_ = popup; } - std::string getToggleHold(void) const { - return _toggleHold; + std::string getToggleHold() const { + return toggleHold_; } + void setToggleHold(std::string hold) { - _toggleHold = hold; + toggleHold_ = hold; } - std::string getTogglePickupHangup(void) const { - return _togglePickupHangup; + std::string getTogglePickupHangup() const { + return togglePickupHangup_; } + void setTogglePickupHangup(const std::string &toggle) { - _togglePickupHangup = toggle; + togglePickupHangup_ = toggle; } private: - std::string _hangup; - std::string _pickup; - std::string _popup; - std::string _toggleHold; - std::string _togglePickupHangup; + std::string hangup_; + std::string pickup_; + std::string popup_; + std::string toggleHold_; + std::string togglePickupHangup_; }; #endif