Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
savoirfairelinux
jami-daemon
Commits
117ccab6
Commit
117ccab6
authored
Oct 12, 2011
by
Tristan Matthews
Browse files
* #7131: removed leading underscores from preferences
parent
51bedb8e
Changes
5
Hide whitespace changes
Inline
Side-by-side
daemon/src/conference.h
View file @
117ccab6
...
...
@@ -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
};
...
...
daemon/src/eventthread.h
View file @
117ccab6
...
...
@@ -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_
;
};
...
...
daemon/src/fileutils.h
View file @
117ccab6
...
...
@@ -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__
daemon/src/preferences.cpp
View file @
117ccab6
...
...
@@ -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
,
&
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
_
);
}
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
_
);
}
daemon/src/preferences.h
View file @
117ccab6
...
...
@@ -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
{