projects
/
ardour.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
fa828e0
)
add clamp for adding points to a ControlList from a (G)UI
author
Paul Davis
<paul@linuxaudiosystems.com>
Mon, 9 Jan 2017 12:42:08 +0000
(12:42 +0000)
committer
Paul Davis
<paul@linuxaudiosystems.com>
Mon, 9 Jan 2017 12:42:08 +0000
(12:42 +0000)
libs/evoral/src/ControlList.cpp
patch
|
blob
|
history
diff --git
a/libs/evoral/src/ControlList.cpp
b/libs/evoral/src/ControlList.cpp
index f952b9c5198ca6dfaf0b2d1168209296d29b1b22..0b2184a97280f3181b8a754b21c1e017730a546c 100644
(file)
--- a/
libs/evoral/src/ControlList.cpp
+++ b/
libs/evoral/src/ControlList.cpp
@@
-492,6
+492,11
@@
ControlList::editor_add (double when, double value, bool with_guard)
maybe_add_insert_guard (when);
}
+ /* clamp new value to allowed range */
+
+ value = max (_min_yval, value);
+ value = min (_max_yval, value);
+
iterator result;
DEBUG_TRACE (DEBUG::ControlList, string_compose ("editor_add: actually add when= %1 value= %2\n", when, value));
result = _events.insert (i, new ControlEvent (when, value));