Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
jami-daemon
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
savoirfairelinux
jami-daemon
Commits
1bce9bf8
Commit
1bce9bf8
authored
11 years ago
by
Tristan Matthews
Browse files
Options
Downloads
Patches
Plain Diff
preferences: clamp only needs to have function scope
parent
97d80491
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
daemon/src/preferences.cpp
+5
-7
5 additions, 7 deletions
daemon/src/preferences.cpp
with
5 additions
and
7 deletions
daemon/src/preferences.cpp
+
5
−
7
View file @
1bce9bf8
...
...
@@ -436,13 +436,6 @@ AudioPreference::setRecordPath(const std::string &r)
}
}
namespace
{
double
clamp
(
double
min
,
double
max
,
double
val
)
{
return
std
::
min
(
max
,
std
::
max
(
min
,
val
));
}
}
void
AudioPreference
::
unserialize
(
const
Conf
::
YamlNode
&
map
)
{
map
.
getValue
(
AUDIO_API_KEY
,
&
audioApi_
);
...
...
@@ -454,6 +447,11 @@ void AudioPreference::unserialize(const Conf::YamlNode &map)
map
.
getValue
(
ALWAYS_RECORDING_KEY
,
&
alwaysRecording_
);
map
.
getValue
(
VOLUMEMIC_KEY
,
&
volumemic_
);
const
auto
clamp
=
[]
(
double
min
,
double
max
,
double
val
)
{
return
std
::
min
(
max
,
std
::
max
(
min
,
val
));
};
volumemic_
=
clamp
(
-
1.0
,
1.0
,
volumemic_
);
map
.
getValue
(
VOLUMESPKR_KEY
,
&
volumespkr_
);
volumespkr_
=
clamp
(
-
1.0
,
1.0
,
volumespkr_
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment